home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / windr440.zip / windrive.zip / WinDriver / include / windrvr.h < prev   
C/C++ Source or Header  |  2000-03-30  |  34KB  |  942 lines

  1. /* 
  2.  * W i n D r i v e r    v 4 . 4 0
  3.  * ==============================
  4.  *
  5.  * Header file for Windows 95/98/NT/NT2000/CE/Linux/Solaris/VxWorks.
  6.  * FOR DETAILS ON THE WinDriver FUNCTIONS, PLEASE SEE THE WinDriver MANUAL
  7.  * OR INCLUDED HELP FILES.
  8.  *
  9.  * This file may not be distributed -- it may only be used for development
  10.  * or evaluation purposes. (see \WinDriver\docs\license.txt for details).
  11.  *
  12.  * Web site: http://www.krftech.com
  13.  * Email:    support@krftech.com
  14.  *
  15.  * (C) KRFTech 1999
  16.  */
  17.  
  18. #ifndef _WINDRVR_H_
  19. #define _WINDRVR_H_
  20.  
  21. #if defined(__cplusplus)
  22.     extern "C" {
  23. #endif
  24.  
  25. // these lines break standard VxWorks builds. remove the -asni flag from the
  26. // compiler flags (from the makefile or the Tornado IDE) to compile WinDriver
  27. // related source code.
  28. #define WD_VER      440
  29. #if defined(VXWORKS)
  30.     #define WD_PROD_NAME "DriverBuilder"
  31. #else
  32.     #define WD_PROD_NAME "WinDriver"
  33. #endif
  34. #define WD_VER_STR  WD_PROD_NAME " V4.40 KRFTech (c)1999"
  35.  
  36. #if !defined(UNIX) && (defined(LINUX) || defined(SOLARIS) || defined(VXWORKS))
  37.     #define UNIX
  38. #endif
  39.  
  40. #if !defined(SPARC) && (defined(__sparc__) || defined (__sprac) || \
  41.         defined(sparc))
  42.     #define SPARC
  43. #endif
  44.  
  45. #if !defined(WIN32) && (defined(WINCE) || defined(WIN95) || defined(WINNT)) && !defined(OS2)
  46.     #define WIN32
  47. #endif
  48.  
  49. #if defined(_WIN32_WCE) && !defined(WINCE)
  50.     #define WINCE
  51. #endif
  52.  
  53. #if !defined(x86) && defined(WIN32) && !defined(WINCE) && !defined(_ALPHA_) 
  54.     #define x86
  55. #endif
  56.  
  57. #if defined(_KERNEL) && !defined(__KERNEL__)
  58.     #define __KERNEL__
  59. #endif
  60.  
  61. #if defined( __KERNEL__) && !defined(_KERNEL)
  62.     #define _KERNEL
  63. #endif
  64.     
  65. #if !defined(WIN32) && !defined(WINCE) && !defined(UNIX) && !defined(OS2)
  66.     #define WIN32
  67. #endif
  68.  
  69. #if defined(UNIX)
  70.     #if !defined(__P_TYPES__)
  71.         #if !defined(VXWORKS)
  72.             typedef void VOID;
  73.             typedef unsigned char UCHAR;
  74.             typedef unsigned short USHORT;
  75.             typedef unsigned int UINT;
  76.             typedef unsigned long ULONG;
  77.             typedef ULONG BOOL;
  78.         #endif
  79.         typedef void *PVOID;
  80.         typedef unsigned char *PBYTE;
  81.         typedef char CHAR;
  82.         typedef char *PCHAR;
  83.         typedef unsigned short *PWORD;
  84.         typedef unsigned long DWORD, *PDWORD;
  85.         typedef PVOID HANDLE;
  86.     #endif
  87.     
  88.     #if !defined(__KERNEL__)
  89.         #include <string.h>
  90.         #include <ctype.h>
  91.         #include <stdlib.h>
  92.     #endif
  93.     #define TRUE 1
  94.     #define FALSE 0
  95.     #define __cdecl
  96.     #define WINAPI
  97.     
  98.     #if defined(__KERNEL__)
  99.         #if defined(LINUX)
  100.             #include <linux/types.h>
  101.             #include <linux/string.h>
  102.         #endif
  103.     #else
  104.         #if defined(LINUX)
  105.             #include <sys/ioctl.h> /* for BSD ioctl() */
  106.         #else
  107.             #include <unistd.h> /* for SVR4 ioctl()*/
  108.         #endif
  109.         #if defined(VXWORKS)
  110.             #include <vxworks.h>
  111.             #undef SPARC /* defined in vxworks.h */
  112.             #include <string.h>
  113.             #include <memLib.h>
  114.             #include <stdLib.h>
  115.             #include <taskLib.h>
  116.             #include <ioLib.h>
  117.             #include <iosLib.h>
  118.             #include <taskLib.h>
  119.             #include <semLib.h>
  120.             #include <timers.h>
  121.         #endif
  122.         #include <sys/types.h>
  123.         #include <sys/stat.h>
  124.         #include <fcntl.h>  
  125.     #endif
  126. #elif defined(OS2)
  127.     #define INCL_DOSSEMAPHORES
  128.     #define INCL_WINLOAD
  129.     #define INCL_DOSPROCESS
  130.     #define INCL_DOSDEVICES
  131.     #define __cdecl
  132.     #define WINAPI
  133.     #include <os2.h>
  134.     #include <string.h>
  135.     #include <ctype.h>  
  136.     #if !defined(__P_TYPES__)
  137.             #define __P_TYPES__
  138.         typedef unsigned short NTSTATUS;    
  139.         typedef unsigned short WORD;
  140.         typedef unsigned short *PWORD;
  141.         typedef unsigned long DWORD, *PDWORD;
  142.         typedef PVOID HANDLE;
  143.     #endif  
  144.     #define TRUE 1
  145.     #define FALSE 0
  146. #elif defined(WINCE)
  147.     #include <windows.h>
  148.     #include <winioctl.h>
  149.     typedef char CHAR;
  150. #elif defined(WIN32)
  151.     #if defined(__KERNEL__)
  152.         int sprintf(char *buffer, const char *format, ...);
  153.     #else
  154.         #include <windows.h>
  155.         #include <winioctl.h>
  156.     #endif
  157.     #if defined(__KERNEL__) && defined(WIN32)
  158.         int sprintf(char *buffer, const char *format, ...);
  159.     #endif
  160.     #if defined(__KERNEL__) && defined(WIN95)
  161.         #include "kdstdlib.h"
  162.     #endif
  163. #endif
  164.  
  165. static CHAR *WD_VER_MODULE = WD_VER_STR;
  166. #ifndef OS2
  167.     typedef unsigned char BYTE;
  168.     typedef unsigned short int WORD;
  169. #endif
  170.  
  171. typedef enum 
  172. {                   
  173.     CMD_NONE = 0,       // No command
  174.     CMD_END = 1,        // End command
  175.  
  176.     RP_BYTE = 10,       // Read port byte
  177.     RP_WORD = 11,       // Read port word  
  178.     RP_DWORD = 12,      // Read port dword
  179.     WP_BYTE = 13,       // Write port byte
  180.     WP_WORD = 14,       // Write port word 
  181.     WP_DWORD = 15,      // Write port dword 
  182.  
  183.     RP_SBYTE = 20,      // Read port string byte
  184.     RP_SWORD = 21,      // Read port string word  
  185.     RP_SDWORD = 22,     // Read port string dword
  186.     WP_SBYTE = 23,      // Write port string byte
  187.     WP_SWORD = 24,      // Write port string word 
  188.     WP_SDWORD = 25,     // Write port string dword 
  189.  
  190.     RM_BYTE = 30,       // Read memory byte
  191.     RM_WORD = 31,       // Read memory word  
  192.     RM_DWORD = 32,      // Read memory dword
  193.     WM_BYTE = 33,       // Write memory byte
  194.     WM_WORD = 34,       // Write memory word 
  195.     WM_DWORD = 35,      // Write memory dword 
  196.  
  197.     RM_SBYTE = 40,      // Read memory string byte
  198.     RM_SWORD = 41,      // Read memory string word  
  199.     RM_SDWORD = 42,     // Read memory string dword
  200.     WM_SBYTE = 43,      // Write memory string byte
  201.     WM_SWORD = 44,      // Write memory string word 
  202.     WM_SDWORD = 45      // Write memory string dword 
  203. } WD_TRANSFER_CMD;                                         
  204.  
  205. enum { WD_DMA_PAGES = 256 };
  206.  
  207. enum { DMA_KERNEL_BUFFER_ALLOC = 1 }; // the system allocates a contiguous buffer
  208.                                  // the user doesnt need to supply linear_address
  209. enum { DMA_KBUF_BELOW_16M = 2 }; // if DMA_KERNEL_BUFFER_ALLOC if used,
  210.                                  // this will make sure it is under 16M
  211. enum { DMA_LARGE_BUFFER   = 4 }; // if DMA_LARGE_BUFFER if used,
  212.                                  // the maximum number of pages are dwPages, and not
  213.                                  // WD_DMA_PAGES. if you lock a user buffer (not a kernel
  214.                                  // allocated buffer) that is larger than 1MB, then use this
  215.                                  // option, and allocate memory for pages.
  216. typedef struct
  217. {
  218.     PVOID pPhysicalAddr;    // physical address of page
  219.     DWORD dwBytes;          // size of page
  220. } WD_DMA_PAGE;
  221.  
  222. typedef struct 
  223. {
  224.     DWORD hDma;             // handle of dma buffer
  225.     PVOID pUserAddr;        // beginning of buffer
  226.     DWORD dwBytes;          // size of buffer
  227.     DWORD dwOptions;        // allocation options:
  228.                             // DMA_KERNEL_BUFFER_ALLOC, DMA_KBUF_BELOW_16M, DMA_LARGE_BUFFER
  229.     DWORD dwPages;          // number of pages in buffer
  230.     WD_DMA_PAGE Page[WD_DMA_PAGES];
  231. } WD_DMA;
  232.  
  233. typedef struct 
  234. {
  235.     DWORD cmdTrans;  // Transfer command WD_TRANSFER_CMD
  236.     DWORD dwPort;    // io port for transfer or user memory address
  237.  
  238.     // parameters used for string transfers:
  239.     DWORD dwBytes;   // for string transfer
  240.     DWORD fAutoinc;  // transfer from one port/address 
  241.                      // or use incremental range of addresses
  242.     DWORD dwOptions; // must be 0
  243.     union
  244.     {
  245.         BYTE Byte;   // use for byte transfer
  246.         WORD Word;   // use for word transfer
  247.         DWORD Dword; // use for dword transfer
  248.         PVOID pBuffer; // use for string transfer
  249.     } Data;       
  250. } WD_TRANSFER;
  251.  
  252.  
  253. enum { INTERRUPT_LEVEL_SENSITIVE = 1 };
  254. enum { INTERRUPT_CMD_COPY = 2 };
  255. enum { INTERRUPT_CE_INT_ID = 4 };
  256.  
  257. typedef struct
  258. {                                                        
  259.     DWORD hInterrupt;    // handle of interrupt
  260.     DWORD dwInterruptNum; // number of interrupt to install 
  261.     DWORD fNotSharable;  // is interrupt unshareable
  262.     DWORD dwOptions;     // interrupt options: INTERRUPT_LEVEL_SENSITIVE, INTERRUPT_CMD_COPY
  263.     WD_TRANSFER *Cmd;    // commands to do on interrupt
  264.     DWORD dwCmds;        // number of commands
  265.     DWORD dwCounter;     // number of interrupts received
  266.     DWORD dwLost;        // number of interrupts not yet dealt with
  267.     DWORD fStopped;      // was interrupt disabled during wait
  268. } WD_INTERRUPT_V30;
  269.  
  270. typedef struct
  271. {
  272.     DWORD hKernelPlugIn;
  273.     DWORD dwMessage;
  274.     PVOID pData;
  275.     DWORD dwResult;
  276. } WD_KERNEL_PLUGIN_CALL;
  277.  
  278. typedef struct
  279. {                                                        
  280.     DWORD hInterrupt;    // handle of interrupt
  281.     DWORD dwOptions;     // interrupt options: INTERRUPT_CMD_COPY
  282.     
  283.     WD_TRANSFER *Cmd;    // commands to do on interrupt
  284.     DWORD dwCmds;        // number of commands
  285.  
  286.     // for WD_IntEnable()
  287.     WD_KERNEL_PLUGIN_CALL kpCall; // kernel plugin call
  288.     DWORD fEnableOk;     // did WD_IntEnable() succeed
  289.  
  290.     // For WD_IntWait() and WD_IntCount()
  291.     DWORD dwCounter;     // number of interrupts received
  292.     DWORD dwLost;        // number of interrupts not yet dealt with
  293.     DWORD fStopped;      // was interrupt disabled during wait
  294. } WD_INTERRUPT;
  295.  
  296. typedef struct
  297. {                                                        
  298.     DWORD dwVer;  
  299.     CHAR cVer[100];
  300. } WD_VERSION;
  301.  
  302. enum 
  303. {
  304.     LICENSE_DEMO = 0x1,
  305.     LICENSE_WD = 0x4, 
  306.     LICENSE_IO = 0x8,   
  307.     LICENSE_MEM = 0x10, 
  308.     LICENSE_INT = 0x20,
  309.     LICENSE_PCI = 0x40,  
  310.     LICENSE_DMA = 0x80, 
  311.     LICENSE_NT = 0x100,
  312.     LICENSE_95 = 0x200, 
  313.     LICENSE_ISAPNP = 0x400, 
  314.     LICENSE_PCMCIA = 0x800, 
  315.     LICENSE_PCI_DUMP = 0x1000,
  316.     LICENSE_MSG_GEN = 0x2000, 
  317.     LICENSE_MSG_EDU = 0x4000, 
  318.     LICENSE_MSG_INT = 0x8000,
  319.     LICENSE_KER_PLUG = 0x10000,
  320.     LICENSE_LINUX = 0x20000,    
  321.     LICENSE_CE = 0x80000,
  322.     LICENSE_VXWORKS = 0x10000000,
  323.     LICENSE_THIS_PC = 0x100000, 
  324.     LICENSE_WIZARD = 0x200000,
  325.     LICENSE_KD = 0x400000,  
  326.     LICENSE_SOLARIS = 0x800000,
  327.     LICENSE_CPU0 = 0x40000,     
  328.     LICENSE_CPU1 = 0x1000000,
  329.     LICENSE_CPU2 = 0x2000000,   
  330.     LICENSE_CPU3 = 0x4000000,
  331.     LICENSE_USB = 0x8000000,    
  332.     LICENSE_OS2 = 0x20000000,
  333. };
  334.  
  335. enum 
  336. {
  337.     LICENSE_CPU_ALL = LICENSE_CPU3 | LICENSE_CPU2 | LICENSE_CPU1 | 
  338.         LICENSE_CPU0,
  339.     LICENSE_ALPHA = LICENSE_CPU1,
  340.     LICENSE_X86 = LICENSE_CPU0,
  341.     LICENSE_SPARC = LICENSE_CPU1 | LICENSE_CPU0,
  342. };
  343.  
  344. typedef struct
  345. {
  346.     CHAR cLicense[100]; // buffer with license string to put
  347.                         // if empty string then get current license setting 
  348.                         // into dwLicense
  349.     DWORD dwLicense;    // returns license settings: LICENSE_DEMO, LICENSE_WD etc...
  350.                         // if put license was unsuccessful (i.e. invalid license)
  351.                         // then dwLicense will return 0.
  352. } WD_LICENSE;
  353.                                             
  354. typedef struct 
  355. {
  356.     DWORD dwBusType;        // Bus Type: ISA, EISA, PCI, PCMCIA
  357.     DWORD dwBusNum;         // Bus number
  358.     DWORD dwSlotFunc;       // Slot number on Bus
  359. } WD_BUS;
  360.  
  361. enum 
  362.     WD_BUS_ISA = 1, 
  363.     WD_BUS_EISA = 2, 
  364.     WD_BUS_PCI = 5, 
  365.     WD_BUS_PCMCIA = 8,
  366. };
  367.  
  368. typedef enum 
  369.     ITEM_NONE=0, 
  370.     ITEM_INTERRUPT=1, 
  371.     ITEM_MEMORY=2, 
  372.     ITEM_IO=3, 
  373.     ITEM_BUS=5,
  374. } ITEM_TYPE;
  375.  
  376. typedef struct 
  377. {
  378.     DWORD item; // ITEM_TYPE
  379.     DWORD fNotSharable;
  380.     union
  381.     {
  382.         struct 
  383.         { // ITEM_MEMORY
  384.             DWORD dwPhysicalAddr;     // physical address on card
  385.             DWORD dwBytes;            // address range
  386.             DWORD dwTransAddr;        // returns the address to pass on to transfer commands
  387.             DWORD dwUserDirectAddr;   // returns the address for direct user read/write
  388.             DWORD dwCpuPhysicalAddr;  // returns the CPU physical address of card
  389.         } Mem;
  390.         struct
  391.         { // ITEM_IO
  392.             DWORD dwAddr;         // beginning of io address
  393.             DWORD dwBytes;        // io range
  394.         } IO;
  395.         struct
  396.         { // ITEM_INTERRUPT
  397.             DWORD dwInterrupt;  // number of interrupt to install 
  398.             DWORD dwOptions;    // interrupt options: INTERRUPT_LEVEL_SENSITIVE
  399.             DWORD hInterrupt;   // returns the handle of the interrupt installed
  400.         } Int;
  401.         WD_BUS Bus; // ITEM_BUS
  402.         struct
  403.         {
  404.             DWORD dw1;
  405.             DWORD dw2;
  406.             DWORD dw3;
  407.             DWORD dw4;
  408.             DWORD dw5;
  409.         } Val;
  410.     } I;
  411. } WD_ITEMS;
  412.  
  413. enum { WD_CARD_ITEMS = 20 };
  414.  
  415. typedef struct 
  416. {
  417.     DWORD dwItems;
  418.     WD_ITEMS Item[WD_CARD_ITEMS];
  419. } WD_CARD;
  420.  
  421. typedef struct 
  422. {
  423.     WD_CARD Card;            // card to register
  424.     DWORD fCheckLockOnly;    // only check if card is lockable, return hCard=1 if OK
  425.     DWORD hCard;             // handle of card
  426. } WD_CARD_REGISTER_V30;
  427.  
  428. typedef struct
  429. {
  430.     WD_CARD Card;           // card to register
  431.     DWORD fCheckLockOnly;   // only check if card is lockable, return hCard=1 if OK
  432.     DWORD hCard;            // handle of card
  433.     DWORD dwOptions;        // should be zero
  434.     CHAR cName[32];         // name of card
  435.     CHAR cDescription[100]; // description
  436. } WD_CARD_REGISTER;
  437.  
  438. enum { WD_PCI_CARDS = 30 };
  439.  
  440. typedef struct 
  441. {
  442.     DWORD dwBus;
  443.     DWORD dwSlot;
  444.     DWORD dwFunction;
  445. } WD_PCI_SLOT;
  446. typedef struct 
  447. {
  448.     DWORD dwVendorId;
  449.     DWORD dwDeviceId;
  450. } WD_PCI_ID;
  451.  
  452. typedef struct
  453. {
  454.     WD_PCI_ID searchId;     // if dwVendorId==0 - scan all vendor IDs
  455.                             // if dwDeviceId==0 - scan all device IDs
  456.     DWORD dwCards;          // number of cards found
  457.     WD_PCI_ID cardId[WD_PCI_CARDS]; // VendorID & DeviceID of cards found
  458.     WD_PCI_SLOT cardSlot[WD_PCI_CARDS]; // pci slot info of cards found
  459. } WD_PCI_SCAN_CARDS;
  460.  
  461. typedef struct 
  462. {
  463.     WD_PCI_SLOT pciSlot;    // pci slot
  464.     WD_CARD Card;           // get card parameters for pci slot
  465. } WD_PCI_CARD_INFO;
  466.  
  467. typedef enum
  468.     PCI_ACCESS_OK = 0, 
  469.     PCI_ACCESS_ERROR = 1, 
  470.     PCI_BAD_BUS = 2, 
  471.     PCI_BAD_SLOT = 3,
  472. } PCI_ACCESS_RESULT;
  473.  
  474. typedef struct 
  475. {
  476.     WD_PCI_SLOT pciSlot;    // pci bus, slot and function number
  477.     PVOID       pBuffer;    // buffer for read/write
  478.     DWORD       dwOffset;   // offset in pci configuration space to read/write from
  479.     DWORD       dwBytes;    // bytes to read/write from/to buffer
  480.                             // returns the number of bytes read/wrote
  481.     DWORD       fIsRead;    // if 1 then read pci config, 0 write pci config
  482.     DWORD       dwResult;   // PCI_ACCESS_RESULT
  483. } WD_PCI_CONFIG_DUMP;
  484.  
  485. enum { WD_ISAPNP_CARDS = 16 };
  486. enum { WD_ISAPNP_COMPATIBLE_IDS = 10 };
  487. enum { WD_ISAPNP_COMP_ID_LENGTH = 7 }; // ISA compressed ID is 7 chars long
  488. enum { WD_ISAPNP_ANSI_LENGTH = 32 }; // ISA ANSI ID is limited to 32 chars long
  489. typedef CHAR WD_ISAPNP_COMP_ID[WD_ISAPNP_COMP_ID_LENGTH+1]; 
  490. typedef CHAR WD_ISAPNP_ANSI[WD_ISAPNP_ANSI_LENGTH+1+3]; // add 3 bytes for DWORD alignment
  491. typedef struct 
  492. {
  493.     WD_ISAPNP_COMP_ID cVendor; // Vendor ID
  494.     DWORD dwSerial; // Serial number of card
  495. } WD_ISAPNP_CARD_ID;
  496.  
  497. typedef struct 
  498. {
  499.     WD_ISAPNP_CARD_ID cardId;  // VendorID & serial number of cards found
  500.     DWORD dwLogicalDevices;    // Logical devices on the card
  501.     BYTE bPnPVersionMajor;     // ISA PnP version Major
  502.     BYTE bPnPVersionMinor;     // ISA PnP version Minor
  503.     BYTE bVendorVersionMajor;  // Vendor version Major
  504.     BYTE bVendorVersionMinor;  // Vendor version Minor
  505.     WD_ISAPNP_ANSI cIdent;     // Device identifier
  506. } WD_ISAPNP_CARD;
  507.  
  508. typedef struct 
  509. {
  510.     WD_ISAPNP_CARD_ID searchId; // if searchId.cVendor[0]==0 - scan all vendor IDs
  511.                                 // if searchId.dwSerial==0 - scan all serial numbers
  512.     DWORD dwCards;              // number of cards found
  513.     WD_ISAPNP_CARD Card[WD_ISAPNP_CARDS]; // cards found
  514. } WD_ISAPNP_SCAN_CARDS;
  515.  
  516. typedef struct 
  517. {
  518.     WD_ISAPNP_CARD_ID cardId;   // VendorID and serial number of card
  519.     DWORD dwLogicalDevice;      // logical device in card
  520.     WD_ISAPNP_COMP_ID cLogicalDeviceId; // logical device ID
  521.     DWORD dwCompatibleDevices;  // number of compatible device IDs
  522.     WD_ISAPNP_COMP_ID CompatibleDevice[WD_ISAPNP_COMPATIBLE_IDS]; // Compatible device IDs
  523.     WD_ISAPNP_ANSI cIdent;      // Device identifier
  524.     WD_CARD Card;               // get card parameters for the ISA PnP card
  525. } WD_ISAPNP_CARD_INFO;
  526.  
  527. typedef enum 
  528.     ISAPNP_ACCESS_OK = 0, 
  529.     ISAPNP_ACCESS_ERROR = 1, 
  530.     ISAPNP_BAD_ID = 2, 
  531. } ISAPNP_ACCESS_RESULT;
  532.  
  533. typedef struct 
  534. {
  535.     WD_ISAPNP_CARD_ID cardId; // VendorID and serial number of card
  536.     DWORD dwOffset;   // offset in ISA PnP configuration space to read/write from
  537.     DWORD fIsRead;    // if 1 then read ISA PnP config, 0 write ISA PnP config
  538.     BYTE  bData;      // result data of byte read/write
  539.     DWORD dwResult;   // ISAPNP_ACCESS_RESULT
  540. } WD_ISAPNP_CONFIG_DUMP;
  541.  
  542. // PCMCIA Card Services
  543.  
  544. // Extreme case - two PCMCIA slots and two multi-function (4 functions) cards
  545. enum 
  546.     WD_PCMCIA_CARDS = 8, 
  547.     WD_PCMCIA_VERSION_LEN = 4, 
  548.     WD_PCMCIA_MANUFACTURER_LEN = 48,
  549.     WD_PCMCIA_PRODUCTNAME_LEN = 48, 
  550.     WD_PCMCIA_MAX_SOCKET = 2,
  551.     WD_PCMCIA_MAX_FUNCTION = 2, 
  552. };
  553.  
  554. typedef struct 
  555. {
  556.     BYTE uSocket;      // Specifies the socket number (first socket is 0)
  557.     BYTE uFunction;    // Specifies the function number (first function is 0)
  558.     BYTE uPadding0;    // 2 bytes padding so structure will be 4 bytes aligned
  559.     BYTE uPadding1;
  560. } WD_PCMCIA_SLOT;
  561.  
  562. typedef struct 
  563. {
  564.     DWORD dwManufacturerId; // card manufacturer
  565.     DWORD dwCardId;         // card type and model
  566. } WD_PCMCIA_ID;
  567.  
  568. typedef struct 
  569. {
  570.     WD_PCMCIA_ID searchId;           // device ID to search for
  571.     DWORD dwCards;                   // number of cards found
  572.     WD_PCMCIA_ID cardId[WD_PCMCIA_CARDS]; // device IDs of cards found
  573.     WD_PCMCIA_SLOT cardSlot[WD_PCMCIA_CARDS]; // pcmcia slot info of cards found
  574. } WD_PCMCIA_SCAN_CARDS;
  575.  
  576. typedef struct 
  577. {
  578.     WD_PCMCIA_SLOT pcmciaSlot; // pcmcia slot
  579.     WD_CARD Card;              // get card parameters for pcmcia slot
  580.     CHAR cVersion[WD_PCMCIA_VERSION_LEN];
  581.     CHAR cManufacturer[WD_PCMCIA_MANUFACTURER_LEN];
  582.     CHAR cProductName[WD_PCMCIA_PRODUCTNAME_LEN];
  583.     DWORD dwManufacturerId;    // card manufacturer
  584.     DWORD dwCardId;            // card type and model
  585.     DWORD dwFuncId;            // card function code
  586. } WD_PCMCIA_CARD_INFO;
  587.  
  588. typedef struct 
  589. {
  590.     WD_PCMCIA_SLOT pcmciaSlot;    
  591.     PVOID pBuffer;    // buffer for read/write
  592.     DWORD dwOffset;   // offset in pcmcia configuration space to 
  593.                       //    read/write from
  594.     DWORD dwBytes;    // bytes to read/write from/to buffer
  595.                       //    returns the number of bytes read/wrote
  596.     DWORD fIsRead;    // if 1 then read pci config, 0 write pci config
  597.     DWORD dwResult;   // PCMCIA_ACCESS_RESULT
  598. } WD_PCMCIA_CONFIG_DUMP;
  599.  
  600. enum { SLEEP_NON_BUSY = 1 };
  601. typedef struct 
  602. {
  603.     DWORD dwMicroSeconds; // Sleep time in Micro Seconds (1/1,000,000 Second)
  604.     DWORD dwOptions;      // can be: SLEEP_NON_BUSY (10000 uSec +)
  605. } WD_SLEEP;
  606.  
  607. typedef enum 
  608.     D_OFF       = 0, 
  609.     D_ERROR     = 1, 
  610.     D_WARN      = 2, 
  611.     D_INFO      = 3, 
  612.     D_TRACE     = 4
  613. } DEBUG_LEVEL;
  614.  
  615. typedef enum 
  616.     S_ALL       = 0xffffffff, 
  617.     S_IO        = 0x8, 
  618.     S_MEM       = 0x10, 
  619.     S_INT       = 0x20, 
  620.     S_PCI       = 0x40,
  621.     S_DMA       = 0x80,
  622.     S_MISC      = 0x100,
  623.     S_LICENSE   = 0x200,
  624.     S_ISAPNP    = 0x400,
  625.     S_PCMCIA    = 0x800,
  626.     S_KER_PLUG  = 0x10000,
  627.     S_CARD_REG  = 0x2000,
  628.     S_KER_DRV   = 0x4000,
  629.     S_USB       = 0x8000,
  630. } DEBUG_SECTION;
  631.  
  632. typedef enum 
  633.     DEBUG_STATUS = 1, 
  634.     DEBUG_SET_FILTER = 2, 
  635.     DEBUG_SET_BUFFER = 3, 
  636.     DEBUG_CLEAR_BUFFER = 4,
  637.     DEBUG_DUMP_SEC_ON = 5,
  638.     DEBUG_DUMP_SEC_OFF = 6
  639. } DEBUG_COMMAND;
  640.  
  641. typedef struct 
  642. {
  643.     DWORD dwCmd;     // DEBUG_COMMAND: DEBUG_STATUS, DEBUG_SET_FILTER, DEBUG_SET_BUFFER, DEBUG_CLEAR_BUFFER
  644.     // used for DEBUG_SET_FILTER
  645.     DWORD dwLevel;   // DEBUG_LEVEL: D_ERROR, D_WARN..., or D_OFF to turn debugging off
  646.     DWORD dwSection; // DEBUG_SECTION: for all sections in driver: S_ALL
  647.                      // for partial sections: S_IO, S_MEM...
  648.     DWORD dwLevelMessageBox; // DEBUG_LEVEL to print in a message box
  649.     // used for DEBUG_SET_BUFFER
  650.     DWORD dwBufferSize; // size of buffer in kernel
  651. } WD_DEBUG;
  652.  
  653. typedef struct 
  654. {
  655.     PCHAR pcBuffer;  // buffer to receive debug messages
  656.     DWORD dwSize;    // size of buffer in bytes
  657. } WD_DEBUG_DUMP;
  658.  
  659. typedef struct 
  660. {
  661.     DWORD hKernelPlugIn;
  662.     PCHAR pcDriverName;
  663.     PCHAR pcDriverPath; // if NULL the driver will be searched in the windows system directory 
  664.     PVOID pOpenData;
  665. } WD_KERNEL_PLUGIN;
  666.  
  667. #define WD_KERNEL_DRIVER_PLUGIN_HANDLE 0xffff0000
  668.  
  669. static DWORD GlobalDW;
  670.  
  671. #ifndef BZERO
  672.     #define BZERO(buf) memset(&(buf), 0, sizeof(buf))
  673. #endif
  674.  
  675. #ifndef INVALID_HANDLE_VALUE
  676.     #define INVALID_HANDLE_VALUE ((HANDLE)(-1))
  677. #endif
  678.  
  679. #ifndef CTL_CODE
  680.     #define CTL_CODE(DeviceType, Function, Method, Access) ( \
  681.         ((DeviceType)<<16) | ((Access)<<14) | ((Function)<<2) | (Method) \
  682.     )
  683.  
  684.     #define METHOD_BUFFERED   0
  685.     #define METHOD_IN_DIRECT  1
  686.     #define METHOD_OUT_DIRECT 2
  687.     #define METHOD_NEITHER    3
  688.     #define FILE_ANY_ACCESS   0
  689.     #define FILE_READ_ACCESS  1    // file & pipe
  690.     #define FILE_WRITE_ACCESS 2    // file & pipe
  691. #endif
  692.  
  693. // Device type
  694. #define WD_TYPE 38200
  695. #define WD_CTL_CODE(wFuncNum) ((DWORD) CTL_CODE( WD_TYPE, wFuncNum, METHOD_NEITHER, FILE_ANY_ACCESS))
  696.  
  697. // WinDriver function IOCTL calls.  For details on the WinDriver functions,
  698. // see the WinDriver manual or included help files.
  699.  
  700. #define IOCTL_WD_DMA_LOCK             WD_CTL_CODE(0x901)
  701. #define IOCTL_WD_DMA_UNLOCK           WD_CTL_CODE(0x902)
  702. #define IOCTL_WD_TRANSFER             WD_CTL_CODE(0x903)
  703. #define IOCTL_WD_MULTI_TRANSFER       WD_CTL_CODE(0x904)
  704. #define IOCTL_WD_INT_ENABLE_V30       WD_CTL_CODE(0x907)
  705. #define IOCTL_WD_INT_DISABLE_V30      WD_CTL_CODE(0x908)
  706. #define IOCTL_WD_INT_COUNT_V30        WD_CTL_CODE(0x909)
  707. #define IOCTL_WD_INT_WAIT_V30         WD_CTL_CODE(0x90a)
  708. #define IOCTL_WD_CARD_REGISTER_V30    WD_CTL_CODE(0x90c)
  709. #define IOCTL_WD_CARD_UNREGISTER_V30  WD_CTL_CODE(0x90d)
  710. #define IOCTL_WD_PCI_SCAN_CARDS       WD_CTL_CODE(0x90e)
  711. #define IOCTL_WD_PCI_GET_CARD_INFO    WD_CTL_CODE(0x90f)
  712. #define IOCTL_WD_VERSION              WD_CTL_CODE(0x910)
  713. #define IOCTL_WD_DEBUG_V30            WD_CTL_CODE(0x911)
  714. #define IOCTL_WD_LICENSE              WD_CTL_CODE(0x912)
  715. #define IOCTL_WD_PCI_CONFIG_DUMP      WD_CTL_CODE(0x91a)
  716. #define IOCTL_WD_KERNEL_PLUGIN_OPEN   WD_CTL_CODE(0x91b)
  717. #define IOCTL_WD_KERNEL_PLUGIN_CLOSE  WD_CTL_CODE(0x91c)
  718. #define IOCTL_WD_KERNEL_PLUGIN_CALL   WD_CTL_CODE(0x91d)
  719. #define IOCTL_WD_INT_ENABLE           WD_CTL_CODE(0x91e)
  720. #define IOCTL_WD_INT_DISABLE          WD_CTL_CODE(0x91f)
  721. #define IOCTL_WD_INT_COUNT            WD_CTL_CODE(0x920)
  722. #define IOCTL_WD_INT_WAIT             WD_CTL_CODE(0x921)
  723. #define IOCTL_WD_ISAPNP_SCAN_CARDS    WD_CTL_CODE(0x924)
  724. #define IOCTL_WD_ISAPNP_GET_CARD_INFO_V40 WD_CTL_CODE(0x925)
  725. #define IOCTL_WD_ISAPNP_CONFIG_DUMP   WD_CTL_CODE(0x926)
  726. #define IOCTL_WD_SLEEP                WD_CTL_CODE(0x927)
  727. #define IOCTL_WD_DEBUG                WD_CTL_CODE(0x928)
  728. #define IOCTL_WD_DEBUG_DUMP           WD_CTL_CODE(0x929)
  729. #define IOCTL_WD_CARD_REGISTER_V40    WD_CTL_CODE(0x92a)
  730. #define IOCTL_WD_CARD_UNREGISTER      WD_CTL_CODE(0x92b)
  731. #define IOCTL_WD_CARD_REGISTER_V41    WD_CTL_CODE(0x92c)
  732. #define IOCTL_WD_ISAPNP_GET_CARD_INFO WD_CTL_CODE(0x92d)
  733. #define IOCTL_WD_PCMCIA_SCAN_CARDS    WD_CTL_CODE(0x92f)
  734. #define IOCTL_WD_PCMCIA_GET_CARD_INFO WD_CTL_CODE(0x930)
  735. #define IOCTL_WD_PCMCIA_CONFIG_DUMP   WD_CTL_CODE(0x931)
  736. #define IOCTL_WD_CARD_REGISTER_V42    WD_CTL_CODE(0x939)
  737. #define IOCTL_WD_CARD_REGISTER_V43    WD_CTL_CODE(0x948)
  738. #define IOCTL_WD_CARD_REGISTER        WD_CTL_CODE(0x94a)
  739.  
  740. #if defined(UNIX)
  741.     typedef struct
  742.     { 
  743.         DWORD dwHeader; 
  744.         PVOID pData; 
  745.         DWORD dwSize;
  746.     } WD_IOCTL_HEADER;
  747.     
  748.     enum { WD_IOCTL_HEADER_CODE = 0xa410b413 };
  749. #endif
  750.  
  751. #if defined(__KERNEL__) || defined(OS2)
  752.     #if defined(OS2)
  753.         DWORD EXPENTRY wdr_open();
  754.         NTSTATUS EXPENTRY wdr_close(HANDLE h);
  755.         NTSTATUS EXPENTRY wdr_ioctl(HANDLE h, DWORD dwFuncNum, PVOID pParam, DWORD dwSize);
  756.         #define WD_Open() ((HANDLE)wdr_open()) 
  757.  
  758.         #define WD_Close(h) wdr_close(h)
  759.         #define WD_FUNCTION(wFuncNum, h, pParam, dwSize, fWait) \
  760.         { \
  761.             wdr_ioctl(h, \
  762.                 wFuncNum, \
  763.                  pParam, \
  764.                  dwSize \
  765.                 ); \
  766.         }
  767.     #else
  768.         HANDLE __cdecl WD_Open();
  769.         void __cdecl WD_Close(HANDLE hWD);
  770.         ULONG __cdecl KP_DeviceIoControl(DWORD dwFuncNum, HANDLE h, PVOID pParam,
  771.             DWORD dwSize);
  772.         #define WD_FUNCTION(wFuncNum, h, pParam, dwSize, fWait) \
  773.             KP_DeviceIoControl(\
  774.                 (DWORD) wFuncNum, h,\
  775.                 (PVOID) pParam, (DWORD) dwSize\
  776.                 ) 
  777.     #endif
  778. #else
  779.     #if defined(UNIX)
  780.         static inline ULONG WD_FUNCTION( DWORD wFuncNum, HANDLE h,
  781.                 PVOID pParam, DWORD dwSize, BOOL fWait)
  782.         {
  783.             WD_IOCTL_HEADER ioctl_hdr;
  784.             ioctl_hdr.dwHeader = WD_IOCTL_HEADER_CODE;
  785.             ioctl_hdr.pData = pParam;
  786.             ioctl_hdr.dwSize = dwSize;
  787.             #if defined(VXWORKS)
  788.                 return (ULONG) ioctl((int)(h), wFuncNum, (int)&ioctl_hdr);
  789.             #elif defined(LINUX) || defined(SOLARIS)
  790.                 return (ULONG) ioctl((int)(h), wFuncNum, &ioctl_hdr);
  791.             #endif
  792.         }
  793.  
  794.         #if defined(VXWORKS)
  795.             #define WD_Open()\
  796.                 ((HANDLE)open("/windrvr", O_RDWR, 0644))
  797.         #else
  798.             #define WD_Open()\
  799.                 ((HANDLE)open("/dev/windrvr", O_RDWR))
  800.         #endif
  801.             
  802.         #define WD_Close(h)\
  803.             close((int) (h))
  804.     
  805.     #elif defined(WINCE) && defined(_WIN32_WCE_EMULATION)
  806.         HANDLE WINAPI WCE_EMU_WD_Open();
  807.         void WINAPI WCE_EMU_WD_Close(HANDLE hWD);
  808.         BOOL WINAPI WCE_EMU_WD_FUNCTION(DWORD wFuncNum, HANDLE h, PVOID 
  809.             pParam, DWORD dwSize);
  810.         #define WD_Open() WCE_EMU_WD_Open()
  811.         #define WD_Close(h) WCE_EMU_WD_Close(h)
  812.         #define WD_FUNCTION(wFuncNum, h, pParam, dwSize, fWait) \
  813.             WCE_EMU_WD_FUNCTION(wFuncNum, h, pParam, dwSize)
  814.     #elif defined(WIN32) || defined(WINCE)
  815.         #define WD_Close(h)\
  816.             CloseHandle(h)
  817.         #if defined(WINCE)
  818.             void WINAPI SetProcPermissions(DWORD dwPermissions);
  819.             #define WD_Open()\
  820.                 (SetProcPermissions(0xFFFF), CreateFile(\
  821.                     TEXT("WDR1:"),\
  822.                     GENERIC_READ,\
  823.                     FILE_SHARE_READ | FILE_SHARE_WRITE,\
  824.                     NULL, OPEN_EXISTING, 0, NULL))
  825.             #define WD_FUNCTION(wFuncNum, h, pParam, dwSize, fWait)\
  826.                 ((DWORD) DeviceIoControl(h, wFuncNum, pParam, dwSize, NULL, 0,\
  827.                     &GlobalDW, NULL))
  828.         #elif defined(WIN32)
  829.             #define WD_Open()\
  830.                 CreateFile(\
  831.                     TEXT("\\\\.\\WINDRVR"),\
  832.                     GENERIC_READ,\
  833.                     FILE_SHARE_READ | FILE_SHARE_WRITE,\
  834.                     NULL, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, NULL)  
  835.             static DWORD WD_FUNCTION(DWORD wFuncNum, HANDLE h,
  836.                 PVOID pParam, DWORD dwSize, BOOL fWait)
  837.             {
  838.                 HANDLE hWD = fWait ? WD_Open() : h;
  839.                 DWORD rc;
  840.                 if (hWD==INVALID_HANDLE_VALUE)
  841.                     return (DWORD) -1;
  842.                 rc = (DWORD) DeviceIoControl(hWD, (DWORD) wFuncNum, (PVOID) pParam,
  843.                     (DWORD) dwSize, NULL, 0, &GlobalDW, NULL);
  844.                 if (fWait)
  845.                     WD_Close(hWD);
  846.                 return rc;
  847.             }
  848.         #endif
  849.     #endif
  850. #endif
  851.  
  852. #define WD_Debug(h,pDebug)\
  853.     WD_FUNCTION(IOCTL_WD_DEBUG, h, pDebug, sizeof (WD_DEBUG), FALSE)
  854. #define WD_DebugDump(h,pDebugDump)\
  855.     WD_FUNCTION(IOCTL_WD_DEBUG_DUMP, h, pDebugDump, sizeof (WD_DEBUG_DUMP), FALSE)
  856. #define WD_DebugV30(h,Debug)\
  857.     WD_FUNCTION(IOCTL_WD_DEBUG_V30, h, NULL, Debug, FALSE)
  858. #define WD_Transfer(h,pTransfer)\
  859.     WD_FUNCTION(IOCTL_WD_TRANSFER, h, pTransfer, sizeof (WD_TRANSFER), FALSE)
  860. #define WD_MultiTransfer(h,pTransferArray,dwNumTransfers)\
  861.     WD_FUNCTION(IOCTL_WD_MULTI_TRANSFER, h, pTransferArray, sizeof (WD_TRANSFER) * dwNumTransfers, FALSE)
  862. #define WD_DMALock(h,pDma)\
  863.     WD_FUNCTION(IOCTL_WD_DMA_LOCK, h, pDma, sizeof (WD_DMA), FALSE)
  864. #define WD_DMAUnlock(h,pDma)\
  865.     WD_FUNCTION(IOCTL_WD_DMA_UNLOCK, h, pDma, sizeof (WD_DMA), FALSE)
  866. #define WD_IntEnableV30(h,pInterrupt)\
  867.     WD_FUNCTION(IOCTL_WD_INT_ENABLE_V30, h, pInterrupt, sizeof (WD_INTERRUPT_V30), FALSE)
  868. #define WD_IntDisableV30(h,pInterrupt)\
  869.     WD_FUNCTION(IOCTL_WD_INT_DISABLE_V30, h, pInterrupt, sizeof (WD_INTERRUPT_V30), FALSE)
  870. #define WD_IntCountV30(h,pInterrupt)\
  871.     WD_FUNCTION(IOCTL_WD_INT_COUNT_V30, h, pInterrupt, sizeof (WD_INTERRUPT_V30), FALSE)
  872. #define WD_IntWaitV30(h,pInterrupt)\
  873.     WD_FUNCTION(IOCTL_WD_INT_WAIT_V30, h, pInterrupt, sizeof (WD_INTERRUPT_V30), TRUE)
  874. #define WD_CardRegisterV30(h,pCard)\
  875.     WD_FUNCTION(IOCTL_WD_CARD_REGISTER_V30, h, pCard, sizeof (WD_CARD_REGISTER_V30), FALSE)
  876. #define WD_CardUnregisterV30(h,pCard)\
  877.     WD_FUNCTION(IOCTL_WD_CARD_UNREGISTER_V30, h, pCard, sizeof (WD_CARD_REGISTER_V30), FALSE)
  878. #define WD_CardRegisterV40(h,pCard)\
  879.     WD_FUNCTION(IOCTL_WD_CARD_REGISTER_V40, h, pCard, sizeof (WD_CARD_REGISTER), FALSE)
  880. #define WD_CardRegisterV41(h,pCard)\
  881.     WD_FUNCTION(IOCTL_WD_CARD_REGISTER_V41, h, pCard, sizeof (WD_CARD_REGISTER), FALSE)
  882. #define WD_CardRegisterV42(h,pCard)\
  883.     WD_FUNCTION(IOCTL_WD_CARD_REGISTER_V42, h, pCard, sizeof (WD_CARD_REGISTER), FALSE)
  884. #define WD_CardRegister(h,pCard)\
  885.     WD_FUNCTION(IOCTL_WD_CARD_REGISTER, h, pCard, sizeof (WD_CARD_REGISTER), FALSE)
  886. #define WD_CardUnregister(h,pCard)\
  887.     WD_FUNCTION(IOCTL_WD_CARD_UNREGISTER, h, pCard, sizeof (WD_CARD_REGISTER), FALSE)
  888. #define WD_PciScanCards(h,pPciScan)\
  889.     WD_FUNCTION(IOCTL_WD_PCI_SCAN_CARDS, h, pPciScan, sizeof (WD_PCI_SCAN_CARDS), FALSE)
  890. #define WD_PciGetCardInfo(h,pPciCard)\
  891.     WD_FUNCTION(IOCTL_WD_PCI_GET_CARD_INFO, h, pPciCard, sizeof (WD_PCI_CARD_INFO), FALSE)
  892. #define WD_PciConfigDump(h,pPciConfigDump)\
  893.     WD_FUNCTION(IOCTL_WD_PCI_CONFIG_DUMP, h, pPciConfigDump, sizeof (WD_PCI_CONFIG_DUMP), FALSE)
  894. #define WD_Version(h,pVerInfo)\
  895.     WD_FUNCTION(IOCTL_WD_VERSION, h, pVerInfo, sizeof (WD_VERSION), FALSE)
  896. #define WD_License(h,pLicense)\
  897.     WD_FUNCTION(IOCTL_WD_LICENSE, h, pLicense, sizeof (WD_LICENSE), FALSE)
  898. #define WD_KernelPlugInOpen(h,pKernelPlugIn)\
  899.     WD_FUNCTION(IOCTL_WD_KERNEL_PLUGIN_OPEN, h, pKernelPlugIn, sizeof (WD_KERNEL_PLUGIN), FALSE)
  900. #define WD_KernelPlugInClose(h,pKernelPlugIn)\
  901.     WD_FUNCTION(IOCTL_WD_KERNEL_PLUGIN_CLOSE, h, pKernelPlugIn, sizeof (WD_KERNEL_PLUGIN), FALSE)
  902. #define WD_KernelPlugInCall(h,pKernelPlugInCall)\
  903.     WD_FUNCTION(IOCTL_WD_KERNEL_PLUGIN_CALL, h, pKernelPlugInCall, sizeof (WD_KERNEL_PLUGIN_CALL), FALSE)
  904. #define WD_IntEnable(h,pInterrupt)\
  905.     WD_FUNCTION(IOCTL_WD_INT_ENABLE, h, pInterrupt, sizeof (WD_INTERRUPT), FALSE)
  906. #define WD_IntDisable(h,pInterrupt)\
  907.     WD_FUNCTION(IOCTL_WD_INT_DISABLE, h, pInterrupt, sizeof (WD_INTERRUPT), FALSE)
  908. #define WD_IntCount(h,pInterrupt)\
  909.     WD_FUNCTION(IOCTL_WD_INT_COUNT, h, pInterrupt, sizeof (WD_INTERRUPT), FALSE)
  910. #define WD_IntWait(h,pInterrupt)\
  911.     WD_FUNCTION(IOCTL_WD_INT_WAIT, h, pInterrupt, sizeof (WD_INTERRUPT), TRUE)
  912. #define WD_IsapnpScanCards(h,pIsapnpScan)\
  913.     WD_FUNCTION(IOCTL_WD_ISAPNP_SCAN_CARDS, h, pIsapnpScan, sizeof (WD_ISAPNP_SCAN_CARDS), FALSE)
  914. #define WD_IsapnpGetCardInfo(h,pIsapnpCard)\
  915.     WD_FUNCTION(IOCTL_WD_ISAPNP_GET_CARD_INFO, h, pIsapnpCard, sizeof (WD_ISAPNP_CARD_INFO), FALSE)
  916. #define WD_IsapnpConfigDump(h,pIsapnpConfigDump)\
  917.     WD_FUNCTION(IOCTL_WD_ISAPNP_CONFIG_DUMP, h, pIsapnpConfigDump, sizeof (WD_ISAPNP_CONFIG_DUMP), FALSE)
  918. #define WD_PcmciaScanCards(h,pPcmciaScan)\
  919.     WD_FUNCTION(IOCTL_WD_PCMCIA_SCAN_CARDS, h, pPcmciaScan, sizeof (WD_PCMCIA_SCAN_CARDS), FALSE)
  920. #define WD_PcmciaGetCardInfo(h,pPcmciaCard)\
  921.     WD_FUNCTION(IOCTL_WD_PCMCIA_GET_CARD_INFO, h, pPcmciaCard, sizeof (WD_PCMCIA_CARD_INFO), FALSE)
  922. #define WD_PcmciaConfigDump(h,pPcmciaConfigDump)\
  923.     WD_FUNCTION(IOCTL_WD_PCMCIA_CONFIG_DUMP, h, pPcmciaConfigDump, sizeof (WD_PCMCIA_CONFIG_DUMP), FALSE)
  924. #define WD_Sleep(h,pSleep)\
  925.     WD_FUNCTION(IOCTL_WD_SLEEP, h, pSleep, sizeof (WD_SLEEP), FALSE)
  926.  
  927. #ifdef __cplusplus
  928. }
  929. #endif
  930.  
  931. #include "windrvr_usb.h"
  932.  
  933. #endif
  934.