Changeset 6565 for trunk/tools/regedit/regapi.c
- Timestamp:
- Aug 19, 2001, 4:04:44 PM (24 years ago)
- File:
-
- 1 edited
-
trunk/tools/regedit/regapi.c (modified) (18 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/regedit/regapi.c
r3424 r6565 9 9 10 10 #include <stdio.h> 11 #include < malloc.h>11 #include <stdlib.h> 12 12 #include <windows.h> 13 13 #include <winreg.h> … … 15 15 #include <winnt.h> 16 16 #include <string.h> 17 #include <shell.h>18 17 19 18 #ifdef __WIN32OS2__ … … 26 25 { 27 26 char *ret = strchr(*string, *token); 27 char *ret1; 28 28 29 29 if(ret) { … … 31 31 ret++; 32 32 (*string) = ret; 33 ret1 = strchr(ret, *token); 34 if(ret1) *ret1 = 0; 33 35 } 34 36 return ret; … … 121 123 122 124 /* 123 * currentsupported api125 * Currently supported api 124 126 */ 125 127 static const char* commandNames[COMMAND_COUNT] = { … … 160 162 161 163 /* 162 * Generic prototy es163 */ 164 static HKEYgetDataType(LPSTR *lpValue);164 * Generic prototypes 165 */ 166 static DWORD getDataType(LPSTR *lpValue); 165 167 static LPSTR getRegKeyName(LPSTR lpLine); 166 168 static HKEY getRegClass(LPSTR lpLine); … … 190 192 static char helpText[] = 191 193 "NAME\n" 192 " regapi - p rovide a command line interface tothe wine registry.\n"194 " regapi - perform certain actions on the wine registry.\n" 193 195 "\n" 194 196 "SYNOPSIS\n" … … 196 198 "\n" 197 199 "DESCRIPTION\n" 198 " regapi allows editing the wine registry. It processes the given\n" 199 " commandName for every line in the stdin data stream. Input data\n" 200 " format may vary depending on the commandName see INPUT FILE FORMAT.\n" 200 " regapi modifies settings in the wine registry. It processes\n" 201 " the given commandName for every line in the stdin data stream.\n" 202 " Input data format may vary depending on the commandName\n" 203 " (see INPUT FILE FORMAT).\n" 201 204 "\n" 202 205 "OPTIONS\n" … … 251 254 /****************************************************************************** 252 255 * This function returns the HKEY associated with the data type encoded in the 253 * value. It modif ythe input parameter (key value) in order to skip this256 * value. It modifies the input parameter (key value) in order to skip this 254 257 * "now useless" data type information. 255 258 */ 256 HKEYgetDataType(LPSTR *lpValue)259 DWORD getDataType(LPSTR *lpValue) 257 260 { 258 261 INT counter = 0; … … 305 308 /****************************************************************************** 306 309 * Extracts from a [HKEY/some/key/path] type of line the key class (what 307 * starts after the '[' and end before the first '\'310 * starts after the '[' and ends before the first '\' 308 311 */ 309 312 static HKEY getRegClass(LPSTR lpClass) … … 315 318 316 319 if (lpClass == NULL) 317 return ERROR_INVALID_PARAMETER;320 return (HKEY)ERROR_INVALID_PARAMETER; 318 321 319 322 strcpy(lpClassCopy, lpClass); 320 323 321 324 classNameEnd = strstr(lpClassCopy, "\\"); /* The class name end by '\' */ 322 if(classNameEnd) 323 *classNameEnd = '\0'; /* Isolate the class name */ 324 325 *classNameEnd = '\0'; /* Isolate the class name */ 325 326 classNameBeg = &lpClassCopy[1]; /* Skip the '[' */ 326 327 … … 336 337 return HKEY_CURRENT_USER; 337 338 else 338 return ERROR_INVALID_PARAMETER;339 return (HKEY)ERROR_INVALID_PARAMETER; 339 340 } 340 341 … … 615 616 /* Get the registry class */ 616 617 currentKeyClass = getRegClass(stdInput); /* Sets global variable */ 617 if (currentKeyClass == ERROR_INVALID_PARAMETER)618 return ERROR_INVALID_PARAMETER;618 if (currentKeyClass == (HKEY)ERROR_INVALID_PARAMETER) 619 return (HRESULT)ERROR_INVALID_PARAMETER; 619 620 620 621 /* Get the key name */ … … 642 643 } 643 644 /****************************************************************************** 644 * This function is a wrapper arroundthe setValue function. It prepares the645 * This function is a wrapper for the setValue function. It prepares the 645 646 * land and clean the area once completed. 646 647 */ … … 660 661 argv[counter]=NULL; 661 662 662 #ifdef __WIN32OS2__663 if(*cmdline == '"') cmdline++;664 argv[0] = cmdline;665 token = strsep(&cmdline, setValueDelim[argCounter]);666 if(token && *(token-2) == '"') {667 *(token-2) = 0;668 }669 argv[1] = getArg(token);670 #else671 663 while( (token = strsep(&cmdline, setValueDelim[argCounter])) != NULL ) 672 664 { … … 676 668 break; /* Stop processing args no matter what */ 677 669 } 678 #endif679 670 680 671 hRes = setValue(argv); … … 708 699 709 700 /****************************************************************************** 710 * This function is a wrapper arroundthe queryValue function. It prepares the701 * This function is a wrapper for the queryValue function. It prepares the 711 702 * land and clean the area once completed. 712 703 */ … … 1030 1021 1031 1022 /****************************************************************************** 1032 * MAIN - The main simply validatethe first parameter (command to perform)1033 * It then read the STDIN lines by lines forwarding their processing1023 * MAIN - WinMain simply validates the first parameter (command to perform) 1024 * It then reads the STDIN lines by lines forwarding their processing 1034 1025 * to the appropriate method. 1035 1026 */ 1036 int PASCAL WinMain (H ANDLE inst, HANDLE prev, LPSTR cmdline, int show)1027 int PASCAL WinMain (HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show) 1037 1028 { 1038 1029 LPSTR token = NULL; /* current token analized */
Note:
See TracChangeset
for help on using the changeset viewer.
