Skip to content

Commit 303ab78

Browse files
committed
Add MmpTlsFiber
2 parents c7839ea + 826747e commit 303ab78

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

MemoryModule/MmpTls.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,6 @@ HookRtlUserThreadStart(
274274

275275
VOID NTAPI HookLdrShutdownThread(VOID) {
276276

277-
PLIST_ENTRY entry;
278277
PMMP_TLSP_RECORD record = nullptr;
279278

280279
//

MemoryModule/MmpTlsFiber.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,10 @@ CRITICAL_SECTION MmpPostponedTlsLock;
2020
DWORD WINAPI MmpReleasePostponedTlsWorker(PVOID) {
2121

2222
DWORD code;
23+
DWORD waitTime = INFINITE;
2324

2425
while (true) {
25-
WaitForSingleObject(MmpPostponedTlsEvent, INFINITE);
26+
WaitForSingleObject(MmpPostponedTlsEvent, waitTime);
2627

2728
EnterCriticalSection(&MmpPostponedTlsLock);
2829

@@ -61,6 +62,8 @@ DWORD WINAPI MmpReleasePostponedTlsWorker(PVOID) {
6162

6263
}
6364

65+
waitTime = MmpPostponedTlsList.empty() ? INFINITE : 1000;
66+
6467
LeaveCriticalSection(&MmpPostponedTlsLock);
6568
}
6669

0 commit comments

Comments
 (0)