NetShareCheck

The NetShareCheck function checks whether or not a server is sharing a device.

Security Requirements

No special group membership is required to successfully execute NetShareCheck.

NET_API_STATUS NetShareCheck(
  LPWSTR servername,  
  LPWSTR device,      
  LPDWORD type        
);
 

Parameters

servername
Pointer to a Unicode string containing the name of the remote server on which the function is to execute. A NULL pointer or string specifies the local computer.
device
Pointer to a Unicode string containing the name of the device to check for shared access.
type
Pointer to an address that contains the type of device share. On return the address pointed to by the type parameter contains the type of share the device is offered with. This parameter is set only if the function returned successfully.

Return Values

If the function returns account information, the return value is NERR_Success.

If the function fails, the return value is one of the following error codes.

Value Meaning
ERROR_INVALID_LEVEL The value specified for the Level parameter is invalid.
ERROR_NOT_ENOUGH_MEMORY Insufficient memory is available.
NERR_DeviceNotShared The device is not shared.

QuickInfo

  Windows NT: Requires version 3.1 or later.
  Windows: Unsupported.
  Windows CE: Unsupported.
  Header: Declared in lmshare.h.
  Import Library: Use netapi32.lib.

See Also

Networking (Net) Overview, Net Functions, NetShareEnum, NetShareGetInfo