- Correct implementation of HUSKEY internals, including functions:
[wine] / include / guiddef.h
1 #ifndef GUID_DEFINED
2 #define GUID_DEFINED
3 typedef struct _GUID
4 {
5     unsigned long  Data1;
6     unsigned short Data2;
7     unsigned short Data3;
8     unsigned char  Data4[ 8 ];
9 } GUID;
10 #endif
11
12 #undef DEFINE_GUID
13
14 #ifdef INITGUID
15 #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
16         const GUID name = \
17         { l, w1, w2, { b1, b2,  b3,  b4,  b5,  b6,  b7,  b8 } }
18 #else
19 #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
20     extern const GUID name
21 #endif
22
23 #define DEFINE_OLEGUID(name, l, w1, w2) \
24         DEFINE_GUID(name, l, w1, w2, 0xC0,0,0,0,0,0,0,0x46)
25
26 #ifndef _GUIDDEF_H_
27 #define _GUIDDEF_H_
28
29 typedef GUID *LPGUID;
30 typedef GUID CLSID,*LPCLSID;
31 typedef GUID IID,*LPIID;
32 typedef GUID FMTID,*LPFMTID;
33
34 #if defined(__cplusplus) && !defined(CINTERFACE)
35 #define REFGUID             const GUID &
36 #define REFCLSID            const CLSID &
37 #define REFIID              const IID &
38 #define REFFMTID            const FMTID &
39 #else /* !defined(__cplusplus) && !defined(CINTERFACE) */
40 #define REFGUID             const GUID* const
41 #define REFCLSID            const CLSID* const
42 #define REFIID              const IID* const
43 #define REFFMTID            const FMTID* const
44 #endif /* !defined(__cplusplus) && !defined(CINTERFACE) */
45
46 #if defined(__cplusplus) && !defined(CINTERFACE)
47 #define IsEqualGUID(rguid1, rguid2) (!memcmp(&(rguid1), &(rguid2), sizeof(GUID)))
48 #else /* defined(__cplusplus) && !defined(CINTERFACE) */
49 #define IsEqualGUID(rguid1, rguid2) (!memcmp(rguid1, rguid2, sizeof(GUID)))
50 #endif /* defined(__cplusplus) && !defined(CINTERFACE) */
51 #define IsEqualIID(riid1, riid2) IsEqualGUID(riid1, riid2)
52 #define IsEqualCLSID(rclsid1, rclsid2) IsEqualGUID(rclsid1, rclsid2)
53
54 #if defined(__cplusplus) && !defined(CINTERFACE)
55 #include <string.h>
56 inline bool operator==(const GUID& guidOne, const GUID& guidOther)
57 {
58     return !memcmp(&guidOne,&guidOther,sizeof(GUID));
59 }
60 inline bool operator!=(const GUID& guidOne, const GUID& guidOther)
61 {
62     return !(guidOne == guidOther);
63 }
64 #endif 
65
66 extern const IID GUID_NULL;
67 #define IID_NULL            GUID_NULL
68 #define CLSID_NULL GUID_NULL
69 #define FMTID_NULL          GUID_NULL
70    
71 #endif /* _GUIDDEF_H_ */