MCPcopy Create free account
hub / github.com/CloverHackyColor/CloverBootloader / CompareGuid

Function CompareGuid

MdePkg/Library/PeiMemoryLib/MemLibGuid.c:71–89  ·  view source on GitHub ↗

Compares two GUIDs. This function compares Guid1 to Guid2. If the GUIDs are identical then TRUE is returned. If there are any bit differences in the two GUIDs, then FALSE is returned. If Guid1 is NULL, then ASSERT(). If Guid2 is NULL, then ASSERT(). @param Guid1 A pointer to a 128 bit GUID. @param Guid2 A pointer to a 128 bit GUID. @retval TRUE Gu

Source from the content-addressed store, hash-verified

69
70**/
71BOOLEAN
72EFIAPI
73CompareGuid (
74 IN CONST GUID *Guid1,
75 IN CONST GUID *Guid2
76 )
77{
78 UINT64 LowPartOfGuid1;
79 UINT64 LowPartOfGuid2;
80 UINT64 HighPartOfGuid1;
81 UINT64 HighPartOfGuid2;
82
83 LowPartOfGuid1 = ReadUnaligned64 ((CONST UINT64*) Guid1);
84 LowPartOfGuid2 = ReadUnaligned64 ((CONST UINT64*) Guid2);
85 HighPartOfGuid1 = ReadUnaligned64 ((CONST UINT64*) Guid1 + 1);
86 HighPartOfGuid2 = ReadUnaligned64 ((CONST UINT64*) Guid2 + 1);
87
88 return (BOOLEAN) (LowPartOfGuid1 == LowPartOfGuid2 && HighPartOfGuid1 == HighPartOfGuid2);
89}
90
91/**
92 Scans a target buffer for a GUID, and returns a pointer to the matching GUID

Callers 15

MemLibGuid.cFile · 0.70
HobLib.cFile · 0.50
HobLib.cFile · 0.50
HobLib.cFile · 0.50
PeiServicesLib.cFile · 0.50

Calls 1

ReadUnaligned64Function · 0.50

Tested by

no test coverage detected