winscard: small stub implementation of winscard dll (Try 2)

Mounir IDRASSI mounir.idrassi at idrix.fr
Tue May 22 12:55:12 CDT 2007


Hi,
As the previous patch did never show up, I am submitting a new one
containing only the bare minimum: a spec file with only stubs and a c
file with DllMain.
If there is a problem with this one also, please let me know.

Mounir IDRASSI
IDRIX - Cryptography and IT Security Experts
http://www.idrix.fr


-------------- next part --------------
>From 993e8b7b519e74560550b961d03b395b45ecf8a6 Mon Sep 17 00:00:00 2001
From: Mounir IDRASSI <mounir.idrassi at idrix.fr>
Date: Tue, 22 May 2007 19:47:59 +0200
Subject: winscard: small stub implementation of winscard dll

---
 Makefile.in                 |    2 +
 configure                   |    2 +
 configure.ac                |    1 +
 dlls/Makefile.in            |    5 +++
 dlls/winscard/Makefile.in   |   17 +++++++++++
 dlls/winscard/rsrc.rc       |   33 +++++++++++++++++++++
 dlls/winscard/winscard.c    |   61 +++++++++++++++++++++++++++++++++++++++
 dlls/winscard/winscard.spec |   66 +++++++++++++++++++++++++++++++++++++++++++
 8 files changed, 187 insertions(+), 0 deletions(-)

diff --git a/Makefile.in b/Makefile.in
index 3b16428..6c9bdef 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -419,6 +419,7 @@ ALL_MAKEFILES = \
 	dlls/winmm/Makefile \
 	dlls/winmm/tests/Makefile \
 	dlls/winnls32/Makefile \
+	dlls/winscard/Makefile \
 	dlls/winspool.drv/Makefile \
 	dlls/winspool.drv/tests/Makefile \
 	dlls/wintab32/Makefile \
@@ -768,6 +769,7 @@ dlls/wininet/tests/Makefile: dlls/wininet/tests/Makefile.in dlls/Maketest.rules
 dlls/winmm/Makefile: dlls/winmm/Makefile.in dlls/Makedll.rules
 dlls/winmm/tests/Makefile: dlls/winmm/tests/Makefile.in dlls/Maketest.rules
 dlls/winnls32/Makefile: dlls/winnls32/Makefile.in dlls/Makedll.rules
+dlls/winscard/Makefile: dlls/winscard/Makefile.in dlls/Makedll.rules
 dlls/winspool.drv/Makefile: dlls/winspool.drv/Makefile.in dlls/Makedll.rules
 dlls/winspool.drv/tests/Makefile: dlls/winspool.drv/tests/Makefile.in dlls/Maketest.rules
 dlls/wintab32/Makefile: dlls/wintab32/Makefile.in dlls/Makedll.rules
diff --git a/configure b/configure
index f6034fe..dd9874e 100755
--- a/configure
+++ b/configure
@@ -20907,6 +20907,8 @@ ac_config_files="$ac_config_files dlls/winmm/tests/Makefile"
 
 ac_config_files="$ac_config_files dlls/winnls32/Makefile"
 
+ac_config_files="$ac_config_files dlls/winscard/Makefile"
+
 ac_config_files="$ac_config_files dlls/winspool.drv/Makefile"
 
 ac_config_files="$ac_config_files dlls/winspool.drv/tests/Makefile"
diff --git a/configure.ac b/configure.ac
index 22de21f..8c9b427 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1749,6 +1749,7 @@ AC_CONFIG_FILES([dlls/wininet/tests/Makefile])
 AC_CONFIG_FILES([dlls/winmm/Makefile])
 AC_CONFIG_FILES([dlls/winmm/tests/Makefile])
 AC_CONFIG_FILES([dlls/winnls32/Makefile])
+AC_CONFIG_FILES([dlls/winscard/Makefile])
 AC_CONFIG_FILES([dlls/winspool.drv/Makefile])
 AC_CONFIG_FILES([dlls/winspool.drv/tests/Makefile])
 AC_CONFIG_FILES([dlls/wintab32/Makefile])
diff --git a/dlls/Makefile.in b/dlls/Makefile.in
index 159bb2d..5bb4e3a 100644
--- a/dlls/Makefile.in
+++ b/dlls/Makefile.in
@@ -207,6 +207,7 @@ BASEDIRS = \
 	wininet \
 	winmm \
 	winnls32 \
+	winscard \
 	winspool.drv \
 	wintab32 \
 	wintrust \
@@ -574,6 +575,7 @@ IMPORT_LIBS = \
 	wininet/libwininet.$(IMPLIBEXT) \
 	winmm/libwinmm.$(IMPLIBEXT) \
 	winnls32/libwinnls32.$(IMPLIBEXT) \
+	winscard/libwinscard.$(IMPLIBEXT) \
 	winspool.drv/libwinspool.$(IMPLIBEXT) \
 	wintab32/libwintab32.$(IMPLIBEXT) \
 	wintrust/libwintrust.$(IMPLIBEXT) \
@@ -927,6 +929,9 @@ winmm/libwinmm.$(IMPLIBEXT): winmm/winmm.spec $(WINEBUILD)
 winnls32/libwinnls32.$(IMPLIBEXT): winnls32/winnls32.spec $(WINEBUILD)
 	@cd winnls32 && $(MAKE) libwinnls32.$(IMPLIBEXT)
 
+winscard/libwinscard.$(IMPLIBEXT): winscard/winscard.spec $(WINEBUILD)
+	@cd winscard && $(MAKE) libwinscard.$(IMPLIBEXT)
+
 winspool.drv/libwinspool.$(IMPLIBEXT): winspool.drv/winspool.drv.spec $(WINEBUILD)
 	@cd winspool.drv && $(MAKE) libwinspool.$(IMPLIBEXT)
 
diff --git a/dlls/winscard/Makefile.in b/dlls/winscard/Makefile.in
new file mode 100644
index 0000000..de8a2b6
--- /dev/null
+++ b/dlls/winscard/Makefile.in
@@ -0,0 +1,17 @@
+TOPSRCDIR = @top_srcdir@
+TOPOBJDIR = ../..
+SRCDIR    = @srcdir@
+VPATH     = @srcdir@
+MODULE    = winscard.dll
+IMPORTLIB = libwinscard.$(IMPLIBEXT)
+IMPORTS   = kernel32
+
+C_SRCS = \
+	winscard.c
+
+RC_SRCS = \
+	rsrc.rc
+
+ at MAKE_DLL_RULES@
+
+ at DEPENDENCIES@  # everything below this line is overwritten by make depend
diff --git a/dlls/winscard/rsrc.rc b/dlls/winscard/rsrc.rc
new file mode 100644
index 0000000..8226e9d
--- /dev/null
+++ b/dlls/winscard/rsrc.rc
@@ -0,0 +1,33 @@
+/*
+ * Top level resource file for winscard.dll
+ *
+ * Copyright 2007 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
+ */
+
+#include "windef.h"
+#include "winbase.h"
+#include "winuser.h"
+#include "winver.h"
+
+LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
+
+#define WINE_FILEDESCRIPTION_STR "Wine Smart Card API"
+#define WINE_FILENAME_STR "winscard.dll"
+#define WINE_FILEVERSION 5,1,2600,2180
+#define WINE_FILEVERSION_STR "5.1.2600.2180"
+
+#include "wine/wine_common_ver.rc"
diff --git a/dlls/winscard/winscard.c b/dlls/winscard/winscard.c
new file mode 100644
index 0000000..03e73f4
--- /dev/null
+++ b/dlls/winscard/winscard.c
@@ -0,0 +1,61 @@
+/*
+ * Copyright 2007 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
+ */
+
+#include "config.h"
+#include <stdarg.h>
+#include "windef.h"
+#include "winbase.h"
+#include "wine/debug.h"
+#include <winscard.h>
+
+WINE_DEFAULT_DEBUG_CHANNEL(winscard);
+
+static HMODULE WINSCARD_hModule;
+
+SCARD_IO_REQUEST g_rgSCardT0Pci = { SCARD_PROTOCOL_T0, 8 };
+SCARD_IO_REQUEST g_rgSCardT1Pci = { SCARD_PROTOCOL_T1, 8 };
+SCARD_IO_REQUEST g_rgSCardRawPci = { SCARD_PROTOCOL_RAW, 8 };
+
+SCARD_IO_REQUEST* SCARD_PCI_T0 = NULL;
+SCARD_IO_REQUEST* SCARD_PCI_T1 = NULL;
+SCARD_IO_REQUEST* SCARD_PCI_RAW = NULL;
+
+
+BOOL WINAPI DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
+{
+    TRACE("%p,%x,%p\n", hinstDLL, fdwReason, lpvReserved);
+
+    switch (fdwReason)
+    {
+        case DLL_PROCESS_ATTACH:
+        {
+		    DisableThreadLibraryCalls(hinstDLL);
+		    WINSCARD_hModule = hinstDLL;
+		    /* initialize protocol requests pointers */
+            SCARD_PCI_T0 	= &g_rgSCardT0Pci;
+            SCARD_PCI_T1 		= &g_rgSCardT1Pci;
+	    	SCARD_PCI_RAW 	= &g_rgSCardRawPci;
+	    	break;
+        }
+        case DLL_PROCESS_DETACH:
+    		break;
+    }
+
+    return TRUE;
+}
+
diff --git a/dlls/winscard/winscard.spec b/dlls/winscard/winscard.spec
new file mode 100644
index 0000000..a5e47f6
--- /dev/null
+++ b/dlls/winscard/winscard.spec
@@ -0,0 +1,66 @@
+@ stub ClassInstall32
+@ stub SCardAccessNewReaderEvent
+@ stub SCardReleaseAllEvents
+@ stub SCardReleaseNewReaderEvent
+@ stub SCardAccessStartedEvent
+@ stub SCardAddReaderToGroupA
+@ stub SCardAddReaderToGroupW
+@ stub SCardBeginTransaction
+@ stub SCardCancel
+@ stub SCardConnectA
+@ stub SCardConnectW
+@ stub SCardControl
+@ stub SCardDisconnect
+@ stub SCardEndTransaction
+@ stub SCardEstablishContext
+@ stub SCardForgetCardTypeA
+@ stub SCardForgetCardTypeW
+@ stub SCardForgetReaderA
+@ stub SCardForgetReaderGroupA
+@ stub SCardForgetReaderGroupW
+@ stub SCardForgetReaderW
+@ stub SCardFreeMemory
+@ stub SCardGetAttrib
+@ stub SCardGetCardTypeProviderNameA
+@ stub SCardGetCardTypeProviderNameW
+@ stub SCardGetProviderIdA
+@ stub SCardGetProviderIdW
+@ stub SCardGetStatusChangeA
+@ stub SCardGetStatusChangeW
+@ stub SCardIntroduceCardTypeA
+@ stub SCardIntroduceCardTypeW
+@ stub SCardIntroduceReaderA
+@ stub SCardIntroduceReaderGroupA
+@ stub SCardIntroduceReaderGroupW
+@ stub SCardIntroduceReaderW
+@ stub SCardIsValidContext
+@ stub SCardListCardsA
+@ stub SCardListCardsW
+@ stub SCardListInterfacesA
+@ stub SCardListInterfacesW
+@ stub SCardListReaderGroupsA
+@ stub SCardListReaderGroupsW
+@ stub SCardListReadersA
+@ stub SCardListReadersW
+@ stub SCardLocateCardsA
+@ stub SCardLocateCardsByATRA
+@ stub SCardLocateCardsByATRW
+@ stub SCardLocateCardsW
+@ stub SCardReconnect
+@ stub SCardReleaseContext
+@ stub SCardReleaseStartedEvent
+@ stub SCardRemoveReaderFromGroupA
+@ stub SCardRemoveReaderFromGroupW
+@ stub SCardSetAttrib
+@ stub SCardSetCardTypeProviderNameA
+@ stub SCardSetCardTypeProviderNameW
+@ stub SCardState
+@ stub SCardStatusA
+@ stub SCardStatusW
+@ stub SCardTransmit
+@ extern g_rgSCardRawPci
+@ extern g_rgSCardT0Pci	
+@ extern g_rgSCardT1Pci
+@ extern SCARD_PCI_RAW
+@ extern SCARD_PCI_T0
+@ extern SCARD_PCI_T1
-- 
1.4.4.2



More information about the wine-patches mailing list