RegQueryValueExW and RegQueryValueExA calls accept bytes. Patch by Victor Martinez Calvo. CORE-9665 #comment Thanks!

svn path=/trunk/; revision=72947
This commit is contained in:
Mark Jansen
2016-10-09 20:58:08 +00:00
parent fc0c290789
commit aef3f9c467
15 changed files with 31 additions and 30 deletions
@@ -138,7 +138,7 @@ LoadUsernameHint(HWND hDlg, INT iCur)
if(RegOpenKeyExW(hKey, szName, 0, KEY_READ, &hSubKey) != ERROR_SUCCESS)
break;
dwSize = MAXVALUE;
dwSize = MAXVALUE * sizeof(WCHAR);
if(RegQueryValueExW(hKey, L"UsernameHint", 0, NULL, (LPBYTE)szValue, &dwSize) == ERROR_SUCCESS)
{
@@ -185,7 +185,7 @@ FillServerAddesssCombo(PINFO pInfo)
NULL);
if (ret == ERROR_SUCCESS)
{
size = MAX_KEY_NAME;
size = sizeof(Name);
if (RegQueryValueExW(hKey,
Name,
0,
+5 -5
View File
@@ -11,7 +11,7 @@
BOOL
GetApplicationString(HKEY hKey, LPWSTR lpKeyName, LPWSTR lpString)
{
DWORD dwSize = MAX_PATH;
DWORD dwSize = MAX_PATH * sizeof(WCHAR);
if (RegQueryValueExW(hKey,
lpKeyName,
@@ -50,7 +50,7 @@ IsInstalledApplication(LPWSTR lpRegName, BOOL IsUserKey)
if (RegOpenKeyW(hKey, szName, &hSubKey) == ERROR_SUCCESS)
{
dwType = REG_SZ;
dwSize = MAX_PATH;
dwSize = sizeof(szDisplayName);
if (RegQueryValueExW(hSubKey,
L"DisplayName",
NULL,
@@ -118,7 +118,7 @@ UninstallApplication(INT Index, BOOL bModify)
hKey = ItemInfo->hSubKey;
dwType = REG_SZ;
dwSize = MAX_PATH;
dwSize = sizeof(szPath);
if (RegQueryValueExW(hKey,
bModify ? szModify : szUninstall,
NULL,
@@ -254,7 +254,7 @@ EnumInstalledApplications(INT EnumType, BOOL IsUserKey, APPENUMPROC lpEnumProc)
}
dwType = REG_SZ;
dwSize = MAX_PATH;
dwSize = sizeof(pszParentKeyName);
bIsUpdate = (RegQueryValueExW(Info.hSubKey,
L"ParentKeyName",
NULL,
@@ -262,7 +262,7 @@ EnumInstalledApplications(INT EnumType, BOOL IsUserKey, APPENUMPROC lpEnumProc)
(LPBYTE)pszParentKeyName,
&dwSize) == ERROR_SUCCESS);
dwSize = MAX_PATH;
dwSize = sizeof(pszDisplayName);
if (RegQueryValueExW(Info.hSubKey,
L"DisplayName",
NULL,
@@ -11,7 +11,7 @@
BOOL
GetApplicationString(HKEY hKey, LPCWSTR lpKeyName, LPWSTR lpString)
{
DWORD dwSize = MAX_PATH;
DWORD dwSize = MAX_PATH * sizeof(WCHAR);
if (RegQueryValueExW(hKey,
lpKeyName,
@@ -50,7 +50,7 @@ IsInstalledApplication(LPWSTR lpRegName, BOOL IsUserKey)
if (RegOpenKeyW(hKey, szName, &hSubKey) == ERROR_SUCCESS)
{
dwType = REG_SZ;
dwSize = MAX_PATH;
dwSize = sizeof(szDisplayName);
if (RegQueryValueExW(hSubKey,
L"DisplayName",
NULL,
@@ -118,7 +118,7 @@ UninstallApplication(INT Index, BOOL bModify)
hKey = ItemInfo->hSubKey;
dwType = REG_SZ;
dwSize = MAX_PATH;
dwSize = sizeof(szPath);
if (RegQueryValueExW(hKey,
bModify ? szModify : szUninstall,
NULL,
@@ -254,7 +254,7 @@ EnumInstalledApplications(INT EnumType, BOOL IsUserKey, APPENUMPROC lpEnumProc)
}
dwType = REG_SZ;
dwSize = MAX_PATH;
dwSize = sizeof(pszParentKeyName);
bIsUpdate = (RegQueryValueExW(Info.hSubKey,
L"ParentKeyName",
NULL,
@@ -262,7 +262,7 @@ EnumInstalledApplications(INT EnumType, BOOL IsUserKey, APPENUMPROC lpEnumProc)
(LPBYTE)pszParentKeyName,
&dwSize) == ERROR_SUCCESS);
dwSize = MAX_PATH;
dwSize = sizeof(pszDisplayName);
if (RegQueryValueExW(Info.hSubKey,
L"DisplayName",
NULL,
+1 -1
View File
@@ -774,7 +774,7 @@ static void ChooseFavorite(LPCWSTR pszFavorite)
if (RegOpenKeyExW(HKEY_CURRENT_USER, s_szFavoritesRegKey, 0, KEY_QUERY_VALUE, &hKey) != ERROR_SUCCESS)
goto done;
cbData = (sizeof(szFavoritePath) / sizeof(szFavoritePath[0])) - 1;
cbData = sizeof(szFavoritePath);
memset(szFavoritePath, 0, sizeof(szFavoritePath));
if (RegQueryValueExW(hKey, pszFavorite, NULL, &dwType, (LPBYTE) szFavoritePath, &cbData) != ERROR_SUCCESS)
goto done;
+1 -1
View File
@@ -390,7 +390,7 @@ void ProcessPageShowContextMenu(DWORD dwProcessId)
if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"Software\\Microsoft\\Windows NT\\CurrentVersion\\AeDebug", 0, KEY_READ, &hKey) == ERROR_SUCCESS)
{
dwDebuggerSize = 260;
dwDebuggerSize = sizeof(strDebugger);
if (RegQueryValueExW(hKey, L"Debugger", NULL, NULL, (LPBYTE)strDebugger, &dwDebuggerSize) == ERROR_SUCCESS)
{
CharUpper(strDebugger);
+1 -1
View File
@@ -841,7 +841,7 @@ Int_EnumDependentServicesW(HKEY hServicesKey,
if (dwError != ERROR_SUCCESS)
return dwError;
dwSize = MAX_PATH;
dwSize = MAX_PATH * sizeof(WCHAR);
/* Check for the DependOnService Value */
dwError = RegQueryValueExW(hServiceEnumKey,
+1 -1
View File
@@ -80,7 +80,7 @@ RunSetupThreadProc(
return FALSE;
/* Read key */
dwSize = (sizeof(Shell) / sizeof(Shell[0])) - 1;
dwSize = sizeof(Shell);
dwError = RegQueryValueExW(hKey,
L"CmdLine",
NULL,