Re: Winlogon notification DLL and user token



BTW, you can create custom desktop objects that are interactive if they are
on the interactive window station - and there are programs out there which
do this. Be sure to handle this.

"Jennifer Palonus" <jpalonus@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
wrote in message news:ma941217rt65odsknl1li23rrks9uamlsm@xxxxxxxxxx
I can catch the StartService event, and the WLX_NOTIFICATION_INFO
structure has the user's workstation, desktop handle, and user token
like it should.

The user token is valid within the DLL, but if I send it thru a pipe
to the COM server, as per the docs, and try to use it (in
DuplicateTokenEx, for example), I get Windows error 6 - "The handle is
invalid".

I thought the user token the notification DLL gets was supposed to be
a true token. How do I get it recognized within another process?


Have you tried impersonating the user in your DLL and then send
something across the pipe to your COM server which then again
impersonates via ImpersonatenamedPipeClient? Your COM server should then
be able to extract an impersonation token via OpenThreadToken.

That does look somewhat promising, although the client needs to read
something from the pipe before the server can get an ERROR_SUCCESS
return from the function.

Maybe I'm just overthinking the problem.

I was hoping to get the logged-in user's token, but I can redesign the
project so I can get that info another way. I really only need to know
if the logged-on user's desktop is visible or not. As far as the
logged-on user's concerned, the only desktops that should be visible
are "default", "screen-saver", or "Winlogon". I know how to detect if
a screensaver's up, and I can stop the screensaver. I guess the only
problem now is to detect when we're at the Winlogon screen.

Using Sysinternals' Process Explorer, it looks like the Winlogon
desktop exists throughout the login session, so I guess when the user
hits Ctrl+Alt+Esc it does a SwitchDesktop to get the workstation
there. But how do I, another process, detect that the default desktop
is no longer being shown?

Jenny

Graphical Dynamics, Inc
http://www.graphicaldynamics.com


.



Relevant Pages

  • Re: impersonation and accessing remote folder
    ... I am impersonating the user. ... client in this case are both on the same domain, all Windows 2000. ... > once passed to the IIS server, the same credentials cannot be passed ... >>access to the remote folder is denied. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Delegatoin w/ Protocol transition in a Windows 2000 native domain
    ... authentication is the only box checked) on the Exchange 2003 /exchange ... frontend-server by means of impersonating the user who's logged on ... This account is trusted for delegation. ... system" privelege on the ASP.NET server. ...
    (microsoft.public.dotnet.framework.aspnet)
  • impersonation works on local xp not on web server
    ... The program I have written to change a password by impersonating an ... the Windows 2000 server the impersonation fails. ... #region Private Methods ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • RE: Delegatoin w/ Protocol transition in a Windows 2000 native domain
    ... authentication is the only box checked) on the Exchange 2003 /exchange ... frontend-server by means of impersonating the user who's logged on ... Created service principal names for the "DelegationUser" user the ... system" privelege on the ASP.NET server. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Web service in EXE
    ... > under any user context that you want and it could be brought up on the ... > connect to some methods on the server and raise events to control it. ... him to be logged into an interactive window station. ...
    (microsoft.public.dotnet.framework.webservices)