////////////////////////////////////////////////////////////////////////////////
// Copyright (c) Datacard Corporation.  All Rights Reserved.
//
// constants from microsoft's WinSmCrd.H
// some SCARD... errors from WinError.H
////////////////////////////////////////////////////////////////////////////////
namespace dxp01sdk {

    public enum scard_attr {
        SCARD_ATTR_VENDOR_NAME = 0x10100,
        SCARD_ATTR_VENDOR_IFD_TYPE = 0x10101,
        SCARD_ATTR_VENDOR_IFD_VERSION = 0x10102,
        SCARD_ATTR_VENDOR_IFD_SERIAL_NO = 0x10103,
        SCARD_ATTR_CHANNEL_ID = 0x20110,
        SCARD_ATTR_PROTOCOL_TYPES = 0x30120,
        SCARD_ATTR_DEFAULT_CLK = 0x30121,
        SCARD_ATTR_MAX_CLK = 0x30122,
        SCARD_ATTR_DEFAULT_DATA_RATE = 0x30123,
        SCARD_ATTR_MAX_DATA_RATE = 0x30124,
        SCARD_ATTR_MAX_IFSD = 0x30125,
        SCARD_ATTR_POWER_MGMT_SUPPORT = 0x40131,
        SCARD_ATTR_USER_TO_CARD_AUTH_DEVICE = 0x50140,
        SCARD_ATTR_USER_AUTH_INPUT_DEVICE = 0x50142,
        SCARD_ATTR_CHARACTERISTICS = 0x60150,
        SCARD_ATTR_CURRENT_PROTOCOL_TYPE = 0x80201,
        SCARD_ATTR_CURRENT_CLK = 0x80202,
        SCARD_ATTR_CURRENT_F = 0x80203,
        SCARD_ATTR_CURRENT_D = 0x80204,
        SCARD_ATTR_CURRENT_N = 0x80205,
        SCARD_ATTR_CURRENT_W = 0x80206,
        SCARD_ATTR_CURRENT_IFSC = 0x80207,
        SCARD_ATTR_CURRENT_IFSD = 0x80208,
        SCARD_ATTR_CURRENT_BWT = 0x80209,
        SCARD_ATTR_CURRENT_CWT = 0x8020a,
        SCARD_ATTR_CURRENT_EBC_ENCODING = 0x8020b,
        SCARD_ATTR_EXTENDED_BWT = 0x8020c,
        SCARD_ATTR_ICC_PRESENCE = 0x90300,
        SCARD_ATTR_ICC_INTERFACE_STATUS = 0x90301,
        SCARD_ATTR_CURRENT_IO_STATE = 0x90302,
        SCARD_ATTR_ATR_STRING = 0x90303,
        SCARD_ATTR_ICC_TYPE_PER_ATR = 0x90304,
        SCARD_ATTR_ESC_RESET = 0x7a000,
        SCARD_ATTR_ESC_CANCEL = 0x7a003,
        SCARD_ATTR_ESC_AUTHREQUEST = 0x7a005,
        SCARD_ATTR_MAXINPUT = 0x7a007,
        SCARD_ATTR_DEVICE_UNIT = 0x7fff0001,
        SCARD_ATTR_DEVICE_IN_USE = 0x7fff0002,
        SCARD_ATTR_DEVICE_FRIENDLY_NAME_A = 0x7fff0003,
        SCARD_ATTR_DEVICE_SYSTEM_NAME_A = 0x7fff0004,
        SCARD_ATTR_DEVICE_FRIENDLY_NAME_W = 0x7fff0005,
        SCARD_ATTR_DEVICE_SYSTEM_NAME_W = 0x7fff0006,
        SCARD_ATTR_SUPRESS_T1_IFS_REQUEST = 0x7fff0007,
        SCARD_PERF_NUM_TRANSMISSIONS = 0x7ffe0001,
        SCARD_PERF_BYTES_TRANSMITTED = 0x7ffe0002,
        SCARD_PERF_TRANSMISSION_TIME = 0x7ffe0003
    }

    public enum scard_protocol : uint {
        SCARD_PROTOCOL_UNDEFINED = 0,
        SCARD_PROTOCOL_T0 = 0x1,
        SCARD_PROTOCOL_T1 = 0x2,
        SCARD_PROTOCOL_RAW = 0x10000,
        SCARD_PROTOCOL_Tx = 0x3,
        SCARD_PROTOCOL_DEFAULT = 0x80000000,
        SCARD_PROTOCOL_OPTIMAL = 0
    }

    public enum scard_disposition {
        SCARD_SHARE_EXCLUSIVE = 1,
        SCARD_SHARE_SHARED = 2,
        SCARD_SHARE_DIRECT = 3,
        SCARD_LEAVE_CARD = 0,
        SCARD_RESET_CARD = 1,
        SCARD_UNPOWER_CARD = 2,
        SCARD_EJECT_CARD = 3
    }

    public enum scard_error : uint {
        SCARD_S_SUCCESS = 0x0,
        SCARD_E_BAD_SEEK = 0x80100029,
        SCARD_E_CANCELLED = 0x80100002,
        SCARD_E_CANT_DISPOSE = 0x8010000e,
        SCARD_E_CARD_UNSUPPORTED = 0x8010001c,
        SCARD_E_CERTIFICATE_UNAVAILABLE = 0x8010002d,
        SCARD_E_COMM_DATA_LOST = 0x8010002f,
        SCARD_E_DIR_NOT_FOUND = 0x80100023,
        SCARD_E_DUPLICATE_READER = 0x8010001b,
        SCARD_E_FILE_NOT_FOUND = 0x80100024,
        SCARD_E_ICC_CREATEORDER = 0x80100021,
        SCARD_E_ICC_INSTALLATION = 0x80100020,
        SCARD_E_INSUFFICIENT_BUFFER = 0x80100008,
        SCARD_E_INVALID_ATR = 0x80100015,
        SCARD_E_INVALID_CHV = 0x8010002a,
        SCARD_E_INVALID_HANDLE = 0x80100003,
        SCARD_E_INVALID_PARAMETER = 0x80100004,
        SCARD_E_INVALID_TARGET = 0x80100005,
        SCARD_E_INVALID_VALUE = 0x80100011,
        SCARD_E_NO_ACCESS = 0x80100027,
        SCARD_E_NO_DIR = 0x80100025,
        SCARD_E_NO_FILE = 0x80100026,
        SCARD_E_NO_KEY_CONTAINER = 0x80100030,
        SCARD_E_NO_MEMORY = 0x80100006,
        SCARD_E_NO_READERS_AVAILABLE = 0x8010002e,
        SCARD_E_NO_SERVICE = 0x8010001d,
        SCARD_E_NO_SMARTCARD = 0x8010000c,
        SCARD_E_NO_SUCH_CERTIFICATE = 0x8010002c,
        SCARD_E_NOT_READY = 0x80100010,
        SCARD_E_NOT_TRANSACTED = 0x80100016,
        SCARD_E_PCI_TOO_SMALL = 0x80100019,
        SCARD_E_PROTO_MISMATCH = 0x8010000f,
        SCARD_E_READER_UNAVAILABLE = 0x80100017,
        SCARD_E_READER_UNSUPPORTED = 0x8010001a,
        SCARD_E_SERVER_TOO_BUSY = 0x80100031,
        SCARD_E_SERVICE_STOPPED = 0x8010001e,
        SCARD_E_SHARING_VIOLATION = 0x8010000b,
        SCARD_E_SYSTEM_CANCELLED = 0x80100012,
        SCARD_E_TIMEOUT = 0x8010000a,
        SCARD_E_UNEXPECTED = 0x8010001f,
        SCARD_E_UNKNOWN_CARD = 0x8010000d,
        SCARD_E_UNKNOWN_READER = 0x80100009,
        SCARD_E_UNKNOWN_RES_MNG = 0x8010002b,
        SCARD_E_UNSUPPORTED_FEATURE = 0x80100022,
        SCARD_E_WRITE_TOO_MANY = 0x80100028,
        SCARD_F_COMM_ERROR = 0x80100013,
        SCARD_F_INTERNAL_ERROR = 0x80100001,
        SCARD_F_UNKNOWN_ERROR = 0x80100014,
        SCARD_F_WAITED_TOO_LONG = 0x80100007,
        SCARD_P_SHUTDOWN = 0x80100018,
        SCARD_W_CANCELLED_BY_USER = 0x8010006e,
        SCARD_W_CARD_NOT_AUTHENTICATED = 0x8010006f,
        SCARD_W_CHV_BLOCKED = 0x8010006c,
        SCARD_W_EOF = 0x8010006d,
        SCARD_W_REMOVED_CARD = 0x80100069,
        SCARD_W_RESET_CARD = 0x80100068,
        SCARD_W_SECURITY_VIOLATION = 0x8010006a,
        SCARD_W_UNPOWERED_CARD = 0x80100067,
        SCARD_W_UNRESPONSIVE_CARD = 0x80100066,
        SCARD_W_UNSUPPORTED_CARD = 0x80100065,
        SCARD_W_WRONG_CHV = 0x8010006b
    }

    public enum scard_state {
        SCARD_UNKNOWN = 0,
        SCARD_ABSENT = 1,
        SCARD_PRESENT = 2,
        SCARD_SWALLOWED = 3,
        SCARD_POWERED = 4,
        SCARD_NEGOTIABLE = 5,
        SCARD_SPECIFIC = 6
    }
}