2001-08-16 00:44:40 +00:00
|
|
|
#ifndef AVIFILE_COM_H
|
|
|
|
#define AVIFILE_COM_H
|
|
|
|
|
2003-04-21 21:06:08 +00:00
|
|
|
#include "config.h"
|
|
|
|
|
2002-09-13 19:43:17 +00:00
|
|
|
#ifdef HAVE_STDINT_H
|
|
|
|
#include <stdint.h>
|
|
|
|
#else
|
2001-08-16 00:44:40 +00:00
|
|
|
#include <inttypes.h>
|
2002-09-13 19:43:17 +00:00
|
|
|
#endif
|
2001-08-16 00:44:40 +00:00
|
|
|
|
2001-02-24 20:28:24 +00:00
|
|
|
/**
|
|
|
|
* Internal functions and structures for COM emulation code.
|
|
|
|
*/
|
|
|
|
|
2003-04-24 18:48:30 +00:00
|
|
|
#if !defined(WIN32) || defined(__CYGWIN__) || defined(__MINGW32__)
|
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
|
|
|
|
2002-09-13 19:43:17 +00:00
|
|
|
extern const GUID IID_IUnknown;
|
|
|
|
extern const GUID IID_IClassFactory;
|
2001-02-24 20:28:24 +00:00
|
|
|
|
2002-09-13 19:43:17 +00:00
|
|
|
typedef long (*GETCLASSOBJECT) (GUID* clsid, const GUID* iid, void** ppv);
|
|
|
|
int RegisterComClass(const GUID* clsid, GETCLASSOBJECT gcs);
|
|
|
|
int UnregisterComClass(const 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
|
|
|
|
{
|
2002-09-13 19:43:17 +00:00
|
|
|
long STDCALL (*QueryInterface)(struct IUnknown* _this, const GUID* iid, void** ppv);
|
2001-02-24 20:28:24 +00:00
|
|
|
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
|
|
|
|
{
|
2002-09-13 19:43:17 +00:00
|
|
|
long STDCALL (*QueryInterface)(struct IUnknown* _this, const GUID* iid, void** ppv);
|
2001-02-24 20:28:24 +00:00
|
|
|
long STDCALL (*AddRef)(struct IUnknown* _this) ;
|
|
|
|
long STDCALL (*Release)(struct IUnknown* _this) ;
|
2002-09-13 19:43:17 +00:00
|
|
|
long STDCALL (*CreateInstance)(struct IClassFactory* _this, struct IUnknown* pUnkOuter, const GUID* riid, void** ppvObject);
|
2001-02-24 20:28:24 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct IClassFactory
|
|
|
|
{
|
|
|
|
struct IClassFactory_vt* vt;
|
|
|
|
};
|
|
|
|
|
|
|
|
long CoCreateInstance(GUID* rclsid, struct IUnknown* pUnkOuter,
|
2002-09-13 19:43:17 +00:00
|
|
|
long dwClsContext, const 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 */
|