Commit 05988f4f authored by Paul Vriens's avatar Paul Vriens Committed by Alexandre Julliard

shlwapi/tests: Fix some test failures on Vista.

parent 579b8649
......@@ -31,7 +31,7 @@
/* Keys used for testing */
#define REG_TEST_KEY "Software\\Wine\\Test"
#define REG_CURRENT_VERSION "Software\\Microsoft\\Windows\\CurrentVersion"
#define REG_CURRENT_VERSION "Software\\Microsoft\\Windows\\CurrentVersion\\explorer"
static HMODULE hshlwapi;
typedef DWORD (WINAPI *SHCopyKeyA_func)(HKEY,LPCSTR,HKEY,DWORD);
......@@ -284,6 +284,12 @@ static void test_SHCopyKey(void)
HKEY hKeySrc, hKeyDst;
DWORD dwRet;
if (!pSHCopyKeyA)
{
win_skip("SHCopyKeyA is not available\n");
return;
}
/* Delete existing destination sub keys */
hKeyDst = NULL;
if (!RegOpenKeyA(HKEY_CURRENT_USER, REG_TEST_KEY "\\CopyDestination", &hKeyDst) && hKeyDst)
......@@ -305,22 +311,19 @@ static void test_SHCopyKey(void)
if (dwRet || !hKeySrc)
{
ok( 0, "Source couldn't be opened, RegOpenKeyA returned (%u)\n", dwRet);
RegCloseKey(hKeyDst);
return;
}
if (pSHCopyKeyA)
{
dwRet = (*pSHCopyKeyA)(hKeySrc, NULL, hKeyDst, 0);
ok ( ERROR_SUCCESS == dwRet, "Copy failed, ret=(%u)\n", dwRet);
}
dwRet = (*pSHCopyKeyA)(hKeySrc, NULL, hKeyDst, 0);
ok ( ERROR_SUCCESS == dwRet, "Copy failed, ret=(%u)\n", dwRet);
RegCloseKey(hKeySrc);
RegCloseKey(hKeyDst);
/* Check we copied the sub keys, i.e. something that's on every windows system (including Wine) */
hKeyDst = NULL;
dwRet = RegOpenKeyA(HKEY_CURRENT_USER, REG_TEST_KEY "\\CopyDestination\\Setup", &hKeyDst);
dwRet = RegOpenKeyA(HKEY_CURRENT_USER, REG_TEST_KEY "\\CopyDestination\\Shell Folders", &hKeyDst);
if (dwRet || !hKeyDst)
{
ok ( 0, "Copy couldn't be opened, RegOpenKeyA returned (%u)\n", dwRet);
......@@ -328,7 +331,7 @@ static void test_SHCopyKey(void)
}
/* And the we copied the values too */
ok(!SHQueryValueExA(hKeyDst, "BootDir", NULL, NULL, NULL, NULL), "SHQueryValueExA failed\n");
ok(!SHQueryValueExA(hKeyDst, "Common AppData", NULL, NULL, NULL, NULL), "SHQueryValueExA failed\n");
RegCloseKey(hKeyDst);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment