Hi,

As I'm still trying to get Process Explorer running perfectly, I've noticed that
the usernames for the processes are not correct.

The attached patch shows the issue. I'm not sure if this test-patch should go to
wine-patches as I'm not sure my test is correct (or in the correct place). It
succeeds on W2K3.

Maybe someone more knowledgeable about the Token stuff could have a look?

Cheers,

Paul

diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c
index 3e8459e..616afa8 100644
--- a/dlls/advapi32/tests/security.c
+++ b/dlls/advapi32/tests/security.c
@@ -849,6 +849,11 @@ static void test_token_attr(void)
     DWORD i, GLE;
     LPSTR SidString;
     SECURITY_IMPERSONATION_LEVEL ImpersonationLevel;
+    CHAR accountA[MAX_PATH], domainA[MAX_PATH];
+    DWORD real_acc_sizeA, real_dom_sizeA;
+    SID_NAME_USE use;
+    CHAR user_name[UNLEN + 1];
+    DWORD user_size;
 
     /* cygwin-like use case */
     ret = OpenProcessToken(GetCurrentProcess(), MAXIMUM_ALLOWED, &Token);
@@ -913,6 +918,21 @@ static void test_token_attr(void)
 
     pConvertSidToStringSidA(User->User.Sid, &SidString);
     trace("TokenUser: %s attr: 0x%08x\n", SidString, User->User.Attributes);
+
+    /* Retrieve the named user for this SID and compare it to the username,
+     * they should match
+     */
+    real_acc_sizeA = MAX_PATH;
+    real_dom_sizeA = MAX_PATH;
+    ret = LookupAccountSidA(NULL, User->User.Sid, accountA, &real_acc_sizeA, domainA, &real_dom_sizeA, &use);
+
+    user_size = UNLEN + 1;
+    ret = GetUserNameA(user_name, &user_size);
+
+    /* todo_wine */
+    ok(!lstrcmp(accountA, user_name), "Expected %s, got %s\n", user_name, accountA);
+    /* */
+
     LocalFree(SidString);
     HeapFree(GetProcessHeap(), 0, User);
 



Reply via email to