32#define REG_TEST_KEY "Software\\Wine\\Test"
33#define REG_CURRENT_VERSION "Software\\Microsoft\\Windows\\CurrentVersion\\explorer"
44static const char sTestpath1[] =
"%LONGSYSTEMVAR%\\subdir1";
48static const char *
sEnvvar2 =
"ImARatherLongButIndeedNeededString";
80 DWORD nExpectedLen1, nExpectedLen2;
103 trace(
"Expanding %s failed (expected %ld) - known bug in NT4\n",
sTestpath1, nExpectedLen1 );
107 trace(
"Expanding %s failed (expected %ld) - known bug in NT4\n",
sTestpath2, nExpectedLen2 );
132 "Expected REG_SZ, got (%lu)\n", dwType);
140 ok(
REG_SZ == dwType ,
"Expected REG_SZ, got (%lu)\n", dwType);
202 const char * sTestedFunction =
"";
203 DWORD nUsedBuffer1,nUsedBuffer2;
205 sTestedFunction =
"RegOpenKeyExA";
207 ok(
ERROR_SUCCESS == dwRet,
"%s failed, ret=%lu\n", sTestedFunction, dwRet);
211 sTestedFunction =
"SHQueryValueExA";
218 ok(
ERROR_SUCCESS == dwRet,
"%s failed, ret=%lu\n", sTestedFunction, dwRet);
225 ok(
ERROR_SUCCESS == dwRet,
"%s failed, ret=%lu\n", sTestedFunction, dwRet);
226 ok(
REG_SZ == dwType ,
"Expected REG_SZ, got (%lu)\n", dwType);
234 ok(
ERROR_SUCCESS == dwRet,
"%s failed, ret=%lu\n", sTestedFunction, dwRet);
235 ok(
dwSize == nUsedBuffer1,
"Buffer sizes (%lu) and (%lu) are not equal\n",
dwSize, nUsedBuffer1);
242 ok(
ERROR_SUCCESS == dwRet,
"%s failed, ret=%lu\n", sTestedFunction, dwRet);
245 "Buffer size (%lu) should be >= (%lu)\n",
dwSize, nUsedBuffer2);
256 ok(
dwSize == nUsedBuffer1,
"Buffer sizes (%lu) and (%lu) are not equal\n",
dwSize, nUsedBuffer1);
259 "Expected REG_SZ, got (%lu)\n", dwType);
273 "Buffer size (%lu) should be >= (%lu)\n",
dwSize, nUsedBuffer2);
276 "Expected REG_SZ, got (%lu)\n", dwType);
291 "Expected ERROR_MORE_DATA, got (%lu)\n", dwRet);
294 "Expected empty or unexpanded string (win98), got (%s)\n",
buf);
298 "Buffer size (%lu) should be >= (%lu)\n",
dwSize, nUsedBuffer2);
299 ok(
REG_SZ == dwType ,
"Expected REG_SZ, got (%lu)\n", dwType);
314 "Expected ERROR_MORE_DATA, got (%lu)\n", dwRet);
318 "Expected empty or first part of the string \"%s\", got \"%s\"\n",
sEnvvar2,
buf);
323 "Buffer size (%lu) should be >= (%lu)\n",
dwSize, nUsedBuffer2);
324 ok(
REG_SZ == dwType ,
"Expected REG_SZ, got (%lu)\n", dwType);
333 ok(
ERROR_SUCCESS == dwRet,
"%s failed, ret=%lu\n", sTestedFunction, dwRet);
336 "Buffer size (%lu) should be >= (%lu)\n",
dwSize, nUsedBuffer2);
337 ok(
REG_SZ == dwType ,
"Expected REG_SZ, got (%lu)\n", dwType);
344 HKEY hKeySrc, hKeyDst;
349 win_skip(
"SHCopyKeyA is not available\n");
363 if (dwRet || !hKeyDst)
365 ok( 0,
"Destination couldn't be created, RegCreateKeyA returned (%lu)\n", dwRet);
371 if (dwRet || !hKeySrc)
373 ok( 0,
"Source couldn't be opened, RegOpenKeyA returned (%lu)\n", dwRet);
378 dwRet = (*pSHCopyKeyA)(hKeySrc,
NULL, hKeyDst, 0);
387 if (dwRet || !hKeyDst)
389 ok ( 0,
"Copy couldn't be opened, RegOpenKeyA returned (%lu)\n", dwRet);
401 HKEY hKeyTest, hKeyS;
430 ok (
ERROR_SUCCESS == dwRet,
"SHDeleteKey failed, ret=(%lu)\n", dwRet);
439 ok( 0,
"Could not set up SHDeleteKey test\n");
444 static const WCHAR subkeyW[] = {
's',
'u',
'b',
'k',
'e',
'y',0};
447 if (!pSHRegCreateUSKeyW)
449 win_skip(
"SHRegCreateUSKeyW not available\n");
459 static const WCHAR localW[] = {
'S',
'o',
'f',
't',
'w',
'a',
'r',
'e',0};
463 if (!pSHRegOpenUSKeyW || !pSHRegCloseUSKey)
465 win_skip(
"SHRegOpenUSKeyW or SHRegCloseUSKey not available\n");
475 ret = pSHRegCloseUSKey(
key);
482 ret = pSHRegCloseUSKey(
key);
496 win_skip(
"Too old shlwapi version\n");
int strcmp(const char *String1, const char *String2)
ACPI_SIZE strlen(const char *String)
void sysfail(const char *what, int errnoval)
#define RegCloseKey(hKey)
LONG WINAPI RegCreateKeyA(HKEY hKey, LPCSTR lpSubKey, PHKEY phkResult)
LONG WINAPI RegSetValueExA(HKEY hKey, LPCSTR lpValueName, DWORD Reserved, DWORD dwType, CONST BYTE *lpData, DWORD cbData)
LONG WINAPI RegOpenKeyExA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey, _In_ DWORD ulOptions, _In_ REGSAM samDesired, _Out_ PHKEY phkResult)
LONG WINAPI RegOpenKeyA(HKEY hKey, LPCSTR lpSubKey, PHKEY phkResult)
#define ERROR_INVALID_PARAMETER
#define GetProcAddress(x, y)
DWORD WINAPI ExpandEnvironmentStringsA(IN LPCSTR lpSrc, IN LPSTR lpDst, IN DWORD nSize)
BOOL WINAPI DECLSPEC_HOTPATCH SetEnvironmentVariableA(IN LPCSTR lpName, IN LPCSTR lpValue)
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
DWORD WINAPI SHGetValueA(HKEY hKey, LPCSTR lpszSubKey, LPCSTR lpszValue, LPDWORD pwType, LPVOID pvData, LPDWORD pcbData)
DWORD WINAPI SHQueryValueExA(HKEY hKey, LPCSTR lpszValue, LPDWORD lpReserved, LPDWORD pwType, LPVOID pvData, LPDWORD pcbData)
DWORD WINAPI SHDeleteKeyA(HKEY hKey, LPCSTR lpszSubKey)
GLuint GLuint GLsizei GLenum type
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLenum GLuint GLenum GLsizei const GLchar * buf
#define ERROR_FILE_NOT_FOUND
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
#define SRRF_RT_REG_EXPAND_SZ
#define SRRF_RT_REG_DWORD
#define SRRF_RT_REG_QWORD
#define SHREGSET_FORCE_HKCU
#define delete_key(r, p, s)
static void test_SHQueryValueEx(void)
static const char * sEmptyBuffer
static void test_SHDeleteKey(void)
static void test_SHGetValue(void)
static void test_SHCopyKey(void)
static HKEY create_test_entries(void)
static const char * sEnvvar2
static const char sTestpath2[]
static const char * sEnvvar1
static void test_SHGetRegPath(void)
#define REG_CURRENT_VERSION
static const char sTestpath1[]
static char sExpTestpath1[MAX_PATH]
static void test_SHRegCloseUSKey(void)
static void test_SHRegCreateUSKeyW(void)
static char sExpTestpath2[MAX_PATH]
static LSTATUS(WINAPI *pSHRegGetValueA)(HKEY
static void test_SHRegGetValue(void)
#define ERROR_UNSUPPORTED_TYPE
#define ERROR_ENVVAR_NOT_FOUND
#define HKEY_LOCAL_MACHINE
#define HKEY_CURRENT_USER