2003-08-22 05:55:14 +00:00
|
|
|
/*
|
|
|
|
* Copyright 1999 Sylvain St-Germain
|
|
|
|
* Copyright 2002 Andriy Palamarchuk
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
2009-10-27 10:34:16 +00:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
2003-08-22 05:55:14 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
* Defines and consts
|
|
|
|
*/
|
|
|
|
#define KEY_MAX_LEN 1024
|
|
|
|
|
|
|
|
/* Return values */
|
|
|
|
#define SUCCESS 0
|
|
|
|
#define KEY_VALUE_ALREADY_SET 2
|
|
|
|
|
2004-07-10 23:25:17 +00:00
|
|
|
extern HINSTANCE hInst;
|
|
|
|
|
2003-08-22 05:55:14 +00:00
|
|
|
typedef void (*CommandAPI)(LPSTR lpsLine);
|
|
|
|
|
|
|
|
void doSetValue(LPSTR lpsLine);
|
|
|
|
void doDeleteValue(LPSTR lpsLine);
|
|
|
|
void doCreateKey(LPSTR lpsLine);
|
|
|
|
void doDeleteKey(LPSTR lpsLine);
|
|
|
|
void doRegisterDLL(LPSTR lpsLine);
|
|
|
|
void doUnregisterDLL(LPSTR lpsLine);
|
|
|
|
|
2005-10-04 02:40:01 +00:00
|
|
|
BOOL export_registry_key(const TCHAR *file_name, CHAR *reg_key_name);
|
2005-09-25 16:56:52 +00:00
|
|
|
BOOL import_registry_file(LPTSTR filename);
|
2003-08-22 05:55:14 +00:00
|
|
|
void delete_registry_key(CHAR *reg_key_name);
|
|
|
|
|
2005-09-25 16:56:52 +00:00
|
|
|
void setAppName(const CHAR *name);
|
|
|
|
const CHAR *getAppName(void);
|
2003-08-22 05:55:14 +00:00
|
|
|
|
|
|
|
void processRegLines(FILE *in, CommandAPI command);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Generic prototypes
|
|
|
|
*/
|
|
|
|
char* getToken(char** str, const char* delims);
|
2004-01-01 15:12:11 +00:00
|
|
|
void get_file_name(CHAR **command_line, CHAR *filename);
|
2003-08-22 05:55:14 +00:00
|
|
|
LPSTR convertHexToHexCSV( BYTE *buf, ULONG len);
|
|
|
|
LPSTR convertHexToDWORDStr( BYTE *buf, ULONG len);
|
|
|
|
LPSTR getRegKeyName(LPSTR lpLine);
|
2007-12-08 14:29:51 +00:00
|
|
|
BOOL getRegClass(LPSTR lpLine, HKEY* hkey);
|
2003-08-22 05:55:14 +00:00
|
|
|
DWORD getDataType(LPSTR *lpValue, DWORD* parse_type);
|
|
|
|
LPSTR getArg(LPSTR arg);
|
|
|
|
HRESULT openKey(LPSTR stdInput);
|
2005-09-25 16:56:52 +00:00
|
|
|
void closeKey(void);
|
2003-08-22 05:55:14 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* api setValue prototypes
|
|
|
|
*/
|
|
|
|
void processSetValue(LPSTR cmdline);
|
|
|
|
HRESULT setValue(LPSTR val_name, LPSTR val_data);
|
|
|
|
|
2004-07-10 23:25:17 +00:00
|
|
|
/*
|
|
|
|
* Permission prototypes
|
|
|
|
*/
|
|
|
|
|
|
|
|
BOOL InitializeAclUiDll(VOID);
|
|
|
|
VOID UnloadAclUiDll(VOID);
|
|
|
|
BOOL RegKeyEditPermissions(HWND hWndOwner, HKEY hKey, LPCTSTR lpMachine, LPCTSTR lpKeyName);
|
|
|
|
|
2005-09-22 20:54:20 +00:00
|
|
|
/*
|
|
|
|
* Processing
|
|
|
|
*/
|
|
|
|
LONG RegCopyKey(HKEY hDestKey, LPCTSTR lpDestSubKey, HKEY hSrcKey, LPCTSTR lpSrcSubKey);
|
|
|
|
LONG RegMoveKey(HKEY hDestKey, LPCTSTR lpDestSubKey, HKEY hSrcKey, LPCTSTR lpSrcSubKey);
|
|
|
|
LONG RegRenameKey(HKEY hKey, LPCTSTR lpSubKey, LPCTSTR lpNewName);
|
|
|
|
LONG RegRenameValue(HKEY hKey, LPCTSTR lpSubKey, LPCTSTR lpDestValue, LPCTSTR lpSrcValue);
|
2005-10-05 13:25:14 +00:00
|
|
|
LONG RegQueryStringValue(HKEY hKey, LPCTSTR lpSubKey, LPCTSTR lpValueName, LPTSTR pszBuffer, DWORD dwBufferLen);
|
2005-09-22 20:54:20 +00:00
|
|
|
|
2005-10-02 01:21:43 +00:00
|
|
|
/*
|
|
|
|
* Miscellaneous
|
|
|
|
*/
|
2005-11-27 23:23:38 +00:00
|
|
|
#define RSF_WHOLESTRING 0x00000001
|
|
|
|
#define RSF_LOOKATKEYS 0x00000002
|
|
|
|
#define RSF_LOOKATVALUES 0x00000004
|
|
|
|
#define RSF_LOOKATDATA 0x00000008
|
|
|
|
#define RSF_MATCHCASE 0x00010000
|
|
|
|
|
|
|
|
LONG RegSearch(HKEY hKey, LPTSTR lpSubKey, size_t iSubKeyLength,
|
2007-10-19 23:21:45 +00:00
|
|
|
LPCTSTR pszSearchString, DWORD dwValueIndex,
|
2005-11-27 23:23:38 +00:00
|
|
|
DWORD dwSearchFlags, BOOL (*pfnCallback)(LPVOID), LPVOID lpParam);
|
|
|
|
|
2005-10-02 01:21:43 +00:00
|
|
|
BOOL RegKeyGetName(LPTSTR pszDest, size_t iDestLength, HKEY hRootKey, LPCTSTR lpSubKey);
|
|
|
|
|
2004-07-10 23:25:17 +00:00
|
|
|
/* EOF */
|