Commit 1a1c1d07 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

advapi32: Respect object type in SetSecurityInfo().

Do not try to treat types which are not kernel handles as kernel handles.
parent b4926e27
......@@ -2925,6 +2925,9 @@ DWORD WINAPI SetSecurityInfo(HANDLE handle, SE_OBJECT_TYPE ObjectType,
PACL dacl = pDacl;
NTSTATUS status;
if (!handle)
return ERROR_INVALID_HANDLE;
if (!InitializeSecurityDescriptor(&sd, SECURITY_DESCRIPTOR_REVISION))
return ERROR_INVALID_SECURITY_DESCR;
......@@ -3032,13 +3035,18 @@ DWORD WINAPI SetSecurityInfo(HANDLE handle, SE_OBJECT_TYPE ObjectType,
switch (ObjectType)
{
case SE_SERVICE:
FIXME("stub: Service objects are not supported at this time.\n");
status = STATUS_SUCCESS; /* Implement SetServiceObjectSecurity */
case SE_FILE_OBJECT:
case SE_KERNEL_OBJECT:
case SE_WMIGUID_OBJECT:
case SE_REGISTRY_KEY:
status = NtSetSecurityObject(handle, SecurityInfo, &sd);
break;
default:
status = NtSetSecurityObject(handle, SecurityInfo, &sd);
FIXME("unimplemented type %u, returning success\n", ObjectType);
status = STATUS_SUCCESS;
break;
}
if (dacl != pDacl)
free(dacl);
......
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