Windows Kernel Study Notes (2)-iocalldriver function and pocalldriver Function

Source: Internet
Author: User

I saw these two functions while reading the book today, but I didn't care about them yet. I thought they were the same and they should have the same functions. Later, I thought about the same thing. I got two more functions, so I checked them and found that the differences between the two functions are quite big.

First, let's look at the prototype of the two functions:

Ntstatus <br/> iocalldriver (<br/> In pdevice_object deviceobject, <br/> In out pirp <br/> ); <br/> ntstatus <br/> pocalldriver (<br/> In pdevice_object deviceobject, <br/> In out pirp <br/> );

All functions except function names are the same. The parameters are two. One is the pointer of the device object, and the other is the pointer of the IRP request object. The same is true for returned values. So what is the difference?

Let's take a look at the explanation on wdk documentation:

TheIocalldriver
Routine sends an IRP to the driver associated with
Specified device object.

ThePocalldriver
Routine passes a power IRP
To
Next-lower driver in the device stack. (Windows Server 2003, Windows XP, and
Windows 2000 only .)

From the above two sentences, we can see that the iocalldriver function sends an IRP request to the driver object of the deviceobject device object; the pocalldriver function transmits a request with the main function number irp_mj_power to the underlying device in the device stack, and is limited to a specific OS.

Moreover, before calling iocalldriver, the main driver must create an I/O stack location in the IRP for the target driver, the iocalldriver function also helps the driver to assign the deviceobject value of the input parameter to the deviceobject member in the io_stack_location structure.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.