Ignore:
Timestamp:
Sep 5, 2000, 10:35:40 PM (25 years ago)
Author:
sandervl
Message:

RegSetValue workaround + HMOpenFile fix

File:
1 edited

Legend:

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

    r3678 r4197  
    1 /* $Id: registry.cpp,v 1.2 2000-06-08 18:08:56 sandervl Exp $ */
     1/* $Id: registry.cpp,v 1.3 2000-09-05 20:35:39 sandervl Exp $ */
    22
    33/*
     
    899899                                 DWORD, cbData)
    900900{
     901 LONG rc;
     902
    901903  //SvL: 8-11-'97: Bugfix: crash in pmwinx if size == 0 and string is large
    902904  if(cbData == 0)
    903905    cbData = strlen(lpData);
    904906
    905   return(_O32_RegSetValue(ConvertKey(hkey),
     907  rc = _O32_RegSetValue(ConvertKey(hkey),
    906908                         lpSubKey,
    907909                         dwType,
    908910                         lpData,
    909                          cbData));
     911                         cbData);
     912  if(rc == ERROR_NOT_ENOUGH_MEMORY && cbData == 0 && dwType == REG_SZ)
     913  {
     914    char regdata = 0;
     915        //SvL: Netscape sets an empty string key this way; Open32 doesn't like it
     916        rc = _O32_RegSetValue(ConvertKey(hkey),
     917                         lpSubKey,
     918                         dwType,
     919                         &regdata,
     920                         1);
     921  }
     922  return rc;
    910923}
    911924
Note: See TracChangeset for help on using the changeset viewer.