mirror of
https://github.com/reactos/reactos.git
synced 2024-12-27 01:24:38 +00:00
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:
parent
a9fdaba902
commit
bf66746b2d
5 changed files with 85 additions and 0 deletions
|
@ -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>
|
||||
|
|
21
reactos/lib/ntrt0lib/args.c
Normal file
21
reactos/lib/ntrt0lib/args.c
Normal 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 */
|
40
reactos/lib/ntrt0lib/entry_point.c
Normal file
40
reactos/lib/ntrt0lib/entry_point.c
Normal 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 */
|
16
reactos/lib/ntrt0lib/ntrt0.h
Normal file
16
reactos/lib/ntrt0lib/ntrt0.h
Normal 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 */
|
||||
|
5
reactos/lib/ntrt0lib/ntrt0lib.xml
Normal file
5
reactos/lib/ntrt0lib/ntrt0lib.xml
Normal file
|
@ -0,0 +1,5 @@
|
|||
<module name="ntrt0lib" type="staticlibrary">
|
||||
<define name="_DISABLE_TIDENTS" />
|
||||
<file>args.c</file>
|
||||
<file>entry_point.c</file>
|
||||
</module>
|
Loading…
Reference in a new issue