Ignore:
Timestamp:
May 16, 2002, 2:53:45 PM (23 years ago)
Author:
sandervl
Message:

RegQueryInfoKeyW fix

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kernel32/registry.cpp

    r8327 r8431  
    1 /* $Id: registry.cpp,v 1.14 2002-04-29 17:05:30 sandervl Exp $ */
     1/* $Id: registry.cpp,v 1.15 2002-05-16 12:53:45 sandervl Exp $ */
    22
    33/*
     
    717717 *****************************************************************************/
    718718
    719 LONG WIN32API RegQueryInfoKeyA(HKEY        arg1,
    720                                LPSTR       arg2,
    721                                LPDWORD     arg3,
    722                                LPDWORD     arg4,
    723                                LPDWORD     arg5,
    724                                LPDWORD     arg6,
    725                                LPDWORD     arg7,
    726                                LPDWORD     arg8,
    727                                LPDWORD     arg9,
    728                                LPDWORD     arg10,
    729                                LPDWORD     arg11,
    730                                LPFILETIME  arg12)
    731 {
    732   return O32_RegQueryInfoKey(ConvertKey(arg1),
    733                              arg2,
    734                              arg3,
    735                              arg4,
    736                              arg5,
    737                              arg6,
    738                              arg7,
    739                              arg8,
    740                              arg9,
    741                              arg10,
    742                              arg11,
    743                              arg12);
     719LONG WIN32API RegQueryInfoKeyA(HKEY        hkey,
     720                               LPSTR       lpszClass,
     721                               LPDWORD     lpcchClass,
     722                               LPDWORD     lpdwReserved,
     723                               LPDWORD     lpcSubKeys,
     724                               LPDWORD     lpcchMaxSubKey,
     725                               LPDWORD     lpcchMaxClass,
     726                               LPDWORD     lpcValues,
     727                               LPDWORD     lpcchMaxValueName,
     728                               LPDWORD     lpcbMaxValueData,
     729                               LPDWORD     lpcbSecurityDescriptor,
     730                               LPFILETIME  lpftLastWriteTime)
     731{
     732    return O32_RegQueryInfoKey(ConvertKey(hkey), lpszClass,
     733                               lpcchClass, lpdwReserved, lpcSubKeys,
     734                               lpcchMaxSubKey, lpcchMaxClass, lpcValues,
     735                               lpcchMaxValueName, lpcbMaxValueData,
     736                               lpcbSecurityDescriptor,lpftLastWriteTime);
    744737}
    745738
     
    770763                               LPFILETIME  lpftLastWriteTime)
    771764{
    772   char *astring;
    773   LONG  rc;
    774 
    775   rc = O32_RegQueryInfoKey(ConvertKey(hkey),
    776                            (char *)lpszClass,
    777                            lpcchClass,
    778                            lpdwReserved,
    779                            lpcSubKeys,
    780                            lpcchMaxSubKey,
    781                            lpcchMaxClass,
    782                            lpcValues,
    783                            lpcchMaxValueName,
    784                            lpcbMaxValueData,
    785                            lpcbSecurityDescriptor,
    786                            lpftLastWriteTime);
    787   if(rc == ERROR_SUCCESS)
    788   {
    789     if(*lpcchClass) {
    790             astring = (char *)malloc(*lpcchClass+1); //returned length does NOT include 0 terminator
     765    LONG  rc;
     766
     767    rc = O32_RegQueryInfoKey(ConvertKey(hkey), (char *)lpszClass,
     768                             lpcchClass, lpdwReserved, lpcSubKeys,
     769                             lpcchMaxSubKey, lpcchMaxClass, lpcValues,
     770                             lpcchMaxValueName, lpcbMaxValueData,
     771                             lpcbSecurityDescriptor,lpftLastWriteTime);
     772    if(rc == ERROR_SUCCESS)
     773    {
     774        if(lpcchClass && *lpcchClass) {
     775            char *astring = (char *)malloc(*lpcchClass+1); //returned length does NOT include 0 terminator
    791776            strcpy(astring, (char *)lpszClass);
    792777            AsciiToUnicode(astring, lpszClass);
    793778            free(astring);
     779        }
     780        else
     781        if(lpszClass) *lpszClass = 0;
    794782    }
    795     else    *lpszClass = 0;
    796   }
    797   //TODO: lpcbMaxValueData could be wrong for string key values!!! (as it's in bytes)
    798   return(rc);
     783    //TODO: lpcbMaxValueData could be wrong for string key values!!! (as it's in bytes)
     784    return(rc);
    799785}
    800786
Note: See TracChangeset for help on using the changeset viewer.