RegCreateKeyEx: Pass NULL as lpClass

The lpClass parameter isn't used, and it is valid to pass NULL for it.
It is, however, not valid to pass a string literal, because the
conversion to nonconst char* has been deprecated in C++ for a long time
and doesn't exist anymore in C++11.
liquid_container
Nicolas Hake 2016-02-08 16:45:13 +01:00
parent d5dbcb71da
commit 142b7ea7c3
1 changed files with 3 additions and 3 deletions

View File

@ -75,7 +75,7 @@ bool SetRegistryString(const char *szSubKey,
if ((qerr=RegCreateKeyExW(HKEY_CURRENT_USER, if ((qerr=RegCreateKeyExW(HKEY_CURRENT_USER,
GetWideChar(szSubKey), GetWideChar(szSubKey),
0, 0,
L"", NULL,
REG_OPTION_NON_VOLATILE, REG_OPTION_NON_VOLATILE,
KEY_ALL_ACCESS, KEY_ALL_ACCESS,
NULL, NULL,
@ -131,7 +131,7 @@ static bool SetRegClassesRoot(const wchar_t *szSubKey,
if ((qerr=RegCreateKeyExW(HKEY_CLASSES_ROOT, if ((qerr=RegCreateKeyExW(HKEY_CLASSES_ROOT,
szSubKey, szSubKey,
0, 0,
L"", NULL,
REG_OPTION_NON_VOLATILE, REG_OPTION_NON_VOLATILE,
KEY_ALL_ACCESS, KEY_ALL_ACCESS,
NULL, NULL,
@ -391,7 +391,7 @@ void StdCompilerConfigWrite::CreateKey(HKEY hParent)
// Open/Create registry key // Open/Create registry key
if (RegCreateKeyExW(hParent ? hParent : pKey->Parent->Handle, if (RegCreateKeyExW(hParent ? hParent : pKey->Parent->Handle,
pKey->Name.GetWideChar(), pKey->Name.GetWideChar(),
0, L"", REG_OPTION_NON_VOLATILE, 0, NULL, REG_OPTION_NON_VOLATILE,
KEY_WRITE, NULL, KEY_WRITE, NULL,
&pKey->Handle, NULL) != ERROR_SUCCESS) &pKey->Handle, NULL) != ERROR_SUCCESS)
excCorrupt("Could not create key %s!", pKey->Name.getData()); excCorrupt("Could not create key %s!", pKey->Name.getData());