[KMTESTS:EX] Use stricter checks for the UUID returned from ExUuidCreate.

* Check the entire version field
* Check the variant field
* Accept RPC_NT_UUID_LOCAL_ONLY, which is sometimes returned by Windows
* Repeat the test to show that these things happen every time

Based on a patch by Serge Gautherie.
This commit is contained in:
Thomas Faber 2020-06-27 09:27:33 +02:00
parent 8983adf967
commit 1481df94ab
No known key found for this signature in database
GPG key ID: 076E7C3D44720826

View file

@ -14,8 +14,14 @@ START_TEST(ExUuid)
{
UUID Uuid;
NTSTATUS Status;
ULONG i;
Status = ExUuidCreate(&Uuid);
ok(Status == STATUS_SUCCESS, "ExUuidCreate returned unexpected status: %lx\n", Status);
ok((Uuid.Data3 & 0x1000) == 0x1000, "Invalid UUID version: %x\n", (Uuid.Data3 & 0xF000));
for (i = 0; i < 1000; i++)
{
Status = ExUuidCreate(&Uuid);
ok(Status == STATUS_SUCCESS || Status == RPC_NT_UUID_LOCAL_ONLY,
"ExUuidCreate returned unexpected status: 0x%lx\n", Status);
ok((Uuid.Data3 & 0xF000) == 0x1000, "Invalid UUID version: 0x%x\n", (Uuid.Data3 & 0xF000));
ok((Uuid.Data4[0] & 0xC0) == 0x80, "Invalid UUID variant: 0x%x\n", (Uuid.Data4[0] & 0xF0));
}
}