Executes multiple read/write instructions to I/O ports and/or memory addresses.
DWORD WD_MultiTransfer(
HANDLE hWD,
WD_TRANSFER *pTransferArray,
DWORD dwNumTransfers);
| Name | Type | Input/Output |
|---|---|---|
| hWD | HANDLE | Input |
| pTransferArray | WD_TRANSFER* | |
| • cmdTrans | DWORD | Input |
| • dwPort | KPTR | Input |
| • dwBytes | DWORD | Input |
| • fAutoinc | DWORD | Input |
| • dwOptions | DWORD | Input |
| • Data | union | |
| * Byte | BYTE | Input/Output |
| * Word | WORD | Input/Output |
| * Dword | UINT32 | Input/Output |
| * Qword | UINT64 | Input/Output |
| * pBuffer | PVOID | Input/Output |
| dwNumTransfers | DWORD | Input |
| Name | Description |
|---|---|
| hWD | Handle to WinDriver's kernel-mode driver as
received from WD_Open() |
| pTransferArray | Pointer to a beginning of an array of transfer information structures: |
| • cmdTrans |
A value indicating the type of transfer to perform — see definition
of the
In calls to |
| • dwPort |
The memory or I/O address to access.
For a memory transfer, use the kernel-mapping of the base address received
from
For an I/O transfer, use the base address received from
|
| • dwBytes | Used in string transfers — number of bytes to transfer |
| • fAutoinc |
Used for string transfers. If TRUE, I/O or memory address should be incremented for
transfer.If FALSE, all data is transferred to the same port/address.
|
| • dwOptions | Must be set to 0 |
| • Data | The transfer data — input for read transfers, output for write transfers: |
| * Byte | Used for 8-bit transfers |
| * Word | Used for 16-bit transfers |
| * Dword | Used for 32-bit transfers |
| * Qword | Used for 64-bit transfers |
| * pBuffer | Used for string (block) transfers |
| dwNumTransfers |
The number of transfers to perform (the pTransferArray
array should contain at least dwNumTransfers elements)
|
Returns WD_STATUS_SUCCESS (0) on success, or an appropriate
error code otherwise
WD_Transfer()WD_TRANSFER Trans[4]; DWORD dwResult; char *cData = "Message to send\n"; BZERO(Trans); Trans[0].cmdTrans = WP_WORD; /* Write Port WORD */ Trans[0].dwPort = 0x1e0; Trans[0].Data.Word = 0x1023; Trans[1].cmdTrans = WP_WORD; Trans[1].dwPort = 0x1e0; Trans[1].Data.Word = 0x1022; Trans[2].cmdTrans = WP_SBYTE; /* Write Port String BYTE */ Trans[2].dwPort = 0x1f0; Trans[2].dwBytes = strlen(cdata); Trans[2].fAutoinc = FALSE; Trans[2].dwOptions = 0; Trans[2].Data.pBuffer = cData; Trans[3].cmdTrans = RP_DWORD; /* Read Port Dword */ Trans[3].dwPort = 0x1e4; WD_MultiTransfer(hWD, &Trans, 4); dwResult = Trans[3].Data.Dword;