Platform SDK: Network Management |
The network management share functions control shared resources. A shared resource is a local resource on a server (for example, a disk directory, print device, or named pipe) that can be accessed by users and applications on the network.
The share functions are listed following.
Function | Description |
---|---|
NetShareAdd | Shares a resource on a server. |
NetShareCheck | Queries whether a server is sharing a device. |
NetShareDel | Deletes a share name from a server's list of shared resources. |
NetShareEnum | Retrieves share information about each shared resource on a server. |
NetShareGetInfo | Retrieves information about a specified shared resource on a server. |
NetShareSetInfo | Sets a shared resource's parameters. |
The NetShareAdd function allows a user or application to share a resource of a specific type using the specified share name. The NetShareAdd function requires the share name and local device name to share the resource. A user or application must have an account on the server to access the resource.
You can also specify a security descriptor to be associated with a share. Security descriptors specify which users are allowed to access files through the share, and with what type of access.
The network management functions use the following special share names for interprocess communication (IPC) and remote administration of the server:
To list all connections made to a shared resource on a server, or to list all connections established from a particular computer, call the NetConnectionEnum function. You can call NetConnectionEnum at the CONNECTION_INFO_0 and CONNECTION_INFO_1 information levels.
Share functions are available at the following information levels:
SHARE_INFO_0
SHARE_INFO_1
SHARE_INFO_2
SHARE_INFO_501
SHARE_INFO_502
SHARE_INFO_1005
The following information levels are valid only for NetShareSetInfo:
SHARE_INFO_1004
SHARE_INFO_1006
If you are programming for Active Directory™, you may be able to call certain Active Directory Service Interface (ADSI) methods to achieve the same functionality you can achieve by calling the network management share functions. For more information, see IADsFileShare.
Windows 2000: The SHARE_INFO_1501 information level is supported only on Windows 2000.
Windows 95/98: The following information levels are supported on Windows 95 and Windows 98:
connection_info_0
connection_info_1
connection_info_50
share_info_0
share_info_1
share_info_2
share_info_50