> ...
> > Actually, that looks wrong since as I said before, no program should check it
> > anyway, and the spec says it always returns SS_PENDING.

This is true for SC_EXEC_SCSI_COMMAND

> obviuosly we have different specs:
> MSDN Library July 1995 says in Windows 95 DDK "Get Device Type Comand" 
> 
> > Table 4-5. Return Values from Get Device Type Command 
> > 
> > Value  Meaning  
> > SS_COMP  SCSI/ASPI request has completed without error.  
> > SS_INVALID_HA  Invalid host adapter number.  
> > SS_NO_DEVICE  SCSI device not installed.  
> 
> So my prposed fix for WNASPI32_DoPosting is probably wrong and as in
> my first patch we should probably set an appropriate retun value in
> SendASPI32Command:SC_GET_DEV_TYPE. 

I did a revised patch, appended below:
Tested with ramdisk.exe (on my Toshiba DVD) and SoftDVD Max.

Ciao, Marcus
Changelog:
        fixed return value for SC_GET_DEV_TYPE

Index: winaspi32.c
===================================================================
RCS file: /home/wine/wine/dlls/winaspi/winaspi32.c,v
retrieving revision 1.3
diff -u -r1.3 winaspi32.c
--- winaspi32.c 2000/03/24 19:45:47     1.3
+++ winaspi32.c 2000/03/26 06:51:10
@@ -474,6 +476,7 @@
     lpSRB->inquiry.HA_Unique[6] = 0x02; /* Maximum Transfer Length (128K, Byte> 4-7) 
*/
     FIXME("ASPI: Partially implemented SC_HA_INQUIRY for adapter %d.\n", 
lpSRB->inquiry.SRB_HaId);
     return SS_COMP;
+
   case SC_GET_DEV_TYPE: {
     /* FIXME: We should return SS_NO_DEVICE if the device is not configured */
     /* FIXME: We should return SS_INVALID_HA if HostAdapter!=0 */
@@ -496,13 +499,17 @@
                                  /* FIXME: handle lun */
     tmpsrb.cmd.CDBByte[4]      = sizeof(inqbuf);
     tmpsrb.cmd.SRB_CDBLen      = 6;
+
     ret = ASPI_ExecScsiCmd(&tmpsrb.cmd);
-#define X(x) lpSRB->devtype.SRB_##x = tmpsrb.cmd.SRB_##x
-    X(Status);
-#undef X
+
+    lpSRB->devtype.SRB_Status  = tmpsrb.cmd.SRB_Status;
     lpSRB->devtype.SRB_DeviceType = inqbuf[0]&0x1f;
+
     TRACE("returning devicetype %d for target 
%d\n",inqbuf[0]&0x1f,tmpsrb.cmd.SRB_Target);
-    return ret;
+    if (ret!=SS_PENDING) /* Any error is passed down directly */
+       return ret;
+    /* FIXME: knows that the command is finished already, pass final Status */
+    return tmpsrb.cmd.SRB_Status;
   }
   case SC_EXEC_SCSI_CMD:
     return ASPI_ExecScsiCmd(&lpSRB->cmd);

Reply via email to