Winscard: Add header for pcsclite types and helpers for upcomming implementation

Mounir IDRASSI mounir.idrassi at idrix.fr
Thu Aug 28 08:01:32 CDT 2008


---
 dlls/winscard/pcsclite_helper.h |   66 +++++++++++++++++++++++++++++++++++++++
 1 files changed, 66 insertions(+), 0 deletions(-)
 create mode 100644 dlls/winscard/pcsclite_helper.h

diff --git a/dlls/winscard/pcsclite_helper.h b/dlls/winscard/pcsclite_helper.h
new file mode 100644
index 0000000..8af1889
--- /dev/null
+++ b/dlls/winscard/pcsclite_helper.h
@@ -0,0 +1,66 @@
+/*
+ * Declaration of pcsclite types and helpers used by Winscard implementation 
+ *
+ * Copyright 2008 Mounir IDRASSI  (mounir.idrassi at idrix.fr, for IDRIX)
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#ifndef __WINE_PCSCLITE_HELPER_H
+#define __WINE_PCSCLITE_HELPER_H
+ 
+typedef long LITE_SCARDCONTEXT;
+typedef long LITE_SCARDHANDLE;
+
+typedef struct
+{
+    const char *szReader;
+    void *pvUserData;
+    unsigned long dwCurrentState;
+    unsigned long dwEventState;
+    unsigned long cbAtr;
+    unsigned char rgbAtr[33]; /* It's 36 bytes long on Windows */
+}
+LITE_SCARD_READERSTATE;
+
+typedef struct
+{
+    unsigned long dwProtocol;
+    unsigned long cbPciLength;
+}
+LITE_SCARD_IO_REQUEST;
+
+/*
+ * Protocol values. 
+ * Only RAW value is different from Windows declaration
+ */
+#define LITE_SCARD_PROTOCOL_T0      0x00000001
+#define LITE_SCARD_PROTOCOL_T1      0x00000002
+#define LITE_SCARD_PROTOCOL_RAW     0x00000004
+
+unsigned long Win32ToLiteProtocol(DWORD);
+DWORD LiteToWin32Protocol(unsigned long);
+
+/*
+ * Translate PCSC-lite errors to equivalent MS ones
+ * Actually, the only difference is for SCARD_W_INSERTED_CARD(0x8010006A) and
+ * SCARD_E_UNSUPPORTED_FEATURE (0x8010001F)
+ */
+#define PCSCLITE_SCARD_W_INSERTED_CARD          0x8010006A
+#define PCSCLITE_SCARD_E_UNSUPPORTED_FEATURE    0x8010001F
+
+LONG TranslateToWin32Error(long);
+
+#endif
-- 
1.6.0

------=_20080828163724_13901--





More information about the wine-patches mailing list