This function allows the caller to redirect (connect) a local device to a network resource. It is similar to WNetAddConnection, except that it takes a pointer to a NETRESOURCE structure to describe the network resource to connect to. It also takes the addition parameters lpUserID and dwFlags.
ERROR_BAD_DEV_TYPE |
The device type and the resource type do not match. |
WN_BAD_PROVIDER |
lpProvider does not match any NP |
WN_BAD_NETNAME |
lpRemoteName is not acceptable to any NP |
WN_BAD_LOCALNAME |
lpLocalName is invalid. |
WN_BAD_PASSWORD |
invalid password, or the the connection requires additional authentication not provided by the caller (e.g., a username) |
WN_ALREADY_CONNECTED |
lpLocalName is already connected to a network drive or is to a local drive that is already in use locally (e.g. is used for a hard drive or RAM drive). |
WN_ACCESS_DENIED |
access denied (user may need to logon) |
WN_CANNOT_OPEN_PROFILE |
Unable to open the user profile to process persistent connections. |
WN_BAD_PROFILE |
The user profile is in an incorrect format. |
WN_FUNCTION_BUSY |
The MPR or NP is busy (possibly initializing). The caller should retry. |
WN_NO_NETWORK |
network is not present |
WN_NO_NET_OR_BAD_PATH |
the operation could not be handled either because a network component is not started or the specified name could not be handled. |
WN_EXTENDED_ERROR |
a network specific error occurred. WNetGetLastError should be called to obtain a description of the error. |