-
Notifications
You must be signed in to change notification settings - Fork 13
/
pycsc-0.0.3_new-pcsc.patch
86 lines (77 loc) · 2.51 KB
/
pycsc-0.0.3_new-pcsc.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
diff -u pycsc-0.0.3/pycsc.c pycsc-0.0.3_clean/pycsc.c
--- pycsc-0.0.3/pycsc.c 2004-06-21 02:54:29.000000000 +0200
+++ pycsc-0.0.3_clean/pycsc.c 2007-02-10 03:05:38.000000000 +0100
@@ -23,7 +23,7 @@
#endif
/* Internal tool */
-static LONG getReaderList(SCARDCONTEXT hContext, LPSTR* pmszReaders,
+static LONG getReaderList(SCARDCONTEXT hContext, LPTSTR* pmszReaders,
DWORD *pdwReaders);
#ifdef _WINDOWS_
@@ -256,14 +256,14 @@
BYTE pbAtr[MAX_ATR_SIZE];
DWORD dwAtrLen, dwProt=0, dwState=0;
DWORD dwReaderLen;
- LPSTR pcReaders;
+ LPTSTR pcReaders;
LONG rv;
PyObject *ret_value;
dwReaderLen = 10000;
dwAtrLen = 0;
/* Dry run to get the length of the reader name */
- rv = SCardStatus( object->hCard, (LPSTR) NULL, &dwReaderLen,
+ rv = SCardStatus( object->hCard, (LPTSTR) NULL, &dwReaderLen,
&dwState, &dwProt, NULL, &dwAtrLen );
if ( rv != SCARD_S_SUCCESS )
@@ -340,7 +340,7 @@
{
pycscobject *object = (pycscobject *)self;
LONG rv;
- unsigned long len;
+ int len;
unsigned char *sendBuffer;
DWORD bSendPci;
SCARD_IO_REQUEST *pioSendPci;
@@ -499,8 +499,8 @@
static PyObject * pycscobject_pycsc(PyObject *self, PyObject * args, PyObject *keywds)
{
/* No reader name in args, connect to the first reader */
- LPSTR mszReaders = NULL;
- LPSTR szRequestedReader = "";
+ LPTSTR mszReaders = NULL;
+ LPTSTR szRequestedReader = "";
DWORD dwReaders;
DWORD dwMode = SCARD_SHARE_SHARED;
DWORD eProtocol; /* effective protocol */
@@ -611,8 +611,8 @@
static PyObject * pycscobject_listReader(PyObject *self, PyObject * args)
{
SCARDCONTEXT hContext;
- LPSTR mszReaders = NULL;
- LPSTR mszReadersScan;
+ LPTSTR mszReaders = NULL;
+ LPTSTR mszReadersScan;
DWORD dwReaders;
LONG rv;
@@ -941,10 +941,10 @@
}
/* Internal tool */
-static LONG getReaderList(SCARDCONTEXT hContext, LPSTR* pmszReaders, DWORD *pdwReaders)
+static LONG getReaderList(SCARDCONTEXT hContext, LPTSTR* pmszReaders, DWORD *pdwReaders)
{
- LPCSTR mszGroups = 0;
- LPSTR mszReaders = NULL;
+ LPCTSTR mszGroups = 0;
+ LPTSTR mszReaders = NULL;
LONG dwReaders;
LONG rv;
diff -u pycsc-0.0.3/setup.py pycsc-0.0.3_clean/setup.py
--- pycsc-0.0.3/setup.py 2004-01-19 17:09:32.000000000 +0100
+++ pycsc-0.0.3_clean/setup.py 2007-02-10 03:05:25.000000000 +0100
@@ -31,7 +31,7 @@
include = []
else:
libs = ["pcsclite"]
- include = ["/usr/include/pcsc"]
+ include = ["/usr/include/PCSC"]
setup(name="pycsc", version="0.3",