WNetCancelConnection

  WORD WNetCancelConnection(szName, fForce)    
  LPSTR szName;    
  BOOL fForce;    

The WNetCancelConnection function cancels a redirection.

Parameters

szName

Points to either the name of the redirected local device (such as LPT1) or a fully-qualified network path. If a network path is specified, the driver will cancel all the connections to that resource.

fForce

Specifies whether any open files or open print jobs on the device should be closed before the connection is cancelled. If the fForce parameter is FALSE and there are open files or jobs, the connection should not be cancelled. The function should return the WN_OPEN_FILES error value.

Return Value

The return value is one of the following values.

Value Meaning

WN_BAD_POINTER Invalid pointer.
WN_BAD_VALUE The szName parameter is not a valid local device or network name.
WN_NET_ERROR Network error.
WN_NOT_CONNECTED The szName parameter is not a redirected local device or currently accessed network resource.
WN_NOT_SUPPORTED Function not supported.
WN_OPEN_FILES Files are open and the fForce parameter was FALSE. Connection was not cancelled.
WN_OUT_OF_MEMORY Out of memory.
WN_SUCCESS Success.

Comments

The export ordinal for this function is 18.