1996-08-11 15:49:51 +00:00
|
|
|
/*
|
2001-01-12 20:42:06 +00:00
|
|
|
* Old C RunTime DLL - All functionality is provided by msvcrt.
|
1996-08-11 15:49:51 +00:00
|
|
|
*
|
2000-11-08 22:42:53 +00:00
|
|
|
* Copyright 2000 Jon Griffiths
|
1996-08-11 15:49:51 +00:00
|
|
|
*/
|
2000-12-01 23:53:46 +00:00
|
|
|
#include "config.h"
|
2001-01-12 20:42:06 +00:00
|
|
|
#include "windef.h"
|
|
|
|
#include "winbase.h"
|
|
|
|
#include "debugtools.h"
|
1999-04-03 16:22:01 +00:00
|
|
|
|
2000-11-27 01:37:28 +00:00
|
|
|
DEFAULT_DEBUG_CHANNEL(crtdll);
|
1996-08-11 15:49:51 +00:00
|
|
|
|
2001-02-20 01:56:46 +00:00
|
|
|
/* from msvcrt */
|
|
|
|
extern void __cdecl __getmainargs( int *argc, char ***argv, char **environ,
|
|
|
|
int expand_wildcards, void *_startupinfo );
|
|
|
|
|
2001-01-12 20:42:06 +00:00
|
|
|
/* The following data items are not exported from msvcrt */
|
|
|
|
unsigned int CRTDLL__basemajor_dll;
|
|
|
|
unsigned int CRTDLL__baseminor_dll;
|
|
|
|
unsigned int CRTDLL__baseversion_dll;
|
|
|
|
unsigned int CRTDLL__cpumode_dll;
|
|
|
|
unsigned int CRTDLL__osmajor_dll;
|
|
|
|
unsigned int CRTDLL__osminor_dll;
|
|
|
|
unsigned int CRTDLL__osmode_dll;
|
|
|
|
unsigned int CRTDLL__osversion_dll;
|
2000-12-12 00:37:27 +00:00
|
|
|
|
1999-05-22 10:37:57 +00:00
|
|
|
/*********************************************************************
|
|
|
|
* CRTDLL_MainInit (CRTDLL.init)
|
|
|
|
*/
|
2000-11-08 22:42:53 +00:00
|
|
|
BOOL WINAPI CRTDLL_Init(HINSTANCE hinstDLL,DWORD fdwReason,LPVOID lpvReserved)
|
1999-05-22 10:37:57 +00:00
|
|
|
{
|
2001-01-12 20:42:06 +00:00
|
|
|
TRACE("(0x%08x,%ld,%p)\n",hinstDLL,fdwReason,lpvReserved);
|
2000-12-16 21:53:56 +00:00
|
|
|
|
2001-01-12 20:42:06 +00:00
|
|
|
if (fdwReason == DLL_PROCESS_ATTACH)
|
2000-12-16 21:53:56 +00:00
|
|
|
{
|
2001-01-12 20:42:06 +00:00
|
|
|
DWORD version = GetVersion();
|
|
|
|
CRTDLL__basemajor_dll = (version >> 24) & 0xFF;
|
|
|
|
CRTDLL__baseminor_dll = (version >> 16) & 0xFF;
|
|
|
|
CRTDLL__baseversion_dll = (version >> 16);
|
|
|
|
CRTDLL__cpumode_dll = 1; /* FIXME */
|
|
|
|
CRTDLL__osmajor_dll = (version>>8) & 0xFF;
|
|
|
|
CRTDLL__osminor_dll = (version & 0xFF);
|
|
|
|
CRTDLL__osmode_dll = 1; /* FIXME */
|
|
|
|
CRTDLL__osversion_dll = (version & 0xFFFF);
|
2000-12-16 21:53:56 +00:00
|
|
|
}
|
2001-01-12 20:42:06 +00:00
|
|
|
return TRUE;
|
2000-12-16 21:53:56 +00:00
|
|
|
}
|
2001-02-20 01:56:46 +00:00
|
|
|
|
|
|
|
|
|
|
|
/*********************************************************************
|
|
|
|
* __GetMainArgs (CRTDLL.@)
|
|
|
|
*/
|
|
|
|
void __cdecl __GetMainArgs( int *argc, char ***argv, char **environ, int expand_wildcards )
|
|
|
|
{
|
|
|
|
__getmainargs( argc, argv, environ, expand_wildcards, NULL );
|
|
|
|
}
|