Changeset 97748 in vbox for trunk/src/VBox/Additions/common
- Timestamp:
- Dec 6, 2022 9:26:48 AM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxGuest/lib/VBoxGuestR3LibDragAndDrop.cpp
r97746 r97748 103 103 104 104 } while (rc == VERR_INTERRUPTED); 105 106 return rc; 107 } 108 109 110 /** 111 * Sends a DnD error back to the host. 112 * 113 * @returns IPRT status code. 114 * @param pCtx DnD context to use. 115 * @param rcErr Error (IPRT-style) to send. 116 */ 117 VBGLR3DECL(int) VbglR3DnDSendError(PVBGLR3GUESTDNDCMDCTX pCtx, int rcErr) 118 { 119 AssertPtrReturn(pCtx, VERR_INVALID_POINTER); 120 121 HGCMMsgGHError Msg; 122 VBGL_HGCM_HDR_INIT(&Msg.hdr, pCtx->uClientID, GUEST_DND_FN_EVT_ERROR, 2); 123 /** @todo Context ID not used yet. */ 124 Msg.u.v3.uContext.SetUInt32(0); 125 Msg.u.v3.rc.SetUInt32((uint32_t)rcErr); /* uint32_t vs. int. */ 126 127 int rc = VbglR3HGCMCall(&Msg.hdr, sizeof(Msg)); 128 129 /* 130 * Never return an error if the host did not accept the error at the current 131 * time. This can be due to the host not having any appropriate callbacks 132 * set which would handle that error. 133 * 134 * bird: Looks like VERR_NOT_SUPPORTED is what the host will return if it 135 * doesn't an appropriate callback. The code used to ignore ALL errors 136 * the host would return, also relevant ones. 137 */ 138 if (RT_FAILURE(rc)) 139 LogFlowFunc(("Sending error %Rrc failed with rc=%Rrc\n", rcErr, rc)); 140 if (rc == VERR_NOT_SUPPORTED) 141 rc = VINF_SUCCESS; 105 142 106 143 return rc; … … 1882 1919 if (rc != VERR_CANCELLED) 1883 1920 { 1884 int rc2 = VbglR3DnD GHSendError(pCtx, rc);1921 int rc2 = VbglR3DnDSendError(pCtx, rc); 1885 1922 if (RT_FAILURE(rc2)) 1886 1923 LogFlowFunc(("Unable to send error (%Rrc) to host, rc=%Rrc\n", rc, rc2)); … … 1890 1927 return rc; 1891 1928 } 1892 1893 /**1894 * Guest -> Host1895 * Send an error back to the host.1896 *1897 * @returns IPRT status code.1898 * @param pCtx DnD context to use.1899 * @param rcErr Error (IPRT-style) to send.1900 */1901 VBGLR3DECL(int) VbglR3DnDGHSendError(PVBGLR3GUESTDNDCMDCTX pCtx, int rcErr)1902 {1903 AssertPtrReturn(pCtx, VERR_INVALID_POINTER);1904 1905 HGCMMsgGHError Msg;1906 VBGL_HGCM_HDR_INIT(&Msg.hdr, pCtx->uClientID, GUEST_DND_FN_GH_EVT_ERROR, 2);1907 /** @todo Context ID not used yet. */1908 Msg.u.v3.uContext.SetUInt32(0);1909 Msg.u.v3.rc.SetUInt32((uint32_t)rcErr); /* uint32_t vs. int. */1910 1911 int rc = VbglR3HGCMCall(&Msg.hdr, sizeof(Msg));1912 1913 /*1914 * Never return an error if the host did not accept the error at the current1915 * time. This can be due to the host not having any appropriate callbacks1916 * set which would handle that error.1917 *1918 * bird: Looks like VERR_NOT_SUPPORTED is what the host will return if it1919 * doesn't an appropriate callback. The code used to ignore ALL errors1920 * the host would return, also relevant ones.1921 */1922 if (RT_FAILURE(rc))1923 LogFlowFunc(("Sending error %Rrc failed with rc=%Rrc\n", rcErr, rc));1924 if (rc == VERR_NOT_SUPPORTED)1925 rc = VINF_SUCCESS;1926 1927 return rc;1928 }1929 1929 #endif /* VBOX_WITH_DRAG_AND_DROP_GH */ 1930 1930
Note:
See TracChangeset
for help on using the changeset viewer.