Overview
Comment: | Updated to build using mingw32-w64 built-in winscard |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: | a2b7df3c9a039c292e3aed01e7469e764070d4ed |
User & Date: | rkeene on 2012-07-19 05:39:06 |
Other Links: | manifest | tags |
Context
2012-07-19
| ||
05:43 | Corrected name of new Windows compiler check-in: 39dd453bcd user: rkeene tags: trunk | |
05:39 | Updated to build using mingw32-w64 built-in winscard check-in: a2b7df3c9a user: rkeene tags: trunk | |
05:39 | Subversion to Fossil Copy Commit. Please Ignore. Recording copying build/cackey_win32_build/include/pthread.h to build/cackey_win64_build/include/pthread.h. check-in: 5bd5ef312f user: rkeene tags: trunk | |
Changes
Modified build/cackey_win64_build/build.sh from [3415fb284b] to [57487d4186].
1 1 #! /bin/bash 2 2 3 3 make distclean 4 4 5 -cp "./build/cackey_win64_build/lib/winscard.dll" "./build/cackey_win64_build/lib/WinSCard.dll" 6 - 7 5 ./configure --with-pcsc-headers="$(pwd)/build/cackey_win64_build/include" --with-pcsc-libs="-L$(pwd)/build/cackey_win64_build/lib -lwinscard" --host=amd64-mingw32msvc CPPFLAGS="-I$(pwd)/build/cackey_win64_build/include" || exit 1 8 6 9 7 make || exit 1 10 8 11 -rm -f "./build/cackey_win64_build/lib/WinSCard.dll" 12 - 13 9 exit 0
Deleted build/cackey_win64_build/include/SCardErr.h version [969de80f85].
1 -/* 2 - scarderr.mc 3 - 4 - Error message codes from the Smart Card Resource Manager 5 - These messages must be reconciled with winerror.w 6 - They exist here to provide error messages on pre-Win2K systems. 7 - 8 -*/ 9 -#ifndef SCARD_S_SUCCESS 10 -// 11 -// ============================= 12 -// Facility SCARD Error Messages 13 -// ============================= 14 -// 15 -#define SCARD_S_SUCCESS NO_ERROR 16 -// 17 -// Values are 32 bit values laid out as follows: 18 -// 19 -// 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 20 -// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 21 -// +---+-+-+-----------------------+-------------------------------+ 22 -// |Sev|C|R| Facility | Code | 23 -// +---+-+-+-----------------------+-------------------------------+ 24 -// 25 -// where 26 -// 27 -// Sev - is the severity code 28 -// 29 -// 00 - Success 30 -// 01 - Informational 31 -// 10 - Warning 32 -// 11 - Error 33 -// 34 -// C - is the Customer code flag 35 -// 36 -// R - is a reserved bit 37 -// 38 -// Facility - is the facility code 39 -// 40 -// Code - is the facility's status code 41 -// 42 -// 43 -// Define the facility codes 44 -// 45 -#define FACILITY_SYSTEM 0x0 46 -#define FACILITY_SCARD 0x10 47 - 48 - 49 -// 50 -// Define the severity codes 51 -// 52 -#define STATUS_SEVERITY_WARNING 0x2 53 -#define STATUS_SEVERITY_INFORMATIONAL 0x1 54 -#define STATUS_SEVERITY_ERROR 0x3 55 - 56 - 57 -// 58 -// MessageId: SCARD_F_INTERNAL_ERROR 59 -// 60 -// MessageText: 61 -// 62 -// An internal consistency check failed. 63 -// 64 -#define SCARD_F_INTERNAL_ERROR ((DWORD)0x80100001L) 65 - 66 -// 67 -// MessageId: SCARD_E_CANCELLED 68 -// 69 -// MessageText: 70 -// 71 -// The action was cancelled by an SCardCancel request. 72 -// 73 -#define SCARD_E_CANCELLED ((DWORD)0x80100002L) 74 - 75 -// 76 -// MessageId: SCARD_E_INVALID_HANDLE 77 -// 78 -// MessageText: 79 -// 80 -// The supplied handle was invalid. 81 -// 82 -#define SCARD_E_INVALID_HANDLE ((DWORD)0x80100003L) 83 - 84 -// 85 -// MessageId: SCARD_E_INVALID_PARAMETER 86 -// 87 -// MessageText: 88 -// 89 -// One or more of the supplied parameters could not be properly interpreted. 90 -// 91 -#define SCARD_E_INVALID_PARAMETER ((DWORD)0x80100004L) 92 - 93 -// 94 -// MessageId: SCARD_E_INVALID_TARGET 95 -// 96 -// MessageText: 97 -// 98 -// Registry startup information is missing or invalid. 99 -// 100 -#define SCARD_E_INVALID_TARGET ((DWORD)0x80100005L) 101 - 102 -// 103 -// MessageId: SCARD_E_NO_MEMORY 104 -// 105 -// MessageText: 106 -// 107 -// Not enough memory available to complete this command. 108 -// 109 -#define SCARD_E_NO_MEMORY ((DWORD)0x80100006L) 110 - 111 -// 112 -// MessageId: SCARD_F_WAITED_TOO_LONG 113 -// 114 -// MessageText: 115 -// 116 -// An internal consistency timer has expired. 117 -// 118 -#define SCARD_F_WAITED_TOO_LONG ((DWORD)0x80100007L) 119 - 120 -// 121 -// MessageId: SCARD_E_INSUFFICIENT_BUFFER 122 -// 123 -// MessageText: 124 -// 125 -// The data buffer to receive returned data is too small for the returned data. 126 -// 127 -#define SCARD_E_INSUFFICIENT_BUFFER ((DWORD)0x80100008L) 128 - 129 -// 130 -// MessageId: SCARD_E_UNKNOWN_READER 131 -// 132 -// MessageText: 133 -// 134 -// The specified reader name is not recognized. 135 -// 136 -#define SCARD_E_UNKNOWN_READER ((DWORD)0x80100009L) 137 - 138 -// 139 -// MessageId: SCARD_E_TIMEOUT 140 -// 141 -// MessageText: 142 -// 143 -// The user-specified timeout value has expired. 144 -// 145 -#define SCARD_E_TIMEOUT ((DWORD)0x8010000AL) 146 - 147 -// 148 -// MessageId: SCARD_E_SHARING_VIOLATION 149 -// 150 -// MessageText: 151 -// 152 -// The smart card cannot be accessed because of other connections outstanding. 153 -// 154 -#define SCARD_E_SHARING_VIOLATION ((DWORD)0x8010000BL) 155 - 156 -// 157 -// MessageId: SCARD_E_NO_SMARTCARD 158 -// 159 -// MessageText: 160 -// 161 -// The operation requires a Smart Card, but no Smart Card is currently in the device. 162 -// 163 -#define SCARD_E_NO_SMARTCARD ((DWORD)0x8010000CL) 164 - 165 -// 166 -// MessageId: SCARD_E_UNKNOWN_CARD 167 -// 168 -// MessageText: 169 -// 170 -// The specified smart card name is not recognized. 171 -// 172 -#define SCARD_E_UNKNOWN_CARD ((DWORD)0x8010000DL) 173 - 174 -// 175 -// MessageId: SCARD_E_CANT_DISPOSE 176 -// 177 -// MessageText: 178 -// 179 -// The system could not dispose of the media in the requested manner. 180 -// 181 -#define SCARD_E_CANT_DISPOSE ((DWORD)0x8010000EL) 182 - 183 -// 184 -// MessageId: SCARD_E_PROTO_MISMATCH 185 -// 186 -// MessageText: 187 -// 188 -// The requested protocols are incompatible with the protocol currently in use with the smart card. 189 -// 190 -#define SCARD_E_PROTO_MISMATCH ((DWORD)0x8010000FL) 191 - 192 -// 193 -// MessageId: SCARD_E_NOT_READY 194 -// 195 -// MessageText: 196 -// 197 -// The reader or smart card is not ready to accept commands. 198 -// 199 -#define SCARD_E_NOT_READY ((DWORD)0x80100010L) 200 - 201 -// 202 -// MessageId: SCARD_E_INVALID_VALUE 203 -// 204 -// MessageText: 205 -// 206 -// One or more of the supplied parameters values could not be properly interpreted. 207 -// 208 -#define SCARD_E_INVALID_VALUE ((DWORD)0x80100011L) 209 - 210 -// 211 -// MessageId: SCARD_E_SYSTEM_CANCELLED 212 -// 213 -// MessageText: 214 -// 215 -// The action was cancelled by the system, presumably to log off or shut down. 216 -// 217 -#define SCARD_E_SYSTEM_CANCELLED ((DWORD)0x80100012L) 218 - 219 -// 220 -// MessageId: SCARD_F_COMM_ERROR 221 -// 222 -// MessageText: 223 -// 224 -// An internal communications error has been detected. 225 -// 226 -#define SCARD_F_COMM_ERROR ((DWORD)0x80100013L) 227 - 228 -// 229 -// MessageId: SCARD_F_UNKNOWN_ERROR 230 -// 231 -// MessageText: 232 -// 233 -// An internal error has been detected, but the source is unknown. 234 -// 235 -#define SCARD_F_UNKNOWN_ERROR ((DWORD)0x80100014L) 236 - 237 -// 238 -// MessageId: SCARD_E_INVALID_ATR 239 -// 240 -// MessageText: 241 -// 242 -// An ATR obtained from the registry is not a valid ATR string. 243 -// 244 -#define SCARD_E_INVALID_ATR ((DWORD)0x80100015L) 245 - 246 -// 247 -// MessageId: SCARD_E_NOT_TRANSACTED 248 -// 249 -// MessageText: 250 -// 251 -// An attempt was made to end a non-existent transaction. 252 -// 253 -#define SCARD_E_NOT_TRANSACTED ((DWORD)0x80100016L) 254 - 255 -// 256 -// MessageId: SCARD_E_READER_UNAVAILABLE 257 -// 258 -// MessageText: 259 -// 260 -// The specified reader is not currently available for use. 261 -// 262 -#define SCARD_E_READER_UNAVAILABLE ((DWORD)0x80100017L) 263 - 264 -// 265 -// MessageId: SCARD_P_SHUTDOWN 266 -// 267 -// MessageText: 268 -// 269 -// The operation has been aborted to allow the server application to exit. 270 -// 271 -#define SCARD_P_SHUTDOWN ((DWORD)0x80100018L) 272 - 273 -// 274 -// MessageId: SCARD_E_PCI_TOO_SMALL 275 -// 276 -// MessageText: 277 -// 278 -// The PCI Receive buffer was too small. 279 -// 280 -#define SCARD_E_PCI_TOO_SMALL ((DWORD)0x80100019L) 281 - 282 -// 283 -// MessageId: SCARD_E_READER_UNSUPPORTED 284 -// 285 -// MessageText: 286 -// 287 -// The reader driver does not meet minimal requirements for support. 288 -// 289 -#define SCARD_E_READER_UNSUPPORTED ((DWORD)0x8010001AL) 290 - 291 -// 292 -// MessageId: SCARD_E_DUPLICATE_READER 293 -// 294 -// MessageText: 295 -// 296 -// The reader driver did not produce a unique reader name. 297 -// 298 -#define SCARD_E_DUPLICATE_READER ((DWORD)0x8010001BL) 299 - 300 -// 301 -// MessageId: SCARD_E_CARD_UNSUPPORTED 302 -// 303 -// MessageText: 304 -// 305 -// The smart card does not meet minimal requirements for support. 306 -// 307 -#define SCARD_E_CARD_UNSUPPORTED ((DWORD)0x8010001CL) 308 - 309 -// 310 -// MessageId: SCARD_E_NO_SERVICE 311 -// 312 -// MessageText: 313 -// 314 -// The Smart card resource manager is not running. 315 -// 316 -#define SCARD_E_NO_SERVICE ((DWORD)0x8010001DL) 317 - 318 -// 319 -// MessageId: SCARD_E_SERVICE_STOPPED 320 -// 321 -// MessageText: 322 -// 323 -// The Smart card resource manager has shut down. 324 -// 325 -#define SCARD_E_SERVICE_STOPPED ((DWORD)0x8010001EL) 326 - 327 -// 328 -// MessageId: SCARD_E_UNEXPECTED 329 -// 330 -// MessageText: 331 -// 332 -// An unexpected card error has occurred. 333 -// 334 -#define SCARD_E_UNEXPECTED ((DWORD)0x8010001FL) 335 - 336 -// 337 -// MessageId: SCARD_E_ICC_INSTALLATION 338 -// 339 -// MessageText: 340 -// 341 -// No Primary Provider can be found for the smart card. 342 -// 343 -#define SCARD_E_ICC_INSTALLATION ((DWORD)0x80100020L) 344 - 345 -// 346 -// MessageId: SCARD_E_ICC_CREATEORDER 347 -// 348 -// MessageText: 349 -// 350 -// The requested order of object creation is not supported. 351 -// 352 -#define SCARD_E_ICC_CREATEORDER ((DWORD)0x80100021L) 353 - 354 -// 355 -// MessageId: SCARD_E_UNSUPPORTED_FEATURE 356 -// 357 -// MessageText: 358 -// 359 -// This smart card does not support the requested feature. 360 -// 361 -#define SCARD_E_UNSUPPORTED_FEATURE ((DWORD)0x80100022L) 362 - 363 -// 364 -// MessageId: SCARD_E_DIR_NOT_FOUND 365 -// 366 -// MessageText: 367 -// 368 -// The identified directory does not exist in the smart card. 369 -// 370 -#define SCARD_E_DIR_NOT_FOUND ((DWORD)0x80100023L) 371 - 372 -// 373 -// MessageId: SCARD_E_FILE_NOT_FOUND 374 -// 375 -// MessageText: 376 -// 377 -// The identified file does not exist in the smart card. 378 -// 379 -#define SCARD_E_FILE_NOT_FOUND ((DWORD)0x80100024L) 380 - 381 -// 382 -// MessageId: SCARD_E_NO_DIR 383 -// 384 -// MessageText: 385 -// 386 -// The supplied path does not represent a smart card directory. 387 -// 388 -#define SCARD_E_NO_DIR ((DWORD)0x80100025L) 389 - 390 -// 391 -// MessageId: SCARD_E_NO_FILE 392 -// 393 -// MessageText: 394 -// 395 -// The supplied path does not represent a smart card file. 396 -// 397 -#define SCARD_E_NO_FILE ((DWORD)0x80100026L) 398 - 399 -// 400 -// MessageId: SCARD_E_NO_ACCESS 401 -// 402 -// MessageText: 403 -// 404 -// Access is denied to this file. 405 -// 406 -#define SCARD_E_NO_ACCESS ((DWORD)0x80100027L) 407 - 408 -// 409 -// MessageId: SCARD_E_WRITE_TOO_MANY 410 -// 411 -// MessageText: 412 -// 413 -// The smartcard does not have enough memory to store the information. 414 -// 415 -#define SCARD_E_WRITE_TOO_MANY ((DWORD)0x80100028L) 416 - 417 -// 418 -// MessageId: SCARD_E_BAD_SEEK 419 -// 420 -// MessageText: 421 -// 422 -// There was an error trying to set the smart card file object pointer. 423 -// 424 -#define SCARD_E_BAD_SEEK ((DWORD)0x80100029L) 425 - 426 -// 427 -// MessageId: SCARD_E_INVALID_CHV 428 -// 429 -// MessageText: 430 -// 431 -// The supplied PIN is incorrect. 432 -// 433 -#define SCARD_E_INVALID_CHV ((DWORD)0x8010002AL) 434 - 435 -// 436 -// MessageId: SCARD_E_UNKNOWN_RES_MNG 437 -// 438 -// MessageText: 439 -// 440 -// An unrecognized error code was returned from a layered component. 441 -// 442 -#define SCARD_E_UNKNOWN_RES_MNG ((DWORD)0x8010002BL) 443 - 444 -// 445 -// MessageId: SCARD_E_NO_SUCH_CERTIFICATE 446 -// 447 -// MessageText: 448 -// 449 -// The requested certificate does not exist. 450 -// 451 -#define SCARD_E_NO_SUCH_CERTIFICATE ((DWORD)0x8010002CL) 452 - 453 -// 454 -// MessageId: SCARD_E_CERTIFICATE_UNAVAILABLE 455 -// 456 -// MessageText: 457 -// 458 -// The requested certificate could not be obtained. 459 -// 460 -#define SCARD_E_CERTIFICATE_UNAVAILABLE ((DWORD)0x8010002DL) 461 - 462 -// 463 -// MessageId: SCARD_E_NO_READERS_AVAILABLE 464 -// 465 -// MessageText: 466 -// 467 -// Cannot find a smart card reader. 468 -// 469 -#define SCARD_E_NO_READERS_AVAILABLE ((DWORD)0x8010002EL) 470 - 471 -// 472 -// MessageId: SCARD_E_COMM_DATA_LOST 473 -// 474 -// MessageText: 475 -// 476 -// A communications error with the smart card has been detected. Retry the operation. 477 -// 478 -#define SCARD_E_COMM_DATA_LOST ((DWORD)0x8010002FL) 479 - 480 -// 481 -// MessageId: SCARD_E_NO_KEY_CONTAINER 482 -// 483 -// MessageText: 484 -// 485 -// The requested key container does not exist on the smart card. 486 -// 487 -#define SCARD_E_NO_KEY_CONTAINER ((DWORD)0x80100030L) 488 - 489 -// 490 -// MessageId: SCARD_E_SERVER_TOO_BUSY 491 -// 492 -// MessageText: 493 -// 494 -// The Smart card resource manager is too busy to complete this operation. 495 -// 496 -#define SCARD_E_SERVER_TOO_BUSY ((DWORD)0x80100031L) 497 - 498 -// 499 -// MessageId: SCARD_E_PIN_CACHE_EXPIRED 500 -// 501 -// MessageText: 502 -// 503 -// The smart card PIN cache has expired. 504 -// 505 -#define SCARD_E_PIN_CACHE_EXPIRED ((DWORD)0x80100032L) 506 - 507 -// 508 -// MessageId: SCARD_E_NO_PIN_CACHE 509 -// 510 -// MessageText: 511 -// 512 -// The smart card PIN cannot be cached. 513 -// 514 -#define SCARD_E_NO_PIN_CACHE ((DWORD)0x80100033L) 515 - 516 -// 517 -// MessageId: SCARD_E_READ_ONLY_CARD 518 -// 519 -// MessageText: 520 -// 521 -// The smart card is read only and cannot be written to. 522 -// 523 -#define SCARD_E_READ_ONLY_CARD ((DWORD)0x80100034L) 524 - 525 -// 526 -// These are warning codes. 527 -// 528 -// 529 -// MessageId: SCARD_W_UNSUPPORTED_CARD 530 -// 531 -// MessageText: 532 -// 533 -// The reader cannot communicate with the smart card, due to ATR configuration conflicts. 534 -// 535 -#define SCARD_W_UNSUPPORTED_CARD ((DWORD)0x80100065L) 536 - 537 -// 538 -// MessageId: SCARD_W_UNRESPONSIVE_CARD 539 -// 540 -// MessageText: 541 -// 542 -// The smart card is not responding to a reset. 543 -// 544 -#define SCARD_W_UNRESPONSIVE_CARD ((DWORD)0x80100066L) 545 - 546 -// 547 -// MessageId: SCARD_W_UNPOWERED_CARD 548 -// 549 -// MessageText: 550 -// 551 -// Power has been removed from the smart card, so that further communication is not possible. 552 -// 553 -#define SCARD_W_UNPOWERED_CARD ((DWORD)0x80100067L) 554 - 555 -// 556 -// MessageId: SCARD_W_RESET_CARD 557 -// 558 -// MessageText: 559 -// 560 -// The smart card has been reset, so any shared state information is invalid. 561 -// 562 -#define SCARD_W_RESET_CARD ((DWORD)0x80100068L) 563 - 564 -// 565 -// MessageId: SCARD_W_REMOVED_CARD 566 -// 567 -// MessageText: 568 -// 569 -// The smart card has been removed, so that further communication is not possible. 570 -// 571 -#define SCARD_W_REMOVED_CARD ((DWORD)0x80100069L) 572 - 573 -// 574 -// MessageId: SCARD_W_SECURITY_VIOLATION 575 -// 576 -// MessageText: 577 -// 578 -// Access was denied because of a security violation. 579 -// 580 -#define SCARD_W_SECURITY_VIOLATION ((DWORD)0x8010006AL) 581 - 582 -// 583 -// MessageId: SCARD_W_WRONG_CHV 584 -// 585 -// MessageText: 586 -// 587 -// The card cannot be accessed because the wrong PIN was presented. 588 -// 589 -#define SCARD_W_WRONG_CHV ((DWORD)0x8010006BL) 590 - 591 -// 592 -// MessageId: SCARD_W_CHV_BLOCKED 593 -// 594 -// MessageText: 595 -// 596 -// The card cannot be accessed because the maximum number of PIN entry attempts has been reached. 597 -// 598 -#define SCARD_W_CHV_BLOCKED ((DWORD)0x8010006CL) 599 - 600 -// 601 -// MessageId: SCARD_W_EOF 602 -// 603 -// MessageText: 604 -// 605 -// The end of the smart card file has been reached. 606 -// 607 -#define SCARD_W_EOF ((DWORD)0x8010006DL) 608 - 609 -// 610 -// MessageId: SCARD_W_CANCELLED_BY_USER 611 -// 612 -// MessageText: 613 -// 614 -// The action was cancelled by the user. 615 -// 616 -#define SCARD_W_CANCELLED_BY_USER ((DWORD)0x8010006EL) 617 - 618 -// 619 -// MessageId: SCARD_W_CARD_NOT_AUTHENTICATED 620 -// 621 -// MessageText: 622 -// 623 -// No PIN was presented to the smart card. 624 -// 625 -#define SCARD_W_CARD_NOT_AUTHENTICATED ((DWORD)0x8010006FL) 626 - 627 -// 628 -// MessageId: SCARD_W_CACHE_ITEM_NOT_FOUND 629 -// 630 -// MessageText: 631 -// 632 -// The requested item could not be found in the cache. 633 -// 634 -#define SCARD_W_CACHE_ITEM_NOT_FOUND ((DWORD)0x80100070L) 635 - 636 -// 637 -// MessageId: SCARD_W_CACHE_ITEM_STALE 638 -// 639 -// MessageText: 640 -// 641 -// The requested cache item is too old and was deleted from the cache. 642 -// 643 -#define SCARD_W_CACHE_ITEM_STALE ((DWORD)0x80100071L) 644 - 645 -// 646 -// MessageId: SCARD_W_CACHE_ITEM_TOO_BIG 647 -// 648 -// MessageText: 649 -// 650 -// The new cache item exceeds the maximum per-item size defined for the cache. 651 -// 652 -#define SCARD_W_CACHE_ITEM_TOO_BIG ((DWORD)0x80100072L) 653 - 654 -#endif // SCARD_S_SUCCESS 655 -
Deleted build/cackey_win64_build/include/winscard.h version [62b1252f08].
1 -/*++ 2 - 3 -Copyright (c) 1996 Microsoft Corporation 4 - 5 -Module Name: 6 - 7 - WinSCard 8 - 9 -Abstract: 10 - 11 - This header file provides the definitions and symbols necessary for an 12 - Application or Smart Card Service Provider to access the Smartcard 13 - Subsystem. 14 - 15 -Environment: 16 - 17 - Win32 18 - 19 -Notes: 20 - 21 ---*/ 22 - 23 -#ifndef _WINSCARD_H_ 24 -#define _WINSCARD_H_ 25 - 26 -#if defined (_MSC_VER) && (_MSC_VER >= 1020) 27 -#pragma once 28 -#endif 29 - 30 -#include <wtypes.h> 31 -#include <winioctl.h> 32 -#include "winsmcrd.h" 33 -#ifndef SCARD_S_SUCCESS 34 -#include "SCardErr.h" 35 -#endif 36 - 37 -#ifdef __cplusplus 38 -extern "C" { 39 -#endif 40 - 41 -#ifndef _LPCBYTE_DEFINED 42 -#define _LPCBYTE_DEFINED 43 -typedef const BYTE *LPCBYTE; 44 -#endif 45 -#ifndef _LPCVOID_DEFINED 46 -#define _LPCVOID_DEFINED 47 -typedef const VOID *LPCVOID; 48 -#endif 49 - 50 -#ifndef WINSCARDAPI 51 -#define WINSCARDAPI 52 -#endif 53 -#ifndef WINSCARDDATA 54 -#define WINSCARDDATA __declspec(dllimport) 55 -#endif 56 - 57 -/* In clr:pure we cannot mark data export with dllimport. 58 - * We should add small functions which returns the value of 59 - * the global. 60 - */ 61 -#if !defined(_M_CEE_PURE) 62 -WINSCARDDATA extern const SCARD_IO_REQUEST 63 - g_rgSCardT0Pci, 64 - g_rgSCardT1Pci, 65 - g_rgSCardRawPci; 66 -#define SCARD_PCI_T0 (&g_rgSCardT0Pci) 67 -#define SCARD_PCI_T1 (&g_rgSCardT1Pci) 68 -#define SCARD_PCI_RAW (&g_rgSCardRawPci) 69 -#endif 70 - 71 -// 72 -//////////////////////////////////////////////////////////////////////////////// 73 -// 74 -// Service Manager Access Services 75 -// 76 -// The following services are used to manage user and terminal contexts for 77 -// Smart Cards. 78 -// 79 - 80 -typedef ULONG_PTR SCARDCONTEXT; 81 -typedef SCARDCONTEXT *PSCARDCONTEXT, *LPSCARDCONTEXT; 82 - 83 -typedef ULONG_PTR SCARDHANDLE; 84 -typedef SCARDHANDLE *PSCARDHANDLE, *LPSCARDHANDLE; 85 - 86 -#define SCARD_AUTOALLOCATE (DWORD)(-1) 87 - 88 -#define SCARD_SCOPE_USER 0 // The context is a user context, and any 89 - // database operations are performed within the 90 - // domain of the user. 91 -#define SCARD_SCOPE_TERMINAL 1 // The context is that of the current terminal, 92 - // and any database operations are performed 93 - // within the domain of that terminal. (The 94 - // calling application must have appropriate 95 - // access permissions for any database actions.) 96 -#define SCARD_SCOPE_SYSTEM 2 // The context is the system context, and any 97 - // database operations are performed within the 98 - // domain of the system. (The calling 99 - // application must have appropriate access 100 - // permissions for any database actions.) 101 - 102 -extern WINSCARDAPI LONG WINAPI 103 -SCardEstablishContext( 104 - __in DWORD dwScope, 105 - __reserved LPCVOID pvReserved1, 106 - __reserved LPCVOID pvReserved2, 107 - __out LPSCARDCONTEXT phContext); 108 - 109 -extern WINSCARDAPI LONG WINAPI 110 -SCardReleaseContext( 111 - __in SCARDCONTEXT hContext); 112 - 113 -extern WINSCARDAPI LONG WINAPI 114 -SCardIsValidContext( 115 - __in SCARDCONTEXT hContext); 116 - 117 - 118 -// 119 -//////////////////////////////////////////////////////////////////////////////// 120 -// 121 -// Smart Card Database Management Services 122 -// 123 -// The following services provide for managing the Smart Card Database. 124 -// 125 - 126 -#define SCARD_ALL_READERS TEXT("SCard$AllReaders\000") 127 -#define SCARD_DEFAULT_READERS TEXT("SCard$DefaultReaders\000") 128 -#define SCARD_LOCAL_READERS TEXT("SCard$LocalReaders\000") 129 -#define SCARD_SYSTEM_READERS TEXT("SCard$SystemReaders\000") 130 - 131 -#define SCARD_PROVIDER_PRIMARY 1 // Primary Provider Id 132 -#define SCARD_PROVIDER_CSP 2 // Crypto Service Provider Id 133 -#define SCARD_PROVIDER_KSP 3 // Key Storage Provider Id 134 - 135 - 136 -// 137 -// Database Reader routines 138 -// 139 - 140 -extern WINSCARDAPI LONG WINAPI 141 -SCardListReaderGroupsA( 142 - __in SCARDCONTEXT hContext, 143 - __nullnullterminated __out_ecount_opt(*pcchGroups) LPSTR mszGroups, 144 - __inout LPDWORD pcchGroups); 145 -extern WINSCARDAPI LONG WINAPI 146 -SCardListReaderGroupsW( 147 - __in SCARDCONTEXT hContext, 148 - __nullnullterminated __out_ecount_opt(*pcchGroups) LPWSTR mszGroups, 149 - __inout LPDWORD pcchGroups); 150 -#ifdef UNICODE 151 -#define SCardListReaderGroups SCardListReaderGroupsW 152 -#else 153 -#define SCardListReaderGroups SCardListReaderGroupsA 154 -#endif // !UNICODE 155 - 156 -extern WINSCARDAPI LONG WINAPI 157 -SCardListReadersA( 158 - __in SCARDCONTEXT hContext, 159 - __in_opt LPCSTR mszGroups, 160 - __nullnullterminated __out_ecount_opt(*pcchReaders) LPSTR mszReaders, 161 - __inout LPDWORD pcchReaders); 162 -extern WINSCARDAPI LONG WINAPI 163 -SCardListReadersW( 164 - __in SCARDCONTEXT hContext, 165 - __in_opt LPCWSTR mszGroups, 166 - __nullnullterminated __out_ecount_opt(*pcchReaders) LPWSTR mszReaders, 167 - __inout LPDWORD pcchReaders); 168 -#ifdef UNICODE 169 -#define SCardListReaders SCardListReadersW 170 -#else 171 -#define SCardListReaders SCardListReadersA 172 -#endif // !UNICODE 173 - 174 -extern WINSCARDAPI LONG WINAPI 175 -SCardListCardsA( 176 - __in SCARDCONTEXT hContext, 177 - __in_opt LPCBYTE pbAtr, 178 - __in_ecount_opt(cguidInterfaceCount) LPCGUID rgquidInterfaces, 179 - __in DWORD cguidInterfaceCount, 180 - __nullnullterminated __out_ecount_opt(*pcchCards) LPSTR mszCards, 181 - __inout LPDWORD pcchCards); 182 -extern WINSCARDAPI LONG WINAPI 183 -SCardListCardsW( 184 - __in SCARDCONTEXT hContext, 185 - __in_opt LPCBYTE pbAtr, 186 - __in_ecount_opt(cguidInterfaceCount) LPCGUID rgquidInterfaces, 187 - __in DWORD cguidInterfaceCount, 188 - __nullnullterminated __out_ecount_opt(*pcchCards) LPWSTR mszCards, 189 - __inout LPDWORD pcchCards); 190 -#ifdef UNICODE 191 -#define SCardListCards SCardListCardsW 192 -#else 193 -#define SCardListCards SCardListCardsA 194 -#endif // !UNICODE 195 -// 196 -// NOTE: The routine SCardListCards name differs from the PC/SC definition. 197 -// It should be: 198 -// 199 -// extern WINSCARDAPI LONG WINAPI 200 -// SCardListCardTypes( 201 -// __in SCARDCONTEXT hContext, 202 -// __in_opt LPCBYTE pbAtr, 203 -// __in_opt LPCGUID rgquidInterfaces, 204 -// __in DWORD cguidInterfaceCount, 205 -// __out_opt LPTSTR mszCards, 206 -// __inout LPDWORD pcchCards); 207 -// 208 -// Here's a work-around MACRO: 209 -#define SCardListCardTypes SCardListCards 210 - 211 -extern WINSCARDAPI LONG WINAPI 212 -SCardListInterfacesA( 213 - __in SCARDCONTEXT hContext, 214 - __in LPCSTR szCard, 215 - __out LPGUID pguidInterfaces, 216 - __inout LPDWORD pcguidInterfaces); 217 -extern WINSCARDAPI LONG WINAPI 218 -SCardListInterfacesW( 219 - __in SCARDCONTEXT hContext, 220 - __in LPCWSTR szCard, 221 - __out LPGUID pguidInterfaces, 222 - __inout LPDWORD pcguidInterfaces); 223 -#ifdef UNICODE 224 -#define SCardListInterfaces SCardListInterfacesW 225 -#else 226 -#define SCardListInterfaces SCardListInterfacesA 227 -#endif // !UNICODE 228 - 229 -extern WINSCARDAPI LONG WINAPI 230 -SCardGetProviderIdA( 231 - __in SCARDCONTEXT hContext, 232 - __in LPCSTR szCard, 233 - __out LPGUID pguidProviderId); 234 -extern WINSCARDAPI LONG WINAPI 235 -SCardGetProviderIdW( 236 - __in SCARDCONTEXT hContext, 237 - __in LPCWSTR szCard, 238 - __out LPGUID pguidProviderId); 239 -#ifdef UNICODE 240 -#define SCardGetProviderId SCardGetProviderIdW 241 -#else 242 -#define SCardGetProviderId SCardGetProviderIdA 243 -#endif // !UNICODE 244 -// 245 -// NOTE: The routine SCardGetProviderId in this implementation uses GUIDs. 246 -// The PC/SC definition uses BYTEs. 247 -// 248 - 249 -extern WINSCARDAPI LONG WINAPI 250 -SCardGetCardTypeProviderNameA( 251 - __in SCARDCONTEXT hContext, 252 - __in LPCSTR szCardName, 253 - __in DWORD dwProviderId, 254 - __out_ecount_opt(*pcchProvider) LPSTR szProvider, 255 - __inout LPDWORD pcchProvider); 256 -extern WINSCARDAPI LONG WINAPI 257 -SCardGetCardTypeProviderNameW( 258 - __in SCARDCONTEXT hContext, 259 - __in LPCWSTR szCardName, 260 - __in DWORD dwProviderId, 261 - __out_ecount_opt(*pcchProvider) LPWSTR szProvider, 262 - __inout LPDWORD pcchProvider); 263 -#ifdef UNICODE 264 -#define SCardGetCardTypeProviderName SCardGetCardTypeProviderNameW 265 -#else 266 -#define SCardGetCardTypeProviderName SCardGetCardTypeProviderNameA 267 -#endif // !UNICODE 268 -// 269 -// NOTE: This routine is an extension to the PC/SC definitions. 270 -// 271 - 272 - 273 -// 274 -// Database Writer routines 275 -// 276 - 277 -extern WINSCARDAPI LONG WINAPI 278 -SCardIntroduceReaderGroupA( 279 - __in SCARDCONTEXT hContext, 280 - __in LPCSTR szGroupName); 281 -extern WINSCARDAPI LONG WINAPI 282 -SCardIntroduceReaderGroupW( 283 - __in SCARDCONTEXT hContext, 284 - __in LPCWSTR szGroupName); 285 -#ifdef UNICODE 286 -#define SCardIntroduceReaderGroup SCardIntroduceReaderGroupW 287 -#else 288 -#define SCardIntroduceReaderGroup SCardIntroduceReaderGroupA 289 -#endif // !UNICODE 290 - 291 -extern WINSCARDAPI LONG WINAPI 292 -SCardForgetReaderGroupA( 293 - __in SCARDCONTEXT hContext, 294 - __in LPCSTR szGroupName); 295 -extern WINSCARDAPI LONG WINAPI 296 -SCardForgetReaderGroupW( 297 - __in SCARDCONTEXT hContext, 298 - __in LPCWSTR szGroupName); 299 -#ifdef UNICODE 300 -#define SCardForgetReaderGroup SCardForgetReaderGroupW 301 -#else 302 -#define SCardForgetReaderGroup SCardForgetReaderGroupA 303 -#endif // !UNICODE 304 - 305 -extern WINSCARDAPI LONG WINAPI 306 -SCardIntroduceReaderA( 307 - __in SCARDCONTEXT hContext, 308 - __in LPCSTR szReaderName, 309 - __in LPCSTR szDeviceName); 310 -extern WINSCARDAPI LONG WINAPI 311 -SCardIntroduceReaderW( 312 - __in SCARDCONTEXT hContext, 313 - __in LPCWSTR szReaderName, 314 - __in LPCWSTR szDeviceName); 315 -#ifdef UNICODE 316 -#define SCardIntroduceReader SCardIntroduceReaderW 317 -#else 318 -#define SCardIntroduceReader SCardIntroduceReaderA 319 -#endif // !UNICODE 320 - 321 -extern WINSCARDAPI LONG WINAPI 322 -SCardForgetReaderA( 323 - __in SCARDCONTEXT hContext, 324 - __in LPCSTR szReaderName); 325 -extern WINSCARDAPI LONG WINAPI 326 -SCardForgetReaderW( 327 - __in SCARDCONTEXT hContext, 328 - __in LPCWSTR szReaderName); 329 -#ifdef UNICODE 330 -#define SCardForgetReader SCardForgetReaderW 331 -#else 332 -#define SCardForgetReader SCardForgetReaderA 333 -#endif // !UNICODE 334 - 335 -extern WINSCARDAPI LONG WINAPI 336 -SCardAddReaderToGroupA( 337 - __in SCARDCONTEXT hContext, 338 - __in LPCSTR szReaderName, 339 - __in LPCSTR szGroupName); 340 -extern WINSCARDAPI LONG WINAPI 341 -SCardAddReaderToGroupW( 342 - __in SCARDCONTEXT hContext, 343 - __in LPCWSTR szReaderName, 344 - __in LPCWSTR szGroupName); 345 -#ifdef UNICODE 346 -#define SCardAddReaderToGroup SCardAddReaderToGroupW 347 -#else 348 -#define SCardAddReaderToGroup SCardAddReaderToGroupA 349 -#endif // !UNICODE 350 - 351 -extern WINSCARDAPI LONG WINAPI 352 -SCardRemoveReaderFromGroupA( 353 - __in SCARDCONTEXT hContext, 354 - __in LPCSTR szReaderName, 355 - __in LPCSTR szGroupName); 356 -extern WINSCARDAPI LONG WINAPI 357 -SCardRemoveReaderFromGroupW( 358 - __in SCARDCONTEXT hContext, 359 - __in LPCWSTR szReaderName, 360 - __in LPCWSTR szGroupName); 361 -#ifdef UNICODE 362 -#define SCardRemoveReaderFromGroup SCardRemoveReaderFromGroupW 363 -#else 364 -#define SCardRemoveReaderFromGroup SCardRemoveReaderFromGroupA 365 -#endif // !UNICODE 366 - 367 -extern WINSCARDAPI LONG WINAPI 368 -SCardIntroduceCardTypeA( 369 - __in SCARDCONTEXT hContext, 370 - __in LPCSTR szCardName, 371 - __in_opt LPCGUID pguidPrimaryProvider, 372 - __in_opt LPCGUID rgguidInterfaces, 373 - __in DWORD dwInterfaceCount, 374 - __in LPCBYTE pbAtr, 375 - __in LPCBYTE pbAtrMask, 376 - __in DWORD cbAtrLen); 377 -extern WINSCARDAPI LONG WINAPI 378 -SCardIntroduceCardTypeW( 379 - __in SCARDCONTEXT hContext, 380 - __in LPCWSTR szCardName, 381 - __in_opt LPCGUID pguidPrimaryProvider, 382 - __in_opt LPCGUID rgguidInterfaces, 383 - __in DWORD dwInterfaceCount, 384 - __in LPCBYTE pbAtr, 385 - __in LPCBYTE pbAtrMask, 386 - __in DWORD cbAtrLen); 387 -#ifdef UNICODE 388 -#define SCardIntroduceCardType SCardIntroduceCardTypeW 389 -#else 390 -#define SCardIntroduceCardType SCardIntroduceCardTypeA 391 -#endif // !UNICODE 392 -// 393 -// NOTE: The routine SCardIntroduceCardType's parameters' order differs from 394 -// the PC/SC definition. It should be: 395 -// 396 -// extern WINSCARDAPI LONG WINAPI 397 -// SCardIntroduceCardType( 398 -// __in SCARDCONTEXT hContext, 399 -// __in LPCTSTR szCardName, 400 -// __in LPCBYTE pbAtr, 401 -// __in LPCBYTE pbAtrMask, 402 -// __in DWORD cbAtrLen, 403 -// __in_opt LPCGUID pguidPrimaryProvider, 404 -// __in_opt LPCGUID rgguidInterfaces, 405 -// __in DWORD dwInterfaceCount); 406 -// 407 -// Here's a work-around MACRO: 408 -#define PCSCardIntroduceCardType(hContext, szCardName, pbAtr, pbAtrMask, cbAtrLen, pguidPrimaryProvider, rgguidInterfaces, dwInterfaceCount) \ 409 - SCardIntroduceCardType(hContext, szCardName, pguidPrimaryProvider, rgguidInterfaces, dwInterfaceCount, pbAtr, pbAtrMask, cbAtrLen) 410 - 411 -extern WINSCARDAPI LONG WINAPI 412 -SCardSetCardTypeProviderNameA( 413 - __in SCARDCONTEXT hContext, 414 - __in LPCSTR szCardName, 415 - __in DWORD dwProviderId, 416 - __in LPCSTR szProvider); 417 -extern WINSCARDAPI LONG WINAPI 418 -SCardSetCardTypeProviderNameW( 419 - __in SCARDCONTEXT hContext, 420 - __in LPCWSTR szCardName, 421 - __in DWORD dwProviderId, 422 - __in LPCWSTR szProvider); 423 -#ifdef UNICODE 424 -#define SCardSetCardTypeProviderName SCardSetCardTypeProviderNameW 425 -#else 426 -#define SCardSetCardTypeProviderName SCardSetCardTypeProviderNameA 427 -#endif // !UNICODE 428 -// 429 -// NOTE: This routine is an extention to the PC/SC specifications. 430 -// 431 - 432 -extern WINSCARDAPI LONG WINAPI 433 -SCardForgetCardTypeA( 434 - __in SCARDCONTEXT hContext, 435 - __in LPCSTR szCardName); 436 -extern WINSCARDAPI LONG WINAPI 437 -SCardForgetCardTypeW( 438 - __in SCARDCONTEXT hContext, 439 - __in LPCWSTR szCardName); 440 -#ifdef UNICODE 441 -#define SCardForgetCardType SCardForgetCardTypeW 442 -#else 443 -#define SCardForgetCardType SCardForgetCardTypeA 444 -#endif // !UNICODE 445 - 446 - 447 -// 448 -//////////////////////////////////////////////////////////////////////////////// 449 -// 450 -// Service Manager Support Routines 451 -// 452 -// The following services are supplied to simplify the use of the Service 453 -// Manager API. 454 -// 455 - 456 -extern WINSCARDAPI LONG WINAPI 457 -SCardFreeMemory( 458 - __in SCARDCONTEXT hContext, 459 - __in LPCVOID pvMem); 460 - 461 -#if (NTDDI_VERSION >= NTDDI_WINXP) 462 -extern WINSCARDAPI HANDLE WINAPI 463 -SCardAccessStartedEvent(void); 464 - 465 -extern WINSCARDAPI void WINAPI 466 -SCardReleaseStartedEvent(void); 467 -#endif // (NTDDI_VERSION >= NTDDI_WINXP) 468 - 469 -// 470 -//////////////////////////////////////////////////////////////////////////////// 471 -// 472 -// Reader Services 473 -// 474 -// The following services supply means for tracking cards within readers. 475 -// 476 - 477 -typedef struct { 478 - LPCSTR szReader; // reader name 479 - LPVOID pvUserData; // user defined data 480 - DWORD dwCurrentState; // current state of reader at time of call 481 - DWORD dwEventState; // state of reader after state change 482 - DWORD cbAtr; // Number of bytes in the returned ATR. 483 - BYTE rgbAtr[36]; // Atr of inserted card, (extra alignment bytes) 484 -} SCARD_READERSTATEA, *PSCARD_READERSTATEA, *LPSCARD_READERSTATEA; 485 -typedef struct { 486 - LPCWSTR szReader; // reader name 487 - LPVOID pvUserData; // user defined data 488 - DWORD dwCurrentState; // current state of reader at time of call 489 - DWORD dwEventState; // state of reader after state change 490 - DWORD cbAtr; // Number of bytes in the returned ATR. 491 - BYTE rgbAtr[36]; // Atr of inserted card, (extra alignment bytes) 492 -} SCARD_READERSTATEW, *PSCARD_READERSTATEW, *LPSCARD_READERSTATEW; 493 -#ifdef UNICODE 494 -typedef SCARD_READERSTATEW SCARD_READERSTATE; 495 -typedef PSCARD_READERSTATEW PSCARD_READERSTATE; 496 -typedef LPSCARD_READERSTATEW LPSCARD_READERSTATE; 497 -#else 498 -typedef SCARD_READERSTATEA SCARD_READERSTATE; 499 -typedef PSCARD_READERSTATEA PSCARD_READERSTATE; 500 -typedef LPSCARD_READERSTATEA LPSCARD_READERSTATE; 501 -#endif // UNICODE 502 - 503 -// Backwards compatibility macros 504 -#define SCARD_READERSTATE_A SCARD_READERSTATEA 505 -#define SCARD_READERSTATE_W SCARD_READERSTATEW 506 -#define PSCARD_READERSTATE_A PSCARD_READERSTATEA 507 -#define PSCARD_READERSTATE_W PSCARD_READERSTATEW 508 -#define LPSCARD_READERSTATE_A LPSCARD_READERSTATEA 509 -#define LPSCARD_READERSTATE_W LPSCARD_READERSTATEW 510 - 511 -#define SCARD_STATE_UNAWARE 0x00000000 // The application is unaware of the 512 - // current state, and would like to 513 - // know. The use of this value 514 - // results in an immediate return 515 - // from state transition monitoring 516 - // services. This is represented by 517 - // all bits set to zero. 518 -#define SCARD_STATE_IGNORE 0x00000001 // The application requested that 519 - // this reader be ignored. No other 520 - // bits will be set. 521 -#define SCARD_STATE_CHANGED 0x00000002 // This implies that there is a 522 - // difference between the state 523 - // believed by the application, and 524 - // the state known by the Service 525 - // Manager. When this bit is set, 526 - // the application may assume a 527 - // significant state change has 528 - // occurred on this reader. 529 -#define SCARD_STATE_UNKNOWN 0x00000004 // This implies that the given 530 - // reader name is not recognized by 531 - // the Service Manager. If this bit 532 - // is set, then SCARD_STATE_CHANGED 533 - // and SCARD_STATE_IGNORE will also 534 - // be set. 535 -#define SCARD_STATE_UNAVAILABLE 0x00000008 // This implies that the actual 536 - // state of this reader is not 537 - // available. If this bit is set, 538 - // then all the following bits are 539 - // clear. 540 -#define SCARD_STATE_EMPTY 0x00000010 // This implies that there is not 541 - // card in the reader. If this bit 542 - // is set, all the following bits 543 - // will be clear. 544 -#define SCARD_STATE_PRESENT 0x00000020 // This implies that there is a card 545 - // in the reader. 546 -#define SCARD_STATE_ATRMATCH 0x00000040 // This implies that there is a card 547 - // in the reader with an ATR 548 - // matching one of the target cards. 549 - // If this bit is set, 550 - // SCARD_STATE_PRESENT will also be 551 - // set. This bit is only returned 552 - // on the SCardLocateCard() service. 553 -#define SCARD_STATE_EXCLUSIVE 0x00000080 // This implies that the card in the 554 - // reader is allocated for exclusive 555 - // use by another application. If 556 - // this bit is set, 557 - // SCARD_STATE_PRESENT will also be 558 - // set. 559 -#define SCARD_STATE_INUSE 0x00000100 // This implies that the card in the 560 - // reader is in use by one or more 561 - // other applications, but may be 562 - // connected to in shared mode. If 563 - // this bit is set, 564 - // SCARD_STATE_PRESENT will also be 565 - // set. 566 -#define SCARD_STATE_MUTE 0x00000200 // This implies that the card in the 567 - // reader is unresponsive or not 568 - // supported by the reader or 569 - // software. 570 -#define SCARD_STATE_UNPOWERED 0x00000400 // This implies that the card in the 571 - // reader has not been powered up. 572 - 573 -extern WINSCARDAPI LONG WINAPI 574 -SCardLocateCardsA( 575 - __in SCARDCONTEXT hContext, 576 - __in LPCSTR mszCards, 577 - __inout LPSCARD_READERSTATEA rgReaderStates, 578 - __in DWORD cReaders); 579 -extern WINSCARDAPI LONG WINAPI 580 -SCardLocateCardsW( 581 - __in SCARDCONTEXT hContext, 582 - __in LPCWSTR mszCards, 583 - __inout LPSCARD_READERSTATEW rgReaderStates, 584 - __in DWORD cReaders); 585 -#ifdef UNICODE 586 -#define SCardLocateCards SCardLocateCardsW 587 -#else 588 -#define SCardLocateCards SCardLocateCardsA 589 -#endif // !UNICODE 590 - 591 -#if (NTDDI_VERSION >= NTDDI_WINXP) 592 -typedef struct _SCARD_ATRMASK { 593 - DWORD cbAtr; // Number of bytes in the ATR and the mask. 594 - BYTE rgbAtr[36]; // Atr of card (extra alignment bytes) 595 - BYTE rgbMask[36]; // Mask for the Atr (extra alignment bytes) 596 -} SCARD_ATRMASK, *PSCARD_ATRMASK, *LPSCARD_ATRMASK; 597 - 598 - 599 -extern WINSCARDAPI LONG WINAPI 600 -SCardLocateCardsByATRA( 601 - __in SCARDCONTEXT hContext, 602 - __in LPSCARD_ATRMASK rgAtrMasks, 603 - __in DWORD cAtrs, 604 - __inout LPSCARD_READERSTATEA rgReaderStates, 605 - __in DWORD cReaders); 606 -extern WINSCARDAPI LONG WINAPI 607 -SCardLocateCardsByATRW( 608 - __in SCARDCONTEXT hContext, 609 - __in LPSCARD_ATRMASK rgAtrMasks, 610 - __in DWORD cAtrs, 611 - __inout LPSCARD_READERSTATEW rgReaderStates, 612 - __in DWORD cReaders); 613 -#ifdef UNICODE 614 -#define SCardLocateCardsByATR SCardLocateCardsByATRW 615 -#else 616 -#define SCardLocateCardsByATR SCardLocateCardsByATRA 617 -#endif // !UNICODE 618 -#endif // (NTDDI_VERSION >= NTDDI_WINXP) 619 - 620 -extern WINSCARDAPI LONG WINAPI 621 -SCardGetStatusChangeA( 622 - __in SCARDCONTEXT hContext, 623 - __in DWORD dwTimeout, 624 - __inout LPSCARD_READERSTATEA rgReaderStates, 625 - __in DWORD cReaders); 626 -extern WINSCARDAPI LONG WINAPI 627 -SCardGetStatusChangeW( 628 - __in SCARDCONTEXT hContext, 629 - __in DWORD dwTimeout, 630 - __inout LPSCARD_READERSTATEW rgReaderStates, 631 - __in DWORD cReaders); 632 -#ifdef UNICODE 633 -#define SCardGetStatusChange SCardGetStatusChangeW 634 -#else 635 -#define SCardGetStatusChange SCardGetStatusChangeA 636 -#endif // !UNICODE 637 - 638 -extern WINSCARDAPI LONG WINAPI 639 -SCardCancel( 640 - __in SCARDCONTEXT hContext); 641 - 642 - 643 -// 644 -//////////////////////////////////////////////////////////////////////////////// 645 -// 646 -// Card/Reader Communication Services 647 -// 648 -// The following services provide means for communication with the card. 649 -// 650 - 651 -#define SCARD_SHARE_EXCLUSIVE 1 // This application is not willing to share this 652 - // card with other applications. 653 -#define SCARD_SHARE_SHARED 2 // This application is willing to share this 654 - // card with other applications. 655 -#define SCARD_SHARE_DIRECT 3 // This application demands direct control of 656 - // the reader, so it is not available to other 657 - // applications. 658 - 659 -#define SCARD_LEAVE_CARD 0 // Don't do anything special on close 660 -#define SCARD_RESET_CARD 1 // Reset the card on close 661 -#define SCARD_UNPOWER_CARD 2 // Power down the card on close 662 -#define SCARD_EJECT_CARD 3 // Eject the card on close 663 - 664 -extern WINSCARDAPI LONG WINAPI 665 -SCardConnectA( 666 - __in SCARDCONTEXT hContext, 667 - __in LPCSTR szReader, 668 - __in DWORD dwShareMode, 669 - __in DWORD dwPreferredProtocols, 670 - __out LPSCARDHANDLE phCard, 671 - __out LPDWORD pdwActiveProtocol); 672 -extern WINSCARDAPI LONG WINAPI 673 -SCardConnectW( 674 - __in SCARDCONTEXT hContext, 675 - __in LPCWSTR szReader, 676 - __in DWORD dwShareMode, 677 - __in DWORD dwPreferredProtocols, 678 - __out LPSCARDHANDLE phCard, 679 - __out LPDWORD pdwActiveProtocol); 680 -#ifdef UNICODE 681 -#define SCardConnect SCardConnectW 682 -#else 683 -#define SCardConnect SCardConnectA 684 -#endif // !UNICODE 685 - 686 -extern WINSCARDAPI LONG WINAPI 687 -SCardReconnect( 688 - __in SCARDHANDLE hCard, 689 - __in DWORD dwShareMode, 690 - __in DWORD dwPreferredProtocols, 691 - __in DWORD dwInitialization, 692 - __out_opt LPDWORD pdwActiveProtocol); 693 - 694 -extern WINSCARDAPI LONG WINAPI 695 -SCardDisconnect( 696 - __in SCARDHANDLE hCard, 697 - __in DWORD dwDisposition); 698 - 699 -extern WINSCARDAPI LONG WINAPI 700 -SCardBeginTransaction( 701 - __in SCARDHANDLE hCard); 702 - 703 -extern WINSCARDAPI LONG WINAPI 704 -SCardEndTransaction( 705 - __in SCARDHANDLE hCard, 706 - __in DWORD dwDisposition); 707 - 708 -extern WINSCARDAPI LONG WINAPI 709 -SCardCancelTransaction( 710 - __in SCARDHANDLE hCard); 711 -// 712 -// NOTE: This call corresponds to the PC/SC SCARDCOMM::Cancel routine, 713 -// terminating a blocked SCardBeginTransaction service. 714 -// 715 - 716 - 717 -extern WINSCARDAPI LONG WINAPI 718 -SCardState( 719 - __in SCARDHANDLE hCard, 720 - __out LPDWORD pdwState, 721 - __out LPDWORD pdwProtocol, 722 - __out_bcount(*pcbAtrLen) LPBYTE pbAtr, 723 - __inout LPDWORD pcbAtrLen); 724 -// 725 -// NOTE: SCardState is an obsolete routine. PC/SC has replaced it with 726 -// SCardStatus. 727 -// 728 - 729 -extern WINSCARDAPI LONG WINAPI 730 -SCardStatusA( 731 - __in SCARDHANDLE hCard, 732 - __nullnullterminated __out_ecount_opt(*pcchReaderLen) LPSTR mszReaderNames, 733 - __inout_opt LPDWORD pcchReaderLen, 734 - __out_opt LPDWORD pdwState, 735 - __out_opt LPDWORD pdwProtocol, 736 - __out_ecount_opt(*pcbAtrLen) LPBYTE pbAtr, 737 - __inout_opt LPDWORD pcbAtrLen); 738 -extern WINSCARDAPI LONG WINAPI 739 -SCardStatusW( 740 - __in SCARDHANDLE hCard, 741 - __nullnullterminated __out_ecount_opt(*pcchReaderLen) LPWSTR mszReaderNames, 742 - __inout_opt LPDWORD pcchReaderLen, 743 - __out_opt LPDWORD pdwState, 744 - __out_opt LPDWORD pdwProtocol, 745 - __out_ecount_opt(*pcbAtrLen) LPBYTE pbAtr, 746 - __inout_opt LPDWORD pcbAtrLen); 747 -#ifdef UNICODE 748 -#define SCardStatus SCardStatusW 749 -#else 750 -#define SCardStatus SCardStatusA 751 -#endif // !UNICODE 752 - 753 -extern WINSCARDAPI LONG WINAPI 754 -SCardTransmit( 755 - __in SCARDHANDLE hCard, 756 - __in LPCSCARD_IO_REQUEST pioSendPci, 757 - __in_bcount(cbSendLength) LPCBYTE pbSendBuffer, 758 - __in DWORD cbSendLength, 759 - __inout_opt LPSCARD_IO_REQUEST pioRecvPci, 760 - __out_bcount(*pcbRecvLength) LPBYTE pbRecvBuffer, 761 - __inout LPDWORD pcbRecvLength); 762 - 763 -#if (NTDDI_VERSION >= NTDDI_VISTA) 764 -extern WINSCARDAPI LONG WINAPI 765 -SCardGetTransmitCount( 766 - __in SCARDHANDLE hCard, 767 - __out LPDWORD pcTransmitCount); 768 -#endif // (NTDDI_VERSION >= NTDDI_VISTA) 769 - 770 -// 771 -//////////////////////////////////////////////////////////////////////////////// 772 -// 773 -// Reader Control Routines 774 -// 775 -// The following services provide for direct, low-level manipulation of the 776 -// reader by the calling application allowing it control over the 777 -// attributes of the communications with the card. 778 -// 779 - 780 -extern WINSCARDAPI LONG WINAPI 781 -SCardControl( 782 - __in SCARDHANDLE hCard, 783 - __in DWORD dwControlCode, 784 - __in_bcount(cbInBufferSize) LPCVOID lpInBuffer, 785 - __in DWORD cbInBufferSize, 786 - __out_bcount(cbOutBufferSize) LPVOID lpOutBuffer, 787 - __in DWORD cbOutBufferSize, 788 - __out LPDWORD lpBytesReturned); 789 - 790 -extern WINSCARDAPI LONG WINAPI 791 -SCardGetAttrib( 792 - __in SCARDHANDLE hCard, 793 - __in DWORD dwAttrId, 794 - __out_bcount_opt(*pcbAttrLen) LPBYTE pbAttr, 795 - __inout LPDWORD pcbAttrLen); 796 -// 797 -// NOTE: The routine SCardGetAttrib's name differs from the PC/SC definition. 798 -// It should be: 799 -// 800 -// extern WINSCARDAPI LONG WINAPI 801 -// SCardGetReaderCapabilities( 802 -// __in SCARDHANDLE hCard, 803 -// __in DWORD dwTag, 804 -// __out LPBYTE pbAttr, 805 -// __inout LPDWORD pcbAttrLen); 806 -// 807 -// Here's a work-around MACRO: 808 -#define SCardGetReaderCapabilities SCardGetAttrib 809 - 810 -extern WINSCARDAPI LONG WINAPI 811 -SCardSetAttrib( 812 - __in SCARDHANDLE hCard, 813 - __in DWORD dwAttrId, 814 - __in_bcount(cbAttrLen) LPCBYTE pbAttr, 815 - __in DWORD cbAttrLen); 816 -// 817 -// NOTE: The routine SCardSetAttrib's name differs from the PC/SC definition. 818 -// It should be: 819 -// 820 -// extern WINSCARDAPI LONG WINAPI 821 -// SCardSetReaderCapabilities( 822 -// __in SCARDHANDLE hCard, 823 -// __in DWORD dwTag, 824 -// __in LPCBYTE pbAttr, 825 -// __in DWORD cbAttrLen); 826 -// 827 -// Here's a work-around MACRO: 828 -#define SCardSetReaderCapabilities SCardSetAttrib 829 - 830 - 831 -// 832 -//////////////////////////////////////////////////////////////////////////////// 833 -// 834 -// Smart Card Dialog definitions 835 -// 836 -// The following section contains structures and exported function 837 -// declarations for the Smart Card Common Dialog dialog. 838 -// 839 - 840 -// Defined constants 841 -// Flags 842 -#define SC_DLG_MINIMAL_UI 0x01 843 -#define SC_DLG_NO_UI 0x02 844 -#define SC_DLG_FORCE_UI 0x04 845 - 846 -#define SCERR_NOCARDNAME 0x4000 847 -#define SCERR_NOGUIDS 0x8000 848 - 849 -typedef SCARDHANDLE (WINAPI *LPOCNCONNPROCA) (__in SCARDCONTEXT, __in LPSTR, __in LPSTR, __in PVOID); 850 -typedef SCARDHANDLE (WINAPI *LPOCNCONNPROCW) (__in SCARDCONTEXT, __in LPWSTR, __in LPWSTR, __in PVOID); 851 -#ifdef UNICODE 852 -#define LPOCNCONNPROC LPOCNCONNPROCW 853 -#else 854 -#define LPOCNCONNPROC LPOCNCONNPROCA 855 -#endif // !UNICODE 856 -typedef BOOL (WINAPI *LPOCNCHKPROC) (__in SCARDCONTEXT, __in SCARDHANDLE, __in PVOID); 857 -typedef void (WINAPI *LPOCNDSCPROC) (__in SCARDCONTEXT, __in SCARDHANDLE, __in PVOID); 858 - 859 - 860 -// 861 -// OPENCARD_SEARCH_CRITERIA: In order to specify a user-extended search, 862 -// lpfnCheck must not be NULL. Moreover, the connection to be made to the 863 -// card before performing the callback must be indicated by either providing 864 -// lpfnConnect and lpfnDisconnect OR by setting dwShareMode. 865 -// If both the connection callbacks and dwShareMode are non-NULL, the callbacks 866 -// will be used. 867 -// 868 - 869 -typedef struct { 870 - DWORD dwStructSize; 871 - LPSTR lpstrGroupNames; // OPTIONAL reader groups to include in 872 - DWORD nMaxGroupNames; // search. NULL defaults to 873 - // SCard$DefaultReaders 874 - LPCGUID rgguidInterfaces; // OPTIONAL requested interfaces 875 - DWORD cguidInterfaces; // supported by card's SSP 876 - LPSTR lpstrCardNames; // OPTIONAL requested card names; all cards w/ 877 - DWORD nMaxCardNames; // matching ATRs will be accepted 878 - LPOCNCHKPROC lpfnCheck; // OPTIONAL if NULL no user check will be performed. 879 - LPOCNCONNPROCA lpfnConnect; // OPTIONAL if lpfnConnect is provided, 880 - LPOCNDSCPROC lpfnDisconnect; // lpfnDisconnect must also be set. 881 - LPVOID pvUserData; // OPTIONAL parameter to callbacks 882 - DWORD dwShareMode; // OPTIONAL must be set if lpfnCheck is not null 883 - DWORD dwPreferredProtocols; // OPTIONAL 884 -} OPENCARD_SEARCH_CRITERIAA, *POPENCARD_SEARCH_CRITERIAA, *LPOPENCARD_SEARCH_CRITERIAA; 885 -typedef struct { 886 - DWORD dwStructSize; 887 - LPWSTR lpstrGroupNames; // OPTIONAL reader groups to include in 888 - DWORD nMaxGroupNames; // search. NULL defaults to 889 - // SCard$DefaultReaders 890 - LPCGUID rgguidInterfaces; // OPTIONAL requested interfaces 891 - DWORD cguidInterfaces; // supported by card's SSP 892 - LPWSTR lpstrCardNames; // OPTIONAL requested card names; all cards w/ 893 - DWORD nMaxCardNames; // matching ATRs will be accepted 894 - LPOCNCHKPROC lpfnCheck; // OPTIONAL if NULL no user check will be performed. 895 - LPOCNCONNPROCW lpfnConnect; // OPTIONAL if lpfnConnect is provided, 896 - LPOCNDSCPROC lpfnDisconnect; // lpfnDisconnect must also be set. 897 - LPVOID pvUserData; // OPTIONAL parameter to callbacks 898 - DWORD dwShareMode; // OPTIONAL must be set if lpfnCheck is not null 899 - DWORD dwPreferredProtocols; // OPTIONAL 900 -} OPENCARD_SEARCH_CRITERIAW, *POPENCARD_SEARCH_CRITERIAW, *LPOPENCARD_SEARCH_CRITERIAW; 901 -#ifdef UNICODE 902 -typedef OPENCARD_SEARCH_CRITERIAW OPENCARD_SEARCH_CRITERIA; 903 -typedef POPENCARD_SEARCH_CRITERIAW POPENCARD_SEARCH_CRITERIA; 904 -typedef LPOPENCARD_SEARCH_CRITERIAW LPOPENCARD_SEARCH_CRITERIA; 905 -#else 906 -typedef OPENCARD_SEARCH_CRITERIAA OPENCARD_SEARCH_CRITERIA; 907 -typedef POPENCARD_SEARCH_CRITERIAA POPENCARD_SEARCH_CRITERIA; 908 -typedef LPOPENCARD_SEARCH_CRITERIAA LPOPENCARD_SEARCH_CRITERIA; 909 -#endif // UNICODE 910 - 911 - 912 -// 913 -// OPENCARDNAME_EX: used by SCardUIDlgSelectCard; replaces obsolete OPENCARDNAME 914 -// 915 - 916 -typedef struct { 917 - DWORD dwStructSize; // REQUIRED 918 - SCARDCONTEXT hSCardContext; // REQUIRED 919 - HWND hwndOwner; // OPTIONAL 920 - DWORD dwFlags; // OPTIONAL -- default is SC_DLG_MINIMAL_UI 921 - LPCSTR lpstrTitle; // OPTIONAL 922 - LPCSTR lpstrSearchDesc; // OPTIONAL (eg. "Please insert your <brandname> smart card.") 923 - HICON hIcon; // OPTIONAL 32x32 icon for your brand insignia 924 - POPENCARD_SEARCH_CRITERIAA pOpenCardSearchCriteria; // OPTIONAL 925 - LPOCNCONNPROCA lpfnConnect; // OPTIONAL - performed on successful selection 926 - LPVOID pvUserData; // OPTIONAL parameter to lpfnConnect 927 - DWORD dwShareMode; // OPTIONAL - if lpfnConnect is NULL, dwShareMode and 928 - DWORD dwPreferredProtocols; // OPTIONAL dwPreferredProtocols will be used to 929 - // connect to the selected card 930 - LPSTR lpstrRdr; // REQUIRED [IN|OUT] Name of selected reader 931 - DWORD nMaxRdr; // REQUIRED [IN|OUT] 932 - LPSTR lpstrCard; // REQUIRED [IN|OUT] Name of selected card 933 - DWORD nMaxCard; // REQUIRED [IN|OUT] 934 - DWORD dwActiveProtocol; // [OUT] set only if dwShareMode not NULL 935 - SCARDHANDLE hCardHandle; // [OUT] set if a card connection was indicated 936 -} OPENCARDNAME_EXA, *POPENCARDNAME_EXA, *LPOPENCARDNAME_EXA; 937 -typedef struct { 938 - DWORD dwStructSize; // REQUIRED 939 - SCARDCONTEXT hSCardContext; // REQUIRED 940 - HWND hwndOwner; // OPTIONAL 941 - DWORD dwFlags; // OPTIONAL -- default is SC_DLG_MINIMAL_UI 942 - LPCWSTR lpstrTitle; // OPTIONAL 943 - LPCWSTR lpstrSearchDesc; // OPTIONAL (eg. "Please insert your <brandname> smart card.") 944 - HICON hIcon; // OPTIONAL 32x32 icon for your brand insignia 945 - POPENCARD_SEARCH_CRITERIAW pOpenCardSearchCriteria; // OPTIONAL 946 - LPOCNCONNPROCW lpfnConnect; // OPTIONAL - performed on successful selection 947 - LPVOID pvUserData; // OPTIONAL parameter to lpfnConnect 948 - DWORD dwShareMode; // OPTIONAL - if lpfnConnect is NULL, dwShareMode and 949 - DWORD dwPreferredProtocols; // OPTIONAL dwPreferredProtocols will be used to 950 - // connect to the selected card 951 - LPWSTR lpstrRdr; // REQUIRED [IN|OUT] Name of selected reader 952 - DWORD nMaxRdr; // REQUIRED [IN|OUT] 953 - LPWSTR lpstrCard; // REQUIRED [IN|OUT] Name of selected card 954 - DWORD nMaxCard; // REQUIRED [IN|OUT] 955 - DWORD dwActiveProtocol; // [OUT] set only if dwShareMode not NULL 956 - SCARDHANDLE hCardHandle; // [OUT] set if a card connection was indicated 957 -} OPENCARDNAME_EXW, *POPENCARDNAME_EXW, *LPOPENCARDNAME_EXW; 958 -#ifdef UNICODE 959 -typedef OPENCARDNAME_EXW OPENCARDNAME_EX; 960 -typedef POPENCARDNAME_EXW POPENCARDNAME_EX; 961 -typedef LPOPENCARDNAME_EXW LPOPENCARDNAME_EX; 962 -#else 963 -typedef OPENCARDNAME_EXA OPENCARDNAME_EX; 964 -typedef POPENCARDNAME_EXA POPENCARDNAME_EX; 965 -typedef LPOPENCARDNAME_EXA LPOPENCARDNAME_EX; 966 -#endif // UNICODE 967 - 968 -#define OPENCARDNAMEA_EX OPENCARDNAME_EXA 969 -#define OPENCARDNAMEW_EX OPENCARDNAME_EXW 970 -#define POPENCARDNAMEA_EX POPENCARDNAME_EXA 971 -#define POPENCARDNAMEW_EX POPENCARDNAME_EXW 972 -#define LPOPENCARDNAMEA_EX LPOPENCARDNAME_EXA 973 -#define LPOPENCARDNAMEW_EX LPOPENCARDNAME_EXW 974 - 975 - 976 -// 977 -// SCardUIDlgSelectCard replaces GetOpenCardName 978 -// 979 - 980 -extern WINSCARDAPI LONG WINAPI 981 -SCardUIDlgSelectCardA( 982 - LPOPENCARDNAMEA_EX); 983 -extern WINSCARDAPI LONG WINAPI 984 -SCardUIDlgSelectCardW( 985 - LPOPENCARDNAMEW_EX); 986 -#ifdef UNICODE 987 -#define SCardUIDlgSelectCard SCardUIDlgSelectCardW 988 -#else 989 -#define SCardUIDlgSelectCard SCardUIDlgSelectCardA 990 -#endif // !UNICODE 991 - 992 - 993 -// 994 -// "Smart Card Common Dialog" definitions for backwards compatibility 995 -// with the Smart Card Base Services SDK version 1.0 996 -// 997 - 998 -typedef struct { 999 - DWORD dwStructSize; 1000 - HWND hwndOwner; 1001 - SCARDCONTEXT hSCardContext; 1002 - LPSTR lpstrGroupNames; 1003 - DWORD nMaxGroupNames; 1004 - LPSTR lpstrCardNames; 1005 - DWORD nMaxCardNames; 1006 - LPCGUID rgguidInterfaces; 1007 - DWORD cguidInterfaces; 1008 - LPSTR lpstrRdr; 1009 - DWORD nMaxRdr; 1010 - LPSTR lpstrCard; 1011 - DWORD nMaxCard; 1012 - LPCSTR lpstrTitle; 1013 - DWORD dwFlags; 1014 - LPVOID pvUserData; 1015 - DWORD dwShareMode; 1016 - DWORD dwPreferredProtocols; 1017 - DWORD dwActiveProtocol; 1018 - LPOCNCONNPROCA lpfnConnect; 1019 - LPOCNCHKPROC lpfnCheck; 1020 - LPOCNDSCPROC lpfnDisconnect; 1021 - SCARDHANDLE hCardHandle; 1022 -} OPENCARDNAMEA, *POPENCARDNAMEA, *LPOPENCARDNAMEA; 1023 -typedef struct { 1024 - DWORD dwStructSize; 1025 - HWND hwndOwner; 1026 - SCARDCONTEXT hSCardContext; 1027 - LPWSTR lpstrGroupNames; 1028 - DWORD nMaxGroupNames; 1029 - LPWSTR lpstrCardNames; 1030 - DWORD nMaxCardNames; 1031 - LPCGUID rgguidInterfaces; 1032 - DWORD cguidInterfaces; 1033 - LPWSTR lpstrRdr; 1034 - DWORD nMaxRdr; 1035 - LPWSTR lpstrCard; 1036 - DWORD nMaxCard; 1037 - LPCWSTR lpstrTitle; 1038 - DWORD dwFlags; 1039 - LPVOID pvUserData; 1040 - DWORD dwShareMode; 1041 - DWORD dwPreferredProtocols; 1042 - DWORD dwActiveProtocol; 1043 - LPOCNCONNPROCW lpfnConnect; 1044 - LPOCNCHKPROC lpfnCheck; 1045 - LPOCNDSCPROC lpfnDisconnect; 1046 - SCARDHANDLE hCardHandle; 1047 -} OPENCARDNAMEW, *POPENCARDNAMEW, *LPOPENCARDNAMEW; 1048 -#ifdef UNICODE 1049 -typedef OPENCARDNAMEW OPENCARDNAME; 1050 -typedef POPENCARDNAMEW POPENCARDNAME; 1051 -typedef LPOPENCARDNAMEW LPOPENCARDNAME; 1052 -#else 1053 -typedef OPENCARDNAMEA OPENCARDNAME; 1054 -typedef POPENCARDNAMEA POPENCARDNAME; 1055 -typedef LPOPENCARDNAMEA LPOPENCARDNAME; 1056 -#endif // UNICODE 1057 - 1058 -// Backwards compatibility macros 1059 -#define OPENCARDNAME_A OPENCARDNAMEA 1060 -#define OPENCARDNAME_W OPENCARDNAMEW 1061 -#define POPENCARDNAME_A POPENCARDNAMEA 1062 -#define POPENCARDNAME_W POPENCARDNAMEW 1063 -#define LPOPENCARDNAME_A LPOPENCARDNAMEA 1064 -#define LPOPENCARDNAME_W LPOPENCARDNAMEW 1065 - 1066 -extern WINSCARDAPI LONG WINAPI 1067 -GetOpenCardNameA( 1068 - LPOPENCARDNAMEA); 1069 -extern WINSCARDAPI LONG WINAPI 1070 -GetOpenCardNameW( 1071 - LPOPENCARDNAMEW); 1072 -#ifdef UNICODE 1073 -#define GetOpenCardName GetOpenCardNameW 1074 -#else 1075 -#define GetOpenCardName GetOpenCardNameA 1076 -#endif // !UNICODE 1077 - 1078 -extern WINSCARDAPI LONG WINAPI 1079 -SCardDlgExtendedError (void); 1080 - 1081 -#if (NTDDI_VERSION >= NTDDI_VISTA) 1082 - 1083 -// 1084 -// Smartcard Caching API 1085 -// 1086 - 1087 -extern WINSCARDAPI LONG WINAPI 1088 -SCardReadCacheA( 1089 - __in SCARDCONTEXT hContext, 1090 - __in UUID *CardIdentifier, 1091 - __in DWORD FreshnessCounter, 1092 - __in LPSTR LookupName, 1093 - __out_bcount(*DataLen) PBYTE Data, 1094 - __out DWORD *DataLen); 1095 -extern WINSCARDAPI LONG WINAPI 1096 -SCardReadCacheW( 1097 - __in SCARDCONTEXT hContext, 1098 - __in UUID *CardIdentifier, 1099 - __in DWORD FreshnessCounter, 1100 - __in LPWSTR LookupName, 1101 - __out_bcount(*DataLen) PBYTE Data, 1102 - __out DWORD *DataLen); 1103 -#ifdef UNICODE 1104 -#define SCardReadCache SCardReadCacheW 1105 -#else 1106 -#define SCardReadCache SCardReadCacheA 1107 -#endif // !UNICODE 1108 - 1109 -extern WINSCARDAPI LONG WINAPI 1110 -SCardWriteCacheA( 1111 - __in SCARDCONTEXT hContext, 1112 - __in UUID *CardIdentifier, 1113 - __in DWORD FreshnessCounter, 1114 - __in LPSTR LookupName, 1115 - __in_bcount(DataLen) PBYTE Data, 1116 - __in DWORD DataLen); 1117 -extern WINSCARDAPI LONG WINAPI 1118 -SCardWriteCacheW( 1119 - __in SCARDCONTEXT hContext, 1120 - __in UUID *CardIdentifier, 1121 - __in DWORD FreshnessCounter, 1122 - __in LPWSTR LookupName, 1123 - __in_bcount(DataLen) PBYTE Data, 1124 - __in DWORD DataLen); 1125 -#ifdef UNICODE 1126 -#define SCardWriteCache SCardWriteCacheW 1127 -#else 1128 -#define SCardWriteCache SCardWriteCacheA 1129 -#endif // !UNICODE 1130 - 1131 -#endif // (NTDDI_VERSION >= NTDDI_VISTA) 1132 - 1133 -#ifdef __cplusplus 1134 -} 1135 -#endif 1136 -#endif // _WINSCARD_H_ 1137 - 1138 -
Deleted build/cackey_win64_build/include/winsmcrd.h version [b14ff00d72].
1 -/*++ 2 - 3 -Copyright (c) 1996 Microsoft Corporation 4 - 5 -Module Name: 6 - 7 - winsmcrd.h 8 - 9 -Abstract: 10 - Smart Card class/port IOCTL codes. This file is required for all code 11 - user mode and kernel mode, using Smart Card IOCTL's, defines, 12 - data structures 13 - 14 -Revision History: 15 - 16 ---*/ 17 - 18 - 19 -#ifndef _NTDDSCRD_H2_ 20 -#define _NTDDSCRD_H2_ 21 - 22 -#if defined (_MSC_VER) && (_MSC_VER >= 1020) 23 -#pragma once 24 -#endif 25 - 26 -#ifdef __cplusplus 27 -extern "C" { 28 -#endif 29 - 30 -#ifdef _WINSCARD_H_ 31 -typedef DWORD ULONG; 32 -typedef WORD UWORD; 33 -typedef BYTE UCHAR; 34 -#else 35 -typedef ULONG DWORD; 36 -// typedef UWORD WORD; 37 -typedef UCHAR BYTE; 38 -#endif 39 - 40 -#ifndef DEVICE_TYPE_SMARTCARD 41 -#define FILE_DEVICE_SMARTCARD 0x00000031 42 -#else 43 -#if 0x00000031 != FILE_DEVICE_SMARTCARD 44 -#error "Incorrect Smart Card Device Definition" 45 -#endif 46 -#endif 47 - 48 - 49 -// 50 -// Various constants 51 -// 52 - 53 -#define SCARD_ATR_LENGTH 33 // ISO 7816-3 spec. 54 - 55 -// 56 -/////////////////////////////////////////////////////////////////////////////// 57 -// 58 -// Protocol Flag definitions 59 -// 60 - 61 -#define SCARD_PROTOCOL_UNDEFINED 0x00000000 // There is no active protocol. 62 -#define SCARD_PROTOCOL_T0 0x00000001 // T=0 is the active protocol. 63 -#define SCARD_PROTOCOL_T1 0x00000002 // T=1 is the active protocol. 64 -#define SCARD_PROTOCOL_RAW 0x00010000 // Raw is the active protocol. 65 -// 66 -// This is the mask of ISO defined transmission protocols 67 -// 68 -#define SCARD_PROTOCOL_Tx (SCARD_PROTOCOL_T0 | SCARD_PROTOCOL_T1) 69 -// 70 -// Use the default transmission parameters / card clock freq. 71 -// 72 -#define SCARD_PROTOCOL_DEFAULT 0x80000000 73 -// 74 -// Use optimal transmission parameters / card clock freq. 75 -// Since using the optimal parameters is the default case no bit is defined to be 1 76 -// 77 -#define SCARD_PROTOCOL_OPTIMAL 0x00000000 78 - 79 - 80 -// 81 -// Ioctl parameters 1 for IOCTL_SMARTCARD_POWER 82 -// 83 -#define SCARD_POWER_DOWN 0 // Power down the card. 84 -#define SCARD_COLD_RESET 1 // Cycle power and reset the card. 85 -#define SCARD_WARM_RESET 2 // Force a reset on the card. 86 - 87 -// 88 -/////////////////////////////////////////////////////////////////////////////// 89 -// 90 -// Reader Action IOCTLs 91 -// 92 - 93 -#define SCARD_CTL_CODE(code) CTL_CODE(FILE_DEVICE_SMARTCARD, \ 94 - (code), \ 95 - METHOD_BUFFERED, \ 96 - FILE_ANY_ACCESS) 97 - 98 -#define IOCTL_SMARTCARD_POWER SCARD_CTL_CODE( 1) 99 -#define IOCTL_SMARTCARD_GET_ATTRIBUTE SCARD_CTL_CODE( 2) 100 -#define IOCTL_SMARTCARD_SET_ATTRIBUTE SCARD_CTL_CODE( 3) 101 -#define IOCTL_SMARTCARD_CONFISCATE SCARD_CTL_CODE( 4) 102 -#define IOCTL_SMARTCARD_TRANSMIT SCARD_CTL_CODE( 5) 103 -#define IOCTL_SMARTCARD_EJECT SCARD_CTL_CODE( 6) 104 -#define IOCTL_SMARTCARD_SWALLOW SCARD_CTL_CODE( 7) 105 -// #define IOCTL_SMARTCARD_READ SCARD_CTL_CODE( 8) obsolete 106 -// #define IOCTL_SMARTCARD_WRITE SCARD_CTL_CODE( 9) obsolete 107 -#define IOCTL_SMARTCARD_IS_PRESENT SCARD_CTL_CODE(10) 108 -#define IOCTL_SMARTCARD_IS_ABSENT SCARD_CTL_CODE(11) 109 -#define IOCTL_SMARTCARD_SET_PROTOCOL SCARD_CTL_CODE(12) 110 -#define IOCTL_SMARTCARD_GET_STATE SCARD_CTL_CODE(14) 111 -#define IOCTL_SMARTCARD_GET_LAST_ERROR SCARD_CTL_CODE(15) 112 -#define IOCTL_SMARTCARD_GET_PERF_CNTR SCARD_CTL_CODE(16) 113 - 114 - 115 -// 116 -/////////////////////////////////////////////////////////////////////////////// 117 -// 118 -// Tags for requesting card and reader attributes 119 -// 120 - 121 -#define MAXIMUM_ATTR_STRING_LENGTH 32 // Nothing bigger than this from getAttr 122 -#define MAXIMUM_SMARTCARD_READERS 10 // Limit the readers on the system 123 - 124 -#define SCARD_ATTR_VALUE(Class, Tag) ((((ULONG)(Class)) << 16) | ((ULONG)(Tag))) 125 - 126 -#define SCARD_CLASS_VENDOR_INFO 1 // Vendor information definitions 127 -#define SCARD_CLASS_COMMUNICATIONS 2 // Communication definitions 128 -#define SCARD_CLASS_PROTOCOL 3 // Protocol definitions 129 -#define SCARD_CLASS_POWER_MGMT 4 // Power Management definitions 130 -#define SCARD_CLASS_SECURITY 5 // Security Assurance definitions 131 -#define SCARD_CLASS_MECHANICAL 6 // Mechanical characteristic definitions 132 -#define SCARD_CLASS_VENDOR_DEFINED 7 // Vendor specific definitions 133 -#define SCARD_CLASS_IFD_PROTOCOL 8 // Interface Device Protocol options 134 -#define SCARD_CLASS_ICC_STATE 9 // ICC State specific definitions 135 -#define SCARD_CLASS_PERF 0x7ffe // performace counters 136 -#define SCARD_CLASS_SYSTEM 0x7fff // System-specific definitions 137 - 138 -#define SCARD_ATTR_VENDOR_NAME SCARD_ATTR_VALUE(SCARD_CLASS_VENDOR_INFO, 0x0100) 139 -#define SCARD_ATTR_VENDOR_IFD_TYPE SCARD_ATTR_VALUE(SCARD_CLASS_VENDOR_INFO, 0x0101) 140 -#define SCARD_ATTR_VENDOR_IFD_VERSION SCARD_ATTR_VALUE(SCARD_CLASS_VENDOR_INFO, 0x0102) 141 -#define SCARD_ATTR_VENDOR_IFD_SERIAL_NO SCARD_ATTR_VALUE(SCARD_CLASS_VENDOR_INFO, 0x0103) 142 -#define SCARD_ATTR_CHANNEL_ID SCARD_ATTR_VALUE(SCARD_CLASS_COMMUNICATIONS, 0x0110) 143 -#define SCARD_ATTR_PROTOCOL_TYPES SCARD_ATTR_VALUE(SCARD_CLASS_PROTOCOL, 0x0120) 144 -// #define SCARD_ATTR_ASYNC_PROTOCOL_TYPES SCARD_ATTR_VALUE(SCARD_CLASS_PROTOCOL, 0x0120) 145 -#define SCARD_ATTR_DEFAULT_CLK SCARD_ATTR_VALUE(SCARD_CLASS_PROTOCOL, 0x0121) 146 -#define SCARD_ATTR_MAX_CLK SCARD_ATTR_VALUE(SCARD_CLASS_PROTOCOL, 0x0122) 147 -#define SCARD_ATTR_DEFAULT_DATA_RATE SCARD_ATTR_VALUE(SCARD_CLASS_PROTOCOL, 0x0123) 148 -#define SCARD_ATTR_MAX_DATA_RATE SCARD_ATTR_VALUE(SCARD_CLASS_PROTOCOL, 0x0124) 149 -#define SCARD_ATTR_MAX_IFSD SCARD_ATTR_VALUE(SCARD_CLASS_PROTOCOL, 0x0125) 150 -// #define SCARD_ATTR_SYNC_PROTOCOL_TYPES SCARD_ATTR_VALUE(SCARD_CLASS_PROTOCOL, 0x0126) 151 -#define SCARD_ATTR_POWER_MGMT_SUPPORT SCARD_ATTR_VALUE(SCARD_CLASS_POWER_MGMT, 0x0131) 152 -#define SCARD_ATTR_USER_TO_CARD_AUTH_DEVICE SCARD_ATTR_VALUE(SCARD_CLASS_SECURITY, 0x0140) 153 -#define SCARD_ATTR_USER_AUTH_INPUT_DEVICE SCARD_ATTR_VALUE(SCARD_CLASS_SECURITY, 0x0142) 154 -#define SCARD_ATTR_CHARACTERISTICS SCARD_ATTR_VALUE(SCARD_CLASS_MECHANICAL, 0x0150) 155 - 156 -#define SCARD_ATTR_CURRENT_PROTOCOL_TYPE SCARD_ATTR_VALUE(SCARD_CLASS_IFD_PROTOCOL, 0x0201) 157 -#define SCARD_ATTR_CURRENT_CLK SCARD_ATTR_VALUE(SCARD_CLASS_IFD_PROTOCOL, 0x0202) 158 -#define SCARD_ATTR_CURRENT_F SCARD_ATTR_VALUE(SCARD_CLASS_IFD_PROTOCOL, 0x0203) 159 -#define SCARD_ATTR_CURRENT_D SCARD_ATTR_VALUE(SCARD_CLASS_IFD_PROTOCOL, 0x0204) 160 -#define SCARD_ATTR_CURRENT_N SCARD_ATTR_VALUE(SCARD_CLASS_IFD_PROTOCOL, 0x0205) 161 -#define SCARD_ATTR_CURRENT_W SCARD_ATTR_VALUE(SCARD_CLASS_IFD_PROTOCOL, 0x0206) 162 -#define SCARD_ATTR_CURRENT_IFSC SCARD_ATTR_VALUE(SCARD_CLASS_IFD_PROTOCOL, 0x0207) 163 -#define SCARD_ATTR_CURRENT_IFSD SCARD_ATTR_VALUE(SCARD_CLASS_IFD_PROTOCOL, 0x0208) 164 -#define SCARD_ATTR_CURRENT_BWT SCARD_ATTR_VALUE(SCARD_CLASS_IFD_PROTOCOL, 0x0209) 165 -#define SCARD_ATTR_CURRENT_CWT SCARD_ATTR_VALUE(SCARD_CLASS_IFD_PROTOCOL, 0x020a) 166 -#define SCARD_ATTR_CURRENT_EBC_ENCODING SCARD_ATTR_VALUE(SCARD_CLASS_IFD_PROTOCOL, 0x020b) 167 -#define SCARD_ATTR_EXTENDED_BWT SCARD_ATTR_VALUE(SCARD_CLASS_IFD_PROTOCOL, 0x020c) 168 - 169 -#define SCARD_ATTR_ICC_PRESENCE SCARD_ATTR_VALUE(SCARD_CLASS_ICC_STATE, 0x0300) 170 -#define SCARD_ATTR_ICC_INTERFACE_STATUS SCARD_ATTR_VALUE(SCARD_CLASS_ICC_STATE, 0x0301) 171 -#define SCARD_ATTR_CURRENT_IO_STATE SCARD_ATTR_VALUE(SCARD_CLASS_ICC_STATE, 0x0302) 172 -#define SCARD_ATTR_ATR_STRING SCARD_ATTR_VALUE(SCARD_CLASS_ICC_STATE, 0x0303) 173 -#define SCARD_ATTR_ICC_TYPE_PER_ATR SCARD_ATTR_VALUE(SCARD_CLASS_ICC_STATE, 0x0304) 174 - 175 -#define SCARD_ATTR_ESC_RESET SCARD_ATTR_VALUE(SCARD_CLASS_VENDOR_DEFINED, 0xA000) 176 -#define SCARD_ATTR_ESC_CANCEL SCARD_ATTR_VALUE(SCARD_CLASS_VENDOR_DEFINED, 0xA003) 177 -#define SCARD_ATTR_ESC_AUTHREQUEST SCARD_ATTR_VALUE(SCARD_CLASS_VENDOR_DEFINED, 0xA005) 178 -#define SCARD_ATTR_MAXINPUT SCARD_ATTR_VALUE(SCARD_CLASS_VENDOR_DEFINED, 0xA007) 179 - 180 -#define SCARD_ATTR_DEVICE_UNIT SCARD_ATTR_VALUE(SCARD_CLASS_SYSTEM, 0x0001) 181 -#define SCARD_ATTR_DEVICE_IN_USE SCARD_ATTR_VALUE(SCARD_CLASS_SYSTEM, 0x0002) 182 -#define SCARD_ATTR_DEVICE_FRIENDLY_NAME_A SCARD_ATTR_VALUE(SCARD_CLASS_SYSTEM, 0x0003) 183 -#define SCARD_ATTR_DEVICE_SYSTEM_NAME_A SCARD_ATTR_VALUE(SCARD_CLASS_SYSTEM, 0x0004) 184 -#define SCARD_ATTR_DEVICE_FRIENDLY_NAME_W SCARD_ATTR_VALUE(SCARD_CLASS_SYSTEM, 0x0005) 185 -#define SCARD_ATTR_DEVICE_SYSTEM_NAME_W SCARD_ATTR_VALUE(SCARD_CLASS_SYSTEM, 0x0006) 186 -#define SCARD_ATTR_SUPRESS_T1_IFS_REQUEST SCARD_ATTR_VALUE(SCARD_CLASS_SYSTEM, 0x0007) 187 - 188 -#define SCARD_PERF_NUM_TRANSMISSIONS SCARD_ATTR_VALUE(SCARD_CLASS_PERF, 0x0001) 189 -#define SCARD_PERF_BYTES_TRANSMITTED SCARD_ATTR_VALUE(SCARD_CLASS_PERF, 0x0002) 190 -#define SCARD_PERF_TRANSMISSION_TIME SCARD_ATTR_VALUE(SCARD_CLASS_PERF, 0x0003) 191 - 192 -#ifdef UNICODE 193 -#define SCARD_ATTR_DEVICE_FRIENDLY_NAME SCARD_ATTR_DEVICE_FRIENDLY_NAME_W 194 -#define SCARD_ATTR_DEVICE_SYSTEM_NAME SCARD_ATTR_DEVICE_SYSTEM_NAME_W 195 -#else 196 -#define SCARD_ATTR_DEVICE_FRIENDLY_NAME SCARD_ATTR_DEVICE_FRIENDLY_NAME_A 197 -#define SCARD_ATTR_DEVICE_SYSTEM_NAME SCARD_ATTR_DEVICE_SYSTEM_NAME_A 198 -#endif 199 - 200 - 201 -// 202 -// T=0 Protocol Defines 203 -// 204 - 205 -#define SCARD_T0_HEADER_LENGTH 7 206 -#define SCARD_T0_CMD_LENGTH 5 207 - 208 - 209 -// 210 -// T=1 Protocol Defines 211 -// 212 - 213 -#define SCARD_T1_PROLOGUE_LENGTH 3 214 -#define SCARD_T1_EPILOGUE_LENGTH 2 215 -#define SCARD_T1_MAX_IFS 254 216 - 217 - 218 -// 219 -/////////////////////////////////////////////////////////////////////////////// 220 -// 221 -// Reader states 222 -// 223 - 224 -#define SCARD_UNKNOWN 0 // This value implies the driver is unaware 225 - // of the current state of the reader. 226 -#define SCARD_ABSENT 1 // This value implies there is no card in 227 - // the reader. 228 -#define SCARD_PRESENT 2 // This value implies there is a card is 229 - // present in the reader, but that it has 230 - // not been moved into position for use. 231 -#define SCARD_SWALLOWED 3 // This value implies there is a card in the 232 - // reader in position for use. The card is 233 - // not powered. 234 -#define SCARD_POWERED 4 // This value implies there is power is 235 - // being provided to the card, but the 236 - // Reader Driver is unaware of the mode of 237 - // the card. 238 -#define SCARD_NEGOTIABLE 5 // This value implies the card has been 239 - // reset and is awaiting PTS negotiation. 240 -#define SCARD_SPECIFIC 6 // This value implies the card has been 241 - // reset and specific communication 242 - // protocols have been established. 243 - 244 -//////////////////////////////////////////////////////////////////////////////// 245 -// 246 -// I/O Services 247 -// 248 -// The following services provide access to the I/O capabilities of the 249 -// reader drivers. Services of the Smart Card are requested by placing the 250 -// following structure into the protocol buffer: 251 -// 252 - 253 - 254 -typedef struct _SCARD_IO_REQUEST{ 255 - DWORD dwProtocol; // Protocol identifier 256 - DWORD cbPciLength; // Protocol Control Information Length 257 -} SCARD_IO_REQUEST, *PSCARD_IO_REQUEST, *LPSCARD_IO_REQUEST; 258 -typedef const SCARD_IO_REQUEST *LPCSCARD_IO_REQUEST; 259 - 260 - 261 -// 262 -// T=0 protocol services. 263 -// 264 - 265 -typedef struct { 266 - BYTE 267 - bCla, // The instruction class 268 - bIns, // The instruction code within the instruction class 269 - bP1, 270 - bP2, // Parameters to the instruction 271 - bP3; // Size of I/O Transfer 272 -} SCARD_T0_COMMAND, *LPSCARD_T0_COMMAND; 273 - 274 -typedef struct { 275 - SCARD_IO_REQUEST ioRequest; 276 - BYTE 277 - bSw1, 278 - bSw2; // Return codes from the instruction 279 - union 280 - { 281 - SCARD_T0_COMMAND CmdBytes; 282 - BYTE rgbHeader[5]; 283 - } DUMMYUNIONNAME; 284 -} SCARD_T0_REQUEST; 285 - 286 -typedef SCARD_T0_REQUEST *PSCARD_T0_REQUEST, *LPSCARD_T0_REQUEST; 287 - 288 - 289 -// 290 -// T=1 Protocol Services 291 -// 292 - 293 -typedef struct { 294 - SCARD_IO_REQUEST ioRequest; 295 -} SCARD_T1_REQUEST; 296 -typedef SCARD_T1_REQUEST *PSCARD_T1_REQUEST, *LPSCARD_T1_REQUEST; 297 - 298 - 299 -// 300 -//////////////////////////////////////////////////////////////////////////////// 301 -// 302 -// Driver attribute flags 303 -// 304 - 305 -#define SCARD_READER_SWALLOWS 0x00000001 // Reader has a card swallowing 306 - // mechanism. 307 -#define SCARD_READER_EJECTS 0x00000002 // Reader has a card ejection 308 - // mechanism. 309 -#define SCARD_READER_CONFISCATES 0x00000004 // Reader has a card capture 310 - // mechanism. 311 - 312 -// 313 -/////////////////////////////////////////////////////////////////////////////// 314 -// 315 -// Type of reader 316 -// 317 -#define SCARD_READER_TYPE_SERIAL 0x01 318 -#define SCARD_READER_TYPE_PARALELL 0x02 319 -#define SCARD_READER_TYPE_KEYBOARD 0x04 320 -#define SCARD_READER_TYPE_SCSI 0x08 321 -#define SCARD_READER_TYPE_IDE 0x10 322 -#define SCARD_READER_TYPE_USB 0x20 323 -#define SCARD_READER_TYPE_PCMCIA 0x40 324 -#define SCARD_READER_TYPE_VENDOR 0xF0 325 - 326 -#ifdef __cplusplus 327 -} 328 -#endif 329 -#endif 330 - 331 -
Deleted build/cackey_win64_build/lib/winscard.dll version [d8a369cdb6].
cannot compute difference between binary files
Deleted build/cackey_win64_build/lib/winscard.lib version [a067715b19].
cannot compute difference between binary files