Made user-mode execution of processes work again

svn path=/trunk/; revision=344
This commit is contained in:
David Welch 1999-03-26 10:37:03 +00:00
parent 867fa342e3
commit 140b387c62
6 changed files with 20 additions and 9 deletions

View file

@ -1,7 +1,10 @@
#include <stdio.h>
#include <ddk/ntddk.h>
int main(int argc, char* argv[])
{
printf("Hello world\n");
UNICODE_STRING UnicodeString;
RtlInitUnicodeString(&UnicodeString,L"Hello world\n");
NtDisplayString(&UnicodeString);
return(0);
}

View file

@ -1,8 +1,9 @@
all: hello.exe
OBJECTS = hello.o
OBJECTS = ../common/crt0.o hello.o
LIBS = ../../lib/kernel32/kernel32.a ../../lib/ntdll/ntdll.a
hello.exe: $(OBJECTS) $(LIBS)
$(CC) $(OBJECTS) -o hello.exe
$(LD) $(OBJECTS) $(LIBS) -o hello.exe
include ../../rules.mak

View file

@ -1,8 +1,6 @@
#ifndef __INCLUDE_DDK_PSTYPES_H
#define __INCLUDE_DDK_PSTYPES_H
#undef WIN32_LEAN_AND_MEAN
#include <windows.h> // might be redundant
#include <kernel32/heap.h>
#include <kernel32/atom.h>
#include <internal/hal.h>
@ -259,8 +257,8 @@ typedef struct _KPROCESS
/*
* Added by David Welch (welch@mcmail.com)
*/
LIST_ENTRY MemoryAreaList;
HANDLE_TABLE HandleTable;
LIST_ENTRY MemoryAreaList;
HANDLE_TABLE HandleTable;
} KPROCESS, *PKPROCESS;
typedef struct _EPROCESS

View file

@ -15,7 +15,10 @@ void aprintf(char* fmt, ...);
#define ROUNDUP(a,b) ((((a)+(b)-1)/(b))*(b))
#define ROUNDDOWN(a,b) (((a)/(b))*(b))
#define FIELD_OFFSET(type,fld) ((LONG)&(((type *)0)->fld))
#ifndef FIELD_OFFSET
#define FIELD_OFFSET(type,fld) ((LONG)&(((type *)0)->fld))
#endif
BOOL __ErrorReturnFalse(ULONG ErrorCode);
PVOID __ErrorReturnNull(ULONG ErrorCode);

View file

@ -14,3 +14,9 @@ typedef struct _DLL
extern DLL LdrDllListHead;
PEPFUNC LdrPEStartup(PVOID ImageBase, HANDLE SectionHandle);
NTSTATUS LdrMapSections(HANDLE ProcessHandle,
PVOID ImageBase,
HANDLE SectionHandle,
PIMAGE_NT_HEADERS NTHeaders);
NTSTATUS LdrMapNTDllForProcess(HANDLE ProcessHandle,
PHANDLE NTDllSectionHandle);

View file

@ -26,7 +26,7 @@ NLS_OBJECTS = # nls/mbtowc.o nls/wctomb.o
THREAD_OBJECTS = thread/thread.o
PROCESS_OBJECTS = process/proc.o process/cmdline.o
PROCESS_OBJECTS = process/proc.o process/cmdline.o process/create.o
STRING_OBJECTS = string/lstring.o