Author: gadamopoulos
Date: Wed Oct 31 15:23:11 2012
New Revision: 57658
URL:
http://svn.reactos.org/svn/reactos?rev=57658&view=rev
Log:
[user32_apitests]
- Add some tests for OpenInputDesktop
Modified:
trunk/rostests/apitests/user32/desktop.c
Modified: trunk/rostests/apitests/user32/desktop.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/user32/desktop.c…
==============================================================================
--- trunk/rostests/apitests/user32/desktop.c [iso-8859-1] (original)
+++ trunk/rostests/apitests/user32/desktop.c [iso-8859-1] Wed Oct 31 15:23:11 2012
@@ -132,6 +132,33 @@
test_CreateProcessWithDesktop(8, argv0,
"NonExistantWinsta\\NonExistantDesktop", 0);
}
+void Test_OpenInputDesktop()
+{
+ HDESK hDeskInput ,hDeskInput2;
+ HDESK hDeskInitial;
+ BOOL ret;
+
+ hDeskInput = OpenInputDesktop(0, FALSE, DESKTOP_ALL_ACCESS);
+ ok(hDeskInput != NULL, "OpenInputDesktop failed\n");
+ hDeskInitial = GetThreadDesktop( GetCurrentThreadId() );
+ ok(hDeskInitial != NULL, "GetThreadDesktop failed\n");
+ ok(hDeskInput != hDeskInitial, "OpenInputDesktop returned thread
desktop\n");
+
+ hDeskInput2 = OpenInputDesktop(0, FALSE, DESKTOP_ALL_ACCESS);
+ ok(hDeskInput2 != NULL, "Second call to OpenInputDesktop failed\n");
+ ok(hDeskInput2 != hDeskInput, "Second call to OpenInputDesktop returned same
handle\n");
+
+ ok(CloseDesktop(hDeskInput2) != 0, "CloseDesktop failed\n");
+
+ ret = SetThreadDesktop(hDeskInput);
+ ok(ret == TRUE, "SetThreadDesktop for input desktop failed\n");
+
+ ret = SetThreadDesktop(hDeskInitial);
+ ok(ret == TRUE, "SetThreadDesktop for initial desktop failed\n");
+
+ ok(CloseDesktop(hDeskInput) != 0, "CloseDesktop failed\n");
+}
+
START_TEST(desktop)
{
char **test_argv;
@@ -151,4 +178,5 @@
}
Test_InitialDesktop(test_argv[0]);
+ Test_OpenInputDesktop();
}