regproc.h 2.37 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
/*
 * 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
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

/******************************************************************************
 * Defines and consts
 */
23
#define KEY_MAX_LEN             1024
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38

/* Return values */
#define SUCCESS               0
#define KEY_VALUE_ALREADY_SET 2

typedef void (*CommandAPI)(LPSTR lpsLine);

void doSetValue(LPSTR lpsLine);
void doDeleteValue(LPSTR lpsLine);
void doCreateKey(LPSTR lpsLine);
void doDeleteKey(LPSTR lpsLine);
void doQueryValue(LPSTR lpsLine);
void doRegisterDLL(LPSTR lpsLine);
void doUnregisterDLL(LPSTR lpsLine);

39 40
BOOL export_registry_key(CHAR *file_name, CHAR *reg_key_name);
BOOL import_registry_file(LPTSTR filename);
41 42
void delete_registry_key(CHAR *reg_key_name);

43
void setAppName(const CHAR *name);
44
const CHAR *getAppName(void);
45 46 47

void processRegLines(FILE *in, CommandAPI command);

48
/*
49 50 51
 * Generic prototypes
 */
char*   getToken(char** str, const char* delims);
52
void    get_file_name(CHAR **command_line, CHAR *filename);
53 54 55 56 57 58 59 60 61
DWORD   convertHexToDWord(char *str, BYTE *buf);
DWORD   convertHexCSVToHex(char *str, BYTE *buf, ULONG bufLen);
LPSTR   convertHexToHexCSV( BYTE *buf, ULONG len);
LPSTR   convertHexToDWORDStr( BYTE *buf, ULONG len);
LPSTR   getRegKeyName(LPSTR lpLine);
HKEY    getRegClass(LPSTR lpLine);
DWORD   getDataType(LPSTR *lpValue, DWORD* parse_type);
LPSTR   getArg(LPSTR arg);
HRESULT openKey(LPSTR stdInput);
62
void    closeKey(void);
63

64
/*
65 66 67 68 69
 * api setValue prototypes
 */
void    processSetValue(LPSTR cmdline);
HRESULT setValue(LPSTR val_name, LPSTR val_data);

70
/*
71 72 73
 * api queryValue prototypes
 */
void    processQueryValue(LPSTR cmdline);
74 75

extern BOOL ProcessCmdLine(LPSTR lpCmdLine);