maillady 2 Posted August 19, 2012 The last parameter "$pSecurity" for _WinAPI_CreateFile, there's no example on how to use the "$tagSECURITY_ATTRIBUTES" struct..How do I get "Descriptor" part of the strutcure for $tagSECURITY_ATTRIBUTESLocal $pSecurity = DllStructCreate($tagSECURITY_ATTRIBUTES) DllStructSetData($pSecurity, "InheritHandle", 1);If True, the new process inherits the handle. DllStructSetData($pSecurity, "Descriptor", ?????????); A pointer to a security descriptor for the object that controls the sharing of it DllStructSetData($pSecurity, "Length", DllStructGetSize($pSecurity)) ;The size, in bytes, of this structure Local $hFile = _WinAPI_CreateFile($sFilename, 2, 2, 4, $pSecurity) If (Not $hFile) Then Return SetError(3, 0, 0) Share this post Link to post Share on other sites
Andreik 66 Posted August 20, 2012 MSDN:Because the internal format of a security descriptor can vary, we recommend that applications not modify the SECURITY_DESCRIPTOR structure directly.For creating and manipulating a security descriptor, use the functions: GetSecurityDescriptorControl GetSecurityDescriptorDacl GetSecurityDescriptorGroup GetSecurityDescriptorLength GetSecurityDescriptorOwner GetSecurityDescriptorRMControl GetSecurityDescriptorSacl InitializeSecurityDescriptor IsValidSecurityDescriptor SetSecurityDescriptorDacl SetSecurityDescriptorGroup SetSecurityDescriptorOwner SetSecurityDescriptorRMControl SetSecurityDescriptorSacl When the words fail... music speaks Share this post Link to post Share on other sites