diff --git a/Controllers/SeagateController/SeagateController.cpp b/Controllers/SeagateController/SeagateController.cpp index 3840b7411..7bfa2471c 100644 --- a/Controllers/SeagateController/SeagateController.cpp +++ b/Controllers/SeagateController/SeagateController.cpp @@ -78,7 +78,7 @@ void SeagateController::SendPacket | Size must be enough for the SCSI_PASS_THROUGH_DIRECT struct plus the sense | | data. Size of 80 bytes taken from captured data | \*-----------------------------------------------------------------------------*/ - unsigned char buffer[80] = {0}; + unsigned char buffer[sizeof(SCSI_PASS_THROUGH_DIRECT) + 32] = {0}; /*-----------------------------------------------------------------------------*\ | Create PSCSI_PASS_THROUGH_DIRECT pointer and point it to the buffer | @@ -99,7 +99,7 @@ void SeagateController::SendPacket command->DataTransferLength = packet_sz; command->TimeOutValue = 0x00000014; command->DataBuffer = packet; - command->SenseInfoOffset = 0x0000002E; + command->SenseInfoOffset = sizeof(SCSI_PASS_THROUGH_DIRECT); command->Cdb[0] = 0xD2; command->Cdb[1] = 0x53; @@ -117,5 +117,5 @@ void SeagateController::SendPacket /*-----------------------------------------------------------------------------*\ | Send pass through command | \*-----------------------------------------------------------------------------*/ - DeviceIoControl(fd, IOCTL_SCSI_PASS_THROUGH_DIRECT, command, 80, command, 80, NULL, NULL); -} \ No newline at end of file + DeviceIoControl(fd, IOCTL_SCSI_PASS_THROUGH_DIRECT, command, sizeof(buffer), command, sizeof(buffer), NULL, NULL); +} diff --git a/Controllers/SeagateController/SeagateControllerDetect.cpp b/Controllers/SeagateController/SeagateControllerDetect.cpp index 2d5d16163..62d2d8f57 100644 --- a/Controllers/SeagateController/SeagateControllerDetect.cpp +++ b/Controllers/SeagateController/SeagateControllerDetect.cpp @@ -106,7 +106,7 @@ static HANDLE OpenDevice(wchar_t buff[MAX_PATH]) * * \******************************************************************************************/ -void DetectSeagateControllers(std::vector& rgb_controllers) +void DetectSeagateControllers() { /*-------------------------------------------------------------------------------------------------*\ | https://docs.microsoft.com/en-us/windows-hardware/drivers/install/identifiers-for-scsi-devices | @@ -122,7 +122,7 @@ void DetectSeagateControllers(std::vector& rgb_controllers) SeagateController* controller = new SeagateController(fd, dev_name); RGBController_Seagate* rgb_controller = new RGBController_Seagate(controller); - rgb_controllers.push_back(rgb_controller); + ResourceManager::get()->RegisterRGBController(rgb_controller); } } } /* DetectSpectrixS40GControllers() */