1544
|
1 #ifndef AVIFILE_COM_H
|
|
2 #define AVIFILE_COM_H
|
|
3
|
|
4 #include <inttypes.h>
|
|
5
|
1
|
6 /**
|
|
7 * Internal functions and structures for COM emulation code.
|
|
8 */
|
|
9
|
1544
|
10 #ifndef WIN32
|
1
|
11
|
|
12 #ifdef __cplusplus
|
|
13 extern "C" {
|
|
14 #endif
|
|
15
|
|
16 void* CoTaskMemAlloc(unsigned long cb);
|
|
17 void CoTaskMemFree(void* cb);
|
|
18
|
1544
|
19 #ifndef GUID_TYPE
|
|
20 #define GUID_TYPE
|
1
|
21 typedef struct
|
|
22 {
|
1544
|
23 uint32_t f1;
|
|
24 uint16_t f2;
|
|
25 uint16_t f3;
|
|
26 uint8_t f4[8];
|
1
|
27 } GUID;
|
1544
|
28 #endif
|
1
|
29
|
|
30 extern GUID IID_IUnknown;
|
|
31 extern GUID IID_IClassFactory;
|
|
32
|
|
33 typedef long (*GETCLASSOBJECT) (GUID* clsid, GUID* iid, void** ppv);
|
|
34 int RegisterComClass(GUID* clsid, GETCLASSOBJECT gcs);
|
1544
|
35 int UnregisterComClass(GUID* clsid, GETCLASSOBJECT gcs);
|
1
|
36
|
|
37 #ifndef STDCALL
|
1544
|
38 #define STDCALL __attribute__((__stdcall__))
|
1
|
39 #endif
|
|
40
|
|
41 struct IUnknown;
|
|
42 struct IClassFactory;
|
|
43 struct IUnknown_vt
|
|
44 {
|
|
45 long STDCALL (*QueryInterface)(struct IUnknown* _this, GUID* iid, void** ppv);
|
|
46 long STDCALL (*AddRef)(struct IUnknown* _this) ;
|
|
47 long STDCALL (*Release)(struct IUnknown* _this) ;
|
|
48 } ;
|
|
49 struct IUnknown
|
|
50 {
|
|
51 struct IUnknown_vt* vt;
|
|
52 };
|
|
53
|
|
54 struct IClassFactory_vt
|
|
55 {
|
|
56 long STDCALL (*QueryInterface)(struct IUnknown* _this, GUID* iid, void** ppv);
|
|
57 long STDCALL (*AddRef)(struct IUnknown* _this) ;
|
|
58 long STDCALL (*Release)(struct IUnknown* _this) ;
|
|
59 long STDCALL (*CreateInstance)(struct IClassFactory* _this, struct IUnknown* pUnkOuter, GUID* riid, void** ppvObject);
|
|
60 };
|
|
61
|
|
62 struct IClassFactory
|
|
63 {
|
|
64 struct IClassFactory_vt* vt;
|
|
65 };
|
|
66
|
|
67 long CoCreateInstance(GUID* rclsid, struct IUnknown* pUnkOuter,
|
1544
|
68 long dwClsContext, GUID* riid, void** ppv);
|
1
|
69
|
|
70 #ifdef __cplusplus
|
|
71 };
|
1544
|
72 #endif /* __cplusplus */
|
1
|
73
|
1544
|
74 #endif /* WIN32 */
|
302
|
75
|
1544
|
76 #endif /* AVIFILE_COM_H */
|