Process Will Not Terminate Unless System Is In User-mode

Last reviewed: November 2, 1995
Article ID: Q92761
The information in this article applies to:
  • Microsoft Win32 Application Programming Interface (API) included with:

        - Microsoft Windows NT versions 3.1 and 3.5
    

Under Windows NT, a process will not be terminated unless the system is in user-mode. Suppose that TerminateProcess() is called while a device driver or filesystem code is being executed. The system will wait until the threads are running user code before marking the process for termination. On system exit, processes that were the target of a TerminateProcess() will be killed.

This may affect drivers. If a driver is waiting for an object or multiple objects in WaitMode or UserMode, its wait may complete unsuccessfully due to a termination request. Any code that does a UserMode wait or an Alertable wait must check the return status of the wait call. If the wait fails with STATUS_USER_APC or STATUS_ALERTED, this is not an error. The driver should cleanup and return to user-mode.


Additional reference words: 3.10 3.50
KBCategory: kbprg
KBSubcategory: BseProcThrd


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: November 2, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.