LogonUser

From: Gabi (Gabi_at_discussions.microsoft.com)
Date: 06/28/04


Date: Mon, 28 Jun 2004 07:03:01 -0700

Hi all,
i impmplemenet the following code:
if (!OpenProcessToken(GetCurrentProcess(),
        TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &hToken))
                        cout << "OpenProcessToken failed." << endl;

GG = SetPrivilege(
     hToken, // access token handle
     lpszPrivilege, // name of privilege to enable/disable
     bEnablePrivilege // to enable or disable privilege
    ) ;

        SuFail = LogonUser("userName",
                               "domain",
                        "passwd",
                         LOGON32_LOGON_INTERACTIVE,
                         LOGON32_PROVIDER_DEFAULT,
                         &HToken);

        Stts = GetLastError();

and at the end i got error 0x522:
"A required privilege is not held by the client."

where can find those privilages on my machine.
Thanks