Windows System Software -- Consulting, Training, Development -- Unique Expertise, Guaranteed Results

Before Posting...
Please check out the Community Guidelines in the Announcements and Administration Category.

More Info on Driver Writing and Debugging


The free OSR Learning Library has more than 50 articles on a wide variety of topics about writing and debugging device drivers and Minifilters. From introductory level to advanced. All the articles have been recently reviewed and updated, and are written using the clear and definitive style you've come to expect from OSR over the years.


Check out The OSR Learning Library at: https://www.osr.com/osr-learning-library/


obtrace and DEVICE_OBJECT

Aleh_KazakevichAleh_Kazakevich Member Posts: 74
Hi!

Is it possible to use the 'Object Reference Tracing' (!obtrace) for a DEVICE_OBJECT?
I tried several times with different 'gflags' settings, but with no success.

When I set a process name filter (gflags /i) the tracing is working for Key,
File and some other object types, but not for DEVICE_OBJECT:

kd> !obtrace address
Unable to find object in table.

The address of a device object is 100% valid (this can be verified,
for example, by the '!devobj' and '!devstack' commands).

It seems that a 'gflags /i' filter does not apply for the objects created
in the system process context, like a driver objects or a device objects.

When I set a tag names (gflags /t + Dflt, tlfD or any other custom tag)
the tracing does not working at all and I see the message again: "Unable to
find object in table".

Some additional information:

- Windows 7, Windows 8.1 (both x64);

- gflags settings (!gflag):

Current NtGlobalFlag contents: 0x01007400
ptg - Enable pool tagging
ust - Create user mode stack trace database
kst - Create kernel mode stack trace database
otl - Maintain a list of objects for each type
eot - Enable object handle type tagging

- "C:\Program Files\Windows Kits\8.1\Debuggers\x64\gflags.exe" /ro

Boot Registry Settings :
Object Ref Tracing Enabled
Permanent Traces
Pool Tags: Dflt;tlfD;ABCD;DCBA
Process Name: All Processes
(and system was rebooted).

----

Thanks.

Comments

  • Scott_Noone_(OSR)Scott_Noone_(OSR) Administrator Posts: 3,341
    I just ran a quick test on Win7 x86 Checked and it worked fine. I don't
    *think* it's a checked build only thing, but I don't have a Win7 Free
    already installed to play with at the moment.

    Steps were:

    1. Copy gflags.exe and gflagsui.dll to the target machine

    2. Under Object Reference Tracing tick the Enable box

    3. In Pool Tags put: Devi

    4. Click OK, reboot

    kd> !obtrace 8d359830
    Object: 8d359830
    Image: System
    Sequence (+/-) Tag Stack
    -------- ----- ---- ---------------------------------------------------
    41d7 +1 Dflt nt!ObCreateObject+1ab
    nt!IoCreateDevice+17f
    ksecdd!DriverEntry+df
    nt!IopInitializeBuiltinDriver+34c
    nt!PnpInitializeBootStartDriver+a1
    nt!IopInitializeBootDrivers+377
    nt!IoInitSystem+593
    nt!Phase1InitializationDiscard+d67
    nt!Phase1Initialization+d
    nt!PspSystemThreadStartup+178

    -scott
    OSR
    @OSRDrivers

    -scott
    OSR

  • Aleh_KazakevichAleh_Kazakevich Member Posts: 74
    Excellent! It's working!
    :)

    My mistake was that I specified invalid tag value ('Dflt', for example).
    Thanks, Scott.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Upcoming OSR Seminars
OSR has suspended in-person seminars due to the Covid-19 outbreak. But, don't miss your training! Attend via the internet instead!
Internals & Software Drivers 30 Nov 2020 LIVE ONLINE
Writing WDF Drivers 7 Dec 2020 LIVE ONLINE
Developing Minifilters Early 2021 LIVE ONLINE