storage

I see you guys don’t understand my questions.
(sorry for my english)

I need to store data in device extension.
Need some kind of a buffer to store up to ~2mb.

And need to fill it by char[3] elements all the time.

How can I do that?
What types to use and what functions should I use to fill the buffer?

First, I would not store it in the device extension, I would allocate a
buffer and put the pointers to it in the device extension. Then it is your
code, to basically store the data in the buffer including whether you want a
circular buffer or not. There are no functions for managing this you roll
your own.


Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
http://www.windrvr.com
Remove StopSpam from the email to reply

“Shadow” wrote in message news:xxxxx@ntdev…
>I see you guys don’t understand my questions.
> (sorry for my english)
>
> I need to store data in device extension.
> Need some kind of a buffer to store up to ~2mb.
>
> And need to fill it by char[3] elements all the time.
>
>
> How can I do that?
> What types to use and what functions should I use to fill the buffer?
>
>
>

if it is such a large buffer ( 2 mb) avoid teh device extension, which is in
the non paged pool.

instead make it dynamic and store away the pointer in the devExt.

i could not understand “And need to fill it by char[3] elements all the
time.”

amitr0

Hmmm … mostly it’s called C programming 101, which I’m beginning to
think you flunked, and/or READ the posts that have already been posted
against your question. We understand your question perfectly … but we
highly doubt if you are reading and understanding our answers. You were
actually given some very good answers to a rather surprising question.

Stating it simply, allocate a buffer of the proper size, paged if you know
you will never access it above PASSIVE_LEVEL, or non_paged if you will
access it at DISPATCH_LEVEL. You can pass the buffer from an application
via an IOCTL call. There is a whole plethora of means to do this. I’d
suggest you do some DDK study on such topics as ExAllocatePool,
METHOD_BUFFERED, METHOD_DIRECT_IN, etc. etc. etc.

Gary G. Little

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@voliacable.com
Sent: Friday, July 28, 2006 8:40 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] storage

I see you guys don’t understand my questions.
(sorry for my english)

I need to store data in device extension.
Need some kind of a buffer to store up to ~2mb.

And need to fill it by char[3] elements all the time.

How can I do that?
What types to use and what functions should I use to fill the buffer?


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

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

You probably want a circular ring buffer. Stop thinking about your data
as characters and using str functions, rather, think of your data as
bytes (e.g. typedef UCHAR BYTE;). Use RtlCopyMemory to copy from your
data to your ring buffer. Any decent algorithm book will have a
circular ring buffer topic, I am sure you can find one online as well.

d

– I can spell, I just can’t type.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Shadow
Sent: Friday, July 28, 2006 6:40 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] storage

I see you guys don’t understand my questions.
(sorry for my english)

I need to store data in device extension.
Need some kind of a buffer to store up to ~2mb.

And need to fill it by char[3] elements all the time.

How can I do that?
What types to use and what functions should I use to fill the buffer?


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

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

See my other response. Also it seems that your three chars are probably not
null terminated. If you are actually collecting three bytes of information
at a time, perhaps what you want is an array of three byte objects?

#define MAX_ELEMENTS 4096

struct LogElement
{
char bytes[3];
}

LogElement LogArray[MAX_ELEMENTS];

You then need an index associated with LogArray and you need to simply copy
a LogElement object into your LogArray:

LogElement aLogElement;

LogArray[index++] = aLogElement;

This is C programming 101. Of course you need to make sure that index <
MAX_ELEMENTS.

=====================
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 Shadow
Sent: Friday, July 28, 2006 9:40 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] storage

I see you guys don’t understand my questions.
(sorry for my english)

I need to store data in device extension.
Need some kind of a buffer to store up to ~2mb.

And need to fill it by char[3] elements all the time.

How can I do that?
What types to use and what functions should I use to fill the buffer?


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

To unsubscribe, visit the List Server section of OSR Online
at http://www.osronline.com/page.cfm?name=ListServer