[UNIATA]
authorThomas Faber <thomas.faber@reactos.org>
Sun, 22 May 2016 10:25:24 +0000 (10:25 +0000)
committerThomas Faber <thomas.faber@reactos.org>
Sun, 22 May 2016 10:25:24 +0000 (10:25 +0000)
- When handling CD READ_CAPACITY requests in AtapiInterrupt__, fully rewind the DataBuffer instead of relying on the last read length. Fixes crash on first stage boot in KVM.
CORE-11286 #resolve
CORE-11296

svn path=/trunk/; revision=71371

reactos/drivers/storage/ide/uniata/id_ata.cpp

index d7a354b..719148e 100644 (file)
@@ -5923,13 +5923,13 @@ continue_read_drq:
                     // for that also.
                     if (srb->Cdb[0] == SCSIOP_READ_CAPACITY) {
 
-                        AtaReq->DataBuffer -= wordCount;
+                        AtaReq->DataBuffer -= AtaReq->WordsTransfered;
                         if (AtaReq->DataBuffer[0] == 0x00) {
                             *((ULONG *) &(AtaReq->DataBuffer[0])) = 0xFFFFFF7F;
                         }
 
                         *((ULONG *) &(AtaReq->DataBuffer[2])) = 0x00080000;
-                        AtaReq->DataBuffer += wordCount;
+                        AtaReq->DataBuffer += AtaReq->WordsTransfered;
                     }
 #ifndef UNIATA_INIT_CHANGERS
                     else