+ /* Create PublicDefaultSd */
+ SePublicDefaultSd = ExAllocatePool(NonPagedPool,
+ sizeof(SECURITY_DESCRIPTOR));
+ if (SePublicDefaultSd == NULL)
+ return(FALSE);
+
+ RtlCreateSecurityDescriptor(SePublicDefaultSd,
+ SECURITY_DESCRIPTOR_REVISION);
+ RtlSetDaclSecurityDescriptor(SePublicDefaultSd,
+ TRUE,
+ SePublicDefaultDacl,
+ FALSE);
+
+ /* Create PublicDefaultUnrestrictedSd */
+ SePublicDefaultUnrestrictedSd = ExAllocatePool(NonPagedPool,
+ sizeof(SECURITY_DESCRIPTOR));
+ if (SePublicDefaultUnrestrictedSd == NULL)
+ return(FALSE);
+
+ RtlCreateSecurityDescriptor(SePublicDefaultUnrestrictedSd,
+ SECURITY_DESCRIPTOR_REVISION);
+ RtlSetDaclSecurityDescriptor(SePublicDefaultUnrestrictedSd,
+ TRUE,
+ SePublicDefaultUnrestrictedDacl,
+ FALSE);
+
+ /* Create PublicOpenSd */
+ SePublicOpenSd = ExAllocatePool(NonPagedPool,
+ sizeof(SECURITY_DESCRIPTOR));
+ if (SePublicOpenSd == NULL)
+ return(FALSE);
+
+ RtlCreateSecurityDescriptor(SePublicOpenSd,
+ SECURITY_DESCRIPTOR_REVISION);
+ RtlSetDaclSecurityDescriptor(SePublicOpenSd,
+ TRUE,
+ SePublicOpenDacl,
+ FALSE);
+
+ /* Create PublicOpenUnrestrictedSd */
+ SePublicOpenUnrestrictedSd = ExAllocatePool(NonPagedPool,
+ sizeof(SECURITY_DESCRIPTOR));
+ if (SePublicOpenUnrestrictedSd == NULL)
+ return(FALSE);
+
+ RtlCreateSecurityDescriptor(SePublicOpenUnrestrictedSd,
+ SECURITY_DESCRIPTOR_REVISION);
+ RtlSetDaclSecurityDescriptor(SePublicOpenUnrestrictedSd,
+ TRUE,
+ SePublicOpenUnrestrictedDacl,
+ FALSE);
+
+ /* Create SystemDefaultSd */
+ SeSystemDefaultSd = ExAllocatePool(NonPagedPool,
+ sizeof(SECURITY_DESCRIPTOR));
+ if (SeSystemDefaultSd == NULL)
+ return(FALSE);
+
+ RtlCreateSecurityDescriptor(SeSystemDefaultSd,
+ SECURITY_DESCRIPTOR_REVISION);
+ RtlSetDaclSecurityDescriptor(SeSystemDefaultSd,
+ TRUE,
+ SeSystemDefaultDacl,
+ FALSE);
+
+ /* Create UnrestrictedSd */
+ SeUnrestrictedSd = ExAllocatePool(NonPagedPool,
+ sizeof(SECURITY_DESCRIPTOR));
+ if (SeUnrestrictedSd == NULL)
+ return(FALSE);
+
+ RtlCreateSecurityDescriptor(SeUnrestrictedSd,
+ SECURITY_DESCRIPTOR_REVISION);
+ RtlSetDaclSecurityDescriptor(SeUnrestrictedSd,
+ TRUE,
+ SeUnrestrictedDacl,
+ FALSE);
+