hi loren
i understand ur point.
but ur get-integer will get a copy of the integer allocated in kernel stack.
similarly if i want to have somthing like get_data(ABC_Type, Buffer)
where the memory for ABC_Type variable was allocated in the kernel, then is
it possible.
what i have in mind is the following:-
typedef struct abc_type {
struct x * a1;
struct y * a2;
void * dhsj
int type;
}ABC_type;
kernel mode code
ABC_Type *abc = (ABC_Type *) ExAllocatePool()
abc->a1 = (struct x *) ExAllocatePool()
abc->a1->a =132
abc->type =3232 ,etc
then
user mode code
void *inp_buffer;
ABC_Type *xyz
/* to read the data structure from the kernel */
DeviceIoControl(inp_buffer,READ_CODE)
/* to update the data structure read from the kernel */
xyz = (ABC_Type *) inp_buffer
xyz->a1->a=999
xyz->type=-1
/* to update the data structure in the kernel */
DeviceIoControl(inp_buffer,WRITE_CODE)
IS THIS POSSIBLE
please tell me
I think my questions may be obvious to all of you , but since i am a newbie
in this field, i am seeking ur help
Regards
Mayank
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Loren Wilton
Sent: Saturday, May 17, 2003 8:04 PM
To: NT Developers Interest List
Subject: [ntdev] Re: Too many ioctls
There is a somewhat limited number of ioctl values that you can assign,
something like 10 or 12 bits worth, I think. So you are limited to
something like 1000 separate ioctls. In your driver these all show up at
one entry point, so you have to decode the ioctl value with a switch
statement or the like.
I would probably not make an ioctl for every possible variable, especially
if the number of variables can change. It would probably be more practical
to make get_integer, get_string, set_integer, set_string type ioctls, and
then pass an enumerated value to these ioctls to identify the specific field
you want to manipulate.
If you are doing very very many of these per second all the time (and not
just a bunch to set things up and then a few from time to time) the overhead
might get to be a problem. In that case you could consider using shared
memory. This is fairly easy to set up, and obviously lets you manipulate
variables quickly. You would have to determine if you needed to lock every
access, or if you could do a group of accesses with a single lock. Fiddling
locks on and off also has overhead, although probably not as much as
processing an ioctl.
Loren
You are currently subscribed to ntdev as:
xxxxx@intersolutions.stpn.soft.net
To unsubscribe send a blank email to xxxxx@lists.osr.com