WNetGetUser

  WORD WNetGetUser(szUser, nBufferSize)    
  LPSTR szUser;    
  WORD FAR * nBufferSize;    

The WNetGetUser function retrieves the current user name.

Parameters

szUser

Points to the buffer to receive the current user name.

nBufferSize

Points to a variable containing the size of the buffer pointed to by the szUser parameter. The function copies the actual size (in bytes) of the user name to the variable.

Return Value

The return value is one of the following values.

Value Meaning

WN_BAD_POINTER Invalid pointer.
WN_BAD_USER Not logged in; no current user name.
WN_MORE_DATA The buffer was too small.
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 16.

If the network does not support a string that directly corresponds to the MS-Net user name, the driver can either return an acceptable substitute or not support this function.

If the function returns WN_MORE_DATA, the function also copies the size (in bytes) of the buffer required to hold the complete user name.