' guiddef.ab

Type GUID
	Data1 As DWord
	Data2 As Word
	Data3 As Word
	Data4[7] As Byte
End Type

Dim GUID_NULL = [0, 0, 0, [0, 0, 0, 0, 0, 0, 0, 0]] As GUID

TypeDef IID = GUID
TypeDef CLSID = GUID
TypeDef FMTID = GUID

'Dim IID_NULL = GUID_NULL
'Dim CLSID_NULL = GUID_NULL
'Dim FMTID_NULL = GUID_NULL

Function IsEqualGUID(ByRef x As GUID, ByRef y As GUID) As BOOL
	IsEqualGUID = (memcmp(VarPtr(x), VarPtr(y), SizeOf (GUID)) = 0)
End Function

Function IsEqualIID(ByRef x As IID, ByRef y As IID) As BOOL
	IsEqualIID = (memcmp(VarPtr(x), VarPtr(y), SizeOf (IID)) = 0)
End Function

Function IsEqualCLSID(ByRef x As CLSID, ByRef y As CLSID) As BOOL
	IsEqualCLSID = (memcmp(VarPtr(x), VarPtr(y), SizeOf (CLSID)) = 0)
End Function

#ifndef _SYS_GUID_OPERATOR_EQ_
#ifdef _NO_SYS_GUID_OPERATOR_EQ_
#define _SYS_GUID_OPERATOR_EQ_
/*
Function Operator ==(ByRef x As GUID, ByRef y As GUID) As Boolean
	Return IsEqualGUID(x, y) <> FALSE
End Function

Function Operator <>(ByRef x As GUID, ByRef y As GUID) As Boolean
	Return IsEqualGUID(x, y) = FALSE
End Function
*/
#endif
#endif
