maillady Posted August 19, 2012 Share 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) Link to comment Share on other sites More sharing options...
Andreik Posted August 20, 2012 Share 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. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now