2 * Copyright 1999 Sylvain St-Germain
3 * Copyright 2002 Andriy Palamarchuk
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.
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.
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 /******************************************************************************
23 #define KEY_MAX_LEN 1024
27 #define KEY_VALUE_ALREADY_SET 2
29 typedef void (*CommandAPI)(LPTSTR lpsLine);
31 void doSetValue(LPTSTR lpsLine);
32 void doDeleteValue(LPTSTR lpsLine);
33 void doCreateKey(LPTSTR lpsLine);
34 void doDeleteKey(LPTSTR lpsLine);
35 void doQueryValue(LPTSTR lpsLine);
36 void doRegisterDLL(LPTSTR lpsLine);
37 void doUnregisterDLL(LPTSTR lpsLine);
39 BOOL export_registry_key(TCHAR* file_name, TCHAR* reg_key_name);
40 BOOL import_registry_file(LPTSTR filename);
41 void delete_registry_key(TCHAR* reg_key_name);
43 void processRegLines(FILE* in, CommandAPI command);
49 #define get_file_name get_file_nameW
51 #define get_file_name get_file_nameA
54 char* getToken(char** str, const char* delims);
55 void get_file_nameA(CHAR** command_line, CHAR* filename, int max_filename);
56 void get_file_nameW(CHAR** command_line, WCHAR* filename, int max_filename);
57 DWORD convertHexToDWord(TCHAR* str, BYTE* buf);
58 DWORD convertHexCSVToHex(TCHAR* str, BYTE* buf, ULONG bufLen);
59 LPTSTR convertHexToHexCSV(BYTE* buf, ULONG len);
60 LPTSTR convertHexToDWORDStr(BYTE* buf, ULONG len);
61 LPTSTR getRegKeyName(LPTSTR lpLine);
62 HKEY getRegClass(LPTSTR lpLine);
63 DWORD getDataType(LPTSTR* lpValue, DWORD* parse_type);
64 LPTSTR getArg(LPTSTR arg);
65 HRESULT openKey(LPTSTR stdInput);
69 * api setValue prototypes
71 void processSetValue(LPTSTR cmdline);
72 HRESULT setValue(LPTSTR val_name, LPTSTR val_data);
75 * api queryValue prototypes
77 void processQueryValue(LPTSTR cmdline);
81 //typedef UINT_PTR SIZE_T, *PSIZE_T;
82 //#define _MAX_PATH 260 /* max. length of full pathname */
83 #endif /*WIN32_REGDBG*/
86 #define _tfopen _wfopen
94 HANDLE hHeap, // handle to private heap block
95 DWORD dwFlags, // heap allocation control
96 SIZE_T dwBytes // number of bytes to allocate
99 LPVOID RegHeapReAlloc(
100 HANDLE hHeap, // handle to heap block
101 DWORD dwFlags, // heap reallocation options
102 LPVOID lpMem, // pointer to memory to reallocate
103 SIZE_T dwBytes // number of bytes to reallocate
107 HANDLE hHeap, // handle to heap
108 DWORD dwFlags, // heap free options
109 LPVOID lpMem // pointer to memory