mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 05:32:55 +00:00
remove duplicate RegQueryStringValue() function
svn path=/trunk/; revision=18272
This commit is contained in:
parent
5f5bf68c82
commit
ed14f79996
1 changed files with 0 additions and 36 deletions
|
@ -178,42 +178,6 @@ static BOOL _CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
|||
* Key suggestion
|
||||
*/
|
||||
|
||||
static LONG RegQueryStringValue(HKEY hKey, LPCTSTR lpSubKey, LPCTSTR lpValueName,
|
||||
LPTSTR lpDest, DWORD dwDestLength)
|
||||
{
|
||||
LONG lResult;
|
||||
HKEY hSubKey = NULL;
|
||||
DWORD cbData, dwType;
|
||||
|
||||
if (lpSubKey)
|
||||
{
|
||||
lResult = RegOpenKey(hKey, lpSubKey, &hSubKey);
|
||||
if (lResult != ERROR_SUCCESS)
|
||||
goto done;
|
||||
hKey = hSubKey;
|
||||
}
|
||||
|
||||
cbData = (dwDestLength - 1) * sizeof(*lpDest);
|
||||
lResult = RegQueryValueEx(hKey, lpValueName, NULL, &dwType,
|
||||
(LPBYTE) lpDest, &cbData);
|
||||
if (lResult != ERROR_SUCCESS)
|
||||
goto done;
|
||||
if (dwType != REG_SZ)
|
||||
{
|
||||
lResult = -1;
|
||||
goto done;
|
||||
}
|
||||
|
||||
lpDest[cbData / sizeof(*lpDest)] = '\0';
|
||||
|
||||
done:
|
||||
if (lResult != ERROR_SUCCESS)
|
||||
lpDest[0] = '\0';
|
||||
if (hSubKey)
|
||||
RegCloseKey(hSubKey);
|
||||
return lResult;
|
||||
}
|
||||
|
||||
static void SuggestKeys(HKEY hRootKey, LPCTSTR pszKeyPath, LPTSTR pszSuggestions,
|
||||
size_t iSuggestionsLength)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue