* Significant improve boot speed and debug log neatness:

- Get rid of a dozen of debug prints that have been straying along for a long time (some for years), most of which I must shamefully admit I am responsible for.
- Fix a critical bug subsystem bug in smss and don't hang the system 15 seconds on boot-up.
- Rebase some problematic modules (and fix wshtcpip's rbuild file) to avoid relocations on bootup and some process startup. 
- Enable lsass startup in winlogon and the registry.
- Only show debug log header when actually debugging to a file.

svn path=/trunk/; revision=22305
This commit is contained in:
Alex Ionescu 2006-06-11 08:25:10 +00:00
parent ab794adf1d
commit 57dc67574c
20 changed files with 72 additions and 77 deletions

View file

@ -170,6 +170,7 @@ SmBeginClientInitialization (IN PSM_PORT_MESSAGE Request,
PSM_CONNECT_DATA ConnectData = SmpGetConnectData (Request);
ULONG SbApiPortNameSize = SM_CONNECT_DATA_SIZE(*Request);
INT ClientIndex = SM_INVALID_CLIENT_INDEX;
HANDLE Process;
DPRINT("SM: %s(%08lx,%08lx) called\n", __FUNCTION__,
@ -182,26 +183,25 @@ SmBeginClientInitialization (IN PSM_PORT_MESSAGE Request,
if (NULL != SmpClientDirectory.CandidateClient)
{
PROCESS_BASIC_INFORMATION pbi;
OBJECT_ATTRIBUTES ObjectAttributes;
RtlZeroMemory (& pbi, sizeof pbi);
Status = NtQueryInformationProcess (Request->Header.ClientId.UniqueProcess,
InitializeObjectAttributes(&ObjectAttributes, NULL, 0, NULL, NULL);
Status = NtOpenProcess(&Process,
PROCESS_ALL_ACCESS,
&ObjectAttributes,
&Request->Header.ClientId);
ASSERT(NT_SUCCESS(Status));
Status = NtQueryInformationProcess (Process,
ProcessBasicInformation,
& pbi,
sizeof pbi,
NULL);
if (NT_SUCCESS(Status))
ASSERT(NT_SUCCESS(Status));
{
SmpClientDirectory.CandidateClient->ServerProcessId =
(ULONG) pbi.UniqueProcessId;
}
else
{
LARGE_INTEGER Fixme;
Fixme.QuadPart = -50000000;
DPRINT1("WARNING! UniqueProcess IS A THREAD HANDLE!!!\n");
NtDelayExecution(FALSE, &Fixme);
DPRINT1("FIXME!\n");
}
}
else
{

View file

@ -47,6 +47,7 @@
<property name="BASEADDRESS_CARDS" value="0x701a0000" />
<property name="BASEADDRESS_WININET" value="0x70200000" />
<property name="BASEADDRESS_ACLUI" value="0x71550000" />
<property name="BASEADDRESS_DHCPCSVC" value="0x71650000" />
<property name="BASEADDRESS_SHDOCVW" value="0x71700000" />
<property name="BASEADDRESS_MSWSOCK" value="0x71a30000" />
<property name="BASEADDRESS_WSOCK32" value="0x71ab0000" />
@ -92,29 +93,29 @@
<property name="BASEADDRESS_WINTRUST" value="0x76c30000" />
<property name="BASEADDRESS_IMAGEHLP" value="0x76c90000" />
<property name="BASEADDRESS_FMIFS" value="0x76df0000" />
<property name="BASEADDRESS_SHELL32" value="0x77260000" />
<property name="BASEADDRESS_IPHLPAPI" value="0x77400000" />
<property name="BASEADDRESS_SHELL32" value="0x6a360000" />
<property name="BASEADDRESS_IPHLPAPI" value="0x75700000" />
<property name="BASEADDRESS_MSVFW32" value="0x77400000" />
<property name="BASEADDRESS_MSACM32" value="0x77400000" />
<property name="BASEADDRESS_MMDRV" value="0x77530000" />
<property name="BASEADDRESS_MMDRV" value="0x74C30000" />
<property name="BASEADDRESS_CRTDLL" value="0x77630000" />
<property name="BASEADDRESS_AUTHZ" value="0x77690000" />
<property name="BASEADDRESS_CFGMGR32" value="0x77700000" />
<property name="BASEADDRESS_PACKET" value="0x77780000" />
<property name="BASEADDRESS_MSAFD" value="0x777a0000" />
<property name="BASEADDRESS_MSI" value="0x777b0000" />
<property name="BASEADDRESS_SNMPAPI" value="0x777c0000" />
<property name="BASEADDRESS_MSAFD" value="0x77780000" />
<property name="BASEADDRESS_MSI" value="0x77790000" />
<property name="BASEADDRESS_SNMPAPI" value="0x777a0000" />
<property name="BASEADDRESS_IPRTPRIO" value="0x777c0000" />
<property name="BASEADDRESS_WSHTCPIP" value="0x777c0000" />
<property name="BASEADDRESS_WINMM" value="0x777d0000" />
<property name="BASEADDRESS_WSHTCPIP" value="0x677b0000" />
<property name="BASEADDRESS_WINMM" value="0x697d0000" />
<property name="BASEADDRESS_WS2HELP" value="0x777e0000" />
<property name="BASEADDRESS_WSHIRDA" value="0x777f0000" />
<property name="BASEADDRESS_WINSPOOL" value="0x77800000" />
<property name="BASEADDRESS_VERSION" value="0x77a40000" />
<property name="BASEADDRESS_OLE32" value="0x77a50000" />
<property name="BASEADDRESS_WS2_32" value="0x77aa0000" />
<property name="BASEADDRESS_WS2_32" value="0x74aa0000" />
<property name="BASEADDRESS_OLEPRO32" value="0x77aa0000" />
<property name="BASEADDRESS_CRYPT32" value="0x77ab0000" />
<property name="BASEADDRESS_CRYPT32" value="0x67ab0000" />
<property name="BASEADDRESS_ADVAPI32" value="0x77dc0000" />
<property name="BASEADDRESS_USER32" value="0x77e50000" />
<property name="BASEADDRESS_GDI32" value="0x77f10000" />

View file

@ -737,7 +737,7 @@ HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Tonga Standard Tim
;HKLM,"SOFTWARE\ReactOS\Windows NT\CurrentVersion\Winlogon","Shell",0x00020000,"%SystemRoot%\system32\cmd.exe"
HKLM,"SOFTWARE\ReactOS\Windows NT\CurrentVersion\Winlogon","Shell",0x00020000,"%SystemRoot%\explorer.exe"
HKLM,"SOFTWARE\ReactOS\Windows NT\CurrentVersion\Winlogon","StartServices",0x00010001,0x00000001
HKLM,"SOFTWARE\ReactOS\Windows NT\CurrentVersion\Winlogon","StartLsass",0x00010001,0x00000000
HKLM,"SOFTWARE\ReactOS\Windows NT\CurrentVersion\Winlogon","StartLsass",0x00010001,0x00000001
HKLM,"SOFTWARE\ReactOS\Windows NT\CurrentVersion\Winlogon","StartGUI",0x00010001,0x00000000
HKLM,"SOFTWARE\ReactOS\Windows NT\CurrentVersion\Winlogon","Userinit",0x00020000,"%SystemRoot%\system32\userinit.exe"

View file

@ -14,7 +14,7 @@ LsapInitLsa(VOID)
{
HANDLE hEvent;
DPRINT1("LsapInitLsa() called\n");
DPRINT("LsapInitLsa() called\n");
LsarStartRpcServer();

View file

@ -567,7 +567,7 @@ CopyImage(
{
case IMAGE_BITMAP:
{
DbgPrint("WARNING: Incomplete implementation of CopyImage!\n");
DPRINT("WARNING: Incomplete implementation of CopyImage!\n");
/*
* FIXME: Support flags LR_COPYDELETEORG, LR_COPYFROMRESOURCE,
* LR_COPYRETURNORG, LR_CREATEDIBSECTION and LR_MONOCHROME.
@ -596,7 +596,7 @@ CopyImage(
/* FIXME: support loading the image as shared from an instance */
if (!IconMsgDisplayed)
{
DbgPrint("FIXME: CopyImage doesn't support IMAGE_ICON correctly!\n");
DPRINT("FIXME: CopyImage doesn't support IMAGE_ICON correctly!\n");
IconMsgDisplayed = TRUE;
}
return CopyIcon(hnd);
@ -608,7 +608,7 @@ CopyImage(
/* FIXME: support loading the image as shared from an instance */
if (!IconMsgDisplayed)
{
DbgPrint("FIXME: CopyImage doesn't support IMAGE_CURSOR correctly!\n");
DPRINT("FIXME: CopyImage doesn't support IMAGE_CURSOR correctly!\n");
IconMsgDisplayed = TRUE;
}
return CopyCursor(hnd);

View file

@ -62,7 +62,7 @@ static VOID STDCALL I8042MouseInputTestTimeout(PDEVICE_EXTENSION DevExt)
/* Check if the last byte came too long ago */
if (Now.QuadPart - DevExt->MousePacketStartTime.QuadPart >
DevExt->Settings.MouseSynchIn100ns) {
DPRINT1("Mouse input packet timeout\n");
DPRINT("Mouse input packet timeout\n");
DevExt->MouseState = MouseIdle;
}
}

View file

@ -221,7 +221,7 @@ TDI_STATUS InfoNetworkLayerTdiSetEx( UINT InfoClass,
TI_DbgPrint(DEBUG_INFO,("Called\n"));
OskitDumpBuffer( (OSK_PCHAR)Buffer, BufferSize );
//OskitDumpBuffer( (OSK_PCHAR)Buffer, BufferSize );
if( InfoClass == INFO_CLASS_PROTOCOL &&
InfoType == INFO_TYPE_PROVIDER &&

View file

@ -1,4 +1,4 @@
<module name="wshtcpip" type="win32dll" installbase="system32" installname="wshtcpip.dll">
<module name="wshtcpip" type="win32dll" baseaddress="${BASEADDRESS_WSHTCPIP}" installbase="system32" installname="wshtcpip.dll">
<importlibrary definition="wshtcpip.def"></importlibrary>
<include base="wshtcpip">.</include>
<define name="UNICODE" />

View file

@ -223,7 +223,7 @@ VOID HalpCalibrateStallExecution(VOID)
}
DbgPrint("Calibrating delay loop... [");
DPRINT("Calibrating delay loop... [");
/* Stage 1: Coarse calibration */
@ -246,7 +246,7 @@ VOID HalpCalibrateStallExecution(VOID)
Pcr->StallScaleFactor >>= 1; /* Get bottom value for delay */
/* Stage 2: Fine calibration */
DbgPrint("delay_count: %d", Pcr->StallScaleFactor);
DPRINT("delay_count: %d", Pcr->StallScaleFactor);
calib_bit = Pcr->StallScaleFactor; /* Which bit are we going to test */
@ -275,9 +275,9 @@ VOID HalpCalibrateStallExecution(VOID)
Pcr->StallScaleFactor /= (MILLISEC / 2); /* Calculate delay_count for 1ms */
DbgPrint("]\n");
DbgPrint("delay_count: %d\n", Pcr->StallScaleFactor);
DbgPrint("CPU speed: %d\n", Pcr->StallScaleFactor / 250);
DPRINT("]\n");
DPRINT("delay_count: %d\n", Pcr->StallScaleFactor);
DPRINT("CPU speed: %d\n", Pcr->StallScaleFactor / 250);
#if 0
DbgPrint("About to start delay loop test\n");
DbgPrint("Waiting for five minutes...");

View file

@ -44,8 +44,8 @@ RtlpMapFile(PUNICODE_STRING ImageFileName,
DPRINT1("Failed to read image file from disk\n");
return(Status);
}
/* Now create a section for this image */
/* Now create a section for this image */
Status = ZwCreateSection(Section,
SECTION_ALL_ACCESS,
NULL,
@ -75,10 +75,9 @@ RtlpInitEnvironment(HANDLE ProcessHandle,
ULONG EnviroSize;
ULONG Size;
PWCHAR Environment = 0;
DPRINT("RtlpInitEnvironment (hProcess: %p, Peb: %p Params: %p)\n",
ProcessHandle, Peb, ProcessParameters);
/* Give the caller 1MB if he requested it */
if (ProcessParameters->Flags & RTL_USER_PROCESS_PARAMETERS_RESERVE_1MB)
{
@ -97,7 +96,7 @@ RtlpInitEnvironment(HANDLE ProcessHandle,
return(Status);
}
}
/* Find the end of the Enviroment Block */
if ((Environment = (PWCHAR)ProcessParameters->Environment))
{
@ -106,7 +105,6 @@ RtlpInitEnvironment(HANDLE ProcessHandle,
/* Calculate the size of the block */
EnviroSize = (ULONG)((ULONG_PTR)Environment -
(ULONG_PTR)ProcessParameters->Environment);
DPRINT("EnvironmentSize %ld\n", EnviroSize);
/* Allocate and Initialize new Environment Block */
Size = EnviroSize;
@ -121,24 +119,21 @@ RtlpInitEnvironment(HANDLE ProcessHandle,
DPRINT1("Failed to allocate Environment Block\n");
return(Status);
}
/* Write the Environment Block */
ZwWriteVirtualMemory(ProcessHandle,
BaseAddress,
ProcessParameters->Environment,
EnviroSize,
NULL);
/* Save pointer */
ProcessParameters->Environment = BaseAddress;
}
DPRINT("EnvironmentPointer %p\n", BaseAddress);
DPRINT("Ppb->MaximumLength 0x%lx\n", ProcessParameters->MaximumLength);
/* Now allocate space for the Parameter Block */
BaseAddress = NULL;
Size = ProcessParameters->MaximumLength;
Size = ProcessParameters->MaximumLength;
Status = ZwAllocateVirtualMemory(ProcessHandle,
&BaseAddress,
0,
@ -150,14 +145,14 @@ RtlpInitEnvironment(HANDLE ProcessHandle,
DPRINT1("Failed to allocate Parameter Block\n");
return(Status);
}
/* Write the Parameter Block */
ZwWriteVirtualMemory(ProcessHandle,
BaseAddress,
ProcessParameters,
ProcessParameters->Length,
NULL);
/* Write pointer to Parameter Block */
ZwWriteVirtualMemory(ProcessHandle,
&Peb->ProcessParameters,
@ -200,7 +195,6 @@ RtlCreateUserProcess(IN PUNICODE_STRING ImageFileName,
HANDLE hSection;
PROCESS_BASIC_INFORMATION ProcessBasicInfo;
OBJECT_ATTRIBUTES ObjectAttributes;
DPRINT("RtlCreateUserProcess: %wZ\n", ImageFileName);
/* Map and Load the File */
@ -212,10 +206,10 @@ RtlCreateUserProcess(IN PUNICODE_STRING ImageFileName,
DPRINT1("Could not map process image\n");
return Status;
}
/* Clean out the CurDir Handle if we won't use it */
if (!InheritHandles) ProcessParameters->CurrentDirectory.Handle = NULL;
/* Use us as parent if none other specified */
if (!ParentProcess) ParentProcess = NtCurrentProcess();
@ -240,8 +234,7 @@ RtlCreateUserProcess(IN PUNICODE_STRING ImageFileName,
NULL,
ProcessSecurityDescriptor);
}
/* Create Kernel Process Object */
Status = ZwCreateProcess(&ProcessInfo->ProcessHandle,
PROCESS_ALL_ACCESS,
@ -257,7 +250,7 @@ RtlCreateUserProcess(IN PUNICODE_STRING ImageFileName,
ZwClose(hSection);
return(Status);
}
/* Get some information on the image */
Status = ZwQuerySection(hSection,
SectionImageInformation,
@ -284,7 +277,7 @@ RtlCreateUserProcess(IN PUNICODE_STRING ImageFileName,
ZwClose(ProcessInfo->ProcessHandle);
ZwClose(hSection);
return(Status);
}
}
/* Create Process Environment */
RtlpInitEnvironment(ProcessInfo->ProcessHandle,
@ -309,7 +302,7 @@ RtlCreateUserProcess(IN PUNICODE_STRING ImageFileName,
ZwClose(hSection); /* Don't try to optimize this on top! */
return Status;
}
/* Close the Section Handle and return */
ZwClose(hSection);
return STATUS_SUCCESS;

View file

@ -866,17 +866,20 @@ ExDestroyHandleByEntry(IN PHANDLE_TABLE HandleTable,
DPRINT("DestroyHandleByEntry HT:0x%p Entry:0x%p\n", HandleTable, Entry);
KeEnterCriticalRegion();
ExAcquireHandleLockExclusive(HandleTable);
if (!(HandleTable->Flags & EX_HANDLE_TABLE_CLOSING))
{
KeEnterCriticalRegion();
ExAcquireHandleLockExclusive(HandleTable);
/* free and automatically unlock the handle. However we don't need to pulse
the contention event since other locks on this entry will fail */
ExpFreeHandleTableEntry(HandleTable,
Entry,
HANDLE_TO_EX_HANDLE(Handle));
/* free and automatically unlock the handle. However we don't need to pulse
the contention event since other locks on this entry will fail */
ExpFreeHandleTableEntry(HandleTable,
Entry,
HANDLE_TO_EX_HANDLE(Handle));
ExReleaseHandleLock(HandleTable);
KeLeaveCriticalRegion();
ExReleaseHandleLock(HandleTable);
KeLeaveCriticalRegion();
}
}
PHANDLE_TABLE_ENTRY

View file

@ -261,7 +261,6 @@ ExecuteRuntimeAsserts(VOID)
ASSERT(FIELD_OFFSET(KPCR, Tib.ExceptionList) == KPCR_EXCEPTION_LIST);
ASSERT(FIELD_OFFSET(KPCR, Self) == KPCR_SELF);
ASSERT(FIELD_OFFSET(KIPCR, PrcbData) + FIELD_OFFSET(KPRCB, CurrentThread) == KPCR_CURRENT_THREAD);
DPRINT1("NPXThread offset: %lx\n", FIELD_OFFSET(KIPCR, PrcbData) + FIELD_OFFSET(KPRCB, NpxThread));
ASSERT(FIELD_OFFSET(KIPCR, PrcbData) + FIELD_OFFSET(KPRCB, NpxThread) == KPCR_NPX_THREAD);
ASSERT(FIELD_OFFSET(KTSS, Esp0) == KTSS_ESP0);
ASSERT(FIELD_OFFSET(KTSS, IoMapBase) == KTSS_IOMAPBASE);

View file

@ -646,7 +646,7 @@ xHalIoAssignDriveLetters(IN PROS_LOADER_PARAMETER_BLOCK LoaderBlock,
RDiskCount = xHalpGetRDiskCount();
DPRINT1("RDiskCount %d\n", RDiskCount);
DPRINT("RDiskCount %d\n", RDiskCount);
Buffer1 = (PWSTR)ExAllocatePool(PagedPool,
64 * sizeof(WCHAR));

View file

@ -139,9 +139,9 @@ IopCreateFile(PVOID ObjectBody,
{
if (!(DeviceObject->Vpb->Flags & VPB_MOUNTED))
{
DPRINT1("Mount the logical volume\n");
DPRINT("Mount the logical volume\n");
Status = IoMountVolume(DeviceObject, FALSE);
DPRINT1("Status %x\n", Status);
DPRINT("Status %x\n", Status);
}
DeviceObject = DeviceObject->Vpb->DeviceObject;
}

View file

@ -103,6 +103,10 @@ KdpInitDebugLog(PKD_DISPATCH_TABLE DispatchTable,
/* Register as a Provider */
InsertTailList(&KdProviders, &DispatchTable->KdProvidersList);
/* Display separator + ReactOS version at start of the debug log */
DPRINT1("---------------------------------------------------------------\n");
DPRINT1("ReactOS "KERNEL_VERSION_STR" (Build "KERNEL_VERSION_BUILD_STR")\n");
}
else if (BootPhase == 2)
{

View file

@ -287,10 +287,6 @@ _main(ULONG MultiBootMagic,
/* Initialize HAL */
HalInitSystem (0, (PLOADER_PARAMETER_BLOCK)&KeLoaderBlock);
/* Display separator + ReactOS version at start of the debug log */
DPRINT1("---------------------------------------------------------------\n");
DPRINT1("ReactOS "KERNEL_VERSION_STR" (Build "KERNEL_VERSION_BUILD_STR")\n");
/* Do general System Startup */
KiSystemStartup(1);
}

View file

@ -150,7 +150,7 @@ MmAccessFault(KPROCESSOR_MODE Mode,
}
if (PsGetCurrentProcess() == NULL)
{
CPRINT("No current process\n");
DPRINT("No current process\n");
return(STATUS_UNSUCCESSFUL);
}
@ -280,7 +280,7 @@ MmNotPresentFault(KPROCESSOR_MODE Mode,
/* Allow this! It lets us page alloc much earlier! It won't be needed
* after my init patch anyways
*/
CPRINT("No current process\n");
DPRINT("No current process\n");
if (Address < (ULONG_PTR)MmSystemRangeStart)
{
return(STATUS_UNSUCCESSFUL);

View file

@ -384,7 +384,6 @@ MmInit1(ULONG_PTR FirstKrnlPhysAddr,
MmInitGlobalKernelPageDirectory();
DbgPrint("Used memory %dKb\n", (MmStats.NrTotalPages * PAGE_SIZE) / 1024);
DPRINT1("Kernel Stack Limits. InitTop = 0x%x, Init = 0x%x\n", init_stack_top, init_stack);
LastKernelAddress = (ULONG_PTR)MmInitializePageList(
FirstKrnlPhysAddr,

View file

@ -1175,7 +1175,7 @@ UserRegisterClass(IN CONST WNDCLASSEXW* lpwcx,
if (Class != NULL)
{
ClassAlreadyExists:
DPRINT1("Class 0x%p does already exist!\n", ClassAtom);
DPRINT("Class 0x%p does already exist!\n", ClassAtom);
SetLastWin32Error(ERROR_CLASS_ALREADY_EXISTS);
return (RTL_ATOM)0;
}

View file

@ -722,7 +722,7 @@ VOID co_IntShellHookNotify(WPARAM Message, LPARAM lParam)
if (!Desktop)
{
DPRINT1("IntShellHookNotify: No desktop!\n");
DPRINT("IntShellHookNotify: No desktop!\n");
return;
}