ative windows dll, proxy methods, Unsupported Dwarf2 information for...

Stephen Crowley stephen.crowley at gmail.com
Thu Apr 7 08:59:02 CDT 2005


Hi,  I have a win32 dll which exports about 30 functions. I've used
winedump with the -f and -I flags to create stub/proxy functions which
use LoadLibrary.  Please CC my on all responses as I am not subscribed
to the list.

It generates functions like so..

HGTBSESSION __stdcall GTBAPI_gtbCreateSession(HWND hParent,
GTBSessionCallback * lpCallBack, void * lpParam)
{
       HGTBSESSION (__stdcall *pFunc)(HWND, const GTBSessionCallback
*, void *);
       HGTBSESSION retVal;
       pFunc=(void*)GetProcAddress(hDLL,"gtbCreateSession");
       TRACE("((HWND)%p,(GTBSessionCallback *)%p,(void *)%p):
forward\n",hParent,lpCallBack,lpParam);
       retVal = pFunc(hParent,lpCallBack,lpParam);
       TRACE("Returned (%p)\n",retVal);
       return retVal;
}

For compatibility with existing code I removed the GTBAPI_ from the
function and switched back to the native prototype.

GTAPIB_EXTERN HGTBSESSION WINAPI gtbCreateSession(HWND hParent, const
GTBSessionCallback *lpCallBack, void *lpParam)

Compiled and linked like so.

gcc -shared GTAPIB_main.c -I/usr/include/wine/windows
-I../GenSrc/API/GTAPIB -o ../lib/libgtapib.so
/usr/lib/wine/kernel32.dll.so

Then I have a small test app that I compile/link:

winegcc TestAPIB.c -I/usr/include/wine/windows -I
../../../GenSrc/API/GTAPIB -L../../../lib -lgtapib -lkernel32 -o
TestAPIB

Running ./TestAPIB throws the following error

WineDbg starting on pid 0x8
Unhandled exception: page fault on read access to 0x00000000 in 32-bit
code (0x00000000).
In 32 bit mode.
.....
Backtrace:
=>1 0x00000000 (0x406efe60)
fixme:dbghelp:elf_load_debug_info_from_map Unsupported Dwarf2
information for testapib<elf>
 2 0x405e5276 WinMain in testapib (0x406efe90)
 3 0x405e5173 __wine_exe_main in testapib (0x406eff20)
 4 0x404e0de2 in kernel32 (+0x50de2) (0x406efff4)
 5 0x4001d181 wine_switch_to_stack in libwine.so.1 (0x00000000)
0x00000000: addb        %al,0x0(%eax)

My wine version is 20050310

Any tips would be greatly appreciated.

Thanks,
Stephen



More information about the wine-devel mailing list