[core] improve VDS calls

* Factorize error setting.
* Use break so as to not leak resources on error.
* Ensure that the error codes are set properly.
This commit is contained in:
Pete Batard 2020-11-09 16:48:53 +00:00
parent e8c717c394
commit 2538974318
No known key found for this signature in database
GPG key ID: 38E0CF5E69EDD671
3 changed files with 35 additions and 65 deletions

View file

@ -54,7 +54,7 @@
#define FILE_FLOPPY_DISKETTE 0x00000004
#define VDS_SET_ERROR(hr) do { if (hr == S_FALSE) hr = ERROR_SEVERITY_ERROR|FAC(FACILITY_STORAGE)|ERROR_GEN_FAILURE; FormatStatus = hr; SetLastError(hr); } while(0)
#define VDS_SET_ERROR(hr) do { if (hr != S_OK) { hr = ERROR_SEVERITY_ERROR|FAC(FACILITY_STORAGE)|ERROR_GEN_FAILURE; FormatStatus = hr; SetLastError(hr); } } while(0)
#if !defined(__MINGW32__)
typedef enum _FSINFOCLASS {