https://git.reactos.org/?p=reactos.git;a=commitdiff;h=9b89cd1ef2e56f682d6d0…
commit 9b89cd1ef2e56f682d6d0f4c713fa55602bf701b
Author: David Quintana <gigaherz(a)gmail.com>
AuthorDate: Wed Jan 31 18:12:57 2018 +0100
Commit: GitHub <noreply(a)github.com>
CommitDate: Wed Jan 31 18:12:57 2018 +0100
[NTOSKRNL] Fix CcIdleDelay initializer for old msvc versions (#339)
[NTOSKRNL] Fix initialization of CcIdleDelay for msvc builds (fixes boot).
* Introduce a macro to initialize LARGE_INTEGERs in a consistent way.
---
ntoskrnl/cc/view.c | 6 +-----
sdk/include/ndk/rtltypes.h | 12 ++++++++++++
2 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/ntoskrnl/cc/view.c b/ntoskrnl/cc/view.c
index 2520cab53d..003c5d81de 100644
--- a/ntoskrnl/cc/view.c
+++ b/ntoskrnl/cc/view.c
@@ -71,11 +71,7 @@ ULONG CcTotalDirtyPages = 0;
LIST_ENTRY CcDeferredWrites;
KSPIN_LOCK CcDeferredWriteSpinLock;
LIST_ENTRY CcCleanSharedCacheMapList;
-#ifndef _MSC_VER
-LARGE_INTEGER CcIdleDelay = {.QuadPart = (LONGLONG)-1*1000*1000*10};
-#else
-LARGE_INTEGER CcIdleDelay = {(LONGLONG)-1*1000*1000*10};
-#endif
+LARGE_INTEGER CcIdleDelay = RTL_CONSTANT_LARGE_INTEGER((LONGLONG)-1*1000*1000*10);
/* Internal vars (ROS):
* - Event to notify lazy writer to shutdown
diff --git a/sdk/include/ndk/rtltypes.h b/sdk/include/ndk/rtltypes.h
index 0ee0eb3d86..0abde3e0c0 100644
--- a/sdk/include/ndk/rtltypes.h
+++ b/sdk/include/ndk/rtltypes.h
@@ -403,6 +403,18 @@ extern BOOLEAN NTSYSAPI NLS_MB_OEM_CODE_PAGE_TAG;
#endif /* NTOS_MODE_USER */
+//
+// Constant Large Integer Macro
+//
+#ifdef NONAMELESSUNION
+C_ASSERT(FIELD_OFFSET(LARGE_INTEGER, u.LowPart) == 0);
+#else
+C_ASSERT(FIELD_OFFSET(LARGE_INTEGER, LowPart) == 0);
+#endif
+#define RTL_CONSTANT_LARGE_INTEGER(quad_part) { { (quad_part), (quad_part)>>32 } }
+#define RTL_MAKE_LARGE_INTEGER(low_part, high_part) { { (low_part), (high_part) } }
+
+
#ifdef NTOS_MODE_USER
//