File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -622,6 +622,7 @@ QByteArray qefi_get_variable(QUuid uuid, QString name)
622
622
LPCTSTR c_uuid = std_uuid.c_str ();
623
623
624
624
// Create a buffer
625
+ size_t skip = sizeof (TCHAR) / sizeof (quint8);
625
626
TCHAR buffer[EFIVAR_BUFFER_SIZE];
626
627
627
628
size_t length = read_efivar_win (c_name, c_uuid, (PVOID)buffer, EFIVAR_BUFFER_SIZE);
@@ -633,8 +634,11 @@ QByteArray qefi_get_variable(QUuid uuid, QString name)
633
634
}
634
635
else
635
636
{
636
- for (const auto &byte : buffer) {
637
- value.append (byte);
637
+ for (size_t i = 0 ; i < length / skip; i++) {
638
+ for (size_t j = 0 ; j < skip; j++) {
639
+ const quint8 byte = (quint8)((buffer[i] & (0xFF << (8 * j))) >> (8 * j));
640
+ value.append (byte);
641
+ }
638
642
}
639
643
}
640
644
You can’t perform that action at this time.
0 commit comments