Why IoGetDmaAdapter call could fail under Windows XP 64 Bits?

Here is a code sample of what I am trying to do inside a driver that
will control a DMA device. The exact same code works perfectly under
any 32 bit Windows OS (2000, XP, 2003). Why does it fail when I run
this under Windows XP 64 bit. Since there is no return code on the
call, it is hard to figure what could be wrong.

I have tried to change many of the parameters without any success.

m_ulNumberOfMapRegs = 0;

DEVICE_DESCRIPTION oDevDesc;
RtlZeroMemory(&oDevDesc, sizeof(DEVICE_DESCRIPTION)); //Fill the
struct with zeros

//Now fill in the stuct with valid information
oDevDesc.Version = DEVICE_DESCRIPTION_VERSION;
oDevDesc.Master = TRUE;
oDevDesc.ScatterGather = TRUE;
oDevDesc.DemandMode = FALSE;
oDevDesc.AutoInitialize = FALSE;
oDevDesc.Dma32BitAddresses = FALSE;
oDevDesc.IgnoreCount = FALSE;
oDevDesc.Dma64BitAddresses = TRUE;
oDevDesc.DmaChannel = 0;
oDevDesc.InterfaceType = PCIBus;
oDevDesc.DmaWidth = Width32Bits;
oDevDesc.DmaSpeed = Compatible;
oDevDesc.MaximumLength = 8294400;

//Now get the pointer to the DMA Adapter
m_psDmaAdapter = IoGetDmaAdapter(poPhysicalDeviceObject,
&oDevDesc,
&m_ulNumberOfMapRegs);

Your parameters for your device descriptor appear to NOT be the source of
the problem, although you could set Dma32BitAddresses to TRUE.

Your hardware does actually support 64bit operations, right (either directly
or using DAC)?

Are you certain that you are passing the correct device object in
poPhysicalDeviceObject?

Try running verifier and see what pops up.

Try stepping into IoGetDmaAdapter (perhaps easier in the checked OS) and get
a clue to where the failure occurs that way.

=====================
Mark Roddy DDK MVP
Windows 2003/XP/2000 Consulting
Hollis Technology Solutions 603-321-1032
www.hollistech.com


From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Andre Laframboise
Sent: Friday, September 30, 2005 3:17 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Why IoGetDmaAdapter call could fail under Windows XP 64
Bits?

Here is a code sample of what I am trying to do inside a driver that will
control a DMA device. The exact same code works perfectly under any 32 bit
Windows OS (2000, XP, 2003). Why does it fail when I run this under Windows
XP 64 bit. Since there is no return code on the call, it is hard to figure
what could be wrong.

I have tried to change many of the parameters without any success.

m_ulNumberOfMapRegs = 0;

DEVICE_DESCRIPTION oDevDesc;
RtlZeroMemory(&oDevDesc, sizeof(DEVICE_DESCRIPTION)); //Fill the
struct with zeros

//Now fill in the stuct with valid information
oDevDesc.Version = DEVICE_DESCRIPTION_VERSION;
oDevDesc.Master = TRUE;
oDevDesc.ScatterGather = TRUE;
oDevDesc.DemandMode = FALSE;
oDevDesc.AutoInitialize = FALSE;
oDevDesc.Dma32BitAddresses = FALSE;
oDevDesc.IgnoreCount = FALSE;
oDevDesc.Dma64BitAddresses = TRUE;
oDevDesc.DmaChannel = 0;
oDevDesc.InterfaceType = PCIBus;
oDevDesc.DmaWidth = Width32Bits;
oDevDesc.DmaSpeed = Compatible;
oDevDesc.MaximumLength = 8294400;

//Now get the pointer to the DMA Adapter
m_psDmaAdapter = IoGetDmaAdapter(poPhysicalDeviceObject,
&oDevDesc,
&m_ulNumberOfMapRegs);


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com