WNetCancelConnection2
The WNetCancelConnection2 function breaks an existing network connection. It can also be used to remove remembered network connections that are not currently connected. This function supersedes WNetCancelConnection.
DWORD WNetCancelConnection2(
LPTSTR lpName, // pointer to resource name to disconnect
DWORD dwFlags, // connection type flags
BOOL fForce // flag for unconditional disconnect
);
The WNetAddConnection2 function makes a connection to a network resource. The function can redirect a local device to the network resource.
The WNetAddConnection2 function supersedes the WNetAddConnection function. If you pass a handle to a window that the provider of network resources can use as an owner window for dialog boxes, use the WNetAddConnection3 function.
DWORD WNetAddConnection2(
LPNETRESOURCE lpNetResource, // points to structure that
// specifies connection details
LPCTSTR lpPassword, // points to password string
LPCTSTR lpUsername, // points to user name string
DWORD dwFlags // set of bit flags that specify
// connection options
);