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
展開 最小化

WdfPdoInitAddDeviceText メソッド

The WdfPdoInitAddDeviceText method adds a device description and device location to a device, for a specified locale.

構文

NTSTATUS WdfPdoInitAddDeviceText(
  [in]  PWDFDEVICE_INIT DeviceInit,
  [in]  PCUNICODE_STRING DeviceDescription,
  [in]  PCUNICODE_STRING DeviceLocation,
  [in]  LCID LocaleId
);

パラメーター

DeviceInit [in]

A pointer to a WDFDEVICE_INIT structure.

DeviceDescription [in]

A pointer to a UNICODE_STRING structure that contains a device description, formatted for the given locale. The driver can allocate the string's buffer from paged pool.

DeviceLocation [in]

A pointer to a UNICODE_STRING structure that contains a description of the location on the bus where the parent device found the child. The driver can allocate the string's buffer from paged pool.

LocaleId [in]

A locale identifier (LCID) that represents the locale of the Unicode strings. For more information about locale identifiers, see the Microsoft Developer Network (MSDN) Web site.

戻り値

If the operation succeeds, the method returns STATUS_SUCCESS. Additional return values include:

リターン コード説明
STATUS_INVALID_DEVICE_REQUEST

The driver is initializing an FDO instead of a PDO.

STATUS_INSUFFICIENT_RESOURCES

The driver could not allocate space to store the strings.

 

The method might also return other NTSTATUS values.

解説

The framework stores the specified device text and passes it to the PnP manager in response to an IRP_MN_QUERY_DEVICE_TEXT request. The text that you supply should help the user to identify the device. The PnP manager sometimes displays the text while attempting to install additional drivers for the device.

You can call WdfPdoInitAddDeviceText multiple times, adding device text for multiple locales. When the system displays the text, it chooses the text that matches the current locale, if available. Otherwise, it will use the string for the default locale. The driver can specify the driver's default locale by calling WdfPdoInitSetDefaultLocale.

The driver must call WdfPdoInitAddDeviceText before calling WdfDeviceCreate. For more information about calling WdfDeviceCreate, see Creating a Framework Device Object.

The following code example provides Unicode strings for a device's location and description. The description includes an instance number. For a complete example that uses WdfPdoInitAddDeviceText, see the KbFiltr sample driver.

DECLARE_CONST_UNICODE_STRING(deviceLocation,L"Keyboard Filter\0" );
DECLARE_UNICODE_STRING_SIZE(buffer, MAX_ID_LEN);

status = RtlUnicodeStringPrintf(
                                &buffer,
                                L"Keyboard_Filter_%02d",
                                InstanceNo
                                );
if (!NT_SUCCESS(status)) {
    goto Cleanup;
}
status = WdfPdoInitAddDeviceText(
                                 pDeviceInit,
                                 &buffer,
                                 &deviceLocation,
                                 0x409
                                 );
if (!NT_SUCCESS(status)) {
    goto Cleanup;
}

要件

バージョン

Available in version 1.0 and later versions of KMDF.

ヘッダー

Wdfpdo.h (includeWdf.h)

ライブラリ

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

IRQL

PASSIVE_LEVEL

参照

WdfPdoInitSetDefaultLocale

 

 

コミュニティの追加

追加
表示:
© 2015 Microsoft