1
0
Fork 0
mirror of synced 2025-03-07 03:53:26 +01:00

advapi32: Respect object type in SetSecurityInfo().

Do not try to treat types which are not kernel handles as kernel handles.
This commit is contained in:
Zebediah Figura 2023-10-15 12:59:32 -05:00 committed by Alexandre Julliard
parent b4926e2724
commit 1a1c1d07ee

View file

@ -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 */
break;
default:
case SE_FILE_OBJECT:
case SE_KERNEL_OBJECT:
case SE_WMIGUID_OBJECT:
case SE_REGISTRY_KEY:
status = NtSetSecurityObject(handle, SecurityInfo, &sd);
break;
default:
FIXME("unimplemented type %u, returning success\n", ObjectType);
status = STATUS_SUCCESS;
break;
}
if (dacl != pDacl)
free(dacl);