Author: hbelusca
Date: Mon Nov 7 15:51:56 2016
New Revision: 73170
URL: http://svn.reactos.org/svn/reactos?rev=73170&view=rev
Log:
[NTOS:IO]: IopCreateDriver(): Set the returned DriverObject value only in case of success.
Modified:
trunk/reactos/ntoskrnl/io/iomgr/driver.c
Modified: trunk/reactos/ntoskrnl/io/iomgr/driver.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/iomgr/driver.c…
==============================================================================
--- trunk/reactos/ntoskrnl/io/iomgr/driver.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/io/iomgr/driver.c [iso-8859-1] Mon Nov 7 15:51:56 2016
@@ -527,12 +527,13 @@
RtlFreeUnicodeString(&RegistryKey);
RtlFreeUnicodeString(&DriverName);
- *DriverObject = Driver;
if (!NT_SUCCESS(Status))
{
DPRINT("IopCreateDriver() failed (Status 0x%08lx)\n", Status);
return Status;
}
+
+ *DriverObject = Driver;
MmFreeDriverInitialization((PLDR_DATA_TABLE_ENTRY)Driver->DriverSection);
@@ -1426,7 +1427,7 @@
&DriverReinitListLock);
while (Entry)
{
- /* Get the item*/
+ /* Get the item */
ReinitItem = CONTAINING_RECORD(Entry, DRIVER_REINIT_ITEM, ItemEntry);
/* Increment reinitialization counter */
@@ -1462,7 +1463,7 @@
&DriverBootReinitListLock);
while (Entry)
{
- /* Get the item*/
+ /* Get the item */
ReinitItem = CONTAINING_RECORD(Entry, DRIVER_REINIT_ITEM, ItemEntry);
/* Increment reinitialization counter */
@@ -1510,7 +1511,7 @@
/* First, create a unique name for the driver if we don't have one */
if (!DriverName)
{
- /* Create a random name and set up the string*/
+ /* Create a random name and set up the string */
NameLength = (USHORT)swprintf(NameBuffer,
DRIVER_ROOT_NAME L"%08u",
KeTickCount.LowPart);
Author: hbelusca
Date: Mon Nov 7 13:57:11 2016
New Revision: 73168
URL: http://svn.reactos.org/svn/reactos?rev=73168&view=rev
Log:
[NTOS:IO]: An improvement for the total log size check (addendum to r73167).
Modified:
trunk/reactos/ntoskrnl/io/iomgr/error.c
Modified: trunk/reactos/ntoskrnl/io/iomgr/error.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/iomgr/error.c?…
==============================================================================
--- trunk/reactos/ntoskrnl/io/iomgr/error.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/io/iomgr/error.c [iso-8859-1] Mon Nov 7 13:57:11 2016
@@ -554,10 +554,6 @@
return NULL;
}
- /* Check if we're past our buffer */
- // FIXME/TODO: Perform the checks by taking into account EntrySize.
- if (IopTotalLogSize > IOP_MAXIMUM_LOG_SIZE) return NULL;
-
/* Check whether the size is too small or too large */
if ((EntrySize < sizeof(IO_ERROR_LOG_PACKET)) ||
(EntrySize > ERROR_LOG_MAXIMUM_SIZE))
@@ -566,11 +562,15 @@
return NULL;
}
- /* Round up the size */
+ /* Round up the size and calculate the total size */
EntrySize = ROUND_UP(EntrySize, sizeof(PVOID));
-
- /* Calculate the total size and allocate it */
LogEntrySize = sizeof(ERROR_LOG_ENTRY) + EntrySize;
+
+ /* Check if we're past our buffer */
+ // TODO: Improve (what happens in case of concurrent calls?)
+ if (IopTotalLogSize + LogEntrySize > IOP_MAXIMUM_LOG_SIZE) return NULL;
+
+ /* Allocate the entry */
LogEntry = ExAllocatePoolWithTag(NonPagedPool,
LogEntrySize,
TAG_ERROR_LOG);
Author: gadamopoulos
Date: Sun Nov 6 23:34:22 2016
New Revision: 73161
URL: http://svn.reactos.org/svn/reactos?rev=73161&view=rev
Log:
[SHELL32]
- CShellLink: Zero the pointer to mDropTarget by releasing the smart pointer instead of just releasing the object. This lead to a crash every time CShellLink::DragLeave was called.
CORE-11956
Modified:
trunk/reactos/dll/win32/shell32/CShellLink.cpp
Modified: trunk/reactos/dll/win32/shell32/CShellLink.cpp
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/CShellLi…
==============================================================================
--- trunk/reactos/dll/win32/shell32/CShellLink.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/CShellLink.cpp [iso-8859-1] Sun Nov 6 23:34:22 2016
@@ -2248,7 +2248,7 @@
if (mDropTarget)
{
hr = mDropTarget->DragLeave();
- mDropTarget->Release();
+ mDropTarget.Release();
}
return hr;