Home » U++ Library support » U++ Core » Using DLI files on Windows
Using DLI files on Windows [message #38509] |
Fri, 21 December 2012 06:49 |
Novo
Messages: 1358 Registered: December 2006
|
Ultimate Contributor |
|
|
It is possible that a DLL exports a name (I can see it in dependency walker) but a call to this function crashes, because, I believe, a stub points to a NULL pointer.
Is there a way in Windows to tell that although function's name is exported it cannot be called?
I have a real world example: OpenCL.dll that supports only OpenCL v.1.1 exports function clRetainDevice, which is defined in OpenCL v.1.2. Call to this function crashes, no wonder why.
TIA
Regards,
Novo
|
|
|
|
Re: Using DLI files on Windows [message #38557 is a reply to message #38549] |
Sun, 23 December 2012 14:46 |
Novo
Messages: 1358 Registered: December 2006
|
Ultimate Contributor |
|
|
mirek wrote on Sun, 23 December 2012 03:56 | Well, in that dli struct, functions are represented as member variable pointers, so you can check the existence before making call.
In any case, I do not think that mere NOP instead of missing function is a good idea in most places (say the function is supposed to return a handle that you use downstream in your code, it would cause havoc).
Mirek
|
Thanks. I did check a member for NULL pointer. It looks like this dll is just a proxy to other dlls and I should check version of API instead of a pointer to function because call to clRetainDevice doesn't crash with Intel platform an does crash with NVIDIA although they implement the same version of this API ...
I tried to check content of IMAGE_EXPORT_DIRECTORY.AddressOfFunctions. But everything seemed to be fine.
Sorry for false alarm.
Regards,
Novo
|
|
|
Goto Forum:
Current Time: Thu Mar 28 15:36:23 CET 2024
Total time taken to generate the page: 0.01472 seconds
|