-
Notifications
You must be signed in to change notification settings - Fork 199
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Kernel32 GetProcAddress for 64its #478
Comments
Which overload are you using and what exception or result code are you getting? |
I found something, maybe this is helpful: StackOverflow: GetProcAddress function in C++ GetProcAddress function in C++
|
Thanks for all of your answer, i use it in a C# Library project, So first i Load my Library like this :
And if i call GetLastError() i got the error code 0, in 64Bits i've an message who told me that the function is not found but in 32Bits it works well, so Every element on my list in 64Bits = IntPtr.Zero |
Please try this:https://csharp.hotexamples.com/fr/examples/-/getDllVersionDelegate/-/php-getdllversiondelegate-class-examples.htmlAm 06.08.2024 10:49 schrieb iR3SH ***@***.***>:
Thanks for all of your answer, i use it in a C# Library project, So first i Load my Library like this :
SafeHINSTANCE safeModule = LoadLibraryEx(DllUrl);
Then i want to load the functions of the dll like this GetProcAddress(safeModule, "CCAPIConnectConsole")
But then i look if any load of functions are loaded correclty
`
safeModule = LoadLibrary(DllUrl);
CCAPIFunctionsList.Add(GetProcAddress(safeModule, "CCAPIConnectConsole"));
CCAPIFunctionsList.Add(GetProcAddress(safeModule, "CCAPIDisconnectConsole"));
CCAPIFunctionsList.Add(GetProcAddress(safeModule, "CCAPIGetConnectionStatus"));
CCAPIFunctionsList.Add(GetProcAddress(safeModule, "CCAPISetBootConsoleIds"));
CCAPIFunctionsList.Add(GetProcAddress(safeModule, "CCAPISetConsoleIds"));
CCAPIFunctionsList.Add(GetProcAddress(safeModule, "CCAPISetMemory"));
CCAPIFunctionsList.Add(GetProcAddress(safeModule, "CCAPIGetMemory"));
CCAPIFunctionsList.Add(GetProcAddress(safeModule, "CCAPIGetProcessList"));
CCAPIFunctionsList.Add(GetProcAddress(safeModule, "CCAPIGetProcessName"));
CCAPIFunctionsList.Add(GetProcAddress(safeModule, "CCAPIGetTemperature"));
CCAPIFunctionsList.Add(GetProcAddress(safeModule, "CCAPIShutdown"));
CCAPIFunctionsList.Add(GetProcAddress(safeModule, "CCAPIRingBuzzer"));
CCAPIFunctionsList.Add(GetProcAddress(safeModule, "CCAPISetConsoleLed"));
CCAPIFunctionsList.Add(GetProcAddress(safeModule, "CCAPIGetFirmwareInfo"));
CCAPIFunctionsList.Add(GetProcAddress(safeModule, "CCAPIVshNotify"));
CCAPIFunctionsList.Add(GetProcAddress(safeModule, "CCAPIGetNumberOfConsoles"));
CCAPIFunctionsList.Add(GetProcAddress(safeModule, "CCAPIGetConsoleInfo"));
CCAPIFunctionsList.Add(GetProcAddress(safeModule, "CCAPIGetDllVersion"));
private bool IsCCAPILoaded()
{
for (int i = 0; i < CCAPIFunctionsList.Count; i++)
if (CCAPIFunctionsList.ElementAt(i) == IntPtr.Zero)
return false;
return true;
}`
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: ***@***.***>
|
This was my bad, i'm tryng to load an 32Bits Library in an 64Bits tool, it can't work i think |
https://stackoverflow.com/questions/2265023/load-32-bit-dll-library-in-64-bit-application |
Also, for functions like this that use a NULL handle to report failure, you can use Win32Error.ThrowLastErrorIfInvalid CCAPIFunctionsList.Add(Win32Error.ThrowLastErrorIfInvalid(GetProcAddress(safeModule, "CCAPIGetDllVersion"))); |
@dahall: Another unrelated Question: Does this always work? Or does this only work on specific DLLs, like edit: How do I know, my specific call is supported by this approach? |
Any handle in Vanara that supports the |
Hi,
I'm trying to use the function GetProcAddress, when i run my application in 32Bits everthing works, but not when i launch it in Any CPU or 64Bits
Could you make the method compatible with 64Bits ?
Thanks :)
The text was updated successfully, but these errors were encountered: