I’ll be committing ritual suicide in the parking lot, if anyone is
interested.
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Phil Barila
Sent: Thursday, August 11, 2005 12:06 PM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] buffer(Albert’s question)
Not enough coffee this AM, Mark? ‘1’ is certainly a printable
character.
It prints as 1. 0x01 is not, of course. His types are correct, he’s
indexing into a PCHAR, so there should be a char there.
To “Developer”
(I liked you better as Albert Pinto. You’ll get a lot more respect if
you
read the posting guidelines at OSROnline and do what they say. Your
initiation of this thread is an excellent example of how NOT to post a
question on this list.)
Jan Bottorff caught a likely cause of your problem. You are expecting
either ‘1’ or ‘2’, you need to catch the case where it is any other
value.
If you see that it’s any other value, use Mark’s suggestion to print the
hex
value in the buffer. If you find that’s happening, you then need to
figure
out why it’s not what you expect.
The MSDN docs say that RtlFillMemory is preferred over RtlFillBytes, if
you
aren’t supporting Win9x.
Phil
Philip D. Barila Windows DDK MVP
Seagate Technology, LLC
(720) 684-1842
As if I need to say it: Not speaking for Seagate.
“Mark Roddy” wrote in message news:xxxxx@ntdev…
> Neither of the values ‘1’ or ‘2’ are printable characters. Change %c
to
> %x.
>
> =====================
> Mark Roddy DDK MVP
> Windows 2003/XP/2000 Consulting
> Hollis Technology Solutions 603-321-1032
> www.hollistech.com
>
>> -----Original Message-----
>> From: xxxxx@lists.osr.com
>> [mailto:xxxxx@lists.osr.com] On Behalf Of Developer
>> Sent: Thursday, August 11, 2005 1:38 AM
>> To: Windows System Software Devs Interest List
>> Subject: Re: [ntdev] buffer(Albert’s question)
>>
>> members,
>>
>> of hand I have created a lot of confusion amongst you just
>> because of a stupid typo error, and trying to reproduce the
>> code by typing it.
>> well here is the original with the WinDbg output…
>>
>>
>> In global header the variable is declared as
>>
>> #define SIZEB 3000000
>> PCHAR buffer;
>>
>> in driver entry i allocate and initialize the buffer as
>>
>> buffer=ExAllocatePool( NonPagedPoolCacheAligned ,SIZEB);
>> RtlFillBytes(buffer,SIZEB,‘1’);
>>
>> In another function f00() that is called in some dispatcher, I write
>>
>>
>>
>> if(buffer[OFFSET]==‘2’){
>> KdPrint((“\nindex is : %u”,OFFSET));
>> KdPrint((“\n buffer[%u] is :
>> %c”,OFFSET,buffer[OFFSET]));
>> return 1;
>> }
>> else if(buffer[OFFSET]==‘1’){
>> KdPrint((\nindex is : %u",OFFSET));
>> KdPrint((“\n buffer[%u] is :
>> %c”,OFFSET,buffer[OFFSET]));
>> return 0;
>> }
>> }
>>
>>
>>
>>
>>
>> In the dispatcher for READ, I have…
>>
>> KdPrint((“\n(READ)”));
>> foo(OFFSET);
>>
>>
>>
>>
>> here is the dump from WinDbg.
>>
>> (READ)
>> index is : 955
>> buffer[955] is :
>>
>> (READ)
>> index is : 963
>> buffer[963] is :
>>
>>
>>
>> I am using debug (checked ) build and I am using WinDbg over
>> a serial cable conected at 19200 baud rate.
>>
>> I cannot get the reason why in the debugger I never see the
>> contents of the location OFFSET!!!
>>
>> -A
—
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: xxxxx@stratus.com
To unsubscribe send a blank email to xxxxx@lists.osr.com