How to Create A Shared Folder
-
i was surfing the whole noon just looking on how to create a shared folder over network with permission. i also couldn't found any example in MSDN. at last i found some code snippets on some forum.. anyone could give some code snippets? thanks in advanced. SECURITY_INFORMATION SecurityInformation; SecurityInformation = OWNER_SECURITY_INFORMATION; SECURITY_DESCRIPTOR SecurityDescriptor; ACL Acl; SID Sid; DWORD dwAclAllowed; dwAclAllowed = sizeof(ACCESS_ALLOWED_ACE) - sizeof(DWORD) + GetLengthSid(&Sid); InitializeAcl(&Acl, dwAclAllowed, ACL_REVISION); InitializeSecurityDescriptor(&SecurityDescriptor, SECURITY_DESCRIPTOR_REVISION); SetSecurityDescriptorOwner(&SecurityDescriptor, &Sid, TRUE); SetSecurityDescriptorGroup(&SecurityDescriptor, &Sid, TRUE); SetSecurityDescriptorDacl(&SecurityDescriptor, TRUE, &Acl, TRUE); SetSecurityDescriptorSacl(&SecurityDescriptor, TRUE, &Acl, TRUE); SetFileSecurity(strOCRDownloadFontLibPath, SecurityInformation, &SecurityDescriptor); from, -= aLbert =-