PRB: DLL May Not Get DLL_PROCESS_DETACH Call When in an MTS Process (201907)



The information in this article applies to:

  • Microsoft Transaction Server 2.0

This article was previously published under Q201907

SYMPTOMS

If a DLL, whose Microsoft ActiveX components are installed in Microsoft Transaction Server (MTS) version 2.0, is hosted in an MTS process, the DllMain function might not receive a DLL_PROCESS_DETACH call when the MTS process is shut down. Therefore, you cannot rely on receiving a DLL_PROCESS_DETACH call in order to perform DLL clean-up activities.

CAUSE

If the MTS process is shut down manually by using the MTS Explorer or the Mtxstop program, the process (after a very brief delay) calls the Win32 API TerminateProcess function. In this case, a DLL_PROCESS_DETACH call to DllMain does not occur.

NOTE: The DLL_PROCESS_DETACH call does occur when the MTS process shuts down because the package times out. Note that this scenario does not apply to MTS packages that have an infinite time-out, such as out-of-process Microsoft Internet Information Server (IIS) virtual directories.

STATUS

This behavior is by design.

Modification Type:MajorLast Reviewed:6/12/2001
Keywords:kbDSupport kbprb KB201907