Click to open or copy the files for the NetShare sample.
This sample illustrates how to use the Windows NT® Lan Manager API in conjunction with the Win32® security API to create a new share on an arbitrary machine with permissions that grant an arbitrary user/group Full Access to the share.
This sample uses the following keywords:
addaccessallowedace; fprintf; getlasterror; getlengthsid; getprocessheap; heapalloc; heapfree; heaprealloc; initializeacl; initializesecuritydescriptor; lookupaccountnamew; netshareadd; printf; setsecuritydescriptordacl; wmain