I need to call RtlQueryProcessHeapInformation in Delphi.
RtlQueryProcessHeapInformation is a function exported from ntdll.dll.
I don’t have a prototype for this function. I get “Undeclared identifier” error.
asm
...
xchg ebx, eax
pop ebp
call RtlQueryProcessHeapInformation
dec ebp
...
end;
Thank you for your help.
A bit of websearch leads to this page or this one which indicate that the function looks like this:
You already know what
NTSTATUSfrom your previous question. As forNTAPI, that’s__stdcall. So that means the function declaration in Delphi is:The page I link to also includes a declaration for
PRTL_DEBUG_INFORMATIONand I’m sure you can translate that yourself. You’ll still have to reverse engineer what the parameters mean since this is an implementation private, undocumented function.This is the second question that you have asked that has been almost identical. In both questions you present the question as being an assembler question. But it’s not. In both questions you needed to work out the declaration of the function, and how to import it from the external DLL. What you should take away from this is that when you need to call a function in another DLL you can do one of two things:
externalcode that I have shown in both your questions. This is the simpler approach.LoadLibraryandGetProcAddressto explicitly import it. This is the more laborious approach.Please don’t take this the wrong way – I’m just trying to show you what you need to know to be able to solve such problems for yourself.