We are trying to use NetShareAdd to create a share on the system and have it recognized in the clustered resource. So the clustered resource name is "ExileOnMainSt" and thus:
SHARE_INFO_503 si503 = { 0 }; si503.shi503_servername = L"EXILEONMAINST"; si503.shi503_netname = L"TSV" si503.shi503_type = STYPE_DISKTREE; si503.shi503_remark = L""; si503.shi503_permissions = ACCESS_READ; si503.shi503_max_uses = 0xFFFFFFFF; si503.shi503_path = L"S:\\TSV"; DWORD dwParmErr = 0; NET_API_STATUS eNetErr = NetShareAdd(L"EXILEONMAINST", 503, (LPBYTE) &si503, &dwParmErr);
I'm receiving ERROR_INVALID_PARAMETER but dwParmErr is zero when the spec says it should be one of the following:
#define SHARE_NETNAME_PARMNUM 1 #define SHARE_TYPE_PARMNUM 3 #define SHARE_REMARK_PARMNUM 4 #define SHARE_PERMISSIONS_PARMNUM 5 #define SHARE_MAX_USES_PARMNUM 6 #define SHARE_CURRENT_USES_PARMNUM 7 #define SHARE_PATH_PARMNUM 8 #define SHARE_PASSWD_PARMNUM 9 #define SHARE_FILE_SD_PARMNUM 501 #define SHARE_SERVER_PARMNUM 503
This works in Windows Server 2008 R2. Has the functionality changed?
Adam