次の方法で共有


GetCallerVMProcessId (Compact 2013)

3/28/2014

This function obtains the process identifier of the caller that originated the call to the function.

Syntax

DWORD GetCallerVMProcessId (void);

Parameters

None.

Return Value

The process identifier of the process that made the call into the driver, directly or indirectly, from another kernel component.

Remarks

Device drivers need to know who originates a call so that they can access the virtual memory and the handle of the caller. Device drivers also need to know if they were called from a trusted source, or directly called from a user process. For example, a driver can be called from a user application with WriteFile, which calls DeviceIoControl into the driver.

A driver can also be called with a DeviceIoControl directly. If the parameters are coming from the kernel, the driver knows they can be trusted. User parameters need to be validated. GetCallerVMProcessId and ForwardDeviceIoControl resolve these issues.

Requirements

Header

pkfuncs.h

Library

coredll.lib

See Also

Reference

Kernel Functions
ForwardDeviceIoControl
GetDirectCallerProcessId

Other Resources

DeviceIoControl
WriteFile