[SETUPAPI] CM_Set_Class_Registry_PropertyW: Do not convert SD if ulLength is 0

This commit is contained in:
Eric Kohl 2024-12-14 20:09:27 +01:00
parent 4795177ced
commit 4d376dfd64

View file

@ -7974,6 +7974,8 @@ CM_Set_Class_Registry_PropertyW(
return CR_INVALID_DATA; return CR_INVALID_DATA;
if (ulProperty == CM_CRP_SECURITY_SDS) if (ulProperty == CM_CRP_SECURITY_SDS)
{
if (ulLength != 0)
{ {
if (!ConvertStringSecurityDescriptorToSecurityDescriptorW((LPCWSTR)Buffer, if (!ConvertStringSecurityDescriptorToSecurityDescriptorW((LPCWSTR)Buffer,
SDDL_REVISION_1, SDDL_REVISION_1,
@ -7986,6 +7988,8 @@ CM_Set_Class_Registry_PropertyW(
Buffer = (PCVOID)pSecurityDescriptor; Buffer = (PCVOID)pSecurityDescriptor;
ulLength = SecurityDescriptorSize; ulLength = SecurityDescriptorSize;
}
ulProperty = CM_CRP_SECURITY; ulProperty = CM_CRP_SECURITY;
ulType = REG_BINARY; ulType = REG_BINARY;
} }