Ignore:
Timestamp:
Jun 11, 1999, 3:19:52 PM (26 years ago)
Author:
phaller
Message:

Fix: added more debug info, beautified source #2.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/advapi32/ADVAPI32.CPP

    r102 r103  
    1 /* $Id: ADVAPI32.CPP,v 1.4 1999-06-11 13:00:21 phaller Exp $ */
     1/* $Id: ADVAPI32.CPP,v 1.5 1999-06-11 13:19:52 phaller Exp $ */
    22
    33/*
     
    195195                               LPSTR arg2)
    196196{
    197   dprintf(("ADVAPI32: RegDeleteValueA(%08xh,%s)\n";
     197  dprintf(("ADVAPI32: RegDeleteValueA(%08xh,%s)\n",
    198198           arg1,
    199199           arg2));
     
    471471//******************************************************************************
    472472//******************************************************************************
    473 DWORD WIN32API RegSetValueA(HKEY hkey, LPCSTR lpSubKey, DWORD dwType, LPCSTR lpData, DWORD cbData)
    474 {
    475 #ifdef DEBUG
    476    WriteLog("ADVAPI32: RegSetValueA %d, %s, %d, %s, %d\n", hkey, lpSubKey, dwType, lpData, cbData);
    477 #endif
    478    //SvL: 8-11-'97: Bugfix: crash in pmwinx if size == 0 and string is large
    479    if(cbData == 0)
    480    cbData = strlen(lpData);
    481 
    482    return(O32_RegSetValue(ConvertKey(hkey), lpSubKey, dwType, lpData, cbData));
    483 }
    484 //******************************************************************************
    485 //******************************************************************************
    486 DWORD WIN32API RegSetValueW(HKEY hkey, LPCWSTR lpSubKey, DWORD dwType, LPCWSTR lpData, DWORD cbData)
    487 {
    488  char *astring1 = UnicodeToAsciiString((LPWSTR)lpSubKey);
    489  char *astring2 = UnicodeToAsciiString((LPWSTR)lpData);
    490  LONG  rc;
    491 
    492 #ifdef DEBUG
    493     WriteLog("ADVAPI32: RegSetValue\n");
    494 #endif
    495    //SvL: 8-11-'97: Bugfix: crash in pmwinx if size == 0 and string is large
    496    if(cbData == 0)
    497    cbData = strlen(astring2);
    498 
    499    rc = O32_RegSetValue(ConvertKey(hkey), astring1, dwType, astring2, cbData);
    500    FreeAsciiString(astring1);
    501    FreeAsciiString(astring2);
    502    return(rc);
     473DWORD WIN32API RegSetValueA(HKEY   hkey,
     474                            LPCSTR lpSubKey,
     475                            DWORD  dwType,
     476                            LPCSTR lpData,
     477                            DWORD  cbData)
     478{
     479  dprintf(("ADVAPI32: RegSetValueA(%08xh,%s,%08xh,%s,%08xh)\n",
     480           hkey,
     481           lpSubKey,
     482           dwType,
     483           lpData,
     484           cbData));
     485
     486
     487  //SvL: 8-11-'97: Bugfix: crash in pmwinx if size == 0 and string is large
     488  if(cbData == 0)
     489    cbData = strlen(lpData);
     490
     491  return(O32_RegSetValue(ConvertKey(hkey),
     492                         lpSubKey,
     493                         dwType,
     494                         lpData,
     495                         cbData));
     496}
     497//******************************************************************************
     498//******************************************************************************
     499DWORD WIN32API RegSetValueW(HKEY    hkey,
     500                            LPCWSTR lpSubKey,
     501                            DWORD   dwType,
     502                            LPCWSTR lpData,
     503                            DWORD   cbData)
     504{
     505  char *astring1 = UnicodeToAsciiString((LPWSTR)lpSubKey);
     506  char *astring2 = UnicodeToAsciiString((LPWSTR)lpData);
     507  LONG  rc;
     508
     509  dprintf(("ADVAPI32: RegSetValueW(%08xh,%s,%08xh,%s,%08xh)\n",
     510           hkey,
     511           astring1,
     512           dwType,
     513           astring2,
     514           cbData));
     515
     516  //SvL: 8-11-'97: Bugfix: crash in pmwinx if size == 0 and string is large
     517  if(cbData == 0)
     518    cbData = strlen(astring2);
     519
     520  rc = O32_RegSetValue(ConvertKey(hkey),
     521                       astring1,
     522                       dwType,
     523                       astring2,
     524                       cbData);
     525
     526  FreeAsciiString(astring1);
     527  FreeAsciiString(astring2);
     528  return(rc);
    503529}
    504530//******************************************************************************
    505531//TODO:Check for string length here too?
    506532//******************************************************************************
    507 DWORD WIN32API RegSetValueExA(HKEY arg1, LPSTR arg2, DWORD arg3, DWORD arg4, BYTE * arg5, DWORD  arg6)
    508 {
    509 #ifdef DEBUG
    510     WriteLog("ADVAPI32: RegSetValueEx\n");
    511 #endif
    512     return O32_RegSetValueEx(ConvertKey(arg1), arg2, arg3, arg4, arg5, arg6);
     533DWORD WIN32API RegSetValueExA(HKEY   arg1,
     534                              LPSTR  arg2,
     535                              DWORD  arg3,
     536                              DWORD  arg4,
     537                              BYTE  *arg5,
     538                              DWORD  arg6)
     539{
     540  dprintf(("ADVAPI32: RegSetValueExA(%08xh,%s,%08xh,%08xh,%08xh,%08xh)\n",
     541           arg1,
     542           arg2,
     543           arg3,
     544           arg4,
     545           arg5,
     546           arg6));
     547
     548  return O32_RegSetValueEx(ConvertKey(arg1),
     549                           arg2,
     550                           arg3,
     551                           arg4,
     552                           arg5,
     553                           arg6);
    513554}
    514555//******************************************************************************
    515556//TODO:Check for string length here too?
    516557//******************************************************************************
    517 DWORD WIN32API RegSetValueExW(HKEY arg1, LPWSTR arg2, DWORD arg3, DWORD arg4, BYTE * arg5, DWORD  arg6)
    518 {
    519  char *astring = UnicodeToAsciiString(arg2);
    520  LONG  rc;
    521 
    522 #ifdef DEBUG
    523     WriteLog("ADVAPI32: RegSetValueExW, NOT COMPLETE!!\n");
    524 #endif
    525     rc = O32_RegSetValueEx(ConvertKey(arg1), astring, arg3, arg4, arg5, arg6);
    526     FreeAsciiString(astring);
    527     return(rc);
     558DWORD WIN32API RegSetValueExW(HKEY   arg1,
     559                              LPWSTR arg2,
     560                              DWORD  arg3,
     561                              DWORD  arg4,
     562                              BYTE   *arg5,
     563                              DWORD  arg6)
     564{
     565  char *astring = UnicodeToAsciiString(arg2);
     566  LONG  rc;
     567
     568  dprintf(("ADVAPI32: RegSetValueExW(%08xh,%s,%08xh,%08xh,%08xh,%08xh)\n",
     569           arg1,
     570           astring,
     571           arg3,
     572           arg4,
     573           arg5,
     574           arg6));
     575
     576  rc = O32_RegSetValueEx(ConvertKey(arg1),
     577                         astring,
     578                         arg3,
     579                         arg4,
     580                         arg5,
     581                         arg6);
     582  FreeAsciiString(astring);
     583  return(rc);
    528584}
    529585//******************************************************************************
Note: See TracChangeset for help on using the changeset viewer.