If you want to ‘look’ at the data itself I suggest copying the first 10 or
20 bytes of pData into a separate buffer, NULL terminate the buffer and then
push it into the DbgPrint statement. At least you won’t be touching,
potentially, bytes beyond the end of the buffer which could be invalid.
Pete
Kernel Drivers
Windows Filesystem and Device Driver Consulting
www.KernelDrivers.com
(303)546-0300
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@hotmail.com
Sent: Wednesday, November 08, 2006 10:52 AM
To: Windows File Systems Devs Interest List
Subject: RE:[ntfsd] General Buffer and Offset Question
Yeah, it blue-screened nicely when I tried it. Good thing I’m using VMWare
and testing/debugging in a VM.
I’m guessin then, that in terms of what I’m interested in, this BytesOffset
value is meaningless?
Ok. Here’s the crux of my issue. I’m trying to “look” at the buffers.
Now, I have no idea whether or not this is something I should or should not
do. Apparently, I’m doing a lot of things I should never be doing.
Remember, I’ve not done any of the context stuff yet. I’m still trying to
get a handle on what is in the pipe durnig my reads and writes.
Here’s the code:
if ( (Irp->MdlAddress !=
NULL) )
{
pData =
MmGetSystemAddressForMdlSafe(Irp->MdlAddress, NormalPagePriority);
RRF_LOG_PRINT(RRDEBUG_DISPLAY_READ_DISPATCH, (“Dispatch Read size of Mdl
buffer contains %d bytes with offset %ld\n”, bufferLength, bufferOffset));
RRF_LOG_PRINT(RRDEBUG_DISPLAY_READ_DISPATCH, (“Dispatch Read MDL buffer
contains ANSI :\n %s\n”, ( (char*)pData ) ));
}
Note to Tony; See, I *did* take a suggestion and changed the priority back
to Normal.
You can see I’m trying to dump the buffer into the debugger.
This seems to work okay until I get to the “hosts” file. It dumps out part
of the file and then blue screens.
I’m thinking I likely don’t have a clue what I’m dumping to begin with and
whether or not its safe to do so. Hence, I started this thread.
Regardless, I’m not any further along than I was, even though I understand
what I am doing better now, thank you again.
So… here’s the dilly-o: Is this problem with the larger-text files
because … why? I have no idea. It could be I’m doing something that
should never, ever be done because… I have no idea.
Thanks again.
Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17
You are currently subscribed to ntfsd as: xxxxx@kerneldrivers.com
To unsubscribe send a blank email to xxxxx@lists.osr.com