This function attempts to disconnect from a network. If the underlying network returns ERROR_OPEN_FILES, the function prompts the user for confirmation. Users will be informed of any errors.
At a Glance
Header file: | Winnetwk.h |
Windows CE versions: | 2.0 and later |
Syntax
DWORD WNetDisconnectDialog1(LPDISCDLGSTRUCT lpDiscDlgStruc);
Parameters
lpDiscDlgStruct
[in] Long pointer to the DISCDLGSTRUCT data structure, which specifies the behavior for the disconnect attempt.
Return Values
ERROR_SUCCESS indicates success. An error value indicates failure. To get extended error information, call GetLastError. Possible GetLastError error values are described in the following table.
Value | Description |
ERROR_SUCCESS | The connection is successfully disconnected. |
ERROR_CANCELLED | After the user was prompted for a decision to disconnect, the user elected not to disconnect. |
ERROR_OPEN_FILES | The function is unable to disconnect because the user is actively using the connection. |
ERROR_BUSY | The network provider is busy, and is possibly initializing. The caller should retry. |
ERROR_NO_NETWORK | The network is not present. |
ERROR_NOT_ENOUGH_MEMORY | There is insufficient memory to start the dialog box. |