OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
From: Steve Swartz (steveswMICROSOFT.COM)
Date: Thu Jan 10 2002 - 09:38:26 CST

  • Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

    In Windows 2000 and Windows XP, there is a product called SENS that
    emits COM+ LCE events when interesting system events (like shutdown)
    occur. On those operating systems, you can just register a subscription
    through SENS with the appropriate underlying event, and your component
    will be called at the right time. The nice thing about SENS is, if your
    component doesn't take too long, you're called in a situation where you
    can do normal processing without worrying about the operating system
    shutting down beneath you.

    -----Original Message-----
    From: Mark A. Rice [mailto:mriceCANARYLABS.COM]
    Sent: Thursday, January 10, 2002 7:19 AM
    To: DCOMDISCUSS.MICROSOFT.COM
    Subject: Detecting Windows shutdown

    I have DCOM server (written using ATL is that matters) that I want to
    detect when NT/XP is shutting down so that it can close some files
    properly. I have researched this for a few days and I cannot figure out
    how
    to do it.

    I have created a hidden windows with WS_POPUP and have code to handle
    the
    WM_ENDSESSION message. I also have code to handle the
    SERVICE_CONTROL_SHUTDOWN event.

    If the server is running as the interactive user, I get the endsession
    message. If the server is running as a service under the local system
    account and is checked to interact with the desktop I get the message.
    If
    the server is running as a specific user with "Run As" as a server or
    service, or it is running as the local system account but cannot
    interact
    with the desktop, then I do not get the message. Also, I never seem to
    get
    the SERVICE_CONTROL_SHUTDOWN event.

    Can anyone tell me what I am doing wrong? Thanks,

    ----------------------------------------------------------------
    Users Guide http://discuss.microsoft.com/archives/mailfaq.asp
    contains important info. Save time, search the archives at
    http://discuss.microsoft.com/archives/index.html .
    To unsubscribe, mailto:DCOM-signoff-requestDISCUSS.MICROSOFT.COM