ReactOS  0.4.14-dev-845-g8381e29
winscard.c File Reference
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "wine/debug.h"
#include "winscard.h"
#include "winternl.h"
Include dependency graph for winscard.c:

Go to the source code of this file.

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (winscard)
 
BOOL WINAPI DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
 
HANDLE WINAPI SCardAccessStartedEvent (void)
 
LONG WINAPI SCardAddReaderToGroupA (SCARDCONTEXT context, LPCSTR reader, LPCSTR group)
 
LONG WINAPI SCardAddReaderToGroupW (SCARDCONTEXT context, LPCWSTR reader, LPCWSTR group)
 
LONG WINAPI SCardEstablishContext (DWORD dwScope, LPCVOID pvReserved1, LPCVOID pvReserved2, LPSCARDCONTEXT phContext)
 
LONG WINAPI SCardIsValidContext (SCARDCONTEXT context)
 
LONG WINAPI SCardListCardsA (SCARDCONTEXT hContext, LPCBYTE pbAtr, LPCGUID rgguidInterfaces, DWORD cguidInterfaceCount, LPSTR mszCards, LPDWORD pcchCards)
 
LONG WINAPI SCardReleaseContext (SCARDCONTEXT context)
 
LONG WINAPI SCardStatusA (SCARDHANDLE context, LPSTR szReaderName, LPDWORD pcchReaderLen, LPDWORD pdwState, LPDWORD pdwProtocol, LPBYTE pbAtr, LPDWORD pcbAtrLen)
 
LONG WINAPI SCardStatusW (SCARDHANDLE context, LPWSTR szReaderName, LPDWORD pcchReaderLen, LPDWORD pdwState, LPDWORD pdwProtocol, LPBYTE pbAtr, LPDWORD pcbArtLen)
 
void WINAPI SCardReleaseStartedEvent (void)
 
LONG WINAPI SCardListReadersA (SCARDCONTEXT context, const CHAR *groups, CHAR *readers, DWORD *buflen)
 
LONG WINAPI SCardListReadersW (SCARDCONTEXT context, const WCHAR *groups, WCHAR *readers, DWORD *buflen)
 
LONG WINAPI SCardCancel (SCARDCONTEXT context)
 

Variables

static HANDLE g_startedEvent = NULL
 
const SCARD_IO_REQUEST g_rgSCardT0Pci = { SCARD_PROTOCOL_T0, 8 }
 
const SCARD_IO_REQUEST g_rgSCardT1Pci = { SCARD_PROTOCOL_T1, 8 }
 
const SCARD_IO_REQUEST g_rgSCardRawPci = { SCARD_PROTOCOL_RAW, 8 }
 

Function Documentation

◆ DllMain()

BOOL WINAPI DllMain ( HINSTANCE  hinstDLL,
DWORD  fdwReason,
LPVOID  lpvReserved 
)

Definition at line 35 of file winscard.c.

36 {
37  TRACE("%p,%x,%p\n", hinstDLL, fdwReason, lpvReserved);
38 
39  switch (fdwReason)
40  {
41  case DLL_PROCESS_ATTACH:
42  DisableThreadLibraryCalls(hinstDLL);
43  /* FIXME: for now, we act as if the pcsc daemon is always started */
45  break;
46  case DLL_PROCESS_DETACH:
47  if (lpvReserved) break;
49  break;
50  }
51 
52  return TRUE;
53 }
#define TRUE
Definition: types.h:120
#define CloseHandle
Definition: compat.h:406
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
Definition: loader.c:85
#define DLL_PROCESS_ATTACH
Definition: compat.h:120
static IN DWORD IN LPVOID lpvReserved
smooth NULL
Definition: ftsmooth.c:416
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventA(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCSTR lpName OPTIONAL)
Definition: synch.c:637
#define DLL_PROCESS_DETACH
Definition: compat.h:119
#define TRACE(s)
Definition: solgame.cpp:4
static HANDLE g_startedEvent
Definition: winscard.c:28

◆ SCardAccessStartedEvent()

HANDLE WINAPI SCardAccessStartedEvent ( void  )

Definition at line 55 of file winscard.c.

56 {
57  return g_startedEvent;
58 }
static HANDLE g_startedEvent
Definition: winscard.c:28

◆ SCardAddReaderToGroupA()

LONG WINAPI SCardAddReaderToGroupA ( SCARDCONTEXT  context,
LPCSTR  reader,
LPCSTR  group 
)

Definition at line 60 of file winscard.c.

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 }
Definition: http.c:7094
long LONG
Definition: pedump.c:60
smooth NULL
Definition: ftsmooth.c:416
NTSYSAPI BOOLEAN NTAPI RtlCreateUnicodeStringFromAsciiz(_Out_ PUNICODE_STRING Destination, _In_ PCSZ Source)
GLboolean GLuint group
Definition: glext.h:11120
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
Definition: reader.h:83
LONG WINAPI SCardAddReaderToGroupW(SCARDCONTEXT context, LPCWSTR reader, LPCWSTR group)
Definition: winscard.c:78

◆ SCardAddReaderToGroupW()

LONG WINAPI SCardAddReaderToGroupW ( SCARDCONTEXT  context,
LPCWSTR  reader,
LPCWSTR  group 
)

Definition at line 78 of file winscard.c.

79 {
80  FIXME("%x %s %s\n", (unsigned int) context, debugstr_w(reader), debugstr_w(group));
81  return SCARD_S_SUCCESS;
82 }
Definition: http.c:7094
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:110
GLboolean GLuint group
Definition: glext.h:11120
#define SCARD_S_SUCCESS
Definition: scarderr.h:31
Definition: reader.h:83

Referenced by SCardAddReaderToGroupA().

◆ SCardCancel()

LONG WINAPI SCardCancel ( SCARDCONTEXT  context)

Definition at line 144 of file winscard.c.

145 {
146  FIXME("(%lx) stub\n", context);
148  return SCARD_F_INTERNAL_ERROR;
149 }
Definition: http.c:7094
#define SCARD_F_INTERNAL_ERROR
Definition: scarderr.h:32
#define FIXME(fmt,...)
Definition: debug.h:110
#define SetLastError(x)
Definition: compat.h:417
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:92

◆ SCardEstablishContext()

LONG WINAPI SCardEstablishContext ( DWORD  dwScope,
LPCVOID  pvReserved1,
LPCVOID  pvReserved2,
LPSCARDCONTEXT  phContext 
)

Definition at line 84 of file winscard.c.

86 {
87  FIXME("(%x,%p,%p,%p) stub\n", dwScope, pvReserved1, pvReserved2, phContext);
90 }
#define SCARD_F_INTERNAL_ERROR
Definition: scarderr.h:32
#define FIXME(fmt,...)
Definition: debug.h:110
#define SetLastError(x)
Definition: compat.h:417
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:92

◆ SCardIsValidContext()

LONG WINAPI SCardIsValidContext ( SCARDCONTEXT  context)

Definition at line 92 of file winscard.c.

93 {
94  FIXME("(%lx) stub\n", context);
97 }
Definition: http.c:7094
#define SCARD_F_INTERNAL_ERROR
Definition: scarderr.h:32
#define FIXME(fmt,...)
Definition: debug.h:110
#define SetLastError(x)
Definition: compat.h:417
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:92

◆ SCardListCardsA()

LONG WINAPI SCardListCardsA ( SCARDCONTEXT  hContext,
LPCBYTE  pbAtr,
LPCGUID  rgguidInterfaces,
DWORD  cguidInterfaceCount,
LPSTR  mszCards,
LPDWORD  pcchCards 
)

Definition at line 99 of file winscard.c.

100 {
101  FIXME(": stub\n");
103  return SCARD_F_INTERNAL_ERROR;
104 }
#define SCARD_F_INTERNAL_ERROR
Definition: scarderr.h:32
#define FIXME(fmt,...)
Definition: debug.h:110
#define SetLastError(x)
Definition: compat.h:417
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:92

◆ SCardListReadersA()

LONG WINAPI SCardListReadersA ( SCARDCONTEXT  context,
const CHAR groups,
CHAR readers,
DWORD buflen 
)

Definition at line 132 of file winscard.c.

133 {
134  FIXME("(%lx, %s, %p, %p) stub\n", context, debugstr_a(groups), readers, buflen);
136 }
Definition: http.c:7094
GLsizei GLuint * groups
Definition: glext.h:11113
#define FIXME(fmt,...)
Definition: debug.h:110
static struct reader readers[]
Definition: readers.c:908
#define debugstr_a
Definition: kernel32.h:31
#define SCARD_E_NO_READERS_AVAILABLE
Definition: scarderr.h:77

◆ SCardListReadersW()

LONG WINAPI SCardListReadersW ( SCARDCONTEXT  context,
const WCHAR groups,
WCHAR readers,
DWORD buflen 
)

Definition at line 138 of file winscard.c.

139 {
140  FIXME("(%lx, %s, %p, %p) stub\n", context, debugstr_w(groups), readers, buflen);
142 }
Definition: http.c:7094
GLsizei GLuint * groups
Definition: glext.h:11113
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:110
static struct reader readers[]
Definition: readers.c:908
#define SCARD_E_NO_READERS_AVAILABLE
Definition: scarderr.h:77

◆ SCardReleaseContext()

LONG WINAPI SCardReleaseContext ( SCARDCONTEXT  context)

Definition at line 106 of file winscard.c.

107 {
108  FIXME("(%lx) stub\n", context);
110  return SCARD_F_INTERNAL_ERROR;
111 }
Definition: http.c:7094
#define SCARD_F_INTERNAL_ERROR
Definition: scarderr.h:32
#define FIXME(fmt,...)
Definition: debug.h:110
#define SetLastError(x)
Definition: compat.h:417
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:92

◆ SCardReleaseStartedEvent()

void WINAPI SCardReleaseStartedEvent ( void  )

Definition at line 127 of file winscard.c.

128 {
129  FIXME("stub\n");
130 }
#define FIXME(fmt,...)
Definition: debug.h:110

◆ SCardStatusA()

LONG WINAPI SCardStatusA ( SCARDHANDLE  context,
LPSTR  szReaderName,
LPDWORD  pcchReaderLen,
LPDWORD  pdwState,
LPDWORD  pdwProtocol,
LPBYTE  pbAtr,
LPDWORD  pcbAtrLen 
)

Definition at line 113 of file winscard.c.

114 {
115  FIXME("(%lx) stub\n", context);
117  return SCARD_F_INTERNAL_ERROR;
118 }
Definition: http.c:7094
#define SCARD_F_INTERNAL_ERROR
Definition: scarderr.h:32
#define FIXME(fmt,...)
Definition: debug.h:110
#define SetLastError(x)
Definition: compat.h:417
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:92

◆ SCardStatusW()

LONG WINAPI SCardStatusW ( SCARDHANDLE  context,
LPWSTR  szReaderName,
LPDWORD  pcchReaderLen,
LPDWORD  pdwState,
LPDWORD  pdwProtocol,
LPBYTE  pbAtr,
LPDWORD  pcbArtLen 
)

Definition at line 120 of file winscard.c.

121 {
122  FIXME("(%lx) stub\n", context);
124  return SCARD_F_INTERNAL_ERROR;
125 }
Definition: http.c:7094
#define SCARD_F_INTERNAL_ERROR
Definition: scarderr.h:32
#define FIXME(fmt,...)
Definition: debug.h:110
#define SetLastError(x)
Definition: compat.h:417
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:92

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( winscard  )

Variable Documentation

◆ g_rgSCardRawPci

const SCARD_IO_REQUEST g_rgSCardRawPci = { SCARD_PROTOCOL_RAW, 8 }

Definition at line 32 of file winscard.c.

◆ g_rgSCardT0Pci

const SCARD_IO_REQUEST g_rgSCardT0Pci = { SCARD_PROTOCOL_T0, 8 }

Definition at line 30 of file winscard.c.

◆ g_rgSCardT1Pci

const SCARD_IO_REQUEST g_rgSCardT1Pci = { SCARD_PROTOCOL_T1, 8 }

Definition at line 31 of file winscard.c.

◆ g_startedEvent

HANDLE g_startedEvent = NULL
static

Definition at line 28 of file winscard.c.

Referenced by DllMain(), and SCardAccessStartedEvent().