Szerkesztés

Megosztás a következőn keresztül:


Obtaining WDM Information

[Applies to KMDF only]

The framework provides several object methods that enable your driver to obtain WDM-defined information.

Obtaining WDM Information About the Driver and its Devices

To obtain WDM information about a driver and its devices, the driver can call the following methods:

WdfFdoInitWdmGetPhysicalDevice
Retrieves the DEVICE_OBJECT structure that represents a device's physical device object (PDO). A driver can call this method before the driver has created a framework device object for the device.

WdfDeviceWdmGetPhysicalDevice
Retrieves the WDM DEVICE_OBJECT structure that represents a device's PDO. A driver can call this method after it has created a framework device object for the device.

WdfDeviceWdmGetDeviceObject
Returns the WDM device object that is associated with a specified framework device object.

WdfDeviceWdmGetAttachedDevice
Returns the next-lower WDM device object in the device stack.

WdfWdmDeviceGetWdfDeviceHandle
Returns a handle to the framework device object that is associated with a specified WDM device object.

WdfWdmDriverGetWdfDriverHandle
Returns a handle to the framework driver object that is associated with a specified WDM driver object.

Obtaining WDM Information About I/O Requests

To obtain WDM information about I/O requests, a driver can call the following methods:

WdfRequestWdmGetIrp
Returns the WDM IRP structure that is associated with a specified framework request object. (On the other hand, a driver that receives a WDM IRP outside of the framework can create a framework request object for the IRP by calling WdfRequestCreateFromIrp.)

WdfRequestGetParameters
Retrieves the parameters that are associated with a specified framework request object. Most of these parameters come from the request's WDM I/O stack location.)

WdfRequestRetrieveOutputWdmMdl
Retrieves a memory descriptor list (MDL) that represents an I/O request's output buffer.

WdfRequestRetrieveInputWdmMdl
Retrieves an MDL that represents an I/O request's input buffer.

WdfRequestFormatRequestUsingCurrentType
Copies the contents of the calling driver's I/O stack location to the I/O stack location of the driver's local I/O target.

WdfRequestWdmFormatUsingStackLocation
Sets the contents of the I/O stack location for the driver's local I/O target.

Obtaining WDM Information About I/O Targets

To obtain WDM information about I/O targets, a driver can call the following methods:

WdfIoTargetWdmGetTargetDeviceObject
Returns a pointer to the WDM device object that is associated with a local or remote I/O target.

WdfIoTargetWdmGetTargetFileObject
Returns a pointer to the WDM FILE_OBJECT structure that is associated with a remote I/O target.

WdfIoTargetWdmGetTargetFileHandle
Returns a handle to the file that is associated with a remote I/O target.

WdfIoTargetWdmGetTargetPhysicalDevice
Returns a pointer to the WDM physical device object (PDO) that represents a remote I/O target's device.

Obtaining WDM Information About Interrupts and DPCs

To obtain WDM information about interrupts and deferred procedure calls (DPCs), a driver can call the following methods:

WdfInterruptWdmGetInterrupt
Returns a pointer to the WDM KINTERRUPT structure that is associated with a specified framework interrupt object.

WdfDpcWdmGetDpc
Returns a pointer to the WDM KDPC structure that is associated with a specified framework DPC object.

Obtaining WDM Information About USB I/O Targets

To obtain WDM information about USB I/O targets, a driver can call the following method:

WdfUsbTargetPipeWdmGetPipeHandle
Returns the USBD_PIPE_HANDLE-typed handle that is associated with a specified framework pipe object.

Obtaining WDM Information About the Registry

To obtain WDM information about the registry, a driver can call the following method:

WdfRegistryWdmGetHandle
Returns a WDM handle to the registry key that a framework registry-key object represents.

Obtaining WDM Information About File Objects

To obtain WDM information about file objects, a driver can call the following method:

WdfFileObjectWdmGetFileObject
Returns the WDM FILE_OBJECT structure that is associated with a specified framework file object.