LookupAccountSidW returns "unexpected" username

Andreas Rosenberg andreas.rosenberg at apis.de
Tue Mar 10 11:01:08 CDT 2009


While I did some experimenting with the proposals from Vitaliy Margolen
to get an accepted patch for GetUserProfileDirectoryW, I found this 
behavior:

OpenProcessToken(hProcess,TOKEN_QUERY,&hToken);
...
GetTokenInformation( hToken, TokenUser, ptiUser, cbti, &cbti )
...
LookupAccountSidW( NULL, ptiUser->User.Sid, lpUserName, lpchSize,lpDomain, 
&cbDomain, &snu );

In Windows XP SP3 the LookupAccountSidW fills lpUserName with the
name of the current user (same as GetUserName)

Running this code in Wine results in the username: 'INTERACTIVE'.

Seems like the LookupAccountSidW does something not compatible with 
Windows. Im thinking about writing a test code, but simply checking
if the above code returns the same as GetUserNameW seems not 
correct, if test code should run under a different account as the actual
login user. 

Is this a requirement for running the wine tests?




More information about the wine-devel mailing list