Changeset 42485 in vbox
- Timestamp:
- Jul 31, 2012 4:13:53 PM (12 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 5 edited
-
include/GuestCtrlImplPrivate.h (modified) (1 diff)
-
include/GuestSessionImpl.h (modified) (2 diffs)
-
src-client/GuestCtrlPrivate.cpp (modified) (2 diffs)
-
src-client/GuestProcessImpl.cpp (modified) (5 diffs)
-
src-client/GuestSessionImpl.cpp (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/include/GuestCtrlImplPrivate.h
r42478 r42485 37 37 #endif 38 38 39 #ifdef LOG_GROUP 40 #undef LOG_GROUP 41 #endif 39 42 #define LOG_GROUP LOG_GROUP_GUEST_CONTROL 40 43 #include <VBox/log.h> -
trunk/src/VBox/Main/include/GuestSessionImpl.h
r42461 r42485 140 140 struct Data 141 141 { 142 /** Guest control protocol version .143 * Guest control prior to VBox 4.2 hasversion 1,144 * guest control 2.0 has ...well,2. */142 /** Guest control protocol version to be used. 143 * Guest Additions < VBox 4.2 have version 1, 144 * any newer version will have version 2. */ 145 145 uint32_t mProtocolVersion; 146 146 /** Flag indicating if this is an internal session … … 157 157 /** The session timeout. Default is 30s. */ 158 158 ULONG mTimeout; 159 /** The next process ID for assignment. */ 160 ULONG mNextProcessID; 161 /** The session's environment block. Can be 162 * overwritten/extended by ProcessCreate(Ex). */ 159 163 GuestEnvironment mEnvironment; 164 /** Directory objects bound to this session. */ 160 165 SessionDirectories mDirectories; 166 /** File objects bound to this session. */ 161 167 SessionFiles mFiles; 168 /** Process objects bound to this session. */ 162 169 SessionProcesses mProcesses; 163 170 } mData; -
trunk/src/VBox/Main/src-client/GuestCtrlPrivate.cpp
r42478 r42485 150 150 Assert((pvData == NULL) && !cbData); 151 151 152 int rc = VINF_SUCCESS;153 152 switch (enmType) 154 153 { … … 185 184 } 186 185 186 int rc = GuestCtrlEvent::Init(); 187 187 if (RT_SUCCESS(rc)) 188 { 189 rc = GuestCtrlEvent::Init(); 190 if (RT_SUCCESS(rc)) 191 mType = enmType; 192 } 188 mType = enmType; 193 189 194 190 LogFlowFuncLeaveRC(rc); -
trunk/src/VBox/Main/src-client/GuestProcessImpl.cpp
r42478 r42485 318 318 /* Create a new context ID and assign it. */ 319 319 int rc = VERR_NOT_FOUND; 320 321 ULONG uCount = mData.mNextContextID++; 320 322 ULONG uNewContextID = 0; 321 323 ULONG uTries = 0; 322 324 for (;;) 323 325 { 326 if (uCount == VBOX_GUESTCTRL_MAX_CONTEXTS) 327 uCount = 0; 328 324 329 /* Create a new context ID ... */ 325 330 uNewContextID = VBOX_GUESTCTRL_CONTEXTID_MAKE(uSessionID, 326 mData.mProcessID, mData.mNextContextID); 327 if (mData.mNextContextID == VBOX_GUESTCTRL_MAX_CONTEXTS) 328 mData.mNextContextID = 0; 331 mData.mProcessID, uCount); 332 329 333 /* Is the context ID already used? Try next ID ... */ 330 if (!callbackExists(u NewContextID))334 if (!callbackExists(uCount)) 331 335 { 332 336 /* Callback with context ID was not found. This means … … 336 340 break; 337 341 } 338 mData.mNextContextID++; 339 342 343 uCount++; 340 344 if (++uTries == UINT32_MAX) 341 345 break; /* Don't try too hard. */ … … 348 352 * the session + process ID), just the context count 349 353 * will be used here. */ 350 mData.mCallbacks[ mData.mNextContextID] = pCallback;354 mData.mCallbacks[uCount] = pCallback; 351 355 Assert(mData.mCallbacks.size()); 352 356 … … 356 360 357 361 LogFlowThisFunc(("Added new callback (Session: %RU32, Process: %RU32, Count=%RU32) CID=%RU32\n", 358 uSessionID, mData.mProcessID, mData.mNextContextID, uNewContextID));362 uSessionID, mData.mProcessID, uCount, uNewContextID)); 359 363 } 360 364 … … 784 788 { 785 789 if (pData->pvData && pData->cbData) 790 { 786 791 rc = pCallback->FillData(pData->pvData, pData->cbData); 792 Assert(pCallback->GetPayloadSize() == pData->cbData); 793 } 787 794 788 795 int rc2 = pCallback->Signal(); -
trunk/src/VBox/Main/src-client/GuestSessionImpl.cpp
r42478 r42485 76 76 mData.mName = aName; 77 77 78 mData.mNextProcessID = 0; 79 78 80 /* Confirm a successful initialization when it's the case. */ 79 81 autoInitSpan.setSucceeded(); … … 482 484 483 485 /* Create a new (host-based) process ID and assign it. */ 484 ULONG uNewProcessID = 0;485 486 ULONG uTries = 0; 486 487 … … 488 489 { 489 490 /* Is the context ID already used? */ 490 if (!processExists( uNewProcessID, NULL /* pProgress */))491 if (!processExists(mData.mNextProcessID, NULL /* pProgress */)) 491 492 { 492 493 /* Callback with context ID was not found. This means … … 496 497 break; 497 498 } 498 uNewProcessID++; 499 mData.mNextProcessID++; 500 if (mData.mNextProcessID == UINT32_MAX) 501 mData.mNextProcessID = 0; 499 502 500 503 if (++uTries == UINT32_MAX) … … 510 513 511 514 rc = pProcess->init(mData.mParent->getConsole() /* Console */, this /* Session */, 512 uNewProcessID, procInfo);515 mData.mNextProcessID, procInfo); 513 516 if (RT_FAILURE(rc)) throw rc; 514 517 515 518 /* Add the created process to our map. */ 516 mData.mProcesses[ uNewProcessID] = pProcess;519 mData.mProcesses[mData.mNextProcessID] = pProcess; 517 520 518 521 LogFlowFunc(("Added new process (Session: %RU32) with process ID=%RU32\n", 519 mData.mId, uNewProcessID));522 mData.mId, mData.mNextProcessID)); 520 523 } 521 524 catch (int rc2)
Note:
See TracChangeset
for help on using the changeset viewer.

