Marco
August 24th, 1999, 03:27 AM
private Type SECURITY_DESCRIPTOR
Descriptor(SECURITY_DESCRIPTOR_MIN_LENGTH) as Byte
End Type
private Type SECURITY_ATTRIBUTES
nLength as Long
lpSecurityDescriptor as Long
bInheritHandle as Long
End Type
private Declare Function InitializeSecurityDescriptor Lib "advapi32.dll" (pSecurityDescriptor as SECURITY_DESCRIPTOR, byval dwRevision as Long) as Long
private Declare Function SetSecurityDescriptorDacl Lib "advapi32.dll" (pSecurityDescriptor as SECURITY_DESCRIPTOR, byval bDaclPresent as Long, byval pDacl as Long, byval bDaclDefaulted as Long) as Long
private Declare Function CreateNamedPipe Lib "kernel32" Alias "CreateNamedPipeA" (byval lpName as string, byval dwOpenMode as Long, byval dwPipeMode as Long, byval nMaxInstances as Long, byval nOutBufferSize as Long, byval nInBufferSize as Long, byval nDefaultTimeOut as Long, lpSecurityAttributes as SECURITY_ATTRIBUTES) as Long
Dim pSD as SECURITY_DESCRIPTOR
Dim sa as SECURITY_ATTRIBUTES
............
' create a security descriptor that allows anyone to write to
' the pipe...
'
result = InitializeSecurityDescriptor(pSD, SECURITY_DESCRIPTOR_REVISION)
' add a null disc. ACL to the security descriptor.
'
result = SetSecurityDescriptorDacl(pSD, 1, 0&, 0)
sa.nLength = len(sa)
sa.lpSecurityDescriptor = pSD <--------
sa.bInheritHandle = 1
.............
I wanna assign the memory address of variable pSD to sa.lpSecurityDescriptor; how could i do it ?
Thank you in advance for your help.....
Descriptor(SECURITY_DESCRIPTOR_MIN_LENGTH) as Byte
End Type
private Type SECURITY_ATTRIBUTES
nLength as Long
lpSecurityDescriptor as Long
bInheritHandle as Long
End Type
private Declare Function InitializeSecurityDescriptor Lib "advapi32.dll" (pSecurityDescriptor as SECURITY_DESCRIPTOR, byval dwRevision as Long) as Long
private Declare Function SetSecurityDescriptorDacl Lib "advapi32.dll" (pSecurityDescriptor as SECURITY_DESCRIPTOR, byval bDaclPresent as Long, byval pDacl as Long, byval bDaclDefaulted as Long) as Long
private Declare Function CreateNamedPipe Lib "kernel32" Alias "CreateNamedPipeA" (byval lpName as string, byval dwOpenMode as Long, byval dwPipeMode as Long, byval nMaxInstances as Long, byval nOutBufferSize as Long, byval nInBufferSize as Long, byval nDefaultTimeOut as Long, lpSecurityAttributes as SECURITY_ATTRIBUTES) as Long
Dim pSD as SECURITY_DESCRIPTOR
Dim sa as SECURITY_ATTRIBUTES
............
' create a security descriptor that allows anyone to write to
' the pipe...
'
result = InitializeSecurityDescriptor(pSD, SECURITY_DESCRIPTOR_REVISION)
' add a null disc. ACL to the security descriptor.
'
result = SetSecurityDescriptorDacl(pSD, 1, 0&, 0)
sa.nLength = len(sa)
sa.lpSecurityDescriptor = pSD <--------
sa.bInheritHandle = 1
.............
I wanna assign the memory address of variable pSD to sa.lpSecurityDescriptor; how could i do it ?
Thank you in advance for your help.....