Dan Kegel dank@kegel.com writes:
@@ -1261,6 +1297,8 @@ HANDLE WINAPI RtlCreateHeap( ULONG flags, PVOID addr, SIZE_T totalSize, SIZE_T c totalSize = HEAP_DEF_SIZE; flags |= HEAP_GROWABLE; }
- if (NtCurrentTeb() && NtCurrentTeb()->Peb && (NtCurrentTeb()->Peb->NtGlobalFlag & FLG_HEAP_ENABLE_FREE_CHECK))
flags |= HEAP_FREE_CHECKING_ENABLED;
This can't work, you can't use NtCurrentTeb before the TEB is properly initialized.