Ignore:
Timestamp:
Jun 8, 2000, 8:08:58 PM (25 years ago)
Author:
sandervl
Message:

RegQueryValueW, OpenFile and LoadLibrary fixes

File:
1 edited

Legend:

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

    r2984 r3678  
    1 /* $Id: registry.cpp,v 1.1 2000-03-03 11:15:59 sandervl Exp $ */
     1/* $Id: registry.cpp,v 1.2 2000-06-08 18:08:56 sandervl Exp $ */
    22
    33/*
     
    3030#include "unicode.h"
    3131#include <winreg.h>
     32
     33#define DBG_LOCALLOG    DBG_registry
     34#include "dbglocal.h"
    3235
    3336
     
    789792
    790793ODINFUNCTION4(LONG,RegQueryValueW,HKEY,   hkey,
    791                                    LPCWSTR,lpszSubKey,
    792                                    LPWSTR, lpszValue,
    793                                    PLONG,  pcbValue)
     794                                  LPCWSTR,lpszSubKey,
     795                                  LPWSTR, lpszValue,
     796                                  PLONG,  pcbValue)
    794797{
    795798  char *astring1 = UnicodeToAsciiString((LPWSTR)lpszSubKey);
     
    803806  if(rc == ERROR_SUCCESS)
    804807  {
    805     astring2 = (char *)malloc(*pcbValue);
    806     strcpy(astring2, (char *)lpszValue);
    807     AsciiToUnicode(astring2, lpszValue);
    808     free(astring2);
     808        if(pcbValue) {
     809                astring2 = (char *)malloc(*pcbValue);
     810                strcpy(astring2, (char *)lpszValue);
     811                AsciiToUnicode(astring2, lpszValue);
     812                free(astring2);
     813        }
    809814  }
     815  FreeAsciiString(astring1);
    810816  return(rc);
    811817}
     
    918924
    919925ODINFUNCTION5(LONG,RegSetValueW,HKEY,   hkey,
    920                                  LPCWSTR,lpSubKey,
    921                                  DWORD,  dwType,
    922                                  LPCWSTR,lpData,
    923                                  DWORD,  cbData)
     926                                LPCWSTR,lpSubKey,
     927                                DWORD,  dwType,
     928                                LPCWSTR,lpData,
     929                                DWORD,  cbData)
    924930{
    925931  char *astring1 = UnicodeToAsciiString((LPWSTR)lpSubKey);
     
    956962
    957963ODINFUNCTION6(LONG,RegSetValueExA,HKEY,  arg1,
    958                                    LPSTR, arg2,
    959                                    DWORD, arg3,
    960                                    DWORD, arg4,
    961                                    BYTE*, arg5,
    962                                    DWORD, arg6)
     964                                  LPSTR, arg2,
     965                                  DWORD, arg3,
     966                                  DWORD, arg4,
     967                                  BYTE*, arg5,
     968                                  DWORD, arg6)
    963969{
    964970  return _O32_RegSetValueEx(ConvertKey(arg1),
Note: See TracChangeset for help on using the changeset viewer.