A do-nothing crt0 for native NT processes.

(see note by A.Ionescu in reactos/subsys/crt/main.c)

svn path=/trunk/; revision=18219
This commit is contained in:
Emanuele Aliberti 2005-10-02 16:09:30 +00:00
parent a9fdaba902
commit bf66746b2d
5 changed files with 85 additions and 0 deletions

View file

@ -170,6 +170,9 @@
<directory name="newdev">
<xi:include href="newdev/newdev.xml" />
</directory>
<directory name="ntrt0lib">
<xi:include href="ntrt0lib/ntrt0lib.xml" />
</directory>
<directory name="ntdll">
<xi:include href="ntdll/ntdll.xml" />
</directory>

View file

@ -0,0 +1,21 @@
/* $Id$
*
* ReactOS Operating System
*/
#include "ntrt0.h"
#define NDEBUG
#include <debug.h>
/**********************************************************************
* NAME
* NtRtParseCommandLine/2
*/
NTSTATUS STDCALL NtRtParseCommandLine (PPEB Peb, int * argc, char ** argv)
{
*argc=0;
argv[0]=NULL;
//TODO
return STATUS_SUCCESS;
}
/* EOF */

View file

@ -0,0 +1,40 @@
/* $Id$
*
* ReactOS Operating System
*/
#include "ntrt0.h"
#define NDEBUG
#include <debug.h>
#ifdef NDEBUG
#define NTRT_DEBUG_FLAG 0
#else
#define NTRT_DEBUG_FLAG 1
#endif
int argc = 0;
char * argv [32] = {NULL};
char * envp = NULL;
/* Native process' entry point */
VOID STDCALL NtProcessStartup (PPEB Peb)
{
NTSTATUS Status = STATUS_SUCCESS;
/*
* Parse the command line.
*/
Status = NtRtParseCommandLine (Peb, & argc, argv);
if (STATUS_SUCCESS != Status)
{
DPRINT1("NT: %s: NtRtParseCommandLine failed (Status=0x%08lx)\n",
__FUNCTION__, Status);
}
/*
* Call the user main
*/
(void) _main (argc, argv, & envp, NTRT_DEBUG_FLAG);
}
/* EOF */

View file

@ -0,0 +1,16 @@
#if !defined(_NTRT0_H)
#define _NTRT0_H
/* PSDK/NDK Headers */
#include <stdio.h>
#include <windows.h>
#define NTOS_MODE_USER
#include <ndk/ntndk.h>
extern int _cdecl _main(int,char**,char**,int);
NTSTATUS STDCALL NtRtParseCommandLine (PPEB,int*,char**);
#endif /* !def _NTRT0_H */

View file

@ -0,0 +1,5 @@
<module name="ntrt0lib" type="staticlibrary">
<define name="_DISABLE_TIDENTS" />
<file>args.c</file>
<file>entry_point.c</file>
</module>