Author: tfaber
Date: Fri May 19 19:11:14 2017
New Revision: 74600
URL: http://svn.reactos.org/svn/reactos?rev=74600&view=rev
Log:
[NTDLL:LDR]
- Fix logic error in LdrpInit that caused us to busy-wait instead of sleep. This makes LibreOffice start up in a few seconds instead of sitting around at 100% CPU for a minute or two.
CORE-13268 #resolve
Modified:
trunk/reactos/dll/ntdll/ldr/ldrinit.c
Modified: trunk/reactos/dll/ntdll/ldr/ldrinit.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/ntdll/ldr/ldrinit.c?re…
==============================================================================
--- trunk/reactos/dll/ntdll/ldr/ldrinit.c [iso-8859-1] (original)
+++ trunk/reactos/dll/ntdll/ldr/ldrinit.c [iso-8859-1] Fri May 19 19:11:14 2017
@@ -2223,11 +2223,11 @@
1,
0) == 1)
{
- /* Set the timeout to 30 seconds */
+ /* Set the timeout to 30 milliseconds */
Timeout.QuadPart = Int32x32To64(30, -10000);
/* Make sure the status hasn't changed */
- while (!LdrpProcessInitialized)
+ while (LdrpProcessInitialized == 1)
{
/* Do the wait */
ZwDelayExecution(FALSE, &Timeout);
Author: tfaber
Date: Fri May 19 18:22:46 2017
New Revision: 74599
URL: http://svn.reactos.org/svn/reactos?rev=74599&view=rev
Log:
[RTL]
- Do not change RTL_HANDLE_TABLE::CommittedHandles when committing a new page of handle entries. This value must always point to the beginning of the allocation, to correctly track the entire committed range. Fixes LibreOffice Writer (and ntdll_apitest) crash.
CORE-13271 #resolve
Modified:
trunk/reactos/sdk/lib/rtl/handle.c
Modified: trunk/reactos/sdk/lib/rtl/handle.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/lib/rtl/handle.c?rev=7…
==============================================================================
--- trunk/reactos/sdk/lib/rtl/handle.c [iso-8859-1] (original)
+++ trunk/reactos/sdk/lib/rtl/handle.c [iso-8859-1] Fri May 19 18:22:46 2017
@@ -89,6 +89,7 @@
return NULL;
/* Update handle array pointers */
+ HandleTable->CommittedHandles = (PRTL_HANDLE_TABLE_ENTRY)ArrayPointer;
HandleTable->UnCommittedHandles = (PRTL_HANDLE_TABLE_ENTRY)ArrayPointer;
HandleTable->MaxReservedHandles = (PRTL_HANDLE_TABLE_ENTRY)((ULONG_PTR)ArrayPointer + ArraySize);
}
@@ -107,7 +108,6 @@
/* Update handle array pointers */
HandleTable->FreeHandles = (PRTL_HANDLE_TABLE_ENTRY)ArrayPointer;
- HandleTable->CommittedHandles = (PRTL_HANDLE_TABLE_ENTRY)ArrayPointer;
HandleTable->UnCommittedHandles = (PRTL_HANDLE_TABLE_ENTRY)((ULONG_PTR)ArrayPointer + ArraySize);
/* Calculate the number of entries we can store in the array */
Author: hbelusca
Date: Fri May 19 16:14:10 2017
New Revision: 74597
URL: http://svn.reactos.org/svn/reactos?rev=74597&view=rev
Log:
[SCSIPORT]: Fixes:
- In SpiScanAdapter(), after an SCSI INQUIRY command has succeeded and we are setting up a LUN extension structure,
cache in its InquiryData member the inquiry data retrieved from the INQUIRY command (alternatively we might just cache
a pointer to a valid "LunInfo" since the latter are also cached elsewhere).
- This allows SpiBuildDeviceMap(), which is called just after SpiScanAdapter(), to correctly report in the registry SCSI tree
the correct Identifier and DeviceType values for the enumerated logical units.
- Use ExFreePoolWithTag in SpiScanAdapter().
Modified:
trunk/reactos/drivers/storage/scsiport/scsiport.c
Modified: trunk/reactos/drivers/storage/scsiport/scsiport.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/scsiport/s…
==============================================================================
--- trunk/reactos/drivers/storage/scsiport/scsiport.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/storage/scsiport/scsiport.c [iso-8859-1] Fri May 19 16:14:10 2017
@@ -101,7 +101,7 @@
IN OUT PSCSI_LUN_INFO LunInfo);
static VOID
-SpiScanAdapter (IN PSCSI_PORT_DEVICE_EXTENSION DeviceExtension);
+SpiScanAdapter(IN PSCSI_PORT_DEVICE_EXTENSION DeviceExtension);
static NTSTATUS
SpiGetInquiryData (IN PSCSI_PORT_DEVICE_EXTENSION DeviceExtension,
@@ -3911,6 +3911,14 @@
DPRINT("SpiScanAdapter(): Found device of type %d at bus %d tid %d lun %d\n",
InquiryData->DeviceType, Bus, Target, Lun);
+ /*
+ * Cache the inquiry data into the LUN extension (or alternatively
+ * we could save a pointer to LunInfo within the LunExtension?)
+ */
+ RtlCopyMemory(&LunExtension->InquiryData,
+ InquiryData,
+ INQUIRYDATABUFFERSIZE);
+
/* Add this info to the linked list */
LunInfo->Next = NULL;
if (LastLunInfo)
@@ -3956,10 +3964,10 @@
/* Free allocated buffers */
if (LunExtension)
- ExFreePool(LunExtension);
+ ExFreePoolWithTag(LunExtension, TAG_SCSIPORT);
if (LunInfo)
- ExFreePool(LunInfo);
+ ExFreePoolWithTag(LunInfo, TAG_SCSIPORT);
/* Sum what we found */
BusScanInfo->LogicalUnitsCount += (UCHAR)DevicesFound;