1 /** 2 * This file has no copyright assigned and is placed in the Public Domain. 3 * This file is part of the mingw-w64 runtime package. 4 * No warranty is given; refer to the file DISCLAIMER.PD within this package. 5 */ 6 #ifndef _WINSCARD_H_ 7 #define _WINSCARD_H_ 8 9 #include <_mingw_unicode.h> 10 #include <wtypes.h> 11 #include <winioctl.h> 12 #include "winsmcrd.h" 13 #ifndef SCARD_S_SUCCESS 14 #include "SCardErr.h" 15 #endif 16 17 #ifdef __cplusplus 18 extern "C" { 19 #endif 20 21 #ifndef _LPCBYTE_DEFINED 22 #define _LPCBYTE_DEFINED 23 typedef const BYTE *LPCBYTE; 24 #endif 25 #ifndef _LPCVOID_DEFINED 26 #define _LPCVOID_DEFINED 27 typedef const VOID *LPCVOID; 28 #endif 29 30 #ifndef WINSCARDAPI 31 #define WINSCARDAPI 32 #endif 33 #ifndef WINSCARDDATA 34 #define WINSCARDDATA __declspec(dllimport) 35 #endif 36 37 WINSCARDDATA extern const SCARD_IO_REQUEST g_rgSCardT0Pci,g_rgSCardT1Pci,g_rgSCardRawPci; 38 #define SCARD_PCI_T0 (&g_rgSCardT0Pci) 39 #define SCARD_PCI_T1 (&g_rgSCardT1Pci) 40 #define SCARD_PCI_RAW (&g_rgSCardRawPci) 41 42 typedef ULONG_PTR SCARDCONTEXT; 43 typedef SCARDCONTEXT *PSCARDCONTEXT,*LPSCARDCONTEXT; 44 45 typedef ULONG_PTR SCARDHANDLE; 46 typedef SCARDHANDLE *PSCARDHANDLE,*LPSCARDHANDLE; 47 48 #define SCARD_AUTOALLOCATE (DWORD)(-1) 49 #define SCARD_SCOPE_USER 0 50 #define SCARD_SCOPE_TERMINAL 1 51 #define SCARD_SCOPE_SYSTEM 2 52 53 extern WINSCARDAPI LONG WINAPI SCardEstablishContext(DWORD dwScope,LPCVOID pvReserved1,LPCVOID pvReserved2,LPSCARDCONTEXT phContext); 54 extern WINSCARDAPI LONG WINAPI SCardReleaseContext(SCARDCONTEXT hContext); 55 extern WINSCARDAPI LONG WINAPI SCardIsValidContext(SCARDCONTEXT hContext); 56 57 #define SCARD_ALL_READERS TEXT("SCard$AllReaders\000") 58 #define SCARD_DEFAULT_READERS TEXT("SCard$DefaultReaders\000") 59 #define SCARD_LOCAL_READERS TEXT("SCard$LocalReaders\000") 60 #define SCARD_SYSTEM_READERS TEXT("SCard$SystemReaders\000") 61 62 #define SCARD_PROVIDER_PRIMARY 1 63 #define SCARD_PROVIDER_CSP 2 64 65 #define SCardListReaderGroups __MINGW_NAME_AW(SCardListReaderGroups) 66 #define SCardListReaders __MINGW_NAME_AW(SCardListReaders) 67 #define SCardListCards __MINGW_NAME_AW(SCardListCards) 68 #define SCardListInterfaces __MINGW_NAME_AW(SCardListInterfaces) 69 #define SCardGetProviderId __MINGW_NAME_AW(SCardGetProviderId) 70 #define SCardGetCardTypeProviderName __MINGW_NAME_AW(SCardGetCardTypeProviderName) 71 #define SCardIntroduceReaderGroup __MINGW_NAME_AW(SCardIntroduceReaderGroup) 72 #define SCardForgetReaderGroup __MINGW_NAME_AW(SCardForgetReaderGroup) 73 #define SCardIntroduceReader __MINGW_NAME_AW(SCardIntroduceReader) 74 #define SCardForgetReader __MINGW_NAME_AW(SCardForgetReader) 75 #define SCardAddReaderToGroup __MINGW_NAME_AW(SCardAddReaderToGroup) 76 #define SCardRemoveReaderFromGroup __MINGW_NAME_AW(SCardRemoveReaderFromGroup) 77 #define SCardIntroduceCardType __MINGW_NAME_AW(SCardIntroduceCardType) 78 #define SCardSetCardTypeProviderName __MINGW_NAME_AW(SCardSetCardTypeProviderName) 79 #define SCardForgetCardType __MINGW_NAME_AW(SCardForgetCardType) 80 81 extern WINSCARDAPI LONG WINAPI SCardListReaderGroupsA(SCARDCONTEXT hContext,LPSTR mszGroups,LPDWORD pcchGroups); 82 extern WINSCARDAPI LONG WINAPI SCardListReaderGroupsW(SCARDCONTEXT hContext,LPWSTR mszGroups,LPDWORD pcchGroups); 83 extern WINSCARDAPI LONG WINAPI SCardListReadersA(SCARDCONTEXT hContext,LPCSTR mszGroups,LPSTR mszReaders,LPDWORD pcchReaders); 84 extern WINSCARDAPI LONG WINAPI SCardListReadersW(SCARDCONTEXT hContext,LPCWSTR mszGroups,LPWSTR mszReaders,LPDWORD pcchReaders); 85 extern WINSCARDAPI LONG WINAPI SCardListCardsA(SCARDCONTEXT hContext,LPCBYTE pbAtr,LPCGUID rgquidInterfaces,DWORD cguidInterfaceCount,LPSTR mszCards,LPDWORD pcchCards); 86 extern WINSCARDAPI LONG WINAPI SCardListCardsW(SCARDCONTEXT hContext,LPCBYTE pbAtr,LPCGUID rgquidInterfaces,DWORD cguidInterfaceCount,LPWSTR mszCards,LPDWORD pcchCards); 87 #define SCardListCardTypes SCardListCards 88 extern WINSCARDAPI LONG WINAPI SCardListInterfacesA(SCARDCONTEXT hContext,LPCSTR szCard,LPGUID pguidInterfaces,LPDWORD pcguidInterfaces); 89 extern WINSCARDAPI LONG WINAPI SCardListInterfacesW(SCARDCONTEXT hContext,LPCWSTR szCard,LPGUID pguidInterfaces,LPDWORD pcguidInterfaces); 90 extern WINSCARDAPI LONG WINAPI SCardGetProviderIdA(SCARDCONTEXT hContext,LPCSTR szCard,LPGUID pguidProviderId); 91 extern WINSCARDAPI LONG WINAPI SCardGetProviderIdW(SCARDCONTEXT hContext,LPCWSTR szCard,LPGUID pguidProviderId); 92 extern WINSCARDAPI LONG WINAPI SCardGetCardTypeProviderNameA(SCARDCONTEXT hContext,LPCSTR szCardName,DWORD dwProviderId,LPSTR szProvider,LPDWORD pcchProvider); 93 extern WINSCARDAPI LONG WINAPI SCardGetCardTypeProviderNameW(SCARDCONTEXT hContext,LPCWSTR szCardName,DWORD dwProviderId,LPWSTR szProvider,LPDWORD pcchProvider); 94 extern WINSCARDAPI LONG WINAPI SCardIntroduceReaderGroupA(SCARDCONTEXT hContext,LPCSTR szGroupName); 95 extern WINSCARDAPI LONG WINAPI SCardIntroduceReaderGroupW(SCARDCONTEXT hContext,LPCWSTR szGroupName); 96 extern WINSCARDAPI LONG WINAPI SCardForgetReaderGroupA(SCARDCONTEXT hContext,LPCSTR szGroupName); 97 extern WINSCARDAPI LONG WINAPI SCardForgetReaderGroupW(SCARDCONTEXT hContext,LPCWSTR szGroupName); 98 extern WINSCARDAPI LONG WINAPI SCardIntroduceReaderA(SCARDCONTEXT hContext,LPCSTR szReaderName,LPCSTR szDeviceName); 99 extern WINSCARDAPI LONG WINAPI SCardIntroduceReaderW(SCARDCONTEXT hContext,LPCWSTR szReaderName,LPCWSTR szDeviceName); 100 extern WINSCARDAPI LONG WINAPI SCardForgetReaderA(SCARDCONTEXT hContext,LPCSTR szReaderName); 101 extern WINSCARDAPI LONG WINAPI SCardForgetReaderW(SCARDCONTEXT hContext,LPCWSTR szReaderName); 102 extern WINSCARDAPI LONG WINAPI SCardAddReaderToGroupA(SCARDCONTEXT hContext,LPCSTR szReaderName,LPCSTR szGroupName); 103 extern WINSCARDAPI LONG WINAPI SCardAddReaderToGroupW(SCARDCONTEXT hContext,LPCWSTR szReaderName,LPCWSTR szGroupName); 104 extern WINSCARDAPI LONG WINAPI SCardRemoveReaderFromGroupA(SCARDCONTEXT hContext,LPCSTR szReaderName,LPCSTR szGroupName); 105 extern WINSCARDAPI LONG WINAPI SCardRemoveReaderFromGroupW(SCARDCONTEXT hContext,LPCWSTR szReaderName,LPCWSTR szGroupName); 106 extern WINSCARDAPI LONG WINAPI SCardIntroduceCardTypeA(SCARDCONTEXT hContext,LPCSTR szCardName,LPCGUID pguidPrimaryProvider,LPCGUID rgguidInterfaces,DWORD dwInterfaceCount,LPCBYTE pbAtr,LPCBYTE pbAtrMask,DWORD cbAtrLen); 107 extern WINSCARDAPI LONG WINAPI SCardIntroduceCardTypeW(SCARDCONTEXT hContext,LPCWSTR szCardName,LPCGUID pguidPrimaryProvider,LPCGUID rgguidInterfaces,DWORD dwInterfaceCount,LPCBYTE pbAtr,LPCBYTE pbAtrMask,DWORD cbAtrLen); 108 109 #define PCSCardIntroduceCardType(hContext,szCardName,pbAtr,pbAtrMask,cbAtrLen,pguidPrimaryProvider,rgguidInterfaces,dwInterfaceCount) SCardIntroduceCardType(hContext,szCardName,pguidPrimaryProvider,rgguidInterfaces,dwInterfaceCount,pbAtr,pbAtrMask,cbAtrLen) 110 111 extern WINSCARDAPI LONG WINAPI SCardSetCardTypeProviderNameA(SCARDCONTEXT hContext,LPCSTR szCardName,DWORD dwProviderId,LPCSTR szProvider); 112 extern WINSCARDAPI LONG WINAPI SCardSetCardTypeProviderNameW(SCARDCONTEXT hContext,LPCWSTR szCardName,DWORD dwProviderId,LPCWSTR szProvider); 113 extern WINSCARDAPI LONG WINAPI SCardForgetCardTypeA(SCARDCONTEXT hContext,LPCSTR szCardName); 114 extern WINSCARDAPI LONG WINAPI SCardForgetCardTypeW(SCARDCONTEXT hContext,LPCWSTR szCardName); 115 extern WINSCARDAPI LONG WINAPI SCardFreeMemory(SCARDCONTEXT hContext,LPCVOID pvMem); 116 extern WINSCARDAPI HANDLE WINAPI SCardAccessStartedEvent(void); 117 extern WINSCARDAPI void WINAPI SCardReleaseStartedEvent(void); 118 119 typedef struct { 120 LPCSTR szReader; 121 LPVOID pvUserData; 122 DWORD dwCurrentState; 123 DWORD dwEventState; 124 DWORD cbAtr; 125 BYTE rgbAtr[36]; 126 } SCARD_READERSTATEA,*PSCARD_READERSTATEA,*LPSCARD_READERSTATEA; 127 128 typedef struct { 129 LPCWSTR szReader; 130 LPVOID pvUserData; 131 DWORD dwCurrentState; 132 DWORD dwEventState; 133 DWORD cbAtr; 134 BYTE rgbAtr[36]; 135 } SCARD_READERSTATEW,*PSCARD_READERSTATEW,*LPSCARD_READERSTATEW; 136 137 __MINGW_TYPEDEF_AW(SCARD_READERSTATE) 138 __MINGW_TYPEDEF_AW(PSCARD_READERSTATE) 139 __MINGW_TYPEDEF_AW(LPSCARD_READERSTATE) 140 141 #define SCardLocateCards __MINGW_NAME_AW(SCardLocateCards) 142 #define SCardLocateCardsByATR __MINGW_NAME_AW(SCardLocateCardsByATR) 143 #define SCardGetStatusChange __MINGW_NAME_AW(SCardGetStatusChange) 144 #define SCardConnect __MINGW_NAME_AW(SCardConnect) 145 #define SCardStatus __MINGW_NAME_AW(SCardStatus) 146 147 #define SCARD_READERSTATE_A SCARD_READERSTATEA 148 #define SCARD_READERSTATE_W SCARD_READERSTATEW 149 #define PSCARD_READERSTATE_A PSCARD_READERSTATEA 150 #define PSCARD_READERSTATE_W PSCARD_READERSTATEW 151 #define LPSCARD_READERSTATE_A LPSCARD_READERSTATEA 152 #define LPSCARD_READERSTATE_W LPSCARD_READERSTATEW 153 154 #define SCARD_STATE_UNAWARE 0x00000000 155 #define SCARD_STATE_IGNORE 0x00000001 156 #define SCARD_STATE_CHANGED 0x00000002 157 #define SCARD_STATE_UNKNOWN 0x00000004 158 #define SCARD_STATE_UNAVAILABLE 0x00000008 159 #define SCARD_STATE_EMPTY 0x00000010 160 #define SCARD_STATE_PRESENT 0x00000020 161 #define SCARD_STATE_ATRMATCH 0x00000040 162 #define SCARD_STATE_EXCLUSIVE 0x00000080 163 #define SCARD_STATE_INUSE 0x00000100 164 #define SCARD_STATE_MUTE 0x00000200 165 #define SCARD_STATE_UNPOWERED 0x00000400 166 167 extern WINSCARDAPI LONG WINAPI SCardLocateCardsA(SCARDCONTEXT hContext,LPCSTR mszCards,LPSCARD_READERSTATEA rgReaderStates,DWORD cReaders); 168 extern WINSCARDAPI LONG WINAPI SCardLocateCardsW(SCARDCONTEXT hContext,LPCWSTR mszCards,LPSCARD_READERSTATEW rgReaderStates,DWORD cReaders); 169 170 typedef struct _SCARD_ATRMASK { 171 DWORD cbAtr; 172 BYTE rgbAtr[36]; 173 BYTE rgbMask[36]; 174 } SCARD_ATRMASK,*PSCARD_ATRMASK,*LPSCARD_ATRMASK; 175 176 extern WINSCARDAPI LONG WINAPI SCardLocateCardsByATRA(SCARDCONTEXT hContext,LPSCARD_ATRMASK rgAtrMasks,DWORD cAtrs,LPSCARD_READERSTATEA rgReaderStates,DWORD cReaders); 177 extern WINSCARDAPI LONG WINAPI SCardLocateCardsByATRW(SCARDCONTEXT hContext,LPSCARD_ATRMASK rgAtrMasks,DWORD cAtrs,LPSCARD_READERSTATEW rgReaderStates,DWORD cReaders); 178 extern WINSCARDAPI LONG WINAPI SCardGetStatusChangeA(SCARDCONTEXT hContext,DWORD dwTimeout,LPSCARD_READERSTATEA rgReaderStates,DWORD cReaders); 179 extern WINSCARDAPI LONG WINAPI SCardGetStatusChangeW(SCARDCONTEXT hContext,DWORD dwTimeout,LPSCARD_READERSTATEW rgReaderStates,DWORD cReaders); 180 extern WINSCARDAPI LONG WINAPI SCardCancel(SCARDCONTEXT hContext); 181 182 #define SCARD_SHARE_EXCLUSIVE 1 183 #define SCARD_SHARE_SHARED 2 184 #define SCARD_SHARE_DIRECT 3 185 186 #define SCARD_LEAVE_CARD 0 187 #define SCARD_RESET_CARD 1 188 #define SCARD_UNPOWER_CARD 2 189 #define SCARD_EJECT_CARD 3 190 191 extern WINSCARDAPI LONG WINAPI SCardConnectA(SCARDCONTEXT hContext,LPCSTR szReader,DWORD dwShareMode,DWORD dwPreferredProtocols,LPSCARDHANDLE phCard,LPDWORD pdwActiveProtocol); 192 extern WINSCARDAPI LONG WINAPI SCardConnectW(SCARDCONTEXT hContext,LPCWSTR szReader,DWORD dwShareMode,DWORD dwPreferredProtocols,LPSCARDHANDLE phCard,LPDWORD pdwActiveProtocol); 193 extern WINSCARDAPI LONG WINAPI SCardReconnect(SCARDHANDLE hCard,DWORD dwShareMode,DWORD dwPreferredProtocols,DWORD dwInitialization,LPDWORD pdwActiveProtocol); 194 extern WINSCARDAPI LONG WINAPI SCardDisconnect(SCARDHANDLE hCard,DWORD dwDisposition); 195 extern WINSCARDAPI LONG WINAPI SCardBeginTransaction(SCARDHANDLE hCard); 196 extern WINSCARDAPI LONG WINAPI SCardEndTransaction(SCARDHANDLE hCard,DWORD dwDisposition); 197 extern WINSCARDAPI LONG WINAPI SCardCancelTransaction(SCARDHANDLE hCard); 198 extern WINSCARDAPI LONG WINAPI SCardState(SCARDHANDLE hCard,LPDWORD pdwState,LPDWORD pdwProtocol,LPBYTE pbAtr,LPDWORD pcbAtrLen); 199 extern WINSCARDAPI LONG WINAPI SCardStatusA(SCARDHANDLE hCard,LPSTR szReaderName,LPDWORD pcchReaderLen,LPDWORD pdwState,LPDWORD pdwProtocol,LPBYTE pbAtr,LPDWORD pcbAtrLen); 200 extern WINSCARDAPI LONG WINAPI SCardStatusW(SCARDHANDLE hCard,LPWSTR szReaderName,LPDWORD pcchReaderLen,LPDWORD pdwState,LPDWORD pdwProtocol,LPBYTE pbAtr,LPDWORD pcbAtrLen); 201 extern WINSCARDAPI LONG WINAPI SCardTransmit(SCARDHANDLE hCard,LPCSCARD_IO_REQUEST pioSendPci,LPCBYTE pbSendBuffer,DWORD cbSendLength,LPSCARD_IO_REQUEST pioRecvPci,LPBYTE pbRecvBuffer,LPDWORD pcbRecvLength); 202 extern WINSCARDAPI LONG WINAPI SCardControl(SCARDHANDLE hCard,DWORD dwControlCode,LPCVOID lpInBuffer,DWORD nInBufferSize,LPVOID lpOutBuffer,DWORD nOutBufferSize,LPDWORD lpBytesReturned); 203 extern WINSCARDAPI LONG WINAPI SCardGetAttrib(SCARDHANDLE hCard,DWORD dwAttrId,LPBYTE pbAttr,LPDWORD pcbAttrLen); 204 205 #define SCardGetReaderCapabilities SCardGetAttrib 206 207 extern WINSCARDAPI LONG WINAPI SCardSetAttrib(SCARDHANDLE hCard,DWORD dwAttrId,LPCBYTE pbAttr,DWORD cbAttrLen); 208 209 #define SCardSetReaderCapabilities SCardSetAttrib 210 211 #define SC_DLG_MINIMAL_UI 0x01 212 #define SC_DLG_NO_UI 0x02 213 #define SC_DLG_FORCE_UI 0x04 214 215 #define SCERR_NOCARDNAME 0x4000 216 #define SCERR_NOGUIDS 0x8000 217 218 #define LPOCNCONNPROC __MINGW_NAME_AW(LPOCNCONNPROC) 219 220 typedef SCARDHANDLE (WINAPI *LPOCNCONNPROCA) (SCARDCONTEXT,LPSTR,LPSTR,PVOID); 221 typedef SCARDHANDLE (WINAPI *LPOCNCONNPROCW) (SCARDCONTEXT,LPWSTR,LPWSTR,PVOID); 222 typedef WINBOOL (WINAPI *LPOCNCHKPROC) (SCARDCONTEXT,SCARDHANDLE,PVOID); 223 typedef void (WINAPI *LPOCNDSCPROC) (SCARDCONTEXT,SCARDHANDLE,PVOID); 224 225 typedef struct { 226 DWORD dwStructSize; 227 LPSTR lpstrGroupNames; 228 DWORD nMaxGroupNames; 229 LPCGUID rgguidInterfaces; 230 DWORD cguidInterfaces; 231 LPSTR lpstrCardNames; 232 DWORD nMaxCardNames; 233 LPOCNCHKPROC lpfnCheck; 234 LPOCNCONNPROCA lpfnConnect; 235 LPOCNDSCPROC lpfnDisconnect; 236 LPVOID pvUserData; 237 DWORD dwShareMode; 238 DWORD dwPreferredProtocols; 239 } OPENCARD_SEARCH_CRITERIAA,*POPENCARD_SEARCH_CRITERIAA,*LPOPENCARD_SEARCH_CRITERIAA; 240 241 typedef struct { 242 DWORD dwStructSize; 243 LPWSTR lpstrGroupNames; 244 DWORD nMaxGroupNames; 245 LPCGUID rgguidInterfaces; 246 DWORD cguidInterfaces; 247 LPWSTR lpstrCardNames; 248 DWORD nMaxCardNames; 249 LPOCNCHKPROC lpfnCheck; 250 LPOCNCONNPROCW lpfnConnect; 251 LPOCNDSCPROC lpfnDisconnect; 252 LPVOID pvUserData; 253 DWORD dwShareMode; 254 DWORD dwPreferredProtocols; 255 } OPENCARD_SEARCH_CRITERIAW,*POPENCARD_SEARCH_CRITERIAW,*LPOPENCARD_SEARCH_CRITERIAW; 256 257 __MINGW_TYPEDEF_AW(OPENCARD_SEARCH_CRITERIA) 258 __MINGW_TYPEDEF_AW(POPENCARD_SEARCH_CRITERIA) 259 __MINGW_TYPEDEF_AW(LPOPENCARD_SEARCH_CRITERIA) 260 261 typedef struct { 262 DWORD dwStructSize; 263 SCARDCONTEXT hSCardContext; 264 HWND hwndOwner; 265 DWORD dwFlags; 266 LPCSTR lpstrTitle; 267 LPCSTR lpstrSearchDesc; 268 HICON hIcon; 269 POPENCARD_SEARCH_CRITERIAA pOpenCardSearchCriteria; 270 LPOCNCONNPROCA lpfnConnect; 271 LPVOID pvUserData; 272 DWORD dwShareMode; 273 DWORD dwPreferredProtocols; 274 LPSTR lpstrRdr; 275 DWORD nMaxRdr; 276 LPSTR lpstrCard; 277 DWORD nMaxCard; 278 DWORD dwActiveProtocol; 279 SCARDHANDLE hCardHandle; 280 } OPENCARDNAME_EXA,*POPENCARDNAME_EXA,*LPOPENCARDNAME_EXA; 281 282 typedef struct { 283 DWORD dwStructSize; 284 SCARDCONTEXT hSCardContext; 285 HWND hwndOwner; 286 DWORD dwFlags; 287 LPCWSTR lpstrTitle; 288 LPCWSTR lpstrSearchDesc; 289 HICON hIcon; 290 POPENCARD_SEARCH_CRITERIAW pOpenCardSearchCriteria; 291 LPOCNCONNPROCW lpfnConnect; 292 LPVOID pvUserData; 293 DWORD dwShareMode; 294 DWORD dwPreferredProtocols; 295 LPWSTR lpstrRdr; 296 DWORD nMaxRdr; 297 LPWSTR lpstrCard; 298 DWORD nMaxCard; 299 DWORD dwActiveProtocol; 300 SCARDHANDLE hCardHandle; 301 } OPENCARDNAME_EXW,*POPENCARDNAME_EXW,*LPOPENCARDNAME_EXW; 302 303 __MINGW_TYPEDEF_AW(OPENCARDNAME_EX) 304 __MINGW_TYPEDEF_AW(POPENCARDNAME_EX) 305 __MINGW_TYPEDEF_AW(LPOPENCARDNAME_EX) 306 307 #define OPENCARDNAMEA_EX OPENCARDNAME_EXA 308 #define OPENCARDNAMEW_EX OPENCARDNAME_EXW 309 #define POPENCARDNAMEA_EX POPENCARDNAME_EXA 310 #define POPENCARDNAMEW_EX POPENCARDNAME_EXW 311 #define LPOPENCARDNAMEA_EX LPOPENCARDNAME_EXA 312 #define LPOPENCARDNAMEW_EX LPOPENCARDNAME_EXW 313 314 #define SCardUIDlgSelectCard __MINGW_NAME_AW(SCardUIDlgSelectCard) 315 316 extern WINSCARDAPI LONG WINAPI SCardUIDlgSelectCardA(LPOPENCARDNAMEA_EX); 317 extern WINSCARDAPI LONG WINAPI SCardUIDlgSelectCardW(LPOPENCARDNAMEW_EX); 318 319 typedef struct { 320 DWORD dwStructSize; 321 HWND hwndOwner; 322 SCARDCONTEXT hSCardContext; 323 LPSTR lpstrGroupNames; 324 DWORD nMaxGroupNames; 325 LPSTR lpstrCardNames; 326 DWORD nMaxCardNames; 327 LPCGUID rgguidInterfaces; 328 DWORD cguidInterfaces; 329 LPSTR lpstrRdr; 330 DWORD nMaxRdr; 331 LPSTR lpstrCard; 332 DWORD nMaxCard; 333 LPCSTR lpstrTitle; 334 DWORD dwFlags; 335 LPVOID pvUserData; 336 DWORD dwShareMode; 337 DWORD dwPreferredProtocols; 338 DWORD dwActiveProtocol; 339 LPOCNCONNPROCA lpfnConnect; 340 LPOCNCHKPROC lpfnCheck; 341 LPOCNDSCPROC lpfnDisconnect; 342 SCARDHANDLE hCardHandle; 343 } OPENCARDNAMEA,*POPENCARDNAMEA,*LPOPENCARDNAMEA; 344 345 typedef struct { 346 DWORD dwStructSize; 347 HWND hwndOwner; 348 SCARDCONTEXT hSCardContext; 349 LPWSTR lpstrGroupNames; 350 DWORD nMaxGroupNames; 351 LPWSTR lpstrCardNames; 352 DWORD nMaxCardNames; 353 LPCGUID rgguidInterfaces; 354 DWORD cguidInterfaces; 355 LPWSTR lpstrRdr; 356 DWORD nMaxRdr; 357 LPWSTR lpstrCard; 358 DWORD nMaxCard; 359 LPCWSTR lpstrTitle; 360 DWORD dwFlags; 361 LPVOID pvUserData; 362 DWORD dwShareMode; 363 DWORD dwPreferredProtocols; 364 DWORD dwActiveProtocol; 365 LPOCNCONNPROCW lpfnConnect; 366 LPOCNCHKPROC lpfnCheck; 367 LPOCNDSCPROC lpfnDisconnect; 368 SCARDHANDLE hCardHandle; 369 } OPENCARDNAMEW,*POPENCARDNAMEW,*LPOPENCARDNAMEW; 370 371 __MINGW_TYPEDEF_AW(OPENCARDNAME) 372 __MINGW_TYPEDEF_AW(POPENCARDNAME) 373 __MINGW_TYPEDEF_AW(LPOPENCARDNAME) 374 375 #define OPENCARDNAME_A OPENCARDNAMEA 376 #define OPENCARDNAME_W OPENCARDNAMEW 377 #define POPENCARDNAME_A POPENCARDNAMEA 378 #define POPENCARDNAME_W POPENCARDNAMEW 379 #define LPOPENCARDNAME_A LPOPENCARDNAMEA 380 #define LPOPENCARDNAME_W LPOPENCARDNAMEW 381 382 #define GetOpenCardName __MINGW_NAME_AW(GetOpenCardName) 383 384 extern WINSCARDAPI LONG WINAPI GetOpenCardNameA(LPOPENCARDNAMEA); 385 extern WINSCARDAPI LONG WINAPI GetOpenCardNameW(LPOPENCARDNAMEW); 386 extern WINSCARDAPI LONG WINAPI SCardDlgExtendedError(void); 387 388 #if (_WIN32_WINNT >= 0x0600) 389 LONG WINAPI SCardGetTransmitCount( 390 SCARDHANDLE hCard, 391 LPDWORD pcTransmitCount 392 ); 393 394 LONG WINAPI SCardReadCacheA( 395 SCARDCONTEXT hContext, 396 UUID *CardIdentifier, 397 DWORD FreshnessCounter, 398 LPSTR LookupName, 399 PBYTE Data, 400 DWORD *DataLen 401 ); 402 403 LONG WINAPI SCardReadCacheW( 404 SCARDCONTEXT hContext, 405 UUID *CardIdentifier, 406 DWORD FreshnessCounter, 407 LPWSTR LookupName, 408 PBYTE Data, 409 DWORD *DataLen 410 ); 411 412 #define SCardReadCache __MINGW_NAME_AW(SCardReadCache) 413 414 LONG WINAPI SCardWriteCacheA( 415 SCARDCONTEXT hContext, 416 UUID *CardIdentifier, 417 DWORD FreshnessCounter, 418 LPSTR LookupName, 419 PBYTE Data, 420 DWORD DataLen 421 ); 422 423 LONG WINAPI SCardWriteCacheW( 424 SCARDCONTEXT hContext, 425 UUID *CardIdentifier, 426 DWORD FreshnessCounter, 427 LPWSTR LookupName, 428 PBYTE Data, 429 DWORD DataLen 430 ); 431 432 #define SCardWriteCache __MINGW_NAME_AW(SCardWriteCache) 433 434 #endif /*(_WIN32_WINNT >= 0x0600)*/ 435 436 #ifdef __cplusplus 437 } 438 #endif 439 #endif 440