* This avoids going into VirtualProtect changing the page access while code
may potentially be executing these areas of memory (since the module is
hooked, and may have returned to user code)
* Need to find a better way of solving the non-immutable-shader-reflection
given baked in uniform values. Probably expose the uniform values mapping
to the user, and for D3D it just becomes trivial and unchanging.
* Also I need to create separable programs per-shader for use for
reflection in that case, but thanks to the stupid gl_PerVertex
redeclaration that becomes a nightmare.
* This might be a more serious problem in future...
* We only hook all loaded modules once, at init time, in Win32_IAT_EndHooks
* If a LoadLibrary call afterwards implicitly loads some modules we don't
see them. Potentially we should rehook all loaded modules again each time
LoadLibrary is called but then there would be a lot of redundant work
unless we tracked module unload/loads to see if a module has been hooked
before or not. For now assume we don't need to hook these modules and
get away with just updating module handles
* Seen in the wild some HMODULEs come back pointing 2 bytes after the real
module base address, and so without the magic number. I don't know why
but I can't assume anything about the behaviour so I ignore these modules
to avoid crashes.
* A label is shown at the top of the pixel history showing the range
display and visible channels. The channel visibility behaves the same as
in the texture viewer - 2 or more and the other channels display as black
and 1 channel displays grayscale.
* It's a little messier as it's easier for the os-specific header to not
define it and get confusing errors, but that's a one-time problem and
having an extra function in a callstack and not showing source at the
point of the RDCBREAK is annoying every time.
* On x64 windows IsWow64 returns true for 32bit programs, but on x86
windows there is no such thing as Wow64 so it returns false. Detect this
by checking our own processes Wow64 nature (which should always return
true if Wow64 is a thing).