diff --git a/programs/regedit/regproc.c b/programs/regedit/regproc.c index 2cd187b604c..fe6fa8aea9a 100644 --- a/programs/regedit/regproc.c +++ b/programs/regedit/regproc.c @@ -30,14 +30,11 @@ #define REG_VAL_BUF_SIZE 4096 -/* Delimiters used to parse the "value" to query queryValue*/ -#define QUERY_VALUE_MAX_ARGS 1 - /* maximal number of characters in hexadecimal data line, not including '\' character */ #define REG_FILE_HEX_LINE_LEN 76 -/* Globals used by the api setValue, queryValue */ +/* Globals used by the api setValue */ static LPSTR currentKeyName = NULL; static HKEY currentKeyClass = 0; static HKEY currentKeyHandle = 0; @@ -175,55 +172,6 @@ DWORD convertHexToDWord(char *str, BYTE *buf) return sizeof(DWORD); } -/****************************************************************************** - * Converts a hex buffer into a hex comma separated values - */ -char* convertHexToHexCSV(BYTE *buf, ULONG bufLen) -{ - char* str; - char* ptrStr; - BYTE* ptrBuf; - - ULONG current = 0; - - str = HeapAlloc(GetProcessHeap(), 0, (bufLen+1)*2); - memset(str, 0, (bufLen+1)*2); - ptrStr = str; /* Pointer to result */ - ptrBuf = buf; /* Pointer to current */ - - while (current < bufLen) { - BYTE bCur = ptrBuf[current++]; - char res[3]; - - sprintf(res, "%02x", (unsigned int)*&bCur); - strcat(str, res); - strcat(str, ","); - } - - /* Get rid of the last comma */ - str[strlen(str)-1] = '\0'; - return str; -} - -/****************************************************************************** - * Converts a hex buffer into a DWORD string - */ -char* convertHexToDWORDStr(BYTE *buf, ULONG bufLen) -{ - char* str; - DWORD dw; - - if ( bufLen != sizeof(DWORD) ) return NULL; - - str = HeapAlloc(GetProcessHeap(), 0, (bufLen*2)+1); - - memcpy(&dw,buf,sizeof(DWORD)); - sprintf(str, "%08x", dw); - - /* Get rid of the last comma */ - return str; -} - /****************************************************************************** * Converts a hex comma separated values list into a hex list. * The Hex input string must be in exactly the correct form. @@ -611,44 +559,6 @@ void doSetValue(LPSTR stdInput) } } -/****************************************************************************** - * This function is the main entry point to the queryValue type of action. It - * receives the currently read line and dispatch the work depending on the - * context. - */ -void doQueryValue(LPSTR stdInput) -{ - /* - * We encountered the end of the file, make sure we - * close the opened key and exit - */ - if (stdInput == NULL) { - if (bTheKeyIsOpen != FALSE) - closeKey(); - - return; - } - - if ( stdInput[0] == '[') /* We are reading a new key */ - { - if ( bTheKeyIsOpen != FALSE ) - closeKey(); /* Close the previous key before */ - - if ( openKey(stdInput) != ERROR_SUCCESS ) - fprintf(stderr,"%s: queryValue failed to open key %s\n", - getAppName(), stdInput); - } else if( ( bTheKeyIsOpen ) && - (( stdInput[0] == '@') || /* reading a default @=data pair */ - ( stdInput[0] == '\"'))) /* reading a new value=data pair */ - { - processQueryValue(stdInput); - } else /* since we are assuming that the */ - { /* file format is valid we must */ - if ( bTheKeyIsOpen ) /* be reading a blank line which */ - closeKey(); /* indicate end of this key processing */ - } -} - /****************************************************************************** * This function is the main entry point to the deleteValue type of action. It * receives the currently read line and dispatch the work depending on the @@ -740,135 +650,6 @@ void processSetValue(LPSTR line) val_data); } -/****************************************************************************** - * This function is a wrapper for the queryValue function. It prepares the - * land and clean the area once completed. - */ -void processQueryValue(LPSTR cmdline) -{ - fprintf(stderr,"ERROR!!! - temporary disabled"); - exit(1); -#if 0 - LPSTR argv[QUERY_VALUE_MAX_ARGS];/* args storage */ - LPSTR token = NULL; /* current token analyzed */ - ULONG argCounter = 0; /* counter of args */ - INT counter; - HRESULT hRes = 0; - LPSTR keyValue = NULL; - LPSTR lpsRes = NULL; - - /* - * Init storage and parse the line - */ - for (counter=0; counter