Re: Usage of SeMarkLogonSessionForTerminationNotification?

Given the information below and my experience that this interface also
does not work on Win2K SP2 or NT4 SP6a, is there a bug here? Is there
some way of using the interfaces that will make them work correctly? Is
there some other way (or set of interfaces) that people are using to get
notified when a session logs out so they can cleanup per-login session
resources?

– Thanks, Rick

Vodicka, Michal writes:

> ----------
> From: xxxxx@storagecraft.com[SMTP:xxxxx@storagecraft.com]
> Reply To: xxxxx@lists.osr.com
> Sent: Thursday, October 03, 2002 7:15 PM
> To: xxxxx@lists.osr.com
> Subject: [ntfsd] Re: Usage of SeMarkLogonSessionForTerminationNotification?
>
> >and call the Mark entry each time you get called (by a logged in user) to allocate the
> > structures that need to be cleaned up when the user logs out?
>
> Yes. Mark is per-logon-session, and must be called on each logon
> session which is “interesting” and you need a termination callback for
> it. Without Mark, no logon session callbacks will occur, Register is
> not enough.
>
Correct but under my experience, it doesn’t always works as expected. The
callback is never called for the first GUI logon session and also for some
next if you’re using fast user switching. It seems there is some problem
with dereferencing and for these logon sessions the reference count never
reaches zero (well, I’m pretty sure because examined it). I wanted to use
this feature for per-session cleanup and failed because of this problem. On
the other hand, it always worked for terminal sessions.

Note it is sometimes before I tested it, it was for XP release. Maybe it is
better for SP1 and .NET.

Best regards, Michal Vodicka