1996-08-11 17:49:51 +02:00
|
|
|
/*
|
2001-01-12 21:42:06 +01:00
|
|
|
* Old C RunTime DLL - All functionality is provided by msvcrt.
|
1996-08-11 17:49:51 +02:00
|
|
|
*
|
2000-11-08 23:42:53 +01:00
|
|
|
* Copyright 2000 Jon Griffiths
|
1996-08-11 17:49:51 +02:00
|
|
|
*/
|
2000-12-02 00:53:46 +01:00
|
|
|
#include "config.h"
|
2001-01-12 21:42:06 +01:00
|
|
|
#include "windef.h"
|
|
|
|
#include "winbase.h"
|
|
|
|
#include "debugtools.h"
|
1999-04-03 18:22:01 +02:00
|
|
|
|
2000-11-27 02:37:28 +01:00
|
|
|
DEFAULT_DEBUG_CHANNEL(crtdll);
|
1996-08-11 17:49:51 +02:00
|
|
|
|
2001-02-20 02:56:46 +01:00
|
|
|
/* from msvcrt */
|
2001-04-11 01:25:40 +02:00
|
|
|
extern void __getmainargs( int *argc, char ***argv, char ***envp,
|
|
|
|
int expand_wildcards, int *new_mode );
|
2001-02-20 02:56:46 +01:00
|
|
|
|
2001-01-12 21:42:06 +01: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 01:37:27 +01:00
|
|
|
|
1999-05-22 12:37:57 +02:00
|
|
|
/*********************************************************************
|
|
|
|
* CRTDLL_MainInit (CRTDLL.init)
|
|
|
|
*/
|
2000-11-08 23:42:53 +01:00
|
|
|
BOOL WINAPI CRTDLL_Init(HINSTANCE hinstDLL,DWORD fdwReason,LPVOID lpvReserved)
|
1999-05-22 12:37:57 +02:00
|
|
|
{
|
2001-01-12 21:42:06 +01:00
|
|
|
TRACE("(0x%08x,%ld,%p)\n",hinstDLL,fdwReason,lpvReserved);
|
2000-12-16 22:53:56 +01:00
|
|
|
|
2001-01-12 21:42:06 +01:00
|
|
|
if (fdwReason == DLL_PROCESS_ATTACH)
|
2000-12-16 22:53:56 +01:00
|
|
|
{
|
2001-01-12 21:42:06 +01: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 22:53:56 +01:00
|
|
|
}
|
2001-01-12 21:42:06 +01:00
|
|
|
return TRUE;
|
2000-12-16 22:53:56 +01:00
|
|
|
}
|
2001-02-20 02:56:46 +01:00
|
|
|
|
|
|
|
|
|
|
|
/*********************************************************************
|
|
|
|
* __GetMainArgs (CRTDLL.@)
|
|
|
|
*/
|
2001-04-11 01:25:40 +02:00
|
|
|
void __GetMainArgs( int *argc, char ***argv, char ***envp, int expand_wildcards )
|
2001-02-20 02:56:46 +01:00
|
|
|
{
|
2001-02-21 03:20:08 +01:00
|
|
|
int new_mode = 0;
|
2001-04-11 01:25:40 +02:00
|
|
|
__getmainargs( argc, argv, envp, expand_wildcards, &new_mode );
|
2001-02-20 02:56:46 +01:00
|
|
|
}
|