-
-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test for success of windows scsi command looks incorrect #19
Comments
I also notice that errors seem to have two ways of being handled.
Perhaps I am missing something here but why is there sometimes an exception and sometimes a success flag returned? Sense data is basically an "error code" that should be looked at if an error occured. |
One small thing, you are calling |
One other small thing, out of the full sense data, there are 3 bytes that make up the main "error code" value that users will check. Usually these byte are provided together as a 3 byte array for the user to check. Perhaps you could include a small function that returns these 3 bytes grouped together when passed in the full sense data, or have your code extract them and include them in the SCSIResponse(). These 3 bytes are: These bytes are usually combined together into an array of 3 bytes to give error codes such as the ones shown here: an example of a function that might extract them:
|
scsi status value 2 means "Check Condition", i think here is to be compatible with ata passthrough"? @TkTech We may check it Combined with command OP Code,or do something else to make difference between scsi command set and ata command set. |
Haven't really had a chance to look at this yet, been a bit busy.
This isn't quite right, sense data can be returned for successful commands not just errors. The presence of sense data isn't related to the error state, but failing to parse the Sense data is definitely an exception. |
What you need is easily to get, it should be:
|
In the file
smartie/scsi/windows.py
at line 100, you are testing for success of a scsi command by accepting a scsi_status value of 0 or 2 as succeeded. However I think this should just check for a scsi_status value of 0 for success.A value of 2 usually means "something went wrong, check the sense data for more info".
So in these cases the sense data is usually populated.
I found this webpage that lists the various values for scsi_status.
It's annoying that these values are not documated clearly on microsoft API related websites :P
https://dosbox-x.com/doxygen/html/scsidefs_8h_source.html
The text was updated successfully, but these errors were encountered: