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