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:
parent
b4926e2724
commit
1a1c1d07ee
1 changed files with 13 additions and 5 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue