From: <jda...@us...> - 2010-12-27 16:03:44
|
Revision: 523 http://pyscard.svn.sourceforge.net/pyscard/?rev=523&view=rev Author: jdaussel Date: 2010-12-27 16:03:37 +0000 (Mon, 27 Dec 2010) Log Message: ----------- Support of 64bit SCARDCONTEXT and SCARDHANDLE on windows Modified Paths: -------------- trunk/pyscard/src/smartcard/scard/helpers.c Modified: trunk/pyscard/src/smartcard/scard/helpers.c =================================================================== --- trunk/pyscard/src/smartcard/scard/helpers.c 2010-12-23 14:44:33 UTC (rev 522) +++ trunk/pyscard/src/smartcard/scard/helpers.c 2010-12-27 16:03:37 UTC (rev 523) @@ -727,7 +727,7 @@ #ifdef PCSCLITE oScardContext = PyLong_FromLong( (long)source ); #else // !PCSCLITE - oScardContext = PyLong_FromUnsignedLong( (unsigned long)source ); + oScardContext = PyLong_FromVoidPtr( (void*)source ); #endif // PCSCLITE // append list to target @@ -773,7 +773,7 @@ #ifdef PCSCLITE scRet = PyLong_AsLong( source ); #else // !PCSCLITE - scRet = PyLong_AsUnsignedLong( source ); + scRet = PyLong_AsVoidPtr( source ); #endif // PCSCLITE return scRet; @@ -797,7 +797,7 @@ #ifdef PCSCLITE oScardHandle = PyLong_FromLong( (long)source ); #else // !PCSCLITE - oScardHandle = PyLong_FromUnsignedLong( (unsigned long)source ); + oScardHandle = PyLong_FromVoidPtr( (void*)source ); #endif // PCSCLITE // append list to target @@ -843,7 +843,7 @@ #ifdef PCSCLITE scRet = PyLong_AsLong( source ); #else // !PCSCLITE - scRet = PyLong_AsUnsignedLong( source ); + scRet = PyLong_AsVoidPtr( source ); #endif // PCSCLITE return scRet; @@ -860,24 +860,24 @@ builds a Python SCARDDWORDARG from a C SCARDDWORDARG ==============================================================================*/ { - PyObject* oScardContext; + PyObject* oScardDword; - // create SCARDCONTEXT + // create SCARDDWORDARG #ifdef PCSCLITE - oScardContext = PyLong_FromLong( (long)source ); + oScardDword = PyLong_FromLong( (long)source ); #else // !PCSCLITE - oScardContext = PyLong_FromUnsignedLong( (unsigned long)source ); + oScardDword = PyLong_FromUnsignedLong( (unsigned long)source ); #endif // PCSCLITE // append list to target if( !*ptarget ) { - *ptarget = oScardContext; + *ptarget = oScardDword; } else if( *ptarget == Py_None ) { Py_DECREF(Py_None); - *ptarget = oScardContext; + *ptarget = oScardDword; } else { @@ -888,8 +888,8 @@ PyList_Append(*ptarget,o2); Py_XDECREF(o2); } - PyList_Append(*ptarget,oScardContext); - Py_XDECREF(oScardContext); + PyList_Append(*ptarget,oScardDword); + Py_XDECREF(oScardDword); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |