[python-sybase] Problem on Windows solved

Vadim Beloborodov bvr at proj.pib.com.ua
Wed, 1 Sep 2004 17:03:58 +0300


Hi!

I have a small problem with Sybase-0.36 module on Windows.

import Sybase
db=3DSybase.connect('someserver','someuser','somepass')

and get

"the instruction at 0x009dd8a7 referenced memory at (0x00000001) the memory
could not be written"


Problem found in file ctx.c on declarations:

static CS_RETCODE clientmsg_cb(CS_CONTEXT *cs_ctx,
          CS_CONNECTION *cs_conn,
          CS_CLIENTMSG *cs_msg)

and

static CS_RETCODE servermsg_cb(CS_CONTEXT *cs_ctx,
          CS_CONNECTION *cs_conn,
          CS_SERVERMSG *cs_msg)

I change to (note  - CS_INTERNAL):

static CS_RETCODE CS_INTERNAL clientmsg_cb(CS_CONTEXT *cs_ctx,
          CS_CONNECTION *cs_conn,
          CS_CLIENTMSG *cs_msg)
and

static CS_RETCODE CS_INTERNAL servermsg_cb(CS_CONTEXT *cs_ctx,
          CS_CONNECTION *cs_conn,
          CS_SERVERMSG *cs_msg)

This changes declaration of functions to __stdcall on Windows (default is
__ccall).

--
Vadim Beloborodov