> Hi experts,
>
> Can anyone tell me whether ImpersonateLoggedOnUser() can be used over a network where domains are not used, only workgroup is defined (peer to peer network)?
>
> If yes, what is to be put where "domain name" is to be given?
>
> My detailed problem is posted in my earlier post in this thread.
>
> Thanks,
>
> Vivek
>
>
> Well, I have found a way to use ImpersonateLoggedOnUser() on peer to peer networks having no domains, but workgroups. I am giving it below for someone who may want it, (or perhaps, Bernard might add it in his FAQ?)
>
>
> add line
>
>
#define LOGON32_LOGON_NEW_CREDENTIALS 9
> at the start.
>
> use code something like this for logonuser()
>
>
LogonUser("deodhar","\\\\new","password",LOGON32_LOGON_NEW_CREDENTIALS, LOGON32_PROVIDER_DEFAULT, @nToken)
>
>
> where "deodhar" is user on cmputer "new" who has access to the data folder, "password" is password given to user "deodhar" on computer "new".
>
> You can use this code from any computer in the network and get access.
>
> I have tested this with only Xp sp2. For other types, I think logon_provider options will have to be changed.
>
> Thanks,
>
> Vivek
Goog work Vivek. I have updated the FAQ with your suggestion.
Bernard
** If you see someone without a smile, give em one of yours :) **