> 
> The FT_Read is executed (via a function pointer of course), 
> and it returns. There is no OpenOCD error (so some status is 
> returned, the number of bytes is ok, and so on). The function 
> gets to it's end, but never returns to the caller. Windows 
> shows "access violation" exception, so I'm guessing that 
> dynamially called FT_Read destroys the stack frame and return 
> address somehow...
> 
> Any idea what I may be doing wrong? What info can I provide 
> for you to help me in that task?
> 

you are using the wrong calling convention if this happens.
Note the WINAPI

i have done this with previous ftdi stuff, try

typedef FT_STATUS (WINAPI *FT_OPENEX)(PVOID pArg1,DWORD Flags,FT_HANDLE
*pHandle);
static FT_OPENEX FT_OpenEx = NULL;

and then to get functions:

hDll = LoadLibrary( "ftd2xx.dll" );
if( hDll == NULL )
        return ERROR_FTD2XX;

FT_OpenEx = (FT_OPENEX)GetProcAddress( hDll, "FT_OpenEx" );
if( FT_OpenEx == NULL )
        return ERROR_FTD2XX;

Cheers
Spen
_______________________________________________
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to