mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
- Fix warnings
- Remove code that isn't used in ReactOS because our _SHExpandEnvironmentStrings was completely re-written and thus doesn't use the two helper functions that WINE's _SHExpandEnvironmentStrings does. svn path=/trunk/; revision=16789
This commit is contained in:
parent
bafc9b7881
commit
14e0bc6128
3 changed files with 2 additions and 53 deletions
|
@ -88,9 +88,8 @@ static CRITICAL_SECTION_DEBUG critsect_debug =
|
|||
};
|
||||
static CRITICAL_SECTION keyboard_crit = { &critsect_debug, -1, 0, 0, 0, 0 };
|
||||
|
||||
static DWORD keyboard_users;
|
||||
|
||||
#ifndef __REACTOS__
|
||||
static DWORD keyboard_users;
|
||||
static HHOOK keyboard_hook;
|
||||
#endif
|
||||
|
||||
|
|
|
@ -1457,57 +1457,6 @@ static HRESULT _SHGetAllUsersProfilePath(DWORD dwFlags, BYTE folder,
|
|||
return hr;
|
||||
}
|
||||
|
||||
static HRESULT _SHOpenProfilesKey(PHKEY pKey)
|
||||
{
|
||||
LONG lRet;
|
||||
DWORD disp;
|
||||
|
||||
lRet = RegCreateKeyExW(HKEY_LOCAL_MACHINE, ProfileListW, 0, NULL, 0,
|
||||
KEY_ALL_ACCESS, NULL, pKey, &disp);
|
||||
return HRESULT_FROM_WIN32(lRet);
|
||||
}
|
||||
|
||||
/* Reads the value named szValueName from the key profilesKey (assumed to be
|
||||
* opened by _SHOpenProfilesKey) into szValue, which is assumed to be MAX_PATH
|
||||
* WCHARs in length. If it doesn't exist, returns szDefault (and saves
|
||||
* szDefault to the registry).
|
||||
*/
|
||||
static HRESULT _SHGetProfilesValue(HKEY profilesKey, LPCWSTR szValueName,
|
||||
LPWSTR szValue, LPCWSTR szDefault)
|
||||
{
|
||||
HRESULT hr;
|
||||
DWORD type, dwPathLen = MAX_PATH * sizeof(WCHAR);
|
||||
LONG lRet;
|
||||
|
||||
TRACE("%p,%s,%p,%s\n", profilesKey, debugstr_w(szValueName), szValue,
|
||||
debugstr_w(szDefault));
|
||||
lRet = RegQueryValueExW(profilesKey, szValueName, NULL, &type,
|
||||
(LPBYTE)szValue, &dwPathLen);
|
||||
if (!lRet && (type == REG_SZ || type == REG_EXPAND_SZ) && dwPathLen
|
||||
&& *szValue)
|
||||
{
|
||||
dwPathLen /= sizeof(WCHAR);
|
||||
szValue[dwPathLen] = '\0';
|
||||
hr = S_OK;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Missing or invalid value, set a default */
|
||||
lstrcpynW(szValue, szDefault, MAX_PATH);
|
||||
TRACE("Setting missing value %s to %s\n", debugstr_w(szValueName),
|
||||
debugstr_w(szValue));
|
||||
lRet = RegSetValueExW(profilesKey, szValueName, 0, REG_EXPAND_SZ,
|
||||
(LPBYTE)szValue,
|
||||
(strlenW(szValue) + 1) * sizeof(WCHAR));
|
||||
if (lRet)
|
||||
hr = HRESULT_FROM_WIN32(lRet);
|
||||
else
|
||||
hr = S_OK;
|
||||
}
|
||||
TRACE("returning 0x%08lx (output value is %s)\n", hr, debugstr_w(szValue));
|
||||
return hr;
|
||||
}
|
||||
|
||||
/* From the original Wine source:
|
||||
*
|
||||
* Attempts to expand environment variables from szSrc into szDest, which is
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
#include <string.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#define COBJMACROS
|
||||
#define NONAMELESSUNION
|
||||
|
|
Loading…
Reference in a new issue