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

Sept/Oct 2019 Issue of The NT Insider available


Download PDF here: http://insider.osr.com/2019/ntinsider_2019_01.pdf

It’s a particularly BIG issue, too: 40 pages of technical goodness, ranging from WDF to Minifilters. Check it out.
Before Posting...
Please check out the Community Guidelines in the Announcements and Administration Category.

BSOD 0xC4_f6 in WIN7

Alex_C3Alex_C3 Member Posts: 11

Hi, All.

I wrote a function to convert the drive letter in a file minifilter. In this function, I use the ZwQuerySymbolicLinkObject function to get the hard disk's drive letter.
But the function ZwQuerySymbolicLinkObject caused BSOD and the error code 0xC4_f6 means "A driver references a user-mode handle as kernel mode."
I can't fig out what caused this bug. Hope you guys can give some advice.
Any word will be appreciated.

Here is my function code:
NTSTATUS QuerySymbolicLink( IN PUNICODE_STRING SymbolicLinkName, OUT PUNICODE_STRING LinkTarget ) { OBJECT_ATTRIBUTES objAttr = { 0 }; NTSTATUS status; HANDLE handle = NULL; InitializeObjectAttributes(&objAttr, SymbolicLinkName, OBJ_CASE_INSENSITIVE, 0, 0); status = ZwOpenSymbolicLinkObject(&handle, GENERIC_READ, &objAttr); if (!NT_SUCCESS(status)) { DbgPrint("open the symbolinkobj failed ..\n"); ZwClose(handle); return status; } if (!LinkTarget->Buffer) { ZwClose(handle); return STATUS_INSUFFICIENT_RESOURCES; } RtlZeroMemory(LinkTarget->Buffer, LinkTarget->MaximumLength); status = ZwQuerySymbolicLinkObject(handle, LinkTarget, NULL); ZwClose(handle); if (!NT_SUCCESS(status)) { DbgPrint(" query the symbolinkObject failed ...\n"); } return status; }

Comments

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
Writing WDF Drivers 21 Oct 2019 OSR Seminar Space & ONLINE
Internals & Software Drivers 18 Nov 2019 Dulles, VA
Kernel Debugging 30 Mar 2020 OSR Seminar Space
Developing Minifilters 27 Apr 2020 OSR Seminar Space & ONLINE