📄 sense4.h
字号:
/**************************************************************************************
* Copyright (c) 2001, Beijing SenseLock Info. & Secu. Inc.
* All rights reserved.
*
* filename: sense4.h
*
* briefs: EliteIV library interface declaration, return value and some constant definition.
*
* date: 05/31/2005
* history:
* 05/31/2005 Rename the product to EliteIV.
*******************************************************************************************/
#ifndef __SENSE4_H__
#define __SENSE4_H__
#ifdef _MSC_VER
#pragma comment(linker, "/defaultlib:setupapi.lib")
#endif
#ifdef __cplusplus
extern "C" {
#endif
#if defined WIN32 || defined _WIN32 || defined _WIN64
#include <windows.h>
typedef HANDLE S4HANDLE;
#elif defined __MACH__
typedef io_connect_t S4HANDLE;
#else
typedef void* S4HANDLE;
#endif /* defined WIN32 || defined _WIN32 || defined _WIN64 */
#ifndef IN
#define IN
#endif
#ifndef OUT
#define OUT
#endif
#if !defined _WINDOWS_
#define WINAPI
#define CONST const
typedef unsigned char UCHAR;
typedef unsigned short USHORT;
typedef unsigned int UINT;
typedef unsigned long ULONG;
typedef char CHAR;
typedef char TCHAR;
typedef void VOID;
#ifndef _BYTE_DEFINED
#define _BYTE_DEFINED
typedef unsigned char BYTE;
#endif
#ifndef _WORD_DEFINED
#define _WORD_DEFINED
typedef unsigned short WORD;
#endif
#ifndef _DWORD_DEFINED
#define _DWORD_DEFINED
typedef unsigned long DWORD;
#endif
typedef VOID* LPVOID;
typedef CHAR* LPSTR;
typedef CONST CHAR* LPCSTR;
typedef CONST TCHAR* LPCTSTR;
typedef BYTE* LPBYTE;
typedef WORD* LPWORD;
typedef DWORD* LPDWORD;
#endif /* !defined _WINDOWS */
//@{
/**
device share mode definition
*/
#define S4_EXCLUSIZE_MODE 0 /** exclusive mode*/
#define S4_SHARE_MODE 1 /** sharable mode*/
//@}
//@{
/**
the control code value definition
*/
#define S4_LED_UP 0x00000004 /** LED up*/
#define S4_LED_DOWN 0x00000008 /** LED down*/
#define S4_LED_WINK 0x00000028 /** LED wink*/
#define S4_GET_DEVICE_TYPE 0x00000025 /** get the device type*/
#define S4_GET_SERIAL_NUMBER 0X00000026 /** get the device serial number*/
#define S4_GET_VM_TYPE 0X00000027 /** get the virtual machine type*/
#define S4_GET_DEVICE_USABLE_SPACE 0x00000029 /** get the total space of the device*/
#define S4_SET_DEVICE_ID 0x0000002a /** set the device ID*/
#define S4_RESET_DEVICE 0x00000002 /** reset the device*/
#define S4_DF_AVAILABLE_SPACE 0x00000031 /** get the free space of current directory*/
#define S4_EF_INFO 0x00000032 /** get specified file information in current directory*/
#define S4_SET_USB_MODE 0x00000041 /** set the device as a normal usb device*/
#define S4_SET_HID_MODE 0x00000042 /** set the device as a HID device*/
#define S4_GET_CUSTOMER_NAME 0x0000002b /** get the customer number*/
#define S4_GET_MANUFACTURE_DATE 0x0000002c /** get the manufacture date of the device*/
#define S4_GET_CURRENT_TIME 0x0000002d /** get the current time of the clock device*/
//@}
//@}
//@{
/**
device type definition
*/
#define S4_LOCAL_DEVICE 0x00 /** local device*/
#define S4_MASTER_DEVICE 0x01 /** net master device*/
#define S4_SLAVE_DEVICE 0x02 /** net slave device*/
//@}
//@{
/**
virtual machine type definition
*/
#define S4_VM_51 0x00 /** inter 51*/
#define S4_VM_251_BINARY 0x01 /** inter 251, binary mode*/
#define S4_VM_251_SOURCE 0X02 /** inter 251, source mode*/
//@}
//@{
/**
PIN and key type definition
*/
#define S4_USER_PIN 0x000000a1 /** user PIN*/
#define S4_DEV_PIN 0x000000a2 /** developer PIN*/
#define S4_AUTHEN_PIN 0x000000a3 /** authentication key of net device*/
//@}
//@{
/**
file type definition
*/
#define S4_RSA_PUBLIC_FILE 0x00000006 /** RSA public key file*/
#define S4_RSA_PRIVATE_FILE 0x00000007 /** RSA private key file*/
#define S4_EXE_FILE 0x00000008 /** executable file of virtual machine*/
#define S4_DATA_FILE 0x00000009 /** data file*/
#define S4_XA_EXE_FILE 0x0000000b /** executable file of XA User mode*/
//@}
//@{
/**
flag value definition
*/
#define S4_CREATE_NEW 0x000000a5 /** create a new file*/
#define S4_UPDATE_FILE 0x000000a6 /** write data to the specified file*/
#define S4_KEY_GEN_RSA_FILE 0x000000a7 /** generate RSA key pair files*/
#define S4_SET_LICENCES 0x000000a8 /** set the max license number of the current module for the net device*/
#define S4_CREATE_ROOT_DIR 0x000000ab /** create root directory*/
#define S4_CREATE_SUB_DIR 0x000000ac /** create child directory for current directory*/
#define S4_CREATE_MODULE 0x000000ad /** create a module directory for the net device */
/** the following three flags can only be used when creating a new executable file */
#define S4_FILE_READ_WRITE 0x00000000 /** the new executable file can be read and written by executable file */
#define S4_FILE_EXECUTE_ONLY 0x00000100 /** the new executable file can't be read or written by executable file*/
#define S4_CREATE_PEDDING_FILE 0x00002000 /** create a padding file*/
//@}
//@{
/**
execuable file executing mode definition
*/
#define S4_VM_EXE 0x00000000 /** executing on virtual machine*/
#define S4_XA_EXE 0x00000001 /** executing on XA User mode */
//@}
//@{
/**
return value definition
*/
#define S4_SUCCESS 0x00000000 /** success*/
#define S4_UNPOWERED 0x00000001 /** the device has been powered off*/
#define S4_INVALID_PARAMETER 0x00000002 /** invalid parameter*/
#define S4_COMM_ERROR 0x00000003 /** communication error*/
#define S4_PROTOCOL_ERROR 0x00000004 /** communication protocol error*/
#define S4_DEVICE_BUSY 0x00000005 /** the device is busy*/
#define S4_KEY_REMOVED 0x00000006 /** the device has been removed */
#define S4_INSUFFICIENT_BUFFER 0x00000011 /** the input buffer is insufficient*/
#define S4_NO_LIST 0x00000012 /** find no device*/
#define S4_GENERAL_ERROR 0x00000013 /** general error, commonly indicates not enough memory*/
#define S4_UNSUPPORTED 0x00000014 /** the function isn't supported*/
#define S4_DEVICE_TYPE_MISMATCH 0x00000020 /** the device type doesn't match*/
#define S4_FILE_SIZE_CROSS_7FFF 0x00000021 /** the execuable file crosses address 0x7FFF*/
#define S4_CURRENT_DF_ISNOT_MF 0x00000201 /** a net module must be child directory of the root directory*/
#define S4_INVAILABLE_MODULE_DF 0x00000202 /** the current directory is not a module*/
#define S4_FILE_SIZE_TOO_LARGE 0x00000203 /** the file size is beyond address 0x7FFF*/
#define S4_DF_SIZE 0x00000204 /** the specified directory size is too small*/
#define S4_DEVICE_UNSUPPORTED 0x00006a81 /** the request can't be supported by the device*/
#define S4_FILE_NOT_FOUND 0x00006a82 /** the specified file can't be found */
#define S4_INSUFFICIENT_SECU_STATE 0x00006982 /** the security state doesn't match*/
#define S4_DIRECTORY_EXIST 0x00006901 /** the specified directory has already existed*/
#define S4_FILE_EXIST 0x00006a80 /** the specified file has already existed*/
#define S4_INSUFFICIENT_SPACE 0x00006a84 /** the space is insufficient*/
#define S4_OFFSET_BEYOND 0x00006B00 /** the offset is beyond the file size*/
#define S4_PIN_BLOCK 0x00006983 /** the specified pin or key has been locked*/
#define S4_FILE_TYPE_MISMATCH 0x00006981 /** the file type doesn't match*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -