Eksportimine (0) Prindi
Laienda kõik
EN
See sisu pole teie keeles saadaval, siin on inglise keelne versioon.

WdfDriverRetrieveVersionString method

[Applies to KMDF and UMDF]

The WdfDriverRetrieveVersionString method retrieves a Unicode string that identifies the version of the Kernel-Mode Driver Framework that the driver is running with.

Syntax


NTSTATUS WdfDriverRetrieveVersionString(
  [in]  WDFDRIVER Driver,
  [in]  WDFSTRING String
);

Parameters

Driver [in]

A handle to the driver's framework driver object that the driver obtained from a previous call to WdfDriverCreate or WdfGetDriver.

String [in]

A handle to a framework string object that the driver obtained from a previous call to WdfStringCreate. The framework assigns the version string to the string object.

Return value

WdfDriverRetrieveVersionString returns STATUS_SUCCESS if the operation succeeds. Otherwise, this method might return one of the following values:

Return codeDescription
STATUS_INSUFFICIENT_RESOURCES

The framework could not allocate a buffer for the Unicode string.

 

This method might also return other NTSTATUS values.

A system bug check occurs if the Driver handle is invalid.

Remarks

Your driver can call WdfDriverRetrieveVersionString if you want to display a string that identifies the framework library's version. The string's format might change from one version to another, so the driver must not attempt to interpret the string's format or content.

For more information about library versions, see Framework Library Versioning.

Examples

The following code example creates a string object, assigns the version string to the object, and displays the string if a debugger is running.


WDFSTRING string;
UNICODE_STRING us;

status = WdfStringCreate(
                         NULL,
                         WDF_NO_OBJECT_ATTRIBUTES,
                         &string
                         );
if (NT_SUCCESS(status)) {
    status = WdfDriverRetrieveVersionString(
                                            driver,
                                            string
                                            );
    if (NT_SUCCESS(status)) {
        WdfStringGetUnicodeString(
                                  string,
                                  &us
                                  );
        DbgPrint(
                 "WDF Version string:  %wZ\n",
                 &us
                 );
    }
    WdfObjectDelete(string);
}

Requirements

Minimum KMDF version

1.0

Minimum UMDF version

2.0

Header

Wdfdriver.h (include Wdf.h)

Library

Wdf01000.sys (KMDF);
WUDFx02000.dll (UMDF)

IRQL

PASSIVE_LEVEL

DDI compliance rules

DriverCreate, KmdfIrql, KmdfIrql2

See also

WdfDriverCreate
WdfDriverIsVersionAvailable
WdfGetDriver
WdfObjectDelete
WdfStringCreate
WdfStringGetUnicodeString

 

 

Send comments about this topic to Microsoft

Näita:
© 2014 Microsoft