2 ** Copyright (c) 2009 Blackmagic Design
4 ** Permission is hereby granted, free of charge, to any person or organization
5 ** obtaining a copy of the software and accompanying documentation covered by
6 ** this license (the "Software") to use, reproduce, display, distribute,
7 ** execute, and transmit the Software, and to prepare derivative works of the
8 ** Software, and to permit third-parties to whom the Software is furnished to
9 ** do so, all subject to the following:
11 ** The copyright notices in the Software and this entire statement, including
12 ** the above license grant, this restriction and the following disclaimer,
13 ** must be included in all copies of the Software, in whole or in part, and
14 ** all derivative works of the Software, unless such copies or derivative
15 ** works are solely in the form of machine-executable object code generated by
16 ** a source language processor.
18 ** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 ** IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 ** FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
21 ** SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
22 ** FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
23 ** ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
24 ** DEALINGS IN THE SOFTWARE.
28 #ifndef __LINUX_COM_H_
29 #define __LINUX_COM_H_
51 typedef REFIID CFUUIDBytes;
52 #define CFUUIDGetUUIDBytes(x) x
55 typedef unsigned long ULONG;
58 #define SUCCEEDED(Status) ((HRESULT)(Status) >= 0)
59 #define FAILED(Status) ((HRESULT)(Status)<0)
61 #define IS_ERROR(Status) ((unsigned long)(Status) >> 31 == SEVERITY_ERROR)
62 #define HRESULT_CODE(hr) ((hr) & 0xFFFF)
63 #define HRESULT_FACILITY(hr) (((hr) >> 16) & 0x1fff)
64 #define HRESULT_SEVERITY(hr) (((hr) >> 31) & 0x1)
65 #define SEVERITY_SUCCESS 0
66 #define SEVERITY_ERROR 1
68 #define MAKE_HRESULT(sev,fac,code) ((HRESULT) (((unsigned long)(sev)<<31) | ((unsigned long)(fac)<<16) | ((unsigned long)(code))) )
70 #define S_OK ((HRESULT)0x00000000L)
71 #define S_FALSE ((HRESULT)0x00000001L)
72 #define E_UNEXPECTED ((HRESULT)0x8000FFFFL)
73 #define E_NOTIMPL ((HRESULT)0x80000001L)
74 #define E_OUTOFMEMORY ((HRESULT)0x80000002L)
75 #define E_INVALIDARG ((HRESULT)0x80000003L)
76 #define E_NOINTERFACE ((HRESULT)0x80000004L)
77 #define E_POINTER ((HRESULT)0x80000005L)
78 #define E_HANDLE ((HRESULT)0x80000006L)
79 #define E_ABORT ((HRESULT)0x80000007L)
80 #define E_FAIL ((HRESULT)0x80000008L)
81 #define E_ACCESSDENIED ((HRESULT)0x80000009L)
83 #define STDMETHODCALLTYPE
85 #define IID_IUnknown (REFIID){0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46}
86 #define IUnknownUUID IID_IUnknown
92 virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID iid, LPVOID *ppv) = 0;
93 virtual ULONG STDMETHODCALLTYPE AddRef(void) = 0;
94 virtual ULONG STDMETHODCALLTYPE Release(void) = 0;