trouble calling function from windows dll

maarten van damme maartenvd1994 at gmail.com
Sat Mar 24 12:11:28 PDT 2012


hi,
I'm trying to call NtUnmapViewOfSection from ntdll.dll. According to the
msdn docs it should look like

NTSTATUS NtUnmapViewOfSection(
  __in      HANDLE ProcessHandle,
  __in_opt  PVOID BaseAddress
);


I tried to call it by simply declaring

extern(Windows) uint NtUnmapViewOfSection(HANDLE hProcess,PVOID baseAddress);

But now I get

 Error 42: Symbol Undefined _NtUnmapViewOfSection at 8


I've also tried using GetProcAddress

cast(uint function(HANDLE hProcess,PVOID
address))GetProcAddress(Runtime.loadLibrary("ntdll.dll"),
"NtUnmapViewOfSection")

but when I looked at GetLastError I get error 127 (specified procedure
could not be found) and the function doesn't work.


It's likely I'm missing something easy here, I just can't figure out what it is.

Someone knows what it is?


Maarten
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20120324/24f59655/attachment.html>


More information about the Digitalmars-d-learn mailing list