Group: Windows Networking - Library: mpr
The WNetCancelConnection2 function cancels an existing network connection. You can also call the function to remove remembered network connections that are not currently connected.
Mapping and disconnecting network drives
DWORD WNetCancelConnection2(
LPCTSTR lpName,
DWORD dwFlags,
BOOL fForce
); DECLARE INTEGER WNetCancelConnection2 IN mpr;
STRING lpName,;
INTEGER dwFlags,;
INTEGER fForce lpName [in] Pointer to a constant null-terminated string that specifies the name of either the redirected local device or the remote network resource to disconnect from.
dwFlags [in] Connection type.
fForce [in] Specifies whether the disconnection should occur if there are open files or jobs on the connection.
If the function succeeds, the return value is NO_ERROR (0).
Home