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 %d) - known bug in NT4\n",
sTestpath1, nExpectedLen1 );
107 trace(
"Expanding %s failed (expected %d) - known bug in NT4\n",
sTestpath2, nExpectedLen2 );
132 "Expected REG_SZ, got (%u)\n", dwType);
140 ok(
REG_SZ == dwType ,
"Expected REG_SZ, got (%u)\n", dwType);
202 const char * sTestedFunction =
"";
203 DWORD nUsedBuffer1,nUsedBuffer2;
205 sTestedFunction =
"RegOpenKeyExA";
207 ok(
ERROR_SUCCESS == dwRet,
"%s failed, ret=%u\n", sTestedFunction, dwRet);
211 sTestedFunction =
"SHQueryValueExA";
218 ok(
ERROR_SUCCESS == dwRet,
"%s failed, ret=%u\n", sTestedFunction, dwRet);
225 ok(
ERROR_SUCCESS == dwRet,
"%s failed, ret=%u\n", sTestedFunction, dwRet);
226 ok(
REG_SZ == dwType ,
"Expected REG_SZ, got (%u)\n", dwType);
234 ok(
ERROR_SUCCESS == dwRet,
"%s failed, ret=%u\n", sTestedFunction, dwRet);
235 ok(
dwSize == nUsedBuffer1,
"Buffer sizes (%u) and (%u) are not equal\n",
dwSize, nUsedBuffer1);
242 ok(
ERROR_SUCCESS == dwRet,
"%s failed, ret=%u\n", sTestedFunction, dwRet);
245 "Buffer size (%u) should be >= (%u)\n",
dwSize, nUsedBuffer2);
256 ok(
dwSize == nUsedBuffer1,
"Buffer sizes (%u) and (%u) are not equal\n",
dwSize, nUsedBuffer1);
259 "Expected REG_SZ, got (%u)\n", dwType);
273 "Buffer size (%u) should be >= (%u)\n",
dwSize, nUsedBuffer2);
276 "Expected REG_SZ, got (%u)\n", dwType);
291 "Expected ERROR_MORE_DATA, got (%u)\n", dwRet);
296 "Expected empty or unexpanded string (win98), got (%s)\n",
buf);
301 "Buffer size (%u) should be >= (%u)\n",
dwSize, nUsedBuffer2);
302 ok(
REG_SZ == dwType ,
"Expected REG_SZ, got (%u)\n", dwType);
317 "Expected ERROR_MORE_DATA, got (%u)\n", dwRet);
323 "Expected empty or first part of the string \"%s\", got \"%s\"\n",
sEnvvar2,
buf);
329 "Buffer size (%u) should be >= (%u)\n",
dwSize, nUsedBuffer2);
330 ok(
REG_SZ == dwType ,
"Expected REG_SZ, got (%u)\n", dwType);
339 ok(
ERROR_SUCCESS == dwRet,
"%s failed, ret=%u\n", sTestedFunction, dwRet);
342 "Buffer size (%u) should be >= (%u)\n",
dwSize, nUsedBuffer2);
343 ok(
REG_SZ == dwType ,
"Expected REG_SZ, got (%u)\n", dwType);
350 HKEY hKeySrc, hKeyDst;
355 win_skip(
"SHCopyKeyA is not available\n");
369 if (dwRet || !hKeyDst)
371 ok( 0,
"Destination couldn't be created, RegCreateKeyA returned (%u)\n", dwRet);
377 if (dwRet || !hKeySrc)
379 ok( 0,
"Source couldn't be opened, RegOpenKeyA returned (%u)\n", dwRet);
384 dwRet = (*pSHCopyKeyA)(hKeySrc,
NULL, hKeyDst, 0);
393 if (dwRet || !hKeyDst)
395 ok ( 0,
"Copy couldn't be opened, RegOpenKeyA returned (%u)\n", dwRet);
407 HKEY hKeyTest, hKeyS;
445 ok( 0,
"Could not set up SHDeleteKey test\n");
450 static const WCHAR subkeyW[] = {
's',
'u',
'b',
'k',
'e',
'y',0};
453 if (!pSHRegCreateUSKeyW)
455 win_skip(
"SHRegCreateUSKeyW not available\n");
465 static const WCHAR localW[] = {
'S',
'o',
'f',
't',
'w',
'a',
'r',
'e',0};
469 if (!pSHRegOpenUSKeyW || !pSHRegCloseUSKey)
471 win_skip(
"SHRegOpenUSKeyW or SHRegCloseUSKey not available\n");
481 ret = pSHRegCloseUSKey(
key);
488 ret = pSHRegCloseUSKey(
key);
502 win_skip(
"Too old shlwapi version\n");
int strcmp(const char *String1, const char *String2)
ACPI_SIZE strlen(const char *String)
char * strcpy(char *DstString, const char *SrcString)
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 delete_key(r, p, s)
#define SRRF_RT_REG_EXPAND_SZ
#define SRRF_RT_REG_DWORD
#define SRRF_RT_REG_QWORD
#define SHREGSET_FORCE_HKCU
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