From 156dad05c08cd921288aedf1b281ff23844a1692 Mon Sep 17 00:00:00 2001 From: Paul Vriens Date: Mon, 26 May 2008 17:42:15 +0200 Subject: [PATCH] setupapi/tests: Test registry after testDeviceRegistryProperty. --- dlls/setupapi/tests/devinst.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/dlls/setupapi/tests/devinst.c b/dlls/setupapi/tests/devinst.c index aacd8a5d816..07497d45876 100644 --- a/dlls/setupapi/tests/devinst.c +++ b/dlls/setupapi/tests/devinst.c @@ -1046,6 +1046,10 @@ static void testDeviceRegistryPropertyA() DWORD size; DWORD regType; BOOL ret; + LONG res; + HKEY key; + static const CHAR bogus[] = + "System\\CurrentControlSet\\Enum\\Root\\LEGACY_BOGUS"; SetLastError(0xdeadbeef); set = pSetupDiGetClassDevsA(&guid, NULL, 0, DIGCF_DEVICEINTERFACE); @@ -1122,6 +1126,17 @@ static void testDeviceRegistryPropertyA() ok(!ret && GetLastError() == ERROR_INVALID_DATA, "Expected ERROR_INVALID_DATA, got %08x\n", GetLastError()); pSetupDiDestroyDeviceInfoList(set); + + res = RegOpenKeyA(HKEY_LOCAL_MACHINE, bogus, &key); + todo_wine + ok(res == ERROR_FILE_NOT_FOUND, "Expected key to not exist\n"); + /* FIXME: Remove when Wine is fixed */ + if (res == ERROR_SUCCESS) + { + /* Wine doesn't delete the information currently */ + trace("We are most likely on Wine\n"); + RegDeleteKeyA(HKEY_LOCAL_MACHINE, bogus); + } } static void testDeviceRegistryPropertyW() @@ -1135,6 +1150,12 @@ static void testDeviceRegistryPropertyW() DWORD size; DWORD regType; BOOL ret; + LONG res; + HKEY key; + static const WCHAR bogus[] = {'S','y','s','t','e','m','\\', + 'C','u','r','r','e','n','t','C','o','n','t','r','o','l','S','e','t','\\', + 'E','n','u','m','\\','R','o','o','t','\\', + 'L','E','G','A','C','Y','_','B','O','G','U','S',0}; SetLastError(0xdeadbeef); set = pSetupDiGetClassDevsW(&guid, NULL, 0, DIGCF_DEVICEINTERFACE); @@ -1216,6 +1237,17 @@ static void testDeviceRegistryPropertyW() ok(!ret && GetLastError() == ERROR_INVALID_DATA, "Expected ERROR_INVALID_DATA, got %08x\n", GetLastError()); pSetupDiDestroyDeviceInfoList(set); + + res = RegOpenKeyW(HKEY_LOCAL_MACHINE, bogus, &key); + todo_wine + ok(res == ERROR_FILE_NOT_FOUND, "Expected key to not exist\n"); + /* FIXME: Remove when Wine is fixed */ + if (res == ERROR_SUCCESS) + { + /* Wine doesn't delete the information currently */ + trace("We are most likely on Wine\n"); + RegDeleteKeyW(HKEY_LOCAL_MACHINE, bogus); + } } START_TEST(devinst) -- 2.11.4.GIT