The "Microsoft Client for Netware Networks," included with Windows 95 is an example of a provider that is able to support multiple sets of credentials. You can use the provider for Windows NT with multiple user credentials, although certain limitations still apply.
In Windows 95, the initial connection to a given server or its shared resource has to be made using the interactive user's set of credentials, either by explicitly supplying it or by specifying NULL for lpPassword or lpUsername in the API (see online documentation). Otherwise, the function fails with error 5 (ERROR_ACCESS_DENIED). Provided that such an initial connection is successful, subsequent attempts to establish a connection to a shared resource on the server will ignore the supplied credentials and succeed.
In Windows NT, on the other hand, you can use the API with multiple sets of user credentials. However, one major limitation applies, namely, that connections to a given server or its shared resources have to be made within the context of a single set of credentials. For an initial connection, if you use NULL for lpPassword or lpUsername, the interactive user's credentials are used by default. If there has been a successful initial connection to the server, subsequent attempts to open a connection using a different set of credentials results in error 1219 (ERROR_SESSION_CREDENTIAL_CONFLICT), which indicates a conflict between the supplied set of credentials and the existing one. To establish a connection using a different set of credentials, first you have to cancel the existing connections to the server using WNetCancelConnection2().
Article ID: 183366 - Last Review: Nov 21, 2006 - Revision: 1