First, locate the slot to which your card is connected, using WD_PciScanCards().
Then get the card's information by calling
WD_PciGetCardInfo(). Now call WD_CardRegister() to install the memory range and map it into both kernel and user mode virtual address spaces. You can then either access the memory directly from your user mode application (more efficient), by using the user mode mapping of the physical address — returned by WD_CardRegister() in cardReg.Card.Item[i].I.Mem.dwUserDirectAddr (where 'i' is the index number of the memory range in the Item array) — or pass the kernel mode mapping of the memory — returned by WD_CardRegister() in cardReg.Card.Item[i].I.Mem.dwTransAddr — to WD_Transfer() (/ WD_MultiTransfer()), in order to access the memory in the kernel.
This is demonstrated, for example, in the sample code found in the WinDriver\samples\pci_diag directory, and
in the diagnostics DriverWizard code that you can generate for your PCI
card. [NOTE: To access memory directly in the kernel, from within a Kernel PlugIn project, you must use the kernel mode mapping of the physical memory address — returned by WD_CardRegister() in cardReg.Card.Item[i].I.Mem.dwTransAddr — and not the user mode mapping that is used to access the memory directly from your user mode application.] |

