!dma extension not working

Hi,
while debugging a driver on a win XP SP 3 kernel (with windbg
6.11.0001.404), I noticed that invoking !dma extension I always get an
error:

Error reading dma adapter list head: 0x807133d0

Does anybody know what is going on?

Bye
Alex

If you turn on symbol and read failure output do you see anything
interesting when the command fails?

.show_sym_failures /s /t
.show_read_failures /v

-scott


Scott Noone
Consulting Associate and Chief System Problem Analyst
OSR Open Systems Resources, Inc.
http://www.osronline.com

“alex” wrote in message news:xxxxx@windbg…

Hi,
while debugging a driver on a win XP SP 3 kernel (with windbg
6.11.0001.404), I noticed that invoking !dma extension I always get an
error:

Error reading dma adapter list head: 0x807133d0

Does anybody know what is going on?

Bye
Alex

iirc there is no typeinfo in pdb for nt!_ADAPTER_INFORMATION
also before reaching there iirc there is an underscore problem not
sure i think i mailed windbgfb about it but no feedback

kdexts:\>fc kdexts.dll kdextsORIG.dll
Comparing files kdexts.dll and KDEXTSORIG.DLL
***** kdexts.dll

_LIST_ENTRY
Failed to get Flink from hal!HalpAcpiTableCacheList
***** KDEXTSORIG.DLL

LIST_ENTRY

Failed to get Flink from hal!HalpAcpiTableCacheList
*****

kdexts:\>

if you patch the string in kdexts.dll you may get adapter address but
no adapter information

kd> !dma 806f6b80 20

Error retrieving verifier adapter information list offset.

Adapter: 806f6b80
MasterAdapter: 00000000
Adapter base Va 00000000
Map register base: 00000000
WCB: 8118da18
Map registers: 00000000 mapped, 00000000 allocated, 00000000 max
Wait context block: 0x8118da18 (may be free)
DeviceRoutine : 0xffffffff _IO_ALLOCATION_ACTION
+ffffffffffffffff
NumberOfMapRegisters : 0x22
kd> !dma

Dumping all DMA adapters…

Error retrieving verifier adapter information list offset.

Adapter: 812963e0

Error retrieving verifier adapter information list offset.

Adapter: 8123a318

Error retrieving verifier adapter information list offset.

Adapter: 8116b2f0
Master adapter: 806f6b80

also verifier dma verification should be active

On 3/13/12, Scott Noone wrote:
> If you turn on symbol and read failure output do you see anything
> interesting when the command fails?
>
> .show_sym_failures /s /t
> .show_read_failures /v
>
> -scott
>
> –
> Scott Noone
> Consulting Associate and Chief System Problem Analyst
> OSR Open Systems Resources, Inc.
> http://www.osronline.com
>
>
> “alex” wrote in message news:xxxxx@windbg…
>
> Hi,
> while debugging a driver on a win XP SP 3 kernel (with windbg
> 6.11.0001.404), I noticed that invoking !dma extension I always get an
> error:
>
> Error reading dma adapter list head: 0x807133d0
>
> Does anybody know what is going on?
>
> Bye
> Alex
>
>
> —
> WINDBG is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>

On 03/12/2012 20.32, Scott Noone wrote:

If you turn on symbol and read failure output do you see anything
interesting when the command fails?

.show_sym_failures /s /t
.show_read_failures /v
Yes:

0: kd> !dma
vuread bf800000 failed
vread bf800000 failed
vuread bf000000 failed
vread bf000000 failed
vuread bf012000 failed
vread bf012000 failed
vuread bf061000 failed
vread bf061000 failed
vuread bf139000 failed
vread bf139000 failed
vuread bf20f000 failed
vread bf20f000 failed
vuread bf2a7000 failed
vread bf2a7000 failed
vuread bf9c7000 failed
vread bf9c7000 failed
vuread bfcef000 failed
vread bfcef000 failed
type lookup ‘hal!_HALP_DMA_ADAPTER_OBJECT’ failure.
type lookup ‘LIST_ENTRY’ failure.

Error reading dma adapter list head: 0x806f93d0

As raj said, _LIST_ENTRY exists, but LIST_ENTRY does not.

Bye
Alex

HALP_DMA_ADAPTER_OBJECT’ type failure doesnt make any difference in xp
if i remember correctly and just patching the string LIST_ENTRY to
_LIST_ENTRY (yes it is dword aligned so there is space to patch it
inline

because the path that accesses the HALP_DMA_ADAPTER_OBJECT is in an if clause
like
if (halp#…) use shiny Struct else use Dull Struct

would get the dma results in xp and you can do a
hal!_ADAPTER_OBJECT on the results

or if you dont want to patch you can do

dt nt!_LIST_ENTRY 0x806f93d0
or dl 0x806f93d0
or probably !walklist 0x806f93d0
and go on from there

On 3/13/12, alex wrote:
> On 03/12/2012 20.32, Scott Noone wrote:
>> If you turn on symbol and read failure output do you see anything
>> interesting when the command fails?
>>
>> .show_sym_failures /s /t
>> .show_read_failures /v
> Yes:
>
> 0: kd> !dma
> vuread bf800000 failed
> vread bf800000 failed
> vuread bf000000 failed
> vread bf000000 failed
> vuread bf012000 failed
> vread bf012000 failed
> vuread bf061000 failed
> vread bf061000 failed
> vuread bf139000 failed
> vread bf139000 failed
> vuread bf20f000 failed
> vread bf20f000 failed
> vuread bf2a7000 failed
> vread bf2a7000 failed
> vuread bf9c7000 failed
> vread bf9c7000 failed
> vuread bfcef000 failed
> vread bfcef000 failed
> type lookup ‘hal!_HALP_DMA_ADAPTER_OBJECT’ failure.
> type lookup ‘LIST_ENTRY’ failure.
>
> Error reading dma adapter list head: 0x806f93d0
>
> As raj said, _LIST_ENTRY exists, but LIST_ENTRY does not.
>
> Bye
> Alex
>
> —
> WINDBG is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>

“alex” wrote in message news:xxxxx@windbg…

As raj said, _LIST_ENTRY exists, but LIST_ENTRY does not.

What a pain. If you really need it, it’s possible to add missing types to a
PDB. See my instructions here:

http://www.osronline.com/showthread.cfm?link=193747

-scott


Scott Noone
Consulting Associate and Chief System Problem Analyst
OSR Open Systems Resources, Inc.
http://www.osronline.com

no scott it is not a problem of symbol info i think it is a problem of
underscore and i think it needs a hard patch in kdexts.dll

here is a latest windbg patch

lkd> !dma

Error reading dma adapter list head: 0x806e3250

lkd> .unload kdexts.dll
Unloading kdexts.dll extension DLL
lkd> .shell
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Program Files\Windows Kits\8.0\Debuggers\x86><.shell waiting 1
second(s) for process>
<.shell process may need input> fc winxp\kdexts.dll winxp\kdextsmod.dll

Comparing files WINXP\kdexts.dll and WINXP\KDEXTSMOD.DLL
***** WINXP\kdexts.dll

LIST_ENTRY

Failed to get Flink from hal!HalpAcpiTableCacheList

***** WINXP\KDEXTSMOD.DLL

_LIST_ENTRY
Failed to get Flink from hal!HalpAcpiTableCacheList
*****

C:\Program Files\Windows Kits\8.0\Debuggers\x86><.shell waiting 1
second(s) for process>
<.shell process may need input>

ren winxp\kdexts.dll kdextsorig.dll

C:\Program Files\Windows Kits\8.0\Debuggers\x86><.shell waiting 1
second(s) for process>
<.shell process may need input>

ren winxp\kdextsmod.dll kdexts.dll

C:\Program Files\Windows Kits\8.0\Debuggers\x86><.shell waiting 1
second(s) for process>
<.shell process may need input>exit
exit
.shell: Process exited

Press ENTER to continue
<.shell waiting 1 second(s) for process>
<.shell process may need input>

lkd> .load kdexts.dll

lkd> !dma

Dumping all DMA adapters…

Adapter: 86d84e78
Adapter: 86d43c60
Adapter: 86d2b800
Adapter: 86cbd9c0
Adapter: 86d59478
Adapter: 86d366b0
Adapter: 86cc90d0
Adapter: 86cbaab8
Adapter: 86cc5788
Adapter: 86d32f98
Master adapter: 806e3120

lkd> dt *!*dma*
halaacpi!_DMA_ADAPTER
halaacpi!_DMA_OPERATIONS
lkd> dt hal!_DMA_ADAPTER 86d84e78
+0x000 Version : 1
+0x002 Size : 0x64
+0x004 DmaOperations : 0x806d06b8 _DMA_OPERATIONS
lkd> dt -r hal!_DMA_ADAPTER 86d84e78
+0x000 Version : 1
+0x002 Size : 0x64
+0x004 DmaOperations : 0x806d06b8 _DMA_OPERATIONS
+0x000 Size : 0x40
+0x004 PutDmaAdapter : 0x806d461e void hal!HalPutDmaAdapter+0
+0x008 AllocateCommonBuffer : 0x806d4176 void*
hal!HalAllocateCommonBuffer+0
+0x00c FreeCommonBuffer : 0x806d41e4 void
hal!HalFreeCommonBuffer+0
+0x010 AllocateAdapterChannel : 0x806d87f8 long
hal!IoAllocateAdapterChannel+0
+0x014 FlushAdapterBuffers : 0x806d5458 unsigned char
hal!IoFlushAdapterBuffers+0
+0x018 FreeAdapterChannel : 0x806d43d0 void
hal!IoFreeAdapterChannel+0
+0x01c FreeMapRegisters : 0x806d44ce void hal!IoFreeMapRegisters+0
+0x020 MapTransfer : 0x806d53ea _LARGE_INTEGER
hal!IoMapTransfer+0
+0x024 GetDmaAlignment : 0x806d656c unsigned long
hal!HalGetDmaAlignment+0
+0x028 ReadDmaCounter : 0x806d51a2 unsigned long
hal!HalReadDmaCounter+0
+0x02c GetScatterGatherList : 0x806d4b52 long
hal!HalGetScatterGatherList+0
+0x030 PutScatterGatherList : 0x806d4a56 void
hal!HalPutScatterGatherList+0
+0x034 CalculateScatterGatherList : 0x806d41fc long
hal!HalCalculateScatterGatherListSize+0
+0x038 BuildScatterGatherList : 0x806d47f6 long
hal!HalBuildScatterGatherList+0
+0x03c BuildMdlFromScatterGatherList : 0x806d4696 long
hal!HalBuildMdlFromScatterGatherList+0

lkd> dl 0x806e3250
806e3250 86d84ed4 86d32ff4 00000000 00000000
86d84ed4 86d43cbc 806e3250 00000000 0a240011
86d43cbc 86d2b85c 86d84ed4 00000000 0a030011
86d2b85c 86cbda1c 86d43cbc 00000000 00010011
86cbda1c 86d594d4 86d2b85c 00000000 0a130011
86d594d4 86d3670c 86cbda1c 00000000 0a420011
86d3670c 86cc912c 86d594d4 00000000 00010011
86cc912c 86cbab14 86d3670c 00000000 00210011
86cbab14 86cc57e4 86cc912c 00000000 00020011
86cc57e4 86d32ff4 86cbab14 00000000 00010011
86d32ff4 806e3250 86cc57e4 00000000 0a230000

lkd> ? 86d84e78+5c
Evaluate expression: -2032644396 = 86d84ed4

On 3/14/12, Scott Noone wrote:
> “alex” wrote in message news:xxxxx@windbg…
>>As raj said, _LIST_ENTRY exists, but LIST_ENTRY does not.
>
> What a pain. If you really need it, it’s possible to add missing types to a
> PDB. See my instructions here:
>
> http://www.osronline.com/showthread.cfm?link=193747
>
> -scott
>
> –
> Scott Noone
> Consulting Associate and Chief System Problem Analyst
> OSR Open Systems Resources, Inc.
> http://www.osronline.com
>
>
>
> —
> WINDBG is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>

Scott,

That is one awesome hack. Why did I miss it last time around?

http://www.osronline.com/showthread.cfm?link=193747

> no scott it is not a problem of symbol info i think it is a problem of

underscore and i think it needs a hard patch in kdexts.dll

I think you might be the fact that MS strips the symbols which do not begin
with “_” from most structures before publishing.

Consider the MS symbols for a driver which declares LIST_ENTRY

kd> dt nt!*LIST_ENTRY
ntkrpamp!_LIST_ENTRY
ntkrpamp!_LIST_ENTRY
ntkrpamp!_SINGLE_LIST_ENTRY
ntkrpamp!_PENDING_RELATIONS_LIST_ENTRY
ntkrpamp!_HIVE_LIST_ENTRY
ntkrpamp!_ARBITER_LIST_ENTRY
ntkrpamp!_RELATION_LIST_ENTRY
ntkrpamp!_RTLP_RANGE_LIST_ENTRY

And the symbols for my own driver:

kd> dt mydrv!*LIST_ENTRY
mydrv!SINGLE_LIST_ENTRY
mydrv!LIST_ENTRY
mydrv!PLIST_ENTRY
mydrv!PSINGLE_LIST_ENTRY
mydrv!_LIST_ENTRY
mydrv!_SINGLE_LIST_ENTRY
mydrv!_LIST_ENTRY

The MS Devs develop against internal symbols and so forget to use the “_”
version. This is why many of these helper tools rot outside Redmond.

So AFAICS you are right & wrong. Yes it is a problem with the underscore,
but growing symbols to look like what the MSDEVS use is a suitable fix.