Re: A strange problem with Service ...

From: JJ (jjjj_at_nospam.com)
Date: 06/16/05


Date: Wed, 15 Jun 2005 22:17:08 -0400

Impersonating a user does not map HKEY_CURRENT_USER. Try calling
LoadUserProfile().

"Polaris" <etpolaris@hotmail.com> wrote in message
news:u$1IJ3gcFHA.1556@TK2MSFTNGP10.phx.gbl...
> Hi:
>
> I have a very strange problem and could not make any sense out of it:
>
> I wrote a Windows service program (Win-XP). The program impersonates the
> loggedon user (a user with only "Guest" privilege) and access user's
> registry settings from HKEY_CURRENT_USER.
>
> I found out that the program works (which means successfully read values
> from the HKCU) ONLY if I pop up a message box (by calling MessageBox(...),
> does not matter what is shown by the message box) in the service program
> before the impersonating codes. If I do not show the message box in the
> service, I get error "File not found" while trying to read the registry
> values under HKCU. Reproducible each time.
>
> Why does popping up a messagebox make such a difference? Any hints
> welcome.
>
> Thanks In Advance !
> Polaris
>



Relevant Pages

  • ImpersonateNamedPipeClient() in TSPs
    ... does anyone know how to impersonate the account of the calling ... application inside TSP (Telephony Service Provider) code? ... This is why we thought impersonating the calling application during ...
    (microsoft.public.win32.programmer.tapi)
  • Re: Problem with explorer - PCBUTTS1 Impersonating others again
    ... You are NOT a MVP you are a thief I know this is true because GOD told me. ... Why would ANYONE trust an unethical hack that resorts to impersonating ... Calling an illegal alien an "undocumented worker" is like calling a ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: Audio Problem - Another Impersonation
    ... You need to format your hard and reinstall windows. ... Another person impersonating me - Chris, ... Calling an illegal alien an "undocumented worker" is like calling a ...
    (microsoft.public.windowsxp.general)
  • Re: VIEWING MOVIES ONLINE - Another Impersonation
    ... You need to format your hard and reinstall windows. ... Another person impersonating me - Chris, ... Calling an illegal alien an "undocumented worker" is like calling a ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: print jobs stuck in que - Another Impersonation
    ... You need to format your hard and reinstall windows. ... Another person impersonating me - Chris, ... Calling an illegal alien an "undocumented worker" is like calling a ...
    (microsoft.public.windowsxp.help_and_support)