diff --git a/Controllers/ENESMBusController/ENESMBusInterface/ENESMBusInterface_SpectrixS40G_Windows.cpp b/Controllers/ENESMBusController/ENESMBusInterface/ENESMBusInterface_SpectrixS40G_Windows.cpp index 1d77416a..4f319931 100644 --- a/Controllers/ENESMBusController/ENESMBusInterface/ENESMBusInterface_SpectrixS40G_Windows.cpp +++ b/Controllers/ENESMBusController/ENESMBusInterface/ENESMBusInterface_SpectrixS40G_Windows.cpp @@ -91,7 +91,10 @@ unsigned char ENESMBusInterface_SpectrixS40G::ENERegisterRead(ene_dev_id dev, en | Send the STORAGE_PROTOCOL_COMMAND to the device | \*-----------------------------------------------------------------------------*/ DWORD bytesreturned = 0; - bool result = DeviceIoControl(nvme_fd, IOCTL_STORAGE_PROTOCOL_COMMAND, buffer, sizeof(buffer), buffer, sizeof(buffer), &bytesreturned, (LPOVERLAPPED)0x0); + while(bytesreturned != sizeof(buffer)) + { + bool result = 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 |