2 * Old C RunTime DLL - All functionality is provided by msvcrt.
4 * Copyright 2000 Jon Griffiths
9 #include "debugtools.h"
11 DEFAULT_DEBUG_CHANNEL(crtdll);
14 extern void __getmainargs( int *argc, char ***argv, char ***envp,
15 int expand_wildcards, int *new_mode );
17 /* The following data items are not exported from msvcrt */
18 unsigned int CRTDLL__basemajor_dll;
19 unsigned int CRTDLL__baseminor_dll;
20 unsigned int CRTDLL__baseversion_dll;
21 unsigned int CRTDLL__cpumode_dll;
22 unsigned int CRTDLL__osmajor_dll;
23 unsigned int CRTDLL__osminor_dll;
24 unsigned int CRTDLL__osmode_dll;
25 unsigned int CRTDLL__osversion_dll;
27 /*********************************************************************
28 * CRTDLL_MainInit (CRTDLL.init)
30 BOOL WINAPI CRTDLL_Init(HINSTANCE hinstDLL,DWORD fdwReason,LPVOID lpvReserved)
32 TRACE("(0x%08x,%ld,%p)\n",hinstDLL,fdwReason,lpvReserved);
34 if (fdwReason == DLL_PROCESS_ATTACH)
36 DWORD version = GetVersion();
37 CRTDLL__basemajor_dll = (version >> 24) & 0xFF;
38 CRTDLL__baseminor_dll = (version >> 16) & 0xFF;
39 CRTDLL__baseversion_dll = (version >> 16);
40 CRTDLL__cpumode_dll = 1; /* FIXME */
41 CRTDLL__osmajor_dll = (version>>8) & 0xFF;
42 CRTDLL__osminor_dll = (version & 0xFF);
43 CRTDLL__osmode_dll = 1; /* FIXME */
44 CRTDLL__osversion_dll = (version & 0xFFFF);
50 /*********************************************************************
51 * __GetMainArgs (CRTDLL.@)
53 void __GetMainArgs( int *argc, char ***argv, char ***envp, int expand_wildcards )
56 __getmainargs( argc, argv, envp, expand_wildcards, &new_mode );