Re: How to get the adress machine of any c_proc()
- Posted by mattlewis (admin) Nov 15, 2013
- 1478 views
petelomax said...
javier07b9 said...
Yes, this is a complicated way for call any c_proc(), only i try this for understanding how works Euphoria
You can do something like
kernel32 = open_dll("kernel32.dll") xLoadLibrary = define_c_func(kernel32,"LoadLibraryA",{C_PTR},C_PTR) xGetProcAddress = define_c_func(kernel32, "GetProcAddress",{C_PTR,C_PTR},C_PTR)
and invoke those via c_func to get the raw addresses and play with those directly (for learning purposes, and may require some assembly code)
Those aren't necessary in euphoria code (as Jim already mentioned). Just use define_c_var(), which gives you the address of a function or variable in the DLL. The backend uses LoadLibrary and GetProcAddress behind the scenes.
Matt