Commit 070cbfc4 authored by Bernhard Loos's avatar Bernhard Loos Committed by Alexandre Julliard

ntdll/tests: Add a test for STATUS_OBJECT_TYPE_MISMATCH.

parent bf3c2a06
...@@ -46,6 +46,7 @@ static NTSTATUS (WINAPI *pNtOpenSymbolicLinkObject)(PHANDLE, ACCESS_MASK, POBJEC ...@@ -46,6 +46,7 @@ static NTSTATUS (WINAPI *pNtOpenSymbolicLinkObject)(PHANDLE, ACCESS_MASK, POBJEC
static NTSTATUS (WINAPI *pNtCreateSymbolicLinkObject)(PHANDLE, ACCESS_MASK, POBJECT_ATTRIBUTES, PUNICODE_STRING); static NTSTATUS (WINAPI *pNtCreateSymbolicLinkObject)(PHANDLE, ACCESS_MASK, POBJECT_ATTRIBUTES, PUNICODE_STRING);
static NTSTATUS (WINAPI *pNtQuerySymbolicLinkObject)(HANDLE,PUNICODE_STRING,PULONG); static NTSTATUS (WINAPI *pNtQuerySymbolicLinkObject)(HANDLE,PUNICODE_STRING,PULONG);
static NTSTATUS (WINAPI *pNtQueryObject)(HANDLE,OBJECT_INFORMATION_CLASS,PVOID,ULONG,PULONG); static NTSTATUS (WINAPI *pNtQueryObject)(HANDLE,OBJECT_INFORMATION_CLASS,PVOID,ULONG,PULONG);
static NTSTATUS (WINAPI *pNtReleaseSemaphore)(HANDLE handle, ULONG count, PULONG previous);
static void test_case_sensitive (void) static void test_case_sensitive (void)
...@@ -774,6 +775,28 @@ static void test_query_object(void) ...@@ -774,6 +775,28 @@ static void test_query_object(void)
pNtClose( handle ); pNtClose( handle );
} }
static void test_type_mismatch(void)
{
HANDLE h;
NTSTATUS res;
OBJECT_ATTRIBUTES attr;
attr.Length = sizeof(attr);
attr.RootDirectory = 0;
attr.ObjectName = NULL;
attr.Attributes = 0;
attr.SecurityDescriptor = NULL;
attr.SecurityQualityOfService = NULL;
res = pNtCreateEvent( &h, 0, &attr, 0, 0 );
ok(!res, "can't create event: %x\n", res);
res = pNtReleaseSemaphore( h, 30, NULL );
ok(res == STATUS_OBJECT_TYPE_MISMATCH, "expected 0xc0000024, got %x\n", res);
pNtClose( h );
}
START_TEST(om) START_TEST(om)
{ {
HMODULE hntdll = GetModuleHandleA("ntdll.dll"); HMODULE hntdll = GetModuleHandleA("ntdll.dll");
...@@ -805,6 +828,7 @@ START_TEST(om) ...@@ -805,6 +828,7 @@ START_TEST(om)
pNtCreateTimer = (void *)GetProcAddress(hntdll, "NtCreateTimer"); pNtCreateTimer = (void *)GetProcAddress(hntdll, "NtCreateTimer");
pNtCreateSection = (void *)GetProcAddress(hntdll, "NtCreateSection"); pNtCreateSection = (void *)GetProcAddress(hntdll, "NtCreateSection");
pNtQueryObject = (void *)GetProcAddress(hntdll, "NtQueryObject"); pNtQueryObject = (void *)GetProcAddress(hntdll, "NtQueryObject");
pNtReleaseSemaphore = (void *)GetProcAddress(hntdll, "NtReleaseSemaphore");
test_case_sensitive(); test_case_sensitive();
test_namespace_pipe(); test_namespace_pipe();
...@@ -812,4 +836,5 @@ START_TEST(om) ...@@ -812,4 +836,5 @@ START_TEST(om)
test_directory(); test_directory();
test_symboliclink(); test_symboliclink();
test_query_object(); test_query_object();
test_type_mismatch();
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment