Module: wine Branch: master Commit: 1161d0e15e6d41c62096b3e442e77115b9aa4e7a URL: http://source.winehq.org/git/wine.git/?a=commit;h=1161d0e15e6d41c62096b3e442...
Author: Rok Mandeljc manrok@email.si Date: Thu Nov 1 08:08:42 2007 +0100
wnaspi32: Do the command dumping only after device has been verified.
---
dlls/wnaspi32/winaspi32.c | 24 ++++++++++++------------ 1 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/dlls/wnaspi32/winaspi32.c b/dlls/wnaspi32/winaspi32.c index 0f8e2f9..8c76878 100644 --- a/dlls/wnaspi32/winaspi32.c +++ b/dlls/wnaspi32/winaspi32.c @@ -313,6 +313,18 @@ ASPI_ExecScsiCmd(SRB_ExecSCSICmd *lpPRB) int fd; DWORD SRB_Status;
+ num_controllers = ASPI_GetNumControllers(); + if (lpPRB->SRB_HaId > num_controllers) { + WARN("Failed: Wanted hostadapter %d, but we have only %d.\n", + lpPRB->SRB_HaId, num_controllers + ); + return WNASPI32_DoPosting( lpPRB, SS_INVALID_HA ); + } + fd = ASPI_OpenDevice(lpPRB); + if (fd == -1) { + return WNASPI32_DoPosting( lpPRB, SS_NO_DEVICE ); + } + /* FIXME: hackmode */ #define MAKE_TARGET_TO_HOST(lpPRB) \ if (!TARGET_TO_HOST(lpPRB)) { \ @@ -345,18 +357,6 @@ ASPI_ExecScsiCmd(SRB_ExecSCSICmd *lpPRB) } ASPI_DebugPrintCmd(lpPRB);
- num_controllers = ASPI_GetNumControllers(); - if (lpPRB->SRB_HaId > num_controllers) { - WARN("Failed: Wanted hostadapter %d, but we have only %d.\n", - lpPRB->SRB_HaId, num_controllers - ); - return WNASPI32_DoPosting( lpPRB, SS_INVALID_HA ); - } - fd = ASPI_OpenDevice(lpPRB); - if (fd == -1) { - return WNASPI32_DoPosting( lpPRB, SS_NO_DEVICE ); - } - sg_hd = NULL; sg_reply_hdr = NULL;