Commit 2408676f authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

user32/tests: Add basic tests for GetUserObjectSecurity().

parent 1a1c1d07
......@@ -1093,6 +1093,31 @@ static void test_invisible_winstation(char **argv)
SetProcessWindowStation(old_winstation);
}
static void test_get_security(void)
{
SECURITY_INFORMATION info = DACL_SECURITY_INFORMATION;
HDESK desktop = GetThreadDesktop(GetCurrentThreadId());
DWORD size, expect_size;
char buffer[500];
BOOL ret;
size = 0xdeadbeef;
SetLastError(0xdeadbeef);
ret = GetUserObjectSecurity( desktop, &info, NULL, 0, &size );
ok( !ret, "got %#x\n", ret );
ok( GetLastError() == ERROR_INSUFFICIENT_BUFFER, "got error %lu\n", GetLastError() );
ok( size && size < sizeof(buffer), "got size %lu\n", size );
expect_size = size;
size = 0xdeadbeef;
SetLastError(0xdeadbeef);
ret = GetUserObjectSecurity( desktop, &info, buffer, sizeof(buffer), &size );
ok( ret == TRUE, "got %#x\n", ret );
ok( GetLastError() == 0xdeadbeef, "got error %lu\n", GetLastError() );
ok( size == expect_size, "got size %lu\n", size );
ok( IsValidSecurityDescriptor(buffer), "expected valid SD\n" );
}
START_TEST(winstation)
{
char **argv;
......@@ -1126,4 +1151,5 @@ START_TEST(winstation)
test_getuserobjectinformation();
test_foregroundwindow();
test_invisible_winstation(argv);
test_get_security();
}
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