Changeset 28434 in vbox for trunk/src/VBox/Additions/common/VBoxService
- Timestamp:
- Apr 17, 2010 6:08:28 PM (15 years ago)
- Location:
- trunk/src/VBox/Additions/common/VBoxService
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxService/VBoxServiceControl.cpp
r28420 r28434 145 145 } 146 146 else 147 { 148 rc = VBoxServiceControlExecProcess(uContextID, szCmd, uFlags, szArgs, uNumArgs, 147 { 148 rc = VBoxServiceControlExecProcess(uContextID, szCmd, uFlags, szArgs, uNumArgs, 149 149 szEnv, cbEnv, uNumEnvVars, 150 150 szStdIn, szStdOut, szStdErr, … … 272 272 if (RTListNodeIsLast(&g_GuestControlExecThreads, &pNode->Node)) 273 273 break; 274 275 PVBOXSERVICECTRLTHREAD pNext = RTListNodeGetNext(&pNode->Node, VBOXSERVICECTRLTHREAD, Node); 274 275 PVBOXSERVICECTRLTHREAD pNext = RTListNodeGetNext(&pNode->Node, VBOXSERVICECTRLTHREAD, Node); 276 276 pNode = pNext; 277 277 } -
trunk/src/VBox/Additions/common/VBoxService/VBoxServiceControlExec.cpp
r28420 r28434 267 267 */ 268 268 AssertPtr(pThread); 269 VBoxServiceVerbose(3, "Control: Process started: PID=%u, CID=%u\n", 269 VBoxServiceVerbose(3, "Control: Process started: PID=%u, CID=%u\n", 270 270 pThread->uPID, pThread->uContextID); 271 271 rc = VbglR3GuestCtrlExecReportStatus(pThread->uClientID, pThread->uContextID, 272 pThread->uPID, PROC_STS_STARTED, 0 /* u32Flags */, 272 pThread->uPID, PROC_STS_STARTED, 0 /* u32Flags */, 273 273 NULL /* pvData */, 0 /* cbData */); 274 274 … … 384 384 /* 385 385 * Need to exit? 386 */ 386 */ 387 387 if (pThread->fShutdown) 388 388 break; … … 463 463 VBoxServiceError("Control: Process has reached an undefined status!\n"); 464 464 } 465 466 VBoxServiceVerbose(3, "Control: Process ended: PID=%u, CID=%u, Status=%u, Flags=%u\n", 465 466 VBoxServiceVerbose(3, "Control: Process ended: PID=%u, CID=%u, Status=%u, Flags=%u\n", 467 467 pThread->uPID, pThread->uContextID, uStatus, uFlags); 468 468 rc = VbglR3GuestCtrlExecReportStatus(pThread->uClientID, pThread->uContextID, … … 529 529 /** Allocates and gives back a thread data struct which then can be used by the worker thread. */ 530 530 int VBoxServiceControlExecAllocateThreadData(PVBOXSERVICECTRLTHREAD pThread, 531 uint32_t u32ContextID, 532 const char *pszCmd, uint32_t uFlags, 533 const char *pszArgs, uint32_t uNumArgs, 531 uint32_t u32ContextID, 532 const char *pszCmd, uint32_t uFlags, 533 const char *pszArgs, uint32_t uNumArgs, 534 534 const char *pszEnv, uint32_t cbEnv, uint32_t uNumEnvVars, 535 535 const char *pszStdIn, const char *pszStdOut, const char *pszStdErr, … … 554 554 555 555 /* Prepare argument list. */ 556 int rc = RTGetOptArgvFromString(&pThread->papszArgs, (int*)&pThread->uNumArgs, 556 int rc = RTGetOptArgvFromString(&pThread->papszArgs, (int*)&pThread->uNumArgs, 557 557 (uNumArgs > 0) ? pszArgs : "", NULL); 558 558 /* Did we get the same result? */ … … 592 592 593 593 /* Adjust time limit value. */ 594 pThread->uTimeLimitMS = ( (uTimeLimitMS == UINT32_MAX) 594 pThread->uTimeLimitMS = ( (uTimeLimitMS == UINT32_MAX) 595 595 || (uTimeLimitMS == 0)) ? 596 596 RT_INDEFINITE_WAIT : uTimeLimitMS; … … 695 695 rc = RTProcCreateEx(pThread->pszCmd, pThread->papszArgs, hEnv, pThread->uFlags, 696 696 phStdIn, phStdOut, phStdErr, 697 strlen(pThread->pszUser) ? pThread->pszUser : NULL, 698 strlen(pThread->pszUser) && strlen(pThread->pszPassword) ? pThread->pszPassword : NULL, 697 strlen(pThread->pszUser) ? pThread->pszUser : NULL, 698 strlen(pThread->pszUser) && strlen(pThread->pszPassword) ? pThread->pszPassword : NULL, 699 699 &hProcess); 700 700 if (RT_SUCCESS(rc)) … … 730 730 else /* Something went wrong; report error! */ 731 731 { 732 int rc2 = VbglR3GuestCtrlExecReportStatus(pThread->uClientID, pThread->uContextID, pThread->uPID, 732 int rc2 = VbglR3GuestCtrlExecReportStatus(pThread->uClientID, pThread->uContextID, pThread->uPID, 733 733 PROC_STS_ERROR, rc, 734 734 NULL /* pvData */, 0 /* cbData */); 735 735 if (RT_FAILURE(rc2)) 736 VBoxServiceError("Control: Could not report process start error! Error: %Rrc (process error %Rrc)\n", 736 VBoxServiceError("Control: Could not report process start error! Error: %Rrc (process error %Rrc)\n", 737 737 rc2, rc); 738 738 } … … 753 753 754 754 VbglR3GuestCtrlDisconnect(pThread->uClientID); 755 VBoxServiceVerbose(3, "Control: Thread of process \"%s\" (PID: %u) ended with rc=%Rrc\n", 755 VBoxServiceVerbose(3, "Control: Thread of process \"%s\" (PID: %u) ended with rc=%Rrc\n", 756 756 pThread->pszCmd, pThread->uPID, rc); 757 757 return rc; … … 765 765 } 766 766 767 int VBoxServiceControlExecProcess(uint32_t uContextID, const char *pszCmd, uint32_t uFlags, 768 const char *pszArgs, uint32_t uNumArgs, 767 int VBoxServiceControlExecProcess(uint32_t uContextID, const char *pszCmd, uint32_t uFlags, 768 const char *pszArgs, uint32_t uNumArgs, 769 769 const char *pszEnv, uint32_t cbEnv, uint32_t uNumEnvVars, 770 770 const char *pszStdIn, const char *pszStdOut, const char *pszStdErr, … … 777 777 { 778 778 rc = VBoxServiceControlExecAllocateThreadData(pThread, 779 uContextID, 780 pszCmd, uFlags, 779 uContextID, 780 pszCmd, uFlags, 781 781 pszArgs, uNumArgs, 782 pszEnv, cbEnv, uNumEnvVars, 783 pszStdIn, pszStdOut, pszStdErr, 782 pszEnv, cbEnv, uNumEnvVars, 783 pszStdIn, pszStdOut, pszStdErr, 784 784 pszUser, pszPassword, 785 785 uTimeLimitMS); 786 786 if (RT_SUCCESS(rc)) 787 787 { 788 rc = RTThreadCreate(&pThread->Thread, VBoxServiceControlExecThread, 788 rc = RTThreadCreate(&pThread->Thread, VBoxServiceControlExecThread, 789 789 (void *)(PVBOXSERVICECTRLTHREAD*)pThread, 0, 790 790 RTTHREADTYPE_DEFAULT, RTTHREADFLAGS_WAITABLE, "Exec"); 791 791 if (RT_FAILURE(rc)) 792 792 { 793 VBoxServiceError("Control: RTThreadCreate failed, rc=%Rrc\n, pThread=%p\n", 793 VBoxServiceError("Control: RTThreadCreate failed, rc=%Rrc\n, pThread=%p\n", 794 794 rc, pThread); 795 795 } … … 808 808 } 809 809 } 810 810 811 811 if (RT_FAILURE(rc)) 812 812 VBoxServiceControlExecDestroyThreadData(pThread); -
trunk/src/VBox/Additions/common/VBoxService/VBoxServiceInternal.h
r28420 r28434 231 231 232 232 #ifdef VBOX_WITH_GUEST_CONTROL 233 extern int VBoxServiceControlExecProcess(uint32_t uContext, const char *pszCmd, uint32_t uFlags, 234 const char *pszArgs, uint32_t uNumArgs, 233 extern int VBoxServiceControlExecProcess(uint32_t uContext, const char *pszCmd, uint32_t uFlags, 234 const char *pszArgs, uint32_t uNumArgs, 235 235 const char *pszEnv, uint32_t cbEnv, uint32_t uNumEnvVars, 236 236 const char *pszStdIn, const char *pszStdOut, const char *pszStdErr, -
trunk/src/VBox/Additions/common/VBoxService/VBoxServicePageSharing.cpp
r28432 r28434 46 46 47 47 #if defined(RT_OS_WINDOWS) && !defined(TARGET_NT4) 48 #include <tlhelp32.h> 48 #include <tlhelp32.h> 49 49 #include <psapi.h> 50 50 … … 162 162 } 163 163 } 164 164 165 165 pBaseAddress = (BYTE *)MemInfo[i].BaseAddress + MemInfo[i].RegionSize; 166 166 if (dwModuleSize > MemInfo[i].RegionSize) … … 175 175 while (dwModuleSize); 176 176 177 int rc = VbglR3RegisterSharedModule(pModule->Info.szModule, pModule->szFileVersion, (RTGCPTR64)pModule->Info.modBaseAddr, 177 int rc = VbglR3RegisterSharedModule(pModule->Info.szModule, pModule->szFileVersion, (RTGCPTR64)pModule->Info.modBaseAddr, 178 178 pModule->Info.modBaseSize, idxRegion, aRegions); 179 179 AssertRC(rc); … … 238 238 } 239 239 240 printf( "\n\n MODULE NAME: %s", ModuleInfo.szModule ); 241 printf( "\n executable = %s", ModuleInfo.szExePath ); 242 printf( "\n process ID = 0x%08X", ModuleInfo.th32ProcessID ); 243 printf( "\n base address = 0x%08X", (DWORD) ModuleInfo.modBaseAddr ); 244 printf( "\n base size = %d", ModuleInfo.modBaseSize ); 240 printf( "\n\n MODULE NAME: %s", ModuleInfo.szModule ); 241 printf( "\n executable = %s", ModuleInfo.szExePath ); 242 printf( "\n process ID = 0x%08X", ModuleInfo.th32ProcessID ); 243 printf( "\n base address = 0x%08X", (DWORD) ModuleInfo.modBaseAddr ); 244 printf( "\n base size = %d", ModuleInfo.modBaseSize ); 245 245 } 246 246 while (Module32Next(hSnapshot, &ModuleInfo)); … … 270 270 Process32First(hSnapshot, &ProcessInfo); 271 271 272 do 272 do 273 273 { 274 274 VBoxServicePageSharingInspectModules(ProcessInfo.th32ProcessID, &pNewTree); … … 361 361 for (;;) 362 362 { 363 363 364 364 VBoxServicePageSharingInspectGuest(); 365 365
Note:
See TracChangeset
for help on using the changeset viewer.