Does ahk automatically load ntdll.dll? Topic is solved

Get help with using AutoHotkey and its commands and hotkeys
pneumatic
Posts: 299
Joined: 05 Dec 2016, 01:51

Does ahk automatically load ntdll.dll?

21 Nov 2019, 07:46

https://www.autohotkey.com/docs/commands/DllCall.htm wrote: DllFile may be omitted when calling a function that resides in User32.dll, Kernel32.dll, ComCtl32.dll, or Gdi32.dll.
For example, "User32\IsWindowVisible" produces the same result as "IsWindowVisible".

However it seems I can call functions inside ntdll.dll, without having to specify ntdll.dll, which isn't in the aforementioned list.

eg. DllCall("RtlMoveMemory") works, even without explicitly loading ntdll.dll.

Is this ok, or should I do DllCall("ntdll\RtlMoveMemory") to improve reliability on different systems?

Thanks
User avatar
jNizM
Posts: 2663
Joined: 30 Sep 2013, 01:33
GitHub: jNizM
Contact:

Re: Does ahk automatically load ntdll.dll?  Topic is solved

21 Nov 2019, 07:58

It is because RtlMoveMemory is also available via kernel32.dll
Image
[AHK] 1.1.32.00 x64 Unicode | [WIN] 10 Pro (Version 2004) x64 | [GitHub] Profile
Donations are appreciated if I could help you
User avatar
jeeswg
Posts: 6902
Joined: 19 Dec 2016, 01:58
Location: UK

Re: Does ahk automatically load ntdll.dll?

21 Nov 2019, 08:01

Using this code to list functions in a dll on Windows 7:
LoadPicture() from variable - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=5&t=39002&p=181321#p181321

kernel32.dll and ntdll.dll both contain:
RtlCaptureContext
RtlCaptureStackBackTrace
RtlFillMemory
RtlMoveMemory
RtlUnwind
RtlZeroMemory
VerSetConditionMask

ntdll.dll has many other RtlXXX functions also, e.g. RtlCompareMemory and RtlComputeCrc32.
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA

Return to “Ask For Help”

Who is online

Users browsing this forum: boiler, Chunjee, Google [Bot], Hologram, mikeyww and 46 guests