Thread View: borland.public.cppbuilder.nativeapi
3 messages
3 total messages
Started by Darko MIletic
Wed, 18 Jun 2008 23:30
Problems with LogonUser API
Author: Darko MIletic
Date: Wed, 18 Jun 2008 23:30
Date: Wed, 18 Jun 2008 23:30
14 lines
1514 bytes
1514 bytes
I need to write a function that get's user profile folder for specified username. I use SHGetFolderPath API for this in conjunction with LogonUser. LogonUser is needed because since that is the only way (known to me) to get acl user token needed for SHGetFolderPath. Everything works fine when account has password, however if I try to call LogonUser with empty password I get error ERROR_ACCOUNT_RESTRICTION that states: Logon failure: user account restriction. Possible reasons are blank passwords not allowed, logon hour restrictions, or a policy restriction has been enforced. So any idea how to get acl token for user account that has no password? Thanks in advance
Re: Problems with LogonUser API
Author: DreamChaser
Date: Fri, 27 Jun 2008 06:18
Date: Fri, 27 Jun 2008 06:18
15 lines
1588 bytes
1588 bytes
Darko MIletic wrote: > I need to write a function that get's user profile folder for specified > username. I use SHGetFolderPath API for this in conjunction with > LogonUser. LogonUser is needed because since that is the only way (known > to me) to get acl user token needed for SHGetFolderPath. Everything > works fine when account has password, however if I try to call LogonUser > with empty password I get error ERROR_ACCOUNT_RESTRICTION that states: <snip> > So any idea how to get acl token for user account that has no password? > Is the user actually logged on to the machine, or are you trying to impersonate a user. If locally logged on take a look at SHGetSpecialFolderLocation() dc
Re: Problems with LogonUser API
Author: Darko Miletic
Date: Fri, 27 Jun 2008 14:27
Date: Fri, 27 Jun 2008 14:27
11 lines
1381 bytes
1381 bytes
DreamChaser wrote: > Is the user actually logged on to the machine, or are you trying to > impersonate a user. As I said in my previous message I am trying to impersonate user. >If locally logged on take a look at > SHGetSpecialFolderLocation() That API is obsolete and superseeded with SHGetFolderPath. But in any case it does not matter since both API's need token for impersonated user.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads