Does ahk automatically load ntdll.dll? Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
pneumatic
Posts: 338
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: 3183
Joined: 30 Sep 2013, 01:33
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] v2.0.5 | [WIN] 11 Pro (Version 22H2) | [GitHub] Profile
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 (v1)”

Who is online

Users browsing this forum: bobstoner289, peter_ahk and 328 guests