VBcoders Browse New Submit Contact Sign In

No account? Register free

Forgot password?

Obtain the Owner of a File on Windows NT: Requires obtaining the security descriptor, then using th

Microsoft  (1 Submission)   Windows System Services   Visual Basic 5.0   Unknown Difficulty   Wed 17th March 1999   Mon 8th February 2021

Obtain the Owner of a File on Windows NT: Requires obtaining the security descriptor, then using the descriptor to get a pointer to the

API Declarations



Private Declare Function GetFileSecurity Lib "advapi32.dll" _
Alias "GetFileSecurityA" ( _
ByVal lpFileName As String, _
ByVal RequestedInformation As Long, _
pSecurityDescriptor As Byte, _
ByVal nLength As Long, _
lpnLengthNeeded As Long _
) As Long

Private Declare Function GetSecurityDescriptorOwner Lib "advapi32.dll" _
(pSecurityDescriptor As Any, _
pOwner As Long, _
lpbOwnerDefaulted As Long) As Long

Private Declare Function LookupAccountSid Lib "advapi32.dll" _
Alias "LookupAccountSidA" ( _
ByVal lpSystemName As String, _
ByVal Sid As Long, _
ByVal name As String, _
cbName As Long, _
ByVal ReferencedDomainName As String, _
cbReferencedDomainName As Long, _
peUse As Long) As Long

Private Declare Function GetWindowsDirectory Lib "kernel32" _
Alias "GetWindowsDirectoryA" ( _
ByVal lpBuffer As String, _
ByVal nSize As Long) As Long

Private Const OWNER_SECURITY_INFORMATION = &H1
Private Const ERROR_INSUFFICIENT_BUFFER = 122&
Private Const MAX_PATH = 255

Rate Obtain the Owner of a File on Windows NT: Requires obtaining the security descriptor, then using th (1(1 Vote))
Obtain the Owner of a File on Windows NT: Requires obtaining the security descriptor, then using th.bas

Obtain the Owner of a File on Windows NT: Requires obtaining the security descriptor, then using th Comments

No comments yet — be the first to post one!

Post a Comment

0/1000 characters