COM.h
1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#pragma once
#include "il2cpp-class-internals.h"
#include "il2cpp-vm-support.h"
#include "os/COM.h"
#include "vm/Exception.h"
struct Il2CppGuid;
struct Il2CppSafeArrayBound;
struct Il2CppSafeArray;
struct Il2CppIUnknown;
namespace il2cpp
{
namespace vm
{
class LIBIL2CPP_CODEGEN_API COM
{
public:
static inline void CreateInstance(const Il2CppGuid& clsid, Il2CppIUnknown** object)
{
const il2cpp_hresult_t hr = os::COM::CreateInstance(clsid, object);
IL2CPP_VM_RAISE_IF_FAILED(hr, true);
}
static inline il2cpp_hresult_t CreateFreeThreadedMarshaler(Il2CppIUnknown* outer, Il2CppIUnknown** marshal)
{
return os::COM::CreateFreeThreadedMarshaler(outer, marshal);
}
static void MarshalVariant(Il2CppObject* obj, Il2CppVariant* variant);
static Il2CppObject* MarshalVariantResult(const Il2CppVariant* variant);
static void DestroyVariant(Il2CppVariant* variant);
static Il2CppSafeArray* MarshalSafeArray(uint16_t variantType, Il2CppArray* managedArray);
static Il2CppArray* MarshalSafeArrayResult(uint16_t variantType, Il2CppClass* type, Il2CppSafeArray* safeArray);
static Il2CppSafeArray* MarshalSafeArrayBString(Il2CppArray* managedArray);
static Il2CppArray* MarshalSafeArrayBStringResult(Il2CppClass* type, Il2CppSafeArray* safeArray);
static inline void DestroySafeArray(Il2CppSafeArray* safeArray)
{
const il2cpp_hresult_t hr = os::COM::SafeArrayDestroy(safeArray);
IL2CPP_VM_RAISE_IF_FAILED(hr, true);
}
};
} /* namespace vm */
} /* namespace il2cpp */