Zhiyi Zhang : setupapi/tests: Test phantom value after device creation.
Alexandre Julliard
julliard at winehq.org
Mon Mar 18 16:20:13 CDT 2019
Module: wine
Branch: master
Commit: 35673c7e8e0709276fe6f0bb2727da3da438ec11
URL: https://source.winehq.org/git/wine.git/?a=commit;h=35673c7e8e0709276fe6f0bb2727da3da438ec11
Author: Zhiyi Zhang <zzhang at codeweavers.com>
Date: Fri Mar 15 11:40:41 2019 +0800
setupapi/tests: Test phantom value after device creation.
Signed-off-by: Zhiyi Zhang <zzhang at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/setupapi/tests/devinst.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/dlls/setupapi/tests/devinst.c b/dlls/setupapi/tests/devinst.c
index 004a956..3add9b2 100644
--- a/dlls/setupapi/tests/devinst.c
+++ b/dlls/setupapi/tests/devinst.c
@@ -742,6 +742,11 @@ static void test_register_device_info(void)
SP_DEVINFO_DATA device = {0};
BOOL ret;
HDEVINFO set;
+ HKEY hkey;
+ LSTATUS ls;
+ DWORD type = 0;
+ DWORD phantom = 0;
+ DWORD size;
int i = 0;
SetLastError(0xdeadbeef);
@@ -770,8 +775,19 @@ static void test_register_device_info(void)
ret = SetupDiCreateDeviceInfoA(set, "Root\\LEGACY_BOGUS\\0000", &guid, NULL, NULL, 0, &device);
ok(ret, "Failed to create device, error %#x.\n", GetLastError());
+ RegOpenKeyA(HKEY_LOCAL_MACHINE, "SYSTEM\\CurrentControlSet\\Enum\\ROOT\\LEGACY_BOGUS\\0000", &hkey);
+ size = sizeof(phantom);
+ ls = RegQueryValueExA(hkey, "Phantom", NULL, &type, (BYTE *)&phantom, &size);
+ todo_wine ok(ls == ERROR_SUCCESS, "Got wrong error code %#x\n", ls);
+ todo_wine ok(phantom == 1, "Got wrong phantom value %d\n", phantom);
+ todo_wine ok(type == REG_DWORD, "Got wrong phantom type %#x\n", type);
+ ok(size == sizeof(phantom), "Got wrong phantom size %d\n", size);
ret = SetupDiRegisterDeviceInfo(set, &device, 0, NULL, NULL, NULL);
ok(ret, "Failed to register device, error %#x.\n", GetLastError());
+ size = sizeof(phantom);
+ ls = RegQueryValueExA(hkey, "Phantom", NULL, NULL, (BYTE *)&phantom, &size);
+ ok(ls == ERROR_FILE_NOT_FOUND, "Got wrong error code %#x\n", ls);
+ RegCloseKey(hkey);
ret = SetupDiCreateDeviceInfoA(set, "Root\\LEGACY_BOGUS\\0001", &guid, NULL, NULL, 0, &device);
ok(ret, "Failed to create device, error %#x.\n", GetLastError());
More information about the wine-cvs
mailing list