From 4ba408424ca4a99c0ac4bf8c6192efb577d2bcab Mon Sep 17 00:00:00 2001 From: SergeySlice Date: Sat, 30 Apr 2022 15:39:36 +0300 Subject: [PATCH] dont define copy constructor Signed-off-by: SergeySlice --- rEFIt_UEFI/Platform/Hibernate.cpp | 14 +++++++++----- rEFIt_UEFI/include/Guid++.h | 6 +++--- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/rEFIt_UEFI/Platform/Hibernate.cpp b/rEFIt_UEFI/Platform/Hibernate.cpp index cf9787713..2459efc0c 100644 --- a/rEFIt_UEFI/Platform/Hibernate.cpp +++ b/rEFIt_UEFI/Platform/Hibernate.cpp @@ -717,7 +717,7 @@ IsOsxHibernated (IN LOADER_ENTRY *Entry) UINTN Size = 0; UINT8 *Data = NULL; REFIT_VOLUME *Volume = Entry->Volume; - EFI_GUID BootGUID; + EFI_GUID *BootGUID; XBool ret = false; UINT8 *Value = NULL; @@ -849,21 +849,25 @@ IsOsxHibernated (IN LOADER_ENTRY *Entry) VolumeUUID = APFSPartitionUUIDExtract(Volume->DevicePath); if ( VolumeUUID.notNull() ) { //BootGUID = (EFI_GUID*)(Data + Size - 0x14); - BootGUID = *(EFI_GUID*)ScanGuid(Data, Size, &VolumeUUID); + BootGUID = (EFI_GUID*)ScanGuid(Data, Size, &VolumeUUID); //DBG(" APFS Boot0082 points to UUID:%s\n", BootGUID.toXString8().c_str()); } else { //BootGUID = (EFI_GUID*)(Data + Size - 0x16); VolumeUUID = FindGPTPartitionGuidInDevicePath(Volume->DevicePath); if ( VolumeUUID.notNull() ) { - BootGUID = *(EFI_GUID*)ScanGuid(Data, Size, &VolumeUUID); + BootGUID = (EFI_GUID*)ScanGuid(Data, Size, &VolumeUUID); //DBG(" Boot0082 points to UUID:%s\n", BootGUID.toXString8().c_str()); } } //DBG(" Volume has PartUUID=%s\n", VolumeUUID.toXString8().c_str()); - if (BootGUID.notNull() && VolumeUUID.notNull() && BootGUID != VolumeUUID ) { + if (BootGUID != NULL && VolumeUUID.notNull() && *BootGUID != VolumeUUID ) { ret = false; } else { - DBG(" Boot0082 points to Volume with UUID:%s\n", BootGUID.toXString8().c_str()); + if (BootGUID == NULL) { + DBG(" Boot0082 points to Volume with null UUID\n"); + } else { + DBG(" Boot0082 points to Volume with UUID:%s\n", BootGUID->toXString8().c_str()); + } //3. Checks for boot-image exists if (gSettings.Boot.StrictHibernate) { diff --git a/rEFIt_UEFI/include/Guid++.h b/rEFIt_UEFI/include/Guid++.h index 23d5d31d6..23aa18c8a 100644 --- a/rEFIt_UEFI/include/Guid++.h +++ b/rEFIt_UEFI/include/Guid++.h @@ -58,7 +58,7 @@ public: constexpr GUID() : Data1(0), Data2(0), Data3(0), Data4{0,0,0,0,0,0,0,0} {} - constexpr GUID(const GUID& other) : GUID{other.Data1, other.Data2, other.Data3, {other.Data4[0], other.Data4[1], other.Data4[2], other.Data4[3], other.Data4[4], other.Data4[5], other.Data4[6], other.Data4[7]}} { } +// constexpr GUID(const GUID& other) : GUID{other.Data1, other.Data2, other.Data3, {other.Data4[0], other.Data4[1], other.Data4[2], other.Data4[3], other.Data4[4], other.Data4[5], other.Data4[6], other.Data4[7]}} { } constexpr GUID(UINT32 _data1, UINT16 _data2, UINT16 _data3, const GUID_Data4& _data4) : Data1(_data1), Data2(_data2), Data3(_data3), Data4{_data4.i0, _data4.i1, _data4.i2, _data4.i3, _data4.i4, _data4.i5, _data4.i6, _data4.i7} { } constexpr bool operator == (const GUID& other) const { @@ -66,8 +66,8 @@ public: } constexpr bool operator != (const GUID& other) const { return ! (*this == other); } -// void setNull() { *this = GUID(); } - void setNull() {Data1 = 0; Data2 = 0; Data3 = 0; memset( (void*)&Data4[0], 0, 8);} + void setNull() { *this = GUID(); } +// void setNull() {Data1 = 0; Data2 = 0; Data3 = 0; memset( (void*)&Data4[0], 0, 8);} constexpr bool isNull() const { return Data1 == 0 && Data2 == 0 && Data3 == 0 && Data4[0] == 0 && Data4[1] == 0 && Data4[2] == 0 && Data4[3] == 0 && Data4[4] == 0 && Data4[5] == 0 && Data4[6] == 0 && Data4[7] == 0; } constexpr bool notNull() const { return !isNull(); }