I see 2 types of API designation
?1)? Just like windows sdk, there are lots API function call,
CreateFile, CreateProcess, ReadFile … . In this way provides lots
of function API to give users to call. I thought it may can quickly
called by applications.
2) The other is like IRP. No matter what functions you want, the
only interface to next is IoCallDriver ?
Can some experts help to talk about the advances and defects between
this two types?
And which condition should choose 1) or 2)?
Thanks
Best Wishes
Gang Chen
Use both methods. They don’t replace each other.
Igor Sharovar
钢陈 wrote:
I see 2 types of API designation
- Just like windows sdk, there are lots API function call,
CreateFile, CreateProcess, ReadFile … . In this way provides lots
of function API to give users to call. I thought it may can quickly
called by applications.
- The other is like IRP. No matter what functions you want, the
only interface to next is IoCallDriver ?
Can some experts help to talk about the advances and defects between
this two types?
And which condition should choose 1) or 2)?
To a certain extent, the question is moot. User-mode applications in
Windows use your method 1). Kernel-mode drivers in Windows user your
method 2). That’s just the way it is.
Because kernel mode is so critical (a mistake in a kernel driver brings
down the whole system), there are excellent reasons for making the
interfaces between drivers as simple and focused as possible. Fewer
points of contact mean fewer places to introduce errors. So, the only
interface between drivers is via IRPs, passed by means of IoCallDriver.
–
Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.
Tim Roberts wrote:
Fewer points of contact mean fewer places to
introduce errors. So, the only interface between
drivers is via IRPs, passed by means of IoCallDriver.
I thought there was some IRP_MN_QUERY_INTERFACE functionality that allowed you to expose a direct-call interface as well.
xxxxx@gmail.com wrote:
Tim Roberts wrote:
> Fewer points of contact mean fewer places to
> introduce errors. So, the only interface between
> drivers is via IRPs, passed by means of IoCallDriver.
I thought there was some IRP_MN_QUERY_INTERFACE functionality that allowed you to expose a direct-call interface as well.
You are correct, but that IRP_MN_QUERY_INTERFACE call arrives in an IRP
via IoCallDriver.
–
Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.
Hi all,
Thanks for the explaination.
As I thought, the advance of one interface including code architecture
design for a module. It is easier to log all the api calls. But the
defects is it need a request data structure for users.
It may be more complicated for users.
On Thu, Mar 17, 2011 at 6:14 AM, Tim Roberts wrote:
> xxxxx@gmail.com wrote:
>> Tim Roberts wrote:
>>> Fewer points of contact mean fewer places to
>>> introduce errors. So, the only interface between
>>> drivers is via IRPs, passed by means of IoCallDriver.
>> I thought there was some IRP_MN_QUERY_INTERFACE functionality that allowed you to expose a direct-call interface as well.
>
> You are correct, but that IRP_MN_QUERY_INTERFACE call arrives in an IRP
> via IoCallDriver.
>
> –
> Tim Roberts, xxxxx@probo.com
> Providenza & Boekelheide, Inc.
>
>
> —
> 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
>
>