memlib
memlib copied to clipboard
Fix LdrLoadDll signature, support GetModuleHandleExW, EnumProcessModules
This was required to make the hooks work for me without crashing in some situations.
ReactOS has the type as PULONG
https://doxygen.reactos.org/d7/d55/ldrapi_8c.html#a7671bda932dbb5096570f431ff83474c
I also checked LoadLibraryExW
(which is the implementation for all LoadLibrary*
s) and when it calls LdrLoadDll
it puts a reference into rdx
.
(Although I have no idea why rcx (SearchPath) is ORed with
0x1
...)
ntinternals and wine seem to say Flags
is a ULONG. In wine, they just pass Flags
from LoadLibrary*
directly to LdrLoadDll
rather than referencing.