From a3acd6bda5a73782008313cd562ef484fe72e1ce Mon Sep 17 00:00:00 2001 From: Adam Honse Date: Tue, 15 Jul 2025 00:07:53 -0500 Subject: [PATCH] Fix XPG S40G infinite loop on Windows 11 --- .../ENESMBusInterface_SpectrixS40G_Windows.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Controllers/ENESMBusController/ENESMBusInterface/ENESMBusInterface_SpectrixS40G_Windows.cpp b/Controllers/ENESMBusController/ENESMBusInterface/ENESMBusInterface_SpectrixS40G_Windows.cpp index ec4e5d42..35b1cf0b 100644 --- a/Controllers/ENESMBusController/ENESMBusInterface/ENESMBusInterface_SpectrixS40G_Windows.cpp +++ b/Controllers/ENESMBusController/ENESMBusInterface/ENESMBusInterface_SpectrixS40G_Windows.cpp @@ -103,10 +103,7 @@ unsigned char ENESMBusInterface_SpectrixS40G::ENERegisterRead(ene_dev_id dev, en | Send the STORAGE_PROTOCOL_COMMAND to the device | \*-----------------------------------------------------------------------------*/ DWORD bytesreturned = 0; - while(bytesreturned != sizeof(buffer)) - { - DeviceIoControl(nvme_fd, IOCTL_STORAGE_PROTOCOL_COMMAND, buffer, sizeof(buffer), buffer, sizeof(buffer), &bytesreturned, (LPOVERLAPPED)0x0); - } + DeviceIoControl(nvme_fd, IOCTL_STORAGE_PROTOCOL_COMMAND, buffer, sizeof(buffer), buffer, sizeof(buffer), &bytesreturned, (LPOVERLAPPED)0x0); /*-----------------------------------------------------------------------------*\ | Copy the ENE Register Write extra data into the STORAGE_PROTOCOL_COMMAND |