Windows 3.1 Device Drivers (ddag31qh.hlp) (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
WNetCancelConnection
                                                     Up Next Previous
────────────────────────────────────────────────────────────────────────────
 
WORD WNetCancelConnection(szName, fForce)
LPSTR szName;
BOOL fForce;
 
The WNetCancelConnection function cancels a redirection.
 
Parameter  Description
────────────────────────────────────────────────────────────────────────────
 
 
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.
 
                                      ♦