/*1* DllMainCRTStartup default entry point2*3* Copyright 2019 Jacek Caban for CodeWeavers4*5* This library is free software; you can redistribute it and/or6* modify it under the terms of the GNU Lesser General Public7* License as published by the Free Software Foundation; either8* version 2.1 of the License, or (at your option) any later version.9*10* This library is distributed in the hope that it will be useful,11* but WITHOUT ANY WARRANTY; without even the implied warranty of12* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU13* Lesser General Public License for more details.14*15* You should have received a copy of the GNU Lesser General Public16* License along with this library; if not, write to the Free Software17* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA18*/1920#ifdef __WINE_PE_BUILD2122#include <stdarg.h>23#include <stdio.h>24#include <process.h>25#include "windef.h"26#include "winbase.h"2728extern _PIFV __xi_a[];29extern _PIFV __xi_z[];30extern _PVFV __xc_a[];31extern _PVFV __xc_z[];32extern _PVFV __xt_a[];33extern _PVFV __xt_z[];3435static void fallback_initterm( _PVFV *table,_PVFV *end )36{37for ( ; table < end; table++)38if (*table) (*table)();39}4041static int fallback_initterm_e( _PIFV *table, _PIFV *end )42{43int res;44for (res = 0; !res && table < end; table++)45if (*table) res = (*table)();46return res;47}4849BOOL WINAPI DllMainCRTStartup( HINSTANCE inst, DWORD reason, void *reserved )50{51BOOL ret;5253if (reason == DLL_PROCESS_ATTACH)54{55if (fallback_initterm_e( __xi_a, __xi_z ) != 0) return FALSE;56fallback_initterm( __xc_a, __xc_z );57}5859ret = DllMain( inst, reason, reserved );6061if (reason == DLL_PROCESS_DETACH) fallback_initterm( __xt_a, __xt_z );62return ret;63}6465#endif666768