- Timestamp:
- Apr 5, 2019 8:23:13 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/GuestHost/DragAndDrop/DnDURIObject.cpp
r76553 r78020 36 36 : m_enmType(Type_Unknown) 37 37 , m_enmView(View_Unknown) 38 , m_fIsOpen(false)39 38 { 40 39 RT_ZERO(u); … … 48 47 , m_strSrcPathAbs(strSrcPathAbs) 49 48 , m_strTgtPathAbs(strDstPathAbs) 50 , m_fIsOpen(false)51 49 { 52 50 RT_ZERO(u); … … 65 63 { 66 64 LogFlowThisFuncEnter(); 67 68 if (!m_fIsOpen)69 return;70 65 71 66 switch (m_enmType) … … 90 85 break; 91 86 } 92 93 m_fIsOpen = false;94 87 } 95 88 … … 190 183 bool DnDURIObject::IsOpen(void) const 191 184 { 192 return m_fIsOpen; 185 switch (m_enmType) 186 { 187 case Type_File: return RTFileIsValid(u.File.hFile); 188 case Type_Directory: return RTDirIsValid(u.Dir.hDir); 189 default: break; 190 } 191 192 return false; 193 193 } 194 194 … … 223 223 AssertReturn(!(fFlags & ~DNDURIOBJECT_FLAGS_VALID_MASK), VERR_INVALID_FLAGS); 224 224 RT_NOREF1(fFlags); 225 226 if (m_fIsOpen)227 return VINF_SUCCESS;228 225 229 226 int rc = VINF_SUCCESS; … … 301 298 { 302 299 m_enmView = enmView; 303 m_fIsOpen = true;304 300 } 305 301 … … 312 308 * 313 309 * @return IPRT status code. 314 * @param enmView View to use for querying information. 310 * @param enmView View to use for querying information. Currently ignored. 315 311 */ 316 312 int DnDURIObject::queryInfoInternal(View enmView) … … 323 319 { 324 320 case Type_File: 321 AssertMsgReturn(RTFileIsValid(u.File.hFile), ("Object has invalid file handle\n"), VERR_INVALID_STATE); 325 322 rc = RTFileQueryInfo(u.File.hFile, &u.File.objInfo, RTFSOBJATTRADD_NOTHING); 326 323 break; 327 324 328 325 case Type_Directory: 326 AssertMsgReturn(RTDirIsValid(u.Dir.hDir), ("Object has invalid directory handle\n"), VERR_INVALID_STATE); 329 327 rc = RTDirQueryInfo(u.Dir.hDir, &u.Dir.objInfo, RTFSOBJATTRADD_NOTHING); 330 328 break; … … 429 427 /* pcbRead is optional. */ 430 428 431 AssertMsgReturn(m_fIsOpen, ("Object not in open state\n"), VERR_INVALID_STATE);432 429 AssertMsgReturn(m_enmView == View_Source, ("Cannot write to an object which is not in target view\n"), 433 430 VERR_INVALID_STATE); … … 526 523 /* pcbWritten is optional. */ 527 524 528 AssertMsgReturn(m_fIsOpen, ("Object not in open state\n"), VERR_INVALID_STATE);529 525 AssertMsgReturn(m_enmView == View_Target, ("Cannot write to an object which is not in target view\n"), 530 526 VERR_INVALID_STATE);
Note:
See TracChangeset
for help on using the changeset viewer.