Commit 1e7b56b
committed
Guard the page-protection scan workaround to Windows only
Per @ds5678's review on #267: VirtualProtect/VirtualQuery are kernel32 (Windows-only)
and PAGE_NOACCESS is a Windows page state. Run the make-readable / restore dance only
when OperatingSystem.IsWindows(); on other platforms fall back to the direct
FindSignatureInBlock scan (its prior behaviour), so the kernel32 P/Invokes are never
called off-Windows. Also satisfies the CA1416 platform-compatibility analyzer.1 parent a3c8137 commit 1e7b56b
1 file changed
Lines changed: 11 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
29 | | - | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
30 | 37 | | |
31 | 38 | | |
32 | 39 | | |
| |||
40 | 47 | | |
41 | 48 | | |
42 | 49 | | |
43 | | - | |
| 50 | + | |
| 51 | + | |
44 | 52 | | |
45 | 53 | | |
46 | 54 | | |
| |||
0 commit comments