diff --git a/reactos/ntoskrnl/ldr/init.c b/reactos/ntoskrnl/ldr/init.c index 9bfd7c0be79..04aa97e4264 100644 --- a/reactos/ntoskrnl/ldr/init.c +++ b/reactos/ntoskrnl/ldr/init.c @@ -12,7 +12,8 @@ * RJJ 10/12/98 Rolled in David's code to load COFF drivers * JM 14/12/98 Built initial PE user module loader * RJJ 06/03/99 Moved user PE loader into NTDLL - * EA 19990717 GetSystemDirectory() + * EA 19990717 LdrGetSystemDirectory() + * EK 20000618 Using SystemRoot link instead of LdrGetSystemDirectory() */ /* INCLUDES *****************************************************************/ @@ -32,8 +33,6 @@ #define NDEBUG #include -#include "syspath.h" - /* GLOBALS *******************************************************************/ #define STACK_TOP (0xb0000000) @@ -49,7 +48,6 @@ NTSTATUS LdrLoadInitialProcess (VOID) NTSTATUS Status; HANDLE ProcessHandle; UNICODE_STRING ProcessName; - WCHAR TmpNameBuffer[MAX_PATH]; OBJECT_ATTRIBUTES ObjectAttributes; HANDLE FileHandle; HANDLE SectionHandle; @@ -63,26 +61,25 @@ NTSTATUS LdrLoadInitialProcess (VOID) HANDLE ThreadHandle; /* - * Get the system directory's name (a DOS device - * alias name which is in \\??\\). + * Get the absolute path to smss.exe using the + * SystemRoot link. */ - LdrGetSystemDirectory(TmpNameBuffer, sizeof TmpNameBuffer); - wcscat(TmpNameBuffer, L"\\smss.exe"); - RtlInitUnicodeString(&ProcessName, TmpNameBuffer); + RtlInitUnicodeString(&ProcessName, + L"\\SystemRoot\\system32\\smss.exe"); /* * Open process image to determine ImageBase * and StackBase/Size. */ InitializeObjectAttributes(&ObjectAttributes, - &ProcessName, + &ProcessName, 0, NULL, NULL); DPRINT("Opening image file %S\n", ObjectAttributes.ObjectName->Buffer); Status = ZwOpenFile(&FileHandle, FILE_ALL_ACCESS, - &ObjectAttributes, + &ObjectAttributes, NULL, 0, 0); diff --git a/reactos/ntoskrnl/ldr/sysdll.c b/reactos/ntoskrnl/ldr/sysdll.c index 415f698126f..be2a428094c 100644 --- a/reactos/ntoskrnl/ldr/sysdll.c +++ b/reactos/ntoskrnl/ldr/sysdll.c @@ -25,8 +25,6 @@ #define NDEBUG #include -#include "syspath.h" - /* GLOBALS *******************************************************************/ static PVOID SystemDllEntryPoint = NULL; @@ -56,7 +54,7 @@ NTSTATUS LdrpMapSystemDll(HANDLE ProcessHandle, * * RETURNS: Status */ -{ +{ CHAR BlockBuffer [1024]; DWORD ImageBase; ULONG ImageSize; @@ -69,15 +67,13 @@ NTSTATUS LdrpMapSystemDll(HANDLE ProcessHandle, PIMAGE_NT_HEADERS NTHeaders; ULONG InitialViewSize; ULONG i; - WCHAR TmpNameBuffer [MAX_PATH]; /* * Locate and open NTDLL to determine ImageBase * and LdrStartup */ - LdrGetSystemDirectory(TmpNameBuffer, sizeof TmpNameBuffer); - wcscat(TmpNameBuffer, L"\\ntdll.dll"); - RtlInitUnicodeString(&DllPathname, TmpNameBuffer); + RtlInitUnicodeString(&DllPathname, + L"\\SystemRoot\\system32\\ntdll.dll"); InitializeObjectAttributes(&FileObjectAttributes, &DllPathname, 0, @@ -125,7 +121,7 @@ NTSTATUS LdrpMapSystemDll(HANDLE ProcessHandle, ZwClose(FileHandle); return(STATUS_UNSUCCESSFUL); } - ImageBase = NTHeaders->OptionalHeader.ImageBase; + ImageBase = NTHeaders->OptionalHeader.ImageBase; ImageSize = NTHeaders->OptionalHeader.SizeOfImage; /* diff --git a/reactos/ntoskrnl/ldr/syspath.c b/reactos/ntoskrnl/ldr/syspath.c deleted file mode 100644 index 95360b96f78..00000000000 --- a/reactos/ntoskrnl/ldr/syspath.c +++ /dev/null @@ -1,89 +0,0 @@ -/* $Id: syspath.c,v 1.3 1999/10/20 23:09:26 rex Exp $ - * - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel - * FILE: ntoskrnl/ldr/syspath.c - * PURPOSE: Get system path - * PROGRAMMERS: EA - * UPDATE HISTORY: - * EA 19990717 GetSystemDirectory() - */ - -/* INCLUDES *****************************************************************/ - -#include -#include -#include - - -/********************************************************************** - * NAME - * GetSystemDirectory - * - * DESCRIPTION - * Get the ReactOS system directory from the registry. - * (since registry does not work yet, fill the buffer - * with a literal which will remain as the default). - * - * RETURN VALUE - * NULL on error; otherwise SystemDirectoryName. - * - * REVISIONS - * 19990717 (EA) - */ -LPWSTR -LdrGetSystemDirectory ( - LPWSTR SystemDirectoryName, - DWORD Size - ) -{ - LPWSTR DosDev = L"\\??\\"; - LPWSTR SDName = L"C:\\reactos\\system32"; - - if ( (NULL == SystemDirectoryName) - || ( - ( - (wcslen(DosDev) - + wcslen(SDName) - + 1 - ) - * sizeof (WCHAR) - ) - > Size - ) - ) - { - DbgPrint("LdrGetSystemDirectory() failed\n"); - return NULL; - } - /* - * Prefix with the dos devices aliases - * directory, since the system directory - * is always given as a dos name by users - * (in the registry/by the boot loader?). - */ - wcscpy( - SystemDirectoryName, - L"\\??\\" - ); - if (FALSE) - { - /* - * FIXME: get the system directory - * from the registry. - */ - } - else - { - /* Default value */ - wcscat( - SystemDirectoryName, - SDName - ); - } - - return SystemDirectoryName; -} - - -/* EOF */ diff --git a/reactos/ntoskrnl/ldr/syspath.h b/reactos/ntoskrnl/ldr/syspath.h deleted file mode 100644 index 300c4bd36dd..00000000000 --- a/reactos/ntoskrnl/ldr/syspath.h +++ /dev/null @@ -1,6 +0,0 @@ -LPWSTR -LdrGetSystemDirectory ( - LPWSTR SystemDirectoryName, - DWORD Size - ); - diff --git a/reactos/ntoskrnl/makefile_rex b/reactos/ntoskrnl/makefile_rex index 605d862e6a5..d47e5f8657b 100644 --- a/reactos/ntoskrnl/makefile_rex +++ b/reactos/ntoskrnl/makefile_rex @@ -1,4 +1,4 @@ -# $Id: makefile_rex,v 1.72 2000/06/09 20:02:37 ekohl Exp $ +# $Id: makefile_rex,v 1.73 2000/06/18 17:39:07 ekohl Exp $ # # ReactOS Operating System # @@ -126,7 +126,6 @@ OBJECTS_IO = \ io/create.o \ io/device.o \ io/dir.o \ - io/dpc.o \ io/drvlck.o \ io/errlog.o \ io/error.o \ @@ -227,7 +226,6 @@ OBJECTS_LDR = \ ldr/init.o \ ldr/loader.o \ ldr/rtl.o \ - ldr/syspath.o \ ldr/sysdll.o \ ldr/userldr.o