Mercurial > mplayer.hg
annotate loader/com.h @ 24992:5701e23ebcb4
Better handling of win32 GUI thread:
1. Use _beginthreadex to create the GUI thread to avoid possible memory leak
when linked to MS CRT.
2. Terminate the GUI thread in an cleaner way using PostThreadMessage()
rather than the unrecommended TerminateThread().
author | zuxy |
---|---|
date | Sun, 11 Nov 2007 08:14:57 +0000 |
parents | 12afc06c044e |
children | 2c8cdb9123b8 |
rev | line source |
---|---|
15166
f5537cc95b02
Mark modified imported files as such to comply with GPL ¡ø2a.
diego
parents:
9978
diff
changeset
|
1 /* |
18783 | 2 * Modified for use with MPlayer, detailed changelog at |
3 * http://svn.mplayerhq.hu/mplayer/trunk/ | |
15166
f5537cc95b02
Mark modified imported files as such to comply with GPL ¡ø2a.
diego
parents:
9978
diff
changeset
|
4 * $Id$ |
f5537cc95b02
Mark modified imported files as such to comply with GPL ¡ø2a.
diego
parents:
9978
diff
changeset
|
5 */ |
f5537cc95b02
Mark modified imported files as such to comply with GPL ¡ø2a.
diego
parents:
9978
diff
changeset
|
6 |
1544 | 7 #ifndef AVIFILE_COM_H |
8 #define AVIFILE_COM_H | |
9 | |
9967
b0d1b415320c
cygwin support patch by Sascha Sommer and some fixes by me
alex
parents:
7386
diff
changeset
|
10 #include "config.h" |
b0d1b415320c
cygwin support patch by Sascha Sommer and some fixes by me
alex
parents:
7386
diff
changeset
|
11 |
7386 | 12 #ifdef HAVE_STDINT_H |
13 #include <stdint.h> | |
14 #else | |
1544 | 15 #include <inttypes.h> |
7386 | 16 #endif |
1544 | 17 |
1 | 18 /** |
19 * Internal functions and structures for COM emulation code. | |
20 */ | |
21 | |
9978 | 22 #if !defined(WIN32) || defined(__CYGWIN__) || defined(__MINGW32__) |
1 | 23 |
24 #ifdef __cplusplus | |
25 extern "C" { | |
26 #endif | |
27 | |
1544 | 28 #ifndef GUID_TYPE |
29 #define GUID_TYPE | |
1 | 30 typedef struct |
31 { | |
1544 | 32 uint32_t f1; |
33 uint16_t f2; | |
34 uint16_t f3; | |
35 uint8_t f4[8]; | |
1 | 36 } GUID; |
1544 | 37 #endif |
1 | 38 |
7386 | 39 extern const GUID IID_IUnknown; |
40 extern const GUID IID_IClassFactory; | |
1 | 41 |
7386 | 42 typedef long (*GETCLASSOBJECT) (GUID* clsid, const GUID* iid, void** ppv); |
43 int RegisterComClass(const GUID* clsid, GETCLASSOBJECT gcs); | |
44 int UnregisterComClass(const GUID* clsid, GETCLASSOBJECT gcs); | |
1 | 45 |
46 #ifndef STDCALL | |
1544 | 47 #define STDCALL __attribute__((__stdcall__)) |
1 | 48 #endif |
49 | |
50 struct IUnknown; | |
51 struct IClassFactory; | |
52 struct IUnknown_vt | |
53 { | |
7386 | 54 long STDCALL (*QueryInterface)(struct IUnknown* _this, const GUID* iid, void** ppv); |
1 | 55 long STDCALL (*AddRef)(struct IUnknown* _this) ; |
56 long STDCALL (*Release)(struct IUnknown* _this) ; | |
57 } ; | |
3128 | 58 |
59 typedef struct IUnknown | |
1 | 60 { |
61 struct IUnknown_vt* vt; | |
3128 | 62 } IUnknown; |
1 | 63 |
64 struct IClassFactory_vt | |
65 { | |
7386 | 66 long STDCALL (*QueryInterface)(struct IUnknown* _this, const GUID* iid, void** ppv); |
1 | 67 long STDCALL (*AddRef)(struct IUnknown* _this) ; |
68 long STDCALL (*Release)(struct IUnknown* _this) ; | |
7386 | 69 long STDCALL (*CreateInstance)(struct IClassFactory* _this, struct IUnknown* pUnkOuter, const GUID* riid, void** ppvObject); |
1 | 70 }; |
71 | |
72 struct IClassFactory | |
73 { | |
74 struct IClassFactory_vt* vt; | |
75 }; | |
76 | |
22325
12afc06c044e
Replace __MINGW32__ by more consistent WIN32_LOADER. This should fix compilation under
voroshil
parents:
22305
diff
changeset
|
77 #ifdef WIN32_LOADER |
1 | 78 long CoCreateInstance(GUID* rclsid, struct IUnknown* pUnkOuter, |
22305
3d1b23cf3d08
Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
voroshil
parents:
18783
diff
changeset
|
79 long dwClsContext, const GUID* riid, void** ppv); |
3d1b23cf3d08
Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
voroshil
parents:
18783
diff
changeset
|
80 void* CoTaskMemAlloc(unsigned long cb); |
3d1b23cf3d08
Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
voroshil
parents:
18783
diff
changeset
|
81 void CoTaskMemFree(void* cb); |
3d1b23cf3d08
Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
voroshil
parents:
18783
diff
changeset
|
82 #else |
3d1b23cf3d08
Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
voroshil
parents:
18783
diff
changeset
|
83 long STDCALL CoCreateInstance(GUID* rclsid, struct IUnknown* pUnkOuter, |
7386 | 84 long dwClsContext, const GUID* riid, void** ppv); |
22305
3d1b23cf3d08
Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
voroshil
parents:
18783
diff
changeset
|
85 void* STDCALL CoTaskMemAlloc(unsigned long); |
3d1b23cf3d08
Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
voroshil
parents:
18783
diff
changeset
|
86 void STDCALL CoTaskMemFree(void*); |
3d1b23cf3d08
Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
voroshil
parents:
18783
diff
changeset
|
87 #endif |
1 | 88 |
89 #ifdef __cplusplus | |
90 }; | |
1544 | 91 #endif /* __cplusplus */ |
1 | 92 |
1544 | 93 #endif /* WIN32 */ |
302 | 94 |
1544 | 95 #endif /* AVIFILE_COM_H */ |