| 1 | /*
|
|---|
| 2 | * Copyright (C) 2000 Alexandre Julliard
|
|---|
| 3 | *
|
|---|
| 4 | * This library is free software; you can redistribute it and/or
|
|---|
| 5 | * modify it under the terms of the GNU Lesser General Public
|
|---|
| 6 | * License as published by the Free Software Foundation; either
|
|---|
| 7 | * version 2.1 of the License, or (at your option) any later version.
|
|---|
| 8 | *
|
|---|
| 9 | * This library is distributed in the hope that it will be useful,
|
|---|
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|---|
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|---|
| 12 | * Lesser General Public License for more details.
|
|---|
| 13 | *
|
|---|
| 14 | * You should have received a copy of the GNU Lesser General Public
|
|---|
| 15 | * License along with this library; if not, write to the Free Software
|
|---|
| 16 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|---|
| 17 | */
|
|---|
| 18 |
|
|---|
| 19 | #ifndef _GUIDDEF_H_
|
|---|
| 20 | #define _GUIDDEF_H_
|
|---|
| 21 |
|
|---|
| 22 | #ifndef GUID_DEFINED
|
|---|
| 23 | #define GUID_DEFINED
|
|---|
| 24 | typedef struct _GUID
|
|---|
| 25 | {
|
|---|
| 26 | unsigned long Data1;
|
|---|
| 27 | unsigned short Data2;
|
|---|
| 28 | unsigned short Data3;
|
|---|
| 29 | unsigned char Data4[ 8 ];
|
|---|
| 30 | } GUID;
|
|---|
| 31 | #endif
|
|---|
| 32 |
|
|---|
| 33 | #ifndef __LPCGUID_DEFINED__
|
|---|
| 34 | #define __LPCGUID_DEFINED__
|
|---|
| 35 | typedef const GUID *LPCGUID;
|
|---|
| 36 | #endif
|
|---|
| 37 |
|
|---|
| 38 | #undef DEFINE_GUID
|
|---|
| 39 |
|
|---|
| 40 | #ifdef INITGUID
|
|---|
| 41 | #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
|
|---|
| 42 | extern const GUID name = \
|
|---|
| 43 | { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }
|
|---|
| 44 | #else
|
|---|
| 45 | #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
|
|---|
| 46 | extern const GUID name
|
|---|
| 47 | #endif
|
|---|
| 48 |
|
|---|
| 49 | #define DEFINE_OLEGUID(name, l, w1, w2) DEFINE_GUID(name, l, w1, w2, 0xC0,0,0,0,0,0,0,0x46)
|
|---|
| 50 |
|
|---|
| 51 | #ifndef __LPGUID_DEFINED__
|
|---|
| 52 | #define __LPGUID_DEFINED__
|
|---|
| 53 | typedef GUID *LPGUID;
|
|---|
| 54 | typedef GUID CLSID,*LPCLSID;
|
|---|
| 55 | #endif
|
|---|
| 56 |
|
|---|
| 57 | #ifndef __IID_DEFINED__
|
|---|
| 58 | #define __IID_DEFINED__
|
|---|
| 59 | typedef GUID IID,*LPIID;
|
|---|
| 60 | #endif /* ndef __IID_DEFINED__ */
|
|---|
| 61 | typedef GUID FMTID,*LPFMTID;
|
|---|
| 62 |
|
|---|
| 63 | #ifdef __midl_proxy
|
|---|
| 64 | #define __MIDL_CONST
|
|---|
| 65 | #else
|
|---|
| 66 | #define __MIDL_CONST const
|
|---|
| 67 | #endif
|
|---|
| 68 |
|
|---|
| 69 | #if defined(__cplusplus) && !defined(CINTERFACE)
|
|---|
| 70 | #define REFGUID const GUID &
|
|---|
| 71 | #define REFCLSID const CLSID &
|
|---|
| 72 | #define REFIID const IID &
|
|---|
| 73 | #define REFFMTID const FMTID &
|
|---|
| 74 | #else /* !defined(__cplusplus) && !defined(CINTERFACE) */
|
|---|
| 75 | #define REFGUID const GUID* __MIDL_CONST
|
|---|
| 76 | #define REFCLSID const CLSID* __MIDL_CONST
|
|---|
| 77 | #define REFIID const IID* __MIDL_CONST
|
|---|
| 78 | #define REFFMTID const FMTID* __MIDL_CONST
|
|---|
| 79 | #endif /* !defined(__cplusplus) && !defined(CINTERFACE) */
|
|---|
| 80 |
|
|---|
| 81 | #if defined(__cplusplus) && !defined(CINTERFACE)
|
|---|
| 82 | #define IsEqualGUID(rguid1, rguid2) (!memcmp(&(rguid1), &(rguid2), sizeof(GUID)))
|
|---|
| 83 | #else /* defined(__cplusplus) && !defined(CINTERFACE) */
|
|---|
| 84 | #define IsEqualGUID(rguid1, rguid2) (!memcmp(rguid1, rguid2, sizeof(GUID)))
|
|---|
| 85 | #endif /* defined(__cplusplus) && !defined(CINTERFACE) */
|
|---|
| 86 | #define IsEqualIID(riid1, riid2) IsEqualGUID(riid1, riid2)
|
|---|
| 87 | #define IsEqualCLSID(rclsid1, rclsid2) IsEqualGUID(rclsid1, rclsid2)
|
|---|
| 88 |
|
|---|
| 89 | #if defined(__cplusplus) && !defined(CINTERFACE)
|
|---|
| 90 | #include <string.h>
|
|---|
| 91 | inline BOOL operator==(const GUID& guidOne, const GUID& guidOther)
|
|---|
| 92 | {
|
|---|
| 93 | return !memcmp(&guidOne,&guidOther,sizeof(GUID));
|
|---|
| 94 | }
|
|---|
| 95 | inline BOOL operator!=(const GUID& guidOne, const GUID& guidOther)
|
|---|
| 96 | {
|
|---|
| 97 | return !(guidOne == guidOther);
|
|---|
| 98 | }
|
|---|
| 99 | #endif
|
|---|
| 100 |
|
|---|
| 101 | extern const IID GUID_NULL;
|
|---|
| 102 |
|
|---|
| 103 | #define IID_NULL GUID_NULL
|
|---|
| 104 | #define CLSID_NULL GUID_NULL
|
|---|
| 105 | #define FMTID_NULL GUID_NULL
|
|---|
| 106 |
|
|---|
| 107 | #endif /* _GUIDDEF_H_ */
|
|---|