NetshareAdd function 
Author Message
 NetshareAdd function

I'm trying to share directories by software. (Visual Basic). I'm
 for an example of use of the NetShareAdd function under Visual Basic
 5.0. I know the C declaration of this function but I have some problems
 to translate it in Visual Basic.
 here is the C declaration:

 ********************** BEGINING OF DOCUMENTATION

         NET_API_STATUS NetShareAdd(
         LPTSTR servername,
         DWORD level,LPBYTE buf,
         LPDWORD parm_err

 Parameters :
 Pointer to a Unicode string containing the name of the remote server on
 which the function is to execute. A NULL poiunter or string specifies
 the local computer.

 Specifies one of the following values to set the level of information
 Value meaning :
 2  The buf parameter points to an array of SHARE_INFO_2 structures
 502  The buf parameter points to an array of SHARE_INFO_502 structures

 Pointer to the buffer in which the data set with the level parameter is

 Optional pointer to a DWORD that contains the index of the first
 parameter that causes ERROR_INVALID_PARAMETER. If NULL, the parameter
 not returned on error.

 If successfull, the return value is NERR_Success (0)
 If the function fails :
 NERR_Duplicate_Share (2118)
 NERR_Redirected_Path (2117)

         typedef struct _SHARE_INFO_2 {
                 LPTSTR  shi2_netname;
                 DWORD   shi2_type;
                 LPTSTR  shi2_remark;
                 DWORD   shi2_permissions;
                 DWORD   shi2_max_uses;
                 DWORD   shi2_current_uses;
                 LPTSTR  shi2_path;
                 LPTSTR  shi2_passwd;
 shi2_name :
 A unicode string containing the sharename of the ressource.
 shi2_type :
 This member can be one of the following types:
         STYPE_DISKTREE  Disk drive
         STYPE_PRINTQ  Print queue
         STYPE_DEVICE  Communication device
         STYPE_IPC  Introprocess communication
 String of remark
 Value needed (for me) ACCESS_ALL  (I think that the value is &HB700)
 maximum number of concurrent connections (unlimited if = -1)
 Number of current connections to the resource
 points to a Unicode string containing the local path for the shared
 shi2_passwd :
 Specifies the share's password (when the server is running with
 share-level security). If the server is running with user-level
 shi2_passwd is ignored. The shi2_passwd member can be no longer than
 SHPWLEN +1 bytes (including a terminating null character)

 ********************** END OF DOCUMENTATION ***********************

Tue, 27 Mar 2001 03:00:00 GMT  
 [ 1 post ] 

 Relevant Pages 

1. NetShareAdd function

2. NetShareAdd function

3. NetShareAdd function

4. netshareadd function win95/98

5. NetShareAdd function

6. HELP NetShareAdd function

7. NetShareAdd function

8. NetShareAdd Function

9. NetShareAdd function

10. NetShareAdd function

11. function NetShareAdd parameters

12. function NetShareAdd parameters


Powered by phpBB® Forum Software