This function is used to log the user off from one or all of the networks. It will not perform system logoff or unload the user's profile. The ExitWindowsEx() function must be used for system logoff.
DWORD WNetLogoff(
LPCTSTR lpProvider,
HWND hwndOwner
);
WN_BAD_PROVIDER | the provider name specified is invalid. |
WN_NOT_LOGGED_ON | the user is not logged on to this network. |
WN_CANCEL | the user canceled the operation. |