Changeset 80828 in vbox
- Timestamp:
- Sep 16, 2019 2:05:09 PM (5 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/include/GuestCtrlImplPrivate.h
r79285 r80828 83 83 : m_hEnv(NIL_RTENV) 84 84 , m_cRefs(1) 85 , m_fFlags(0) 85 86 { } 86 87 … … 362 363 * @throws HRESULT 363 364 */ 364 GuestEnvironmentBase(const GuestEnvironmentBase &rThat, bool fChangeRecord )365 GuestEnvironmentBase(const GuestEnvironmentBase &rThat, bool fChangeRecord, uint32_t fFlags = 0) 365 366 : m_hEnv(NIL_RTENV) 366 367 , m_cRefs(1) 368 , m_fFlags(fFlags) 367 369 { 368 370 int rc = cloneCommon(rThat, fChangeRecord); … … 394 396 /* Need to type convert it. */ 395 397 if (fChangeRecord) 396 rc = RTEnvCreateChangeRecord (&hNewEnv);398 rc = RTEnvCreateChangeRecordEx(&hNewEnv, rThat.m_fFlags); 397 399 else 398 rc = RTEnvCreate (&hNewEnv);400 rc = RTEnvCreateEx(&hNewEnv, rThat.m_fFlags); 399 401 if (RT_SUCCESS(rc)) 400 402 { … … 412 414 */ 413 415 if (fChangeRecord) 414 rc = RTEnvCreateChangeRecord (&hNewEnv);416 rc = RTEnvCreateChangeRecordEx(&hNewEnv, rThat.m_fFlags); 415 417 else 416 rc = RTEnvCreate (&hNewEnv);418 rc = RTEnvCreateEx(&hNewEnv, rThat.m_fFlags); 417 419 } 418 420 if (RT_SUCCESS(rc)) … … 420 422 RTEnvDestroy(m_hEnv); 421 423 m_hEnv = hNewEnv; 424 m_fFlags = rThat.m_fFlags; 422 425 } 423 426 return rc; … … 429 432 /** Reference counter. */ 430 433 uint32_t volatile m_cRefs; 434 /** RTENV_CREATE_F_XXX. */ 435 uint32_t m_fFlags; 431 436 }; 432 437 … … 470 475 * Initialize this as a normal environment block. 471 476 * @returns IPRT status code. 472 */ 473 int initNormal(void) 477 * @param fFlags RTENV_CREATE_F_XXX 478 */ 479 int initNormal(uint32_t fFlags) 474 480 { 475 481 AssertReturn(m_hEnv == NIL_RTENV, VERR_WRONG_ORDER); 476 return RTEnvCreate(&m_hEnv); 482 m_fFlags = fFlags; 483 return RTEnvCreateEx(&m_hEnv, fFlags); 477 484 } 478 485 … … 494 501 GuestEnvironment &operator=(const GuestEnvironmentBase &rThat) 495 502 { 496 int rc = c loneCommon(rThat, true /*fChangeRecord*/);503 int rc = copy(rThat); 497 504 if (RT_FAILURE(rc)) 498 505 throw (Global::vboxStatusCodeToCOM(rc)); … … 550 557 * Initialize this as a environment change record. 551 558 * @returns IPRT status code. 552 */ 553 int initChangeRecord(void) 559 * @param fFlags RTENV_CREATE_F_XXX 560 */ 561 int initChangeRecord(uint32_t fFlags) 554 562 { 555 563 AssertReturn(m_hEnv == NIL_RTENV, VERR_WRONG_ORDER); 556 return RTEnvCreateChangeRecord(&m_hEnv); 564 m_fFlags = fFlags; 565 return RTEnvCreateChangeRecordEx(&m_hEnv, fFlags); 557 566 } 558 567 … … 574 583 GuestEnvironmentChanges &operator=(const GuestEnvironmentBase &rThat) 575 584 { 576 int rc = c loneCommon(rThat, true /*fChangeRecord*/);585 int rc = copy(rThat); 577 586 if (RT_FAILURE(rc)) 578 587 throw (Global::vboxStatusCodeToCOM(rc)); -
trunk/src/VBox/Main/include/GuestImpl.h
r80654 r80828 106 106 uint32_t i_getAdditionsRevision(void) { return mData.mAdditionsRevision; } 107 107 uint32_t i_getAdditionsVersion(void) { return mData.mAdditionsVersionFull; } 108 VBOXOSTYPE i_getGuestOSType(void) { return mData.mOSType; } 108 VBOXOSTYPE i_getGuestOSType(void) const { return mData.mOSType; } 109 /** Checks if the guest OS type is part of the windows NT family. */ 110 bool i_isGuestInWindowsNtFamily(void) const 111 { 112 return mData.mOSType < VBOXOSTYPE_OS2 && mData.mOSType >= VBOXOSTYPE_WinNT; 113 } 109 114 #ifdef VBOX_WITH_GUEST_CONTROL 110 115 int i_dispatchToSession(PVBOXGUESTCTRLHOSTCBCTX pCtxCb, PVBOXGUESTCTRLHOSTCALLBACK pSvcCb); -
trunk/src/VBox/Main/src-client/GuestSessionImpl.cpp
r79188 r80828 230 230 if (RT_SUCCESS(rc)) 231 231 { 232 rc = mData.mEnvironmentChanges.initChangeRecord(); 232 rc = mData.mEnvironmentChanges.initChangeRecord(pGuest->i_isGuestInWindowsNtFamily() 233 ? RTENV_CREATE_F_ALLOW_EQUAL_FIRST_IN_VAR : 0); 233 234 if (RT_SUCCESS(rc)) 234 235 { … … 1836 1837 if (pBaseEnv) 1837 1838 { 1838 int vrc = pBaseEnv->initNormal( );1839 int vrc = pBaseEnv->initNormal(Guest.i_isGuestInWindowsNtFamily() ? RTENV_CREATE_F_ALLOW_EQUAL_FIRST_IN_VAR : 0); 1839 1840 if (RT_SUCCESS(vrc)) 1840 1841 vrc = pBaseEnv->copyUtf8Block(pszzEnvBlock, cbEnvBlock);
Note:
See TracChangeset
for help on using the changeset viewer.