Hi all,
I am hoping someone can help me.
I am trying to port a NT4 driver for a PCI device to a WDM driver but it
crashes in IoGetDmaAdapter. I stepped into this function but I am can’t
figure out what is going on. I can see it makes calls to
IoGetAttachedDeviceReference, IoCreateSynchronousFsdRequest and finally call
IoCallDriver. All seems to be well. However, a few lines further down is
zeroes out some memory and subsequently I see this line call [EBP-34] but
the memory at [EBP-34] was just zeroes out !!!
I am calling this function from inside my StartDevice function. No Dma
resources where handed over to me in the resource list which also makes me
wonder. In which cases does the resource list contain DMA resources ?
Does someone have a hint as to where I should look to solve this problem ?
Thanks,
Jos
Hi,
I found the problem, if we pass NULL as the first argument everything
works fine. This is strange as the documentation doesn’t mention this I
think. Can anyone explain to me why do I have to pass NULL ?
Thanks all,
Jos Scherders
wrote in message news:xxxxx@ntdev…
>
> I found the problem, if we pass NULL as the first argument everything
> works fine. This is strange as the documentation doesn’t mention this I
> think. Can anyone explain to me why do I have to pass NULL ?
>
Well, the answer is that while it might make IoGetDmaAdapter work for you,
you’re working around another problem. In fact you should NOT pass NULL for
this argument.
You mentioned in the original post that you were not getting DMA
resources – Do you mean you’re not getting pointers to your BARs to program
your device?
The issue here sounds to me like your PnP resources are not being properly
set up…
Peter
OSR
Well, I suspect something is wrong too because passing NULL is not
documented… Wonder why it doesn’t scream though :))
I am not getting a CmResourceTypeDma but my device is a bus master so this
is Ok I thought. I initialize the DEVICE_DESCRIPTION myself following an
example in Walter Oney’s book. If I pass in my PDO I get a crash, if I
pass NULL it works. I think that in the latter case IoGetDmaAdapter just
calls the Hall directly which is why it works. In the failing case it ends
up deferencing a NULL pointer.
Perhaps I should doublecheck what I am passing, I am starting to suspect I
am passing in something horrible wrong.
Thanks for your reply.
Jos.
You must pass a PnP PDO there. Passing other device object will cause a crash.
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com
----- Original Message -----
From:
To: “Windows System Software Devs Interest List”
Sent: Thursday, September 25, 2003 1:13 PM
Subject: [ntdev] Re: IoGetDmaAdapter crashes
> Hi,
>
> I found the problem, if we pass NULL as the first argument everything
> works fine. This is strange as the documentation doesn’t mention this I
> think. Can anyone explain to me why do I have to pass NULL ?
>
> Thanks all,
> Jos Scherders
>
> —
> Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com