Questions tagged [getprocaddress]

GetProcAddress is a function in the Windows API for getting addresses of functions in dynamically loaded libraries

106 questions
53
votes
3 answers

Load 32-bit DLL library in 64-bit application

Is there a way to load a 32-bit DLL library (something with the same usage as LoadLibrary) I would like to use that function along with GetProcAddress. I looked at WOW, but it does not seem to offer the functionality. The functionality should exist,…
adk
  • 4,479
  • 9
  • 36
  • 38
23
votes
3 answers

GetProcAddress function in C++

Hello guys: I've loaded my DLL in my project but whenever I use the GetProcAddress function. it returns NULL! what should I do? I use this function ( double GetNumber(double x) ) in "MYDLL.dll" Here is a code which I used: typedef double…
Alireza
  • 1,018
  • 1
  • 8
  • 23
14
votes
4 answers

C# GetProcAddress Returns Zero

For some reason, whenever my C# .NET 2.0 application makes a call to GetProcAddress it always returns zero. public class MyClass { internal static class UnsafeNativeMethods { [DllImport("kernel32.dll", CharSet = CharSet.Auto,…
Jim Fell
  • 13,750
  • 36
  • 127
  • 202
8
votes
2 answers

GetProcAddress cannot find my functions

I made a DLL with a function named "render()" and I want to load it dynamically to my application, but GetProcAddress cannot find it. Here's the DLL .h: #ifdef D3D_API_EXPORTS #define D3D_API_API __declspec(dllexport) #else #define D3D_API_API…
SurvivalMachine
  • 7,946
  • 15
  • 57
  • 87
7
votes
2 answers

0xC0000005: Access violation executing location 0x00000000

I'm writing an MFC project that try to call a function in the DLL which will return some information in a string. The function in the DLL is as follows: int GetInfo(char* Info) The function will return 0 if success. Information will be returned in…
user2845698
  • 71
  • 1
  • 1
  • 2
6
votes
2 answers

getProcAddress - NULL is returned

I have the following code: //mydll.cpp #include #include #define STDOUT_FILEDESC 1 class MYSTDOUT { bool shouldClose; bool isBuffered; public: MYSTDOUT(bool buf = true, bool cl =…
YAKOVM
  • 9,805
  • 31
  • 116
  • 217
5
votes
2 answers

Difference between dllimport and getProcAddress

First, I know that it doesn't make sense to compare the dllimport attribute and the getProcAddress function directly. Rather, I am interested in comparing two pieces of code, that achieve basically the same thing - calling a function in a dll - by…
Boris
  • 5,094
  • 4
  • 45
  • 71
5
votes
5 answers

GetProcAddress() failing, error 127

Here's my DLL code: #include #include int sysLol(char *arg); int sysLol(char *arg) { std::cout< #include #include…
Moon
  • 329
  • 2
  • 3
  • 20
5
votes
2 answers

GetProcAddress returns 0 For All Functions

First of all yes I have searched this for a while now and can't find any answers relevant to my case. Basically I am trying to get the address of a function in a windows DLL (dnsapi.dll) and GetProcAddress is returning 0. After a while of scratching…
Rob Lennon
  • 63
  • 5
4
votes
0 answers

Call into another DLL takes more time than it should

I have added the following functionality to an existing native C++ application: A 3rd party DLL is loaded via LoadLibraryA(...) A function pointer is obtained from the DLL via GetProcAddress(...) The function is called While this basically works…
Boris
  • 8,551
  • 25
  • 67
  • 120
4
votes
1 answer

GetProcAddress returning NULL

I'm trying to load a dll using LoadLibrary and GetProcAddress. LoadLibrary returns a valid handle but my calls to GetProcAddress return NULL. A call to GetLastError returns 87 which is ERROR_INVALID_PARAMETER. I verified that the function name I'm…
Ian Burris
  • 6,325
  • 21
  • 59
  • 80
4
votes
1 answer

How to call MessageBox with GetProcAddress function?

I want to call MessageBox() function in such way: 1). load needed library 2). get the function address 3). call it So, for such aim as I understand, I should define new type with all types of arguments in MessageBox function. It returnes INT and…
user1131997
3
votes
3 answers

Dynamically resolve C stdlib functions from .NET

I want to resolve the addresses of functions like those from the C stdlib such as malloc at run-time from .NET code (so I can JIT machine code that calls to these addresses for my VM). I believe I should use LoadLibrary and GetProcAddress supplying…
J D
  • 48,105
  • 13
  • 171
  • 274
3
votes
1 answer

GetProcAddress returns NULL

I have to use a simple function from a DLL; I am able to load the library but GetProcAddress returns NULL. I think I understood name mangling but maybe I'm doing something wrong. Thanks (Code follows, asap I'll add other information…
gc5
  • 9,468
  • 24
  • 90
  • 151
3
votes
1 answer

GetModuleHandle(), for a DLL in another process

The title explains this all really, I have a process tapping into another process. I need to be able to GetModuleHandle, on this program for a certain DLL which isn't Windows standard, and I don't have the source code to the main program. I need to…
user1591117
  • 287
  • 2
  • 5
  • 13
1
2 3 4 5 6 7 8