BSOD to list files in DbgPrint();

Hello,

I have this code: http://pastebin.com/P29b3AKe

and i got BSOD pointing to line 79.

Apparently seems all okay.

Some suggestion?

Thank you.

You are assuming the FileName is NULL terminated which it may not be.
This could be causing your problem towards the edge of your buffer. Form
a UNICODE_STRING and print it that way.

Pete


Kernel Drivers
Windows File System and Device Driver Consulting
www.KernelDrivers.com
866.263.9295

------ Original Message ------
From: xxxxx@hotmail.com
To: “Windows File Systems Devs Interest List”
Sent: 1/24/2017 5:54:58 AM
Subject: [ntfsd] BSOD to list files in DbgPrint();

>Hello,
>
>I have this code: http://pastebin.com/P29b3AKe
>
>and i got BSOD pointing to line 79.
>
>Apparently seems all okay.
>
>Some suggestion?
>
>Thank you.
>
>—
>NTFSD is sponsored by OSR
>
>
>MONTHLY seminars on crash dump analysis, WDF, Windows internals and
>software drivers!
>Details at http:
>
>To unsubscribe, visit the List Server section of OSR Online at
>http:</http:></http:>

@Petter, thank you.

could give me a code example, please?

On Tue, 24 Jan 2017, xxxxx@hotmail.com wrote:

I have this code: http://pastebin.com/P29b3AKe

and i got BSOD pointing to line 79.

The error is on line 71, you should use Ptr there.

(but you should fix the problem with null termination also)

Bo Branten