Re: SPAM-LOW: buffer problem

there is nothing much to say. the code is self explanatory, it uses
kdprint and I am using windbg on a serial connection

On 8/9/05, Arlie Davis wrote:
> You’ll need to provide more information. What debugger are you using? What
> command are you executing to try to view the contents of the buffer? What
> are you expecting to happen, and what actually happens?
>
> – arlie
>
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of Albert Pinto
> Sent: Tuesday, August 09, 2005 12:26 PM
> To: Windows System Software Devs Interest List
> Subject: SPAM-LOW: [ntdev] buffer problem
>
> I have a global buffer defined 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 that is called in some dispatcher, I write
>
> if(buffer[OFFSET]==‘2’){
> KdPrint((“\n 2 buffer[%u] is : %c”,OFFSET,buff[OFFSET])); } else
> if(buffer[OFFSET]==‘1’){ KdPrint((“\n 1 buffer[%u] is :
> %c”,OFFSET,buff[OFFSET])); }
>
>
>
> I cannot get the reason why in the debugger I never see the contents of the
> location OFFSET!!!
>
> any help
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: unknown lmsubst tag argument: ‘’
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
>
>
> —
> Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@gmail.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>

What’s the name of the buffer? Is it “buffer” or “buff”?

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Albert Pinto
Sent: 09 August 2005 17:26
To: Windows System Software Devs Interest List
Subject: [ntdev] buffer problem

I have a global buffer defined 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 that is called in some dispatcher, I write

if(buffer[OFFSET]==‘2’){
KdPrint((“\n 2 buffer[%u] is : %c”,OFFSET,buff[OFFSET]));
}
else if(buffer[OFFSET]==‘1’){
KdPrint((“\n 1 buffer[%u] is : %c”,OFFSET,buff[OFFSET]));
}

I cannot get the reason why in the debugger I never see the
contents of the location OFFSET!!!

any help


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: unknown lmsubst tag
argument: ‘’ To unsubscribe send a blank email to
xxxxx@lists.osr.com

is it that difficult prokash, i am using a simple Kdprint, and I find
no reason why that should fail.

On 8/9/05, xxxxx@garlic.com wrote:
> It is a global variable, so it would not appear on the stack ( when you
> use windbg ). But you can look at it by issuing the following command
>
> dd YourDrivername!buffer
>
> N.B:Make sure your driver’s pdb is loaded by issuing the following
>
> x YourDrivername!*
>
> where YourDrivername is the name of your driver file without the .sys
> extension.
>
> -pro
>
>
> > You’ll need to provide more information. What debugger are you using?
> > What
> > command are you executing to try to view the contents of the buffer? What
> > are you expecting to happen, and what actually happens?
> >
> > – arlie
> >
> >
> > -----Original Message-----
> > From: xxxxx@lists.osr.com
> > [mailto:xxxxx@lists.osr.com] On Behalf Of Albert Pinto
> > Sent: Tuesday, August 09, 2005 12:26 PM
> > To: Windows System Software Devs Interest List
> > Subject: SPAM-LOW: [ntdev] buffer problem
> >
> > I have a global buffer defined 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 that is called in some dispatcher, I write
> >
> > if(buffer[OFFSET]==‘2’){
> > KdPrint((“\n 2 buffer[%u] is : %c”,OFFSET,buff[OFFSET])); } else
> > if(buffer[OFFSET]==‘1’){ KdPrint((“\n 1 buffer[%u] is :
> > %c”,OFFSET,buff[OFFSET])); }
> >
> >
> >
> > I cannot get the reason why in the debugger I never see the contents of
> > the
> > location OFFSET!!!
> >
> > any help
> >
> > —
> > Questions? First check the Kernel Driver FAQ at
> > http://www.osronline.com/article.cfm?id=256
> >
> > You are currently subscribed to ntdev as: unknown lmsubst tag argument: ‘’
> > To unsubscribe send a blank email to xxxxx@lists.osr.com
> >
> >
> >
> >
> > —
> > Questions? First check the Kernel Driver FAQ at
> > http://www.osronline.com/article.cfm?id=256
> >
> > You are currently subscribed to ntdev as: xxxxx@garlic.com
> > To unsubscribe send a blank email to xxxxx@lists.osr.com
> >
>
>
> —
> Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@gmail.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>

Albert Pinto wrote:

there is nothing much to say. the code is self explanatory, it uses
kdprint and I am using windbg on a serial connection

There is a LOT more to say. I still don’t understand what the problem
is. Is it that you never see EITHER of the KdPrint messages, or is it
that the messages appear but not with the information you expect, or is
it that you enter a WinDbg command to display the data, and that display
is not what you expect?

On 8/9/05, Arlie Davis wrote:
>
>
>>You’ll need to provide more information. What debugger are you using? What
>>command are you executing to try to view the contents of the buffer? What
>>are you expecting to happen, and what actually happens?
>>
>>– arlie
>>
>>
>>-----Original Message-----
>>From: xxxxx@lists.osr.com
>>[mailto:xxxxx@lists.osr.com] On Behalf Of Albert Pinto
>>Sent: Tuesday, August 09, 2005 12:26 PM
>>To: Windows System Software Devs Interest List
>>Subject: SPAM-LOW: [ntdev] buffer problem
>>
>>I have a global buffer defined 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 that is called in some dispatcher, I write
>>
>>if(buffer[OFFSET]==‘2’){
>>KdPrint((“\n 2 buffer[%u] is : %c”,OFFSET,buff[OFFSET])); } else
>>if(buffer[OFFSET]==‘1’){ KdPrint((“\n 1 buffer[%u] is :
>>%c”,OFFSET,buff[OFFSET])); }
>>
>>
>>
>>I cannot get the reason why in the debugger I never see the contents of the
>>location OFFSET!!!
>>
>>any help
>>
>>


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

prokash,

It is just other way to look at to figure out if you happen to have index
problem when you are trying to print from the code.

I tried that, everything is fine, else it wouldn’t have gone into the
if…else i am using the same offset at both places and the condition
checker is hard coded!!!
no mistakes there