Redigera

Dela via


!ndiskd.ndisrwlock

The !ndiskd.ndisrwlock extension displays information about an NDIS_RW_LOCK_EX lock structure.

!ndiskd.ndisrwlock -handle <x>

Parameters

-handle
Required. Handle of the lock structure.

DLL

Ndiskd.dll

Examples

Use the !ndiskd.ndisrwlock extension if you create your own RW lock and would want to inspect it. To obtain the handle for an RW lock, use the poi command to dereference the address of your driver's lock. The following snippet shows how to look at a lock that the TCIPIP protocol was using at the time of the example.

0: kd> !ndiskd.ndisrwlock poi(tcpip!gAleHashtableLock)


NDIS READ-WRITE LOCK

    Allocated by       [NDIS generic object]
    Exclusive access   Not acquired
    Read-only access   0 references

    Set a breakpoint on acquire/release

To observe the driver using this RW lock, click on the "Set a breakpoint on acquire/release" link at the bottom of the RW lock's details. After setting the breakpoint, enter the g command to let the debugee machine run and hit the breakpoint.

0: kd> ba r4 ffffe00bc3fc22f8
0: kd> g
Breakpoint 0 hit
nt!KeTestSpinLock+0x3:
fffff802`0d69eb53 4885c0          test    rax,rax

Now you can re-run the same !ndiskd.ndisrwlock command to see that this RW lock has one Read-only access reference.

0: kd> !ndiskd.ndisrwlock poi(tcpip!gAleHashtableLock)


NDIS READ-WRITE LOCK

    Allocated by       [NDIS generic object]
    Exclusive access   Not acquired
    Read-only access   1 reference

    Set a breakpoint on acquire/release

See also

Network Driver Design Guide

Windows Vista and Later Networking Reference

Debugging the Network Stack

NDIS extensions (Ndiskd.dll)

!ndiskd.help

NDIS_RW_LOCK_EX