CoGetClassObject function Null safety ole32

int CoGetClassObject(
  1. Pointer<GUID> rclsid,
  2. int dwClsContext,
  3. Pointer<NativeType> pvReserved,
  4. Pointer<GUID> riid,
  5. Pointer<Pointer<NativeType>> ppv
)

Provides a pointer to an interface on a class object associated with a specified CLSID. CoGetClassObject locates, and if necessary, dynamically loads the executable code required to do this.

HRESULT CoGetClassObject(
  REFCLSID rclsid,
  DWORD    dwClsContext,
  LPVOID   pvReserved,
  REFIID   riid,
  LPVOID   *ppv
);

Implementation

int CoGetClassObject(Pointer<GUID> rclsid, int dwClsContext, Pointer pvReserved,
    Pointer<GUID> riid, Pointer<Pointer> ppv) {
  final _CoGetClassObject = _ole32.lookupFunction<
      Int32 Function(Pointer<GUID> rclsid, Uint32 dwClsContext,
          Pointer pvReserved, Pointer<GUID> riid, Pointer<Pointer> ppv),
      int Function(Pointer<GUID> rclsid, int dwClsContext, Pointer pvReserved,
          Pointer<GUID> riid, Pointer<Pointer> ppv)>('CoGetClassObject');
  return _CoGetClassObject(rclsid, dwClsContext, pvReserved, riid, ppv);
}