1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Documentation help topics: %_dos & tcc /n

Discussion in 'Support' started by Frank, Jan 29, 2013.

  1. Frank

    Joined:
    Aug 2, 2011
    Messages:
    258
    Likes Received:
    4
    • %_dos:
    The help says "Windows 7" -> "WIN7", but I get "WINDOWS7".

    • %_service:
    "_service returns 1 if TCC was started as a service (TCC /N)."

    I can't find more info to this in the help. How can I use "TCC /N"?
     
  2. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,863
    Likes Received:
    83
    WAD. I've corrected the documentation for the next build.

    It's not intended for general use. If you're running TCC as a service, you can add the /N option to notify TCC that it's a service. The only thing it affects is to ignore a CTRL_LOGOFF_EVENT if TCC is a service.
     
  3. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,962
    Likes Received:
    30
    I'm curious now. I have a mail server, started by the AUTOEXNT service, running in UI0 (on the services desktop). If I send a certain email through the server, it will start a TCC (as NT_AUTHORITY on that desktop). Will a logoff cause that instance of TCC (started without "/N") to receive CTRL_LOGOFF_EVENT and therefore terminate?
     
  4. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,863
    Likes Received:
    83
    Yes.

    A logoff of any user will send CTRL_LOGOFF_EVENT to all console processes on the system.
     
  5. Steve Fabian

    Joined:
    May 20, 2008
    Messages:
    3,520
    Likes Received:
    4
    You mean that if a user logs off, not only the console processes of that user receive the CTRL_LOGOFF_EVENT, but also all other users' console processes? Is there a way for a console process receiving CTRL_LOGOFF_EVENT to discern that it is from another user's logging off?
     
  6. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,863
    Likes Received:
    83
    That's what I mean.

    No.
     
  7. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,962
    Likes Received:
    30
    Is it any different for WM_[QUERY]ENDSESSION (ENDSESSION_LOGOFF), which should be floating around at about the same time as CTRL_LOGOFF_EVENT? I don't thing those can cross desktops. How does TCC respond to them?
     
  8. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,863
    Likes Received:
    83
    Console apps don't see those messages.

    TCC kludges around the WM_ENDSESSION problem by creating a hidden window that looks for WM_ENDSESSION, and runs TCEXIT before shutting down.
     
  9. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,962
    Likes Received:
    30
    But TCC has had a (top level) window for a long time (hasn't it?). Is it not enough to handle the ENDSESSION_LOGOFF lParam and not bother with CTRL_LOGOFF_EVENT?
    I had thought you used TCC's window for more than that.
     
  10. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,863
    Likes Received:
    83
    No. It's not possible to prevent a logoff or shutdown when an app gets a WM_ENDSESSION message; just to delay it slightly while doing some cleanup. (Remember that 5 second timeout before the app is killed by Windows regardless of what it's doing.)

    And Windows will send the CTRL_LOGOFF_EVENT anyway to the console app's event handler, and kill it if it doesn't respond appropriately.
     

Share This Page