Windows programming

Moderators: None (Apply to moderate this forum)
Number of threads: 3711
Number of posts: 9173

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
LogonUser() API blocks with wrong credentials Posted by NarendraGupta on 16 Apr 2009 at 10:08 AM
Hi,

We are impersonating a user in an application that runs as a service. The service under which the application is running is started with Logon as Local System Account.

User have all the required previledge required like log on as service.
After providing correct credentials we are able to do successful impersonation

if the password passed to LogonUser() API is wrong it blocked/hanging.
we are using OS: Windows XP

For impersonation we are calling LogonUser() API

LogonUser(mailbox,domain,m_szPassword,
LOGON32_LOGON_SERVICE,
LOGON32_PROVIDER_DEFAULT,
&hToken))

steps followed for impersonation are as follows-
1. LookupPrivilegeValue for SE_TCB_NAME
2. OpenProcessToken
3. AdjustTokenPrivileges
4. LogonUser
5. LoadUserProfile
6. ImpersonateLoggedOnUser



any suggestion would be great help for us.

Thanks in advance
Narendra



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.