can't change the control property of a Security Descriptor of a file 
Author Message
 can't change the control property of a Security Descriptor of a file

Hi,

I can't change the control property of a Security Descriptor of a
file/Directory.

Can someone explaine me what is wrong in my code ???

Thanks in advance

Stphane Schwartz

VB Code :

Const DACL_PROTECTED As Long = &H1000

Private Type SECURITY_DESCRIPTOR

Revision As Byte

Sbz1 As Byte

Control As Integer

Owner As Long

Group As Long

sacl As ACL

dacl As ACL

End Type

Private Declare Function GetNamedSecurityInfo Lib "advapi32.dll" Alias
"GetNamedSecurityInfoA" ( _

ByVal ObjName As String, _

ByVal SE_OBJECT As Long, _

ByVal SecInfo As Long, _

ByVal PSID As Long, _

ByVal psidGroup As Long, _

lngDacl As Long, _

pSacl As Long, _

pSecurityDescriptor As SECURITY_DESCRIPTOR) As Long

Private Declare Function SetSecurityDescriptorControl Lib "advapi32" ( _

pSecurityDescriptor As SECURITY_DESCRIPTOR, _

ByVal ControlBitsOfInterest As Integer, _

ByVal ControlBitsToSet As Integer) As Long

Public Function SetSecurityDescriptor()

Dim lngCompteur As Long

Dim lngDacl As Long

Dim lngReponse As Long

Dim oSDSecurityDescriptor As SECURITY_DESCRIPTOR

lngCompteur = GetNamedSecurityInfo(filename, SE_FILE_OBJECT,
DACL_SECURITY_INFORMATION, _

0&, 0&, lngDacl, ByVal 0, oSDSecurityDescriptor)

lngReponse = SetSecurityDescriptorControl _

(oSDSecurityDescriptor, DACL_PROTECTED, IIf(BoolInherit_DACL_Protected,
DACL_PROTECTED, 0))

End Function



Tue, 08 Apr 2003 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Why do property descriptors change case??

2. Build Exchange Mailbox with security descriptor. (SOLVED)

3. Help in creating Security Descriptor

4. 'Canned' data in VB program

5. Security Descriptor

6. Build Exchange Mailbox with security descriptor. (SOLVED)

7. Pointer to Security Descriptor?

8. Problem retrieving Security Descriptor

9. Changing a control's properties from another form in a project

10. OCX to permantly change control's properties in runtime ver of Access7

11. backcolor property on SSTab control doesn't change backcolor

12. control's properties, changing

 

 
Powered by phpBB® Forum Software