Standard Error Codes

Status codes include:

WN_SUCCESS

Success.

WN_NOT_SUPPORTED

Function not supported.

WN_MORE_DATA

Warning: buffer too small.

N_BAD_POINTER

Invalid pointer specified.

WN_BAD_VALUE

Invalid numeric value specified.

WN_BAD_PASSWORD

Incorrect password specified.

WN_ACCESS_DENIED

Security violation.

WN_FUNCTION_BUSY

This function cannot be reentered and is currently being used, or the provider is still initializing and is not ready to be called yet.

WN_WINDOWS_ERROR

A required Windows function failed.

WN_BAD_USER

Invalid user name specified.

WN_OUT_OF_MEMORY

Out of memory.

WN_NOT_CONNECTED

Device is not redirected.

WN_OPEN_FILES

Connection could not be canceled because files are still open.

WN_BAD_NETNAME

Network name is invalid.

ERROR_EXTENDED_ERROR

The NP has a text error message to report.

ERROR_UNEXP_NET_ERROR

The network encountered an error for which it cannot generate a specific error code.


One notable difference is that the WN_FUNCTION_BUSY code is also used to indicate that the provider is initializing and is not ready to be called yet. The provider should only return this if it is going to be available, since this return code is passed by MPR back to its caller and is likely to cause an application to retry.