[NTOS:EX] Initialize ExpResourceTimeoutCount also via the "Session Manager/ResourceTimeoutCount" registry value (#4089)

For more details, see
http://systemmanager.ru/win2k_regestry.en/29859.htm
https://www.betaarchive.com/wiki/index.php/Microsoft_KB_Archive/102985#ResourceTimeoutCount_REG_DWORD
This commit is contained in:
Hermès Bélusca-Maïto
2023-09-21 13:33:28 +02:00
parent 56417bfb93
commit 4bdfee8e8b
3 changed files with 12 additions and 6 deletions
+1 -1
View File
@@ -561,7 +561,7 @@ DATA_SEG("INITDATA") CM_SYSTEM_CONTROL_VECTOR CmControlVector[] =
{
L"Session Manager",
L"ResourceTimeoutCount",
&DummyData,
&ExpResourceTimeoutCount,
NULL,
NULL
},
+10 -5
View File
@@ -18,7 +18,7 @@
#define IsOwnedExclusive(r) (r->Flag & ResourceOwnedExclusive)
#define IsBoostAllowed(r) (!(r->Flag & ResourceHasDisabledPriorityBoost))
#if (!(defined(CONFIG_SMP)) && !(DBG))
#if !defined(CONFIG_SMP) && !DBG
FORCEINLINE
VOID
@@ -65,13 +65,17 @@ ExReleaseResourceLock(IN PERESOURCE Resource,
/* Release the lock */
KeReleaseInStackQueuedSpinLock(LockHandle);
}
#endif
#endif // !defined(CONFIG_SMP) && !DBG
/* DATA***********************************************************************/
LARGE_INTEGER ExShortTime = {{-100000, -1}};
LARGE_INTEGER ExpTimeout;
ULONG ExpResourceTimeoutCount = 90 * 3600 / 2;
/* Timeout value for resources in 4-second units (7 days) */
ULONG ExpResourceTimeoutCount = 90 * 3600 / 2; // NT value: 648000 (30 days)
KSPIN_LOCK ExpResourceSpinLock;
LIST_ENTRY ExpSystemResourcesList;
BOOLEAN ExResourceStrict = TRUE;
@@ -631,7 +635,7 @@ ExpWaitForResource(IN PERESOURCE Resource,
/* Increase contention count and use a 5 second timeout */
Resource->ContentionCount++;
Timeout.QuadPart = 500 * -10000;
Timeout.QuadPart = 500 * -10000LL;
for (;;)
{
/* Wait for ownership */
@@ -640,7 +644,8 @@ ExpWaitForResource(IN PERESOURCE Resource,
KernelMode,
FALSE,
&Timeout);
if (Status != STATUS_TIMEOUT) break;
if (Status != STATUS_TIMEOUT)
break;
/* Increase wait count */
WaitCount++;
+1
View File
@@ -19,6 +19,7 @@ extern ERESOURCE ExpFirmwareTableResource;
extern ERESOURCE ExpTimeRefreshLock;
extern LIST_ENTRY ExpFirmwareTableProviderListHead;
extern BOOLEAN ExpIsWinPEMode;
extern ULONG ExpResourceTimeoutCount;
extern LIST_ENTRY ExpSystemResourcesList;
extern ULONG ExpAnsiCodePageDataOffset, ExpOemCodePageDataOffset;
extern ULONG ExpUnicodeCaseTableDataOffset;