File tree 1 file changed +7
-1
lines changed
BepInEx.IL2CPP/Hook/Allocator
1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 2
2
using System . ComponentModel ;
3
3
using System . Runtime . CompilerServices ;
4
4
using System . Runtime . InteropServices ;
5
+ using BepInEx . Logging ;
5
6
6
7
namespace BepInEx . IL2CPP . Hook . Allocator ;
7
8
@@ -26,7 +27,11 @@ protected override nint AllocateChunk(nint hint)
26
27
{
27
28
var mbi = new WinApi . MEMORY_BASIC_INFORMATION ( ) ;
28
29
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
+ }
30
35
31
36
if ( mbi . State == WinApi . PageState . MEM_FREE )
32
37
{
@@ -39,6 +44,7 @@ protected override nint AllocateChunk(nint hint)
39
44
}
40
45
}
41
46
47
+ next :
42
48
hint = mbi . BaseAddress + mbi . RegionSize ;
43
49
}
44
50
You can’t perform that action at this time.
0 commit comments