*** empty log message ***
authorDavid Welch <welch@cwcom.net>
Sun, 29 Aug 1999 13:45:08 +0000 (13:45 +0000)
committerDavid Welch <welch@cwcom.net>
Sun, 29 Aug 1999 13:45:08 +0000 (13:45 +0000)
svn path=/trunk/; revision=632

37 files changed:
reactos/Makefile [moved from reactos/makefile_rex with 99% similarity]
reactos/apps/tests/args/makefile
reactos/apps/tests/hello/makefile
reactos/apps/utils/shell/makefile
reactos/drivers/dd/beep/makefile
reactos/drivers/dd/blue/makefile
reactos/drivers/dd/ide/makefile
reactos/drivers/dd/keyboard/makefile
reactos/drivers/dd/null/makefile
reactos/drivers/dd/parallel/makefile
reactos/drivers/dd/serial/makefile
reactos/drivers/dd/vidport/makefile
reactos/drivers/fs/ext2/makefile
reactos/drivers/fs/minix/makefile_rex
reactos/drivers/fs/template/makefile
reactos/drivers/fs/vfat/makefile
reactos/iface/dll/makefile
reactos/iface/native/makefile
reactos/lib/advapi32/makefile
reactos/lib/crtdll/ctype/MAKEFILE [deleted file]
reactos/lib/crtdll/makefile
reactos/lib/fmifs/makefile
reactos/lib/gdi32/makefile
reactos/lib/kernel32/makefile
reactos/lib/makefile
reactos/lib/ntdll/makefile
reactos/lib/user32/makefile_rex
reactos/lib/version/makefile
reactos/ntoskrnl/ldr/init.c
reactos/ntoskrnl/makefile_rex
reactos/rules.mak
reactos/services/lsass/makefile
reactos/services/smss/makefile
reactos/services/winlogon/makefile
reactos/subsys/csrss/makefile
reactos/subsys/psxss/makefile
reactos/subsys/win32k/makefile

similarity index 99%
rename from reactos/makefile_rex
rename to reactos/Makefile
index f5ea49d..cece782 100644 (file)
@@ -200,6 +200,9 @@ $(SUBSYS:%=%_dist): %_dist:
 # Make an install floppy
 #
 
+install: all
+       ./install.sh /mnt/hda1
+
 make_floppy_dirs:
 ifeq ($(DOSCLI),yes)
        mkdir $(FLOPPY_DIR)\dlls 
index e9e2296..aec0488 100644 (file)
@@ -4,6 +4,8 @@
 OBJECTS= args.o
 PROGS= args.exe
 
+BASE_CFLAGS = -I../../include
+
 all: $(PROGS)
 
 .phony: all
index 8663eb7..e4e6176 100644 (file)
@@ -5,6 +5,7 @@ OBJECTS = ../common/crt0.o hello.o
 PROGS = hello.exe
 LIBS = ../../lib/kernel32/kernel32.a ../../lib/ntdll/ntdll.a
 CLEAN_FILES = hello.o hello.exe
+BASE_CFLAGS = -I../../include
 
 all: hello.exe
 
index 866f24e..23e9e61 100644 (file)
@@ -6,6 +6,8 @@ PROGS= shell.exe
 LIBS= ../../lib/kernel32/kernel32.a ../../lib/ntdll/ntdll.a
 CLEAN_FILES= shell.o shell.exe shell.sym
 
+BASE_CFLAGS = -I../../include
+
 all: shell.exe
 
 clean: $(CLEAN_FILES:%=%_clean)
index 8069b83..d077db6 100644 (file)
@@ -3,6 +3,8 @@
 #
 OBJECTS = beep.o ../../../ntoskrnl/ntoskrnl.a
 
+BASE_CLAGS = -I../../../include
+
 all: beep.sys
 
 .PHONY: all
index 38613a1..8cfa4b0 100644 (file)
@@ -3,6 +3,8 @@
 #
 TARGET = blue
 
+BASE_CFLAGS = -I../../../include
+
 OBJECTS = blue.o ../../../ntoskrnl/ntoskrnl.a
 
 all: blue.sys
@@ -49,3 +51,4 @@ blue.sys: $(OBJECTS)
        - $(RM) temp.exp
 
 
+include ../../../rules.mak
index 63d07a5..e10d810 100644 (file)
@@ -4,6 +4,8 @@
 TARGET=ide
 OBJECTS = ide.o ../../../ntoskrnl/ntoskrnl.a
 
+BASE_CFLAGS = -I../../../include
+
 all: ide.sys
 
 .phony: all
@@ -47,3 +49,4 @@ ide.sys: $(OBJECTS)
               -specs=../../svc_specs -mdll -o ide.sys $(OBJECTS) -Wl,temp.exp
        - $(RM) temp.exp
 
+include ../../../rules.mak
index 1403001..1f26b02 100644 (file)
@@ -4,6 +4,8 @@
 TARGET=keyboard
 OBJECTS = keyboard.o ../../../ntoskrnl/ntoskrnl.a
 
+BASE_CFLAGS = -I../../../include
+
 all: keyboard.sys
 
 .phony: all
@@ -46,3 +48,5 @@ keyboard.sys: $(OBJECTS)
        $(CC) --verbose -Wl,--image-base,0x10000 -Wl,-e,_DriverEntry@8 \
               -specs=../../svc_specs -mdll -o keyboard.sys $(OBJECTS) -Wl,temp.exp
        - $(RM) temp.exp
+
+include ../../../rules.mak
index f2f78b1..c0d8658 100644 (file)
@@ -4,6 +4,8 @@
 TARGET=null
 OBJECTS= null.o ../../../ntoskrnl/ntoskrnl.a
 
+BASE_CFLAGS = -I../../../include
+
 all: null.sys
 
 .phony: all
@@ -48,3 +50,4 @@ null.sys: $(OBJECTS)
        - $(RM) temp.exp
 
 
+include ../../../rules.mak
index 218eae3..0bfbeb9 100644 (file)
@@ -4,6 +4,8 @@
 TARGET=parallel
 OBJECTS= parallel.o ../../../ntoskrnl/ntoskrnl.a
 
+BASE_CFLAGS = -I../../../include
+
 all: parallel.sys
 
 .phony: all
@@ -48,3 +50,4 @@ parallel.sys: $(OBJECTS)
        - $(RM) temp.exp
 
 
+include ../../../rules.mak
index 24276b6..6216e36 100644 (file)
@@ -4,6 +4,8 @@
 TARGET= serial
 OBJECTS= serial.o ../../../ntoskrnl/ntoskrnl.a
 
+BASE_CFLAGS = -I../../../include
+
 all: serial.sys
 
 .phony: all
@@ -48,3 +50,4 @@ serial.sys: $(OBJECTS)
        - $(RM) temp.exp
 
 
+include ../../../rules.mak
index 14c9305..91a1130 100644 (file)
@@ -4,6 +4,8 @@
 TARGET=vidport
 OBJECTS = vidport.o ../../../ntoskrnl/ntoskrnl.a
 
+BASE_CFLAGS = -I../../../include
+
 all: vidport.sys vidport.a
 
 .phony: all
@@ -54,3 +56,4 @@ vidport.a: vidport.sys vidport.def
                --output-lib vidport.a
 
 
+include ../../../rules.mak
index 1d17044..433751d 100644 (file)
@@ -1,6 +1,9 @@
 #
 #
 #
+
+BASE_CFLAGS = -I../../../include
+
 OBJECTS = super.o blockdev.o inode.o file.o dir.o rw.o quota.o security.o \
           attr.o ../../../ntoskrnl/ntoskrnl.a
 
@@ -34,3 +37,4 @@ ext2fs.sys: $(OBJECTS)
              -specs=$(KM_SPECS) -mdll -o ext2fs.sys $(OBJECTS) -Wl,temp.exp
        $(RM) temp.exp
 
+include ../../../rules.mak
index 6c2b7c4..262f54a 100644 (file)
@@ -1,3 +1,5 @@
+BASE_CFLAGS = -I../../../include
+
 all: minix.sys
 
 OBJECTS = block.o rw.o inode.o dir.o mount.o blockdev.o \
index ecd8993..9009429 100644 (file)
@@ -3,6 +3,8 @@
 #
 OBJECTS = template.o
 
+BASE_CFLAGS = -I../../../include
+
 all: tfsd.o
 
 .phony: all
@@ -15,3 +17,5 @@ clean:
 
 tfsd.o: template.o
        $(LD) -r template.o -o tfsd.o
+
+include ../../rules.mak
index 1c288fb..90da342 100644 (file)
@@ -4,6 +4,8 @@
 TARGET=vfatfsd
 OBJECTS = blockdev.o dir.o dirwr.o iface.o ../../../ntoskrnl/ntoskrnl.a
 
+BASE_CFLAGS = -I../../../include
+
 all: vfatfsd.sys
 
 .phony: all
@@ -55,3 +57,4 @@ vfatfsd.sys: $(OBJECTS)
        - $(RM) temp.exp
 
 
+include ../../../rules.mak
index 3f3db8e..fe3aaf1 100644 (file)
@@ -1,4 +1,4 @@
-# $Id: makefile,v 1.1 1999/07/04 11:14:15 ea Exp $
+# $Id: makefile,v 1.2 1999/08/29 13:44:52 dwelch Exp $
 #
 # ReactOS Operating System
 #
@@ -7,6 +7,8 @@
 #
 TARGET = defedf
 
+BASE_CFLAGS = -I../../include
+
 all: $(TARGET)$(EXE_POSTFIX)
 
 $(TARGET)$(EXE_POSTFIX): $(TARGET).c
index 78e356b..500af64 100644 (file)
@@ -1,4 +1,4 @@
-# $Id: makefile,v 1.8 1999/06/17 00:10:30 ea Exp $
+# $Id: makefile,v 1.9 1999/08/29 13:44:52 dwelch Exp $
 #
 # ReactOS Operating System
 #
@@ -15,10 +15,12 @@ KERNEL_SERVICE_TABLE = ../../include/ntdll/napi.h
 KERNEL_ZW_CALLS = ../../ntoskrnl/nt/zw.c
 NAPI_FILES = $(NTDLL_STUBS) $(KERNEL_SERVICE_TABLE) $(KERNEL_ZW_CALLS)
 
+BASE_CFLAGS = -I../../include
+
 all: $(TARGET)$(EXE_POSTFIX) $(NAPI_FILES)
 
 $(NAPI_FILES): $(SYSTEM_CALLS_DB) $(TARGET)$(EXE_POSTFIX) 
-       $(TARGET)$(EXE_POSTFIX) \
+       ./$(TARGET)$(EXE_POSTFIX) \
                $(SYSTEM_CALLS_DB) \
                $(NTDLL_STUBS) \
                $(KERNEL_SERVICE_TABLE) \
index 04a4a34..68df2f4 100644 (file)
@@ -1,7 +1,10 @@
-# $Id: makefile,v 1.6 1999/07/26 20:46:39 ea Exp $
+# $Id: makefile,v 1.7 1999/08/29 13:44:52 dwelch Exp $
 #
 # Makefile for ReactOS advapi32.dll
 #
+
+BASE_CFLAGS = -I../../include
+
 TARGET=advapi32
 ifneq ($(HOST),mingw32-windows)
   ifneq ($(HOST),mingw32-linux)
diff --git a/reactos/lib/crtdll/ctype/MAKEFILE b/reactos/lib/crtdll/ctype/MAKEFILE
deleted file mode 100644 (file)
index 2fa6f26..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-# Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details
-TOP=../..
-
-SRC += ct_flags.c
-SRC += ct_lower.c
-SRC += ct_upper.c
-SRC += isalnum.c
-SRC += isalpha.c
-SRC += isascii.c
-SRC += iscntrl.c
-SRC += isdigit.c
-SRC += isgraph.c
-SRC += islower.c
-SRC += isprint.c
-SRC += ispunct.c
-SRC += isspace.c
-SRC += isupper.c
-SRC += isxdigit.c
-SRC += toascii.c
-SRC += tolower.c
-SRC += toupper.c
-
-include $(TOP)/../makefile.inc
index c575d5e..bd7a0fd 100644 (file)
@@ -1,4 +1,4 @@
-# $Id: makefile,v 1.32 1999/07/16 23:37:04 rex Exp $
+# $Id: makefile,v 1.33 1999/08/29 13:44:53 dwelch Exp $
 #
 # ReactOS Operating System
 #
@@ -13,6 +13,8 @@ else
   DLLTARGET=$(TARGET).dll
 endif
 
+BASE_CFLAGS = -I../../include
+
 all: $(DLLTARGET)
 
 
index f5ca25f..3f9408e 100644 (file)
@@ -1,4 +1,4 @@
-# $Id: makefile,v 1.6 1999/07/17 23:10:19 ea Exp $
+# $Id: makefile,v 1.7 1999/08/29 13:44:53 dwelch Exp $
 #
 # Makefile for fmifs.dll
 #
@@ -13,6 +13,8 @@ else
   DLLTARGET=$(TARGET).dll
 endif
 
+BASE_CFLAGS = -I../../include
+
 all: $(DLLTARGET)
 
 IFS_OBJECTS = chkdsk.o compress.o diskcopy.o extend.o \
index adc97e5..3771921 100644 (file)
@@ -1,9 +1,11 @@
-# $Id: makefile,v 1.7 1999/07/17 23:10:19 ea Exp $
+# $Id: makefile,v 1.8 1999/08/29 13:44:54 dwelch Exp $
 #
 # Makefile for ReactOS gdi32.dll
 #
 TARGET=gdi32
 
+BASE_CFLAGS = -I../../include
+
 ifneq ($(HOST),mingw32-windows)
   ifneq ($(HOST),mingw32-linux)
     DLLTARGET=$(TARGET).a
index 9ad6e5a..772356f 100644 (file)
@@ -1,4 +1,4 @@
-# $Id: makefile,v 1.23 1999/07/17 23:10:20 ea Exp $
+# $Id: makefile,v 1.24 1999/08/29 13:44:56 dwelch Exp $
 #
 # ReactOS Operating System
 #
@@ -6,6 +6,8 @@ TARGET=kernel32
 
 KERNEL32_BASE = 0x77f00000
 
+BASE_CFLAGS = -I../../include
+
 CFLAGS = $(CFLAGS) -DKERNEL32_BASE=$(KERNEL32_BASE)
 
 ifneq ($(HOST),mingw32-windows)
index 25d86e8..6a32b6c 100644 (file)
@@ -1,5 +1,7 @@
 LIBRARIES = ntdll kernel32
 
+BASE_CFLAGS = -I../include
+
 all: $(LIBRARIES)
 
 ntdll: dummy
index 05f4e44..d70c9d1 100644 (file)
@@ -1,9 +1,11 @@
-# $Id: makefile,v 1.21 1999/07/29 21:14:02 ekohl Exp $
+# $Id: makefile,v 1.22 1999/08/29 13:44:57 dwelch Exp $
 #
 # ReactOS Operating System
 #
 TARGET=ntdll
 
+BASE_CFLAGS = -I../../include
+
 IMAGE_BASE = 0x77f60000
 
 ifneq ($(HOST),mingw32-windows)
index 38ad5e2..8ffebdc 100644 (file)
@@ -1,9 +1,11 @@
-# $Id: makefile_rex,v 1.6 1999/07/17 23:10:25 ea Exp $
+# $Id: makefile_rex,v 1.7 1999/08/29 13:44:58 dwelch Exp $
 #
 # ReactOS Operating System
 #
 # Makefile for user32.dll
 #
+BASE_CFLAGS = -I../../include
+
 include ../../rules.mak
 
 TARGET=user32
index 775e404..742931c 100644 (file)
@@ -1,9 +1,11 @@
-# $Id: makefile,v 1.1 1999/08/11 19:56:48 ea Exp $
+# $Id: makefile,v 1.2 1999/08/29 13:44:58 dwelch Exp $
 #
 # Makefile for ReactOS version.dll
 #
 TARGET=version
 
+BASE_CFLAGS = -I../../include
+
 ifneq ($(HOST),mingw32-windows)
   ifneq ($(HOST),mingw32-linux)
     DLLTARGET=$(TARGET).a
index b28dad4..6cd7e72 100644 (file)
@@ -31,7 +31,7 @@
 #include <internal/teb.h>
 #include <ddk/ntddk.h>
 
-#define NDEBUG
+//#define NDEBUG
 #include <internal/debug.h>
 
 #include "syspath.h"
 
 #define STACK_TOP (0xb0000000)
 
-static
-NTSTATUS
-LdrCreatePeb(HANDLE ProcessHandle)
+static NTSTATUS LdrCreatePeb(HANDLE ProcessHandle)
 {
-       NTSTATUS        Status;
-       PVOID           PebBase;
-       ULONG           PebSize;
-       NT_PEB          Peb;
-       ULONG           BytesWritten;
-
-       
-       PebBase = (PVOID)PEB_BASE;
-       PebSize = 0x1000;
-       Status = ZwAllocateVirtualMemory(
-                       ProcessHandle,
-                       & PebBase,
-                       0,
-                       & PebSize,
-                       MEM_COMMIT,
-                       PAGE_READWRITE
-                       );
-       if (!NT_SUCCESS(Status))
-       {
-               return(Status);
-       }
+   NTSTATUS    Status;
+   PVOID               PebBase;
+   ULONG               PebSize;
+   NT_PEB              Peb;
+   ULONG               BytesWritten;
    
    
-       memset(
-               & Peb,
-               0,
-               sizeof Peb
-               );
-       Peb.StartupInfo = (PPROCESSINFOW) PEB_STARTUPINFO;
+   PebBase = (PVOID)PEB_BASE;
+   PebSize = 0x1000;
+   Status = ZwAllocateVirtualMemory(ProcessHandle,
+                                   &PebBase,
+                                   0,
+                                   &PebSize,
+                                   MEM_COMMIT,
+                                   PAGE_READWRITE);
+   if (!NT_SUCCESS(Status))
+     {
+       return(Status);
+     }
+   
+   
+   memset(&Peb, 0, sizeof Peb);
+   
+   Peb.StartupInfo = (PPROCESSINFOW) PEB_STARTUPINFO;
 
-       ZwWriteVirtualMemory(
-               ProcessHandle,
-               (PVOID) PEB_BASE,
-               & Peb,
-               sizeof Peb,
-               & BytesWritten
-               );
+   ZwWriteVirtualMemory(ProcessHandle,
+                       (PVOID)PEB_BASE,
+                       &Peb,
+                       sizeof(Peb),
+                       &BytesWritten);
       
-       return(STATUS_SUCCESS);
+   return(STATUS_SUCCESS);
 }
 
 
-NTSTATUS
-LdrLoadImage (
-       HANDLE          ProcessHandle,
-       PUNICODE_STRING Filename
-       )
+NTSTATUS LdrLoadImage(HANDLE           ProcessHandle,
+                     PUNICODE_STRING   Filename)
 {
-       CHAR                    BlockBuffer [1024];
-       DWORD                   ImageBase;
-       DWORD                   LdrStartupAddr;
-       DWORD                   StackBase;
-       ULONG                   ImageSize;
-       ULONG                   StackSize;
-       NTSTATUS                Status;
-       OBJECT_ATTRIBUTES       FileObjectAttributes;
-       HANDLE                  FileHandle;
-       HANDLE                  SectionHandle;
-       HANDLE                  NTDllSectionHandle;
-       HANDLE                  ThreadHandle;
-       HANDLE                  DupNTDllSectionHandle;
-       CONTEXT                 Context;
-       UNICODE_STRING          DllPathname;
-       PIMAGE_DOS_HEADER       DosHeader;
-       PIMAGE_NT_HEADERS       NTHeaders;
-       ULONG                   BytesWritten;
-       ULONG                   InitialViewSize;
-       ULONG                   i;
-       HANDLE                  DupSectionHandle;
-
-       WCHAR                   TmpNameBuffer [MAX_PATH];
-
-
+   CHAR                        BlockBuffer [1024];
+   DWORD                       ImageBase;
+   DWORD                       LdrStartupAddr;
+   DWORD                       StackBase;
+   ULONG                       ImageSize;
+   ULONG                       StackSize;
+   NTSTATUS            Status;
+   OBJECT_ATTRIBUTES   FileObjectAttributes;
+   HANDLE                      FileHandle;
+   HANDLE                      SectionHandle;
+   HANDLE                      NTDllSectionHandle;
+   HANDLE                      ThreadHandle;
+   HANDLE                      DupNTDllSectionHandle;
+   CONTEXT                     Context;
+   UNICODE_STRING              DllPathname;
+   PIMAGE_DOS_HEADER   DosHeader;
+   PIMAGE_NT_HEADERS   NTHeaders;
+   ULONG                       BytesWritten;
+   ULONG                       InitialViewSize;
+   ULONG                       i;
+   HANDLE                      DupSectionHandle;
+   
+   WCHAR                       TmpNameBuffer [MAX_PATH];
+   
+   
 /* -- PART I -- */
        
-       /*
-        * Locate and open NTDLL to determine ImageBase
-        * and LdrStartup
-        */
-       GetSystemDirectory(
-               TmpNameBuffer,
-               sizeof TmpNameBuffer
-               );
-       wcscat(
-               TmpNameBuffer,
-               L"\\ntdll.dll"
-               );
-       RtlInitUnicodeString(
-               & DllPathname,
-               TmpNameBuffer
-               ); 
-       InitializeObjectAttributes(
-               & FileObjectAttributes,
-               & DllPathname, 
-               0,
-               NULL,
-               NULL
-               );
-       DPRINT("Opening NTDLL\n");
-       Status = ZwOpenFile(
-                       & FileHandle, 
-                       FILE_ALL_ACCESS, 
-                       & FileObjectAttributes, 
-                       NULL, 
-                       0, 
-                       0
-                       );
-       if (!NT_SUCCESS(Status))
-       {
-               DPRINT("NTDLL open failed ");
-               DbgPrintErrorMessage(Status);
-               
-               return Status;
-       }
-       Status = ZwReadFile(
-                       FileHandle,
-                       0,
-                       0,
-                       0,
-                       0,
-                       BlockBuffer,
-                       sizeof BlockBuffer,
-                       0,
-                       0
-                       );
-       if (!NT_SUCCESS(Status))
-       {
-               DPRINT("NTDLL header read failed ");
-               DbgPrintErrorMessage(Status);
-               ZwClose(FileHandle);
-
-               return Status;
-       }    
-       /*
-        * FIXME: this will fail if the NT headers are
-        * more than 1024 bytes from start.
-        */
-       DosHeader = (PIMAGE_DOS_HEADER) BlockBuffer;
-       NTHeaders = (PIMAGE_NT_HEADERS) (BlockBuffer + DosHeader->e_lfanew);
-       if (
-               (DosHeader->e_magic != IMAGE_DOS_MAGIC)
-               || (DosHeader->e_lfanew == 0L)
-               || (*(PULONG) NTHeaders != IMAGE_PE_MAGIC)
-               )
-       {
-               DPRINT("NTDLL format invalid\n");
-               ZwClose(FileHandle);
-
-               return STATUS_UNSUCCESSFUL;
-       }
-       ImageBase = NTHeaders->OptionalHeader.ImageBase;
-       ImageSize = NTHeaders->OptionalHeader.SizeOfImage;
-       /*
-        * FIXME: retrieve the offset of LdrStartup from NTDLL
-        */
-       DPRINT("ImageBase %x\n",ImageBase);
-       LdrStartupAddr =
-               ImageBase
-               + NTHeaders->OptionalHeader.AddressOfEntryPoint;
-       /*
-        * Create a section for NTDLL
-        */
-       Status = ZwCreateSection(
-                       & NTDllSectionHandle,
-                       SECTION_ALL_ACCESS,
-                       NULL,
-                       NULL,
-                       PAGE_READWRITE,
-                       MEM_COMMIT,
-                       FileHandle
-                       );
-       if (!NT_SUCCESS(Status))
-       {
-               DPRINT("NTDLL create section failed ");
-               DbgPrintErrorMessage(Status);
-               ZwClose(FileHandle);
-
-               return Status;
-       }
-       /*
-        * Map the NTDLL into the process
-        */
-       InitialViewSize =
-               DosHeader->e_lfanew
-               + sizeof (IMAGE_NT_HEADERS) 
-               + (     sizeof (IMAGE_SECTION_HEADER)
-                       * NTHeaders->FileHeader.NumberOfSections
-                       );
-       Status = ZwMapViewOfSection(
-                       NTDllSectionHandle,
-                       ProcessHandle,
-                       (PVOID *) & ImageBase,
-                       0,
-                       InitialViewSize,
-                       NULL,
-                       & InitialViewSize,
-                       0,
-                       MEM_COMMIT,
-                       PAGE_READWRITE
-                       );
-       if (!NT_SUCCESS(Status))
-       {
-               DPRINT("NTDLL map view of secion failed ");
-               DbgPrintErrorMessage(Status);
-
-               /* FIXME: destroy the section here  */
-
-               ZwClose(FileHandle);
-
-               return Status;
-       }
-       for (   i = 0;
-               (i < NTHeaders->FileHeader.NumberOfSections);
-               i++
-               )
-       {
-               PIMAGE_SECTION_HEADER   Sections;
-               LARGE_INTEGER           Offset;
-               ULONG                   Base;
+   /*
+    * Locate and open NTDLL to determine ImageBase
+    * and LdrStartup
+    */
+   GetSystemDirectory(TmpNameBuffer, sizeof TmpNameBuffer);
+   wcscat(TmpNameBuffer, L"\\ntdll.dll");
+   RtlInitUnicodeString(&DllPathname, TmpNameBuffer); 
+   InitializeObjectAttributes(&FileObjectAttributes,
+                             &DllPathname, 
+                             0,
+                             NULL,
+                             NULL);
+   DPRINT("Opening NTDLL\n");
+   Status = ZwOpenFile(&FileHandle, 
+                      FILE_ALL_ACCESS, 
+                      &FileObjectAttributes, 
+                      NULL, 
+                      0, 
+                      0);
+   if (!NT_SUCCESS(Status))
+     {
+       DbgPrint("NTDLL open failed ");
+       DbgPrintErrorMessage(Status);   
+       return Status;
+     }
+   Status = ZwReadFile(FileHandle,
+                      0,
+                      0,
+                      0,
+                      0,
+                      BlockBuffer,
+                      sizeof BlockBuffer,
+                      0,
+                      0);
+   if (!NT_SUCCESS(Status))
+     {
+       DPRINT("NTDLL header read failed ");
+       DbgPrintErrorMessage(Status);
+       ZwClose(FileHandle);    
+       return Status;
+     }
+   
+   /*
+    * FIXME: this will fail if the NT headers are
+    * more than 1024 bytes from start.
+    */
+   DosHeader = (PIMAGE_DOS_HEADER) BlockBuffer;
+   NTHeaders = (PIMAGE_NT_HEADERS) (BlockBuffer + DosHeader->e_lfanew);
+   if ((DosHeader->e_magic != IMAGE_DOS_MAGIC)
+       || (DosHeader->e_lfanew == 0L)
+       || (*(PULONG) NTHeaders != IMAGE_PE_MAGIC))
+     {
+       DPRINT("NTDLL format invalid\n");
+       ZwClose(FileHandle);    
+       return STATUS_UNSUCCESSFUL;
+     }
+   ImageBase = NTHeaders->OptionalHeader.ImageBase;
+   ImageSize = NTHeaders->OptionalHeader.SizeOfImage;
+   /*
+    * FIXME: retrieve the offset of LdrStartup from NTDLL
+    */
+   DPRINT("ImageBase %x\n",ImageBase);
+   LdrStartupAddr = ImageBase + NTHeaders->OptionalHeader.AddressOfEntryPoint;
+   /*
+    * Create a section for NTDLL
+    */
+   Status = ZwCreateSection(&NTDllSectionHandle,
+                           SECTION_ALL_ACCESS,
+                           NULL,
+                           NULL,
+                           PAGE_READWRITE,
+                           MEM_COMMIT,
+                           FileHandle);
+   if (!NT_SUCCESS(Status))
+     {
+       DPRINT("NTDLL create section failed ");
+       DbgPrintErrorMessage(Status);
+       ZwClose(FileHandle);
+       
+       return Status;
+     }
+   
+   /*
+    * Map the NTDLL into the process
+    */
+   InitialViewSize = DosHeader->e_lfanew
+     + sizeof (IMAGE_NT_HEADERS) 
+       + (     sizeof (IMAGE_SECTION_HEADER)
+         * NTHeaders->FileHeader.NumberOfSections
+         );
+   Status = ZwMapViewOfSection(NTDllSectionHandle,
+                              ProcessHandle,
+                              (PVOID *) & ImageBase,
+                              0,
+                              InitialViewSize,
+                              NULL,
+                              &InitialViewSize,
+                              0,
+                              MEM_COMMIT,
+                              PAGE_READWRITE);
+   if (!NT_SUCCESS(Status))
+     {
+       DPRINT("NTDLL map view of secion failed ");
+       DbgPrintErrorMessage(Status);
+       
+       /* FIXME: destroy the section here  */
        
-               Sections =
-                       (PIMAGE_SECTION_HEADER) SECHDROFFSET(BlockBuffer);
-               Base =
-                       Sections[i].VirtualAddress
-                       + ImageBase;
-               Offset.u.LowPart =
-                       Sections[i].PointerToRawData;
-               Offset.u.HighPart =
-                       0;
-               Status = ZwMapViewOfSection(
-                               NTDllSectionHandle,
-                               ProcessHandle,
-                               (PVOID *) & Base,
-                               0,
-                               Sections[i].Misc.VirtualSize,
-                               & Offset,
-                               (PULONG) & Sections[i].Misc.VirtualSize,
-                               0,
-                               MEM_COMMIT,
-                               PAGE_READWRITE
-                               );
-               if (!NT_SUCCESS(Status))
-               {
-                       DPRINT("NTDLL map view of secion failed ");
-                       DbgPrintErrorMessage(Status);
-
-                       /* FIXME: destroy the section here  */
-            
-                       ZwClose(FileHandle);
-                       return Status;
-               }
-       }
        ZwClose(FileHandle);
        
-/* -- PART II -- */
+       return Status;
+     }
+   
+   for (i = 0;
+       (i < NTHeaders->FileHeader.NumberOfSections);
+       i++)
+     {
+       PIMAGE_SECTION_HEADER   Sections;
+       LARGE_INTEGER           Offset;
+       ULONG                   Base;
+       
+       Sections = (PIMAGE_SECTION_HEADER) SECHDROFFSET(BlockBuffer);
+               Base = Sections[i].VirtualAddress + ImageBase;
+       Offset.u.LowPart = Sections[i].PointerToRawData;
+       Offset.u.HighPart = 0;
+       Status = ZwMapViewOfSection(NTDllSectionHandle,
+                                   ProcessHandle,
+                                   (PVOID *) & Base,
+                                   0,
+                                   Sections[i].Misc.VirtualSize,
+                                   &Offset,
+                                   (PULONG) & Sections[i].Misc.VirtualSize,
+                                   0,
+                                   MEM_COMMIT,
+                                   PAGE_READWRITE);
+       if (!NT_SUCCESS(Status))
+         {
+            DPRINT("NTDLL map view of secion failed ");
+            DbgPrintErrorMessage(Status);
+            
+            /* FIXME: destroy the section here  */
+            
+            ZwClose(FileHandle);
+            return Status;
+         }
+     }
+   ZwClose(FileHandle);
+   
+   /* -- PART II -- */
        
        /*
         * Open process image to determine ImageBase
@@ -570,52 +526,41 @@ LdrLoadImage (
  * FIXME: The location of the initial process should be configurable,
  * from command line or registry
  */
-NTSTATUS
-LdrLoadInitialProcess (VOID)
+NTSTATUS LdrLoadInitialProcess (VOID)
 {
-       NTSTATUS        Status;
-       HANDLE          ProcessHandle;
-       UNICODE_STRING  ProcessName;
-       WCHAR           TmpNameBuffer [MAX_PATH];
-
-       
-       Status = ZwCreateProcess(
-                       & ProcessHandle,
-                       PROCESS_ALL_ACCESS,
-                       NULL,
-                       SystemProcessHandle,
-                       FALSE,
-                       NULL,
-                       NULL,
-                       NULL
-                       );
-       if (!NT_SUCCESS(Status))
-       {
-               DbgPrint("Could not create process\n");
-               return Status;
-       }
-       /*
-        * Get the system directory's name (a DOS device
-        * alias name which is in \\??\\).
-        */
-       GetSystemDirectory(
-               TmpNameBuffer,
-               sizeof TmpNameBuffer
-               );
-       wcscat(
-               TmpNameBuffer,
-               L"\\shell.exe" /* FIXME: should be smss.exe */
-               );
-       RtlInitUnicodeString(
-               & ProcessName,
-               TmpNameBuffer
-               );
-       Status = LdrLoadImage(
-                       ProcessHandle,
-                       & ProcessName
-                       );
+   NTSTATUS    Status;
+   HANDLE              ProcessHandle;
+   UNICODE_STRING      ProcessName;
+   WCHAR               TmpNameBuffer [MAX_PATH];
    
+   
+   Status = ZwCreateProcess(&ProcessHandle,
+                           PROCESS_ALL_ACCESS,
+                           NULL,
+                           SystemProcessHandle,
+                           FALSE,
+                           NULL,
+                           NULL,
+                           NULL);
+   if (!NT_SUCCESS(Status))
+     {
+       DbgPrint("Could not create process\n");
        return Status;
+     }
+   
+   /*
+    * Get the system directory's name (a DOS device
+    * alias name which is in \\??\\).
+    */
+   GetSystemDirectory(TmpNameBuffer, sizeof TmpNameBuffer);
+   wcscat(TmpNameBuffer, L"\\shell.exe");
+   RtlInitUnicodeString(&ProcessName, TmpNameBuffer);
+   Status = LdrLoadImage(ProcessHandle, &ProcessName);
+   if (!NT_SUCCESS(Status))
+     {
+       DbgPrint("Failed to load %W\n",&ProcessName);
+     }
+   return Status;
 }
 
 /* EOF */
index 0f22269..a9a5173 100644 (file)
@@ -1,9 +1,11 @@
-# $Id: makefile_rex,v 1.30 1999/08/11 23:23:48 ekohl Exp $
+# $Id: makefile_rex,v 1.31 1999/08/29 13:44:58 dwelch Exp $
 #
 # ReactOS Operating System
 #
 TARGET=ntoskrnl
 
+BASE_CFLAGS = -I../include
+
 all: objects $(TARGET).exe
 
 #
index c5b9eca..80714f0 100644 (file)
@@ -61,12 +61,10 @@ endif
 
 CC = $(PREFIX)gcc
 NATIVE_CC = gcc
-CFLAGS = \
+CFLAGS = $(BASE_CFLAGS) \
        -pipe \
        -O2 \
-       -I../../../include \
-       -I../../include  \
-       -I../include \
+       -Iinclude \
        -fno-builtin $(LEAN_AND_MEAN_DEFINE)  \
        $(DEFINES) -Wall \
        -Wstrict-prototypes $(DEBUGGING_CFLAGS) \
index 38de765..1b9f935 100644 (file)
@@ -1,4 +1,4 @@
-# $Id: makefile,v 1.1 1999/07/17 23:10:29 ea Exp $
+# $Id: makefile,v 1.2 1999/08/29 13:45:05 dwelch Exp $
 #
 # Local Security Authority Subsystem
 #
@@ -6,6 +6,8 @@
 #
 TARGET=lsass
 
+BASE_CFLAGS = -I../../include
+
 OBJECTS = $(TARGET).o init.o $(TARGET).coff
 
 LIBS = ../../lib/ntdll/ntdll.a
index ef84859..07289d3 100644 (file)
@@ -1,4 +1,4 @@
-# $Id: makefile,v 1.1 1999/05/30 20:40:18 ea Exp $
+# $Id: makefile,v 1.2 1999/08/29 13:45:06 dwelch Exp $
 #
 # Session Manager
 #
@@ -6,6 +6,8 @@
 #
 TARGET=smss
 
+BASE_CFLAGS = -I../../include
+
 OBJECTS = $(TARGET).o init.o $(TARGET).coff
 
 LIBS = ../../lib/ntdll/ntdll.a
index e82d325..5591f03 100644 (file)
@@ -1,4 +1,4 @@
-# $Id: makefile,v 1.1 1999/06/18 22:40:47 ea Exp $
+# $Id: makefile,v 1.2 1999/08/29 13:45:06 dwelch Exp $
 #
 # Logon/login Application
 #
@@ -6,6 +6,8 @@
 #
 TARGET=winlogon
 
+BASE_CFLAGS = -I../../include
+
 OBJECTS = $(TARGET).o init.o $(TARGET).coff
 
 LIBS = ../../lib/ntdll/ntdll.a
index b229559..add1bfe 100644 (file)
@@ -1,4 +1,4 @@
-# $Id: makefile,v 1.1 1999/06/08 22:50:59 ea Exp $
+# $Id: makefile,v 1.2 1999/08/29 13:45:07 dwelch Exp $
 #
 # CSRSS: Client/server runtime subsystem
 #
@@ -6,6 +6,8 @@
 #
 TARGET=csrss
 
+BASE_CFLAGS = -I../../include
+
 OBJECTS_API = api/process.o
 
 OBJECTS_SBAPI =
index 379b9f5..2f731b3 100644 (file)
@@ -1,4 +1,4 @@
-# $Id: makefile,v 1.1 1999/07/17 23:10:31 ea Exp $
+# $Id: makefile,v 1.2 1999/08/29 13:45:07 dwelch Exp $
 #
 # CSRSS: Client/server run-time subsystem
 #
@@ -6,6 +6,8 @@
 #
 TARGET=csrss
 
+BASE_CFLAGS = -I../../include
+
 OBJECTS = $(TARGET).o init.o $(TARGET).coff
 
 LIBS = ../../lib/ntdll/ntdll.a
index ffd6718..7d6d7ea 100644 (file)
@@ -2,6 +2,8 @@
 # WIN32K.SYS build spec
 #
 
+BASE_CFLAGS = -I../../include
+
 MAIN_OBJECTS = main/dllmain.o
 MISC_OBJECTS = misc/driver.o
 OBJECTS_OBJECTS = objects/bitmaps.o objects/brush.o objects/cliprgn.o  \