WDF_WMI_INSTANCE_CONFIG_INIT_PROVIDER - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
// wdfwmi.h

VOID WDF_WMI_INSTANCE_CONFIG_INIT_PROVIDER(
  [out] PWDF_WMI_INSTANCE_CONFIG Config,
  [in]  WDFWMIPROVIDER           Provider
);

View the official Windows Driver Kit DDI reference

NtDoc

No description available.

Windows Driver Kit DDI reference (nf-wdfwmi-wdf_wmi_instance_config_init_provider)

WDF_WMI_INSTANCE_CONFIG_INIT_PROVIDER function

Description

[Applies to KMDF only]

The WDF_WMI_INSTANCE_CONFIG_INIT_PROVIDER function initializes a WDF_WMI_INSTANCE_CONFIG structure and stores a specified handle to a WMI provider object.

Parameters

Config [out]

A pointer to a WDF_WMI_INSTANCE_CONFIG structure.

Provider [in]

A handle to a WMI provider object that the driver obtained by a previous call to WdfWmiProviderCreate.

Remarks

The WDF_WMI_INSTANCE_CONFIG_INIT_PROVIDER function zeros the WDF_WMI_INSTANCE_CONFIG structure that the Config parameter specifies and sets its Size member. This function also sets the structure's Provider member to the handle that the Provider parameter specifies.

Your driver should call WDF_WMI_INSTANCE_CONFIG_INIT_PROVIDER to initialize a WDF_WMI_INSTANCE_CONFIG structure if it calls WdfWmiProviderCreate before calling WdfWmiInstanceCreate.

Examples

The following code example initializes a WDF_WMI_PROVIDER_CONFIG structure and calls WdfWmiProviderCreate. Then, the example initializes a WDF_WMI_INSTANCE_CONFIG structure and calls WdfWmiInstanceCreate.

WDF_WMI_PROVIDER_CONFIG  providerConfig;
WDFWMIPROVIDER  provider;
GUID  providerGuid = MY_WMI_DATA_BLOCK_GUID;
WDF_WMI_INSTANCE_CONFIG  instanceConfig;
WDFWMIINSTANCE  instanceHandle;
NTSTATUS  status;

WDF_WMI_PROVIDER_CONFIG_INIT(
                             &providerConfig,
                             providerGuid
                             );
providerConfig.Flags = WdfWmiProviderTracing;
providerConfig.EvtWmiProviderFunctionControl = MyProviderFunctionControl;

status = WdfWmiProviderCreate(
                              Device,
                              &providerConfig,
                              WDF_NO_OBJECT_ATTRIBUTES,
                              &provider
                              );

if (!NT_SUCCESS(status)) {
    return status;
}
WDF_WMI_INSTANCE_CONFIG_INIT_PROVIDER(
                                      &instanceConfig,
                                      provider
                                      );
status = WdfWmiInstanceCreate(
                              Device,
                              &instanceConfig,
                              WDF_NO_OBJECT_ATTRIBUTES,
                              &instanceHandle
                              );
if (!NT_SUCCESS(status)) {
    return status;
}

See also

WDF_WMI_INSTANCE_CONFIG

WDF_WMI_INSTANCE_CONFIG_INIT_PROVIDER_CONFIG

WDF_WMI_PROVIDER_CONFIG

WDF_WMI_PROVIDER_CONFIG_INIT

WdfWmiInstanceCreate

WdfWmiProviderCreate