EvtDeviceReportedMissing
EvtDeviceUsageNotificationEx
EvtDeviceWdmIrpDispatch
EvtDeviceWdmPostPoFxRegisterDevice
EvtDeviceWdmPrePoFxUnregisterDevice
WDF_DEVICE_INTERFACE_PROPERTY_DATA
WDF_DEVICE_INTERFACE_PROPERTY_DATA_INIT
WDF_DEVICE_PROPERTY_DATA
WDF_DEVICE_PROPERTY_DATA_INIT
WDF_DISPATCH_IRP_TO_IO_QUEUE_FLAGS
WDF_EVENT_TYPE
WDF_IO_TYPE_CONFIG
WDF_IO_TYPE_CONFIG_INIT
WDF_POWER_FRAMEWORK_SETTINGS
WDF_POWER_FRAMEWORK_SETTINGS_INIT
WDF_POWER_POLICY_IDLE_TIMEOUT_TYPE
WDF_RELEASE_HARDWARE_ORDER_ON_FAILURE
WDF_REMOVE_LOCK_OPTIONS
WDF_REMOVE_LOCK_OPTIONS_FLAGS
WDF_REMOVE_LOCK_OPTIONS_INIT
WdfDeviceAllocAndQueryInterfaceProperty method
WdfDeviceAllocAndQueryPropertyEx method
WdfDeviceAssignInterfaceProperty method
WdfDeviceAssignProperty method
WdfDeviceConfigureWdmIrpDispatchCallback method
WdfDeviceGetDeviceStackIoType method
WdfDeviceGetHardwareRegisterMappedAddress
WdfDeviceInitSetIoTypeEx method
WdfDeviceInitSetReleaseHardwareOrderOnFailure method
WdfDeviceInitSetRemoveLockOptions method
WdfDeviceMapIoSpace
WdfDeviceOpenDevicemapKey method
WdfDevicePostEvent
WdfDeviceQueryInterfaceProperty method
WdfDeviceQueryPropertyEx method
WdfDeviceReadFromHardware
WdfDeviceResumeIdleWithTag method
WdfDeviceStopIdleWithTag method
WdfDeviceUnmapIoSpace
WdfDeviceWdmAssignPowerFrameworkSettings method
WdfDeviceWdmDispatchIrp method
WdfDeviceWdmDispatchIrpToIoQueue method
WdfDeviceWriteToHardware
WdfFdoInitAllocAndQueryPropertyEx method
WdfFdoInitQueryPropertyEx method
展開 最小化

WdfDeviceSetAlignmentRequirement メソッド

The WdfDeviceSetAlignmentRequirement method sets a device's address alignment requirement for the data buffers that the device uses during memory transfer operations.

構文

VOID WdfDeviceSetAlignmentRequirement(
  [in]  WDFDEVICE Device,
  [in]  ULONG AlignmentRequirement
);

パラメーター

Device [in]

A handle to a framework device object.

AlignmentRequirement [in]

The alignment requirement for a data buffer. This value must be one less than the alignment boundary. For example, you can specify 15 for a 16-byte alignment boundary and 31 for a 32-byte alignment boundary. You can also use one of the FILE_Xxxx_ALIGNMENT constants that are defined in Wdm.h.

戻り値

None.

A bug check occurs if the driver supplies an invalid object handle.

解説

The driver can call WdfDeviceGetAlignmentRequirement to obtain the current value for the device's alignment requirement.

The I/O manager sets an alignment requirement value for the device when the driver calls WdfDeviceCreate. For more information about a device's alignment requirement value and when a driver must change the value, see Initializing a Device Object in the WDM documentation.

If your driver specifies an alignment requirement that is greater that the computer's page size (PAGE_SIZE), the logical addresses that the WdfCommonBufferGetAlignedLogicalAddress method returns are always aligned to the specified alignment requirement, but the virtual addresses that the WdfCommonBufferGetAlignedVirtualAddress method returns might not be aligned to the alignment requirement.

If your driver specifies an alignment requirement that is less than the computer's page size, all logical and virtual addresses are aligned to the specified alignment requirement.

For more information about calling WdfDeviceSetAlignmentRequirement, see Enabling DMA Transactions and Using Common Buffers.

The following code example is from the AMCC5933 sample driver. This example checks a device's current alignment requirement and sets the alignment requirement to a new value, if necessary.

ULONG alignReq;

alignReq = WdfDeviceGetAlignmentRequirement(device);
if (alignReq < AMCC5933_ALIGNMENT__32BITS) {
//
// Set the S5933 alignment requirement to a new value.
//
WdfDeviceSetAlignmentRequirement(
                                 device,
                                 AMCC5933_ALIGNMENT__32BITS
                                 );
}

要件

バージョン

Available in version 1.0 and later versions of KMDF.

ヘッダー

Wdfdevice.h (includeWdf.h)

ライブラリ

Wdf<MajorVersionNumber>000.sys (see Framework Library Versions.)

IRQL

<= DISPATCH_LEVEL

参照

WdfCommonBufferGetAlignedLogicalAddress
WdfCommonBufferGetAlignedVirtualAddress
WdfDeviceGetAlignmentRequirement

 

 

コミュニティの追加

追加
表示:
© 2015 Microsoft