Ignore:
Timestamp:
Aug 19, 2001, 4:04:44 PM (24 years ago)
Author:
sandervl
Message:

updates

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/regedit/regapi.c

    r3424 r6565  
    99
    1010#include <stdio.h>
    11 #include <malloc.h>
     11#include <stdlib.h>
    1212#include <windows.h>
    1313#include <winreg.h>
     
    1515#include <winnt.h>
    1616#include <string.h>
    17 #include <shell.h>
    1817
    1918#ifdef __WIN32OS2__
     
    2625{
    2726  char *ret = strchr(*string, *token);
     27  char *ret1;
    2828
    2929   if(ret) {
     
    3131        ret++;
    3232        (*string) = ret;
     33        ret1 = strchr(ret, *token);
     34        if(ret1) *ret1 = 0;
    3335   }
    3436   return ret;
     
    121123
    122124/*
    123  * current supported api
     125 * Currently supported api
    124126 */
    125127static const char* commandNames[COMMAND_COUNT] = {
     
    160162
    161163/*
    162  * Generic prototyes
    163  */
    164 static HKEY    getDataType(LPSTR *lpValue);
     164 * Generic prototypes
     165 */
     166static DWORD   getDataType(LPSTR *lpValue);
    165167static LPSTR   getRegKeyName(LPSTR lpLine);
    166168static HKEY    getRegClass(LPSTR lpLine);
     
    190192static char helpText[] =
    191193"NAME\n"
    192 "          regapi - provide a command line interface to the wine registry.\n"
     194"          regapi - perform certain actions on the wine registry.\n"
    193195"\n"
    194196"SYNOPSIS\n"
     
    196198"\n"
    197199"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"
    201204"\n"
    202205"OPTIONS\n"
     
    251254/******************************************************************************
    252255 * This function returns the HKEY associated with the data type encoded in the
    253  * value.  It modify the input parameter (key value) in order to skip this
     256 * value.  It modifies the input parameter (key value) in order to skip this
    254257 * "now useless" data type information.
    255258 */
    256 HKEY getDataType(LPSTR *lpValue)
     259DWORD getDataType(LPSTR *lpValue)
    257260{
    258261  INT   counter  = 0;
     
    305308/******************************************************************************
    306309 * 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 '\'
    308311 */
    309312static HKEY getRegClass(LPSTR lpClass)
     
    315318 
    316319  if (lpClass == NULL)
    317     return ERROR_INVALID_PARAMETER;
     320    return (HKEY)ERROR_INVALID_PARAMETER;
    318321
    319322  strcpy(lpClassCopy, lpClass);
    320323
    321324  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 */
    325326  classNameBeg  = &lpClassCopy[1];            /* Skip the '[' */
    326327 
     
    336337    return  HKEY_CURRENT_USER;
    337338  else
    338     return ERROR_INVALID_PARAMETER;
     339    return (HKEY)ERROR_INVALID_PARAMETER;
    339340}
    340341
     
    615616  /* Get the registry class */
    616617  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;
    619620
    620621  /* Get the key name */
     
    642643}
    643644/******************************************************************************
    644  * This function is a wrapper arround the setValue function.  It prepares the
     645 * This function is a wrapper for the setValue function.  It prepares the
    645646 * land and clean the area once completed.
    646647 */
     
    660661    argv[counter]=NULL;
    661662
    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 #else
    671663  while( (token = strsep(&cmdline, setValueDelim[argCounter])) != NULL )
    672664  {
     
    676668      break;  /* Stop processing args no matter what */
    677669  }
    678 #endif
    679670
    680671  hRes = setValue(argv);
     
    708699
    709700/******************************************************************************
    710  * This function is a wrapper arround the queryValue function.  It prepares the
     701 * This function is a wrapper for the queryValue function.  It prepares the
    711702 * land and clean the area once completed.
    712703 */
     
    10301021
    10311022/******************************************************************************
    1032  * MAIN - The main simply validate the first parameter (command to perform)
    1033  *        It then read the STDIN lines by lines forwarding their processing
     1023 * MAIN - WinMain simply validates the first parameter (command to perform)
     1024 *        It then reads the STDIN lines by lines forwarding their processing
    10341025 *        to the appropriate method.
    10351026 */
    1036 int PASCAL WinMain (HANDLE inst, HANDLE prev, LPSTR cmdline, int show)
     1027int PASCAL WinMain (HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show)
    10371028{
    10381029  LPSTR  token          = NULL;  /* current token analized */
Note: See TracChangeset for help on using the changeset viewer.