Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygenguiddef.h
Go to the documentation of this file.
00001 /* 00002 * Copyright (C) 2000 Alexandre Julliard 00003 * 00004 * This library is free software; you can redistribute it and/or 00005 * modify it under the terms of the GNU Lesser General Public 00006 * License as published by the Free Software Foundation; either 00007 * version 2.1 of the License, or (at your option) any later version. 00008 * 00009 * This library is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 * Lesser General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU Lesser General Public 00015 * License along with this library; if not, write to the Free Software 00016 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA 00017 */ 00018 00019 #ifndef GUID_DEFINED 00020 #define GUID_DEFINED 00021 typedef struct _GUID 00022 { 00023 #ifdef _MSC_VER 00024 unsigned long Data1; 00025 #else 00026 unsigned int Data1; 00027 #endif 00028 unsigned short Data2; 00029 unsigned short Data3; 00030 unsigned char Data4[ 8 ]; 00031 } GUID; 00032 #endif 00033 00034 #ifndef DECLSPEC_SELECTANY 00035 #define DECLSPEC_SELECTANY __declspec(selectany) 00036 #endif 00037 00038 #ifndef EXTERN_C 00039 #ifdef __cplusplus 00040 #define EXTERN_C extern "C" 00041 #else 00042 #define EXTERN_C extern 00043 #endif 00044 #endif 00045 00046 #undef DEFINE_GUID 00047 00048 #ifdef INITGUID 00049 #ifdef __cplusplus 00050 #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ 00051 EXTERN_C const GUID DECLSPEC_SELECTANY name = \ 00052 { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } 00053 #else 00054 #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ 00055 const GUID DECLSPEC_SELECTANY name = \ 00056 { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } 00057 #endif 00058 #else 00059 #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ 00060 EXTERN_C const GUID name 00061 #endif 00062 00063 #define DEFINE_OLEGUID(name, l, w1, w2) \ 00064 DEFINE_GUID(name, l, w1, w2, 0xC0,0,0,0,0,0,0,0x46) 00065 00066 #ifndef _GUIDDEF_H_ 00067 #define _GUIDDEF_H_ 00068 00069 #ifndef __LPGUID_DEFINED__ 00070 #define __LPGUID_DEFINED__ 00071 typedef GUID *LPGUID; 00072 #endif 00073 00074 #ifndef __LPCGUID_DEFINED__ 00075 #define __LPCGUID_DEFINED__ 00076 typedef const GUID *LPCGUID; 00077 #endif 00078 00079 #ifndef __IID_DEFINED__ 00080 #define __IID_DEFINED__ 00081 00082 typedef GUID IID,*LPIID; 00083 typedef GUID CLSID,*LPCLSID; 00084 typedef GUID FMTID,*LPFMTID; 00085 #define IsEqualIID(riid1, riid2) IsEqualGUID(riid1, riid2) 00086 #define IsEqualCLSID(rclsid1, rclsid2) IsEqualGUID(rclsid1, rclsid2) 00087 #define IsEqualFMTID(rfmtid1, rfmtid2) IsEqualGUID(rfmtid1, rfmtid2) 00088 #define IID_NULL GUID_NULL 00089 #define CLSID_NULL GUID_NULL 00090 #define FMTID_NULL GUID_NULL 00091 00092 #ifdef __midl_proxy 00093 #define __MIDL_CONST 00094 #else 00095 #define __MIDL_CONST const 00096 #endif 00097 00098 #endif /* ndef __IID_DEFINED__ */ 00099 00100 #if defined(__cplusplus) && !defined(CINTERFACE) 00101 #define REFGUID const GUID & 00102 #define REFCLSID const CLSID & 00103 #define REFIID const IID & 00104 #define REFFMTID const FMTID & 00105 #else /* !defined(__cplusplus) && !defined(CINTERFACE) */ 00106 #define REFGUID const GUID* __MIDL_CONST 00107 #define REFCLSID const CLSID* __MIDL_CONST 00108 #define REFIID const IID* __MIDL_CONST 00109 #define REFFMTID const FMTID* __MIDL_CONST 00110 #endif /* !defined(__cplusplus) && !defined(CINTERFACE) */ 00111 00112 #if defined(__cplusplus) && !defined(CINTERFACE) 00113 00114 __inline int InlineIsEqualGUID(REFGUID rguid1, REFGUID rguid2) 00115 { 00116 return ( 00117 ((unsigned long *) &rguid1)[0] == ((unsigned long *) &rguid2)[0] && 00118 ((unsigned long *) &rguid1)[1] == ((unsigned long *) &rguid2)[1] && 00119 ((unsigned long *) &rguid1)[2] == ((unsigned long *) &rguid2)[2] && 00120 ((unsigned long *) &rguid1)[3] == ((unsigned long *) &rguid2)[3]); 00121 } 00122 00123 #define IsEqualGUID(rguid1, rguid2) (!memcmp(&(rguid1), &(rguid2), sizeof(GUID))) 00124 #else /* defined(__cplusplus) && !defined(CINTERFACE) */ 00125 #define IsEqualGUID(rguid1, rguid2) (!memcmp(rguid1, rguid2, sizeof(GUID))) 00126 #endif /* defined(__cplusplus) && !defined(CINTERFACE) */ 00127 00128 #if defined(__cplusplus) && !defined(CINTERFACE) 00129 #include <string.h> 00130 #if !defined _SYS_GUID_OPERATOR_EQ_ && !defined _NO_SYS_GUID_OPERATOR_EQ_ 00131 #define _SYS_GUID_OPERATOR_EQ_ 00132 inline bool operator==(const GUID& guidOne, const GUID& guidOther) 00133 { 00134 return !memcmp(&guidOne,&guidOther,sizeof(GUID)); 00135 } 00136 inline bool operator!=(const GUID& guidOne, const GUID& guidOther) 00137 { 00138 return !(guidOne == guidOther); 00139 } 00140 #endif 00141 #endif 00142 00143 #endif /* _GUIDDEF_H_ */ Generated on Sat May 26 2012 04:29:25 for ReactOS by
1.7.6.1
|