ReactOS 0.4.15-dev-7834-g00c4b3d
winscard.c
Go to the documentation of this file.
1/*
2 * Copyright 2007 Mounir IDRASSI (mounir.idrassi@idrix.fr, for IDRIX)
3 *
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.
8 *
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.
13 *
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
17 */
18
19#include <stdarg.h>
20#include "windef.h"
21#include "winbase.h"
22#include "wine/debug.h"
23#include "winscard.h"
24#include "winternl.h"
25
27
29
33
34
36{
37 TRACE("%p,%x,%p\n", hinstDLL, fdwReason, lpvReserved);
38
39 switch (fdwReason)
40 {
43 /* FIXME: for now, we act as if the pcsc daemon is always started */
45 break;
47 if (lpvReserved) break;
49 break;
50 }
51
52 return TRUE;
53}
54
56{
57 return g_startedEvent;
58}
59
61{
62 LONG retval;
63 UNICODE_STRING readerW, groupW;
64
66 else readerW.Buffer = NULL;
68 else groupW.Buffer = NULL;
69
70 retval = SCardAddReaderToGroupW(context, readerW.Buffer, groupW.Buffer);
71
72 RtlFreeUnicodeString(&readerW);
73 RtlFreeUnicodeString(&groupW);
74
75 return retval;
76}
77
79{
80 FIXME("%x %s %s\n", (unsigned int) context, debugstr_w(reader), debugstr_w(group));
81 return SCARD_S_SUCCESS;
82}
83
85 LPCVOID pvReserved2, LPSCARDCONTEXT phContext)
86{
87 FIXME("(%x,%p,%p,%p) stub\n", dwScope, pvReserved1, pvReserved2, phContext);
90}
91
93{
94 FIXME("(%lx) stub\n", context);
97}
98
99LONG WINAPI SCardListCardsA(SCARDCONTEXT hContext, LPCBYTE pbAtr, LPCGUID rgguidInterfaces, DWORD cguidInterfaceCount, LPSTR mszCards, LPDWORD pcchCards)
100{
101 FIXME(": stub\n");
104}
105
107{
108 FIXME("(%lx) stub\n", context);
111}
112
113LONG WINAPI SCardStatusA(SCARDHANDLE context, LPSTR szReaderName, LPDWORD pcchReaderLen, LPDWORD pdwState, LPDWORD pdwProtocol, LPBYTE pbAtr, LPDWORD pcbAtrLen)
114{
115 FIXME("(%lx) stub\n", context);
118}
119
120LONG WINAPI SCardStatusW(SCARDHANDLE context, LPWSTR szReaderName, LPDWORD pcchReaderLen, LPDWORD pdwState,LPDWORD pdwProtocol,LPBYTE pbAtr,LPDWORD pcbArtLen)
121{
122 FIXME("(%lx) stub\n", context);
125}
126
128{
129 FIXME("stub\n");
130}
131
133{
134 FIXME("(%lx, %s, %p, %p) stub\n", context, debugstr_a(groups), readers, buflen);
136}
137
139{
140 FIXME("(%lx, %s, %p, %p) stub\n", context, debugstr_w(groups), readers, buflen);
142}
143
145{
146 FIXME("(%lx) stub\n", context);
149}
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
#define FIXME(fmt,...)
Definition: debug.h:111
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define CloseHandle
Definition: compat.h:739
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:102
#define DLL_PROCESS_ATTACH
Definition: compat.h:131
#define DLL_PROCESS_DETACH
Definition: compat.h:130
#define SetLastError(x)
Definition: compat.h:752
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
Definition: loader.c:85
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
GLsizei GLuint * groups
Definition: glext.h:11113
GLboolean GLuint group
Definition: glext.h:11120
#define debugstr_a
Definition: kernel32.h:31
#define debugstr_w
Definition: kernel32.h:32
static IN DWORD IN LPVOID lpvReserved
NTSYSAPI BOOLEAN NTAPI RtlCreateUnicodeStringFromAsciiz(_Out_ PUNICODE_STRING Destination, _In_ PCSZ Source)
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
long LONG
Definition: pedump.c:60
static struct reader readers[]
Definition: readers.c:921
#define SCARD_F_INTERNAL_ERROR
Definition: scarderr.h:32
#define SCARD_S_SUCCESS
Definition: scarderr.h:31
#define SCARD_E_NO_READERS_AVAILABLE
Definition: scarderr.h:77
#define TRACE(s)
Definition: solgame.cpp:4
Definition: http.c:7252
Definition: reader.h:84
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventA(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCSTR lpName OPTIONAL)
Definition: synch.c:637
unsigned char * LPBYTE
Definition: typedefs.h:53
uint32_t * LPDWORD
Definition: typedefs.h:59
CONST void * LPCVOID
Definition: windef.h:191
#define WINAPI
Definition: msvc.h:6
void WINAPI SCardReleaseStartedEvent(void)
Definition: winscard.c:127
const SCARD_IO_REQUEST g_rgSCardT1Pci
Definition: winscard.c:31
LONG WINAPI SCardReleaseContext(SCARDCONTEXT context)
Definition: winscard.c:106
const SCARD_IO_REQUEST g_rgSCardRawPci
Definition: winscard.c:32
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
Definition: winscard.c:35
LONG WINAPI SCardAddReaderToGroupA(SCARDCONTEXT context, LPCSTR reader, LPCSTR group)
Definition: winscard.c:60
LONG WINAPI SCardIsValidContext(SCARDCONTEXT context)
Definition: winscard.c:92
LONG WINAPI SCardListCardsA(SCARDCONTEXT hContext, LPCBYTE pbAtr, LPCGUID rgguidInterfaces, DWORD cguidInterfaceCount, LPSTR mszCards, LPDWORD pcchCards)
Definition: winscard.c:99
static HANDLE g_startedEvent
Definition: winscard.c:28
LONG WINAPI SCardListReadersA(SCARDCONTEXT context, const CHAR *groups, CHAR *readers, DWORD *buflen)
Definition: winscard.c:132
LONG WINAPI SCardStatusA(SCARDHANDLE context, LPSTR szReaderName, LPDWORD pcchReaderLen, LPDWORD pdwState, LPDWORD pdwProtocol, LPBYTE pbAtr, LPDWORD pcbAtrLen)
Definition: winscard.c:113
LONG WINAPI SCardAddReaderToGroupW(SCARDCONTEXT context, LPCWSTR reader, LPCWSTR group)
Definition: winscard.c:78
LONG WINAPI SCardListReadersW(SCARDCONTEXT context, const WCHAR *groups, WCHAR *readers, DWORD *buflen)
Definition: winscard.c:138
LONG WINAPI SCardStatusW(SCARDHANDLE context, LPWSTR szReaderName, LPDWORD pcchReaderLen, LPDWORD pdwState, LPDWORD pdwProtocol, LPBYTE pbAtr, LPDWORD pcbArtLen)
Definition: winscard.c:120
HANDLE WINAPI SCardAccessStartedEvent(void)
Definition: winscard.c:55
LONG WINAPI SCardCancel(SCARDCONTEXT context)
Definition: winscard.c:144
LONG WINAPI SCardEstablishContext(DWORD dwScope, LPCVOID pvReserved1, LPCVOID pvReserved2, LPSCARDCONTEXT phContext)
Definition: winscard.c:84
const SCARD_IO_REQUEST g_rgSCardT0Pci
Definition: winscard.c:30
ULONG_PTR SCARDCONTEXT
Definition: winscard.h:37
ULONG_PTR SCARDHANDLE
Definition: winscard.h:38
const BYTE * LPCBYTE
Definition: winscard.h:34
ULONG_PTR * LPSCARDCONTEXT
Definition: winscard.h:37
#define SCARD_PROTOCOL_T1
Definition: winsmcrd.h:73
#define SCARD_PROTOCOL_T0
Definition: winsmcrd.h:72
#define SCARD_PROTOCOL_RAW
Definition: winsmcrd.h:74
const char * LPCSTR
Definition: xmlstorage.h:183
char * LPSTR
Definition: xmlstorage.h:182
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
char CHAR
Definition: xmlstorage.h:175