Commit 245bdef5 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

advapi32: Implement GetSecurityInfo(SE_WINDOW_OBJECT).

parent 2408676f
......@@ -2,7 +2,7 @@ EXTRADEFS = -D_ADVAPI32_
MODULE = advapi32.dll
IMPORTLIB = advapi32
IMPORTS = kernelbase sechost msvcrt
DELAYIMPORTS = rpcrt4
DELAYIMPORTS = rpcrt4 user32
C_SRCS = \
advapi.c \
......
......@@ -1529,6 +1529,21 @@ DWORD WINAPI GetSecurityInfo( HANDLE handle, SE_OBJECT_TYPE type, SECURITY_INFOR
}
break;
case SE_WINDOW_OBJECT:
if (!GetUserObjectSecurity( handle, &SecurityInfo, NULL, 0, &size )
&& GetLastError() != ERROR_INSUFFICIENT_BUFFER)
return GetLastError();
if (!(sd = LocalAlloc( 0, size )))
return ERROR_NOT_ENOUGH_MEMORY;
if (!GetUserObjectSecurity( handle, &SecurityInfo, sd, size, &size ))
{
LocalFree( sd );
return GetLastError();
}
break;
case SE_KERNEL_OBJECT:
case SE_FILE_OBJECT:
case SE_WMIGUID_OBJECT:
......
TESTDLL = advapi32.dll
IMPORTS = advapi32
IMPORTS = advapi32 user32
C_SRCS = \
cred.c \
......
......@@ -8780,6 +8780,28 @@ static void test_IsValidSecurityDescriptor(void)
free(sd);
}
static void test_window_security(void)
{
PSECURITY_DESCRIPTOR sd;
BOOL present, defaulted;
HDESK desktop;
DWORD ret;
ACL *dacl;
desktop = GetThreadDesktop(GetCurrentThreadId());
ret = GetSecurityInfo(desktop, SE_WINDOW_OBJECT,
DACL_SECURITY_INFORMATION, NULL, NULL, NULL, NULL, &sd);
ok(!ret, "got error %lu\n", ret);
ret = GetSecurityDescriptorDacl(sd, &present, &dacl, &defaulted);
ok(ret == TRUE, "got error %lu\n", GetLastError());
todo_wine ok(present == TRUE, "got present %d\n", present);
ok(defaulted == FALSE, "got defaulted %d\n", defaulted);
LocalFree(sd);
}
START_TEST(security)
{
init();
......@@ -8850,6 +8872,7 @@ START_TEST(security)
test_elevation();
test_group_as_file_owner();
test_IsValidSecurityDescriptor();
test_window_security();
/* Must be the last test, modifies process token */
test_token_security_descriptor();
......
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