File tree Expand file tree Collapse file tree
BepInEx.IL2CPP/Hook/Allocator Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22using System . ComponentModel ;
33using System . Runtime . CompilerServices ;
44using System . Runtime . InteropServices ;
5+ using BepInEx . Logging ;
56
67namespace BepInEx . IL2CPP . Hook . Allocator ;
78
@@ -26,7 +27,11 @@ protected override nint AllocateChunk(nint hint)
2627 {
2728 var mbi = new WinApi . MEMORY_BASIC_INFORMATION ( ) ;
2829 if ( WinApi . VirtualQuery ( hint , ref mbi , Marshal . SizeOf < WinApi . MEMORY_BASIC_INFORMATION > ( ) ) == 0 )
29- throw Win32Error ( $ "Failed to query memory information of 0x{ ( long ) hint : X9} ") ;
30+ {
31+ Logger . Log ( LogLevel . Debug ,
32+ $ "Skipping analysing 0x{ ( long ) hint : X8} because VirtualQuery failed: { Win32Error ( ) } ") ;
33+ goto next ;
34+ }
3035
3136 if ( mbi . State == WinApi . PageState . MEM_FREE )
3237 {
@@ -39,6 +44,7 @@ protected override nint AllocateChunk(nint hint)
3944 }
4045 }
4146
47+ next :
4248 hint = mbi . BaseAddress + mbi . RegionSize ;
4349 }
4450
You can’t perform that action at this time.
0 commit comments