Skip to content

Latest commit

 

History

History
64 lines (43 loc) · 1.32 KB

NetShareAdd.md

File metadata and controls

64 lines (43 loc) · 1.32 KB

Home

Function name : NetShareAdd

Group: Network Management - Library: netapi32


Shares a server resource.


Code examples:

How to enumerate, add and delete shares on the local computer (WinNT/XP)

Declaration:

NET_API_STATUS NetShareAdd(
	LPWSTR servername,
	DWORD level,
	LPBYTE buf,
	LPDWORD parm_err
);
  

FoxPro declaration:

DECLARE INTEGER NetShareAdd IN netapi32;
	STRING servername,;
	LONG lvl,;
	STRING @buffer,;
	LONG @parm_err
  

Parameters:

servername [in] Pointer to a string that specifies the DNS or NetBIOS name of the remote server on which the function is to execute.

level [in] Specifies the information level of the data (2, 502).

buf [in] Pointer to the buffer that specifies the data.

parm_err [out] Pointer to a value that receives the index of the first member of the share information structure that causes the ERROR_INVALID_PARAMETER error.


Return value:

If the function succeeds, the return value is NERR_Success (0).


Comments:

If the servername parameter is NULL, the local computer is used.