Adding some more (emphatic no) to what Skywing has said.
The data structure used by your usermode management tool and by your driver
do not necessarily (nor should they necessarily) be the same. They might
be, they might not be.
However, the data structure used to ‘marshal’ and communicate each ‘row’ in
your table of rules needs to be defined such that it can move across the
user-mode/kernel-mode boundary without address information (pointers).
The suggestion to pack the ‘rule’ table rows into a contiguous, variable
length, self-describing linear buffer is a very good solution.
Consider what happens if you go down the path you are suggesting otherwise
and you suddenly decide that support on 64-bit systems would be nice. Well,
you can avoid a whole lot of headache by having the IOCTL interface be
‘bit-width’ agnostic (meaning you explicitly control the field size of every
field) so that your 32-bit usermode control program can work on either x86
or x64 platforms without change and can compile for ia64 without change.
Moreover, the best form for manipulating the ‘rules’ in the usermode
management code might not be the most efficient form for storing them (and
making search/match/test) in kernel mode. The management tool and the
policy enforcement point (the driver) have completely different goals and
access patterns. It is unlikely that these two separate roles will
‘benefit’ from being tied to each other by a single database structure.
Good Luck,
Dave Cattley
Consulting Engineer
Systems Software Development
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Skywing
Sent: Thursday, September 11, 2008 11:33 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] LIST_ENTRY
Why do you think that you need to do this?
Passing linked lists to kernel mode from user mode is going to be major pain
for proper and secure capture of the data without opening serious security
holes.
You should really avoid non-contiguous data structures in user mode to
kernel mode communication, and especially data structures that are not
bounded in size.
I strongly recommended choosing some other format to indicate your data up
to your driver.
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@yahoo.co.uk
Sent: Thursday, September 11, 2008 11:24 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] LIST_ENTRY
In ntdef.h there is the doubly linked list def for LIST_ENTRY and the kernel
mode macros for maintaining and iterating the list.
How can I create such a list in user mode, and pass to the driver using an
IRP?
Which header file would I include and which macros would I use?
Thanks
NTDEV is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer
NTDEV is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer