Hello and thank in advance for your time and help.
My question is not related to avifile. i's about one part of the program,
the library that allows avifile to load the win32 codecs. I'm working in a
telerobotics project in Linux ( in order to use real time ) but I need to
use some native dlls ( cyberimpact.dll a driver of a joystick).
First I tried to use wine but It didn't work, then in the wine-devel
mailing list I read about your program and It could be used as a wrapper to
allow wine load native dlls. So I downloaded your program compiled it, I
linked the lilloader.a to my .c file ( the prueba.c I'm sending to you), the
result can be read in out1.txt, and It seemed to qork perfectly.
However when I tried to execute one function of the dll ( prueba3.c), I got
a segmention fault. I tried to debug the library an at first sight
everything was OK, the problem is the memory address returned it's out of
scope.
My questions are:
Is possible to load any dll?
Am I using well the library, in other words is this the rigth approach?
Maybe is the problem the wsock.dll stuff that I obtained when loading the
library, in that case does anyone know how to fix it?
PLEASE send an answer as quickly as possible even a negative answer, I'm
really stucked with that, and I need to present result to my boss soon.
Jos� Soriano D�az
Escuela Superior de Ingenieros de Sevilla
_________________________________________________________________
Descargue GRATUITAMENTE MSN Explorer en http://explorer.msn.es/intl.asp
LoadLibraryA
External func WSOCK32.dll:8
External func WSOCK32.dll:2
External func WSOCK32.dll:13
External func WSOCK32.dll:9
External func WSOCK32.dll:52
External func WSOCK32.dll:4
External func WSOCK32.dll:1
External func WSOCK32.dll:19
External func WSOCK32.dll:12
External func WSOCK32.dll:18
External func WSOCK32.dll:115
External func WSOCK32.dll:16
External func WSOCK32.dll:3
External func WSOCK32.dll:21
External func WSOCK32.dll:23
External func WSOCK32.dll:111
Entering DllMain(DLL_PROCESS_ATTACH) for ./cyberimpact.dll
./cyberimpact.dll: 10000000
ppFile name of module 0 requested
./cyberimpact.dll: 10000000
GetProcAddress
FreeLibrary(mi_dll)
Entering DllMain(DLL_PROCESS_DETACH) for ./cyberimpact.dll
No hubo problemas
LoadLibraryA
External func WSOCK32.dll:8
External func WSOCK32.dll:2
External func WSOCK32.dll:13
External func WSOCK32.dll:9
External func WSOCK32.dll:52
External func WSOCK32.dll:4
External func WSOCK32.dll:1
External func WSOCK32.dll:19
External func WSOCK32.dll:12
External func WSOCK32.dll:18
External func WSOCK32.dll:115
External func WSOCK32.dll:16
External func WSOCK32.dll:3
External func WSOCK32.dll:21
External func WSOCK32.dll:23
External func WSOCK32.dll:111
Entering DllMain(DLL_PROCESS_ATTACH) for ./cyberimpact.dll
./cyberimpact.dll: 10000000
ppFile name of module 0 requested
./cyberimpact.dll: 10000000
GetProcAddress
HAP_Open
Segemention fault
#include <stdio.h>
#include <dlfcn.h>
#include <wine/windef.h>
#include <wine/winbase.h>
#include <wine/winerror.h>
#include <wine/heap.h>
#include <wine/pe_image.h>
#include <wine/module.h>
#include <wine/debugtools.h>
int main(void)
{
HMODULE *mi_dll;
printf("LoadLibraryA\n");
mi_dll=LoadLibraryA("./cyberimpact.dll");
if(!mi_dll)
{
printf("La puta mi_dll\n");
return -1;
}
printf("GetProcAddress\n");
GetProcAddress(mi_dll,"HAP_Open");
printf("FreeLibrary(mi_dll)\n");
FreeLibrary(mi_dll);
printf("No hubo problemas\n");
return 0;
}
#include <stdio.h>
#include <dlfcn.h>
#include <wine/windef.h>
#include <wine/winbase.h>
#include <wine/winerror.h>
#include <wine/heap.h>
#include <wine/pe_image.h>
#include <wine/module.h>
#include <wine/debugtools.h>
/**************************************************************************/
/*************************************************************************/
/************** Not interesting stuff. Struct definitions **************/
/**************************************************************************/
/*************************************************************************/
status_type *(*HAP_Open)(MPC_communication_struct_type **Haptic_ID_in, char *deviceName, char *deviceFilename);
int main(void)
{
HMODULE *mi_dll;
MPC_communication_struct_type *HAPDevice=NULL;
printf("LoadLibraryA\n");
mi_dll=LoadLibraryA("/home/jose/dw/libloader/cyberimpact.dll");
if(!mi_dll)
{
printf("La puta mi_dll\n");
return -1;
}
printf("GetProcAddress\n");
HAP_Open = (status_type *(*))GetProcAddress(mi_dll,"HAP_Open");
printf("HAP_Open\n");
HAP_Open(&HAPDevice,"CyberImpactJoystick3" , "/home/jose/dw/libloader/HAPTIC.DEV");
printf("FreeLibrary\n");
if(FreeLibrary(mi_dll)==0)
printf("Hubo problemas\n");
printf("No hubo problemas\n");
return 0;
}