DISCDLGSTRUCT Structure

typedef struct _DISCDLGSTRUCT{
    DWORD cbStructure;
    HWND hwndOwner;
    LPSTR lpLocalName;
    LPSTR lpRemoteName;
    DWORD dwFlags;
} DISCDLGSTRUCT, *LPDISCDLGSTRUCT;
 
cbStructure
The size of the DISCDLGSTRUCT structure in bytes. This is filled in by the caller to indicate the size of the structure passed in.
hwndOwner This specifies the HWND of the owning window.
lpRemoteName Specifies the network resource to disconnect. This field may be set to NULL is lpLocalName is specified in which case the connection to the resource redirected from lpLocalName is disconnected.
lpLocalName The local device name that is redirected to the network resource, such as "F:" or "LPT1".

dwFlags
Any combination of the following values:
DISC_UPDATE_PROFILE If set, the connection will no longer be persistent (automatically restored every time the user logs on to the network). This flag is only valid if lpLocalName specifies a local device.
DISC_NO_FORCE If not set, force will be applied when attempting the disconnect if this is required (typically because the user has open files). The user will be informed if there are open files to the connection and asked if he still wants to disconnect. If so, the disconnect will be reattempted with additional force.

WN_CANCEL the user was asked if he really wanted to disconnect and elected not to disconnect.
WN_OPEN_FILES unable to disconnect because the user is actively using the connection.
WN_FUNCTION_BUSY The MPR or NP is busy (possibly initializing). The caller should retry.
WN_NO_NETWORK network is not present.
WN_OUT_OF_MEMORY insufficient memory to bring up the dialog.
WN_EXTENDED_ERROR a network specific error occurred. WNetGetLastError should be called to obtain a description of the error.