CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2001
    Location
    Toronto
    Posts
    118

    Question How NT Service know when a user logon

    Hi, I would like to notified when a user log on WinNT in my NT Service program. Any idea?
    Now I can check the process list in a loop to know if a explorer got launched, but there should be another more decent way.
    thankx ahead.

  2. #2
    Join Date
    Apr 2000
    Location
    San Francisco, California, USA
    Posts
    4,467
    1. Write a small program and register it under HTML\Software\Microsoft\CurrentVersion\Run. The program will contact the service using some flavor of IPC and then exit. Note, since the program is registered in the HKLM portion of the registry, regular users cannot remove it and therefore they cannot break the notification mechanism.

    2. [Windows 2000/XP only] Register a Winlogon notification package. Winlogon notification package is a DLL that is called by Winlogon when certain events occur, in particular, when a user logs on.

    3. [Kinda overkill] Write a GINA stub DLL. Intercept WlxLoggedOutSAS call and notify the service about the logon event.
    Russian Software Development Network -- http://www.rsdn.ru

  3. #3
    Join Date
    Sep 2002
    Location
    China
    Posts
    27

    Can you tell me?

    What is a GINA stub dll? Where can I get some useful information about it? Thanks!

  4. #4
    Join Date
    Apr 2000
    Location
    San Francisco, California, USA
    Posts
    4,467
    A GINA stub is a replacement GINA that passes all requests to the original GINA DLL (which is usually MSGINA.DLL) with little or no processing. There is a sample named GINASTUB in the Platform SDK.
    Russian Software Development Network -- http://www.rsdn.ru

  5. #5
    Join Date
    Sep 2002
    Location
    China
    Posts
    27

    Oh, I see..

    Thank you.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured