Signed-off-by: Rémi Bernon rbernon@codeweavers.com ---
Looks like my attempt to move driver tests around will need some thought so I'm sending the HID tests changes in ntoskrnl.exe/tests instead, as there'll be exhibiting a few things that need fixing.
Also sending a few ntoskrnl.exe tests improvements to fix a few potential spurious failures, especially when running the tests several times, where there's sometimes stale devices laying around.
I'll probably then duplicate the code for DInput driver-based tests.
The first patch may just be skipped, otherwise Marvin was going to complain on every other patch.
dlls/ntoskrnl.exe/tests/ntoskrnl.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/dlls/ntoskrnl.exe/tests/ntoskrnl.c b/dlls/ntoskrnl.exe/tests/ntoskrnl.c index dc10497caee..e3afd46181c 100644 --- a/dlls/ntoskrnl.exe/tests/ntoskrnl.c +++ b/dlls/ntoskrnl.exe/tests/ntoskrnl.c @@ -946,7 +946,7 @@ static void do_return_status(ULONG ioctl, struct return_status_params *params) static void test_return_status(void) { struct return_status_params params; - unsigned int i, j, k; + unsigned int i, j, k, old_threshold;
static const ULONG method_tests[] = { @@ -979,12 +979,15 @@ static void test_return_status(void) params.ret_status = status_tests[i]; params.iosb_status = status_tests[j];
- winetest_push_context("return 0x%08x, iosb 0x%08x, pending %d, method %u", - params.ret_status, params.iosb_status, params.pending, method_tests[k] & 3); + trace("testing return 0x%08x, iosb 0x%08x, pending %d, method %u\n", + params.ret_status, params.iosb_status, params.pending, method_tests[k] & 3); + old_threshold = winetest_mute_threshold; + winetest_mute_threshold = 1;
do_return_status(method_tests[k], ¶ms);
- winetest_pop_context(); + winetest_mute_threshold = old_threshold; + trace("done\n"); } } }
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/ntoskrnl.exe/tests/ntoskrnl.c | 323 +++++++++++------------------ 1 file changed, 116 insertions(+), 207 deletions(-)
diff --git a/dlls/ntoskrnl.exe/tests/ntoskrnl.c b/dlls/ntoskrnl.exe/tests/ntoskrnl.c index e3afd46181c..bd16038073f 100644 --- a/dlls/ntoskrnl.exe/tests/ntoskrnl.c +++ b/dlls/ntoskrnl.exe/tests/ntoskrnl.c @@ -1345,6 +1345,118 @@ static void add_file_to_catalog(HANDLE catalog, const WCHAR *file) } }
+static void driver_stop(void) +{ + SP_DEVINFO_DATA device = {sizeof(SP_DEVINFO_DATA)}; + WCHAR path[MAX_PATH], dest[MAX_PATH], *filepart; + SC_HANDLE manager, service; + HDEVINFO set; + HANDLE file; + BOOL ret; + + set = SetupDiCreateDeviceInfoList(NULL, NULL); + ok(set != INVALID_HANDLE_VALUE, "failed to create device list, error %u\n", GetLastError()); + + ret = SetupDiOpenDeviceInfoW(set, L"root\winetest\0", NULL, 0, &device); + ok(ret, "failed to open device, error %u\n", GetLastError()); + + ret = SetupDiCallClassInstaller(DIF_REMOVE, set, &device); + ok(ret, "failed to remove device, error %u\n", GetLastError()); + + file = CreateFileW(L"\\?\root#winetest#0#{deadbeef-29ef-4538-a5fd-b69573a362c0}", 0, 0, NULL, OPEN_EXISTING, 0, NULL); + ok(file == INVALID_HANDLE_VALUE, "expected failure\n"); + ok(GetLastError() == ERROR_FILE_NOT_FOUND, "got error %u\n", GetLastError()); + + ret = SetupDiDestroyDeviceInfoList(set); + ok(ret, "failed to destroy set, error %u\n", GetLastError()); + + /* Windows stops the service but does not delete it. */ + manager = OpenSCManagerW(NULL, NULL, SC_MANAGER_CONNECT); + ok(!!manager, "failed to open service manager, error %u\n", GetLastError()); + service = OpenServiceW(manager, L"winetest", SERVICE_STOP | DELETE); + ok(!!service, "failed to open service, error %u\n", GetLastError()); + + unload_driver(service); + CloseServiceHandle(manager); + + cat_okfile(); + + GetFullPathNameW(L"winetest.inf", sizeof(path), path, NULL); + ret = SetupCopyOEMInfW(path, NULL, 0, 0, dest, sizeof(dest), NULL, &filepart); + ok(ret, "Failed to copy INF, error %u\n", GetLastError()); + ret = SetupUninstallOEMInfW(filepart, 0, NULL); + ok(ret, "Failed to uninstall INF, error %u\n", GetLastError()); + + ret = DeleteFileW(L"winetest.cat"); + ok(ret, "Failed to delete file, error %u\n", GetLastError()); + ret = DeleteFileW(L"winetest.inf"); + ok(ret, "Failed to delete file, error %u\n", GetLastError()); + ret = DeleteFileW(L"winetest.sys"); + ok(ret, "Failed to delete file, error %u\n", GetLastError()); + /* Windows 10 apparently deletes the image in SetupUninstallOEMInf(). */ + ret = DeleteFileW(L"C:/windows/system32/drivers/winetest.sys"); + ok(ret || GetLastError() == ERROR_FILE_NOT_FOUND, "Failed to delete file, error %u\n", GetLastError()); +} + +static void driver_start(struct testsign_context *ctx, const WCHAR *resource) +{ + static const WCHAR hardware_id[] = L"test_hardware_id\0"; + SP_DEVINFO_DATA device = {sizeof(SP_DEVINFO_DATA)}; + WCHAR path[MAX_PATH], filename[MAX_PATH]; + BOOL ret, need_reboot; + HANDLE catalog; + HDEVINFO set; + FILE *f; + + load_resource(resource, filename); + ret = MoveFileExW(filename, L"winetest.sys", MOVEFILE_COPY_ALLOWED | MOVEFILE_REPLACE_EXISTING); + ok(ret, "failed to move file, error %u\n", GetLastError()); + + f = fopen("winetest.inf", "w"); + ok(!!f, "failed to open winetest.inf: %s\n", strerror(errno)); + fputs(inf_text, f); + fclose(f); + + /* Create the catalog file. */ + + catalog = CryptCATOpen((WCHAR *)L"winetest.cat", CRYPTCAT_OPEN_CREATENEW, 0, CRYPTCAT_VERSION_1, 0); + ok(catalog != INVALID_HANDLE_VALUE, "Failed to create catalog, error %u\n", GetLastError()); + + add_file_to_catalog(catalog, L"winetest.sys"); + add_file_to_catalog(catalog, L"winetest.inf"); + + ret = CryptCATPersistStore(catalog); + todo_wine ok(ret, "Failed to write catalog, error %u\n", GetLastError()); + + ret = CryptCATClose(catalog); + ok(ret, "Failed to close catalog, error %u\n", GetLastError()); + + testsign_sign(ctx, L"winetest.cat"); + + /* Install the driver. */ + + set = SetupDiCreateDeviceInfoList(NULL, NULL); + ok(set != INVALID_HANDLE_VALUE, "failed to create device list, error %u\n", GetLastError()); + + ret = SetupDiCreateDeviceInfoW(set, L"root\winetest\0", &GUID_NULL, NULL, NULL, 0, &device); + ok(ret, "failed to create device, error %u\n", GetLastError()); + + ret = SetupDiSetDeviceRegistryPropertyW( set, &device, SPDRP_HARDWAREID, + (const BYTE *)hardware_id, sizeof(hardware_id) ); + ok(ret, "failed to create set hardware ID, error %u\n", GetLastError()); + + ret = SetupDiCallClassInstaller(DIF_REGISTERDEVICE, set, &device); + ok(ret, "failed to register device, error %u\n", GetLastError()); + + ret = SetupDiDestroyDeviceInfoList(set); + ok(ret, "failed to destroy set, error %u\n", GetLastError()); + + GetFullPathNameW(L"winetest.inf", sizeof(path), path, NULL); + ret = UpdateDriverForPlugAndPlayDevicesW(NULL, hardware_id, path, INSTALLFLAG_FORCE, &need_reboot); + ok(ret, "failed to install device, error %u\n", GetLastError()); + ok(!need_reboot, "expected no reboot necessary\n"); +} + static const GUID bus_class = {0xdeadbeef, 0x29ef, 0x4538, {0xa5, 0xfd, 0xb6, 0x95, 0x73, 0xa3, 0x62, 0xc1}}; static const GUID child_class = {0xdeadbeef, 0x29ef, 0x4538, {0xa5, 0xfd, 0xb6, 0x95, 0x73, 0xa3, 0x62, 0xc2}};
@@ -1703,127 +1815,16 @@ static void test_pnp_devices(void)
static void test_pnp_driver(struct testsign_context *ctx) { - static const char hardware_id[] = "test_hardware_id\0"; - char path[MAX_PATH], dest[MAX_PATH], *filepart; SP_DEVINFO_DATA device = {sizeof(device)}; char cwd[MAX_PATH], tempdir[MAX_PATH]; - WCHAR driver_filename[MAX_PATH]; - SC_HANDLE manager, service; - BOOL ret, need_reboot; - HANDLE catalog, file; - unsigned int i; - HDEVINFO set; - FILE *f;
GetCurrentDirectoryA(ARRAY_SIZE(cwd), cwd); GetTempPathA(ARRAY_SIZE(tempdir), tempdir); SetCurrentDirectoryA(tempdir);
- load_resource(L"driver_pnp.dll", driver_filename); - ret = MoveFileExW(driver_filename, L"winetest.sys", MOVEFILE_COPY_ALLOWED | MOVEFILE_REPLACE_EXISTING); - ok(ret, "failed to move file, error %u\n", GetLastError()); - - f = fopen("winetest.inf", "w"); - ok(!!f, "failed to open winetest.inf: %s\n", strerror(errno)); - fputs(inf_text, f); - fclose(f); - - /* Create the catalog file. */ - - catalog = CryptCATOpen((WCHAR *)L"winetest.cat", CRYPTCAT_OPEN_CREATENEW, 0, CRYPTCAT_VERSION_1, 0); - ok(catalog != INVALID_HANDLE_VALUE, "Failed to create catalog, error %#x\n", GetLastError()); - - ret = !!CryptCATPutCatAttrInfo(catalog, (WCHAR *)L"HWID1", - CRYPTCAT_ATTR_NAMEASCII | CRYPTCAT_ATTR_DATAASCII | CRYPTCAT_ATTR_AUTHENTICATED, - sizeof(L"test_hardware_id"), (BYTE *)L"test_hardware_id"); - todo_wine ok(ret, "failed to add attribute, error %#x\n", GetLastError()); - - ret = !!CryptCATPutCatAttrInfo(catalog, (WCHAR *)L"OS", - CRYPTCAT_ATTR_NAMEASCII | CRYPTCAT_ATTR_DATAASCII | CRYPTCAT_ATTR_AUTHENTICATED, - sizeof(L"VistaX64"), (BYTE *)L"VistaX64"); - todo_wine ok(ret, "failed to add attribute, error %#x\n", GetLastError()); - - add_file_to_catalog(catalog, L"winetest.sys"); - add_file_to_catalog(catalog, L"winetest.inf"); - - ret = CryptCATPersistStore(catalog); - todo_wine ok(ret, "Failed to write catalog, error %u\n", GetLastError()); - - ret = CryptCATClose(catalog); - ok(ret, "Failed to close catalog, error %u\n", GetLastError()); - - testsign_sign(ctx, L"winetest.cat"); - - /* Install the driver. */ - - set = SetupDiCreateDeviceInfoList(NULL, NULL); - ok(set != INVALID_HANDLE_VALUE, "failed to create device list, error %#x\n", GetLastError()); - - ret = SetupDiCreateDeviceInfoA(set, "root\winetest\0", &GUID_NULL, NULL, NULL, 0, &device); - ok(ret, "failed to create device, error %#x\n", GetLastError()); - - ret = SetupDiSetDeviceRegistryPropertyA( set, &device, SPDRP_HARDWAREID, - (const BYTE *)hardware_id, sizeof(hardware_id) ); - ok(ret, "failed to create set hardware ID, error %#x\n", GetLastError()); - - ret = SetupDiCallClassInstaller(DIF_REGISTERDEVICE, set, &device); - ok(ret, "failed to register device, error %#x\n", GetLastError()); - - GetFullPathNameA("winetest.inf", sizeof(path), path, NULL); - ret = UpdateDriverForPlugAndPlayDevicesA(NULL, hardware_id, path, INSTALLFLAG_FORCE, &need_reboot); - ok(ret, "failed to install device, error %#x\n", GetLastError()); - ok(!need_reboot, "expected no reboot necessary\n"); - - /* Tests. */ - + driver_start(ctx, L"driver_pnp.dll"); test_pnp_devices(); - - /* Clean up. */ - - ret = SetupDiCallClassInstaller(DIF_REMOVE, set, &device); - ok(ret, "failed to remove device, error %#x\n", GetLastError()); - - file = CreateFileA("\\?\root#winetest#0#{deadbeef-29ef-4538-a5fd-b69573a362c0}", 0, 0, NULL, OPEN_EXISTING, 0, NULL); - ok(file == INVALID_HANDLE_VALUE, "expected failure\n"); - ok(GetLastError() == ERROR_FILE_NOT_FOUND, "got error %u\n", GetLastError()); - - ret = SetupDiDestroyDeviceInfoList(set); - ok(ret, "failed to destroy set, error %#x\n", GetLastError()); - - set = SetupDiGetClassDevsA(NULL, "wine", NULL, DIGCF_ALLCLASSES); - ok(set != INVALID_HANDLE_VALUE, "failed to get device list, error %#x\n", GetLastError()); - - for (i = 0; SetupDiEnumDeviceInfo(set, i, &device); ++i) - { - ret = SetupDiCallClassInstaller(DIF_REMOVE, set, &device); - ok(ret, "failed to remove device, error %#x\n", GetLastError()); - } - - /* Windows stops the service but does not delete it. */ - manager = OpenSCManagerA(NULL, NULL, SC_MANAGER_CONNECT); - ok(!!manager, "failed to open service manager, error %u\n", GetLastError()); - service = OpenServiceA(manager, "winetest", SERVICE_STOP | DELETE); - ok(!!service, "failed to open service, error %u\n", GetLastError()); - unload_driver(service); - CloseServiceHandle(manager); - - cat_okfile(); - - GetFullPathNameA("winetest.inf", sizeof(path), path, NULL); - ret = SetupCopyOEMInfA(path, NULL, 0, 0, dest, sizeof(dest), NULL, &filepart); - ok(ret, "Failed to copy INF, error %#x\n", GetLastError()); - ret = SetupUninstallOEMInfA(filepart, 0, NULL); - ok(ret, "Failed to uninstall INF, error %u\n", GetLastError()); - - ret = DeleteFileA("winetest.cat"); - ok(ret, "Failed to delete file, error %u\n", GetLastError()); - ret = DeleteFileA("winetest.inf"); - ok(ret, "Failed to delete file, error %u\n", GetLastError()); - ret = DeleteFileA("winetest.sys"); - ok(ret, "Failed to delete file, error %u\n", GetLastError()); - /* Windows 10 apparently deletes the image in SetupUninstallOEMInf(). */ - ret = DeleteFileA("C:/windows/system32/drivers/winetest.sys"); - ok(ret || GetLastError() == ERROR_FILE_NOT_FOUND, "Failed to delete file, error %u\n", GetLastError()); + driver_stop();
SetCurrentDirectoryA(cwd); } @@ -3300,18 +3301,9 @@ static void test_hid_device(DWORD report_id, DWORD polled)
static void test_hid_driver(struct testsign_context *ctx, DWORD report_id, DWORD polled) { - static const char hardware_id[] = "test_hardware_id\0"; - char path[MAX_PATH], dest[MAX_PATH], *filepart; - SP_DEVINFO_DATA device = {sizeof(device)}; char cwd[MAX_PATH], tempdir[MAX_PATH]; - WCHAR driver_filename[MAX_PATH]; - SC_HANDLE manager, service; - BOOL ret, need_reboot; - HANDLE catalog, file; LSTATUS status; - HDEVINFO set; HKEY hkey; - FILE *f;
GetCurrentDirectoryA(ARRAY_SIZE(cwd), cwd); GetTempPathA(ARRAY_SIZE(tempdir), tempdir); @@ -3326,92 +3318,9 @@ static void test_hid_driver(struct testsign_context *ctx, DWORD report_id, DWORD status = RegSetValueExW(hkey, L"PolledMode", 0, REG_DWORD, (void *)&polled, sizeof(polled)); ok(!status, "RegSetValueExW returned %#x\n", status);
- load_resource(L"driver_hid.dll", driver_filename); - ret = MoveFileExW(driver_filename, L"winetest.sys", MOVEFILE_COPY_ALLOWED | MOVEFILE_REPLACE_EXISTING); - ok(ret, "failed to move file, error %u\n", GetLastError()); - - f = fopen("winetest.inf", "w"); - ok(!!f, "failed to open winetest.inf: %s\n", strerror(errno)); - fputs(inf_text, f); - fclose(f); - - /* Create the catalog file. */ - - catalog = CryptCATOpen((WCHAR *)L"winetest.cat", CRYPTCAT_OPEN_CREATENEW, 0, CRYPTCAT_VERSION_1, 0); - ok(catalog != INVALID_HANDLE_VALUE, "Failed to create catalog, error %#x\n", GetLastError()); - - add_file_to_catalog(catalog, L"winetest.sys"); - add_file_to_catalog(catalog, L"winetest.inf"); - - ret = CryptCATPersistStore(catalog); - todo_wine ok(ret, "Failed to write catalog, error %u\n", GetLastError()); - - ret = CryptCATClose(catalog); - ok(ret, "Failed to close catalog, error %u\n", GetLastError()); - - testsign_sign(ctx, L"winetest.cat"); - - /* Install the driver. */ - - set = SetupDiCreateDeviceInfoList(NULL, NULL); - ok(set != INVALID_HANDLE_VALUE, "failed to create device list, error %#x\n", GetLastError()); - - ret = SetupDiCreateDeviceInfoA(set, "root\winetest\0", &GUID_NULL, NULL, NULL, 0, &device); - ok(ret, "failed to create device, error %#x\n", GetLastError()); - - ret = SetupDiSetDeviceRegistryPropertyA( set, &device, SPDRP_HARDWAREID, - (const BYTE *)hardware_id, sizeof(hardware_id) ); - ok(ret, "failed to create set hardware ID, error %#x\n", GetLastError()); - - ret = SetupDiCallClassInstaller(DIF_REGISTERDEVICE, set, &device); - ok(ret, "failed to register device, error %#x\n", GetLastError()); - - GetFullPathNameA("winetest.inf", sizeof(path), path, NULL); - ret = UpdateDriverForPlugAndPlayDevicesA(NULL, hardware_id, path, INSTALLFLAG_FORCE, &need_reboot); - ok(ret, "failed to install device, error %#x\n", GetLastError()); - ok(!need_reboot, "expected no reboot necessary\n"); - - /* Tests. */ - + driver_start(ctx, L"driver_hid.dll"); test_hid_device(report_id, polled); - - /* Clean up. */ - - ret = SetupDiCallClassInstaller(DIF_REMOVE, set, &device); - ok(ret, "failed to remove device, error %#x\n", GetLastError()); - - file = CreateFileA("\\?\root#winetest#0#{deadbeef-29ef-4538-a5fd-b69573a362c0}", 0, 0, NULL, OPEN_EXISTING, 0, NULL); - ok(file == INVALID_HANDLE_VALUE, "expected failure\n"); - ok(GetLastError() == ERROR_FILE_NOT_FOUND, "got error %u\n", GetLastError()); - - ret = SetupDiDestroyDeviceInfoList(set); - ok(ret, "failed to destroy set, error %#x\n", GetLastError()); - - /* Windows stops the service but does not delete it. */ - manager = OpenSCManagerA(NULL, NULL, SC_MANAGER_CONNECT); - ok(!!manager, "failed to open service manager, error %u\n", GetLastError()); - service = OpenServiceA(manager, "winetest", SERVICE_STOP | DELETE); - ok(!!service, "failed to open service, error %u\n", GetLastError()); - unload_driver(service); - CloseServiceHandle(manager); - - cat_okfile(); - - GetFullPathNameA("winetest.inf", sizeof(path), path, NULL); - ret = SetupCopyOEMInfA(path, NULL, 0, 0, dest, sizeof(dest), NULL, &filepart); - ok(ret, "Failed to copy INF, error %#x\n", GetLastError()); - ret = SetupUninstallOEMInfA(filepart, 0, NULL); - ok(ret, "Failed to uninstall INF, error %u\n", GetLastError()); - - ret = DeleteFileA("winetest.cat"); - ok(ret, "Failed to delete file, error %u\n", GetLastError()); - ret = DeleteFileA("winetest.inf"); - ok(ret, "Failed to delete file, error %u\n", GetLastError()); - ret = DeleteFileA("winetest.sys"); - ok(ret, "Failed to delete file, error %u\n", GetLastError()); - /* Windows 10 apparently deletes the image in SetupUninstallOEMInf(). */ - ret = DeleteFileA("C:/windows/system32/drivers/winetest.sys"); - ok(ret || GetLastError() == ERROR_FILE_NOT_FOUND, "Failed to delete file, error %u\n", GetLastError()); + driver_stop();
SetCurrentDirectoryA(cwd); }
On 9/2/21 2:24 AM, Rémi Bernon wrote:
Signed-off-by: Rémi Bernon rbernon@codeweavers.com
dlls/ntoskrnl.exe/tests/ntoskrnl.c | 323 +++++++++++------------------ 1 file changed, 116 insertions(+), 207 deletions(-)
diff --git a/dlls/ntoskrnl.exe/tests/ntoskrnl.c b/dlls/ntoskrnl.exe/tests/ntoskrnl.c index e3afd46181c..bd16038073f 100644 --- a/dlls/ntoskrnl.exe/tests/ntoskrnl.c +++ b/dlls/ntoskrnl.exe/tests/ntoskrnl.c @@ -1345,6 +1345,118 @@ static void add_file_to_catalog(HANDLE catalog, const WCHAR *file) } }
+static void driver_stop(void)
These are PnP-specific, that could ideally be reflected in the function names.
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/ntoskrnl.exe/tests/ntoskrnl.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/dlls/ntoskrnl.exe/tests/ntoskrnl.c b/dlls/ntoskrnl.exe/tests/ntoskrnl.c index bd16038073f..ee8194fd1d0 100644 --- a/dlls/ntoskrnl.exe/tests/ntoskrnl.c +++ b/dlls/ntoskrnl.exe/tests/ntoskrnl.c @@ -92,10 +92,11 @@ struct testsign_context HCERTSTORE root_store, publisher_store; };
+static const WCHAR container_name[] = L"wine_testsign"; + static BOOL testsign_create_cert(struct testsign_context *ctx) { BYTE encoded_name[100], encoded_key_id[200], public_key_info_buffer[1000]; - WCHAR container_name[26]; BYTE hash_buffer[16], cert_buffer[1000], provider_nameA[100], serial[16]; CERT_PUBLIC_KEY_INFO *public_key_info = (CERT_PUBLIC_KEY_INFO *)public_key_info_buffer; CRYPT_KEY_PROV_INFO provider_info = {0}; @@ -110,10 +111,13 @@ static BOOL testsign_create_cert(struct testsign_context *ctx)
memset(ctx, 0, sizeof(*ctx));
- srand(time(NULL)); - swprintf(container_name, ARRAY_SIZE(container_name), L"wine_testsign%u", rand()); - ret = CryptAcquireContextW(&ctx->provider, container_name, NULL, PROV_RSA_FULL, CRYPT_NEWKEYSET); + if (!ret && GetLastError() == NTE_EXISTS) + { + ret = CryptAcquireContextW(&ctx->provider, container_name, NULL, PROV_RSA_FULL, CRYPT_DELETEKEYSET); + ok(ret, "Failed to delete container, error %#x\n", GetLastError()); + ret = CryptAcquireContextW(&ctx->provider, container_name, NULL, PROV_RSA_FULL, CRYPT_NEWKEYSET); + } ok(ret, "Failed to create container, error %#x\n", GetLastError());
ret = CryptGenKey(ctx->provider, AT_SIGNATURE, CRYPT_EXPORTABLE, &key); @@ -245,6 +249,9 @@ static void testsign_cleanup(struct testsign_context *ctx)
ret = CryptReleaseContext(ctx->provider, 0); ok(ret, "failed to release context, error %u\n", GetLastError()); + + ret = CryptAcquireContextW(&ctx->provider, container_name, NULL, PROV_RSA_FULL, CRYPT_DELETEKEYSET); + ok(ret, "Failed to delete container, error %#x\n", GetLastError()); }
static void testsign_sign(struct testsign_context *ctx, const WCHAR *filename)
Signed-off-by: Zebediah Figura zfigura@codeweavers.com
On 9/2/21 7:04 PM, Zebediah Figura (she/her) wrote:
Signed-off-by: Zebediah Figura zfigura@codeweavers.com
Thanks, but FWIW I sent a v2 of these patches right after, because PATCH 2 was broken. I don't think this one did change though.
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/ntoskrnl.exe/tests/ntoskrnl.c | 33 ++++++++++++++---------------- 1 file changed, 15 insertions(+), 18 deletions(-)
diff --git a/dlls/ntoskrnl.exe/tests/ntoskrnl.c b/dlls/ntoskrnl.exe/tests/ntoskrnl.c index ee8194fd1d0..c8c6354b793 100644 --- a/dlls/ntoskrnl.exe/tests/ntoskrnl.c +++ b/dlls/ntoskrnl.exe/tests/ntoskrnl.c @@ -87,7 +87,6 @@ static void load_resource(const WCHAR *name, WCHAR *filename)
struct testsign_context { - HCRYPTPROV provider; const CERT_CONTEXT *cert, *root_cert, *publisher_cert; HCERTSTORE root_store, publisher_store; }; @@ -105,26 +104,27 @@ static BOOL testsign_create_cert(struct testsign_context *ctx) CERT_INFO cert_info = {0}; WCHAR provider_nameW[100]; CERT_EXTENSION extension; + HCRYPTPROV provider; HCRYPTKEY key; DWORD size; BOOL ret;
memset(ctx, 0, sizeof(*ctx));
- ret = CryptAcquireContextW(&ctx->provider, container_name, NULL, PROV_RSA_FULL, CRYPT_NEWKEYSET); + ret = CryptAcquireContextW(&provider, container_name, NULL, PROV_RSA_FULL, CRYPT_NEWKEYSET); if (!ret && GetLastError() == NTE_EXISTS) { - ret = CryptAcquireContextW(&ctx->provider, container_name, NULL, PROV_RSA_FULL, CRYPT_DELETEKEYSET); + ret = CryptAcquireContextW(&provider, container_name, NULL, PROV_RSA_FULL, CRYPT_DELETEKEYSET); ok(ret, "Failed to delete container, error %#x\n", GetLastError()); - ret = CryptAcquireContextW(&ctx->provider, container_name, NULL, PROV_RSA_FULL, CRYPT_NEWKEYSET); + ret = CryptAcquireContextW(&provider, container_name, NULL, PROV_RSA_FULL, CRYPT_NEWKEYSET); } ok(ret, "Failed to create container, error %#x\n", GetLastError());
- ret = CryptGenKey(ctx->provider, AT_SIGNATURE, CRYPT_EXPORTABLE, &key); + ret = CryptGenKey(provider, AT_SIGNATURE, CRYPT_EXPORTABLE, &key); ok(ret, "Failed to create key, error %#x\n", GetLastError()); ret = CryptDestroyKey(key); ok(ret, "Failed to destroy key, error %#x\n", GetLastError()); - ret = CryptGetUserKey(ctx->provider, AT_SIGNATURE, &key); + ret = CryptGetUserKey(provider, AT_SIGNATURE, &key); ok(ret, "Failed to get user key, error %#x\n", GetLastError()); ret = CryptDestroyKey(key); ok(ret, "Failed to destroy key, error %#x\n", GetLastError()); @@ -136,12 +136,12 @@ static BOOL testsign_create_cert(struct testsign_context *ctx) key_info.CertIssuer.pbData = encoded_name;
size = sizeof(public_key_info_buffer); - ret = CryptExportPublicKeyInfo(ctx->provider, AT_SIGNATURE, X509_ASN_ENCODING, public_key_info, &size); + ret = CryptExportPublicKeyInfo(provider, AT_SIGNATURE, X509_ASN_ENCODING, public_key_info, &size); ok(ret, "Failed to export public key, error %#x\n", GetLastError()); cert_info.SubjectPublicKeyInfo = *public_key_info;
size = sizeof(hash_buffer); - ret = CryptHashPublicKeyInfo(ctx->provider, CALG_MD5, 0, X509_ASN_ENCODING, public_key_info, hash_buffer, &size); + ret = CryptHashPublicKeyInfo(provider, CALG_MD5, 0, X509_ASN_ENCODING, public_key_info, hash_buffer, &size); ok(ret, "Failed to hash public key, error %#x\n", GetLastError());
key_info.KeyId.cbData = size; @@ -172,7 +172,7 @@ static BOOL testsign_create_cert(struct testsign_context *ctx) cert_info.rgExtension = &extension; algid.pszObjId = (char *)szOID_RSA_SHA1RSA; size = sizeof(cert_buffer); - ret = CryptSignAndEncodeCertificate(ctx->provider, AT_SIGNATURE, X509_ASN_ENCODING, + ret = CryptSignAndEncodeCertificate(provider, AT_SIGNATURE, X509_ASN_ENCODING, X509_CERT_TO_BE_SIGNED, &cert_info, &algid, NULL, cert_buffer, &size); ok(ret, "Failed to create certificate, error %#x\n", GetLastError());
@@ -180,7 +180,7 @@ static BOOL testsign_create_cert(struct testsign_context *ctx) ok(!!ctx->cert, "Failed to create context, error %#x\n", GetLastError());
size = sizeof(provider_nameA); - ret = CryptGetProvParam(ctx->provider, PP_NAME, provider_nameA, &size, 0); + ret = CryptGetProvParam(provider, PP_NAME, provider_nameA, &size, 0); ok(ret, "Failed to get prov param, error %#x\n", GetLastError()); MultiByteToWideChar(CP_ACP, 0, (char *)provider_nameA, -1, provider_nameW, ARRAY_SIZE(provider_nameW));
@@ -191,6 +191,9 @@ static BOOL testsign_create_cert(struct testsign_context *ctx) ret = CertSetCertificateContextProperty(ctx->cert, CERT_KEY_PROV_INFO_PROP_ID, 0, &provider_info); ok(ret, "Failed to set provider info, error %#x\n", GetLastError());
+ ret = CryptReleaseContext(provider, 0); + ok(ret, "failed to release context, error %u\n", GetLastError()); + ctx->root_store = CertOpenStore(CERT_STORE_PROV_SYSTEM_REGISTRY_A, 0, 0, CERT_SYSTEM_STORE_LOCAL_MACHINE, "root"); if (!ctx->root_store && GetLastError() == ERROR_ACCESS_DENIED) { @@ -198,8 +201,6 @@ static BOOL testsign_create_cert(struct testsign_context *ctx)
ret = CertFreeCertificateContext(ctx->cert); ok(ret, "Failed to free certificate, error %u\n", GetLastError()); - ret = CryptReleaseContext(ctx->provider, 0); - ok(ret, "failed to release context, error %u\n", GetLastError());
return FALSE; } @@ -213,8 +214,6 @@ static BOOL testsign_create_cert(struct testsign_context *ctx) ok(ret, "Failed to free certificate, error %u\n", GetLastError()); ret = CertCloseStore(ctx->root_store, CERT_CLOSE_STORE_CHECK_FLAG); ok(ret, "Failed to close store, error %u\n", GetLastError()); - ret = CryptReleaseContext(ctx->provider, 0); - ok(ret, "failed to release context, error %u\n", GetLastError());
return FALSE; } @@ -232,6 +231,7 @@ static BOOL testsign_create_cert(struct testsign_context *ctx)
static void testsign_cleanup(struct testsign_context *ctx) { + HCRYPTPROV provider; BOOL ret;
ret = CertFreeCertificateContext(ctx->cert); @@ -247,10 +247,7 @@ static void testsign_cleanup(struct testsign_context *ctx) ret = CertCloseStore(ctx->publisher_store, CERT_CLOSE_STORE_CHECK_FLAG); ok(ret, "Failed to close store, error %u\n", GetLastError());
- ret = CryptReleaseContext(ctx->provider, 0); - ok(ret, "failed to release context, error %u\n", GetLastError()); - - ret = CryptAcquireContextW(&ctx->provider, container_name, NULL, PROV_RSA_FULL, CRYPT_DELETEKEYSET); + ret = CryptAcquireContextW(&provider, container_name, NULL, PROV_RSA_FULL, CRYPT_DELETEKEYSET); ok(ret, "Failed to delete container, error %#x\n", GetLastError()); }
This should help with stale devices when some test crashed.
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/ntoskrnl.exe/tests/ntoskrnl.c | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-)
diff --git a/dlls/ntoskrnl.exe/tests/ntoskrnl.c b/dlls/ntoskrnl.exe/tests/ntoskrnl.c index c8c6354b793..b3ea894c947 100644 --- a/dlls/ntoskrnl.exe/tests/ntoskrnl.c +++ b/dlls/ntoskrnl.exe/tests/ntoskrnl.c @@ -1407,6 +1407,7 @@ static void driver_start(struct testsign_context *ctx, const WCHAR *resource) static const WCHAR hardware_id[] = L"test_hardware_id\0"; SP_DEVINFO_DATA device = {sizeof(SP_DEVINFO_DATA)}; WCHAR path[MAX_PATH], filename[MAX_PATH]; + SC_HANDLE manager, service; BOOL ret, need_reboot; HANDLE catalog; HDEVINFO set; @@ -1443,7 +1444,30 @@ static void driver_start(struct testsign_context *ctx, const WCHAR *resource) ok(set != INVALID_HANDLE_VALUE, "failed to create device list, error %u\n", GetLastError());
ret = SetupDiCreateDeviceInfoW(set, L"root\winetest\0", &GUID_NULL, NULL, NULL, 0, &device); - ok(ret, "failed to create device, error %u\n", GetLastError()); + if (!ret && GetLastError() == ERROR_DEVINST_ALREADY_EXISTS) + { + ret = SetupDiOpenDeviceInfoW(set, L"root\winetest\0", NULL, 0, &device); + ok(ret, "failed to open device, error %#x\n", GetLastError()); + + ret = SetupDiCallClassInstaller(DIF_REMOVE, set, &device); + ok(ret, "failed to remove device, error %u\n", GetLastError()); + + ret = SetupDiDeleteDeviceInfo(set, &device); + ok(ret, "failed to delete device info, error %u\n", GetLastError()); + + /* Windows stops the service but does not delete it. */ + manager = OpenSCManagerW(NULL, NULL, SC_MANAGER_CONNECT); + ok(!!manager, "failed to open service manager, error %u\n", GetLastError()); + + service = OpenServiceW(manager, L"winetest", SERVICE_STOP | DELETE); + if (service) unload_driver(service); + else ok(GetLastError() == ERROR_SERVICE_DOES_NOT_EXIST, "got error %u\n", GetLastError()); + + CloseServiceHandle(manager); + + ret = SetupDiCreateDeviceInfoW(set, L"root\winetest\0", &GUID_NULL, NULL, NULL, 0, &device); + } + ok(ret, "failed to create device, error %#x\n", GetLastError());
ret = SetupDiSetDeviceRegistryPropertyW( set, &device, SPDRP_HARDWAREID, (const BYTE *)hardware_id, sizeof(hardware_id) );
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/ntoskrnl.exe/tests/driver_hid.c | 268 ++------------------------- dlls/ntoskrnl.exe/tests/ntoskrnl.c | 250 +++++++++++++++++++++++++ 2 files changed, 265 insertions(+), 253 deletions(-)
diff --git a/dlls/ntoskrnl.exe/tests/driver_hid.c b/dlls/ntoskrnl.exe/tests/driver_hid.c index ed0767877ac..590483f528f 100644 --- a/dlls/ntoskrnl.exe/tests/driver_hid.c +++ b/dlls/ntoskrnl.exe/tests/driver_hid.c @@ -40,6 +40,8 @@ static UNICODE_STRING control_symlink;
static unsigned int got_start_device; +static char report_descriptor_buf[4096]; +static DWORD report_descriptor_len; static DWORD report_id; static DWORD polled;
@@ -161,253 +163,6 @@ static NTSTATUS WINAPI driver_power(DEVICE_OBJECT *device, IRP *irp)
static NTSTATUS WINAPI driver_internal_ioctl(DEVICE_OBJECT *device, IRP *irp) { -#include "psh_hid_macros.h" -/* Replace REPORT_ID with USAGE_PAGE when id is 0 */ -#define REPORT_ID_OR_USAGE_PAGE(size, id, off) SHORT_ITEM_1((id ? 8 : 0), 1, (id + off)) - const unsigned char report_descriptor[] = - { - USAGE_PAGE(1, HID_USAGE_PAGE_GENERIC), - USAGE(1, HID_USAGE_GENERIC_JOYSTICK), - COLLECTION(1, Application), - USAGE(1, HID_USAGE_GENERIC_JOYSTICK), - COLLECTION(1, Logical), - REPORT_ID_OR_USAGE_PAGE(1, report_id, 0), - USAGE_PAGE(1, HID_USAGE_PAGE_GENERIC), - USAGE(1, HID_USAGE_GENERIC_X), - USAGE(1, HID_USAGE_GENERIC_Y), - LOGICAL_MINIMUM(1, -128), - LOGICAL_MAXIMUM(1, 127), - REPORT_SIZE(1, 8), - REPORT_COUNT(1, 2), - INPUT(1, Data|Var|Abs), - - USAGE_PAGE(1, HID_USAGE_PAGE_BUTTON), - USAGE_MINIMUM(1, 1), - USAGE_MAXIMUM(1, 8), - LOGICAL_MINIMUM(1, 0), - LOGICAL_MAXIMUM(1, 1), - REPORT_COUNT(1, 8), - REPORT_SIZE(1, 1), - INPUT(1, Data|Var|Abs), - - USAGE_MINIMUM(1, 0x18), - USAGE_MAXIMUM(1, 0x1f), - LOGICAL_MINIMUM(1, 0), - LOGICAL_MAXIMUM(1, 1), - REPORT_COUNT(1, 8), - REPORT_SIZE(1, 1), - INPUT(1, Cnst|Var|Abs), - REPORT_COUNT(1, 8), - REPORT_SIZE(1, 1), - INPUT(1, Cnst|Var|Abs), - /* needs to be 8 bit aligned as next has Buff */ - - USAGE_MINIMUM(4, (HID_USAGE_PAGE_KEYBOARD<<16)|0x8), - USAGE_MAXIMUM(4, (HID_USAGE_PAGE_KEYBOARD<<16)|0xf), - LOGICAL_MINIMUM(1, 0), - LOGICAL_MAXIMUM(1, 8), - REPORT_COUNT(1, 2), - REPORT_SIZE(1, 8), - INPUT(2, Data|Ary|Rel|Wrap|Lin|Pref|Null|Vol|Buff), - - /* needs to be 8 bit aligned as previous has Buff */ - USAGE(1, 0x20), - LOGICAL_MINIMUM(1, 0), - LOGICAL_MAXIMUM(1, 1), - REPORT_COUNT(1, 8), - REPORT_SIZE(1, 1), - INPUT(1, Data|Var|Abs), - USAGE_MINIMUM(1, 0x21), - USAGE_MAXIMUM(1, 0x22), - REPORT_COUNT(1, 2), - REPORT_SIZE(1, 0), - INPUT(1, Data|Var|Abs), - USAGE(1, 0x23), - REPORT_COUNT(1, 0), - REPORT_SIZE(1, 1), - INPUT(1, Data|Var|Abs), - - USAGE_PAGE(1, HID_USAGE_PAGE_GENERIC), - USAGE(1, HID_USAGE_GENERIC_HATSWITCH), - LOGICAL_MINIMUM(1, 1), - LOGICAL_MAXIMUM(1, 8), - REPORT_SIZE(1, 4), - REPORT_COUNT(1, 2), - INPUT(1, Data|Var|Abs), - - USAGE_PAGE(1, HID_USAGE_PAGE_GENERIC), - USAGE(1, HID_USAGE_GENERIC_Z), - LOGICAL_MINIMUM(4, 0x00000000), - LOGICAL_MAXIMUM(4, 0x3fffffff), - PHYSICAL_MINIMUM(4, 0x80000000), - PHYSICAL_MAXIMUM(4, 0x7fffffff), - REPORT_SIZE(1, 32), - REPORT_COUNT(1, 1), - INPUT(1, Data|Var|Abs), - - /* reset physical range to its default interpretation */ - USAGE_PAGE(1, HID_USAGE_PAGE_GENERIC), - USAGE(1, HID_USAGE_GENERIC_RX), - PHYSICAL_MINIMUM(4, 0), - PHYSICAL_MAXIMUM(4, 0), - REPORT_SIZE(1, 32), - REPORT_COUNT(1, 1), - INPUT(1, Data|Var|Abs), - - USAGE_PAGE(1, HID_USAGE_PAGE_GENERIC), - USAGE(1, HID_USAGE_GENERIC_RY), - LOGICAL_MINIMUM(4, 0x7fff), - LOGICAL_MAXIMUM(4, 0x0000), - PHYSICAL_MINIMUM(4, 0x0000), - PHYSICAL_MAXIMUM(4, 0x7fff), - REPORT_SIZE(1, 32), - REPORT_COUNT(1, 1), - INPUT(1, Data|Var|Abs), - END_COLLECTION, - - USAGE_PAGE(1, HID_USAGE_PAGE_GENERIC), - USAGE(1, HID_USAGE_GENERIC_JOYSTICK), - COLLECTION(1, Report), - REPORT_ID_OR_USAGE_PAGE(1, report_id, 1), - USAGE_PAGE(1, HID_USAGE_PAGE_BUTTON), - USAGE_MINIMUM(1, 9), - USAGE_MAXIMUM(1, 10), - LOGICAL_MINIMUM(1, 0), - LOGICAL_MAXIMUM(1, 1), - REPORT_COUNT(1, 8), - REPORT_SIZE(1, 1), - INPUT(1, Data|Var|Abs), - END_COLLECTION, - - USAGE_PAGE(1, HID_USAGE_PAGE_LED), - USAGE(1, HID_USAGE_LED_GREEN), - COLLECTION(1, Report), - REPORT_ID_OR_USAGE_PAGE(1, report_id, 0), - USAGE_PAGE(1, HID_USAGE_PAGE_LED), - USAGE(1, 1), - USAGE(1, 2), - USAGE(1, 3), - USAGE(1, 4), - USAGE(1, 5), - USAGE(1, 6), - USAGE(1, 7), - USAGE(1, 8), - LOGICAL_MINIMUM(1, 0), - LOGICAL_MAXIMUM(1, 1), - PHYSICAL_MINIMUM(1, 0), - PHYSICAL_MAXIMUM(1, 1), - REPORT_COUNT(1, 8), - REPORT_SIZE(1, 1), - INPUT(1, Data|Var|Abs), - - USAGE(4, (HID_USAGE_PAGE_KEYBOARD<<16)|0x8c), - USAGE(4, (HID_USAGE_PAGE_KEYBOARD<<16)|0x8d), - USAGE(4, (HID_USAGE_PAGE_KEYBOARD<<16)|0x8e), - USAGE(4, (HID_USAGE_PAGE_KEYBOARD<<16)|0x8f), - LOGICAL_MINIMUM(1, 1), - LOGICAL_MAXIMUM(1, 16), - REPORT_COUNT(1, 2), - REPORT_SIZE(1, 8), - INPUT(1, Data|Ary|Abs), - END_COLLECTION, - - USAGE_PAGE(2, HID_USAGE_PAGE_HAPTICS), - USAGE(1, HID_USAGE_HAPTICS_SIMPLE_CONTROLLER), - COLLECTION(1, Logical), - REPORT_ID_OR_USAGE_PAGE(1, report_id, 0), - USAGE_PAGE(2, HID_USAGE_PAGE_HAPTICS), - - USAGE(1, HID_USAGE_HAPTICS_WAVEFORM_LIST), - COLLECTION(1, NamedArray), - USAGE_PAGE(1, HID_USAGE_PAGE_ORDINAL), - USAGE(1, 3), /* HID_USAGE_HAPTICS_WAVEFORM_RUMBLE */ - USAGE(1, 4), /* HID_USAGE_HAPTICS_WAVEFORM_BUZZ */ - LOGICAL_MINIMUM(2, 0x0000), - LOGICAL_MAXIMUM(2, 0xffff), - REPORT_COUNT(1, 2), - REPORT_SIZE(1, 16), - FEATURE(1, Data|Var|Abs|Null), - END_COLLECTION, - - USAGE_PAGE(2, HID_USAGE_PAGE_HAPTICS), - USAGE(1, HID_USAGE_HAPTICS_DURATION_LIST), - COLLECTION(1, NamedArray), - USAGE_PAGE(1, HID_USAGE_PAGE_ORDINAL), - USAGE(1, 3), /* 0 (HID_USAGE_HAPTICS_WAVEFORM_RUMBLE) */ - USAGE(1, 4), /* 0 (HID_USAGE_HAPTICS_WAVEFORM_BUZZ) */ - LOGICAL_MINIMUM(2, 0x0000), - LOGICAL_MAXIMUM(2, 0xffff), - REPORT_COUNT(1, 2), - REPORT_SIZE(1, 16), - FEATURE(1, Data|Var|Abs|Null), - END_COLLECTION, - - USAGE_PAGE(2, HID_USAGE_PAGE_HAPTICS), - USAGE(1, HID_USAGE_HAPTICS_WAVEFORM_CUTOFF_TIME), - UNIT(2, 0x1001), /* seconds */ - UNIT_EXPONENT(1, -3), /* 10^-3 */ - LOGICAL_MINIMUM(2, 0x8000), - LOGICAL_MAXIMUM(2, 0x7fff), - PHYSICAL_MINIMUM(4, 0x00000000), - PHYSICAL_MAXIMUM(4, 0xffffffff), - REPORT_SIZE(1, 32), - REPORT_COUNT(1, 2), - FEATURE(1, Data|Var|Abs), - /* reset global items */ - UNIT(1, 0), /* None */ - UNIT_EXPONENT(1, 0), - - USAGE_PAGE(1, HID_USAGE_PAGE_GENERIC), - USAGE(1, HID_USAGE_GENERIC_Z), - LOGICAL_MINIMUM(4, 0x0000), - LOGICAL_MAXIMUM(4, 0x7fff), - PHYSICAL_MINIMUM(4, 0xfff90000), - PHYSICAL_MAXIMUM(4, 0x0003ffff), - REPORT_SIZE(1, 32), - REPORT_COUNT(1, 1), - FEATURE(1, Data|Var|Abs), - END_COLLECTION, - - USAGE_PAGE(1, HID_USAGE_PAGE_GENERIC), - USAGE(1, HID_USAGE_GENERIC_JOYSTICK), - COLLECTION(1, Report), - REPORT_ID_OR_USAGE_PAGE(1, report_id, 1), - USAGE_PAGE(1, HID_USAGE_PAGE_BUTTON), - USAGE_MINIMUM(1, 9), - USAGE_MAXIMUM(1, 10), - LOGICAL_MINIMUM(1, 0), - LOGICAL_MAXIMUM(1, 1), - PHYSICAL_MINIMUM(1, 0), - PHYSICAL_MAXIMUM(1, 1), - REPORT_COUNT(1, 8), - REPORT_SIZE(1, 1), - FEATURE(1, Data|Var|Abs), - END_COLLECTION, - - USAGE_PAGE(1, HID_USAGE_PAGE_LED), - USAGE(1, HID_USAGE_LED_GREEN), - COLLECTION(1, Report), - REPORT_ID_OR_USAGE_PAGE(1, report_id, 0), - USAGE_PAGE(1, HID_USAGE_PAGE_LED), - REPORT_COUNT(1, 8), - REPORT_SIZE(1, 1), - OUTPUT(1, Cnst|Var|Abs), - END_COLLECTION, - - USAGE_PAGE(1, HID_USAGE_PAGE_LED), - USAGE(1, HID_USAGE_LED_RED), - COLLECTION(1, Report), - REPORT_ID_OR_USAGE_PAGE(1, report_id, 1), - USAGE_PAGE(1, HID_USAGE_PAGE_LED), - REPORT_COUNT(1, 8), - REPORT_SIZE(1, 1), - OUTPUT(1, Cnst|Var|Abs), - END_COLLECTION, - END_COLLECTION, - }; -#undef REPORT_ID_OR_USAGE_PAGE -#include "pop_hid_macros.h" - IO_STACK_LOCATION *stack = IoGetCurrentIrpStackLocation(irp); HID_DEVICE_EXTENSION *ext = device->DeviceExtension; struct hid_device *impl = ext->MiniDeviceExtension; @@ -455,7 +210,7 @@ static NTSTATUS WINAPI driver_internal_ioctl(DEVICE_OBJECT *device, IRP *irp) desc->bCountry = 0; desc->bNumDescriptors = 1; desc->DescriptorList[0].bReportType = HID_REPORT_DESCRIPTOR_TYPE; - desc->DescriptorList[0].wReportLength = sizeof(report_descriptor); + desc->DescriptorList[0].wReportLength = report_descriptor_len; irp->IoStatus.Information = sizeof(*desc); } ret = STATUS_SUCCESS; @@ -464,12 +219,12 @@ static NTSTATUS WINAPI driver_internal_ioctl(DEVICE_OBJECT *device, IRP *irp)
case IOCTL_HID_GET_REPORT_DESCRIPTOR: ok(!in_size, "got input size %u\n", in_size); - ok(out_size == sizeof(report_descriptor), "got output size %u\n", out_size); + ok(out_size == report_descriptor_len, "got output size %u\n", out_size);
- if (out_size == sizeof(report_descriptor)) + if (out_size == report_descriptor_len) { - memcpy(irp->UserBuffer, report_descriptor, sizeof(report_descriptor)); - irp->IoStatus.Information = sizeof(report_descriptor); + memcpy(irp->UserBuffer, report_descriptor_buf, report_descriptor_len); + irp->IoStatus.Information = report_descriptor_len; } ret = STATUS_SUCCESS; break; @@ -679,7 +434,7 @@ static void WINAPI driver_unload(DRIVER_OBJECT *driver) NTSTATUS WINAPI DriverEntry(DRIVER_OBJECT *driver, UNICODE_STRING *registry) { static const int info_size = offsetof( KEY_VALUE_PARTIAL_INFORMATION, Data ); - char buffer[offsetof( KEY_VALUE_PARTIAL_INFORMATION, Data ) + sizeof(DWORD)]; + char buffer[offsetof( KEY_VALUE_PARTIAL_INFORMATION, Data ) + sizeof(report_descriptor_buf)]; HID_MINIDRIVER_REGISTRATION params = { .Revision = HID_REVISION, @@ -713,6 +468,13 @@ NTSTATUS WINAPI DriverEntry(DRIVER_OBJECT *driver, UNICODE_STRING *registry) memcpy(&polled, buffer + info_size, size - info_size); params.DevicesArePolled = polled;
+ RtlInitUnicodeString(&name_str, L"Descriptor"); + size = info_size + sizeof(report_descriptor_buf); + ret = ZwQueryValueKey(hkey, &name_str, KeyValuePartialInformation, buffer, size, &size); + ok(!ret, "ZwQueryValueKey returned %#x\n", ret); + memcpy(report_descriptor_buf, buffer + info_size, size - info_size); + report_descriptor_len = size - info_size; + driver->DriverExtension->AddDevice = driver_add_device; driver->DriverUnload = driver_unload; driver->MajorFunction[IRP_MJ_PNP] = driver_pnp; diff --git a/dlls/ntoskrnl.exe/tests/ntoskrnl.c b/dlls/ntoskrnl.exe/tests/ntoskrnl.c index b3ea894c947..8160beb5dd5 100644 --- a/dlls/ntoskrnl.exe/tests/ntoskrnl.c +++ b/dlls/ntoskrnl.exe/tests/ntoskrnl.c @@ -3329,6 +3329,253 @@ static void test_hid_device(DWORD report_id, DWORD polled)
static void test_hid_driver(struct testsign_context *ctx, DWORD report_id, DWORD polled) { +#include "psh_hid_macros.h" +/* Replace REPORT_ID with USAGE_PAGE when id is 0 */ +#define REPORT_ID_OR_USAGE_PAGE(size, id, off) SHORT_ITEM_1((id ? 8 : 0), 1, (id + off)) + const unsigned char report_descriptor[] = + { + USAGE_PAGE(1, HID_USAGE_PAGE_GENERIC), + USAGE(1, HID_USAGE_GENERIC_JOYSTICK), + COLLECTION(1, Application), + USAGE(1, HID_USAGE_GENERIC_JOYSTICK), + COLLECTION(1, Logical), + REPORT_ID_OR_USAGE_PAGE(1, report_id, 0), + USAGE_PAGE(1, HID_USAGE_PAGE_GENERIC), + USAGE(1, HID_USAGE_GENERIC_X), + USAGE(1, HID_USAGE_GENERIC_Y), + LOGICAL_MINIMUM(1, -128), + LOGICAL_MAXIMUM(1, 127), + REPORT_SIZE(1, 8), + REPORT_COUNT(1, 2), + INPUT(1, Data|Var|Abs), + + USAGE_PAGE(1, HID_USAGE_PAGE_BUTTON), + USAGE_MINIMUM(1, 1), + USAGE_MAXIMUM(1, 8), + LOGICAL_MINIMUM(1, 0), + LOGICAL_MAXIMUM(1, 1), + REPORT_COUNT(1, 8), + REPORT_SIZE(1, 1), + INPUT(1, Data|Var|Abs), + + USAGE_MINIMUM(1, 0x18), + USAGE_MAXIMUM(1, 0x1f), + LOGICAL_MINIMUM(1, 0), + LOGICAL_MAXIMUM(1, 1), + REPORT_COUNT(1, 8), + REPORT_SIZE(1, 1), + INPUT(1, Cnst|Var|Abs), + REPORT_COUNT(1, 8), + REPORT_SIZE(1, 1), + INPUT(1, Cnst|Var|Abs), + /* needs to be 8 bit aligned as next has Buff */ + + USAGE_MINIMUM(4, (HID_USAGE_PAGE_KEYBOARD<<16)|0x8), + USAGE_MAXIMUM(4, (HID_USAGE_PAGE_KEYBOARD<<16)|0xf), + LOGICAL_MINIMUM(1, 0), + LOGICAL_MAXIMUM(1, 8), + REPORT_COUNT(1, 2), + REPORT_SIZE(1, 8), + INPUT(2, Data|Ary|Rel|Wrap|Lin|Pref|Null|Vol|Buff), + + /* needs to be 8 bit aligned as previous has Buff */ + USAGE(1, 0x20), + LOGICAL_MINIMUM(1, 0), + LOGICAL_MAXIMUM(1, 1), + REPORT_COUNT(1, 8), + REPORT_SIZE(1, 1), + INPUT(1, Data|Var|Abs), + USAGE_MINIMUM(1, 0x21), + USAGE_MAXIMUM(1, 0x22), + REPORT_COUNT(1, 2), + REPORT_SIZE(1, 0), + INPUT(1, Data|Var|Abs), + USAGE(1, 0x23), + REPORT_COUNT(1, 0), + REPORT_SIZE(1, 1), + INPUT(1, Data|Var|Abs), + + USAGE_PAGE(1, HID_USAGE_PAGE_GENERIC), + USAGE(1, HID_USAGE_GENERIC_HATSWITCH), + LOGICAL_MINIMUM(1, 1), + LOGICAL_MAXIMUM(1, 8), + REPORT_SIZE(1, 4), + REPORT_COUNT(1, 2), + INPUT(1, Data|Var|Abs), + + USAGE_PAGE(1, HID_USAGE_PAGE_GENERIC), + USAGE(1, HID_USAGE_GENERIC_Z), + LOGICAL_MINIMUM(4, 0x00000000), + LOGICAL_MAXIMUM(4, 0x3fffffff), + PHYSICAL_MINIMUM(4, 0x80000000), + PHYSICAL_MAXIMUM(4, 0x7fffffff), + REPORT_SIZE(1, 32), + REPORT_COUNT(1, 1), + INPUT(1, Data|Var|Abs), + + /* reset physical range to its default interpretation */ + USAGE_PAGE(1, HID_USAGE_PAGE_GENERIC), + USAGE(1, HID_USAGE_GENERIC_RX), + PHYSICAL_MINIMUM(4, 0), + PHYSICAL_MAXIMUM(4, 0), + REPORT_SIZE(1, 32), + REPORT_COUNT(1, 1), + INPUT(1, Data|Var|Abs), + + USAGE_PAGE(1, HID_USAGE_PAGE_GENERIC), + USAGE(1, HID_USAGE_GENERIC_RY), + LOGICAL_MINIMUM(4, 0x7fff), + LOGICAL_MAXIMUM(4, 0x0000), + PHYSICAL_MINIMUM(4, 0x0000), + PHYSICAL_MAXIMUM(4, 0x7fff), + REPORT_SIZE(1, 32), + REPORT_COUNT(1, 1), + INPUT(1, Data|Var|Abs), + END_COLLECTION, + + USAGE_PAGE(1, HID_USAGE_PAGE_GENERIC), + USAGE(1, HID_USAGE_GENERIC_JOYSTICK), + COLLECTION(1, Report), + REPORT_ID_OR_USAGE_PAGE(1, report_id, 1), + USAGE_PAGE(1, HID_USAGE_PAGE_BUTTON), + USAGE_MINIMUM(1, 9), + USAGE_MAXIMUM(1, 10), + LOGICAL_MINIMUM(1, 0), + LOGICAL_MAXIMUM(1, 1), + REPORT_COUNT(1, 8), + REPORT_SIZE(1, 1), + INPUT(1, Data|Var|Abs), + END_COLLECTION, + + USAGE_PAGE(1, HID_USAGE_PAGE_LED), + USAGE(1, HID_USAGE_LED_GREEN), + COLLECTION(1, Report), + REPORT_ID_OR_USAGE_PAGE(1, report_id, 0), + USAGE_PAGE(1, HID_USAGE_PAGE_LED), + USAGE(1, 1), + USAGE(1, 2), + USAGE(1, 3), + USAGE(1, 4), + USAGE(1, 5), + USAGE(1, 6), + USAGE(1, 7), + USAGE(1, 8), + LOGICAL_MINIMUM(1, 0), + LOGICAL_MAXIMUM(1, 1), + PHYSICAL_MINIMUM(1, 0), + PHYSICAL_MAXIMUM(1, 1), + REPORT_COUNT(1, 8), + REPORT_SIZE(1, 1), + INPUT(1, Data|Var|Abs), + + USAGE(4, (HID_USAGE_PAGE_KEYBOARD<<16)|0x8c), + USAGE(4, (HID_USAGE_PAGE_KEYBOARD<<16)|0x8d), + USAGE(4, (HID_USAGE_PAGE_KEYBOARD<<16)|0x8e), + USAGE(4, (HID_USAGE_PAGE_KEYBOARD<<16)|0x8f), + LOGICAL_MINIMUM(1, 1), + LOGICAL_MAXIMUM(1, 16), + REPORT_COUNT(1, 2), + REPORT_SIZE(1, 8), + INPUT(1, Data|Ary|Abs), + END_COLLECTION, + + USAGE_PAGE(2, HID_USAGE_PAGE_HAPTICS), + USAGE(1, HID_USAGE_HAPTICS_SIMPLE_CONTROLLER), + COLLECTION(1, Logical), + REPORT_ID_OR_USAGE_PAGE(1, report_id, 0), + USAGE_PAGE(2, HID_USAGE_PAGE_HAPTICS), + + USAGE(1, HID_USAGE_HAPTICS_WAVEFORM_LIST), + COLLECTION(1, NamedArray), + USAGE_PAGE(1, HID_USAGE_PAGE_ORDINAL), + USAGE(1, 3), /* HID_USAGE_HAPTICS_WAVEFORM_RUMBLE */ + USAGE(1, 4), /* HID_USAGE_HAPTICS_WAVEFORM_BUZZ */ + LOGICAL_MINIMUM(2, 0x0000), + LOGICAL_MAXIMUM(2, 0xffff), + REPORT_COUNT(1, 2), + REPORT_SIZE(1, 16), + FEATURE(1, Data|Var|Abs|Null), + END_COLLECTION, + + USAGE_PAGE(2, HID_USAGE_PAGE_HAPTICS), + USAGE(1, HID_USAGE_HAPTICS_DURATION_LIST), + COLLECTION(1, NamedArray), + USAGE_PAGE(1, HID_USAGE_PAGE_ORDINAL), + USAGE(1, 3), /* 0 (HID_USAGE_HAPTICS_WAVEFORM_RUMBLE) */ + USAGE(1, 4), /* 0 (HID_USAGE_HAPTICS_WAVEFORM_BUZZ) */ + LOGICAL_MINIMUM(2, 0x0000), + LOGICAL_MAXIMUM(2, 0xffff), + REPORT_COUNT(1, 2), + REPORT_SIZE(1, 16), + FEATURE(1, Data|Var|Abs|Null), + END_COLLECTION, + + USAGE_PAGE(2, HID_USAGE_PAGE_HAPTICS), + USAGE(1, HID_USAGE_HAPTICS_WAVEFORM_CUTOFF_TIME), + UNIT(2, 0x1001), /* seconds */ + UNIT_EXPONENT(1, -3), /* 10^-3 */ + LOGICAL_MINIMUM(2, 0x8000), + LOGICAL_MAXIMUM(2, 0x7fff), + PHYSICAL_MINIMUM(4, 0x00000000), + PHYSICAL_MAXIMUM(4, 0xffffffff), + REPORT_SIZE(1, 32), + REPORT_COUNT(1, 2), + FEATURE(1, Data|Var|Abs), + /* reset global items */ + UNIT(1, 0), /* None */ + UNIT_EXPONENT(1, 0), + + USAGE_PAGE(1, HID_USAGE_PAGE_GENERIC), + USAGE(1, HID_USAGE_GENERIC_Z), + LOGICAL_MINIMUM(4, 0x0000), + LOGICAL_MAXIMUM(4, 0x7fff), + PHYSICAL_MINIMUM(4, 0xfff90000), + PHYSICAL_MAXIMUM(4, 0x0003ffff), + REPORT_SIZE(1, 32), + REPORT_COUNT(1, 1), + FEATURE(1, Data|Var|Abs), + END_COLLECTION, + + USAGE_PAGE(1, HID_USAGE_PAGE_GENERIC), + USAGE(1, HID_USAGE_GENERIC_JOYSTICK), + COLLECTION(1, Report), + REPORT_ID_OR_USAGE_PAGE(1, report_id, 1), + USAGE_PAGE(1, HID_USAGE_PAGE_BUTTON), + USAGE_MINIMUM(1, 9), + USAGE_MAXIMUM(1, 10), + LOGICAL_MINIMUM(1, 0), + LOGICAL_MAXIMUM(1, 1), + PHYSICAL_MINIMUM(1, 0), + PHYSICAL_MAXIMUM(1, 1), + REPORT_COUNT(1, 8), + REPORT_SIZE(1, 1), + FEATURE(1, Data|Var|Abs), + END_COLLECTION, + + USAGE_PAGE(1, HID_USAGE_PAGE_LED), + USAGE(1, HID_USAGE_LED_GREEN), + COLLECTION(1, Report), + REPORT_ID_OR_USAGE_PAGE(1, report_id, 0), + USAGE_PAGE(1, HID_USAGE_PAGE_LED), + REPORT_COUNT(1, 8), + REPORT_SIZE(1, 1), + OUTPUT(1, Cnst|Var|Abs), + END_COLLECTION, + + USAGE_PAGE(1, HID_USAGE_PAGE_LED), + USAGE(1, HID_USAGE_LED_RED), + COLLECTION(1, Report), + REPORT_ID_OR_USAGE_PAGE(1, report_id, 1), + USAGE_PAGE(1, HID_USAGE_PAGE_LED), + REPORT_COUNT(1, 8), + REPORT_SIZE(1, 1), + OUTPUT(1, Cnst|Var|Abs), + END_COLLECTION, + END_COLLECTION, + }; +#undef REPORT_ID_OR_USAGE_PAGE +#include "pop_hid_macros.h" + char cwd[MAX_PATH], tempdir[MAX_PATH]; LSTATUS status; HKEY hkey; @@ -3346,6 +3593,9 @@ static void test_hid_driver(struct testsign_context *ctx, DWORD report_id, DWORD status = RegSetValueExW(hkey, L"PolledMode", 0, REG_DWORD, (void *)&polled, sizeof(polled)); ok(!status, "RegSetValueExW returned %#x\n", status);
+ status = RegSetValueExW(hkey, L"Descriptor", 0, REG_BINARY, (void *)report_descriptor, sizeof(report_descriptor)); + ok(!status, "RegSetValueExW returned %#x\n", status); + driver_start(ctx, L"driver_hid.dll"); test_hid_device(report_id, polled); driver_stop();
Crap, I forgot to edit the subject line on these patches... Sorry, tell me if I should resend.
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=97123
Your paranoid android.
=== w7u_2qxl (32 bit report) ===
ntoskrnl.exe: ntoskrnl.c:1477: Test failed: failed to register device, error 3758096907 ntoskrnl.c:3208: Test failed: id 0 poll: didn't find device ntoskrnl.c:3212: Test failed: id 0 poll: got error 5 ntoskrnl.c:3217: Test failed: id 0 poll: HidD_GetNumInputBuffers failed last error 6 ntoskrnl.c:3218: Test failed: id 0 poll: HidD_GetNumInputBuffers returned 3735928559 ntoskrnl.c:3223: Test failed: id 0 poll: HidD_SetNumInputBuffers returned error 6 ntoskrnl.c:3227: Test failed: id 0 poll: HidD_SetNumInputBuffers returned error 6 ntoskrnl.c:3231: Test failed: id 0 poll: HidD_SetNumInputBuffers failed last error 6 ntoskrnl.c:3236: Test failed: id 0 poll: HidD_GetNumInputBuffers failed last error 6 ntoskrnl.c:3237: Test failed: id 0 poll: HidD_GetNumInputBuffers returned 3735928559 ntoskrnl.c:3242: Test failed: id 0 poll: got error 5 ntoskrnl.c:3247: Test failed: id 0 poll: HidD_GetNumInputBuffers failed last error 6 ntoskrnl.c:3248: Test failed: id 0 poll: HidD_GetNumInputBuffers returned 3735928559 ntoskrnl.c:3252: Test failed: id 0 poll: HidD_SetNumInputBuffers failed last error 6 ntoskrnl.c:3257: Test failed: id 0 poll: HidD_GetNumInputBuffers failed last error 6 ntoskrnl.c:3258: Test failed: id 0 poll: HidD_GetNumInputBuffers returned 3735928559 ntoskrnl.c:3262: Test failed: id 0 poll: HidD_GetNumInputBuffers failed last error 6 ntoskrnl.c:3263: Test failed: id 0 poll: HidD_GetNumInputBuffers returned 3735928559 ntoskrnl.c:3270: Test failed: id 0 poll: IOCTL_HID_GET_POLL_FREQUENCY_MSEC failed last error 6 ntoskrnl.c:3272: Test failed: id 0 poll: got poll_freq 0, expected 5 ntoskrnl.c:3278: Test failed: id 0 poll: IOCTL_HID_SET_POLL_FREQUENCY_MSEC failed last error 6 ntoskrnl.c:3285: Test failed: id 0 poll: IOCTL_HID_SET_POLL_FREQUENCY_MSEC failed last error 6 ntoskrnl.c:3292: Test failed: id 0 poll: IOCTL_HID_SET_POLL_FREQUENCY_MSEC failed last error 6 ntoskrnl.c:3298: Test failed: id 0 poll: IOCTL_HID_GET_POLL_FREQUENCY_MSEC failed last error 6 ntoskrnl.c:3300: Test failed: id 0 poll: got poll_freq 0, expected 10000 ntoskrnl.c:3306: Test failed: id 0 poll: IOCTL_HID_SET_POLL_FREQUENCY_MSEC failed last error 6 ntoskrnl.c:3312: Test failed: id 0 poll: IOCTL_HID_GET_POLL_FREQUENCY_MSEC failed last error 6 ntoskrnl.c:2226: Test failed: id 0 poll: HidD_GetPreparsedData failed with error 6 ntoskrnl.c:2232: Test failed: id 0 poll: HidP_GetCaps returned 0xc0110001 ntoskrnl.c:2233: Test failed: id 0 poll: got InputReportByteLength 25, expected 26 ntoskrnl.c:2233: Test failed: id 0 poll: got OutputReportByteLength 2, expected 3 ntoskrnl.c:2233: Test failed: id 0 poll: got FeatureReportByteLength 21, expected 22 ntoskrnl.c:2237: Test failed: id 0 poll: HidP_GetLinkCollectionNodes returned 0xc0110001 ntoskrnl.c:2238: Test failed: id 0 poll: got 0 collection nodes, expected 10 ntoskrnl.c:2244: Test failed: id 0 poll: HidP_GetLinkCollectionNodes returned 0xc0110001 ntoskrnl.c:2245: Test failed: id 0 poll: got 16 collection nodes, expected 10 ntoskrnl.c:2257: Test failed: id 0 poll: HidP_GetButtonCaps returned 0xc0110001 ntoskrnl.c:2259: Test failed: id 0 poll: HidP_GetButtonCaps returned 0xc0110001 ntoskrnl.c:2262: Test failed: id 0 poll: HidP_GetButtonCaps returned 0xc0110001 ntoskrnl.c:2263: Test failed: id 0 poll: HidP_GetButtonCaps returned count 0, expected 17 ntoskrnl.c:2270: Test failed: id 0 poll: HidP_GetButtonCaps returned 0xc0110001 ntoskrnl.c:2271: Test failed: id 0 poll: HidP_GetButtonCaps returned count 32, expected 17 ntoskrnl.c:2277: Test failed: id 0 poll: button_caps[0]: got UsagePage 0000, expected 0009 ntoskrnl.c:2277: Test failed: id 0 poll: button_caps[0]: got BitField 0, expected 2 ntoskrnl.c:2277: Test failed: id 0 poll: button_caps[0]: got LinkCollection 0, expected 1 ntoskrnl.c:2277: Test failed: id 0 poll: button_caps[0]: got LinkUsage 0000, expected 0004 ntoskrnl.c:2277: Test failed: id 0 poll: button_caps[0]: got LinkUsagePage 0000, expected 0001 ntoskrnl.c:2277: Test failed: id 0 poll: button_caps[0]: got IsRange 0, expected 1 ntoskrnl.c:2277: Test failed: id 0 poll: button_caps[0]: got IsAbsolute 0, expected 1 ntoskrnl.c:2277: Test failed: id 0 poll: button_caps[1]: got UsagePage 0000, expected 0009 ntoskrnl.c:2277: Test failed: id 0 poll: button_caps[1]: got BitField 0, expected 3 ntoskrnl.c:2277: Test failed: id 0 poll: button_caps[1]: got LinkCollection 0, expected 1 ntoskrnl.c:2277: Test failed: id 0 poll: button_caps[1]: got LinkUsage 0000, expected 0004 ntoskrnl.c:2277: Test failed: id 0 poll: button_caps[1]: got LinkUsagePage 0000, expected 0001 ntoskrnl.c:2277: Test failed: id 0 poll: button_caps[1]: got IsRange 0, expected 1 ntoskrnl.c:2277: Test failed: id 0 poll: button_caps[1]: got IsAbsolute 0, expected 1 ntoskrnl.c:2277: Test failed: id 0 poll: button_caps[2]: got UsagePage 0000, expected 0007 ntoskrnl.c:2277: Test failed: id 0 poll: button_caps[2]: got BitField 0, expected 508 ntoskrnl.c:2277: Test failed: id 0 poll: button_caps[2]: got LinkCollection 0, expected 1 ntoskrnl.c:2277: Test failed: id 0 poll: button_caps[2]: got LinkUsage 0000, expected 0004 ntoskrnl.c:2277: Test failed: id 0 poll: button_caps[2]: got LinkUsagePage 0000, expected 0001 ntoskrnl.c:2277: Test failed: id 0 poll: button_caps[2]: got IsRange 0, expected 1 ntoskrnl.c:2277: Test failed: id 0 poll: button_caps[3]: got UsagePage 0000, expected 0009 ntoskrnl.c:2277: Test failed: id 0 poll: button_caps[3]: got BitField 0, expected 2 ntoskrnl.c:2277: Test failed: id 0 poll: button_caps[3]: got LinkCollection 0, expected 1 ntoskrnl.c:2277: Test failed: id 0 poll: button_caps[3]: got LinkUsage 0000, expected 0004 ntoskrnl.c:2277: Test failed: id 0 poll: button_caps[3]: got LinkUsagePage 0000, expected 0001 ntoskrnl.c:2277: Test failed: id 0 poll: button_caps[3]: got IsAbsolute 0, expected 1 ntoskrnl.c:2277: Test failed: id 0 poll: button_caps[3]: got NotRange.Usage 0000, expected 0020 ntoskrnl.c:2277: Test failed: id 0 poll: button_caps[3]: got NotRange.DataIndex 0, expected 26 ntoskrnl.c:2283: Test failed: id 0 poll: HidP_GetSpecificButtonCaps returned 0xc0110001 ntoskrnl.c:2285: Test failed: id 0 poll: HidP_GetSpecificButtonCaps returned 0xc0110001 ntoskrnl.c:2288: Test failed: id 0 poll: HidP_GetSpecificButtonCaps returned 0xc0110001 ntoskrnl.c:2289: Test failed: id 0 poll: HidP_GetSpecificButtonCaps returned count 0, expected 17 ntoskrnl.c:2296: Test failed: id 0 poll: HidP_GetSpecificButtonCaps returned 0xc0110001 ntoskrnl.c:2297: Test failed: id 0 poll: HidP_GetSpecificButtonCaps returned count 31, expected 17 ntoskrnl.c:2303: Test failed: id 0 poll: HidP_GetSpecificButtonCaps returned 0xc0110001 ntoskrnl.c:2304: Test failed: id 0 poll: HidP_GetSpecificButtonCaps returned count 31, expected 1 ntoskrnl.c:2309: Test failed: id 0 poll: HidP_GetSpecificButtonCaps returned 0xc0110001 ntoskrnl.c:2310: Test failed: id 0 poll: HidP_GetSpecificButtonCaps returned count 48879, expected 0 ntoskrnl.c:2313: Test failed: id 0 poll: HidP_GetSpecificButtonCaps returned 0xc0110001 ntoskrnl.c:2314: Test failed: id 0 poll: HidP_GetSpecificButtonCaps returned count 48879, expected 0 ntoskrnl.c:2317: Test failed: id 0 poll: HidP_GetSpecificButtonCaps returned 0xc0110001 ntoskrnl.c:2318: Test failed: id 0 poll: HidP_GetSpecificButtonCaps returned count 48879, expected 0 ntoskrnl.c:2322: Test failed: id 0 poll: HidP_GetValueCaps returned 0xc0110001 ntoskrnl.c:2324: Test failed: id 0 poll: HidP_GetValueCaps returned 0xc0110001 ntoskrnl.c:2327: Test failed: id 0 poll: HidP_GetValueCaps returned 0xc0110001 ntoskrnl.c:2328: Test failed: id 0 poll: HidP_GetValueCaps returned count 0, expected 7 ntoskrnl.c:2334: Test failed: id 0 poll: HidP_GetValueCaps returned 0xc0110001 ntoskrnl.c:2335: Test failed: id 0 poll: HidP_GetValueCaps returned count 16, expected 7 ntoskrnl.c:2341: Test failed: id 0 poll: value_caps[0]: got ReportID 1, expected 0 ntoskrnl.c:2341: Test failed: id 0 poll: value_caps[1]: got ReportID 1, expected 0 ntoskrnl.c:2341: Test failed: id 0 poll: value_caps[2]: got ReportID 1, expected 0 ntoskrnl.c:2341: Test failed: id 0 poll: value_caps[3]: got ReportID 1, expected 0 ntoskrnl.c:2347: Test failed: id 0 poll: HidP_GetSpecificValueCaps returned 0xc0110001 ntoskrnl.c:2349: Test failed: id 0 poll: HidP_GetSpecificValueCaps returned 0xc0110001 ntoskrnl.c:2352: Test failed: id 0 poll: HidP_GetSpecificValueCaps returned 0xc0110001 ntoskrnl.c:2353: Test failed: id 0 poll: HidP_GetSpecificValueCaps returned count 0, expected 7 ntoskrnl.c:2360: Test failed: id 0 poll: HidP_GetSpecificValueCaps returned 0xc0110001 ntoskrnl.c:2361: Test failed: id 0 poll: HidP_GetSpecificValueCaps returned count 12, expected 7 ntoskrnl.c:2363: Test failed: id 0 poll: got BitSize 4, expected 8 ntoskrnl.c:2363: Test failed: id 0 poll: got ReportCount 2, expected 1 ntoskrnl.c:2363: Test failed: id 0 poll: got LogicalMin 1, expected -128 ntoskrnl.c:2363: Test failed: id 0 poll: got LogicalMax 8, expected 127 ntoskrnl.c:2363: Test failed: id 0 poll: got NotRange.Usage 0039, expected 0031 ntoskrnl.c:2363: Test failed: id 0 poll: got NotRange.DataIndex 29, expected 0 ntoskrnl.c:2371: Test failed: id 0 poll: HidP_GetSpecificValueCaps returned 0xc0110001 ntoskrnl.c:2377: Test failed: id 0 poll: HidP_GetSpecificValueCaps returned 0xc0110001 ntoskrnl.c:2378: Test failed: id 0 poll: HidP_GetSpecificValueCaps returned count 57005, expected 0 ntoskrnl.c:2381: Test failed: id 0 poll: HidP_GetSpecificValueCaps returned 0xc0110001 ntoskrnl.c:2382: Test failed: id 0 poll: HidP_GetSpecificValueCaps returned count 57005, expected 0 ntoskrnl.c:2385: Test failed: id 0 poll: HidP_GetSpecificValueCaps returned 0xc0110001 ntoskrnl.c:2386: Test failed: id 0 poll: HidP_GetSpecificValueCaps returned count 57005, expected 0 ntoskrnl.c:2391: Test failed: id 0 poll: HidP_InitializeReportForID returned 0xc0110001 ntoskrnl.c:2393: Test failed: id 0 poll: HidP_InitializeReportForID returned 0xc0110001 ntoskrnl.c:2395: Test failed: id 0 poll: HidP_InitializeReportForID returned 0xc0110001 ntoskrnl.c:2397: Test failed: id 0 poll: HidP_InitializeReportForID returned 0xc0110001 ntoskrnl.c:2401: Test failed: id 0 poll: HidP_InitializeReportForID returned 0xc0110001 ntoskrnl.c:2406: Test failed: id 0 poll: unexpected report data ntoskrnl.c:2410: Test failed: id 0 poll: HidP_SetUsageValueArray returned 0xc0110001 ntoskrnl.c:2414: Test failed: id 0 poll: HidP_SetUsageValueArray returned 0xc0110001 ntoskrnl.c:2418: Test failed: id 0 poll: HidP_SetUsageValueArray returned 0xc0110001 ntoskrnl.c:2422: Test failed: id 0 poll: HidP_GetUsageValueArray returned 0xc0110001 ntoskrnl.c:2426: Test failed: id 0 poll: HidP_GetUsageValueArray returned 0xc0110001 ntoskrnl.c:2430: Test failed: id 0 poll: HidP_GetUsageValueArray returned 0xc0110001 ntoskrnl.c:2435: Test failed: id 0 poll: HidP_SetUsageValue returned 0xc0110001 ntoskrnl.c:2439: Test failed: id 0 poll: HidP_GetUsageValue returned 0xc0110001 ntoskrnl.c:2440: Test failed: id 0 poll: got value deadbeef, expected 0x80 ntoskrnl.c:2444: Test failed: id 0 poll: HidP_GetScaledUsageValue returned 0xc0110001 ntoskrnl.c:2445: Test failed: id 0 poll: got value deadbeef, expected 0xffffff80 ntoskrnl.c:2450: Test failed: id 0 poll: HidP_SetUsageValue returned 0xc0110001 ntoskrnl.c:2454: Test failed: id 0 poll: HidP_GetScaledUsageValue returned 0xc0110001 ntoskrnl.c:2455: Test failed: id 0 poll: got value deadbeef, expected 0x7f ntoskrnl.c:2460: Test failed: id 0 poll: HidP_SetUsageValue returned 0xc0110001 ntoskrnl.c:2464: Test failed: id 0 poll: HidP_GetScaledUsageValue returned 0xc0110001 ntoskrnl.c:2465: Test failed: id 0 poll: got value deadbeef, expected 0 ntoskrnl.c:2470: Test failed: id 0 poll: HidP_SetUsageValue returned 0xc0110001 ntoskrnl.c:2474: Test failed: id 0 poll: HidP_GetScaledUsageValue returned 0xc0110001 ntoskrnl.c:2475: Test failed: id 0 poll: got value deadbeef, expected 0 ntoskrnl.c:2479: Test failed: id 0 poll: HidP_GetUsageValue returned 0xc0110001 ntoskrnl.c:2480: Test failed: id 0 poll: got value deadbeef, expected 0x7fffffff ntoskrnl.c:2485: Test failed: id 0 poll: HidP_SetUsageValue returned 0xc0110001 ntoskrnl.c:2489: Test failed: id 0 poll: HidP_GetScaledUsageValue returned 0xc0110001 ntoskrnl.c:2490: Test failed: id 0 poll: got value deadbeef, expected 0x7fffffff ntoskrnl.c:2495: Test failed: id 0 poll: HidP_SetUsageValue returned 0xc0110001 ntoskrnl.c:2499: Test failed: id 0 poll: HidP_GetScaledUsageValue returned 0xc0110001 ntoskrnl.c:2500: Test failed: id 0 poll: got value deadbeef, expected 0x80000000 ntoskrnl.c:2505: Test failed: id 0 poll: HidP_SetUsageValue returned 0xc0110001 ntoskrnl.c:2509: Test failed: id 0 poll: HidP_GetScaledUsageValue returned 0xc0110001 ntoskrnl.c:2510: Test failed: id 0 poll: got value deadbeef, expected 0 ntoskrnl.c:2515: Test failed: id 0 poll: HidP_SetUsageValue returned 0xc0110001 ntoskrnl.c:2519: Test failed: id 0 poll: HidP_GetScaledUsageValue returned 0xc0110001 ntoskrnl.c:2520: Test failed: id 0 poll: got value deadbeef, expected 0 ntoskrnl.c:2523: Test failed: id 0 poll: HidP_GetScaledUsageValue returned 0xc0110001 ntoskrnl.c:2524: Test failed: id 0 poll: got value deadbeef, expected 0 ntoskrnl.c:2529: Test failed: id 0 poll: HidP_MaxUsageListLength(HidP_Input, 0) returned 0, expected 50 ntoskrnl.c:2531: Test failed: id 0 poll: HidP_MaxUsageListLength(HidP_Input, HID_USAGE_PAGE_BUTTON) returned 0, expected 32 ntoskrnl.c:2533: Test failed: id 0 poll: HidP_MaxUsageListLength(HidP_Input, HID_USAGE_PAGE_LED) returned 0, expected 8 ntoskrnl.c:2535: Test failed: id 0 poll: HidP_MaxUsageListLength(HidP_Feature, HID_USAGE_PAGE_BUTTON) returned 0, expected 8 ntoskrnl.c:2543: Test failed: id 0 poll: HidP_SetUsages returned 0xc0110001 ntoskrnl.c:2549: Test failed: id 0 poll: HidP_SetUsages returned 0xc0110001 ntoskrnl.c:2555: Test failed: id 0 poll: HidP_SetUsages returned 0xc0110001 ntoskrnl.c:2561: Test failed: id 0 poll: HidP_SetUsages returned 0xc0110001 ntoskrnl.c:2566: Test failed: id 0 poll: HidP_GetUsages returned 0xc0110001 ntoskrnl.c:2567: Test failed: id 0 poll: got usage count 16, expected 2 ntoskrnl.c:2573: Test failed: id 0 poll: got report[6] ffffffcd expected 0 ntoskrnl.c:2574: Test failed: id 0 poll: got report[7] ffffffcd expected 0 ntoskrnl.c:2578: Test failed: id 0 poll: HidP_SetUsages returned 0xc0110001 ntoskrnl.c:2581: Test failed: id 0 poll: unexpected report data ntoskrnl.c:2585: Test failed: id 0 poll: HidP_SetUsageValue returned 0xc0110001 ntoskrnl.c:2590: Test failed: id 0 poll: HidP_SetUsageValue returned 0xc0110001 ntoskrnl.c:2596: Test failed: id 0 poll: HidP_GetUsages returned 0xc0110001 ntoskrnl.c:2597: Test failed: id 0 poll: got usage count 1, expected 2 ntoskrnl.c:2602: Test failed: id 0 poll: HidP_GetUsages returned 0xc0110001 ntoskrnl.c:2603: Test failed: id 0 poll: got usage count 16, expected 2 ntoskrnl.c:2604: Test failed: id 0 poll: got usages[0] cdcd, expected 4 ntoskrnl.c:2605: Test failed: id 0 poll: got usages[1] cdcd, expected 6 ntoskrnl.c:2611: Test failed: id 0 poll: HidP_GetUsages returned 0xc0110001 ntoskrnl.c:2612: Test failed: id 0 poll: got usage count 16, expected 2 ntoskrnl.c:2613: Test failed: id 0 poll: got usages[0] cdcd, expected 6 ntoskrnl.c:2614: Test failed: id 0 poll: got usages[1] cdcd, expected 4 ntoskrnl.c:2620: Test failed: id 0 poll: HidP_GetUsagesEx returned 0xc0110001 ntoskrnl.c:2621: Test failed: id 0 poll: got usage count 16, expected 4 ntoskrnl.c:2622: Test failed: id 0 poll: got usage_and_pages[0] UsagePage cdcd, expected 9 ntoskrnl.c:2624: Test failed: id 0 poll: got usage_and_pages[1] UsagePage cdcd, expected 9 ntoskrnl.c:2626: Test failed: id 0 poll: got usage_and_pages[2] UsagePage cdcd, expected 7 ntoskrnl.c:2628: Test failed: id 0 poll: got usage_and_pages[3] UsagePage cdcd, expected 7 ntoskrnl.c:2630: Test failed: id 0 poll: got usage_and_pages[4] UsagePage cdcd, expected 8 ntoskrnl.c:2632: Test failed: id 0 poll: got usage_and_pages[5] UsagePage cdcd, expected 8 ntoskrnl.c:2634: Test failed: id 0 poll: got usage_and_pages[0] Usage cdcd, expected 4 ntoskrnl.c:2636: Test failed: id 0 poll: got usage_and_pages[1] Usage cdcd, expected 6 ntoskrnl.c:2638: Test failed: id 0 poll: got usage_and_pages[2] Usage cdcd, expected 9 ntoskrnl.c:2640: Test failed: id 0 poll: got usage_and_pages[3] Usage cdcd, expected b ntoskrnl.c:2642: Test failed: id 0 poll: got usage_and_pages[4] Usage cdcd, expected 6 ntoskrnl.c:2644: Test failed: id 0 poll: got usage_and_pages[5] Usage cdcd, expected 4 ntoskrnl.c:2650: Test failed: id 0 poll: HidP_MaxDataListLength(HidP_Input) returned 0, expected 58 ntoskrnl.c:2654: Test failed: id 0 poll: HidP_MaxDataListLength(HidP_Feature) returned 0, expected 14 ntoskrnl.c:2658: Test failed: id 0 poll: HidP_GetData returned 0xc0110001 ntoskrnl.c:2659: Test failed: id 0 poll: got data count 1, expected 11 ntoskrnl.c:2662: Test failed: id 0 poll: HidP_GetData returned 0xc0110001 ntoskrnl.c:2666: Test failed: id 0 poll: data[1]: got DataIndex 0, expected 1 ntoskrnl.c:2666: Test failed: id 0 poll: data[2]: got DataIndex 0, expected 5 ntoskrnl.c:2667: Test failed: id 0 poll: data[2]: got RawValue 0, expected 1 ntoskrnl.c:2666: Test failed: id 0 poll: data[3]: got DataIndex 0, expected 7 ntoskrnl.c:2667: Test failed: id 0 poll: data[3]: got RawValue 0, expected 1 ntoskrnl.c:2666: Test failed: id 0 poll: data[4]: got DataIndex 0, expected 19 ntoskrnl.c:2667: Test failed: id 0 poll: data[4]: got RawValue 0, expected 1 ntoskrnl.c:2666: Test failed: id 0 poll: data[5]: got DataIndex 0, expected 21 ntoskrnl.c:2667: Test failed: id 0 poll: data[5]: got RawValue 0, expected 1 ntoskrnl.c:2666: Test failed: id 0 poll: data[6]: got DataIndex 0, expected 30 ntoskrnl.c:2666: Test failed: id 0 poll: data[7]: got DataIndex 0, expected 31 ntoskrnl.c:2666: Test failed: id 0 poll: data[8]: got DataIndex 0, expected 32 ntoskrnl.c:2667: Test failed: id 0 poll: data[8]: got RawValue 0, expected -17970434 ntoskrnl.c:2666: Test failed: id 0 poll: data[9]: got DataIndex 0, expected 37 ntoskrnl.c:2667: Test failed: id 0 poll: data[9]: got RawValue 0, expected 1 ntoskrnl.c:2666: Test failed: id 0 poll: data[10]: got DataIndex 0, expected 39 ntoskrnl.c:2667: Test failed: id 0 poll: data[10]: got RawValue 0, expected 1 ntoskrnl.c:2676: Test failed: id 0 poll: HidP_InitializeReportForID returned 0xc0110001 ntoskrnl.c:2682: Test failed: id 0 poll: HidP_SetUsages returned 0xc0110001 ntoskrnl.c:2683: Test failed: id 0 poll: unexpected usage index 0, expected 3 ntoskrnl.c:2685: Test failed: id 0 poll: unexpected usage index 0, expected 4 ntoskrnl.c:2689: Test failed: id 0 poll: HidP_UnsetUsages returned 0xc0110001 ntoskrnl.c:2696: Test failed: id 0 poll: HidP_UnsetUsages returned 0xc0110001 ntoskrnl.c:2701: Test failed: id 0 poll: HidP_SetUsages returned 0xc0110001 ntoskrnl.c:2702: Test failed: id 0 poll: unexpected usage index 0, expected 1 ntoskrnl.c:2707: Test failed: id 0 poll: HidP_InitializeReportForID returned 0xc0110001 ntoskrnl.c:2711: Test failed: id 0 poll: HidP_InitializeReportForID returned 0xc0110001 ntoskrnl.c:2716: Test failed: id 0 poll: unexpected report data ntoskrnl.c:2734: Test failed: id 0 poll: HidP_SetUsageValue returned 0xc0110001 ntoskrnl.c:2738: Test failed: id 0 poll: HidP_SetUsageValue returned 0xc0110001 ntoskrnl.c:2743: Test failed: id 0 poll: HidP_SetUsageValue returned 0xc0110001 ntoskrnl.c:2749: Test failed: id 0 poll: HidP_SetUsageValue returned 0xc0110001 ntoskrnl.c:2753: Test failed: id 0 poll: HidP_SetUsageValue returned 0xc0110001 ntoskrnl.c:2758: Test failed: id 0 poll: HidP_SetUsageValue returned 0xc0110001 ntoskrnl.c:2765: Test failed: id 0 poll: unexpected report data ntoskrnl.c:2772: Test failed: id 0 poll: HidP_GetUsageValue returned 0xc0110001 ntoskrnl.c:2775: Test failed: id 0 poll: HidP_GetUsageValue returned 0xc0110001 ntoskrnl.c:2779: Test failed: id 0 poll: HidP_GetUsageValue returned 0xc0110001 ntoskrnl.c:2784: Test failed: id 0 poll: HidP_GetUsageValue returned 0xc0110001 ntoskrnl.c:2788: Test failed: id 0 poll: HidP_GetUsageValue returned 0xc0110001 ntoskrnl.c:2793: Test failed: id 0 poll: HidP_GetUsageValue returned 0xc0110001 ntoskrnl.c:2794: Test failed: id 0 poll: got value deadbeef, expected 0x1005 ntoskrnl.c:2800: Test failed: id 0 poll: HidP_SetUsageValueArray returned 0xc0110001 ntoskrnl.c:2803: Test failed: id 0 poll: HidP_SetUsageValueArray returned 0xc0110001 ntoskrnl.c:2804: Test failed: id 0 poll: unexpected report data ntoskrnl.c:2809: Test failed: id 0 poll: HidP_GetUsageValueArray returned 0xc0110001 ntoskrnl.c:2812: Test failed: id 0 poll: HidP_GetUsageValueArray returned 0xc0110001 ntoskrnl.c:2814: Test failed: id 0 poll: unexpected report value ntoskrnl.c:2820: Test failed: id 0 poll: HidP_SetUsageValue returned 0xc0110001 ntoskrnl.c:2824: Test failed: id 0 poll: HidP_GetScaledUsageValue returned 0xc0110001 ntoskrnl.c:2825: Test failed: id 0 poll: got value deadbeef, expected 0 ntoskrnl.c:2829: Test failed: id 0 poll: HidP_GetUsageValue returned 0xc0110001 ntoskrnl.c:2830: Test failed: id 0 poll: got value deadbeef, expected 0x7fffffff ntoskrnl.c:2835: Test failed: id 0 poll: HidP_SetUsageValue returned 0xc0110001 ntoskrnl.c:2839: Test failed: id 0 poll: HidP_GetScaledUsageValue returned 0xc0110001 ntoskrnl.c:2840: Test failed: id 0 poll: got value deadbeef, expected 0x3ffff ntoskrnl.c:2845: Test failed: id 0 poll: HidP_SetUsageValue returned 0xc0110001 ntoskrnl.c:2849: Test failed: id 0 poll: HidP_GetScaledUsageValue returned 0xc0110001 ntoskrnl.c:2850: Test failed: id 0 poll: got value deadbeef, expected 0xfff90000 ntoskrnl.c:2853: Test failed: id 0 poll: HidP_SetScaledUsageValue returned 0xc0110001 ntoskrnl.c:2857: Test failed: id 0 poll: HidP_GetUsageValue returned 0xc0110001 ntoskrnl.c:2858: Test failed: id 0 poll: got value 0, expected 0xfffff518 ntoskrnl.c:2861: Test failed: id 0 poll: HidP_SetScaledUsageValue returned 0xc0110001 ntoskrnl.c:2865: Test failed: id 0 poll: HidP_GetUsageValue returned 0xc0110001 ntoskrnl.c:2866: Test failed: id 0 poll: got value 0, expected 0xfffff45e ntoskrnl.c:2869: Test failed: id 0 poll: HidP_SetScaledUsageValue returned 0xc0110001 ntoskrnl.c:2873: Test failed: id 0 poll: HidP_GetUsageValue returned 0xc0110001 ntoskrnl.c:2874: Test failed: id 0 poll: got value 0, expected 0xfffffe7d ntoskrnl.c:2877: Test failed: id 0 poll: HidP_SetScaledUsageValue returned 0xc0110001 ntoskrnl.c:2881: Test failed: id 0 poll: HidP_GetUsageValue returned 0xc0110001 ntoskrnl.c:2882: Test failed: id 0 poll: got value 0, expected 0xfffffd0b ntoskrnl.c:2887: Test failed: id 0 poll: HidP_InitializeReportForID returned 0xc0110001 ntoskrnl.c:2892: Test failed: id 0 poll: HidD_GetInputReport returned error 6 ntoskrnl.c:2897: Test failed: id 0 poll: HidD_GetInputReport returned error 6 ntoskrnl.c:2906: Test failed: id 0 poll: HidD_GetInputReport returned error 6 ntoskrnl.c:2917: Test failed: id 0 poll: HidD_GetInputReport failed, last error 6 ntoskrnl.c:2918: Test failed: id 0 poll: got report[0] ffffffcd, expected 00 ntoskrnl.c:2923: Test failed: id 0 poll: IOCTL_HID_GET_INPUT_REPORT failed, last error 6 ntoskrnl.c:2924: Test failed: id 0 poll: got length 50, expected 3 ntoskrnl.c:2925: Test failed: id 0 poll: got report[0] ffffffcd, expected 00 ntoskrnl.c:2930: Test failed: id 0 poll: HidP_InitializeReportForID returned 0xc0110001 ntoskrnl.c:2935: Test failed: id 0 poll: HidD_GetFeature returned error 6 ntoskrnl.c:2940: Test failed: id 0 poll: HidD_GetFeature returned error 6 ntoskrnl.c:2949: Test failed: id 0 poll: HidD_GetFeature returned error 6 ntoskrnl.c:2960: Test failed: id 0 poll: HidD_GetFeature failed, last error 6 ntoskrnl.c:2961: Test failed: id 0 poll: got report[0] ffffffcd, expected 00 ntoskrnl.c:2966: Test failed: id 0 poll: IOCTL_HID_GET_FEATURE failed, last error 6 ntoskrnl.c:2967: Test failed: id 0 poll: got length 42, expected 3 ntoskrnl.c:2968: Test failed: id 0 poll: got report[0] ffffffcd, expected 00 ntoskrnl.c:2973: Test failed: id 0 poll: HidP_InitializeReportForID returned 0xc0110001 ntoskrnl.c:2978: Test failed: id 0 poll: HidD_SetFeature returned error 6 ntoskrnl.c:2983: Test failed: id 0 poll: HidD_SetFeature returned error 6 ntoskrnl.c:2992: Test failed: id 0 poll: HidD_SetFeature returned error 6 ntoskrnl.c:3002: Test failed: id 0 poll: HidD_SetFeature failed, last error 6 ntoskrnl.c:3008: Test failed: id 0 poll: IOCTL_HID_SET_FEATURE returned error 6 ntoskrnl.c:3012: Test failed: id 0 poll: IOCTL_HID_SET_FEATURE failed, last error 6 ntoskrnl.c:3013: Test failed: id 0 poll: got length 0, expected 3 ntoskrnl.c:3018: Test failed: id 0 poll: HidP_InitializeReportForID returned 0xc0110001 ntoskrnl.c:3025: Test failed: id 0 poll: HidD_SetOutputReport returned error 6 ntoskrnl.c:3030: Test failed: id 0 poll: HidD_SetOutputReport returned error 6 ntoskrnl.c:3039: Test failed: id 0 poll: HidD_SetOutputReport returned error 6 ntoskrnl.c:3049: Test failed: id 0 poll: HidD_SetOutputReport failed, last error 6 ntoskrnl.c:3055: Test failed: id 0 poll: IOCTL_HID_SET_OUTPUT_REPORT returned error 6 ntoskrnl.c:3059: Test failed: id 0 poll: IOCTL_HID_SET_OUTPUT_REPORT failed, last error 6 ntoskrnl.c:3060: Test failed: id 0 poll: got length 0, expected 3 ntoskrnl.c:3066: Test failed: id 0 poll: WriteFile returned error 6 ntoskrnl.c:3071: Test failed: id 0 poll: WriteFile returned error 6 ntoskrnl.c:3082: Test failed: id 0 poll: WriteFile returned error 6 ntoskrnl.c:3096: Test failed: id 0 poll: WriteFile failed, last error 6 ntoskrnl.c:3097: Test failed: id 0 poll: WriteFile wrote 0 ntoskrnl.c:3104: Test failed: id 0 poll: ReadFile failed, last error 6 ntoskrnl.c:3108: Test failed: id 0 poll: ReadFile failed, last error 6 ntoskrnl.c:3116: Test failed: id 0 poll: ReadFile failed, last error 6 ntoskrnl.c:3117: Test failed: id 0 poll: ReadFile returned 0 ntoskrnl.c:3118: Test failed: id 0 poll: unexpected report data ntoskrnl.c:3127: Test failed: id 0 poll: ReadFile returned error 6 ntoskrnl: Timeout
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/ntoskrnl.exe/tests/driver_hid.c | 24 +++++++++++------------- dlls/ntoskrnl.exe/tests/ntoskrnl.c | 13 +++++++++++++ 2 files changed, 24 insertions(+), 13 deletions(-)
diff --git a/dlls/ntoskrnl.exe/tests/driver_hid.c b/dlls/ntoskrnl.exe/tests/driver_hid.c index 590483f528f..7819c5556bb 100644 --- a/dlls/ntoskrnl.exe/tests/driver_hid.c +++ b/dlls/ntoskrnl.exe/tests/driver_hid.c @@ -40,6 +40,7 @@ static UNICODE_STRING control_symlink;
static unsigned int got_start_device; +static HID_DEVICE_ATTRIBUTES attributes; static char report_descriptor_buf[4096]; static DWORD report_descriptor_len; static DWORD report_id; @@ -230,25 +231,16 @@ static NTSTATUS WINAPI driver_internal_ioctl(DEVICE_OBJECT *device, IRP *irp) break;
case IOCTL_HID_GET_DEVICE_ATTRIBUTES: - { - HID_DEVICE_ATTRIBUTES *attr = irp->UserBuffer; - ok(!in_size, "got input size %u\n", in_size); - ok(out_size == sizeof(*attr), "got output size %u\n", out_size); + ok(out_size == sizeof(attributes), "got output size %u\n", out_size);
- if (out_size == sizeof(*attr)) + if (out_size == sizeof(attributes)) { - ok(!attr->Size, "got size %u\n", attr->Size); - - attr->Size = sizeof(*attr); - attr->VendorID = 0x1209; - attr->ProductID = 0x0001; - attr->VersionNumber = 0xface; - irp->IoStatus.Information = sizeof(*attr); + memcpy(irp->UserBuffer, &attributes, sizeof(attributes)); + irp->IoStatus.Information = sizeof(attributes); } ret = STATUS_SUCCESS; break; - }
case IOCTL_HID_READ_REPORT: { @@ -475,6 +467,12 @@ NTSTATUS WINAPI DriverEntry(DRIVER_OBJECT *driver, UNICODE_STRING *registry) memcpy(report_descriptor_buf, buffer + info_size, size - info_size); report_descriptor_len = size - info_size;
+ RtlInitUnicodeString(&name_str, L"Attributes"); + size = info_size + sizeof(attributes); + ret = ZwQueryValueKey(hkey, &name_str, KeyValuePartialInformation, buffer, size, &size); + ok(!ret, "ZwQueryValueKey returned %#x\n", ret); + memcpy(&attributes, buffer + info_size, size - info_size); + driver->DriverExtension->AddDevice = driver_add_device; driver->DriverUnload = driver_unload; driver->MajorFunction[IRP_MJ_PNP] = driver_pnp; diff --git a/dlls/ntoskrnl.exe/tests/ntoskrnl.c b/dlls/ntoskrnl.exe/tests/ntoskrnl.c index 8160beb5dd5..b80927b6999 100644 --- a/dlls/ntoskrnl.exe/tests/ntoskrnl.c +++ b/dlls/ntoskrnl.exe/tests/ntoskrnl.c @@ -39,9 +39,11 @@ #include "dbt.h" #include "initguid.h" #include "devguid.h" +#include "ddk/wdm.h" #include "ddk/hidclass.h" #include "ddk/hidsdi.h" #include "ddk/hidpi.h" +#include "ddk/hidport.h" #include "wine/test.h" #include "wine/heap.h" #include "wine/mssign.h" @@ -3576,6 +3578,14 @@ static void test_hid_driver(struct testsign_context *ctx, DWORD report_id, DWORD #undef REPORT_ID_OR_USAGE_PAGE #include "pop_hid_macros.h"
+ static HID_DEVICE_ATTRIBUTES attributes = + { + .Size = sizeof(HID_DEVICE_ATTRIBUTES), + .VendorID = 0x1209, + .ProductID = 0x0001, + .VersionNumber = 0x0100, + }; + char cwd[MAX_PATH], tempdir[MAX_PATH]; LSTATUS status; HKEY hkey; @@ -3596,6 +3606,9 @@ static void test_hid_driver(struct testsign_context *ctx, DWORD report_id, DWORD status = RegSetValueExW(hkey, L"Descriptor", 0, REG_BINARY, (void *)report_descriptor, sizeof(report_descriptor)); ok(!status, "RegSetValueExW returned %#x\n", status);
+ status = RegSetValueExW(hkey, L"Attributes", 0, REG_BINARY, (void *)&attributes, sizeof(attributes)); + ok(!status, "RegSetValueExW returned %#x\n", status); + driver_start(ctx, L"driver_hid.dll"); test_hid_device(report_id, polled); driver_stop();
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/ntoskrnl.exe/tests/driver_hid.c | 19 +++++--- dlls/ntoskrnl.exe/tests/ntoskrnl.c | 70 +++++++++++++++------------- 2 files changed, 50 insertions(+), 39 deletions(-)
diff --git a/dlls/ntoskrnl.exe/tests/driver_hid.c b/dlls/ntoskrnl.exe/tests/driver_hid.c index 7819c5556bb..a525d845569 100644 --- a/dlls/ntoskrnl.exe/tests/driver_hid.c +++ b/dlls/ntoskrnl.exe/tests/driver_hid.c @@ -43,6 +43,7 @@ static unsigned int got_start_device; static HID_DEVICE_ATTRIBUTES attributes; static char report_descriptor_buf[4096]; static DWORD report_descriptor_len; +static HIDP_CAPS caps; static DWORD report_id; static DWORD polled;
@@ -244,7 +245,7 @@ static NTSTATUS WINAPI driver_internal_ioctl(DEVICE_OBJECT *device, IRP *irp)
case IOCTL_HID_READ_REPORT: { - ULONG expected_size = 25; + ULONG expected_size = caps.InputReportByteLength - (report_id ? 0 : 1); ok(!in_size, "got input size %u\n", in_size); ok(out_size == expected_size, "got output size %u\n", out_size);
@@ -268,7 +269,7 @@ static NTSTATUS WINAPI driver_internal_ioctl(DEVICE_OBJECT *device, IRP *irp) case IOCTL_HID_WRITE_REPORT: { HID_XFER_PACKET *packet = irp->UserBuffer; - ULONG expected_size = 2; + ULONG expected_size = caps.OutputReportByteLength - (report_id ? 0 : 1);
ok(in_size == sizeof(*packet), "got input size %u\n", in_size); ok(!out_size, "got output size %u\n", out_size); @@ -287,7 +288,7 @@ static NTSTATUS WINAPI driver_internal_ioctl(DEVICE_OBJECT *device, IRP *irp) case IOCTL_HID_GET_INPUT_REPORT: { HID_XFER_PACKET *packet = irp->UserBuffer; - ULONG expected_size = 23; + ULONG expected_size = caps.InputReportByteLength - (report_id ? 0 : 1); ok(!in_size, "got input size %u\n", in_size); ok(out_size == sizeof(*packet), "got output size %u\n", out_size);
@@ -306,7 +307,7 @@ static NTSTATUS WINAPI driver_internal_ioctl(DEVICE_OBJECT *device, IRP *irp) case IOCTL_HID_SET_OUTPUT_REPORT: { HID_XFER_PACKET *packet = irp->UserBuffer; - ULONG expected_size = 2; + ULONG expected_size = caps.OutputReportByteLength - (report_id ? 0 : 1); ok(in_size == sizeof(*packet), "got input size %u\n", in_size); ok(!out_size, "got output size %u\n", out_size);
@@ -322,7 +323,7 @@ static NTSTATUS WINAPI driver_internal_ioctl(DEVICE_OBJECT *device, IRP *irp) case IOCTL_HID_GET_FEATURE: { HID_XFER_PACKET *packet = irp->UserBuffer; - ULONG expected_size = 17; + ULONG expected_size = caps.FeatureReportByteLength - (report_id ? 0 : 1); ok(!in_size, "got input size %u\n", in_size); ok(out_size == sizeof(*packet), "got output size %u\n", out_size);
@@ -340,7 +341,7 @@ static NTSTATUS WINAPI driver_internal_ioctl(DEVICE_OBJECT *device, IRP *irp) case IOCTL_HID_SET_FEATURE: { HID_XFER_PACKET *packet = irp->UserBuffer; - ULONG expected_size = 17; + ULONG expected_size = caps.FeatureReportByteLength - (report_id ? 0 : 1); ok(in_size == sizeof(*packet), "got input size %u\n", in_size); ok(!out_size, "got output size %u\n", out_size);
@@ -473,6 +474,12 @@ NTSTATUS WINAPI DriverEntry(DRIVER_OBJECT *driver, UNICODE_STRING *registry) ok(!ret, "ZwQueryValueKey returned %#x\n", ret); memcpy(&attributes, buffer + info_size, size - info_size);
+ RtlInitUnicodeString(&name_str, L"Caps"); + size = info_size + sizeof(caps); + ret = ZwQueryValueKey(hkey, &name_str, KeyValuePartialInformation, buffer, size, &size); + ok(!ret, "ZwQueryValueKey returned %#x\n", ret); + memcpy(&caps, buffer + info_size, size - info_size); + driver->DriverExtension->AddDevice = driver_add_device; driver->DriverUnload = driver_unload; driver->MajorFunction[IRP_MJ_PNP] = driver_pnp; diff --git a/dlls/ntoskrnl.exe/tests/ntoskrnl.c b/dlls/ntoskrnl.exe/tests/ntoskrnl.c index b80927b6999..4bafc786f87 100644 --- a/dlls/ntoskrnl.exe/tests/ntoskrnl.c +++ b/dlls/ntoskrnl.exe/tests/ntoskrnl.c @@ -2014,41 +2014,42 @@ static BOOL sync_ioctl(HANDLE file, DWORD code, void *in_buf, DWORD in_len, void return ret; }
+static const HIDP_CAPS expect_hidp_caps[] = +{ + /* without report id */ + { + .Usage = HID_USAGE_GENERIC_JOYSTICK, + .UsagePage = HID_USAGE_PAGE_GENERIC, + .InputReportByteLength = 26, + .OutputReportByteLength = 3, + .FeatureReportByteLength = 22, + .NumberLinkCollectionNodes = 10, + .NumberInputButtonCaps = 17, + .NumberInputValueCaps = 7, + .NumberInputDataIndices = 47, + .NumberFeatureButtonCaps = 1, + .NumberFeatureValueCaps = 6, + .NumberFeatureDataIndices = 8, + }, + /* with report id */ + { + .Usage = HID_USAGE_GENERIC_JOYSTICK, + .UsagePage = HID_USAGE_PAGE_GENERIC, + .InputReportByteLength = 25, + .OutputReportByteLength = 2, + .FeatureReportByteLength = 21, + .NumberLinkCollectionNodes = 10, + .NumberInputButtonCaps = 17, + .NumberInputValueCaps = 7, + .NumberInputDataIndices = 47, + .NumberFeatureButtonCaps = 1, + .NumberFeatureValueCaps = 6, + .NumberFeatureDataIndices = 8, + }, +}; + static void test_hidp(HANDLE file, HANDLE async_file, int report_id, BOOL polled) { - const HIDP_CAPS expect_hidp_caps[] = - { - /* without report id */ - { - .Usage = HID_USAGE_GENERIC_JOYSTICK, - .UsagePage = HID_USAGE_PAGE_GENERIC, - .InputReportByteLength = 26, - .OutputReportByteLength = 3, - .FeatureReportByteLength = 22, - .NumberLinkCollectionNodes = 10, - .NumberInputButtonCaps = 17, - .NumberInputValueCaps = 7, - .NumberInputDataIndices = 47, - .NumberFeatureButtonCaps = 1, - .NumberFeatureValueCaps = 6, - .NumberFeatureDataIndices = 8, - }, - /* with report id */ - { - .Usage = HID_USAGE_GENERIC_JOYSTICK, - .UsagePage = HID_USAGE_PAGE_GENERIC, - .InputReportByteLength = 25, - .OutputReportByteLength = 2, - .FeatureReportByteLength = 21, - .NumberLinkCollectionNodes = 10, - .NumberInputButtonCaps = 17, - .NumberInputValueCaps = 7, - .NumberInputDataIndices = 47, - .NumberFeatureButtonCaps = 1, - .NumberFeatureValueCaps = 6, - .NumberFeatureDataIndices = 8, - }, - }; const HIDP_BUTTON_CAPS expect_button_caps[] = { { @@ -3609,6 +3610,9 @@ static void test_hid_driver(struct testsign_context *ctx, DWORD report_id, DWORD status = RegSetValueExW(hkey, L"Attributes", 0, REG_BINARY, (void *)&attributes, sizeof(attributes)); ok(!status, "RegSetValueExW returned %#x\n", status);
+ status = RegSetValueExW(hkey, L"Caps", 0, REG_BINARY, (void *)&expect_hidp_caps[report_id], sizeof(*expect_hidp_caps)); + ok(!status, "RegSetValueExW returned %#x\n", status); + driver_start(ctx, L"driver_hid.dll"); test_hid_device(report_id, polled); driver_stop();
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/ntoskrnl.exe/tests/driver_hid.c | 1 - dlls/ntoskrnl.exe/tests/ntoskrnl.c | 1 + 2 files changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/ntoskrnl.exe/tests/driver_hid.c b/dlls/ntoskrnl.exe/tests/driver_hid.c index a525d845569..9c878bec1ec 100644 --- a/dlls/ntoskrnl.exe/tests/driver_hid.c +++ b/dlls/ntoskrnl.exe/tests/driver_hid.c @@ -298,7 +298,6 @@ static NTSTATUS WINAPI driver_internal_ioctl(DEVICE_OBJECT *device, IRP *irp)
memset(packet->reportBuffer, 0xa5, 3); if (report_id) ((char *)packet->reportBuffer)[0] = report_id; - ((char *)packet->reportBuffer)[1] = seq++; irp->IoStatus.Information = 3; ret = STATUS_SUCCESS; break; diff --git a/dlls/ntoskrnl.exe/tests/ntoskrnl.c b/dlls/ntoskrnl.exe/tests/ntoskrnl.c index 4bafc786f87..af322c054b1 100644 --- a/dlls/ntoskrnl.exe/tests/ntoskrnl.c +++ b/dlls/ntoskrnl.exe/tests/ntoskrnl.c @@ -3154,6 +3154,7 @@ static void test_hidp(HANDLE file, HANDLE async_file, int report_id, BOOL polled ret = GetOverlappedResult(async_file, &overlapped, &value, FALSE); ok(ret, "GetOverlappedResult failed, last error %u\n", GetLastError()); ok(value == (report_id ? 3 : 4), "GetOverlappedResult returned length %u, expected 3\n", value); + todo_wine ok(memcmp(report, buffer + caps.InputReportByteLength, caps.InputReportByteLength), "expected different report\n"); ok(!memcmp(report, buffer, caps.InputReportByteLength), "expected identical reports\n");
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/hidclass.sys/device.c | 8 ++------ dlls/ntoskrnl.exe/tests/ntoskrnl.c | 1 - 2 files changed, 2 insertions(+), 7 deletions(-)
diff --git a/dlls/hidclass.sys/device.c b/dlls/hidclass.sys/device.c index ed7cd76fcde..9b91834267e 100644 --- a/dlls/hidclass.sys/device.c +++ b/dlls/hidclass.sys/device.c @@ -278,12 +278,8 @@ static DWORD CALLBACK hid_device_thread(void *args) packet->reportBufferLen--; }
- if (!poll_interval) - call_minidriver( IOCTL_HID_READ_REPORT, ext->u.pdo.parent_fdo, NULL, 0, - packet->reportBuffer, packet->reportBufferLen, &io ); - else - call_minidriver( IOCTL_HID_GET_INPUT_REPORT, ext->u.pdo.parent_fdo, NULL, 0, - packet, sizeof(*packet), &io ); + call_minidriver( IOCTL_HID_READ_REPORT, ext->u.pdo.parent_fdo, NULL, 0, + packet->reportBuffer, packet->reportBufferLen, &io );
if (io.Status == STATUS_SUCCESS) { diff --git a/dlls/ntoskrnl.exe/tests/ntoskrnl.c b/dlls/ntoskrnl.exe/tests/ntoskrnl.c index af322c054b1..4bafc786f87 100644 --- a/dlls/ntoskrnl.exe/tests/ntoskrnl.c +++ b/dlls/ntoskrnl.exe/tests/ntoskrnl.c @@ -3154,7 +3154,6 @@ static void test_hidp(HANDLE file, HANDLE async_file, int report_id, BOOL polled ret = GetOverlappedResult(async_file, &overlapped, &value, FALSE); ok(ret, "GetOverlappedResult failed, last error %u\n", GetLastError()); ok(value == (report_id ? 3 : 4), "GetOverlappedResult returned length %u, expected 3\n", value); - todo_wine ok(memcmp(report, buffer + caps.InputReportByteLength, caps.InputReportByteLength), "expected different report\n"); ok(!memcmp(report, buffer, caps.InputReportByteLength), "expected identical reports\n");
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=97118
Your paranoid android.
=== w7u_el (32 bit report) ===
ntoskrnl.exe: ntoskrnl: Timeout
On 9/2/21 2:24 AM, Rémi Bernon wrote:
Signed-off-by: Rémi Bernon rbernon@codeweavers.com
Looks like my attempt to move driver tests around will need some thought so I'm sending the HID tests changes in ntoskrnl.exe/tests instead, as there'll be exhibiting a few things that need fixing.
Also sending a few ntoskrnl.exe tests improvements to fix a few potential spurious failures, especially when running the tests several times, where there's sometimes stale devices laying around.
I'll probably then duplicate the code for DInput driver-based tests.
The first patch may just be skipped, otherwise Marvin was going to complain on every other patch.
dlls/ntoskrnl.exe/tests/ntoskrnl.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/dlls/ntoskrnl.exe/tests/ntoskrnl.c b/dlls/ntoskrnl.exe/tests/ntoskrnl.c index dc10497caee..e3afd46181c 100644 --- a/dlls/ntoskrnl.exe/tests/ntoskrnl.c +++ b/dlls/ntoskrnl.exe/tests/ntoskrnl.c @@ -946,7 +946,7 @@ static void do_return_status(ULONG ioctl, struct return_status_params *params) static void test_return_status(void) { struct return_status_params params;
- unsigned int i, j, k;
unsigned int i, j, k, old_threshold;
static const ULONG method_tests[] = {
@@ -979,12 +979,15 @@ static void test_return_status(void) params.ret_status = status_tests[i]; params.iosb_status = status_tests[j];
winetest_push_context("return 0x%08x, iosb 0x%08x, pending %d, method %u",
params.ret_status, params.iosb_status, params.pending, method_tests[k] & 3);
trace("testing return 0x%08x, iosb 0x%08x, pending %d, method %u\n",
params.ret_status, params.iosb_status, params.pending, method_tests[k] & 3);
Why change this to a trace?
old_threshold = winetest_mute_threshold;
winetest_mute_threshold = 1; do_return_status(method_tests[k], ¶ms);
winetest_pop_context();
winetest_mute_threshold = old_threshold;
trace("done\n"); } } }
On 9/2/21 6:47 PM, Zebediah Figura (she/her) wrote:
On 9/2/21 2:24 AM, Rémi Bernon wrote:
Signed-off-by: Rémi Bernon rbernon@codeweavers.com
Looks like my attempt to move driver tests around will need some thought so I'm sending the HID tests changes in ntoskrnl.exe/tests instead, as there'll be exhibiting a few things that need fixing.
Also sending a few ntoskrnl.exe tests improvements to fix a few potential spurious failures, especially when running the tests several times, where there's sometimes stale devices laying around.
I'll probably then duplicate the code for DInput driver-based tests.
The first patch may just be skipped, otherwise Marvin was going to complain on every other patch.
dlls/ntoskrnl.exe/tests/ntoskrnl.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/dlls/ntoskrnl.exe/tests/ntoskrnl.c b/dlls/ntoskrnl.exe/tests/ntoskrnl.c index dc10497caee..e3afd46181c 100644 --- a/dlls/ntoskrnl.exe/tests/ntoskrnl.c +++ b/dlls/ntoskrnl.exe/tests/ntoskrnl.c @@ -946,7 +946,7 @@ static void do_return_status(ULONG ioctl, struct return_status_params *params) static void test_return_status(void) { struct return_status_params params; - unsigned int i, j, k; + unsigned int i, j, k, old_threshold; static const ULONG method_tests[] = { @@ -979,12 +979,15 @@ static void test_return_status(void) params.ret_status = status_tests[i]; params.iosb_status = status_tests[j]; - winetest_push_context("return 0x%08x, iosb 0x%08x, pending %d, method %u", - params.ret_status, params.iosb_status, params.pending, method_tests[k] & 3); + trace("testing return 0x%08x, iosb 0x%08x, pending %d, method %u\n", + params.ret_status, params.iosb_status, params.pending, method_tests[k] & 3);
Why change this to a trace?
To make it still visible even if the rest is muted. Also it really doesn't help with the log size problem.
Anyway, it was mostly to have the patches run without spurious failures, it can just be ignored.
On 9/2/21 11:50 AM, Rémi Bernon wrote:
On 9/2/21 6:47 PM, Zebediah Figura (she/her) wrote:
On 9/2/21 2:24 AM, Rémi Bernon wrote:
Signed-off-by: Rémi Bernon rbernon@codeweavers.com
Looks like my attempt to move driver tests around will need some thought so I'm sending the HID tests changes in ntoskrnl.exe/tests instead, as there'll be exhibiting a few things that need fixing.
Also sending a few ntoskrnl.exe tests improvements to fix a few potential spurious failures, especially when running the tests several times, where there's sometimes stale devices laying around.
I'll probably then duplicate the code for DInput driver-based tests.
The first patch may just be skipped, otherwise Marvin was going to complain on every other patch.
dlls/ntoskrnl.exe/tests/ntoskrnl.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/dlls/ntoskrnl.exe/tests/ntoskrnl.c b/dlls/ntoskrnl.exe/tests/ntoskrnl.c index dc10497caee..e3afd46181c 100644 --- a/dlls/ntoskrnl.exe/tests/ntoskrnl.c +++ b/dlls/ntoskrnl.exe/tests/ntoskrnl.c @@ -946,7 +946,7 @@ static void do_return_status(ULONG ioctl, struct return_status_params *params) static void test_return_status(void) { struct return_status_params params; - unsigned int i, j, k; + unsigned int i, j, k, old_threshold; static const ULONG method_tests[] = { @@ -979,12 +979,15 @@ static void test_return_status(void) params.ret_status = status_tests[i]; params.iosb_status = status_tests[j]; - winetest_push_context("return 0x%08x, iosb 0x%08x, pending %d, method %u", - params.ret_status, params.iosb_status, params.pending, method_tests[k] & 3); + trace("testing return 0x%08x, iosb 0x%08x, pending %d, method %u\n", + params.ret_status, params.iosb_status, params.pending, method_tests[k] & 3);
Why change this to a trace?
To make it still visible even if the rest is muted. Also it really doesn't help with the log size problem.
I'm not sure I see the point of that. (Muting should be a temporary measure anyway...)
On 9/2/21 6:54 PM, Zebediah Figura (she/her) wrote:
On 9/2/21 11:50 AM, Rémi Bernon wrote:
On 9/2/21 6:47 PM, Zebediah Figura (she/her) wrote:
On 9/2/21 2:24 AM, Rémi Bernon wrote:
Signed-off-by: Rémi Bernon rbernon@codeweavers.com
Looks like my attempt to move driver tests around will need some thought so I'm sending the HID tests changes in ntoskrnl.exe/tests instead, as there'll be exhibiting a few things that need fixing.
Also sending a few ntoskrnl.exe tests improvements to fix a few potential spurious failures, especially when running the tests several times, where there's sometimes stale devices laying around.
I'll probably then duplicate the code for DInput driver-based tests.
The first patch may just be skipped, otherwise Marvin was going to complain on every other patch.
dlls/ntoskrnl.exe/tests/ntoskrnl.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/dlls/ntoskrnl.exe/tests/ntoskrnl.c b/dlls/ntoskrnl.exe/tests/ntoskrnl.c index dc10497caee..e3afd46181c 100644 --- a/dlls/ntoskrnl.exe/tests/ntoskrnl.c +++ b/dlls/ntoskrnl.exe/tests/ntoskrnl.c @@ -946,7 +946,7 @@ static void do_return_status(ULONG ioctl, struct return_status_params *params) static void test_return_status(void) { struct return_status_params params; - unsigned int i, j, k; + unsigned int i, j, k, old_threshold; static const ULONG method_tests[] = { @@ -979,12 +979,15 @@ static void test_return_status(void) params.ret_status = status_tests[i]; params.iosb_status = status_tests[j]; - winetest_push_context("return 0x%08x, iosb 0x%08x, pending %d, method %u", - params.ret_status, params.iosb_status, params.pending, method_tests[k] & 3); + trace("testing return 0x%08x, iosb 0x%08x, pending %d, method %u\n", + params.ret_status, params.iosb_status, params.pending, method_tests[k] & 3);
Why change this to a trace?
To make it still visible even if the rest is muted. Also it really doesn't help with the log size problem.
I'm not sure I see the point of that. (Muting should be a temporary measure anyway...)
Well for instance it could be unmuted quicker that way, once a few todos are fixed, instead of having to wait to solve most of them because of the context size repeated on each line.