2001-08-16 00:44:40 +00:00
|
|
|
#ifndef AVIFILE_COM_H
|
|
|
|
#define AVIFILE_COM_H
|
|
|
|
|
|
|
|
#include <inttypes.h>
|
|
|
|
|
2001-02-24 20:28:24 +00:00
|
|
|
/**
|
|
|
|
* Internal functions and structures for COM emulation code.
|
|
|
|
*/
|
|
|
|
|
2001-08-16 00:44:40 +00:00
|
|
|
#ifndef WIN32
|
2001-02-24 20:28:24 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
void* CoTaskMemAlloc(unsigned long cb);
|
|
|
|
void CoTaskMemFree(void* cb);
|
|
|
|
|
2001-08-16 00:44:40 +00:00
|
|
|
#ifndef GUID_TYPE
|
|
|
|
#define GUID_TYPE
|
2001-02-24 20:28:24 +00:00
|
|
|
typedef struct
|
|
|
|
{
|
2001-08-16 00:44:40 +00:00
|
|
|
uint32_t f1;
|
|
|
|
uint16_t f2;
|
|
|
|
uint16_t f3;
|
|
|
|
uint8_t f4[8];
|
2001-02-24 20:28:24 +00:00
|
|
|
} GUID;
|
2001-08-16 00:44:40 +00:00
|
|
|
#endif
|
2001-02-24 20:28:24 +00:00
|
|
|
|
|
|
|
extern GUID IID_IUnknown;
|
|
|
|
extern GUID IID_IClassFactory;
|
|
|
|
|
|
|
|
typedef long (*GETCLASSOBJECT) (GUID* clsid, GUID* iid, void** ppv);
|
|
|
|
int RegisterComClass(GUID* clsid, GETCLASSOBJECT gcs);
|
2001-08-16 00:44:40 +00:00
|
|
|
int UnregisterComClass(GUID* clsid, GETCLASSOBJECT gcs);
|
2001-02-24 20:28:24 +00:00
|
|
|
|
|
|
|
#ifndef STDCALL
|
2001-08-16 00:44:40 +00:00
|
|
|
#define STDCALL __attribute__((__stdcall__))
|
2001-02-24 20:28:24 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
struct IUnknown;
|
|
|
|
struct IClassFactory;
|
|
|
|
struct IUnknown_vt
|
|
|
|
{
|
|
|
|
long STDCALL (*QueryInterface)(struct IUnknown* _this, GUID* iid, void** ppv);
|
|
|
|
long STDCALL (*AddRef)(struct IUnknown* _this) ;
|
|
|
|
long STDCALL (*Release)(struct IUnknown* _this) ;
|
|
|
|
} ;
|
2001-11-26 00:47:58 +00:00
|
|
|
|
|
|
|
typedef struct IUnknown
|
2001-02-24 20:28:24 +00:00
|
|
|
{
|
|
|
|
struct IUnknown_vt* vt;
|
2001-11-26 00:47:58 +00:00
|
|
|
} IUnknown;
|
2001-02-24 20:28:24 +00:00
|
|
|
|
|
|
|
struct IClassFactory_vt
|
|
|
|
{
|
|
|
|
long STDCALL (*QueryInterface)(struct IUnknown* _this, GUID* iid, void** ppv);
|
|
|
|
long STDCALL (*AddRef)(struct IUnknown* _this) ;
|
|
|
|
long STDCALL (*Release)(struct IUnknown* _this) ;
|
|
|
|
long STDCALL (*CreateInstance)(struct IClassFactory* _this, struct IUnknown* pUnkOuter, GUID* riid, void** ppvObject);
|
|
|
|
};
|
|
|
|
|
|
|
|
struct IClassFactory
|
|
|
|
{
|
|
|
|
struct IClassFactory_vt* vt;
|
|
|
|
};
|
|
|
|
|
|
|
|
long CoCreateInstance(GUID* rclsid, struct IUnknown* pUnkOuter,
|
2001-08-16 00:44:40 +00:00
|
|
|
long dwClsContext, GUID* riid, void** ppv);
|
2001-02-24 20:28:24 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
};
|
2001-08-16 00:44:40 +00:00
|
|
|
#endif /* __cplusplus */
|
2001-02-24 20:28:24 +00:00
|
|
|
|
2001-08-16 00:44:40 +00:00
|
|
|
#endif /* WIN32 */
|
2001-04-07 16:59:51 +00:00
|
|
|
|
2001-08-16 00:44:40 +00:00
|
|
|
#endif /* AVIFILE_COM_H */
|