Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-16 10:10:03

0001 #ifndef BOOST_THREAD_WIN32_MFC_THREAD_INIT_HPP
0002 #define BOOST_THREAD_WIN32_MFC_THREAD_INIT_HPP
0003 // Distributed under the Boost Software License, Version 1.0. (See
0004 // accompanying file LICENSE_1_0.txt or copy at
0005 // http://www.boost.org/LICENSE_1_0.txt)
0006 // (C) Copyright 2008 Anthony Williams
0007 // (C) Copyright 2011-2012 Vicente J. Botet Escriba
0008 
0009 
0010 // check if we use MFC
0011 #ifdef _AFXDLL
0012 # if defined(_AFXEXT)
0013 
0014 // can't use ExtRawDllMain from afxdllx.h as it also defines the symbol _pRawDllMain
0015 extern "C"
0016 inline BOOL WINAPI ExtRawDllMain(HINSTANCE, DWORD dwReason, LPVOID)
0017 {
0018   if (dwReason == DLL_PROCESS_ATTACH)
0019   {
0020     // save critical data pointers before running the constructors
0021     AFX_MODULE_STATE* pModuleState = AfxGetModuleState();
0022     pModuleState->m_pClassInit = pModuleState->m_classList;
0023     pModuleState->m_pFactoryInit = pModuleState->m_factoryList;
0024     pModuleState->m_classList.m_pHead = NULL;
0025     pModuleState->m_factoryList.m_pHead = NULL;
0026   }
0027   return TRUE; // ok
0028 }
0029 
0030 extern "C" __declspec(selectany) BOOL (WINAPI * const _pRawDllMainOrig)(HINSTANCE, DWORD, LPVOID) = &ExtRawDllMain;
0031 
0032 # elif defined(_USRDLL)
0033 
0034 extern "C" BOOL WINAPI RawDllMain(HINSTANCE, DWORD dwReason, LPVOID);
0035 extern "C" __declspec(selectany) BOOL (WINAPI * const _pRawDllMainOrig)(HINSTANCE, DWORD, LPVOID) = &RawDllMain;
0036 
0037 # endif
0038 #endif
0039 
0040 #endif