Bernhard Loos : ntdll/tests: Add a test for STATUS_OBJECT_TYPE_MISMATCH.

Alexandre Julliard julliard at winehq.org
Wed Jul 20 12:54:40 CDT 2011


Module: wine
Branch: master
Commit: 070cbfc412d3e61a8cdd8e5da350d4e6b96f539a
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=070cbfc412d3e61a8cdd8e5da350d4e6b96f539a

Author: Bernhard Loos <bernhardloos at googlemail.com>
Date:   Tue Jul 19 13:20:45 2011 +0200

ntdll/tests: Add a test for STATUS_OBJECT_TYPE_MISMATCH.

---

 dlls/ntdll/tests/om.c |   25 +++++++++++++++++++++++++
 1 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/dlls/ntdll/tests/om.c b/dlls/ntdll/tests/om.c
index b13d9d1..ac37761 100644
--- a/dlls/ntdll/tests/om.c
+++ b/dlls/ntdll/tests/om.c
@@ -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 *pNtQuerySymbolicLinkObject)(HANDLE,PUNICODE_STRING,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)
@@ -774,6 +775,28 @@ static void test_query_object(void)
     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)
 {
     HMODULE hntdll = GetModuleHandleA("ntdll.dll");
@@ -805,6 +828,7 @@ START_TEST(om)
     pNtCreateTimer          =  (void *)GetProcAddress(hntdll, "NtCreateTimer");
     pNtCreateSection        =  (void *)GetProcAddress(hntdll, "NtCreateSection");
     pNtQueryObject          =  (void *)GetProcAddress(hntdll, "NtQueryObject");
+    pNtReleaseSemaphore     =  (void *)GetProcAddress(hntdll, "NtReleaseSemaphore");
 
     test_case_sensitive();
     test_namespace_pipe();
@@ -812,4 +836,5 @@ START_TEST(om)
     test_directory();
     test_symboliclink();
     test_query_object();
+    test_type_mismatch();
 }




More information about the wine-cvs mailing list