]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
win32: fix HRESULT constant mismatch between signed and unsigned
authorAlain Spineux <alain@baculasystems.com>
Thu, 2 Feb 2023 13:32:54 +0000 (14:32 +0100)
committerEric Bollengier <eric@baculasystems.com>
Thu, 14 Sep 2023 11:57:01 +0000 (13:57 +0200)
- HRESULT is a 32bits signed value
- some constant are >= 0x80000000 that are out of the range of a signed 32
- An alternative would be to set the type casting inside the .h file in the
  depkgs directory
- this concern (in 64bits)
- VSS_E_INVALID_XML_DOCUMENT
- VSS_E_OBJECT_NOT_FOUND
- VSS_E_BAD_STATE
- VSS_E_WRITER_INFRASTRUCTURE
- VSS_E_WRITER_NOT_RESPONDING

bacula/src/win32/filed/vss_generic.cpp

index c6db0c3ef597a63ae9d30608162861ffc7398a59..5346555cef00787d21fc052ca3385685d64d1b1d 100644 (file)
@@ -115,16 +115,16 @@ static void JmsgVssApiStatus(JCR *jcr, int msg_status, HRESULT hr, const char *a
    case E_ACCESSDENIED:
       errmsg = "The caller does not have sufficient backup privileges or is not an administrator.";
       break;
-   case VSS_E_INVALID_XML_DOCUMENT:
+   case ((HRESULT)VSS_E_INVALID_XML_DOCUMENT):
       errmsg = "The XML document is not valid.";
       break;
-   case VSS_E_OBJECT_NOT_FOUND:
+   case ((HRESULT)VSS_E_OBJECT_NOT_FOUND):
       errmsg = "The specified file does not exist.";
       break;
-   case VSS_E_BAD_STATE:
+   case ((HRESULT)VSS_E_BAD_STATE):
       errmsg = "Object is not initialized; called during restore or not called in correct sequence.";
       break;
-   case VSS_E_WRITER_INFRASTRUCTURE:
+   case ((HRESULT)VSS_E_WRITER_INFRASTRUCTURE):
       errmsg = "The writer infrastructure is not operating properly. Check that the Event Service and VSS have been started, and check for errors associated with those services in the error log.";
       break;
    case VSS_S_ASYNC_CANCELLED: