- Removed the 'shadow' NtGlobalFlag from ntdll.dll.

- Initialized NumberOfProcessors from the PEB structure.

svn path=/trunk/; revision=12790
This commit is contained in:
Hartmut Birr 2005-01-04 16:23:29 +00:00
parent 8caac8b834
commit d8b3bb21d1
7 changed files with 62 additions and 19 deletions

View file

@ -17,7 +17,7 @@
#ifdef NDEBUG
#if defined(__GNUC__)
#define TRACE_LDR(args...) if (NtGlobalFlag & FLG_SHOW_LDR_SNAPS) { DbgPrint("(LDR:%s:%d) ",__FILE__,__LINE__); DbgPrint(args); }
#define TRACE_LDR(args...) if (RtlGetNtGlobalFlags() & FLG_SHOW_LDR_SNAPS) { DbgPrint("(LDR:%s:%d) ",__FILE__,__LINE__); DbgPrint(args); }
#define DPRINT(args...)
#else
#define DPRINT

View file

@ -37,8 +37,6 @@ static CRITICAL_SECTION LoaderLock;
static RTL_BITMAP TlsBitMap;
PLDR_MODULE ExeModule;
ULONG NtGlobalFlag = 0;
NTSTATUS LdrpAttachThread (VOID);
@ -102,7 +100,6 @@ LoadImageFileExecutionOptions(PPEB Peb)
* read more options
*/
}
NtGlobalFlag = Peb->NtGlobalFlag;
}
@ -242,6 +239,8 @@ __true_LdrInitializeThunk (ULONG Unknown1,
PLDR_MODULE NtModule; // ntdll
NLSTABLEINFO NlsTable;
WCHAR FullNtDllPath[MAX_PATH];
SYSTEM_BASIC_INFORMATION SystemInformation;
NTSTATUS Status;
DPRINT("LdrInitializeThunk()\n");
if (NtCurrentPeb()->Ldr == NULL || NtCurrentPeb()->Ldr->Initialized == FALSE)
@ -280,6 +279,18 @@ __true_LdrInitializeThunk (ULONG Unknown1,
NTHeaders = (PIMAGE_NT_HEADERS)(ImageBase + PEDosHeader->e_lfanew);
/* Get number of processors */
Status = ZwQuerySystemInformation(SystemBasicInformation,
&SystemInformation,
sizeof(SYSTEM_BASIC_INFORMATION),
NULL);
if (!NT_SUCCESS(Status))
{
ZwTerminateProcess(NtCurrentProcess(), Status);
}
Peb->NumberOfProcessors = SystemInformation.NumberProcessors;
/* create process heap */
RtlInitializeHeapManager();
Peb->ProcessHeap = RtlCreateHeap(HEAP_GROWABLE,

View file

@ -1,4 +1,4 @@
/* $Id: utils.c,v 1.104 2004/12/25 11:18:51 navaraf Exp $
/* $Id$
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -51,7 +51,6 @@ static ULONG LdrpTlsSize = 0;
static HANDLE LdrpKnownDllsDirHandle = NULL;
static UNICODE_STRING LdrpKnownDllPath = {0, 0, NULL};
static PLDR_MODULE LdrpLastModule = NULL;
extern ULONG NtGlobalFlag;
extern PLDR_MODULE ExeModule;
/* PROTOTYPES ****************************************************************/

View file

@ -1,4 +1,4 @@
/* $Id: misc.c,v 1.11 2004/12/13 23:11:13 navaraf Exp $
/* $Id$
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -96,3 +96,14 @@ RtlGetNtVersionNumbers(LPDWORD major, LPDWORD minor, LPDWORD build)
*build = (0xF0000000 | pPeb->OSBuildNumber);
}
}
/*
* @implemented
*/
ULONG
STDCALL
RtlGetNtGlobalFlags(VOID)
{
PPEB pPeb = NtCurrentPeb();
return pPeb->NtGlobalFlag;
}

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id: version.c,v 1.4 2004/11/07 18:45:52 hyperion Exp $
/* $Id$
*
* PROJECT: ReactOS kernel
* PURPOSE: Runtime code
@ -36,7 +36,6 @@
/* GLOBALS ******************************************************************/
extern ULONG NtGlobalFlag;
/* FUNCTIONS ****************************************************************/
@ -71,16 +70,6 @@ RtlGetVersion(RTL_OSVERSIONINFOW *Info)
return STATUS_INVALID_PARAMETER;
}
/*
* @implemented
*/
ULONG
STDCALL
RtlGetNtGlobalFlags(VOID)
{
return(NtGlobalFlag);
}
/*
* @unimplemented
*/

View file

@ -100,6 +100,7 @@ OBJECTS_RTL = \
rtl/ctype.o \
rtl/handle.o \
rtl/message.o \
rtl/misc.o \
rtl/purecall.o \
rtl/regio.o \
rtl/sprintf.o \

View file

@ -0,0 +1,32 @@
/* $Id$
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
* PURPOSE: Various functions
* FILE: lib/ntoskrnl/rtl/misc.c
* PROGRAMER: Hartmut Birr
* REVISION HISTORY:
* 01/03/2005: Created
*/
/* INCLUDES *****************************************************************/
#include <ntoskrnl.h>
#define NDEBUG
#include <internal/debug.h>
/* GLOBALS *******************************************************************/
extern ULONG NtGlobalFlag;
/* FUNCTIONS *****************************************************************/
/*
* @implemented
*/
ULONG
STDCALL
RtlGetNtGlobalFlags(VOID)
{
return(NtGlobalFlag);
}