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

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; }


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
Kernel Debugging 30 Mar 2020 OSR Seminar Space
Writing WDF Drivers 13 April 2020 OSR Seminar Space & ONLINE
Developing Minifilters 20 Apr 2020 OSR Seminar Space & ONLINE
Internals & Software Drivers TBD Dulles, VA