ReactOS  0.4.13-dev-259-g5ca9c9c
winscard.c File Reference
#include "config.h"
#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)
 

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 36 of file winscard.c.

37 {
38  TRACE("%p,%x,%p\n", hinstDLL, fdwReason, lpvReserved);
39 
40  switch (fdwReason)
41  {
42  case DLL_PROCESS_ATTACH:
43  DisableThreadLibraryCalls(hinstDLL);
44  /* FIXME: for now, we act as if the pcsc daemon is always started */
46  break;
47  case DLL_PROCESS_DETACH:
48  if (lpvReserved) break;
50  break;
51  }
52 
53  return TRUE;
54 }
#define TRUE
Definition: types.h:120
#define CloseHandle
Definition: compat.h:398
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:583
#define DLL_PROCESS_DETACH
Definition: compat.h:119
#define TRACE(s)
Definition: solgame.cpp:4
static HANDLE g_startedEvent
Definition: winscard.c:29

◆ SCardAccessStartedEvent()

HANDLE WINAPI SCardAccessStartedEvent ( void  )

Definition at line 56 of file winscard.c.

57 {
58  return g_startedEvent;
59 }
static HANDLE g_startedEvent
Definition: winscard.c:29

◆ SCardAddReaderToGroupA()

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

Definition at line 61 of file winscard.c.

62 {
63  LONG retval;
64  UNICODE_STRING readerW, groupW;
65 
67  else readerW.Buffer = NULL;
69  else groupW.Buffer = NULL;
70 
71  retval = SCardAddReaderToGroupW(context, readerW.Buffer, groupW.Buffer);
72 
73  RtlFreeUnicodeString(&readerW);
74  RtlFreeUnicodeString(&groupW);
75 
76  return retval;
77 }
Definition: http.c:6587
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:79

◆ SCardAddReaderToGroupW()

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

Definition at line 79 of file winscard.c.

80 {
81  FIXME("%x %s %s\n", (unsigned int) context, debugstr_w(reader), debugstr_w(group));
82  return SCARD_S_SUCCESS;
83 }
Definition: http.c:6587
#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().

◆ SCardEstablishContext()

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

Definition at line 85 of file winscard.c.

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

◆ SCardIsValidContext()

LONG WINAPI SCardIsValidContext ( SCARDCONTEXT  context)

Definition at line 93 of file winscard.c.

94 {
95  FIXME("(%lx) stub\n", context);
98 }
Definition: http.c:6587
#define SCARD_F_INTERNAL_ERROR
Definition: scarderr.h:32
#define FIXME(fmt,...)
Definition: debug.h:110
#define SetLastError(x)
Definition: compat.h:409
#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 100 of file winscard.c.

101 {
102  FIXME(": stub\n");
104  return SCARD_F_INTERNAL_ERROR;
105 }
#define SCARD_F_INTERNAL_ERROR
Definition: scarderr.h:32
#define FIXME(fmt,...)
Definition: debug.h:110
#define SetLastError(x)
Definition: compat.h:409
#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 133 of file winscard.c.

134 {
135  FIXME("(%lx, %s, %p, %p) stub\n", context, debugstr_a(groups), readers, buflen);
137 }
Definition: http.c:6587
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 139 of file winscard.c.

140 {
141  FIXME("(%lx, %s, %p, %p) stub\n", context, debugstr_w(groups), readers, buflen);
143 }
Definition: http.c:6587
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 107 of file winscard.c.

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

◆ SCardReleaseStartedEvent()

void WINAPI SCardReleaseStartedEvent ( void  )

Definition at line 128 of file winscard.c.

129 {
130  FIXME("stub\n");
131 }
#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 114 of file winscard.c.

115 {
116  FIXME("(%lx) stub\n", context);
118  return SCARD_F_INTERNAL_ERROR;
119 }
Definition: http.c:6587
#define SCARD_F_INTERNAL_ERROR
Definition: scarderr.h:32
#define FIXME(fmt,...)
Definition: debug.h:110
#define SetLastError(x)
Definition: compat.h:409
#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 121 of file winscard.c.

122 {
123  FIXME("(%lx) stub\n", context);
125  return SCARD_F_INTERNAL_ERROR;
126 }
Definition: http.c:6587
#define SCARD_F_INTERNAL_ERROR
Definition: scarderr.h:32
#define FIXME(fmt,...)
Definition: debug.h:110
#define SetLastError(x)
Definition: compat.h:409
#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 33 of file winscard.c.

◆ g_rgSCardT0Pci

const SCARD_IO_REQUEST g_rgSCardT0Pci = { SCARD_PROTOCOL_T0, 8 }

Definition at line 31 of file winscard.c.

◆ g_rgSCardT1Pci

const SCARD_IO_REQUEST g_rgSCardT1Pci = { SCARD_PROTOCOL_T1, 8 }

Definition at line 32 of file winscard.c.

◆ g_startedEvent

HANDLE g_startedEvent = NULL
static

Definition at line 29 of file winscard.c.

Referenced by DllMain(), and SCardAccessStartedEvent().