WdfStringGetUnicodeString function (wdfstring.h)

[Applies to KMDF and UMDF]

The WdfStringGetUnicodeString method retrieves the Unicode string that is assigned to a specified framework string object.

Syntax

void WdfStringGetUnicodeString(
  WDFSTRING       String,
  PUNICODE_STRING UnicodeString
);

Parameters

String

[in] A handle to a framework string object.

UnicodeString

[out] A pointer to a UNICODE_STRING structure that receives a pointer to the Unicode string that is currently assigned to the string object that String specifies.

Return value

None

Remarks

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

After WdfStringGetUnicodeString returns, the UNICODE_STRING structure that UnicodeString points to contains a pointer to the specified string object's Unicode string, along with the string's length. The Unicode string is allocated in paged pool.

The framework does not make a copy of the string for the driver.

For more information about framework string objects, see Using String Objects.

Examples

The following code example obtains the Unicode string that is assigned to a specified framework string object.

UNICODE_STRING StringName;

WdfStringGetUnicodeString(
                          stringHandle,
                          &StringName
                          );

Requirements

   
Target Platform Universal
Minimum KMDF version 1.0
Minimum UMDF version 2.0
Header wdfstring.h (include Wdf.h)
Library Wdf01000.sys (KMDF); WUDFx02000.dll (UMDF)
IRQL PASSIVE_LEVEL
DDI compliance rules DriverCreate, KmdfIrql, KmdfIrql2

See also

UNICODE_STRING

WdfStringCreate