Re: Winlogon notification DLL and user token
- From: "Skywing" <skywing_NO_SPAM_@xxxxxxxxxxxxxxxxxxx>
- Date: Sat, 11 Mar 2006 09:14:01 -0500
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
.
- References:
- Winlogon notification DLL and user token
- From: Jennifer Palonus
- Re: Winlogon notification DLL and user token
- From: Stefan Kuhr
- Re: Winlogon notification DLL and user token
- From: Jennifer Palonus
- Winlogon notification DLL and user token
- Prev by Date: Re: Why exception is generated at location 0x0000000???
- Next by Date: Re: Getting a specifi user folder in logged-out state
- Previous by thread: Re: Winlogon notification DLL and user token
- Next by thread: Detecting workstation locked, screensaver running
- Index(es):
Relevant Pages
|