[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.
This commit is contained in:
David Quintana 2018-01-31 18:12:57 +01:00 committed by GitHub
parent 862b82f3fa
commit 9b89cd1ef2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 5 deletions

View File

@ -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

View File

@ -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
//