Windows 3.1 Device Drivers (ddag31qh.hlp) (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
WNetAddConnection
                                                     Up Next Previous
────────────────────────────────────────────────────────────────────────────
 
WORD WNetAddConnection(szNetPath, szPassword, szLocalName)
LPSTR szNetPath;
LPSTR szPassword;
LPSTR szLocalName;
 
The WNetAddConnection function redirects a local device (either a disk drive
or a printer port) to a shared device on a remote server.
 
Parameter    Description
────────────────────────────────────────────────────────────────────────────
 
szNetPath    Points to a null-terminated string specifying the shared device
             or remote server.
 
szPassword   Points to a null-terminated string specifying the network
             password for the specified device or server.
 
szLocalName  Points to a null-terminated string specifying the local drive
             or device to be redirected. All szLocalName strings are
             case-independent. Only the drive names A: through Z: and the
             device names LPT1 through LPT3 are used.
 
Return Value
 
The return value is one of the following values.
 
Value                 Meaning
────────────────────────────────────────────────────────────────────────────
WN_ACCESS_DENIED      Security violation.
 
WN_ALREADY_CONNECTED  Local device already connected to a remote resource.
 
WN_BAD_LOCALNAME      Invalid local device name.
 
WN_BAD_NETNAME        Invalid network resource name.
 
WN_BAD_PASSWORD       Invalid password.
 
WN_BAD_POINTER        Invalid pointer.
 
WN_NET_ERROR          Network error.
 
WN_NOT_SUPPORTED      Function not supported.
 
WN_OUT_OF_MEMORY      Out of memory.
 
WN_SUCCESS            Success.
 
Comments
 
The export ordinal for this function is 17.
 
                                      ♦