Jungo WinDriver  
Official Documentation
wdc_lib.h File Reference
#include "windrvr.h"
#include "windrvr_int_thread.h"
#include "windrvr_events.h"
#include "bits.h"
#include "pci_regs.h"

Go to the source code of this file.

Data Structures

struct  WDC_PCI_SCAN_RESULT
 PCI scan results. More...
 
struct  WDC_PCI_SCAN_CAPS_RESULT
 PCI capabilities scan results. More...
 
struct  WDC_INTERRUPT_PARAMS
 

Macros

#define MAX_NAME   128
 
#define MAX_DESC   128
 
#define MAX_NAME_DISPLAY   22
 
#define WDC_DRV_OPEN_CHECK_VER   0x1
 Compare source files WinDriver version with that of the running WinDriver kernel.
 
#define WDC_DRV_OPEN_REG_LIC   0x2
 Register WinDriver license.
 
#define WDC_DRV_OPEN_BASIC   0x0
 No option -> perform only the basic open driver tasks, which are always performed by WDC_DriverOpen (mainly - open a handle to WinDriver)
 
#define WDC_DRV_OPEN_KP   WDC_DRV_OPEN_BASIC
 Kernel PlugIn driver open options <=> basic.
 
#define WDC_DRV_OPEN_ALL   (WDC_DRV_OPEN_CHECK_VER | WDC_DRV_OPEN_REG_LIC)
 
#define WDC_DRV_OPEN_DEFAULT   WDC_DRV_OPEN_ALL
 
#define WDC_DBG_OUT_DBM   0x1
 Send WDC debug messages to the Debug Monitor.
 
#define WDC_DBG_OUT_FILE   0x2
 Send WDC debug messages to a debug file (default: stderr) [User-mode only].
 
#define WDC_DBG_LEVEL_ERR   0x10
 Display only error WDC debug messages.
 
#define WDC_DBG_LEVEL_TRACE   0x20
 Display error and trace WDC debug messages.
 
#define WDC_DBG_NONE   0x100
 Do not print debug messages.
 
#define WDC_DBG_DEFAULT   (WDC_DBG_OUT_DBM | WDC_DBG_LEVEL_TRACE)
 Convenient debug options combinations/defintions.
 
#define WDC_DBG_DBM_ERR   (WDC_DBG_OUT_DBM | WDC_DBG_LEVEL_ERR)
 
#define WDC_DBG_DBM_TRACE   (WDC_DBG_OUT_DBM | WDC_DBG_LEVEL_TRACE)
 
#define WDC_DBG_FILE_ERR   (WDC_DBG_OUT_FILE | WDC_DBG_LEVEL_ERR)
 
#define WDC_DBG_FILE_TRACE   (WDC_DBG_OUT_FILE | WDC_DBG_LEVEL_TRACE)
 
#define WDC_DBG_DBM_FILE_ERR    (WDC_DBG_OUT_DBM | WDC_DBG_OUT_FILE | WDC_DBG_LEVEL_ERR)
 
#define WDC_DBG_DBM_FILE_TRACE    (WDC_DBG_OUT_DBM | WDC_DBG_OUT_FILE | WDC_DBG_LEVEL_TRACE)
 
#define WDC_DBG_FULL    (WDC_DBG_OUT_DBM | WDC_DBG_OUT_FILE | WDC_DBG_LEVEL_TRACE)
 
#define WDC_SLEEP_BUSY   0
 Sleep options.
 
#define WDC_SLEEP_NON_BUSY   SLEEP_NON_BUSY
 
#define WDC_SIZE_8   ((DWORD)sizeof(BYTE))
 
#define WDC_SIZE_16   ((DWORD)sizeof(WORD))
 
#define WDC_SIZE_32   ((DWORD)sizeof(UINT32))
 
#define WDC_SIZE_64   ((DWORD)sizeof(UINT64))
 
#define WDC_ADDR_MODE_TO_SIZE(mode)   (DWORD)mode
 
#define WDC_ADDR_SIZE_TO_MODE(size)
 
#define WDC_AD_CFG_SPACE   0xFF
 Device configuration space identifier (PCI configuration space)
 
#define WDC_ReadMem8(addr, off)   *(volatile BYTE *)((UPTR)(addr) + (UPTR)(off))
 Direct memory read/write macros.
 
#define WDC_ReadMem16(addr, off)    *(volatile WORD *)((UPTR)(addr) + (UPTR)(off))
 reads 2 byte (16 bits) from a specified memory address.
 
#define WDC_ReadMem32(addr, off)    *(volatile UINT32 *)((UPTR)(addr) + (UPTR)(off))
 reads 4 byte (32 bits) from a specified memory address.
 
#define WDC_ReadMem64(addr, off)    *(volatile UINT64 *)((UPTR)(addr) + (UPTR)(off))
 reads 8 byte (64 bits) from a specified memory address.
 
#define WDC_WriteMem8(addr, off, val)    *(volatile BYTE * )(((UPTR)(addr) + (UPTR)(off))) = (val)
 writes 1 byte (8 bits) to a specified memory address.
 
#define WDC_WriteMem16(addr, off, val)    *(volatile WORD * )(((UPTR)(addr) + (UPTR)(off))) = (val)
 writes 2 byte (16 bits) to a specified memory address.
 
#define WDC_WriteMem32(addr, off, val)    *(volatile UINT32 *)(((UPTR)(addr) + (UPTR)(off))) = (val)
 writes 4 byte (32 bits) to a specified memory address.
 
#define WDC_WriteMem64(addr, off, val)    *(volatile UINT64 *)(((UPTR)(addr) + (UPTR)(off))) = (val)
 writes 8 byte (64 bits) to a specified memory address.
 
#define WDC_ReadAddrBlock8(hDev, dwAddrSpace, dwOffset, dwBytes, pData, options)
 WDC_ReadAddrBlock with 1 byte mode.
 
#define WDC_ReadAddrBlock16(hDev, dwAddrSpace, dwOffset, dwBytes, pData, options)
 WDC_ReadAddrBlock with 2 bytes mode.
 
#define WDC_ReadAddrBlock32(hDev, dwAddrSpace, dwOffset, dwBytes, pData, options)
 WDC_ReadAddrBlock with 4 bytes mode.
 
#define WDC_ReadAddrBlock64(hDev, dwAddrSpace, dwOffset, dwBytes, pData, options)
 WDC_ReadAddrBlock with 8 bytes mode.
 
#define WDC_WriteAddrBlock8(hDev, dwAddrSpace, dwOffset, dwBytes, pData, options)
 WDC_WriteAddrBlock with 1 byte mode.
 
#define WDC_WriteAddrBlock16(hDev, dwAddrSpace, dwOffset, dwBytes, pData, options)
 WDC_WriteAddrBlock with 2 bytes mode.
 
#define WDC_WriteAddrBlock32(hDev, dwAddrSpace, dwOffset, dwBytes, pData, options)
 WDC_WriteAddrBlock with 4 bytes mode.
 
#define WDC_WriteAddrBlock64(hDev, dwAddrSpace, dwOffset, dwBytes, pData, options)
 WDC_WriteAddrBlock with 8 bytes mode.
 
#define WDC_DMAGetGlobalHandle(pDma)   ((pDma)->hDma)
 Utility macro that returns a contiguous DMA global handle that can be used for buffer sharing between multiple processes.
 

Typedefs

typedef void * WDC_DEVICE_HANDLE
 Handle to device information struct.
 
typedef DWORD WDC_DRV_OPEN_OPTIONS
 
typedef DWORD WDC_DBG_OPTIONS
 
typedef DWORD WDC_SLEEP_OPTIONS
 
typedef DWORD WDC_ADDR_SIZE
 

Enumerations

enum  WDC_DIRECTION { WDC_WRITE , WDC_READ , WDC_READ_WRITE }
 
enum  WDC_ADDR_RW_OPTIONS { WDC_ADDR_RW_DEFAULT = 0x0 , WDC_ADDR_RW_NO_AUTOINC = 0x4 }
 Read/write address options. More...
 
enum  WDC_ADDR_MODE { WDC_MODE_8 = WDC_SIZE_8 , WDC_MODE_16 = WDC_SIZE_16 , WDC_MODE_32 = WDC_SIZE_32 , WDC_MODE_64 = WDC_SIZE_64 }
 

Functions

HANDLE DLLCALLCONV WDC_GetWDHandle (void)
 Get a handle to WinDriver.
 
PVOID DLLCALLCONV WDC_GetDevContext (_In_ WDC_DEVICE_HANDLE hDev)
 Returns the device's user context information.
 
WD_BUS_TYPE DLLCALLCONV WDC_GetBusType (_In_ WDC_DEVICE_HANDLE hDev)
 Returns the device's bus type: WD_BUS_PCI, WD_BUS_ISA or WD_BUS_UNKNOWN.
 
DWORD DLLCALLCONV WDC_Sleep (_In_ DWORD dwMicroSecs, _In_ WDC_SLEEP_OPTIONS options)
 Delays execution for the specified duration of time (in microseconds).
 
DWORD DLLCALLCONV WDC_Version (_Outptr_ CHAR *pcVersion, _In_ DWORD dwLen, _Outptr_ DWORD *pdwVersion)
 Returns the version number of the WinDriver kernel module used by the WDC library.
 
DWORD DLLCALLCONV WDC_DriverOpen (_In_ WDC_DRV_OPEN_OPTIONS openOptions, _In_ const CHAR *pcLicense)
 Opens and stores a handle to WinDriver's kernel module and initializes the WDC library according to the open options passed to it.
 
DWORD DLLCALLCONV WDC_DriverClose (void)
 Closes the WDC WinDriver handle (acquired and stored by a previous call to WDC_DriverOpen()) and uninitializes the WDC library.
 
DWORD DLLCALLCONV WDC_PciScanDevices (_In_ DWORD dwVendorId, _In_ DWORD dwDeviceId, _Outptr_ WDC_PCI_SCAN_RESULT *pPciScanResult)
 Scans the PCI bus for all devices with the specified vendor and device ID combination and returns information regarding the matching devices that were found and their locations.
 
DWORD DLLCALLCONV WDC_PciScanDevicesByTopology (_In_ DWORD dwVendorId, _In_ DWORD dwDeviceId, _Outptr_ WDC_PCI_SCAN_RESULT *pPciScanResult)
 Scans the PCI bus for all devices with the specified vendor and device ID combination and returns information regarding the matching devices that were found and their locations.
 
DWORD DLLCALLCONV WDC_PciScanRegisteredDevices (_In_ DWORD dwVendorId, _In_ DWORD dwDeviceId, _Outptr_ WDC_PCI_SCAN_RESULT *pPciScanResult)
 Scans the PCI bus for all devices with the specified vendor and device ID combination that have been registered to work with WinDriver, and returns information regarding the matching devices that were found and their locations.
 
DWORD DLLCALLCONV WDC_PciGetExpressOffset (_In_ WDC_DEVICE_HANDLE hDev, _Outptr_ DWORD *pdwOffset)
 Retrieves the PCI Express configuration registers' offset in the device's configuration space.
 
DWORD DLLCALLCONV WDC_PciGetHeaderType (_In_ WDC_DEVICE_HANDLE hDev, _Outptr_ WDC_PCI_HEADER_TYPE *pHeaderType)
 Retrieves the PCI device's configuration space header type.
 
DWORD DLLCALLCONV WDC_PciScanCaps (_In_ WDC_DEVICE_HANDLE hDev, _In_ DWORD dwCapId, _Outptr_ WDC_PCI_SCAN_CAPS_RESULT *pScanCapsResult)
 Scans the basic PCI capabilities of the given device for the specified capability (or for all capabilities).
 
DWORD DLLCALLCONV WDC_PciScanCapsBySlot (_In_ WD_PCI_SLOT *pPciSlot, _In_ DWORD dwCapId, _Outptr_ WDC_PCI_SCAN_CAPS_RESULT *pScanCapsResult)
 Scans the basic PCI capabilities of the given device for the specified capability (or for all capabilities).
 
DWORD DLLCALLCONV WDC_PciScanExtCaps (_In_ WDC_DEVICE_HANDLE hDev, _In_ DWORD dwCapId, _Outptr_ WDC_PCI_SCAN_CAPS_RESULT *pScanCapsResult)
 Scans the extended (PCI Express) PCI capabilities of the given device for the specified capability (or for all capabilities).
 
DWORD DLLCALLCONV WDC_PciGetExpressGenBySlot (_In_ WD_PCI_SLOT *pPciSlot)
 Retrieves the PCI Express generation of a device.
 
DWORD DLLCALLCONV WDC_PciGetExpressGen (_In_ WDC_DEVICE_HANDLE hDev)
 Retrieves the PCI Express generation of a device.
 
DWORD DLLCALLCONV WDC_PciGetDeviceInfo (_Inout_ WD_PCI_CARD_INFO *pDeviceInfo)
 Retrieves a PCI device's resources information (memory and I/O ranges and interrupt information).
 
DWORD DLLCALLCONV WDC_PciSriovEnable (_In_ WDC_DEVICE_HANDLE hDev, _In_ DWORD dwNumVFs)
 SR-IOV API functions are not part of the standard WinDriver API, and not included in the standard version of WinDriver.
 
DWORD DLLCALLCONV WDC_PciSriovDisable (_In_ WDC_DEVICE_HANDLE hDev)
 Disables SR-IOV for a supported device and removes all the assigned VFs.
 
DWORD DLLCALLCONV WDC_PciSriovGetNumVFs (_In_ WDC_DEVICE_HANDLE hDev, _Outptr_ DWORD *pdwNumVFs)
 Gets the number of virtual functions assigned to a supported device.
 
DWORD DLLCALLCONV WDC_PciDeviceOpen (_Outptr_ WDC_DEVICE_HANDLE *phDev, _In_ const WD_PCI_CARD_INFO *pDeviceInfo, _In_ const PVOID pDevCtx)
 Allocates and initializes a WDC PCI device structure, registers the device with WinDriver, and returns a handle to the device.
 
DWORD DLLCALLCONV WDC_IsaDeviceOpen (_Outptr_ WDC_DEVICE_HANDLE *phDev, _In_ const WD_CARD *pDeviceInfo, _In_ const PVOID pDevCtx)
 Allocates and initializes a WDC ISA device structure, registers the device with WinDriver, and returns a handle to the device.
 
DWORD DLLCALLCONV WDC_PciDeviceClose (_In_ WDC_DEVICE_HANDLE hDev)
 Uninitializes a WDC PCI device structure and frees the memory allocated for it.
 
DWORD DLLCALLCONV WDC_IsaDeviceClose (_In_ WDC_DEVICE_HANDLE hDev)
 Uninitializes a WDC ISA device structure and frees the memory allocated for it.
 
DWORD WDC_CardCleanupSetup (_In_ WDC_DEVICE_HANDLE hDev, _In_ WD_TRANSFER *pTransCmds, _In_ DWORD dwCmds, _In_ BOOL fForceCleanup)
 Sets a list of transfer cleanup commands to be performed for the specified card on any of the following occasions:
 
DWORD DLLCALLCONV WDC_KernelPlugInOpen (_In_ WDC_DEVICE_HANDLE hDev, _In_ const CHAR *pcKPDriverName, _In_ PVOID pKPOpenData)
 Opens a handle to a Kernel PlugIn driver.
 
DWORD DLLCALLCONV WDC_CallKerPlug (_In_ WDC_DEVICE_HANDLE hDev, _In_ DWORD dwMsg, _Inout_ PVOID pData, _Outptr_ PDWORD pdwResult)
 Sends a message from a user-mode application to a Kernel PlugIn driver.
 
DWORD DLLCALLCONV WDC_ReadAddr8 (_In_ WDC_DEVICE_HANDLE hDev, _In_ DWORD dwAddrSpace, _In_ KPTR dwOffset, _Outptr_ BYTE *pbVal)
 Read/write a device's address space (8/16/32/64 bits)
 
DWORD DLLCALLCONV WDC_ReadAddr16 (_In_ WDC_DEVICE_HANDLE hDev, _In_ DWORD dwAddrSpace, _In_ KPTR dwOffset, _Outptr_ WORD *pwVal)
 reads 2 byte (16 bits) from a specified memory or I/O address.
 
DWORD DLLCALLCONV WDC_ReadAddr32 (_In_ WDC_DEVICE_HANDLE hDev, _In_ DWORD dwAddrSpace, _In_ KPTR dwOffset, _Outptr_ UINT32 *pdwVal)
 reads 4 byte (32 bits) from a specified memory or I/O address.
 
DWORD DLLCALLCONV WDC_ReadAddr64 (_In_ WDC_DEVICE_HANDLE hDev, _In_ DWORD dwAddrSpace, _In_ KPTR dwOffset, _Outptr_ UINT64 *pqwVal)
 reads 8 byte (64 bits) from a specified memory or I/O address.
 
DWORD DLLCALLCONV WDC_WriteAddr8 (_In_ WDC_DEVICE_HANDLE hDev, _In_ DWORD dwAddrSpace, _In_ KPTR dwOffset, _In_ BYTE bVal)
 writes 1 byte (8 bits) to a specified memory or I/O address.
 
DWORD DLLCALLCONV WDC_WriteAddr16 (_In_ WDC_DEVICE_HANDLE hDev, _In_ DWORD dwAddrSpace, _In_ KPTR dwOffset, _In_ WORD wVal)
 writes 2 byte (16 bits) to a specified memory or I/O address.
 
DWORD DLLCALLCONV WDC_WriteAddr32 (_In_ WDC_DEVICE_HANDLE hDev, _In_ DWORD dwAddrSpace, _In_ KPTR dwOffset, _In_ UINT32 dwVal)
 writes 4 byte (32 bits) to a specified memory or I/O address.
 
DWORD DLLCALLCONV WDC_WriteAddr64 (_In_ WDC_DEVICE_HANDLE hDev, _In_ DWORD dwAddrSpace, _In_ KPTR dwOffset, _In_ UINT64 qwVal)
 writes 8 byte (64 bits) to a specified memory or I/O address.
 
DWORD DLLCALLCONV WDC_ReadAddrBlock (_In_ WDC_DEVICE_HANDLE hDev, _In_ DWORD dwAddrSpace, _In_ KPTR dwOffset, _In_ DWORD dwBytes, _Outptr_ PVOID pData, _In_ WDC_ADDR_MODE mode, _In_ WDC_ADDR_RW_OPTIONS options)
 Reads a block of data from the device.
 
DWORD DLLCALLCONV WDC_WriteAddrBlock (_In_ WDC_DEVICE_HANDLE hDev, _In_ DWORD dwAddrSpace, _In_ KPTR dwOffset, _In_ DWORD dwBytes, _In_ PVOID pData, _In_ WDC_ADDR_MODE mode, _In_ WDC_ADDR_RW_OPTIONS options)
 Writes a block of data to the device.
 
DWORD DLLCALLCONV WDC_MultiTransfer (_In_ WD_TRANSFER *pTransCmds, _In_ DWORD dwNumTrans)
 Performs a group of memory and/or I/O read/write transfers.
 
BOOL DLLCALLCONV WDC_AddrSpaceIsActive (_In_ WDC_DEVICE_HANDLE hDev, _In_ DWORD dwAddrSpace)
 Checks if the specified memory or I/O address space is active ,i.e., if its size is not zero.
 
DWORD DLLCALLCONV WDC_PciReadCfgBySlot (_In_ WD_PCI_SLOT *pPciSlot, _In_ DWORD dwOffset, _Outptr_ PVOID pData, _In_ DWORD dwBytes)
 Read/write a block of any length from the PCI configuration space.
 
DWORD DLLCALLCONV WDC_PciWriteCfgBySlot (_In_ WD_PCI_SLOT *pPciSlot, _In_ DWORD dwOffset, _In_ PVOID pData, _In_ DWORD dwBytes)
 Write data to a specified offset in a PCI device's configuration space or a PCI Express device's extended configuration space.
 
DWORD DLLCALLCONV WDC_PciReadCfg (_In_ WDC_DEVICE_HANDLE hDev, _In_ DWORD dwOffset, _Outptr_ PVOID pData, _In_ DWORD dwBytes)
 Identify device by handle.
 
DWORD DLLCALLCONV WDC_PciWriteCfg (_In_ WDC_DEVICE_HANDLE hDev, _In_ DWORD dwOffset, _In_ PVOID pData, _In_ DWORD dwBytes)
 Writes data to a specified offset in a PCI device's configuration space or a PCI Express device's extended configuration space.
 
DWORD DLLCALLCONV WDC_PciReadCfgBySlot8 (_In_ WD_PCI_SLOT *pPciSlot, _In_ DWORD dwOffset, _Outptr_ BYTE *pbVal)
 Read/write 8/16/32/64 bits from the PCI configuration space.
 
DWORD DLLCALLCONV WDC_PciReadCfgBySlot16 (_In_ WD_PCI_SLOT *pPciSlot, _In_ DWORD dwOffset, _Outptr_ WORD *pwVal)
 Reads 2 bytes (16 bits) from a specified offset in a PCI device's configuration space or a PCI Express device's extended configuration space.
 
DWORD DLLCALLCONV WDC_PciReadCfgBySlot32 (_In_ WD_PCI_SLOT *pPciSlot, _In_ DWORD dwOffset, _Outptr_ UINT32 *pdwVal)
 Reads 4 bytes (32 bits) from a specified offset in a PCI device's configuration space or a PCI Express device's extended configuration space.
 
DWORD DLLCALLCONV WDC_PciReadCfgBySlot64 (_In_ WD_PCI_SLOT *pPciSlot, _In_ DWORD dwOffset, _Outptr_ UINT64 *pqwVal)
 Reads 8 bytes (64 bits) from a specified offset in a PCI device's configuration space or a PCI Express device's extended configuration space.
 
DWORD DLLCALLCONV WDC_PciWriteCfgBySlot8 (_In_ WD_PCI_SLOT *pPciSlot, _In_ DWORD dwOffset, _In_ BYTE bVal)
 writes 1 byte (8 bits) to a specified offset in a PCI device's configuration space or a PCI Express device's extended configuration space.
 
DWORD DLLCALLCONV WDC_PciWriteCfgBySlot16 (_In_ WD_PCI_SLOT *pPciSlot, _In_ DWORD dwOffset, _In_ WORD wVal)
 writes 2 bytes (16 bits) to a specified offset in a PCI device's configuration space or a PCI Express device's extended configuration space.
 
DWORD DLLCALLCONV WDC_PciWriteCfgBySlot32 (_In_ WD_PCI_SLOT *pPciSlot, _In_ DWORD dwOffset, _In_ UINT32 dwVal)
 writes 4 bytes (32 bits) to a specified offset in a PCI device's configuration space or a PCI Express device's extended configuration space.
 
DWORD DLLCALLCONV WDC_PciWriteCfgBySlot64 (_In_ WD_PCI_SLOT *pPciSlot, _In_ DWORD dwOffset, _In_ UINT64 qwVal)
 writes 8 bytes (64 bits) to a specified offset in a PCI device's configuration space or a PCI Express device's extended configuration space.
 
DWORD DLLCALLCONV WDC_PciReadCfg8 (_In_ WDC_DEVICE_HANDLE hDev, _In_ DWORD dwOffset, _Outptr_ BYTE *pbVal)
 Read/write 8/16/32/64 bits from the PCI configuration space.
 
DWORD DLLCALLCONV WDC_PciReadCfg16 (_In_ WDC_DEVICE_HANDLE hDev, _In_ DWORD dwOffset, _Outptr_ WORD *pwVal)
 Reads 2 bytes (16 bits) from a specified offset in a PCI device's configuration space or a PCI Express device's extended configuration space.
 
DWORD DLLCALLCONV WDC_PciReadCfg32 (_In_ WDC_DEVICE_HANDLE hDev, _In_ DWORD dwOffset, _Outptr_ UINT32 *pdwVal)
 Reads 4 bytes (32 bits) from a specified offset in a PCI device's configuration space or a PCI Express device's extended configuration space.
 
DWORD DLLCALLCONV WDC_PciReadCfg64 (_In_ WDC_DEVICE_HANDLE hDev, _In_ DWORD dwOffset, _Outptr_ UINT64 *pqwVal)
 Reads 8 bytes (64 bits) from a specified offset in a PCI device's configuration space or a PCI Express device's extended configuration space.
 
DWORD DLLCALLCONV WDC_PciWriteCfg8 (_In_ WDC_DEVICE_HANDLE hDev, _In_ DWORD dwOffset, _In_ BYTE bVal)
 Writes 1 byte (8 bits) to a specified offset in a PCI device's configuration space or a PCI Express device's extended configuration space.
 
DWORD DLLCALLCONV WDC_PciWriteCfg16 (_In_ WDC_DEVICE_HANDLE hDev, _In_ DWORD dwOffset, _In_ WORD wVal)
 Writes 2 bytes (16 bits) to a specified offset in a PCI device's configuration space or a PCI Express device's extended configuration space.
 
DWORD DLLCALLCONV WDC_PciWriteCfg32 (_In_ WDC_DEVICE_HANDLE hDev, _In_ DWORD dwOffset, _In_ UINT32 dwVal)
 Writes 4 bytes (32 bits) to a specified offset in a PCI device's configuration space or a PCI Express device's extended configuration space.
 
DWORD DLLCALLCONV WDC_PciWriteCfg64 (_In_ WDC_DEVICE_HANDLE hDev, _In_ DWORD dwOffset, _In_ UINT64 qwVal)
 Writes 8 bytes (64 bits) to a specified offset in a PCI device's configuration space or a PCI Express device's extended configuration space.
 
DWORD DLLCALLCONV WDC_DMAContigBufLock (_In_ WDC_DEVICE_HANDLE hDev, _Outptr_ PVOID *ppBuf, _In_ DWORD dwOptions, _In_ DWORD dwDMABufSize, _Outptr_ WD_DMA **ppDma)
 Allocates a contiguous DMA buffer, locks it in physical memory, and returns mappings of the allocated buffer to physical address space and to user-mode and kernel virtual address spaces.
 
DWORD DLLCALLCONV WDC_DMASGBufLock (_In_ WDC_DEVICE_HANDLE hDev, _In_ PVOID pBuf, _In_ DWORD dwOptions, _In_ DWORD dwDMABufSize, _Outptr_ WD_DMA **ppDma)
 Locks a pre-allocated user-mode memory buffer for DMA and returns the corresponding physical mappings of the locked DMA pages.
 
DWORD DLLCALLCONV WDC_DMATransactionContigInit (_In_ WDC_DEVICE_HANDLE hDev, _Outptr_ PVOID *ppBuf, _In_ DWORD dwOptions, _In_ DWORD dwDMABufSize, _Outptr_ WD_DMA **ppDma, _In_ WDC_INTERRUPT_PARAMS *pInterruptParams, _In_ DWORD dwAlignment)
 Initializes the transaction, allocates a contiguous DMA buffer, locks it in physical memory, and returns mappings of the allocated buffer to physical address space and to user-mode and kernel virtual address spaces.
 
DWORD DLLCALLCONV WDC_DMATransactionSGInit (_In_ WDC_DEVICE_HANDLE hDev, _In_ PVOID pBuf, _In_ DWORD dwOptions, _In_ DWORD dwDMABufSize, _Outptr_ WD_DMA **ppDma, _In_ WDC_INTERRUPT_PARAMS *pInterruptParams, _In_ DWORD dwMaxTransferSize, _In_ DWORD dwTransferElementSize)
 Initializes the transaction and locks a pre-allocated user-mode memory buffer for DMA.
 
DWORD DLLCALLCONV WDC_DMATransactionExecute (_Inout_ WD_DMA *pDma, _In_ DMA_TRANSACTION_CALLBACK funcDMATransactionCallback, _In_ PVOID DMATransactionCallbackCtx)
 Begins the execution of a specified DMA transaction.
 
DWORD DLLCALLCONV WDC_DMATransferCompletedAndCheck (_Inout_ WD_DMA *pDma, _In_ BOOL fRunCallback)
 Notifies WinDriver that a device's DMA transfer operation is completed.
 
DWORD DLLCALLCONV WDC_DMATransactionRelease (_In_ WD_DMA *pDma)
 Terminates a specified DMA transaction without deleting the associated WD_DMA transaction structure.
 
DWORD DLLCALLCONV WDC_DMATransactionUninit (_In_ WD_DMA *pDma)
 Unlocks and frees the memory allocated for a DMA buffer transaction by a previous call to WDC_DMATransactionContigInit() or WDC_DMATransactionSGInit()
 
DWORD DLLCALLCONV WDC_DMAReservedBufLock (_In_ WDC_DEVICE_HANDLE hDev, _In_ PHYS_ADDR qwAddr, _Outptr_ PVOID *ppBuf, _In_ DWORD dwOptions, _In_ DWORD dwDMABufSize, _Outptr_ WD_DMA **ppDma)
 Locks a physical reserved memory buffer for DMA and returns the corresponding user mode address of locked DMA buffer.
 
DWORD DLLCALLCONV WDC_DMABufUnlock (_In_ WD_DMA *pDma)
 Unlocks and frees the memory allocated for a DMA buffer by a previous call to WDC_DMAContigBufLock(), WDC_DMASGBufLock() or WDC_DMAReservedBufLock()
 
DWORD DLLCALLCONV WDC_DMABufGet (_In_ DWORD hDma, _Outptr_ WD_DMA **ppDma)
 Retrieves a contiguous DMA buffer which was allocated by another process.
 
DWORD DLLCALLCONV WDC_DMASyncCpu (_In_ WD_DMA *pDma)
 Synchronizes the cache of all CPUs with the DMA buffer, by flushing the data from the CPU caches.
 
DWORD DLLCALLCONV WDC_DMASyncIo (_In_ WD_DMA *pDma)
 Synchronizes the I/O caches with the DMA buffer, by flushing the data from the I/O caches and updating the CPU caches.
 
DWORD DLLCALLCONV WDC_IntEnable (_In_ WDC_DEVICE_HANDLE hDev, _In_ WD_TRANSFER *pTransCmds, _In_ DWORD dwNumCmds, _In_ DWORD dwOptions, _In_ INT_HANDLER funcIntHandler, _In_ PVOID pData, _In_ BOOL fUseKP)
 Enables interrupt handling for the device.
 
DWORD DLLCALLCONV WDC_IntDisable (_In_ WDC_DEVICE_HANDLE hDev)
 Disables interrupt interrupt handling for the device, pursuant to a previous call to WDC_IntEnable()
 
BOOL DLLCALLCONV WDC_IntIsEnabled (_In_ WDC_DEVICE_HANDLE hDev)
 Checks if a device's interrupts are currently enabled.
 
const CHAR *DLLCALLCONV WDC_IntType2Str (_In_ DWORD dwIntType)
 Converts interrupt type to string.
 
DWORD DLLCALLCONV WDC_EventRegister (_In_ WDC_DEVICE_HANDLE hDev, _In_ DWORD dwActions, _In_ EVENT_HANDLER funcEventHandler, _In_ PVOID pData, _In_ BOOL fUseKP)
 Registers the application to receive Plug-and-Play and power management events notifications for the device.
 
DWORD DLLCALLCONV WDC_EventUnregister (_In_ WDC_DEVICE_HANDLE hDev)
 Unregisters an application from a receiving Plug-and-Play and power management notifications for a device, pursuant to a previous call to WDC_EventRegister()
 
BOOL DLLCALLCONV WDC_EventIsRegistered (_In_ WDC_DEVICE_HANDLE hDev)
 Checks if the application is currently registered to receive Plug-and-Play and power management notifications for the device.
 
DWORD DLLCALLCONV WDC_SetDebugOptions (_In_ WDC_DBG_OPTIONS dbgOptions, _In_ const CHAR *pcDbgFile)
 Sets debug options for the WDC library - see the description of WDC_DBG_OPTIONS for details regarding the possible debug options to set.
 
void DLLCALLCONV WDC_Err (const CHAR *format,...)
 Displays debug error messages according to the WDC debug options.
 
void DLLCALLCONV WDC_Trace (const CHAR *format,...)
 Displays debug trace messages according to the WDC debug options.