Freigeben über


Adapter_DllGetClassObject function

Retrieves an interface pointer that a provider can use to communicate with the specified class object. The interface exposes the DllGetClassObject function to the provider. The CoGetClassObject function locates, and if necessary, dynamically loads the executable code that is required by this operation.

[!Important]
This function is only used by generated code and should not be used by developers.

Syntax

STDAPI Adapter_DllGetClassObject(
  _In_  CLSID          supportedClassIds,
  _In_  MI_MainFuncPtr fpMain,
  _In_  REFCLSID       rclsid,
  _In_  REFIID         riid,
  _Out_ PVOID          *ppv
);

Parameters

supportedClassIds [in]

The CLSID that identifies the class object.

fpMain [in]

A pointer to the entry function that retrieves the class object.

rclsid [in]

The CLSID that identifies the class object.

riid [in]

A reference to the identifier of the interface that the provider is to use to communicate with the class object. Usually this value is set to IID_IClassFactory, which is defined in the OLE headers as the interface identifier for IClassFactory. However, the other interface identifiers defined in the OLE header files are also valid. The interface identifiers are defined in the OLE header files as IID_interfacename, where interfacename is the name of the interface.

ppv [out]

The address of the pointer variable that receives the interface pointer requested in the riid parameter. If this function returns successfully, the ppv parameter will contain the requested interface pointer.

Return value

This function returns one of the following values:

CO_E_APPDIDNTREG

The executable was launched, but it did not register the class object (and it may have shut down).

CO_E_APPNOTFOUND

The executable file was not found (CLSCTX_LOCAL_SERVER only).

CO_E_DLLNOTFOUND

Either the in-process DLL or handler DLL was not found.

CO_E_ERRORINDLL

There is an error in the executable image.

E_ACCESSDENIED

There was a general access failure on load.

E_NOINTERFACE

Either the object pointed to by ppv does not support the interface identified by riid, or the QueryInterface operation on the class object returned E_NOINTERFACE.

REGDB_E_CLASSNOTREG

The CLSID is not properly registered. This error can also indicate that the dwClsContext value specified in the CoCreateInstance or CoCreateInstanceEx function is not in the registry.

REGDB_E_READREGDB

There was an error reading the registration database.

S_OK

The location and connection to the specified class object was successful.

WBEM_E_INVALID_PARAMETER

The value for supportedClassId is not included in rclisid.

WBEM_E_NOT_SUPPORTED

The thread model of the DLL is registered as single-threaded apartment (STA), which is not supported by the MI framework.

WBEM_E_OUT_OF_MEMORY

There was not enough memory for the operation.

Requirements

Minimum supported client
Windows 8
Minimum supported server
Windows Server 2012
DLL
WmiToMi.dll

See also

Adapter Functions