https://git.reactos.org/?p=reactos.git;a=commitdiff;h=a5e89014dc943b2cbddb1…
commit a5e89014dc943b2cbddb16fc4d92e13b7e5068e1
Author: Pierre Schweitzer <pierre(a)reactos.org>
AuthorDate: Mon Feb 12 20:45:12 2018 +0100
Commit: Pierre Schweitzer <pierre(a)reactos.org>
CommitDate: Mon Feb 12 20:47:32 2018 +0100
[CDFS_NEW] Fix a bug in Microsoft CDFS implementation where the top level IRP
is set before locking is actually attempted for Cc worker thread (lazy write/read ahead).
So in case locking fails, the top level IRP is set and never unset, and latter
call will hit the assert where it expects the top level IRP to be NULL.
Should be reported upstream (tm).
CORE-14315
---
drivers/filesystems/cdfs_new/resrcsup.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/drivers/filesystems/cdfs_new/resrcsup.c b/drivers/filesystems/cdfs_new/resrcsup.c
index c9eaa7be26..3bb38bb529 100755
--- a/drivers/filesystems/cdfs_new/resrcsup.c
+++ b/drivers/filesystems/cdfs_new/resrcsup.c
@@ -164,10 +164,20 @@ Return Value:
{
PAGED_CODE();
+#ifdef __REACTOS__
+ if (!ExAcquireResourceSharedLite( Fcb->Resource, Wait )) {
+ return FALSE;
+ }
+#endif
+
NT_ASSERT(IoGetTopLevelIrp() == NULL);
IoSetTopLevelIrp((PIRP)FSRTL_CACHE_TOP_LEVEL_IRP);
+#ifndef __REACTOS__
return ExAcquireResourceSharedLite( Fcb->Resource, Wait );
+#else
+ return TRUE;
+#endif
}
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=abdde0b764540617fd99e…
commit abdde0b764540617fd99ef397287421a3ace1dfc
Author: Bișoc George <fraizeraust99(a)gmail.com>
AuthorDate: Sun Feb 11 22:56:38 2018 +0100
Commit: Hermès BÉLUSCA - MAÏTO <hermes.belusca-maito(a)reactos.org>
CommitDate: Sun Feb 11 22:56:38 2018 +0100
[EXPLORER] WatchList should be freed with delete[], not delete (#374)
WatchList is a set of array objects, initialized with "new[]", so it should be freed with "delete[]" to free all of its elements. Otherwise using only "delete" only frees the first variable but not its array. This would lead to an undefined behaviour.
---
base/shell/explorer/syspager.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/base/shell/explorer/syspager.cpp b/base/shell/explorer/syspager.cpp
index 0fa8eae4e3..a1982e7881 100644
--- a/base/shell/explorer/syspager.cpp
+++ b/base/shell/explorer/syspager.cpp
@@ -413,7 +413,7 @@ UINT WINAPI CIconWatcher::WatcherThread(_In_opt_ LPVOID lpParam)
ASSERT(Size <= MAXIMUM_WAIT_OBJECTS);
if (WatchList)
- delete WatchList;
+ delete[] WatchList;
WatchList = new HANDLE[Size];
WatchList[0] = This->m_WakeUpEvent;
@@ -479,7 +479,7 @@ UINT WINAPI CIconWatcher::WatcherThread(_In_opt_ LPVOID lpParam)
}
if (WatchList)
- delete WatchList;
+ delete[] WatchList;
return 0;
}
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=075d58cc647b44ab849d5…
commit 075d58cc647b44ab849d512d9703f3d1d55f5793
Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
AuthorDate: Sun Feb 11 18:08:39 2018 +0100
Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
CommitDate: Sun Feb 11 18:10:08 2018 +0100
[CONUTILS] Relax the enforcement of using FORMAT_MESSAGE_MAX_WIDTH_MASK in the ConMsg* and ConResMsg* functions.
---
sdk/lib/conutils/outstream.c | 55 ++++++++++++++++----------------------------
1 file changed, 20 insertions(+), 35 deletions(-)
diff --git a/sdk/lib/conutils/outstream.c b/sdk/lib/conutils/outstream.c
index 580269cf1e..a36a5ddaa2 100644
--- a/sdk/lib/conutils/outstream.c
+++ b/sdk/lib/conutils/outstream.c
@@ -331,7 +331,7 @@ ConWrite(
#define CON_STREAM_WRITE_CALL(Stream, Str, Len) \
- (Stream)->WriteFunc((Stream), (Str), (Len));
+ (Stream)->WriteFunc((Stream), (Str), (Len))
/* Lock the stream only in non-USE_CRT mode (otherwise use the CRT stream lock) */
#ifndef USE_CRT
@@ -358,9 +358,7 @@ do { \
} while(0)
#define CON_STREAM_WRITE(Stream, Str, Len) \
-do { \
- CON_STREAM_WRITE_CALL((Stream), (Str), (Len)); \
-} while(0)
+ CON_STREAM_WRITE_CALL((Stream), (Str), (Len))
#endif
@@ -797,8 +795,8 @@ ConResPrintf(
* The formatting options, and how to interpret the @p lpSource parameter.
* See FormatMessage() for more details. The @b FORMAT_MESSAGE_ALLOCATE_BUFFER
* and @b FORMAT_MESSAGE_ARGUMENT_ARRAY flags are always ignored.
- * The function implicitly uses the @b FORMAT_MESSAGE_IGNORE_INSERTS and
- * @b FORMAT_MESSAGE_MAX_WIDTH_MASK flags to implement its behaviour.
+ * The function implicitly uses the @b FORMAT_MESSAGE_IGNORE_INSERTS flag
+ * to implement its behaviour.
*
* @param[in] lpSource
* The location of the message definition. The type of this parameter
@@ -841,8 +839,6 @@ ConMsgPuts(
dwFlags |= FORMAT_MESSAGE_IGNORE_INSERTS; // Ignore inserts for FormatMessage.
dwFlags &= ~FORMAT_MESSAGE_ARGUMENT_ARRAY;
- dwFlags |= FORMAT_MESSAGE_MAX_WIDTH_MASK;
-
/*
* Retrieve the message string without appending extra newlines.
* Wrap in SEH to protect from invalid string parameters.
@@ -916,8 +912,6 @@ ConMsgPrintf2V(
dwFlags |= FORMAT_MESSAGE_IGNORE_INSERTS; // Ignore inserts for FormatMessage.
dwFlags &= ~FORMAT_MESSAGE_ARGUMENT_ARRAY;
- dwFlags |= FORMAT_MESSAGE_MAX_WIDTH_MASK;
-
/*
* Retrieve the message string without appending extra newlines.
* Wrap in SEH to protect from invalid string parameters.
@@ -976,9 +970,8 @@ ConMsgPrintf2V(
*
* @param[in] dwFlags
* The formatting options, and how to interpret the @p lpSource parameter.
- * See FormatMessage() for more details. The @b FORMAT_MESSAGE_ALLOCATE_BUFFER
- * flags is always ignored. The function implicitly uses the
- * @b FORMAT_MESSAGE_MAX_WIDTH_MASK flag to implement its behaviour.
+ * See FormatMessage() for more details.
+ * The @b FORMAT_MESSAGE_ALLOCATE_BUFFER flag is always ignored.
*
* @param[in] lpSource
* The location of the message definition. The type of this parameter
@@ -1034,10 +1027,6 @@ ConMsgPrintfV(
/* Sanitize dwFlags */
dwFlags |= FORMAT_MESSAGE_ALLOCATE_BUFFER; // Always allocate an internal buffer.
- //
- // NOTE: Technique taken from eventvwr.c!GetMessageStringFromDll()
- //
- dwFlags |= FORMAT_MESSAGE_MAX_WIDTH_MASK;
/*
* Retrieve the message string without appending extra newlines.
@@ -1091,8 +1080,6 @@ ConMsgPrintfV(
* The formatting options, and how to interpret the @p lpSource parameter.
* See FormatMessage() for more details. The @b FORMAT_MESSAGE_ALLOCATE_BUFFER
* and @b FORMAT_MESSAGE_ARGUMENT_ARRAY flags are always ignored.
- * The function implicitly uses the @b FORMAT_MESSAGE_MAX_WIDTH_MASK flag
- * to implement its behaviour.
*
* @param[in] lpSource
* The location of the message definition. The type of this parameter
@@ -1170,9 +1157,10 @@ ConMsgPrintf(
*
* @param[in] dwFlags
* The formatting options, see FormatMessage() for more details.
- * The only valid flags are @b FORMAT_MESSAGE_ARGUMENT_ARRAY and
- * @b FORMAT_MESSAGE_IGNORE_INSERTS. All the other flags are internally
- * overridden by the function to implement its behaviour.
+ * The only valid flags are @b FORMAT_MESSAGE_ARGUMENT_ARRAY,
+ * @b FORMAT_MESSAGE_IGNORE_INSERTS and @b FORMAT_MESSAGE_MAX_WIDTH_MASK.
+ * All the other flags are internally overridden by the function
+ * to implement its behaviour.
*
* @param[in] uID
* The identifier of the message string. The format string follows the
@@ -1234,10 +1222,6 @@ ConResMsgPrintfExV(
/* Sanitize dwFlags */
dwFlags |= FORMAT_MESSAGE_ALLOCATE_BUFFER; // Always allocate an internal buffer.
- //
- // NOTE: Technique taken from eventvwr.c!GetMessageStringFromDll()
- //
- dwFlags |= FORMAT_MESSAGE_MAX_WIDTH_MASK;
/* The string has already been manually loaded */
dwFlags &= ~(FORMAT_MESSAGE_FROM_HMODULE | FORMAT_MESSAGE_FROM_SYSTEM);
@@ -1291,9 +1275,10 @@ ConResMsgPrintfExV(
*
* @param[in] dwFlags
* The formatting options, see FormatMessage() for more details.
- * The only valid flags are @b FORMAT_MESSAGE_ARGUMENT_ARRAY and
- * @b FORMAT_MESSAGE_IGNORE_INSERTS. All the other flags are internally
- * overridden by the function to implement its behaviour.
+ * The only valid flags are @b FORMAT_MESSAGE_ARGUMENT_ARRAY,
+ * @b FORMAT_MESSAGE_IGNORE_INSERTS and @b FORMAT_MESSAGE_MAX_WIDTH_MASK.
+ * All the other flags are internally overridden by the function
+ * to implement its behaviour.
*
* @param[in] uID
* The identifier of the message string. The format string follows the
@@ -1357,9 +1342,9 @@ ConResMsgPrintfV(
*
* @param[in] dwFlags
* The formatting options, see FormatMessage() for more details.
- * The only valid flag is @b FORMAT_MESSAGE_IGNORE_INSERTS.
- * All the other flags are internally overridden by the function
- * to implement its behaviour.
+ * The only valid flags are @b FORMAT_MESSAGE_IGNORE_INSERTS and
+ * @b FORMAT_MESSAGE_MAX_WIDTH_MASK. All the other flags are internally
+ * overridden by the function to implement its behaviour.
*
* @param[in] uID
* The identifier of the message string. The format string follows the
@@ -1431,9 +1416,9 @@ ConResMsgPrintfEx(
*
* @param[in] dwFlags
* The formatting options, see FormatMessage() for more details.
- * The only valid flag is @b FORMAT_MESSAGE_IGNORE_INSERTS.
- * All the other flags are internally overridden by the function
- * to implement its behaviour.
+ * The only valid flags are @b FORMAT_MESSAGE_IGNORE_INSERTS and
+ * @b FORMAT_MESSAGE_MAX_WIDTH_MASK. All the other flags are internally
+ * overridden by the function to implement its behaviour.
*
* @param[in] uID
* The identifier of the message string. The format string follows the