📄 windrvr.h
字号:
/*
* W i n D r i v e r v 4 . 3 3
* ==============================
*
* Header file for Windows 95/98/NT/NT2000/CE/Linux/Solaris/VxWorks.
* FOR DETAILS ON THE WINDRIVER FUNCTIONS, PLEASE SEE THE WINDRIVER MANUAL
* OR INCLUDED HELP FILES.
*
* This file may not be distributed -- it may only be used for development
* or evaluation purposes. (see \windriver\docs\license.txt for details).
*
* Web site: http://www.jungo.com
* Email: support@jungo.com
*
* (C) Jungo 2000
*/
#ifndef _WINDRVR_H_
#define _WINDRVR_H_
#if defined(__cplusplus)
extern "C" {
#endif
#define WD_VER 433
#define WD_VER_STR "WinDriver V4.33 Jungo (c)2000"
#if !defined(UNIX) && (defined(LINUX) || defined(SOLARIS) || defined(VXWORKS))
#define UNIX
#endif
#if !defined(SPARC) && (defined(__sparc__) || defined (__sparc) || \
defined(sparc))
#define SPARC
#endif
#if !defined(WIN32) && (defined(WINCE) || defined(WIN95) || defined(WINNT))
#define WIN32
#endif
#if defined(_WIN32_WCE) && !defined(WINCE)
#define WINCE
#endif
#if !defined(x86) && defined(WIN32) && !defined(WINCE) && !defined(_ALPHA_)
#define x86
#endif
#if defined(_KERNEL) && !defined(__KERNEL__)
#define __KERNEL__
#endif
#if defined( __KERNEL__) && !defined(_KERNEL)
#define _KERNEL
#endif
#if !defined(WIN32) && !defined(WINCE) && !defined(UNIX)
#define WIN32
#endif
#if defined(UNIX)
#if !defined(__P_TYPES__)
#if !defined(VXWORKS)
typedef void VOID;
typedef unsigned char UCHAR;
typedef unsigned short USHORT;
typedef unsigned int UINT;
typedef unsigned long ULONG;
typedef ULONG BOOL;
#endif
typedef void *PVOID;
typedef unsigned char *PBYTE;
typedef char CHAR;
typedef char *PCHAR;
typedef unsigned short *PWORD;
typedef unsigned long DWORD, *PDWORD;
typedef PVOID HANDLE;
#endif
#if !defined(__KERNEL__)
#include <string.h>
#include <ctype.h>
#include <stdlib.h>
#endif
#define TRUE 1
#define FALSE 0
#define __cdecl
#define WINAPI
#if defined(__KERNEL__)
#if defined(LINUX)
#include <linux/types.h>
#include <linux/string.h>
#endif
#else
#if defined(LINUX)
#include <sys/ioctl.h> /* for BSD ioctl() */
#include <unistd.h>
#else
#include <unistd.h> /* for SVR4 ioctl()*/
#endif
#if defined(VXWORKS)
#include <vxworks.h>
#undef SPARC /* defined in vxworks.h */
#include <string.h>
#include <memLib.h>
#include <stdLib.h>
#include <taskLib.h>
#include <ioLib.h>
#include <iosLib.h>
#include <taskLib.h>
#include <semLib.h>
#include <timers.h>
#endif
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#endif
#elif defined(WINCE)
#include <windows.h>
#include <winioctl.h>
typedef char CHAR;
#elif defined(WIN32)
#if defined(__KERNEL__)
int sprintf(char *buffer, const char *format, ...);
#else
#include <windows.h>
#include <winioctl.h>
#endif
#endif
static CHAR *WD_VER_MODULE = WD_VER_STR;
typedef unsigned char BYTE;
typedef unsigned short int WORD;
typedef enum
{
CMD_NONE = 0, // No command
CMD_END = 1, // End command
RP_BYTE = 10, // Read port byte
RP_WORD = 11, // Read port word
RP_DWORD = 12, // Read port dword
WP_BYTE = 13, // Write port byte
WP_WORD = 14, // Write port word
WP_DWORD = 15, // Write port dword
RP_SBYTE = 20, // Read port string byte
RP_SWORD = 21, // Read port string word
RP_SDWORD = 22, // Read port string dword
WP_SBYTE = 23, // Write port string byte
WP_SWORD = 24, // Write port string word
WP_SDWORD = 25, // Write port string dword
RM_BYTE = 30, // Read memory byte
RM_WORD = 31, // Read memory word
RM_DWORD = 32, // Read memory dword
WM_BYTE = 33, // Write memory byte
WM_WORD = 34, // Write memory word
WM_DWORD = 35, // Write memory dword
RM_SBYTE = 40, // Read memory string byte
RM_SWORD = 41, // Read memory string word
RM_SDWORD = 42, // Read memory string dword
WM_SBYTE = 43, // Write memory string byte
WM_SWORD = 44, // Write memory string word
WM_SDWORD = 45 // Write memory string dword
} WD_TRANSFER_CMD;
enum { WD_DMA_PAGES = 256 };
enum { DMA_KERNEL_BUFFER_ALLOC = 1 }; // the system allocates a contiguous buffer
// the user doesnt need to supply linear_address
enum { DMA_KBUF_BELOW_16M = 2 }; // if DMA_KERNEL_BUFFER_ALLOC if used,
// this will make sure it is under 16M
enum { DMA_LARGE_BUFFER = 4 }; // if DMA_LARGE_BUFFER if used,
// the maximum number of pages are dwPages, and not
// WD_DMA_PAGES. if you lock a user buffer (not a kernel
// allocated buffer) that is larger than 1MB, then use this
// option, and allocate memory for pages.
typedef struct
{
PVOID pPhysicalAddr; // physical address of page
DWORD dwBytes; // size of page
} WD_DMA_PAGE;
typedef struct
{
DWORD hDma; // handle of dma buffer
PVOID pUserAddr; // beginning of buffer
DWORD dwBytes; // size of buffer
DWORD dwOptions; // allocation options:
// DMA_KERNEL_BUFFER_ALLOC, DMA_KBUF_BELOW_16M, DMA_LARGE_BUFFER
DWORD dwPages; // number of pages in buffer
WD_DMA_PAGE Page[WD_DMA_PAGES];
} WD_DMA;
typedef struct
{
DWORD cmdTrans; // Transfer command WD_TRANSFER_CMD
DWORD dwPort; // io port for transfer or user memory address
// parameters used for string transfers:
DWORD dwBytes; // for string transfer
DWORD fAutoinc; // transfer from one port/address
// or use incremental range of addresses
DWORD dwOptions; // must be 0
union
{
BYTE Byte; // use for byte transfer
WORD Word; // use for word transfer
DWORD Dword; // use for dword transfer
PVOID pBuffer; // use for string transfer
} Data;
} WD_TRANSFER;
enum { INTERRUPT_LEVEL_SENSITIVE = 1 };
enum { INTERRUPT_CMD_COPY = 2 };
enum { INTERRUPT_CE_INT_ID = 4 };
typedef struct
{
DWORD hInterrupt; // handle of interrupt
DWORD dwInterruptNum; // number of interrupt to install
DWORD fNotSharable; // is interrupt unshareable
DWORD dwOptions; // interrupt options: INTERRUPT_LEVEL_SENSITIVE, INTERRUPT_CMD_COPY
WD_TRANSFER *Cmd; // commands to do on interrupt
DWORD dwCmds; // number of commands
DWORD dwCounter; // number of interrupts received
DWORD dwLost; // number of interrupts not yet dealt with
DWORD fStopped; // was interrupt disabled during wait
} WD_INTERRUPT_V30;
typedef struct
{
DWORD hKernelPlugIn;
DWORD dwMessage;
PVOID pData;
DWORD dwResult;
} WD_KERNEL_PLUGIN_CALL;
typedef struct
{
DWORD hInterrupt; // handle of interrupt
DWORD dwOptions; // interrupt options: INTERRUPT_CMD_COPY
WD_TRANSFER *Cmd; // commands to do on interrupt
DWORD dwCmds; // number of commands
// for WD_IntEnable()
WD_KERNEL_PLUGIN_CALL kpCall; // kernel plugin call
DWORD fEnableOk; // did WD_IntEnable() succeed
// For WD_IntWait() and WD_IntCount()
DWORD dwCounter; // number of interrupts received
DWORD dwLost; // number of interrupts not yet dealt with
DWORD fStopped; // was interrupt disabled during wait
} WD_INTERRUPT;
typedef struct
{
DWORD dwVer;
CHAR cVer[100];
} WD_VERSION;
enum
{
LICENSE_DEMO = 0x1,
LICENSE_LITE = 0x2,
LICENSE_FULL = 0x4,
LICENSE_IO = 0x8,
LICENSE_MEM = 0x10,
LICENSE_INT = 0x20,
LICENSE_PCI = 0x40,
LICENSE_DMA = 0x80,
LICENSE_NT = 0x100,
LICENSE_95 = 0x200,
LICENSE_ISAPNP = 0x400,
LICENSE_PCMCIA = 0x800,
LICENSE_PCI_DUMP = 0x1000,
LICENSE_MSG_GEN = 0x2000,
LICENSE_MSG_EDU = 0x4000,
LICENSE_MSG_INT = 0x8000,
LICENSE_KER_PLUG = 0x10000,
LICENSE_LINUX = 0x20000,
LICENSE_CE = 0x80000,
LICENSE_VXWORKS = 0x10000000,
LICENSE_THIS_PC = 0x100000,
LICENSE_WIZARD = 0x200000,
LICENSE_KER_NT = 0x400000,
LICENSE_SOLARIS = 0x800000,
LICENSE_CPU0 = 0x40000,
LICENSE_CPU1 = 0x1000000,
LICENSE_CPU2 = 0x2000000,
LICENSE_CPU3 = 0x4000000,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -