NPGetUser

This is used to determine either the current default user name, or the user identification used to establish a network connection.

DWORD NPGetUser(
  LPTSTR lpName,
  LPTSTR lpUserID,
  LPDWORD lpBufferSize
  );
 
lpName
Contains the name of the redirected local device the caller is interested in, or a network name that the user has made a connection to. This may be the empty string if the caller is interested in the name of the user currently logged on to the system. If a network name is passed in, and the user is connected to that resource using different names, it is possible that a provider cannot resolve which user identification to return. In this case the provider may make an arbitrary choice amongst the possible responses.
lpUserID
Points to a buffer to receive the user profile name. This is an identification string that the user made to establish the connection (for example, a user name, or group name). Whenever possible, this string should contain sufficient information to reestablish the connection with a call to NPAddConnection without posting a dialog box when a valid password is supplied.
lpBufferSize
This is used to specify the size of the buffer passed in, in bytes. If the call fails because the buffer is not big enough, this location will be used to return the required buffer size.
WN_NOT_LOGGED_ON The user is not logged on to the network.
WN_NOT_CONNECTED lpName not a redirected device nor a connected network name.
WN_NOT_SUPPORTED lpName is a pointer to an empty string and the NP does not provide the capability for network-wide logon.
WN_MORE_DATA The buffer is too small.
WN_NO_NETWORK Network is not present.