⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 simcb.h

📁 freescale i.mx31 BSP CE5.0全部源码
💻 H
字号:
//
// Copyright (c) Microsoft Corporation.  All rights reserved.
//
//
// Use of this source code is subject to the terms of the Microsoft end-user
// license agreement (EULA) under which you licensed this SOFTWARE PRODUCT.
// If you did not accept the terms of the EULA, you are not authorized to use
// this source code. For a copy of the EULA, please see the LICENSE.RTF on your
// install media.
//

//------------------------------------------------------------------------------
//
//  Copyright (C) 2004, Motorola Inc. All Rights Reserved
//
//------------------------------------------------------------------------------

//------------------------------------------------------------------------------
//
//  Header:  simcb.h
//
//------------------------------------------------------------------------------

#ifndef __SIM_CB_H__
#define __SIM_CB_H__

#include <smclib.h>

//------------------------------------------------------------------------------
// Defines

#define SysCompareMemory( p1, p2, Len )             memcmp( p1,p2, Len )
#define SysCopyMemory( pDest, pSrc, Len )               RtlCopyMemory( pDest, pSrc, Len )

#define ATR_SIZE        0x40        // TS + 32 + SW + PROLOGUE + EPILOGUE...

#define CLA_IDX     0
#define INS_IDX     1
#define P1_IDX      2
#define P2_IDX      3
#define P3_IDX      4

#define ISO_OUT     TRUE
#define ISO_IN      !ISO_OUT


//------------------------------------------------------------------------------
// Types

//Reader power state
typedef enum _READER_POWER_STATE {
    PowerReaderUnspecified = 0,
    PowerReaderWorking,
    PowerReaderOff
} READER_POWER_STATE, *PREADER_POWER_STATE;

//Reader Extension
typedef struct _READER_EXTENSION {
    PCSP_SIM_REG    pSIMReg;       //Register structure

    UCHAR    ucReadBuffer[MIN_BUFFER_SIZE];
    ULONG    ulReadBufferLen;

    READER_POWER_STATE  ReaderPowerState;       //Current reader power state

    LONG    d_RefCount;     //Count the number of references to the device

    HANDLE  hBackgroundThread;      //Backgroud thread for track SIM card attach and detach
    DWORD   dwThreadID;     //Background thread ID

    UINT    d_uReaderState;     //State of device (STATE_OPENED, STATE_CLOSED, etc
    PWCHAR  d_ActivePath;       //Registry path to active device

    BOOLEAN IoctlPending;       //Flag for determining Card tracking started
} READER_EXTENSION, *PREADER_EXTENSION;

//------------------------------------------------------------------------------
// Functions

NTSTATUS CBCardPower(PSMARTCARD_EXTENSION SmartcardExtension);

NTSTATUS CBSetProtocol(PSMARTCARD_EXTENSION SmartcardExtension);

NTSTATUS CBTransmit(PSMARTCARD_EXTENSION SmartcardExtension);

NTSTATUS CBCardTracking(PSMARTCARD_EXTENSION SmartcardExtension);

NTSTATUS CBUpdateCardState(PSMARTCARD_EXTENSION SmartcardExtension);

NTSTATUS CBGenericIOCTL(PSMARTCARD_EXTENSION SmartcardExtension);


#endif // __SIM_CB_H__

//  ------------------------------- END OF FILE -------------------------------


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -