我要做控制服务器共享目录,需要用API,函数我知道了。但具体有很多问题,请高手看看
我要通过数据库要求在服务期上自动开共享目录,并控制能使用此目录的人员(通过系统登陆名)或工作组
SetFileSecurity,GetFileSecurity, SECURITY_DESCRIPTOR, SECURITY_INFORMATION, SetKernelObjectSecurity, SetPrivateObjectSecurity, SetUserObjectSecurity 等
具体我用pb来做
资料上
FUNCTION ulong SetFileSecurity(ref string lpFileName,ulong SecurityInformation,ref SECURITY_DESCRIPTOR pSecurityDescriptor) LIBRARY "advapi32.dll" ALIAS FOR "SetFileSecurityA"
问SetFileSecurityA怎么用
问SECURITY_DESCRIPTOR 是什么类型的,pb里怎么定义和使用
资料里是写:typedef PVOID PSECURITY_DESCRIPTOR;
资料如下
http://efplus.com/techref/os/win/api/win32/func/src/f78_21.htm
////////////////////////////////////////////////////////
BOOL SetFileSecurity( LPCTSTR lpFileName,
// address of string for filename
SECURITY_INFORMATION SecurityInformation,
// type of information to set
PSECURITY_DESCRIPTOR pSecurityDescriptor
// address of security descriptor
Parameters
lpFileName
Points to a null-terminated string specifying the file or directory for which security is set.
SecurityInformation
Specifies a SECURITY_INFORMATION structure identifying the contents of the security descriptor pointed to by the pSecurityDescriptor parameter.
pSecurityDescriptor
Points to a SECURITY_DESCRIPTOR structure.
//////////////////////////////////////////////////////////////
高手能写个范例给我没,我处理没什么反映。