win32security.SetSecurityInfo

SetSecurityInfo(handle, ObjectType, SecurityInfo, Owner, Group, Dacl, Sacl)

Sets security info for an object by handle

Parameters

handle : int/PyHANDLE

Handle to object

ObjectType : int

Value from SE_OBJECT_TYPE enum

SecurityInfo : int

Combination of SECURITY_INFORMATION constants

Owner : PySID

Sid to set as owner of object, can be None

Group : PySID

Group Sid, can be None

Dacl : PyACL

Discretionary ACL to set for object, can be None

Sacl : PyACL

System Audit ACL to set for object, can be None