2 * Copyright 2007 Mounir IDRASSI (mounir.idrassi@idrix.fr, for IDRIX)
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
23 #include "wine/debug.h"
27 WINE_DEFAULT_DEBUG_CHANNEL(winscard);
29 static HANDLE g_startedEvent = NULL;
31 const SCARD_IO_REQUEST g_rgSCardT0Pci = { SCARD_PROTOCOL_T0, 8 };
32 const SCARD_IO_REQUEST g_rgSCardT1Pci = { SCARD_PROTOCOL_T1, 8 };
33 const SCARD_IO_REQUEST g_rgSCardRawPci = { SCARD_PROTOCOL_RAW, 8 };
36 BOOL WINAPI DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
38 TRACE("%p,%x,%p\n", hinstDLL, fdwReason, lpvReserved);
42 case DLL_PROCESS_ATTACH:
44 DisableThreadLibraryCalls(hinstDLL);
45 /* FIXME: for now, we act as if the pcsc daemon is always started */
46 g_startedEvent = CreateEventA(NULL,TRUE,TRUE,NULL);
49 case DLL_PROCESS_DETACH:
51 CloseHandle(g_startedEvent);
59 HANDLE WINAPI SCardAccessStartedEvent(void)
61 return g_startedEvent;
64 LONG WINAPI SCardAddReaderToGroupA(SCARDCONTEXT context, LPCSTR reader, LPCSTR group)
67 UNICODE_STRING readerW, groupW;
69 if(reader) RtlCreateUnicodeStringFromAsciiz(&readerW,reader);
70 else readerW.Buffer = NULL;
71 if(group) RtlCreateUnicodeStringFromAsciiz(&groupW,group);
72 else groupW.Buffer = NULL;
74 retval = SCardAddReaderToGroupW(context, readerW.Buffer, groupW.Buffer);
76 RtlFreeUnicodeString(&readerW);
77 RtlFreeUnicodeString(&groupW);
82 LONG WINAPI SCardAddReaderToGroupW(SCARDCONTEXT context, LPCWSTR reader, LPCWSTR group)
84 FIXME("%x %s %s\n", (unsigned int) context, debugstr_w(reader), debugstr_w(group));
85 return SCARD_S_SUCCESS;
88 LONG WINAPI SCardEstablishContext(DWORD dwScope, LPCVOID pvReserved1,
89 LPCVOID pvReserved2, LPSCARDCONTEXT phContext)
91 FIXME("(%x,%p,%p,%p) stub\n", dwScope, pvReserved1, pvReserved2, phContext);
92 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
93 return SCARD_F_INTERNAL_ERROR;
96 LONG WINAPI SCardIsValidContext(SCARDCONTEXT context)
98 FIXME("(%lx) stub\n", context);
99 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
100 return SCARD_F_INTERNAL_ERROR;
103 LONG WINAPI SCardListCardsA(SCARDCONTEXT hContext, LPCBYTE pbAtr, LPCGUID rgguidInterfaces, DWORD cguidInterfaceCount, LPSTR mszCards, LPDWORD pcchCards)
106 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
107 return SCARD_F_INTERNAL_ERROR;
110 LONG WINAPI SCardReleaseContext(SCARDCONTEXT context)
112 FIXME("(%lx) stub\n", context);
113 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
114 return SCARD_F_INTERNAL_ERROR;
117 LONG WINAPI SCardStatusA(SCARDHANDLE context, LPSTR szReaderName, LPDWORD pcchReaderLen, LPDWORD pdwState, LPDWORD pdwProtocol, LPBYTE pbAtr, LPDWORD pcbAtrLen)
119 FIXME("(%lx) stub\n", context);
120 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
121 return SCARD_F_INTERNAL_ERROR;
124 LONG WINAPI SCardStatusW(SCARDHANDLE context, LPWSTR szReaderName, LPDWORD pcchReaderLen, LPDWORD pdwState,LPDWORD pdwProtocol,LPBYTE pbAtr,LPDWORD pcbArtLen)
126 FIXME("(%lx) stub\n", context);
127 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
128 return SCARD_F_INTERNAL_ERROR;
131 void WINAPI SCardReleaseStartedEvent(void)