Stuart McLachlan
stuart at lexacorp.com.pg
Wed Sep 17 02:16:14 CDT 2003
On 17 Sep 2003 at 8:58, Erwin Craps wrote: > What do you mean with local network name? > > The workgroup, domain name? > Don't know that one, but I supose it's posible. > I haven't tried it (I'll play around with it later) but: NetWkstaUserGetInfo The NetWkstaUserGetInfo function returns information about the currently logged-on user. This function must be called in the context of the logged-on user. Security Requirements This function only works locally. NET_API_STATUS NetWkstaUserGetInfo( LPTSTR reserved, DWORD level, LPBYTE *bufptr ); Parameters reserved This parameter must be set to NULL. level Specifies one of the following values to return the level of information provided. Value Meaning 0 The bufptr parameter points to a WKSTA_USER_INFO_0 structure. 1 The bufptr parameter points to a WKSTA_USER_INFO_1 structure. 1101 The bufptr parameter points to a WKSTA_USER_INFO_1101 structure. bufptr On return, a pointer to the return information structure is returned in the address pointed to by bufptr. and The WKSTA_USER_INFO_1 structure contains user information about a specified workstation, including the name of the current user, the LAN Manager domains accessed by the workstation, and user account information. typedef struct _WKSTA_USER_INFO_1 { LPTSTR wkui1_username; LPTSTR wkui1_logon_domain; LPTSTR wkui1_oth_domains; LPTSTR wkui1_logon_server;}WKSTA_USER_INFO_1, *PWKSTA_USER_INFO_1, *LPWKSTA_USER_INFO_1; Members wkui1_username Returns the name of the user currently logged on to the workstation. wkui1_logon_domain Returns the domain name of the user account of the user currently logged on to the workstation. wkui1_oth_domains Returns the list of other LAN Manager domains browsed by the workstation. The domain names are separated by blanks. wkui1_logon_server Returns the name of the computer that authenticated the server. -- Lexacorp Ltd http://www.lexacorp.com.pg Information Technology Consultancy, Software Development,System Support.