Sync with trunk head
[reactos.git] / base / applications / regedit / regproc.h
1 /*
2 * Copyright 1999 Sylvain St-Germain
3 * Copyright 2002 Andriy Palamarchuk
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19
20 /******************************************************************************
21 * Defines and consts
22 */
23 #define KEY_MAX_LEN 1024
24
25 /* Return values */
26 #define SUCCESS 0
27 #define KEY_VALUE_ALREADY_SET 2
28
29 extern HINSTANCE hInst;
30
31 typedef void (*CommandAPI)(LPSTR lpsLine);
32
33 void doSetValue(LPSTR lpsLine);
34 void doDeleteValue(LPSTR lpsLine);
35 void doCreateKey(LPSTR lpsLine);
36 void doDeleteKey(LPSTR lpsLine);
37 void doRegisterDLL(LPSTR lpsLine);
38 void doUnregisterDLL(LPSTR lpsLine);
39
40 BOOL export_registry_key(const TCHAR *file_name, CHAR *reg_key_name);
41 BOOL import_registry_file(LPTSTR filename);
42 void delete_registry_key(CHAR *reg_key_name);
43
44 void setAppName(const CHAR *name);
45 const CHAR *getAppName(void);
46
47 void processRegLines(FILE *in, CommandAPI command);
48
49 /*
50 * Generic prototypes
51 */
52 char* getToken(char** str, const char* delims);
53 void get_file_name(CHAR **command_line, CHAR *filename);
54 LPSTR convertHexToHexCSV( BYTE *buf, ULONG len);
55 LPSTR convertHexToDWORDStr( BYTE *buf, ULONG len);
56 LPSTR getRegKeyName(LPSTR lpLine);
57 BOOL getRegClass(LPSTR lpLine, HKEY* hkey);
58 DWORD getDataType(LPSTR *lpValue, DWORD* parse_type);
59 LPSTR getArg(LPSTR arg);
60 HRESULT openKey(LPSTR stdInput);
61 void closeKey(void);
62
63 /*
64 * api setValue prototypes
65 */
66 void processSetValue(LPSTR cmdline);
67 HRESULT setValue(LPSTR val_name, LPSTR val_data);
68
69 /*
70 * Permission prototypes
71 */
72
73 BOOL InitializeAclUiDll(VOID);
74 VOID UnloadAclUiDll(VOID);
75 BOOL RegKeyEditPermissions(HWND hWndOwner, HKEY hKey, LPCTSTR lpMachine, LPCTSTR lpKeyName);
76
77 /*
78 * Processing
79 */
80 LONG RegCopyKey(HKEY hDestKey, LPCTSTR lpDestSubKey, HKEY hSrcKey, LPCTSTR lpSrcSubKey);
81 LONG RegMoveKey(HKEY hDestKey, LPCTSTR lpDestSubKey, HKEY hSrcKey, LPCTSTR lpSrcSubKey);
82 LONG RegRenameKey(HKEY hKey, LPCTSTR lpSubKey, LPCTSTR lpNewName);
83 LONG RegRenameValue(HKEY hKey, LPCTSTR lpSubKey, LPCTSTR lpDestValue, LPCTSTR lpSrcValue);
84 LONG RegQueryStringValue(HKEY hKey, LPCTSTR lpSubKey, LPCTSTR lpValueName, LPTSTR pszBuffer, DWORD dwBufferLen);
85
86 /*
87 * Miscellaneous
88 */
89 #define RSF_WHOLESTRING 0x00000001
90 #define RSF_LOOKATKEYS 0x00000002
91 #define RSF_LOOKATVALUES 0x00000004
92 #define RSF_LOOKATDATA 0x00000008
93 #define RSF_MATCHCASE 0x00010000
94
95 LONG RegSearch(HKEY hKey, LPTSTR lpSubKey, size_t iSubKeyLength,
96 LPCTSTR pszSearchString, DWORD dwValueIndex,
97 DWORD dwSearchFlags, BOOL (*pfnCallback)(LPVOID), LPVOID lpParam);
98
99 BOOL RegKeyGetName(LPTSTR pszDest, size_t iDestLength, HKEY hRootKey, LPCTSTR lpSubKey);
100
101 /* EOF */