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

📄 stcusbce.h

📁 Windows CE 5.0 下的SmartCard驱动。
💻 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.
//
/*++

Module Name:

    stcusbce.h

Abstract:

    Driver header - Windows CE Version



Revision History:


--*/

#ifndef __TLP3CE_H__
#define __TLP3CE_H__

#define SMCLIB_CE       1

//#define SysCompareMemory( p1, p2, Len )           memcmp( p1,p2, Len )
#define SysCopyMemory( pDest, pSrc, Len )       RtlCopyMemory( pDest, pSrc, Len )
#define SysFillMemory( pDest, Value, Len )      RtlFillMemory( pDest, Len, Value )

#define MICROSECONDS_PER_MILLISECOND 1000

typedef  TCHAR * LPTSTR;

// values for READER_EXTENSION.d_uReaderState
#define STATE_INITING 1
#define STATE_CLOSED  2
#define STATE_OPENED  3
#define STATE_DEAD    4    // Power down
#define STATE_REMOVED 5    // Power down

const TCHAR szDriverName[];
//
// Prototypes
//
static BOOL
AddDevice(PSMARTCARD_EXTENSION pDevice);

static BOOL
RemoveDevice(PSMARTCARD_EXTENSION pDevice);

BOOL
ValidateAndEnterDevice(PSMARTCARD_EXTENSION pDevice);

BOOL WINAPI
DllEntry(HINSTANCE DllInstance, INT Reason, LPVOID Reserved);

DWORD
SCR_Init( DWORD dwContext );

BOOL
SCR_Deinit( DWORD dwContext );

DWORD
SCR_Open( DWORD dwData,DWORD dwAccess,DWORD dwShareMode );

BOOL
SCR_Close( DWORD Handle );

BOOL
SCR_IOControl(
    DWORD Handle,
    DWORD dwIoControlCode,
    PBYTE pInBuf,
    DWORD nInBufSize,
    PBYTE pOutBuf,
    DWORD nOutBufSize,
    PDWORD pBytesReturned
    );

DWORD
SCR_Read(DWORD Handle, LPVOID pBuffer, DWORD dwNumBytes);

DWORD
SCR_Write(DWORD Handle, LPCVOID pBuffer, DWORD dwNumBytes);

DWORD
SCR_Seek(DWORD Handle, long lDistance, DWORD dwMoveMethod);



static DWORD
GetDeviceName( LPTSTR ActivePath, LPTSTR szDeviceName, LPDWORD pdwClientInfo );

static void
MakeFriendlyName(PSMARTCARD_EXTENSION SmartcardExtension, LPWSTR szFriendlyName);

static PSMARTCARD_EXTENSION
StcUsbLoadDevice( LPTSTR ActiveKey );


static void
StcUsbUnloadDevice(PSMARTCARD_EXTENSION SmartcardExtension);

void
SysDelay(
    ULONG Timeout
    );


#define EnterDevice(pSCE) InterlockedIncrement(&(pSCE)->ReaderExtension->d_RefCount)
#define LeaveDevice(pSCE) InterlockedDecrement(&(pSCE)->ReaderExtension->d_RefCount)


#endif  // __TLP3CE_H__


⌨️ 快捷键说明

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