المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : reading NTFS Share permission - how to interpret SHARE_INFO_2.Permissions flag



C# Programming
01-26-2013, 01:17 AM
hi i am trying to read NTFS share permission. Imported

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
protected struct SHARE_INFO_2
{
[MarshalAs(UnmanagedType.LPWStr)]
public string NetName;
public ShareType ShareType;
[MarshalAs(UnmanagedType.LPWStr)]
public string Remark;
public int Permissions;
public int MaxUsers;
public int CurrentUsers;
[MarshalAs(UnmanagedType.LPWStr)]
public string Path;
[MarshalAs(UnmanagedType.LPWStr)]
public string Password;
}


According to MSDN, Permissions include ACCESS_READ, ACCESS_WRITE, ... etc but the document doesn't tell you the "Integer" value of these constants. Where can I find the C++ header file where these constants are defined? I need them so I can convert integer value "Permissions" into human readable message. (http://msdn.microsoft.com/en-us/library/windows/desktop/bb525408%28v=vs.85%29.aspx)[^ (http://msdn.microsoft.com/en-us/library/windows/desktop/bb525408%28v=vs.85%29.aspx)].

Thank you!

Reference: Network Shares and UNC paths (http://www.codeproject.com/KB/IP/networkshares.aspx)[^ (http://www.codeproject.com/KB/IP/networkshares.aspx)]
dev