Author: hbelusca
Date: Mon Jun 19 19:50:49 2017
New Revision: 75138
URL: http://svn.reactos.org/svn/reactos?rev=75138&view=rev
Log:
[NTDLL_APITEST]: Temporarily disable part of the NtLoad/UnloadKey test (related to force-unload a hive while some handles to subkeys are still opened), because this creates memory corruptions, due to the fact we currently don't perform force-unloads correctly.
CORE-13448
Modified:
trunk/rostests/apitests/ntdll/NtLoadUnloadKey.c
Modified: trunk/rostests/apitests/ntdll/NtLoadUnloadKey.c
URL: http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/ntdll/NtLoadUnlo…
==============================================================================
--- trunk/rostests/apitests/ntdll/NtLoadUnloadKey.c [iso-8859-1] (original)
+++ trunk/rostests/apitests/ntdll/NtLoadUnloadKey.c [iso-8859-1] Mon Jun 19 19:50:49 2017
@@ -524,6 +524,8 @@
Status = NtFlushKey(KeyHandle);
ok_ntstatus(Status, STATUS_SUCCESS);
+#if 0 // Currently, leads to memory corruption !!!!!
+
/* Force-unmount the hive, with the handle key still opened */
Status = DisconnectRegistry(NULL, RegistryHives[0].RegMountPoint, REG_FORCE_UNLOAD);
DPRINT1("Force-unmounting '%S' %s\n", RegistryHives[0].RegMountPoint, NT_SUCCESS(Status) ? "succeeded" : "failed");
@@ -536,6 +538,8 @@
{
ok_ntstatus(Status, STATUS_KEY_DELETED);
}
+
+#endif
/* The key handle should not be valid anymore */
Status = NtDeleteKey(KeyHandle);
Author: hbelusca
Date: Mon Jun 19 16:47:45 2017
New Revision: 75136
URL: http://svn.reactos.org/svn/reactos?rev=75136&view=rev
Log:
[NTOS]: Fix the ObpLookupObjectName() prototype in regard to r75133.
Modified:
trunk/reactos/ntoskrnl/include/internal/ob.h
trunk/reactos/ntoskrnl/ob/obname.c
Modified: trunk/reactos/ntoskrnl/include/internal/ob.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
==============================================================================
--- trunk/reactos/ntoskrnl/include/internal/ob.h [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/include/internal/ob.h [iso-8859-1] Mon Jun 19 16:47:45 2017
@@ -268,16 +268,16 @@
NTSTATUS
NTAPI
ObpLookupObjectName(
- IN HANDLE RootHandle,
- IN PUNICODE_STRING ObjectName,
+ IN HANDLE RootHandle OPTIONAL,
+ IN OUT PUNICODE_STRING ObjectName,
IN ULONG Attributes,
IN POBJECT_TYPE ObjectType,
IN KPROCESSOR_MODE AccessMode,
IN OUT PVOID ParseContext,
- IN PSECURITY_QUALITY_OF_SERVICE SecurityQos,
- IN PVOID InsertObject,
- IN PACCESS_STATE AccessState,
- IN POBP_LOOKUP_CONTEXT LookupContext,
+ IN PSECURITY_QUALITY_OF_SERVICE SecurityQos OPTIONAL,
+ IN PVOID InsertObject OPTIONAL,
+ IN OUT PACCESS_STATE AccessState,
+ OUT POBP_LOOKUP_CONTEXT LookupContext,
OUT PVOID *FoundObject
);
Modified: trunk/reactos/ntoskrnl/ob/obname.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ob/obname.c?rev=7…
==============================================================================
--- trunk/reactos/ntoskrnl/ob/obname.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ob/obname.c [iso-8859-1] Mon Jun 19 16:47:45 2017
@@ -356,7 +356,7 @@
NTSTATUS
NTAPI
ObpLookupObjectName(IN HANDLE RootHandle OPTIONAL,
- IN PUNICODE_STRING ObjectName,
+ IN OUT PUNICODE_STRING ObjectName,
IN ULONG Attributes,
IN POBJECT_TYPE ObjectType,
IN KPROCESSOR_MODE AccessMode,
Author: hbelusca
Date: Mon Jun 19 16:29:44 2017
New Revision: 75133
URL: http://svn.reactos.org/svn/reactos?rev=75133&view=rev
Log:
[NTOS]: Revert the pool tag change from r75128, and explain in comment why we cannot actually use it.
Modified:
trunk/reactos/ntoskrnl/ob/oblife.c
Modified: trunk/reactos/ntoskrnl/ob/oblife.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ob/oblife.c?rev=7…
==============================================================================
--- trunk/reactos/ntoskrnl/ob/oblife.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ob/oblife.c [iso-8859-1] Mon Jun 19 16:29:44 2017
@@ -351,8 +351,19 @@
/* We know this is a pool-allocation if the size doesn't match */
if (Name->MaximumLength != OBP_NAME_LOOKASIDE_MAX_SIZE)
{
- /* Free it from the pool */
- ExFreePoolWithTag(Buffer, OB_NAME_TAG);
+ /*
+ * Free it from the pool.
+ *
+ * We cannot use here ExFreePoolWithTag(..., OB_NAME_TAG); , because
+ * the object name may have been massaged during operation by different
+ * object parse routines. If the latter ones have to resolve a symbolic
+ * link (e.g. as is done by CmpParseKey() and CmpGetSymbolicLink()),
+ * the original object name is freed and re-allocated from the pool,
+ * possibly with a different pool tag. At the end of the day, the new
+ * object name can be reallocated and completely different, but we
+ * should still be able to free it!
+ */
+ ExFreePool(Buffer);
}
else
{