2005-04-15 20:17:14 +00:00
|
|
|
/*
|
2006-06-22 13:34:00 +00:00
|
|
|
* Modified for use with MPlayer, detailed changelog at
|
|
|
|
* http://svn.mplayerhq.hu/mplayer/trunk/
|
2005-04-15 20:17:14 +00:00
|
|
|
*/
|
|
|
|
|
2008-02-23 14:50:55 +00:00
|
|
|
#ifndef MPLAYER_COM_H
|
|
|
|
#define MPLAYER_COM_H
|
2001-08-16 00:44:40 +00:00
|
|
|
|
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.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
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
|
|
|
|
{
|
2008-01-20 17:16:39 +00:00
|
|
|
long STDCALL (*QueryInterface)(struct IUnknown* this, const GUID* iid, void** ppv);
|
|
|
|
long STDCALL (*AddRef)(struct IUnknown* this) ;
|
|
|
|
long STDCALL (*Release)(struct IUnknown* this) ;
|
2001-02-24 20:28:24 +00:00
|
|
|
} ;
|
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
|
|
|
|
{
|
2008-01-20 17:16:39 +00:00
|
|
|
long STDCALL (*QueryInterface)(struct IUnknown* this, const 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, const GUID* riid, void** ppvObject);
|
2001-02-24 20:28:24 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct IClassFactory
|
|
|
|
{
|
|
|
|
struct IClassFactory_vt* vt;
|
|
|
|
};
|
|
|
|
|
2009-05-13 02:58:57 +00:00
|
|
|
#ifdef WIN32_LOADER
|
2001-02-24 20:28:24 +00:00
|
|
|
long CoCreateInstance(GUID* rclsid, struct IUnknown* pUnkOuter,
|
2007-02-23 09:58:01 +00:00
|
|
|
long dwClsContext, const GUID* riid, void** ppv);
|
|
|
|
void* CoTaskMemAlloc(unsigned long cb);
|
|
|
|
void CoTaskMemFree(void* cb);
|
|
|
|
#else
|
|
|
|
long STDCALL CoCreateInstance(GUID* rclsid, struct IUnknown* pUnkOuter,
|
2002-09-13 19:43:17 +00:00
|
|
|
long dwClsContext, const GUID* riid, void** ppv);
|
2007-02-23 09:58:01 +00:00
|
|
|
void* STDCALL CoTaskMemAlloc(unsigned long);
|
|
|
|
void STDCALL CoTaskMemFree(void*);
|
|
|
|
#endif
|
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
|
|
|
|
2008-02-23 14:50:55 +00:00
|
|
|
#endif /* MPLAYER_COM_H */
|