Hi,
I would like to know how to use the ProbeForRead macro.
I have my own struct which I want to pass from Win32 to kernel.
At the kernel side, I would like to check the buffer, but I don’t know
what to do with the alignment.
Thanks.
Igor Rosenberg
Hi,
I would like to know how to use the ProbeForRead macro.
I have my own struct which I want to pass from Win32 to kernel.
At the kernel side, I would like to check the buffer, but I don’t know
what to do with the alignment.
Thanks.
Igor Rosenberg
If you are in doubt about the packing of your structs then just frame
your typedefs with well formed '#pragma pack'.
"Don't let them drive you crazy when you know it's a short walk."
---- snip ----
what to do with the alignment.
---- snip ----
Pass the struct using your own private IOCTL and the OS will do all the
checking required EXCEPT if you insist on putting pointers in your struct.
In that case you have to check what those pointers point to (and you may
have to do a lot more as well.) This topic has been covered here repeatedly.
Search the list. The best practice is to marshall all data into one descrete
buffer and let the OS manage it.
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Igor Rosenberg
Sent: Wednesday, August 04, 2004 6:10 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] proper use of ProbeForRead
Hi,
I would like to know how to use the ProbeForRead macro.
I have my own struct which I want to pass from Win32 to kernel.
At the kernel side, I would like to check the buffer, but I don’t
know
what to do with the alignment.
Thanks.
Igor Rosenberg
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: xxxxx@hollistech.com
To unsubscribe send a blank email to xxxxx@lists.osr.com
Thnaks.
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Mark Roddy
Sent: Wednesday, August 04, 2004 12:37 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] proper use of ProbeForRead
Pass the struct using your own private IOCTL and the OS will do all the
checking required EXCEPT if you insist on putting pointers in your
struct.
In that case you have to check what those pointers point to (and you may
have to do a lot more as well.) This topic has been covered here
repeatedly.
Search the list. The best practice is to marshall all data into one
descrete
buffer and let the OS manage it.
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Igor Rosenberg
Sent: Wednesday, August 04, 2004 6:10 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] proper use of ProbeForRead
Hi,
I would like to know how to use the ProbeForRead macro.
I have my own struct which I want to pass from Win32 to kernel.
At the kernel side, I would like to check the buffer, but I
don’t
know
what to do with the alignment.
Thanks.
Igor Rosenberg
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: xxxxx@hollistech.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@infotrust.sk
To unsubscribe send a blank email to xxxxx@lists.osr.com
On Wed, 2004-08-04 at 05:37, Mark Roddy wrote:
Pass the struct using your own private IOCTL and the OS will do all the
checking required EXCEPT if you insist on putting pointers in your struct.
In particular, you should probably be using METHOD_BUFFERED for this.
-sd
On Wed, 04 Aug 2004 09:46:49 -0700 Steve Dispensa
wrote:
>On Wed, 2004-08-04 at 05:37, Mark Roddy wrote:
>> Pass the struct using your own private IOCTL and the OS will do
>all the
>> checking required EXCEPT if you insist on putting pointers in
>your struct.
>
>In particular, you should probably be using METHOD_BUFFERED for
>this.
is method_direct safe also? the os probes and locks the pages.
–joe
> -sd
>
>
>
>—
>Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
>
>You are currently subscribed to ntdev as: xxxxx@hush.ai
>To unsubscribe send a blank email to xxxxx@lists.osr.com
Concerned about your privacy? Follow this link to get
secure FREE email: http://www.hushmail.com/?l=2
Free, ultra-private instant messaging with Hush Messenger
http://www.hushmail.com/services-messenger?l=434
Promote security and make money with the Hushmail Affiliate Program:
http://www.hushmail.com/about-affiliate?l=427
It’s safe in that the application can’t try to hand down an invalid
buffer pointer or length.
However if the client changes the contents of the buffer, the changes
will be visible when you access the buffer through the MDL. This may or
may not be a problem depending on whether there are any parameters
within the buffer or whether it’s purely data.
If the buffer contains parameters then your driver needs to validate
them. In order to this it needs to first “capture” them by copying them
out of buffer and into system pool or the kernel stack, where the client
cannot change them. Then it can do the validation.
SO if the buffer contains all data then direct is just as “safe” as
buffered. If it contains parameters then you have to do this capture
step. If the buffer is mostly parameters, you may as well have the NTIO
manager do the capturing for you by specifying a bufferd I/O control.
-p
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Joe Black
Sent: Wednesday, August 04, 2004 10:04 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] proper use of ProbeForRead
On Wed, 04 Aug 2004 09:46:49 -0700 Steve Dispensa
wrote:
>On Wed, 2004-08-04 at 05:37, Mark Roddy wrote:
>> Pass the struct using your own private IOCTL and the OS will do
>all the
>> checking required EXCEPT if you insist on putting pointers in
>your struct.
>
>In particular, you should probably be using METHOD_BUFFERED for this.
is method_direct safe also? the os probes and locks the pages.
–joe
> -sd
>
>
>
>—
>Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
>
>You are currently subscribed to ntdev as: xxxxx@hush.ai
>To unsubscribe send a blank email to xxxxx@lists.osr.com
Concerned about your privacy? Follow this link to get
secure FREE email: http://www.hushmail.com/?l=2
Free, ultra-private instant messaging with Hush Messenger
http://www.hushmail.com/services-messenger?l=434
Promote security and make money with the Hushmail Affiliate Program:
http://www.hushmail.com/about-affiliate?l=427
—
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com