- Timestamp:
- Apr 16, 2014 5:57:25 PM (11 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 44 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/include/MachineDebuggerImpl.h
r46423 r51092 21 21 #define ____H_MACHINEDEBUGGER 22 22 23 #include " VirtualBoxBase.h"23 #include "MachineDebuggerWrap.h" 24 24 #include <iprt/log.h> 25 25 #include <VBox/vmm/em.h> … … 28 28 29 29 class ATL_NO_VTABLE MachineDebugger : 30 public VirtualBoxBase, 31 VBOX_SCRIPTABLE_IMPL(IMachineDebugger) 30 public MachineDebuggerWrap 32 31 { 32 33 33 public: 34 35 VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT (MachineDebugger, IMachineDebugger)36 37 DECLARE_NOT_AGGREGATABLE (MachineDebugger)38 39 DECLARE_PROTECT_FINAL_CONSTRUCT()40 41 BEGIN_COM_MAP(MachineDebugger)42 VBOX_DEFAULT_INTERFACE_ENTRIES (IMachineDebugger)43 END_COM_MAP()44 34 45 35 DECLARE_EMPTY_CTOR_DTOR (MachineDebugger) … … 52 42 void uninit(); 53 43 54 // IMachineDebugger properties55 STDMETHOD(COMGETTER(SingleStep))(BOOL *a_pfEnabled);56 STDMETHOD(COMSETTER(SingleStep))(BOOL a_fEnable);57 STDMETHOD(COMGETTER(RecompileUser))(BOOL *a_pfEnabled);58 STDMETHOD(COMSETTER(RecompileUser))(BOOL a_fEnable);59 STDMETHOD(COMGETTER(RecompileSupervisor))(BOOL *a_pfEnabled);60 STDMETHOD(COMSETTER(RecompileSupervisor))(BOOL a_fEnable);61 STDMETHOD(COMGETTER(ExecuteAllInIEM))(BOOL *a_pfEnabled);62 STDMETHOD(COMSETTER(ExecuteAllInIEM))(BOOL a_fEnable);63 STDMETHOD(COMGETTER(PATMEnabled))(BOOL *a_pfEnabled);64 STDMETHOD(COMSETTER(PATMEnabled))(BOOL a_fEnable);65 STDMETHOD(COMGETTER(CSAMEnabled))(BOOL *a_pfEnabled);66 STDMETHOD(COMSETTER(CSAMEnabled))(BOOL a_fEnable);67 STDMETHOD(COMGETTER(LogEnabled))(BOOL *a_pfEnabled);68 STDMETHOD(COMSETTER(LogEnabled))(BOOL a_fEnable);69 STDMETHOD(COMGETTER(LogDbgFlags))(BSTR *a_pbstrSettings);70 STDMETHOD(COMGETTER(LogDbgGroups))(BSTR *a_pbstrSettings);71 STDMETHOD(COMGETTER(LogDbgDestinations))(BSTR *a_pbstrSettings);72 STDMETHOD(COMGETTER(LogRelFlags))(BSTR *a_pbstrSettings);73 STDMETHOD(COMGETTER(LogRelGroups))(BSTR *a_pbstrSettings);74 STDMETHOD(COMGETTER(LogRelDestinations))(BSTR *a_pbstrSettings);75 STDMETHOD(COMGETTER(HWVirtExEnabled))(BOOL *a_pfEnabled);76 STDMETHOD(COMGETTER(HWVirtExNestedPagingEnabled))(BOOL *a_pfEnabled);77 STDMETHOD(COMGETTER(HWVirtExVPIDEnabled))(BOOL *a_pfEnabled);78 STDMETHOD(COMGETTER(HWVirtExUXEnabled))(BOOL *a_pfEnabled);79 STDMETHOD(COMGETTER(PAEEnabled))(BOOL *a_pfEnabled);80 STDMETHOD(COMGETTER(OSName))(BSTR *a_pbstrName);81 STDMETHOD(COMGETTER(OSVersion))(BSTR *a_pbstrVersion);82 STDMETHOD(COMGETTER(VirtualTimeRate))(ULONG *a_puPct);83 STDMETHOD(COMSETTER(VirtualTimeRate))(ULONG a_uPct);84 STDMETHOD(COMGETTER(VM))(LONG64 *a_u64Vm);85 86 // IMachineDebugger methods87 STDMETHOD(DumpGuestCore)(IN_BSTR a_bstrFilename, IN_BSTR a_bstrCompression);88 STDMETHOD(DumpHostProcessCore)(IN_BSTR a_bstrFilename, IN_BSTR a_bstrCompression);89 STDMETHOD(Info)(IN_BSTR a_bstrName, IN_BSTR a_bstrArgs, BSTR *a_bstrInfo);90 STDMETHOD(InjectNMI)();91 STDMETHOD(ModifyLogFlags)(IN_BSTR a_bstrSettings);92 STDMETHOD(ModifyLogGroups)(IN_BSTR a_bstrSettings);93 STDMETHOD(ModifyLogDestinations)(IN_BSTR a_bstrSettings);94 STDMETHOD(ReadPhysicalMemory)(LONG64 a_Address, ULONG a_cbRead, ComSafeArrayOut(BYTE, a_abData));95 STDMETHOD(WritePhysicalMemory)(LONG64 a_Address, ULONG a_cbRead, ComSafeArrayIn(BYTE, a_abData));96 STDMETHOD(ReadVirtualMemory)(ULONG a_idCpu, LONG64 a_Address, ULONG a_cbRead, ComSafeArrayOut(BYTE, a_abData));97 STDMETHOD(WriteVirtualMemory)(ULONG a_idCpu, LONG64 a_Address, ULONG a_cbRead, ComSafeArrayIn(BYTE, a_abData));98 STDMETHOD(DetectOS)(BSTR *a_pbstrName);99 STDMETHOD(GetRegister)(ULONG a_idCpu, IN_BSTR a_bstrName, BSTR *a_pbstrValue);100 STDMETHOD(GetRegisters)(ULONG a_idCpu, ComSafeArrayOut(BSTR, a_bstrNames), ComSafeArrayOut(BSTR, a_bstrValues));101 STDMETHOD(SetRegister)(ULONG a_idCpu, IN_BSTR a_bstrName, IN_BSTR a_bstrValue);102 STDMETHOD(SetRegisters)(ULONG a_idCpu, ComSafeArrayIn(IN_BSTR, a_bstrNames), ComSafeArrayIn(IN_BSTR, a_bstrValues));103 STDMETHOD(DumpGuestStack)(ULONG a_idCpu, BSTR *a_pbstrStack);104 STDMETHOD(ResetStats)(IN_BSTR aPattern);105 STDMETHOD(DumpStats)(IN_BSTR aPattern);106 STDMETHOD(GetStats)(IN_BSTR aPattern, BOOL aWithDescriptions, BSTR *aStats);107 108 109 44 // "public-private methods" 110 void flushQueuedSettings();45 void i_flushQueuedSettings(); 111 46 112 47 private: 48 49 // wrapped IMachineDeugger properties 50 HRESULT getSingleStep(BOOL *aSingleStep); 51 HRESULT setSingleStep(BOOL aSingleStep); 52 HRESULT getRecompileUser(BOOL *aRecompileUser); 53 HRESULT setRecompileUser(BOOL aRecompileUser); 54 HRESULT getRecompileSupervisor(BOOL *aRecompileSupervisor); 55 HRESULT setRecompileSupervisor(BOOL aRecompileSupervisor); 56 HRESULT getExecuteAllInIEM(BOOL *aExecuteAllInIEM); 57 HRESULT setExecuteAllInIEM(BOOL aExecuteAllInIEM); 58 HRESULT getPATMEnabled(BOOL *aPATMEnabled); 59 HRESULT setPATMEnabled(BOOL aPATMEnabled); 60 HRESULT getCSAMEnabled(BOOL *aCSAMEnabled); 61 HRESULT setCSAMEnabled(BOOL aCSAMEnabled); 62 HRESULT getLogEnabled(BOOL *aLogEnabled); 63 HRESULT setLogEnabled(BOOL aLogEnabled); 64 HRESULT getLogDbgFlags(com::Utf8Str &aLogDbgFlags); 65 HRESULT getLogDbgGroups(com::Utf8Str &aLogDbgGroups); 66 HRESULT getLogDbgDestinations(com::Utf8Str &aLogDbgDestinations); 67 HRESULT getLogRelFlags(com::Utf8Str &aLogRelFlags); 68 HRESULT getLogRelGroups(com::Utf8Str &aLogRelGroups); 69 HRESULT getLogRelDestinations(com::Utf8Str &aLogRelDestinations); 70 HRESULT getHWVirtExEnabled(BOOL *aHWVirtExEnabled); 71 HRESULT getHWVirtExNestedPagingEnabled(BOOL *aHWVirtExNestedPagingEnabled); 72 HRESULT getHWVirtExVPIDEnabled(BOOL *aHWVirtExVPIDEnabled); 73 HRESULT getHWVirtExUXEnabled(BOOL *aHWVirtExUXEnabled); 74 HRESULT getOSName(com::Utf8Str &aOSName); 75 HRESULT getOSVersion(com::Utf8Str &aOSVersion); 76 HRESULT getPAEEnabled(BOOL *aPAEEnabled); 77 HRESULT getVirtualTimeRate(ULONG *aVirtualTimeRate); 78 HRESULT setVirtualTimeRate(ULONG aVirtualTimeRate); 79 HRESULT getVM(LONG64 *aVM); 80 81 // wrapped IMachineDeugger properties 82 HRESULT dumpGuestCore(const com::Utf8Str &aFilename, 83 const com::Utf8Str &aCompression); 84 HRESULT dumpHostProcessCore(const com::Utf8Str &aFilename, 85 const com::Utf8Str &aCompression); 86 HRESULT info(const com::Utf8Str &aName, 87 const com::Utf8Str &aArgs, 88 com::Utf8Str &aInfo); 89 HRESULT injectNMI(); 90 HRESULT modifyLogGroups(const com::Utf8Str &aSettings); 91 HRESULT modifyLogFlags(const com::Utf8Str &aSettings); 92 HRESULT modifyLogDestinations(const com::Utf8Str &aSettings); 93 HRESULT readPhysicalMemory(LONG64 aAddress, 94 ULONG aSize, 95 std::vector<BYTE> &aBytes); 96 HRESULT writePhysicalMemory(LONG64 aAddress, 97 ULONG aSize, 98 const std::vector<BYTE> &aBytes); 99 HRESULT readVirtualMemory(ULONG aCpuId, 100 LONG64 aAddress, 101 ULONG aSize, 102 std::vector<BYTE> &aBytes); 103 HRESULT writeVirtualMemory(ULONG aCpuId, 104 LONG64 aAddress, 105 ULONG aSize, 106 const std::vector<BYTE> &aBytes); 107 HRESULT detectOS(com::Utf8Str &aOs); 108 HRESULT getRegister(ULONG aCpuId, 109 const com::Utf8Str &aName, 110 com::Utf8Str &aValue); 111 HRESULT getRegisters(ULONG aCpuId, 112 std::vector<com::Utf8Str> &aNames, 113 std::vector<com::Utf8Str> &aValues); 114 HRESULT setRegister(ULONG aCpuId, 115 const com::Utf8Str &aName, 116 const com::Utf8Str &aValue); 117 HRESULT setRegisters(ULONG aCpuId, 118 const std::vector<com::Utf8Str> &aNames, 119 const std::vector<com::Utf8Str> &aValues); 120 HRESULT dumpGuestStack(ULONG aCpuId, 121 com::Utf8Str &aStack); 122 HRESULT resetStats(const com::Utf8Str &aPattern); 123 HRESULT dumpStats(const com::Utf8Str &aPattern); 124 HRESULT getStats(const com::Utf8Str &aPattern, 125 BOOL aWithDescriptions, 126 com::Utf8Str &aStats); 127 113 128 // private methods 114 bool queueSettings() const;115 HRESULT getEmExecPolicyProperty(EMEXECPOLICY enmPolicy, BOOL *pfEnforced);116 HRESULT setEmExecPolicyProperty(EMEXECPOLICY enmPolicy, BOOL fEnforce);129 bool i_queueSettings() const; 130 HRESULT i_getEmExecPolicyProperty(EMEXECPOLICY enmPolicy, BOOL *pfEnforced); 131 HRESULT i_setEmExecPolicyProperty(EMEXECPOLICY enmPolicy, BOOL fEnforce); 117 132 118 133 /** RTLogGetFlags, RTLogGetGroupSettings and RTLogGetDestinations function. */ … … 120 135 /** Function pointer. */ 121 136 typedef FNLOGGETSTR *PFNLOGGETSTR; 122 HRESULT logStringProps(PRTLOGGER pLogger, PFNLOGGETSTR pfnLogGetStr, const char *pszLogGetStr, BSTR *a_bstrSettings);137 HRESULT i_logStringProps(PRTLOGGER pLogger, PFNLOGGETSTR pfnLogGetStr, const char *pszLogGetStr, Utf8Str aSettings); 123 138 124 139 Console * const mParent; -
trunk/src/VBox/Main/src-all/DisplayUtils.cpp
r44529 r51092 23 23 #include <VBox/VBoxVideo.h> 24 24 25 int readSavedDisplayScreenshot(const Utf8Str &strStateFilePath, uint32_t u32Type, uint8_t **ppu8Data, uint32_t *pcbData, uint32_t *pu32Width, uint32_t *pu32Height) 25 int readSavedDisplayScreenshot(const Utf8Str &strStateFilePath, uint32_t u32Type, uint8_t **ppu8Data, uint32_t *pcbData, 26 uint32_t *pu32Width, uint32_t *pu32Height) 26 27 { 27 28 LogFlowFunc(("u32Type = %d [%s]\n", u32Type, strStateFilePath.c_str())); -
trunk/src/VBox/Main/src-all/ExtPackUtil.cpp
r48778 r51092 1123 1123 * stream is at an end. Optional. 1124 1124 */ 1125 int VBoxExtPackOpenTarFss(RTFILE hTarballFile, char *pszError, size_t cbError, PRTVFSFSSTREAM phTarFss, PRTMANIFEST phFileManifest) 1125 int VBoxExtPackOpenTarFss(RTFILE hTarballFile, char *pszError, size_t cbError, PRTVFSFSSTREAM phTarFss, 1126 PRTMANIFEST phFileManifest) 1126 1127 { 1127 1128 Assert(cbError > 0); … … 1147 1148 { 1148 1149 RTVFSIOSTREAM hPtIos; 1149 rc = RTManifestEntryAddPassthruIoStream(hFileManifest, hTarballIos, "extpack", RTMANIFEST_ATTR_SHA256, true /*read*/, &hPtIos); 1150 rc = RTManifestEntryAddPassthruIoStream(hFileManifest, hTarballIos, "extpack", RTMANIFEST_ATTR_SHA256, 1151 true /*read*/, &hPtIos); 1150 1152 if (RT_SUCCESS(rc)) 1151 1153 { … … 1332 1334 { 1333 1335 if (hXmlFile == NIL_RTVFSFILE) 1334 rc = vboxExtPackReturnError(VERR_MISSING, pszError, cbError, "Mandator file '%s' is missing", VBOX_EXTPACK_DESCRIPTION_NAME); 1336 rc = vboxExtPackReturnError(VERR_MISSING, pszError, cbError, "Mandator file '%s' is missing", 1337 VBOX_EXTPACK_DESCRIPTION_NAME); 1335 1338 if (hManifestFile == NIL_RTVFSFILE) 1336 rc = vboxExtPackReturnError(VERR_MISSING, pszError, cbError, "Mandator file '%s' is missing", VBOX_EXTPACK_MANIFEST_NAME); 1339 rc = vboxExtPackReturnError(VERR_MISSING, pszError, cbError, "Mandator file '%s' is missing", 1340 VBOX_EXTPACK_MANIFEST_NAME); 1337 1341 if (hSignatureFile == NIL_RTVFSFILE) 1338 rc = vboxExtPackReturnError(VERR_MISSING, pszError, cbError, "Mandator file '%s' is missing", VBOX_EXTPACK_SIGNATURE_NAME); 1342 rc = vboxExtPackReturnError(VERR_MISSING, pszError, cbError, "Mandator file '%s' is missing", 1343 VBOX_EXTPACK_SIGNATURE_NAME); 1339 1344 } 1340 1345 -
trunk/src/VBox/Main/src-all/ProgressImpl.cpp
r50952 r51092 159 159 uint64_t ullTimeRemaining = ullTimeTotal - ullTimeElapsed; 160 160 161 // Log(("Progress::GetTimeRemaining: dPercentDone %RI32, ullTimeNow = %RI64, ullTimeElapsed = %RI64, ullTimeTotal = %RI64, ullTimeRemaining = %RI64\n", 161 // Log(("Progress::GetTimeRemaining: dPercentDone %RI32, ullTimeNow = %RI64, ullTimeElapsed = %RI64, 162 // ullTimeTotal = %RI64, ullTimeRemaining = %RI64\n", 162 163 // (uint32_t)dPercentDone, ullTimeNow, ullTimeElapsed, ullTimeTotal, ullTimeRemaining)); 163 164 -
trunk/src/VBox/Main/src-client/ConsoleImpl.cpp
r50919 r51092 1142 1142 if (RT_SUCCESS(rc)) 1143 1143 { 1144 switch (u32GuestFlags & (VMMDEV_CREDENTIALS_JUDGE_OK | VMMDEV_CREDENTIALS_JUDGE_DENY | VMMDEV_CREDENTIALS_JUDGE_NOJUDGEMENT)) 1144 switch (u32GuestFlags & (VMMDEV_CREDENTIALS_JUDGE_OK | VMMDEV_CREDENTIALS_JUDGE_DENY | 1145 VMMDEV_CREDENTIALS_JUDGE_NOJUDGEMENT)) 1145 1146 { 1146 1147 case VMMDEV_CREDENTIALS_JUDGE_DENY: guestJudgement = AuthGuestAccessDenied; break; … … 1209 1210 AssertComRCReturn(hrc, VERR_ACCESS_DENIED); 1210 1211 1211 LogFlowFunc(("allowMultiConnection %d, reuseSingleConnection = %d, mcVRDPClients = %d, mu32SingleRDPClientId = %d\n", allowMultiConnection, reuseSingleConnection, mcVRDPClients, mu32SingleRDPClientId)); 1212 LogFlowFunc(("allowMultiConnection %d, reuseSingleConnection = %d, mcVRDPClients = %d, mu32SingleRDPClientId = %d\n", 1213 allowMultiConnection, reuseSingleConnection, mcVRDPClients, mu32SingleRDPClientId)); 1212 1214 1213 1215 if (allowMultiConnection == FALSE) … … 4287 4289 { 4288 4290 VMSTATE enmVMState = VMR3GetStateU(ptrVM.rawUVM()); 4289 if ( enmVMState == VMSTATE_RUNNING /** @todo LiveMigration: Forbid or deal correctly with the _LS variants */ 4291 if ( enmVMState == VMSTATE_RUNNING /** @todo LiveMigration: Forbid or deal 4292 correctly with the _LS variants */ 4290 4293 || enmVMState == VMSTATE_SUSPENDED) 4291 4294 { … … 6731 6734 vrc = RTDirCreateFullPath(pszDumpDir, 0700); 6732 6735 if (RT_FAILURE(vrc)) 6733 throw setError(E_FAIL, "Failed to setup CoreDumper. Couldn't create dump directory '%s' (%Rrc)\n", pszDumpDir, vrc); 6736 throw setError(E_FAIL, "Failed to setup CoreDumper. Couldn't create dump directory '%s' (%Rrc)\n", 6737 pszDumpDir, vrc); 6734 6738 } 6735 6739 … … 7898 7902 7899 7903 default: 7900 AssertMsgFailed(("%s/%s -> %s\n", Global::stringifyMachineState(that->mMachineState), VMR3GetStateName(enmOldState), VMR3GetStateName(enmState) )); 7904 AssertMsgFailed(("%s/%s -> %s\n", Global::stringifyMachineState(that->mMachineState), 7905 VMR3GetStateName(enmOldState), VMR3GetStateName(enmState) )); 7901 7906 that->setMachineState(MachineState_Paused); 7902 7907 break; … … 7937 7942 AssertMsg( that->mMachineState == MachineState_LiveSnapshotting 7938 7943 || that->mMachineState == MachineState_Teleporting, 7939 ("%s/%s -> %s\n", Global::stringifyMachineState(that->mMachineState), VMR3GetStateName(enmOldState), VMR3GetStateName(enmState) )); 7944 ("%s/%s -> %s\n", Global::stringifyMachineState(that->mMachineState), 7945 VMR3GetStateName(enmOldState), VMR3GetStateName(enmState) )); 7940 7946 break; 7941 7947 7942 7948 case VMSTATE_RUNNING_FT: 7943 7949 AssertMsg(that->mMachineState == MachineState_FaultTolerantSyncing, 7944 ("%s/%s -> %s\n", Global::stringifyMachineState(that->mMachineState), VMR3GetStateName(enmOldState), VMR3GetStateName(enmState) )); 7950 ("%s/%s -> %s\n", Global::stringifyMachineState(that->mMachineState), 7951 VMR3GetStateName(enmOldState), VMR3GetStateName(enmState) )); 7945 7952 break; 7946 7953 … … 8702 8709 { 8703 8710 LogFlowThisFuncEnter(); 8704 LogFlowThisFunc(("u32ClientId = %d, pDevList=%p, cbDevList = %d, fDescExt = %d\n", u32ClientId, pDevList, cbDevList, fDescExt)); 8711 LogFlowThisFunc(("u32ClientId = %d, pDevList=%p, cbDevList = %d, fDescExt = %d\n", 8712 u32ClientId, pDevList, cbDevList, fDescExt)); 8705 8713 8706 8714 AutoCaller autoCaller(this); … … 9062 9070 MachineDebugger *machineDebugger = pConsole->getMachineDebugger(); 9063 9071 if (machineDebugger) 9064 machineDebugger-> flushQueuedSettings();9072 machineDebugger->i_flushQueuedSettings(); 9065 9073 9066 9074 /* … … 9083 9091 ErrorInfoKeeper eik; 9084 9092 pConsole->setVMRuntimeErrorCallbackF(0, "BrokenSharedFolder", 9085 9086 9087 9093 N_("The shared folder '%s' could not be set up: %ls.\n" 9094 "The shared folder setup will not be complete. It is recommended to power down the virtual " 9095 "machine and fix the shared folder settings while the machine is not running"), 9088 9096 it->first.c_str(), eik.getText().raw()); 9089 9097 } … … 9513 9521 9514 9522 pTask->mProgress->SetNextOperation(Bstr(tr("Saving the machine state")).raw(), 9515 pTask->ulMemSize); // operation weight, same as computed when setting up progress object 9523 pTask->ulMemSize); // operation weight, same as computed 9524 // when setting up progress object 9516 9525 if (!pTask->bstrSavedStateFile.isEmpty()) 9517 9526 { -
trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp
r50996 r51092 1026 1026 else if ( osTypeId == "MacOS107" 1027 1027 || osTypeId == "MacOS107_64") 1028 uMaxIntelFamilyModelStep = RT_MAKE_U32_FROM_U8(1, 23, 6, 7); /* Penryn / X5482 */ /** @todo figure out what is required here. */ 1028 uMaxIntelFamilyModelStep = RT_MAKE_U32_FROM_U8(1, 23, 6, 7); /* Penryn / X5482 */ /** @todo figure out 1029 what is required here. */ 1029 1030 else if ( osTypeId == "MacOS108" 1030 1031 || osTypeId == "MacOS108_64") 1031 uMaxIntelFamilyModelStep = RT_MAKE_U32_FROM_U8(1, 23, 6, 7); /* Penryn / X5482 */ /** @todo figure out what is required here. */ 1032 uMaxIntelFamilyModelStep = RT_MAKE_U32_FROM_U8(1, 23, 6, 7); /* Penryn / X5482 */ /** @todo figure out 1033 what is required here. */ 1032 1034 else if ( osTypeId == "MacOS109" 1033 1035 || osTypeId == "MacOS109_64") 1034 uMaxIntelFamilyModelStep = RT_MAKE_U32_FROM_U8(1, 23, 6, 7); /* Penryn / X5482 */ /** @todo figure out what is required here. */ 1036 uMaxIntelFamilyModelStep = RT_MAKE_U32_FROM_U8(1, 23, 6, 7); /* Penryn / X5482 */ /** @todo figure 1037 out what is required here. */ 1035 1038 if (uMaxIntelFamilyModelStep != UINT32_MAX) 1036 1039 InsertConfigInteger(pCPUM, "MaxIntelFamilyModelStep", uMaxIntelFamilyModelStep); … … 1141 1144 #endif 1142 1145 1143 /** @todo Not exactly pretty to check strings; VBOXOSTYPE would be better, but that requires quite a bit of API change in Main. */ 1146 /** @todo Not exactly pretty to check strings; VBOXOSTYPE would be better, 1147 but that requires quite a bit of API change in Main. */ 1144 1148 if ( fIOAPIC 1145 1149 && ( osTypeId == "WindowsNT4" … … 2902 2906 parm.u.pointer.size = sizeof(IConsole *); 2903 2907 2904 rc = pVMMDev->hgcmHostCall("VBoxSharedCrOpenGL", SHCRGL_HOST_FN_SET_CONSOLE, SHCRGL_CPARMS_SET_CONSOLE, &parm); 2908 rc = pVMMDev->hgcmHostCall("VBoxSharedCrOpenGL", SHCRGL_HOST_FN_SET_CONSOLE, 2909 SHCRGL_CPARMS_SET_CONSOLE, &parm); 2905 2910 if (!RT_SUCCESS(rc)) 2906 2911 AssertMsgFailed(("SHCRGL_HOST_FN_SET_CONSOLE failed with %Rrc\n", rc)); … … 3287 3292 else 3288 3293 InsertConfigString(pNode, pszCFGMValueName, strCFGMValueUtf8); 3289 AssertLogRelMsgRCBreak(rc, ("failed to insert CFGM value '%s' to key '%s'\n", strCFGMValueUtf8.c_str(), pszExtraDataKey)); 3294 AssertLogRelMsgRCBreak(rc, ("failed to insert CFGM value '%s' to key '%s'\n", 3295 strCFGMValueUtf8.c_str(), pszExtraDataKey)); 3290 3296 } 3291 3297 } … … 3639 3645 3640 3646 if (enmBus == StorageBus_USB) 3641 rc = PDMR3UsbDriverDetach(pUVM, pcszDevice, uInstance, uLUN, NULL, 0, fHotplug ? 0 : PDM_TACH_FLAGS_NOT_HOT_PLUG); 3647 rc = PDMR3UsbDriverDetach(pUVM, pcszDevice, uInstance, uLUN, NULL, 0, 3648 fHotplug ? 0 : PDM_TACH_FLAGS_NOT_HOT_PLUG); 3642 3649 else 3643 3650 rc = PDMR3DeviceDetach(pUVM, pcszDevice, uInstance, uLUN, fHotplug ? 0 : PDM_TACH_FLAGS_NOT_HOT_PLUG); … … 4070 4077 hrc = pMedium->COMGETTER(Location)(loc.asOutParam()); H(); 4071 4078 setVMRuntimeErrorCallbackF(0, "DvdOrFloppyImageInaccessible", 4072 4079 "The image file '%ls' is inaccessible and is being ignored. Please select a different image file for the virtual %s drive.", 4073 4080 loc.raw(), 4074 4081 enmType == DeviceType_DVD ? "DVD" : "floppy"); … … 4685 4692 4686 4693 /* get the adapter's INetCfgComponent*/ 4687 hrc = VBoxNetCfgWinGetComponentByGuid(pNc, &GUID_DEVCLASS_NET, (GUID*)hostIFGuid.raw(), pAdaptorComponent.asOutParam()); 4694 hrc = VBoxNetCfgWinGetComponentByGuid(pNc, &GUID_DEVCLASS_NET, (GUID*)hostIFGuid.raw(), 4695 pAdaptorComponent.asOutParam()); 4688 4696 if (hrc != S_OK) 4689 4697 { … … 4712 4720 hrc = HRESULT_FROM_WIN32(err); 4713 4721 AssertMsgFailed(("%hrc=%Rhrc %#x\n", hrc, hrc)); 4714 AssertLogRelMsgFailed(("NetworkAttachmentType_Bridged: WideCharToMultiByte failed, hr=%Rhrc (0x%x) err=%u\n", hrc, hrc, err)); 4722 AssertLogRelMsgFailed(( 4723 "NetworkAttachmentType_Bridged: WideCharToMultiByte failed, hr=%Rhrc (0x%x) err=%u\n", 4724 hrc, hrc, err)); 4715 4725 } 4716 4726 } … … 4735 4745 { 4736 4746 VBoxNetCfgWinReleaseINetCfg(pNc, FALSE /*fHasWriteLock*/); 4737 AssertLogRelMsgFailed(("NetworkAttachmentType_Bridged: VBoxNetCfgWinGetComponentByGuid failed, hrc (0x%x)", hrc)); 4747 AssertLogRelMsgFailed(("NetworkAttachmentType_Bridged: VBoxNetCfgWinGetComponentByGuid failed, hrc (0x%x)", 4748 hrc)); 4738 4749 H(); 4739 4750 } … … 4761 4772 "sysctl is set. Either run 'chmod 0666 /dev/%s' or " 4762 4773 "change the group of that node to vboxusers and make yourself " 4763 "a member of that group. Make sure that these changes are permanent."), pszBridgedIfName, pszBridgedIfName); 4774 "a member of that group. Make sure that these changes are permanent."), 4775 pszBridgedIfName, pszBridgedIfName); 4764 4776 default: 4765 4777 AssertMsgFailed(("Could not attach to tap interface! Bad!\n")); … … 5064 5076 5065 5077 /* get the adapter's INetCfgComponent*/ 5066 hrc = VBoxNetCfgWinGetComponentByGuid(pNc, &GUID_DEVCLASS_NET, (GUID*)hostIFGuid.raw(), pAdaptorComponent.asOutParam()); 5078 hrc = VBoxNetCfgWinGetComponentByGuid(pNc, &GUID_DEVCLASS_NET, (GUID*)hostIFGuid.raw(), 5079 pAdaptorComponent.asOutParam()); 5067 5080 if (hrc != S_OK) 5068 5081 { … … 5090 5103 DWORD err = GetLastError(); 5091 5104 hrc = HRESULT_FROM_WIN32(err); 5092 AssertLogRelMsgFailed(("NetworkAttachmentType_HostOnly: WideCharToMultiByte failed, hr=%Rhrc (0x%x) err=%u\n", hrc, hrc, err)); 5105 AssertLogRelMsgFailed(( 5106 "NetworkAttachmentType_HostOnly: WideCharToMultiByte failed, hr=%Rhrc (0x%x) err=%u\n", hrc, hrc, err)); 5093 5107 } 5094 5108 } … … 5111 5125 { 5112 5126 VBoxNetCfgWinReleaseINetCfg(pNc, FALSE /*fHasWriteLock*/); 5113 AssertLogRelMsgFailed(("NetworkAttachmentType_HostOnly: VBoxNetCfgWinGetComponentByGuid failed, hrc=%Rhrc (0x%x)\n", hrc, hrc)); 5127 AssertLogRelMsgFailed(( 5128 "NetworkAttachmentType_HostOnly: VBoxNetCfgWinGetComponentByGuid failed, hrc=%Rhrc (0x%x)\n", hrc, hrc)); 5114 5129 H(); 5115 5130 } … … 5127 5142 InsertConfigString(pCfg, "Trunk", pszTrunk); 5128 5143 InsertConfigString(pCfg, "Network", szNetwork); 5129 InsertConfigInteger(pCfg, "IgnoreConnectFailure", (uint64_t)fIgnoreConnectFailure); /** @todo why is this windows only?? */ 5144 InsertConfigInteger(pCfg, "IgnoreConnectFailure", (uint64_t)fIgnoreConnectFailure); /** @todo why is this 5145 windows only?? */ 5130 5146 networkName = Bstr(szNetwork); 5131 5147 trunkName = Bstr(pszTrunk); -
trunk/src/VBox/Main/src-client/ConsoleImplTeleporter.cpp
r50874 r51092 807 807 */ 808 808 AssertLogRelMsg(enmVMState == VMSTATE_SUSPENDED, ("%s\n", VMR3GetStateName(enmVMState))); 809 AssertLogRelMsg(enmMachineState == MachineState_TeleportingPausedVM, ("%s\n", Global::stringifyMachineState(enmMachineState))); 809 AssertLogRelMsg(enmMachineState == MachineState_TeleportingPausedVM,("%s\n", 810 Global::stringifyMachineState(enmMachineState))); 810 811 811 812 ptrVM.release(); -
trunk/src/VBox/Main/src-client/ConsoleVRDPServer.cpp
r50940 r51092 197 197 #endif /* DEBUG_sunlover */ 198 198 199 static void findTopLeftBorder(const uint8_t *pu8AndMask, const uint8_t *pu8XorMask, uint32_t width, uint32_t height, uint32_t *pxSkip, uint32_t *pySkip) 199 static void findTopLeftBorder(const uint8_t *pu8AndMask, const uint8_t *pu8XorMask, uint32_t width, 200 uint32_t height, uint32_t *pxSkip, uint32_t *pySkip) 200 201 { 201 202 /* … … 365 366 ComSafeArrayIn(BYTE,inShape)) 366 367 { 367 LogSunlover(("VRDPConsoleListener::OnMousePointerShapeChange: %d, %d, %lux%lu, @%lu,%lu\n", visible, alpha, width, height, xHot, yHot)); 368 LogSunlover(("VRDPConsoleListener::OnMousePointerShapeChange: %d, %d, %lux%lu, @%lu,%lu\n", 369 visible, alpha, width, height, xHot, yHot)); 368 370 369 371 if (m_server) … … 557 559 }; 558 560 559 DECLCALLBACK(int) ConsoleVRDPServer::VRDPCallbackQueryProperty(void *pvCallback, uint32_t index, void *pvBuffer, uint32_t cbBuffer, uint32_t *pcbOut) 561 DECLCALLBACK(int) ConsoleVRDPServer::VRDPCallbackQueryProperty(void *pvCallback, uint32_t index, void *pvBuffer, 562 uint32_t cbBuffer, uint32_t *pcbOut) 560 563 { 561 564 ConsoleVRDPServer *server = static_cast<ConsoleVRDPServer*>(pvCallback); … … 675 678 { 676 679 com::Bstr bstr; 677 HRESULT hrc = server->mConsole->getVRDEServer()->GetVRDEProperty(Bstr("VideoChannel/Enabled").raw(), bstr.asOutParam()); 680 HRESULT hrc = server->mConsole->getVRDEServer()->GetVRDEProperty(Bstr("VideoChannel/Enabled").raw(), 681 bstr.asOutParam()); 678 682 679 683 if (hrc != S_OK) … … 703 707 { 704 708 com::Bstr bstr; 705 HRESULT hrc = server->mConsole->getVRDEServer()->GetVRDEProperty(Bstr("VideoChannel/Quality").raw(), bstr.asOutParam()); 709 HRESULT hrc = server->mConsole->getVRDEServer()->GetVRDEProperty(Bstr("VideoChannel/Quality").raw(), 710 bstr.asOutParam()); 706 711 707 712 if (hrc != S_OK) … … 815 820 /* Generic properties. */ 816 821 const char *pszPropertyName = &pFeature->achInfo[9]; 817 HRESULT hrc = server->mConsole->getVRDEServer()->GetVRDEProperty(Bstr(pszPropertyName).raw(), bstrValue.asOutParam()); 822 HRESULT hrc = server->mConsole->getVRDEServer()->GetVRDEProperty(Bstr(pszPropertyName).raw(), 823 bstrValue.asOutParam()); 818 824 if (FAILED(hrc)) 819 825 { … … 916 922 } 917 923 918 DECLCALLBACK(int) ConsoleVRDPServer::VRDPCallbackClientLogon(void *pvCallback, uint32_t u32ClientId, const char *pszUser, const char *pszPassword, const char *pszDomain) 924 DECLCALLBACK(int) ConsoleVRDPServer::VRDPCallbackClientLogon(void *pvCallback, uint32_t u32ClientId, const char *pszUser, 925 const char *pszPassword, const char *pszDomain) 919 926 { 920 927 ConsoleVRDPServer *server = static_cast<ConsoleVRDPServer*>(pvCallback); … … 940 947 } 941 948 942 DECLCALLBACK(void) ConsoleVRDPServer::VRDPCallbackClientDisconnect(void *pvCallback, uint32_t u32ClientId, uint32_t fu32Intercepted) 949 DECLCALLBACK(void) ConsoleVRDPServer::VRDPCallbackClientDisconnect(void *pvCallback, uint32_t u32ClientId, 950 uint32_t fu32Intercepted) 943 951 { 944 952 ConsoleVRDPServer *server = static_cast<ConsoleVRDPServer*>(pvCallback); … … 974 982 } 975 983 976 DECLCALLBACK(int) ConsoleVRDPServer::VRDPCallbackIntercept(void *pvCallback, uint32_t u32ClientId, uint32_t fu32Intercept, void **ppvIntercept) 984 DECLCALLBACK(int) ConsoleVRDPServer::VRDPCallbackIntercept(void *pvCallback, uint32_t u32ClientId, uint32_t fu32Intercept, 985 void **ppvIntercept) 977 986 { 978 987 ConsoleVRDPServer *server = static_cast<ConsoleVRDPServer*>(pvCallback); … … 1052 1061 } 1053 1062 1054 DECLCALLBACK(int) ConsoleVRDPServer::VRDPCallbackUSB(void *pvCallback, void *pvIntercept, uint32_t u32ClientId, uint8_t u8Code, const void *pvRet, uint32_t cbRet) 1063 DECLCALLBACK(int) ConsoleVRDPServer::VRDPCallbackUSB(void *pvCallback, void *pvIntercept, uint32_t u32ClientId, 1064 uint8_t u8Code, const void *pvRet, uint32_t cbRet) 1055 1065 { 1056 1066 #ifdef VBOX_WITH_USB … … 1061 1071 } 1062 1072 1063 DECLCALLBACK(int) ConsoleVRDPServer::VRDPCallbackClipboard(void *pvCallback, void *pvIntercept, uint32_t u32ClientId, uint32_t u32Function, uint32_t u32Format, const void *pvData, uint32_t cbData) 1073 DECLCALLBACK(int) ConsoleVRDPServer::VRDPCallbackClipboard(void *pvCallback, void *pvIntercept, uint32_t u32ClientId, 1074 uint32_t u32Function, uint32_t u32Format, 1075 const void *pvData, uint32_t cbData) 1064 1076 { 1065 1077 return ClipboardCallback(pvIntercept, u32ClientId, u32Function, u32Format, pvData, cbData); 1066 1078 } 1067 1079 1068 DECLCALLBACK(bool) ConsoleVRDPServer::VRDPCallbackFramebufferQuery(void *pvCallback, unsigned uScreenId, VRDEFRAMEBUFFERINFO *pInfo) 1080 DECLCALLBACK(bool) ConsoleVRDPServer::VRDPCallbackFramebufferQuery(void *pvCallback, unsigned uScreenId, 1081 VRDEFRAMEBUFFERINFO *pInfo) 1069 1082 { 1070 1083 ConsoleVRDPServer *server = static_cast<ConsoleVRDPServer*>(pvCallback); … … 1231 1244 if (server->m_fGuestWantsAbsolute) 1232 1245 { 1233 pConsole->getMouse()->PutMouseEventAbsolute(pInputPoint->x + 1, pInputPoint->y + 1, iWheel, 0 /* Horizontal wheel */, mouseButtons); 1246 pConsole->getMouse()->PutMouseEventAbsolute(pInputPoint->x + 1, pInputPoint->y + 1, iWheel, 1247 0 /* Horizontal wheel */, mouseButtons); 1234 1248 } else 1235 1249 { … … 1288 1302 } 1289 1303 1290 DECLCALLBACK(void) ConsoleVRDPServer::VRDPCallbackVideoModeHint(void *pvCallback, unsigned cWidth, unsigned cHeight, unsigned cBitsPerPixel, unsigned uScreenId) 1304 DECLCALLBACK(void) ConsoleVRDPServer::VRDPCallbackVideoModeHint(void *pvCallback, unsigned cWidth, unsigned cHeight, 1305 unsigned cBitsPerPixel, unsigned uScreenId) 1291 1306 { 1292 1307 ConsoleVRDPServer *server = static_cast<ConsoleVRDPServer*>(pvCallback); -
trunk/src/VBox/Main/src-client/DisplayImpl.cpp
r51029 r51092 282 282 { 283 283 VBOX_DISPLAY_SAVESCREENSHOT_DATA *pData = (VBOX_DISPLAY_SAVESCREENSHOT_DATA*)pvCtx; 284 displayMakeThumbnail(pu8BufferAddress, uGuestWidth, uGuestHeight, &pData->pu8Thumbnail, &pData->cbThumbnail, &pData->cxThumbnail, &pData->cyThumbnail); 285 int rc = DisplayMakePNG(pu8BufferAddress, uGuestWidth, uGuestHeight, &pData->pu8PNG, &pData->cbPNG, &pData->cxPNG, &pData->cyPNG, 1); 284 displayMakeThumbnail(pu8BufferAddress, uGuestWidth, uGuestHeight, &pData->pu8Thumbnail, 285 &pData->cbThumbnail, &pData->cxThumbnail, &pData->cyThumbnail); 286 int rc = DisplayMakePNG(pu8BufferAddress, uGuestWidth, uGuestHeight, &pData->pu8PNG, 287 &pData->cbPNG, &pData->cxPNG, &pData->cyPNG, 1); 286 288 if (RT_FAILURE(rc)) 287 289 { … … 334 336 if (pVMMDev) 335 337 { 336 VBOX_DISPLAY_SAVESCREENSHOT_DATA *pScreenshot = (VBOX_DISPLAY_SAVESCREENSHOT_DATA*)RTMemAllocZ(sizeof (*pScreenshot)); 338 VBOX_DISPLAY_SAVESCREENSHOT_DATA *pScreenshot = 339 (VBOX_DISPLAY_SAVESCREENSHOT_DATA*)RTMemAllocZ(sizeof (*pScreenshot)); 337 340 if (pScreenshot) 338 341 { … … 879 882 if (pVMMDev) 880 883 { 881 VBOXCRCMDCTL_HGCM *pCtl = (VBOXCRCMDCTL_HGCM*)RTMemAlloc(sizeof (CRVBOXHGCMDEVRESIZE) + sizeof (VBOXCRCMDCTL_HGCM)); 884 VBOXCRCMDCTL_HGCM *pCtl = 885 (VBOXCRCMDCTL_HGCM*)RTMemAlloc(sizeof (CRVBOXHGCMDEVRESIZE) + sizeof (VBOXCRCMDCTL_HGCM)); 882 886 if (pCtl) 883 887 { … … 1059 1063 pFBInfo->pendingResize.fPending = false; 1060 1064 handleDisplayResize (uScreenId, pFBInfo->pendingResize.bpp, pFBInfo->pendingResize.pvVRAM, 1061 pFBInfo->pendingResize.cbLine, pFBInfo->pendingResize.w, pFBInfo->pendingResize.h, pFBInfo->pendingResize.flags); 1065 pFBInfo->pendingResize.cbLine, pFBInfo->pendingResize.w, pFBInfo->pendingResize.h, 1066 pFBInfo->pendingResize.flags); 1062 1067 break; 1063 1068 } … … 1522 1527 } VBVADIRTYREGION; 1523 1528 1524 static void vbvaRgnInit (VBVADIRTYREGION *prgn, DISPLAYFBINFO *paFramebuffers, unsigned cMonitors, Display *pd, PPDMIDISPLAYPORT pp) 1529 static void vbvaRgnInit (VBVADIRTYREGION *prgn, DISPLAYFBINFO *paFramebuffers, unsigned cMonitors, 1530 Display *pd, PPDMIDISPLAYPORT pp) 1525 1531 { 1526 1532 prgn->paFramebuffers = paFramebuffers; … … 1866 1872 mfu32SupportedOrders = 0; 1867 1873 1868 vbvaSetMemoryFlags (mpVbvaMemory, mfVideoAccelEnabled, mfVideoAccelVRDP, mfu32SupportedOrders, maFramebuffers, mcMonitors); 1874 vbvaSetMemoryFlags (mpVbvaMemory, mfVideoAccelEnabled, mfVideoAccelVRDP, mfu32SupportedOrders, 1875 maFramebuffers, mcMonitors); 1869 1876 #ifdef VBOX_WITH_HGSMI 1870 1877 /* Here is VRDP-IN thread. Process the request in vbvaUpdateBegin under DevVGA lock on an EMT. */ … … 1885 1892 mfu32SupportedOrders = ~0; 1886 1893 1887 vbvaSetMemoryFlags (mpVbvaMemory, mfVideoAccelEnabled, mfVideoAccelVRDP, mfu32SupportedOrders, maFramebuffers, mcMonitors); 1894 vbvaSetMemoryFlags (mpVbvaMemory, mfVideoAccelEnabled, mfVideoAccelVRDP, mfu32SupportedOrders, 1895 maFramebuffers, mcMonitors); 1888 1896 #ifdef VBOX_WITH_HGSMI 1889 1897 /* Here is VRDP-IN thread. Process the request in vbvaUpdateBegin under DevVGA lock on an EMT. */ … … 2199 2207 #ifdef DEBUG_sunlover_2 2200 2208 LogFlowFunc(("indexRecordFirst = %d, indexRecordFree = %d, off32Data = %d, off32Free = %d\n", 2201 mpVbvaMemory->indexRecordFirst, mpVbvaMemory->indexRecordFree, mpVbvaMemory->off32Data, mpVbvaMemory->off32Free)); 2209 mpVbvaMemory->indexRecordFirst, mpVbvaMemory->indexRecordFree, 2210 mpVbvaMemory->off32Data, mpVbvaMemory->off32Free)); 2202 2211 #endif /* DEBUG_sunlover_2 */ 2203 2212 … … 2608 2617 2609 2618 #if defined(VBOX_WITH_HGCM) && defined(VBOX_WITH_CROGL) 2610 BOOL Display::displayCheckTakeScreenshotCrOgl(Display *pDisplay, ULONG aScreenId, uint8_t *pu8Data, uint32_t u32Width, uint32_t u32Height) 2619 BOOL Display::displayCheckTakeScreenshotCrOgl(Display *pDisplay, ULONG aScreenId, uint8_t *pu8Data, 2620 uint32_t u32Width, uint32_t u32Height) 2611 2621 { 2612 2622 BOOL is3denabled; … … 2657 2667 #endif 2658 2668 2659 int Display::displayTakeScreenshotEMT(Display *pDisplay, ULONG aScreenId, uint8_t **ppu8Data, size_t *pcbData, uint32_t *pu32Width, uint32_t *pu32Height) 2669 int Display::displayTakeScreenshotEMT(Display *pDisplay, ULONG aScreenId, uint8_t **ppu8Data, size_t *pcbData, 2670 uint32_t *pu32Width, uint32_t *pu32Height) 2660 2671 { 2661 2672 int rc; … … 4030 4041 * @see PDMIDISPLAYCONNECTOR::pfnProcessAdapterData 4031 4042 */ 4032 DECLCALLBACK(void) Display::displayProcessAdapterDataCallback(PPDMIDISPLAYCONNECTOR pInterface, void *pvVRAM, uint32_t u32VRAMSize) 4043 DECLCALLBACK(void) Display::displayProcessAdapterDataCallback(PPDMIDISPLAYCONNECTOR pInterface, void *pvVRAM, 4044 uint32_t u32VRAMSize) 4033 4045 { 4034 4046 PDRVMAINDISPLAY pDrv = PDMIDISPLAYCONNECTOR_2_MAINDISPLAY(pInterface); … … 4090 4102 pFBInfo->u32InformationSize = pDisplay->u32InformationSize; 4091 4103 4092 LogRelFlow(("VBOX_VIDEO_INFO_TYPE_DISPLAY: %d: at 0x%08X, size 0x%08X, info 0x%08X\n", pDisplay->u32Index, pDisplay->u32Offset, pDisplay->u32FramebufferSize, pDisplay->u32InformationSize)); 4104 LogRelFlow(("VBOX_VIDEO_INFO_TYPE_DISPLAY: %d: at 0x%08X, size 0x%08X, info 0x%08X\n", pDisplay->u32Index, 4105 pDisplay->u32Offset, pDisplay->u32FramebufferSize, pDisplay->u32InformationSize)); 4093 4106 } 4094 4107 else if (pHdr->u8Type == VBOX_VIDEO_INFO_TYPE_QUERY_CONF32) … … 4129 4142 break; 4130 4143 } 4131 else if (pHdr->u8Type != VBOX_VIDEO_INFO_TYPE_NV_HEAP) /** @todo why is Additions/WINNT/Graphics/Miniport/VBoxVideo.cpp pushing this to us? */ 4144 else if (pHdr->u8Type != VBOX_VIDEO_INFO_TYPE_NV_HEAP) /** @todo why is 4145 Additions/WINNT/Graphics/Miniport/VBoxVideo. cpp 4146 pushing this to us? */ 4132 4147 { 4133 4148 LogRel(("Guest adapter information contains unsupported type %d. The block has been skipped.\n", pHdr->u8Type)); … … 4194 4209 4195 4210 LogRelFlow(("VBOX_VIDEO_INFO_TYPE_SCREEN: (%p) %d: at %d,%d, linesize 0x%X, size %dx%d, bpp %d, flags 0x%02X\n", 4196 pHdr, uScreenId, pScreen->xOrigin, pScreen->yOrigin, pScreen->u32LineSize, pScreen->u16Width, pScreen->u16Height, pScreen->bitsPerPixel, pScreen->u8Flags)); 4211 pHdr, uScreenId, pScreen->xOrigin, pScreen->yOrigin, pScreen->u32LineSize, pScreen->u16Width, 4212 pScreen->u16Height, pScreen->bitsPerPixel, pScreen->u8Flags)); 4197 4213 4198 4214 if (uScreenId != VBOX_VIDEO_PRIMARY_SCREEN) … … 4209 4225 } 4210 4226 4211 pDrv->pDisplay->handleDisplayResize(uScreenId, pScreen->bitsPerPixel, (uint8_t *)pvVRAM + pFBInfo->u32Offset, pScreen->u32LineSize, pScreen->u16Width, pScreen->u16Height, VBVA_SCREEN_F_ACTIVE); 4227 pDrv->pDisplay->handleDisplayResize(uScreenId, pScreen->bitsPerPixel, 4228 (uint8_t *)pvVRAM + pFBInfo->u32Offset, 4229 pScreen->u32LineSize, 4230 pScreen->u16Width, pScreen->u16Height, 4231 VBVA_SCREEN_F_ACTIVE); 4212 4232 } 4213 4233 } … … 4301 4321 void Display::handleCrHgsmiCommandCompletion(int32_t result, uint32_t u32Function, PVBOXHGCMSVCPARM pParam) 4302 4322 { 4303 mpDrv->pVBVACallbacks->pfnCrHgsmiCommandCompleteAsync(mpDrv->pVBVACallbacks, (PVBOXVDMACMD_CHROMIUM_CMD)pParam->u.pointer.addr, result); 4323 mpDrv->pVBVACallbacks->pfnCrHgsmiCommandCompleteAsync(mpDrv->pVBVACallbacks, 4324 (PVBOXVDMACMD_CHROMIUM_CMD)pParam->u.pointer.addr, result); 4304 4325 } 4305 4326 … … 4352 4373 { 4353 4374 bool fCheckPendingViewport = (pCtl->enmType == VBOXVDMACMD_CHROMIUM_CTL_TYPE_CRHGSMI_SETUP); 4354 rc = pVMMDev->hgcmHostFastCallAsync(mhCrOglSvc, SHCRGL_HOST_FN_CRHGSMI_CTL, &parm, Display::displayCrHgsmiControlCompletion, this); 4375 rc = pVMMDev->hgcmHostFastCallAsync(mhCrOglSvc, SHCRGL_HOST_FN_CRHGSMI_CTL, &parm, 4376 Display::displayCrHgsmiControlCompletion, this); 4355 4377 AssertRC(rc); 4356 4378 if (RT_SUCCESS(rc)) … … 4365 4387 continue; 4366 4388 4367 rc = crViewportNotify(ul, pFb->pendingViewportInfo.x, pFb->pendingViewportInfo.y, pFb->pendingViewportInfo.width, pFb->pendingViewportInfo.height); 4389 rc = crViewportNotify(ul, pFb->pendingViewportInfo.x, pFb->pendingViewportInfo.y, 4390 pFb->pendingViewportInfo.width, pFb->pendingViewportInfo.height); 4368 4391 if (RT_SUCCESS(rc)) 4369 4392 pFb->pendingViewportInfo.fPending = false; … … 4386 4409 } 4387 4410 4388 DECLCALLBACK(void) Display::displayCrHgsmiCommandProcess(PPDMIDISPLAYCONNECTOR pInterface, PVBOXVDMACMD_CHROMIUM_CMD pCmd, uint32_t cbCmd) 4411 DECLCALLBACK(void) Display::displayCrHgsmiCommandProcess(PPDMIDISPLAYCONNECTOR pInterface, PVBOXVDMACMD_CHROMIUM_CMD pCmd, 4412 uint32_t cbCmd) 4389 4413 { 4390 4414 PDRVMAINDISPLAY pDrv = PDMIDISPLAYCONNECTOR_2_MAINDISPLAY(pInterface); … … 4393 4417 } 4394 4418 4395 DECLCALLBACK(void) Display::displayCrHgsmiControlProcess(PPDMIDISPLAYCONNECTOR pInterface, PVBOXVDMACMD_CHROMIUM_CTL pCmd, uint32_t cbCmd) 4419 DECLCALLBACK(void) Display::displayCrHgsmiControlProcess(PPDMIDISPLAYCONNECTOR pInterface, PVBOXVDMACMD_CHROMIUM_CTL pCmd, 4420 uint32_t cbCmd) 4396 4421 { 4397 4422 PDRVMAINDISPLAY pDrv = PDMIDISPLAYCONNECTOR_2_MAINDISPLAY(pInterface); … … 4400 4425 } 4401 4426 4402 DECLCALLBACK(void) Display::displayCrHgsmiCommandCompletion(int32_t result, uint32_t u32Function, PVBOXHGCMSVCPARM pParam, void *pvContext) 4427 DECLCALLBACK(void) Display::displayCrHgsmiCommandCompletion(int32_t result, uint32_t u32Function, PVBOXHGCMSVCPARM pParam, 4428 void *pvContext) 4403 4429 { 4404 4430 AssertMsgFailed(("not expected!")); … … 4407 4433 } 4408 4434 4409 DECLCALLBACK(void) Display::displayCrHgsmiControlCompletion(int32_t result, uint32_t u32Function, PVBOXHGCMSVCPARM pParam, void *pvContext) 4435 DECLCALLBACK(void) Display::displayCrHgsmiControlCompletion(int32_t result, uint32_t u32Function, PVBOXHGCMSVCPARM pParam, 4436 void *pvContext) 4410 4437 { 4411 4438 Display *pDisplay = (Display *)pvContext; … … 4416 4443 4417 4444 #if defined(VBOX_WITH_HGCM) && defined(VBOX_WITH_CROGL) 4418 DECLCALLBACK(void) Display::displayCrHgcmCtlSubmitCompletion(int32_t result, uint32_t u32Function, PVBOXHGCMSVCPARM pParam, void *pvContext) 4445 DECLCALLBACK(void) Display::displayCrHgcmCtlSubmitCompletion(int32_t result, uint32_t u32Function, PVBOXHGCMSVCPARM pParam, 4446 void *pvContext) 4419 4447 { 4420 4448 VBOXCRCMDCTL *pCmd = (VBOXCRCMDCTL*)pParam->u.pointer.addr; … … 4424 4452 4425 4453 int Display::handleCrHgcmCtlSubmit(struct VBOXCRCMDCTL* pCmd, uint32_t cbCmd, 4426 4427 4454 PFNCRCTLCOMPLETION pfnCompletion, 4455 void *pvCompletion) 4428 4456 { 4429 4457 VMMDev *pVMMDev = mParent->getVMMDev(); … … 4441 4469 4442 4470 pCmd->u.pfnInternal = (void(*)())pfnCompletion; 4443 int rc = pVMMDev->hgcmHostFastCallAsync(mhCrOglSvc, SHCRGL_HOST_FN_CTL, &parm, displayCrHgcmCtlSubmitCompletion, pvCompletion); 4471 int rc = pVMMDev->hgcmHostFastCallAsync(mhCrOglSvc, SHCRGL_HOST_FN_CTL, &parm, displayCrHgcmCtlSubmitCompletion, 4472 pvCompletion); 4444 4473 if (!RT_SUCCESS(rc)) 4445 4474 AssertMsgFailed(("hgcmHostFastCallAsync failed rc %d\n", rc)); … … 4624 4653 if (ASMAtomicReadU32(&pThis->mu32UpdateVBVAFlags) > 0) 4625 4654 { 4626 vbvaSetMemoryFlagsAllHGSMI(pThis->mfu32SupportedOrders, pThis->mfVideoAccelVRDP, pThis->maFramebuffers, pThis->mcMonitors); 4655 vbvaSetMemoryFlagsAllHGSMI(pThis->mfu32SupportedOrders, pThis->mfVideoAccelVRDP, pThis->maFramebuffers, 4656 pThis->mcMonitors); 4627 4657 ASMAtomicDecU32(&pThis->mu32UpdateVBVAFlags); 4628 4658 } … … 4649 4679 } 4650 4680 4651 DECLCALLBACK(void) Display::displayVBVAUpdateProcess(PPDMIDISPLAYCONNECTOR pInterface, unsigned uScreenId, const PVBVACMDHDR pCmd, size_t cbCmd) 4681 DECLCALLBACK(void) Display::displayVBVAUpdateProcess(PPDMIDISPLAYCONNECTOR pInterface, unsigned uScreenId, 4682 const PVBVACMDHDR pCmd, size_t cbCmd) 4652 4683 { 4653 4684 LogFlowFunc(("uScreenId %d pCmd %p cbCmd %d, @%d,%d %dx%d\n", uScreenId, pCmd, cbCmd, pCmd->x, pCmd->y, pCmd->w, pCmd->h)); … … 4723 4754 } 4724 4755 4725 DECLCALLBACK(void) Display::displayVBVAUpdateEnd(PPDMIDISPLAYCONNECTOR pInterface, unsigned uScreenId, int32_t x, int32_t y, uint32_t cx, uint32_t cy) 4756 DECLCALLBACK(void) Display::displayVBVAUpdateEnd(PPDMIDISPLAYCONNECTOR pInterface, unsigned uScreenId, int32_t x, int32_t y, 4757 uint32_t cx, uint32_t cy) 4726 4758 { 4727 4759 LogFlowFunc(("uScreenId %d %d,%d %dx%d\n", uScreenId, x, y, cx, cy)); … … 4870 4902 #endif /* DEBUG_sunlover */ 4871 4903 4872 DECLCALLBACK(int) Display::displayVBVAResize(PPDMIDISPLAYCONNECTOR pInterface, const PVBVAINFOVIEW pView, const PVBVAINFOSCREEN pScreen, void *pvVRAM) 4904 DECLCALLBACK(int) Display::displayVBVAResize(PPDMIDISPLAYCONNECTOR pInterface, const PVBVAINFOVIEW pView, 4905 const PVBVAINFOSCREEN pScreen, void *pvVRAM) 4873 4906 { 4874 4907 LogRelFlowFunc(("pScreen %p, pvVRAM %p\n", pScreen, pvVRAM)); -
trunk/src/VBox/Main/src-client/DrvAudioVRDE.cpp
r50686 r51092 570 570 571 571 572 STDMETHODIMP AudioVRDE::handleVRDESvrCmdAudioInputEventBegin(void *pvContext, int iSampleHz, int cChannels, int cBits, bool fUnsigned) 572 STDMETHODIMP AudioVRDE::handleVRDESvrCmdAudioInputEventBegin(void *pvContext, int iSampleHz, int cChannels, 573 int cBits, bool fUnsigned) 573 574 { 574 575 int bitIdx; -
trunk/src/VBox/Main/src-client/GuestDnDImpl.cpp
r50874 r51092 259 259 static void toMainActions(uint32_t uActions, ComSafeArrayOut(DragAndDropAction_T, actions)); 260 260 static uint32_t toHGCMAction(DragAndDropAction_T action); 261 static void toHGCMActions(DragAndDropAction_T inDefAction, uint32_t *pOutDefAction, ComSafeArrayIn(DragAndDropAction_T, inAllowedActions), uint32_t *pOutAllowedActions); 261 static void toHGCMActions(DragAndDropAction_T inDefAction, uint32_t *pOutDefAction, 262 ComSafeArrayIn(DragAndDropAction_T, inAllowedActions), 263 uint32_t *pOutAllowedActions); 262 264 263 265 /* Private q and parent pointer */ … … 678 680 case DragAndDropAction_Copy: a = DND_COPY_ACTION; break; 679 681 case DragAndDropAction_Move: a = DND_MOVE_ACTION; break; 680 case DragAndDropAction_Link: /* For now it doesn't seems useful to allow a link action between host & guest. Maybe later! */ 682 case DragAndDropAction_Link: /* For now it doesn't seems useful to allow a link 683 action between host & guest. Maybe later! */ 681 684 case DragAndDropAction_Ignore: /* Ignored */ break; 682 685 default: AssertMsgFailed(("Action %u not recognized!\n", action)); break; … … 1302 1305 case DragAndDropSvc::GUEST_DND_HG_EVT_PROGRESS: 1303 1306 { 1304 DragAndDropSvc::PVBOXDNDCBHGEVTPROGRESSDATA pCBData = reinterpret_cast<DragAndDropSvc::PVBOXDNDCBHGEVTPROGRESSDATA>(pvParms); 1307 DragAndDropSvc::PVBOXDNDCBHGEVTPROGRESSDATA pCBData = 1308 reinterpret_cast <DragAndDropSvc::PVBOXDNDCBHGEVTPROGRESSDATA>(pvParms); 1305 1309 AssertPtr(pCBData); 1306 1310 AssertReturn(sizeof(DragAndDropSvc::VBOXDNDCBHGEVTPROGRESSDATA) == cbParms, VERR_INVALID_PARAMETER); … … 1314 1318 case DragAndDropSvc::GUEST_DND_GH_ACK_PENDING: 1315 1319 { 1316 DragAndDropSvc::PVBOXDNDCBGHACKPENDINGDATA pCBData = reinterpret_cast<DragAndDropSvc::PVBOXDNDCBGHACKPENDINGDATA>(pvParms); 1320 DragAndDropSvc::PVBOXDNDCBGHACKPENDINGDATA pCBData = 1321 reinterpret_cast <DragAndDropSvc::PVBOXDNDCBGHACKPENDINGDATA>(pvParms); 1317 1322 AssertPtr(pCBData); 1318 1323 AssertReturn(sizeof(DragAndDropSvc::VBOXDNDCBGHACKPENDINGDATA) == cbParms, VERR_INVALID_PARAMETER); -
trunk/src/VBox/Main/src-client/GuestImpl.cpp
r50544 r51092 646 646 647 647 STDMETHODIMP Guest::InternalGetStatistics(ULONG *aCpuUser, ULONG *aCpuKernel, ULONG *aCpuIdle, 648 ULONG *aMemTotal, ULONG *aMemFree, ULONG *aMemBalloon, ULONG *aMemShared, 649 ULONG *aMemCache, ULONG *aPageTotal, 650 ULONG *aMemAllocTotal, ULONG *aMemFreeTotal, ULONG *aMemBalloonTotal, ULONG *aMemSharedTotal) 648 ULONG *aMemTotal, ULONG *aMemFree, ULONG *aMemBalloon, 649 ULONG *aMemShared, ULONG *aMemCache, ULONG *aPageTotal, 650 ULONG *aMemAllocTotal, ULONG *aMemFreeTotal, 651 ULONG *aMemBalloonTotal, ULONG *aMemSharedTotal) 651 652 { 652 653 CheckComArgOutPointerValid(aCpuUser); -
trunk/src/VBox/Main/src-client/GuestSessionImplTasks.cpp
r50874 r51092 506 506 if (RT_FAILURE(rc)) 507 507 setProgressErrorMsg(VBOX_E_IPRT_ERROR, 508 Utf8StrFmt(GuestSession::tr("Waiting on termination for copying file \"%s\" failed: %Rrc"), 508 Utf8StrFmt(GuestSession::tr( 509 "Waiting on termination for copying file \"%s\" failed: %Rrc"), 509 510 mSource.c_str(), rc)); 510 511 else 511 512 { 512 513 setProgressErrorMsg(VBOX_E_IPRT_ERROR, 513 Utf8StrFmt(GuestSession::tr("Waiting on termination for copying file \"%s\" failed with wait result %ld"), 514 Utf8StrFmt(GuestSession::tr( 515 "Waiting on termination for copying file \"%s\" failed with wait result %ld"), 514 516 mSource.c_str(), waitRes)); 515 517 rc = VERR_GENERAL_FAILURE; /* Fudge. */ … … 528 530 { 529 531 setProgressErrorMsg(VBOX_E_IPRT_ERROR, 530 Utf8StrFmt(GuestSession::tr("Copying file \"%s\" failed with status %ld, exit code %ld"), 532 Utf8StrFmt(GuestSession::tr( 533 "Copying file \"%s\" failed with status %ld, exit code %ld"), 531 534 mSource.c_str(), procStatus, exitCode)); /**@todo Add stringify methods! */ 532 535 rc = VERR_GENERAL_FAILURE; /* Fudge. */ 533 536 } 534 537 } 538 535 539 536 540 if (RT_SUCCESS(rc)) … … 608 612 setProgressErrorMsg(VBOX_E_IPRT_ERROR, 609 613 Utf8StrFmt(GuestSession::tr("Querying guest file information for \"%s\" failed: %Rrc"), 610 mSource.c_str(), rc));614 mSource.c_str(), rc)); 611 615 } 612 616 else if (objData.mType != FsObjType_File) /* Only single files are supported at the moment. */ … … 631 635 { 632 636 GuestProcessStartupInfo procInfo; 633 procInfo.mName 634 637 procInfo.mName = Utf8StrFmt(GuestSession::tr("Copying file \"%s\" from guest to the host to \"%s\" (%RI64 bytes)"), 638 mSource.c_str(), mDest.c_str(), objData.mObjectSize); 635 639 procInfo.mCommand = Utf8Str(VBOXSERVICE_TOOL_CAT); 636 640 procInfo.mFlags = ProcessCreateFlag_Hidden | ProcessCreateFlag_WaitForStdOut; … … 685 689 default: 686 690 setProgressErrorMsg(VBOX_E_IPRT_ERROR, 687 Utf8StrFmt(GuestSession::tr("Error while creating guest process for copying file \"%s\" from guest to host: %Rrc"), 691 Utf8StrFmt(GuestSession::tr( 692 "Error while creating guest process for copying file \"%s\" from guest to host: %Rrc"), 688 693 mSource.c_str(), rc)); 689 694 break; … … 716 721 default: 717 722 setProgressErrorMsg(VBOX_E_IPRT_ERROR, 718 Utf8StrFmt(GuestSession::tr("Reading from file \"%s\" (offset %RU64) failed: %Rrc"), 723 Utf8StrFmt(GuestSession::tr( 724 "Reading from file \"%s\" (offset %RU64) failed: %Rrc"), 719 725 mSource.c_str(), cbWrittenTotal, rc)); 720 726 break; … … 730 736 { 731 737 setProgressErrorMsg(VBOX_E_IPRT_ERROR, 732 Utf8StrFmt(GuestSession::tr("Error writing to file \"%s\" (%RU64 bytes left): %Rrc"), 733 mDest.c_str(), cbToRead, rc)); 738 Utf8StrFmt(GuestSession::tr( 739 "Error writing to file \"%s\" (%RU64 bytes left): %Rrc"), 740 mDest.c_str(), cbToRead, rc)); 734 741 break; 735 742 } … … 784 791 /* If we did not copy all let the user know. */ 785 792 setProgressErrorMsg(VBOX_E_IPRT_ERROR, 786 Utf8StrFmt(GuestSession::tr("Copying file \"%s\" failed (%RU64/%RI64 bytes transfered)"), 787 mSource.c_str(), cbWrittenTotal, objData.mObjectSize)); 793 Utf8StrFmt(GuestSession::tr( 794 "Copying file \"%s\" failed (%RU64/%RI64 bytes transfered)"), 795 mSource.c_str(), cbWrittenTotal, objData.mObjectSize)); 788 796 rc = VERR_GENERAL_FAILURE; /* Fudge. */ 789 797 } … … 799 807 { 800 808 setProgressErrorMsg(VBOX_E_IPRT_ERROR, 801 Utf8StrFmt(GuestSession::tr("Copying file \"%s\" failed with status %ld, exit code %d"), 802 mSource.c_str(), procStatus, exitCode)); /**@todo Add stringify methods! */ 809 Utf8StrFmt(GuestSession::tr( 810 "Copying file \"%s\" failed with status %ld, exit code %d"), 811 mSource.c_str(), procStatus, exitCode)); /**@todo Add 812 stringify methods! */ 803 813 rc = VERR_GENERAL_FAILURE; /* Fudge. */ 804 814 } … … 935 945 936 946 ComObjPtr<Progress> pProgressCopyTo; 937 rc = pSession->i_startTaskAsync(Utf8StrFmt(GuestSession::tr("Copying Guest Additions installer file \"%s\" to \"%s\" on guest"), 947 rc = pSession->i_startTaskAsync(Utf8StrFmt(GuestSession::tr( 948 "Copying Guest Additions installer file \"%s\" to \"%s\" on guest"), 938 949 mSource.c_str(), strFileDest.c_str()), 939 950 pTask, pProgressCopyTo); … … 1033 1044 case VERR_NOT_EQUAL: /** @todo Special guest control rc needed! */ 1034 1045 setProgressErrorMsg(VBOX_E_IPRT_ERROR, 1035 Utf8StrFmt(GuestSession::tr("Running update file \"%s\" on guest terminated with exit code %ld"), 1046 Utf8StrFmt(GuestSession::tr( 1047 "Running update file \"%s\" on guest terminated with exit code %ld"), 1036 1048 procInfo.mCommand.c_str(), exitCode)); 1037 1049 break; … … 1044 1056 case VERR_INVALID_STATE: /** @todo Special guest control rc needed! */ 1045 1057 setProgressErrorMsg(VBOX_E_IPRT_ERROR, 1046 Utf8StrFmt(GuestSession::tr("Update file \"%s\" reported invalid running state"), 1058 Utf8StrFmt(GuestSession::tr( 1059 "Update file \"%s\" reported invalid running state"), 1047 1060 procInfo.mCommand.c_str())); 1048 1061 break; … … 1050 1063 default: 1051 1064 setProgressErrorMsg(VBOX_E_IPRT_ERROR, 1052 Utf8StrFmt(GuestSession::tr("Error while running update file \"%s\" on guest: %Rrc"), 1065 Utf8StrFmt(GuestSession::tr( 1066 "Error while running update file \"%s\" on guest: %Rrc"), 1053 1067 procInfo.mCommand.c_str(), vrc)); 1054 1068 break; … … 1113 1127 if (addsRunLevel == AdditionsRunLevelType_System) 1114 1128 hr = setProgressErrorMsg(VBOX_E_NOT_SUPPORTED, 1115 Utf8StrFmt(GuestSession::tr("Guest Additions are installed but not fully loaded yet, aborting automatic update"))); 1129 Utf8StrFmt(GuestSession::tr( 1130 "Guest Additions are installed but not fully loaded yet, aborting automatic update"))); 1116 1131 else 1117 1132 hr = setProgressErrorMsg(VBOX_E_NOT_SUPPORTED, 1118 Utf8StrFmt(GuestSession::tr("Guest Additions not installed or ready, aborting automatic update"))); 1133 Utf8StrFmt(GuestSession::tr( 1134 "Guest Additions not installed or ready, aborting automatic update"))); 1119 1135 rc = VERR_NOT_SUPPORTED; 1120 1136 } … … 1162 1178 { 1163 1179 hr = setProgressErrorMsg(VBOX_E_NOT_SUPPORTED, 1164 Utf8StrFmt(GuestSession::tr("Unable to detected guest OS version, please update manually")));1180 Utf8StrFmt(GuestSession::tr("Unable to detected guest OS version, please update manually"))); 1165 1181 rc = VERR_NOT_SUPPORTED; 1166 1182 } … … 1182 1198 { 1183 1199 hr = setProgressErrorMsg(VBOX_E_NOT_SUPPORTED, 1184 Utf8StrFmt(GuestSession::tr("Windows 2000 and XP are not supported for automatic updating due to WHQL interaction, please update manually"))); 1200 Utf8StrFmt(GuestSession::tr( 1201 "Windows 2000 and XP are not supported for automatic updating due to WHQL interaction, please update manually"))); 1185 1202 rc = VERR_NOT_SUPPORTED; 1186 1203 } … … 1190 1207 { 1191 1208 hr = setProgressErrorMsg(VBOX_E_NOT_SUPPORTED, 1192 Utf8StrFmt(GuestSession::tr("%s (%s) not supported for automatic updating, please update manually"), 1209 Utf8StrFmt(GuestSession::tr( 1210 "%s (%s) not supported for automatic updating, please update manually"), 1193 1211 strOSType.c_str(), strOSVer.c_str())); 1194 1212 rc = VERR_NOT_SUPPORTED; … … 1293 1311 default: 1294 1312 hr = setProgressErrorMsg(VBOX_E_IPRT_ERROR, 1295 Utf8StrFmt(GuestSession::tr("Error creating installation directory \"%s\" on the guest: %Rrc"), 1296 strUpdateDir.c_str(), rc)); 1313 Utf8StrFmt(GuestSession::tr( 1314 "Error creating installation directory \"%s\" on the guest: %Rrc"), 1315 strUpdateDir.c_str(), rc)); 1297 1316 break; 1298 1317 } … … 1338 1357 mFiles.push_back(InstallerFile("CERT/VBOXCERTUTIL.EXE", 1339 1358 strUpdateDir + "VBoxCertUtil.exe", 1340 UPDATEFILE_FLAG_COPY_FROM_ISO | UPDATEFILE_FLAG_EXECUTE | UPDATEFILE_FLAG_OPTIONAL, 1359 UPDATEFILE_FLAG_COPY_FROM_ISO | UPDATEFILE_FLAG_EXECUTE | 1360 UPDATEFILE_FLAG_OPTIONAL, 1341 1361 siCertUtilRem)); 1342 1362 /* Second pass: Only execute (but don't copy) again, this time installng the … … 1423 1443 { 1424 1444 hr = setProgressErrorMsg(VBOX_E_IPRT_ERROR, 1425 Utf8StrFmt(GuestSession::tr("Error while copying file \"%s\" to \"%s\" on the guest: %Rrc"), 1445 Utf8StrFmt(GuestSession::tr( 1446 "Error while copying file \"%s\" to \"%s\" on the guest: %Rrc"), 1426 1447 itFiles->strSource.c_str(), itFiles->strDest.c_str(), rc)); 1427 1448 break; -
trunk/src/VBox/Main/src-client/HGCM.cpp
r48229 r51092 90 90 91 91 HGCMTHREADHANDLE m_thread; 92 friend DECLCALLBACK(void) hgcmServiceThread 92 friend DECLCALLBACK(void) hgcmServiceThread(HGCMTHREADHANDLE ThreadHandle, void *pvUser); 93 93 94 94 uint32_t volatile m_u32RefCnt; … … 116 116 HGCMSVCEXTHANDLE m_hExtension; 117 117 118 int loadServiceDLL 119 void unloadServiceDLL 118 int loadServiceDLL(void); 119 void unloadServiceDLL(void); 120 120 121 121 /* 122 122 * Main HGCM thread methods. 123 123 */ 124 int instanceCreate 125 void instanceDestroy 124 int instanceCreate(const char *pszServiceLibrary, const char *pszServiceName); 125 void instanceDestroy(void); 126 126 127 127 int saveClientState(uint32_t u32ClientId, PSSMHANDLE pSSM); 128 128 int loadClientState(uint32_t u32ClientId, PSSMHANDLE pSSM); 129 129 130 HGCMService 131 ~HGCMService 132 133 static DECLCALLBACK(void) svcHlpCallComplete 134 static DECLCALLBACK(void) svcHlpDisconnectClient 130 HGCMService(); 131 ~HGCMService() {}; 132 133 static DECLCALLBACK(void) svcHlpCallComplete(VBOXHGCMCALLHANDLE callHandle, int32_t rc); 134 static DECLCALLBACK(void) svcHlpDisconnectClient(void *pvInstance, uint32_t u32ClientId); 135 135 136 136 public: … … 139 139 * Main HGCM thread methods. 140 140 */ 141 static int LoadService 142 void UnloadService 143 144 static void UnloadAll 145 146 static int ResolveService 147 void ReferenceService 148 void ReleaseService 149 150 static void Reset 151 152 static int SaveState 153 static int LoadState 154 155 int CreateAndConnectClient 156 int DisconnectClient 157 158 int HostCall 141 static int LoadService(const char *pszServiceLibrary, const char *pszServiceName); 142 void UnloadService(void); 143 144 static void UnloadAll(void); 145 146 static int ResolveService(HGCMService **ppsvc, const char *pszServiceName); 147 void ReferenceService(void); 148 void ReleaseService(void); 149 150 static void Reset(void); 151 152 static int SaveState(PSSMHANDLE pSSM); 153 static int LoadState(PSSMHANDLE pSSM); 154 155 int CreateAndConnectClient(uint32_t *pu32ClientIdOut, uint32_t u32ClientIdIn); 156 int DisconnectClient(uint32_t u32ClientId, bool fFromService); 157 158 int HostCall(uint32_t u32Function, uint32_t cParms, VBOXHGCMSVCPARM *paParms); 159 159 160 160 #ifdef VBOX_WITH_CRHGSMI 161 161 int HandleAcquired(); 162 162 int HandleReleased(); 163 int HostFastCallAsync (uint32_t u32Function, VBOXHGCMSVCPARM *pParm, PHGCMHOSTFASTCALLCB pfnCompletion, void *pvCompletion); 163 int HostFastCallAsync(uint32_t u32Function, VBOXHGCMSVCPARM *pParm, PHGCMHOSTFASTCALLCB pfnCompletion, 164 void *pvCompletion); 164 165 #endif 165 166 166 uint32_t SizeOfClient 167 168 int RegisterExtension 169 void UnregisterExtension 167 uint32_t SizeOfClient(void) { return m_fntable.cbClient; }; 168 169 int RegisterExtension(HGCMSVCEXTHANDLE handle, PFNHGCMSVCEXT pfnExtension, void *pvExtension); 170 void UnregisterExtension(HGCMSVCEXTHANDLE handle); 170 171 171 172 /* … … 173 174 */ 174 175 175 int GuestCall (PPDMIHGCMPORT pHGCMPort, PVBOXHGCMCMD pCmd, uint32_t u32ClientId, uint32_t u32Function, uint32_t cParms, VBOXHGCMSVCPARM aParms[]); 176 int GuestCall(PPDMIHGCMPORT pHGCMPort, PVBOXHGCMCMD pCmd, uint32_t u32ClientId, 177 uint32_t u32Function, uint32_t cParms, VBOXHGCMSVCPARM aParms[]); 176 178 }; 177 179 … … 180 182 { 181 183 public: 182 HGCMClient 184 HGCMClient() : HGCMObject(HGCMOBJ_CLIENT), pService(NULL), 183 185 pvData(NULL) {}; 184 ~HGCMClient 185 186 int Init 186 ~HGCMClient(); 187 188 int Init(HGCMService *pSvc); 187 189 188 190 /** Service that the client is connected to. */ … … 193 195 }; 194 196 195 HGCMClient::~HGCMClient 196 { 197 if (pService->SizeOfClient 198 RTMemFree 199 } 200 201 int HGCMClient::Init 197 HGCMClient::~HGCMClient() 198 { 199 if (pService->SizeOfClient() > 0) 200 RTMemFree(pvData); 201 } 202 203 int HGCMClient::Init(HGCMService *pSvc) 202 204 { 203 205 pService = pSvc; 204 206 205 if (pService->SizeOfClient 206 { 207 pvData = RTMemAllocZ (pService->SizeOfClient());207 if (pService->SizeOfClient() > 0) 208 { 209 pvData = RTMemAllocZ(pService->SizeOfClient()); 208 210 209 211 if (!pvData) … … 217 219 218 220 219 #define HGCM_CLIENT_DATA(pService, pClient) 221 #define HGCM_CLIENT_DATA(pService, pClient)(pClient->pvData) 220 222 221 223 … … 225 227 int HGCMService::sm_cServices = 0; 226 228 227 HGCMService::HGCMService 229 HGCMService::HGCMService() 228 230 : 229 231 m_thread (0), … … 284 286 if (RT_FAILURE(rc) || !m_pfnLoad) 285 287 { 286 Log(("HGCMService::loadServiceDLL: Error resolving the service entry point %s, rc = %d, m_pfnLoad = %p\n", VBOX_HGCM_SVCLOAD_NAME, rc, m_pfnLoad)); 288 Log(("HGCMService::loadServiceDLL: Error resolving the service entry point %s, rc = %d, m_pfnLoad = %p\n", 289 VBOX_HGCM_SVCLOAD_NAME, rc, m_pfnLoad)); 287 290 288 291 if (RT_SUCCESS(rc)) … … 400 403 { 401 404 public: 402 HGCMMsgHeader () : pCmd (NULL), pHGCMPort(NULL) {};405 HGCMMsgHeader() : pCmd(NULL), pHGCMPort(NULL) {}; 403 406 404 407 /* Command pointer/identifier. */ … … 476 479 #endif 477 480 478 static HGCMMsgCore *hgcmMessageAllocSvc 481 static HGCMMsgCore *hgcmMessageAllocSvc(uint32_t u32MsgId) 479 482 { 480 483 switch (u32MsgId) 481 484 { 482 485 #ifdef VBOX_WITH_CRHGSMI 483 case SVC_MSG_HOSTFASTCALLASYNC: return new HGCMMsgHostFastCallAsyncSvc 486 case SVC_MSG_HOSTFASTCALLASYNC: return new HGCMMsgHostFastCallAsyncSvc(); 484 487 #endif 485 case SVC_MSG_LOAD: return new HGCMMsgSvcLoad 486 case SVC_MSG_UNLOAD: return new HGCMMsgSvcUnload 487 case SVC_MSG_CONNECT: return new HGCMMsgSvcConnect 488 case SVC_MSG_DISCONNECT: return new HGCMMsgSvcDisconnect 489 case SVC_MSG_HOSTCALL: return new HGCMMsgHostCallSvc 490 case SVC_MSG_GUESTCALL: return new HGCMMsgCall 488 case SVC_MSG_LOAD: return new HGCMMsgSvcLoad(); 489 case SVC_MSG_UNLOAD: return new HGCMMsgSvcUnload(); 490 case SVC_MSG_CONNECT: return new HGCMMsgSvcConnect(); 491 case SVC_MSG_DISCONNECT: return new HGCMMsgSvcDisconnect(); 492 case SVC_MSG_HOSTCALL: return new HGCMMsgHostCallSvc(); 493 case SVC_MSG_GUESTCALL: return new HGCMMsgCall(); 491 494 case SVC_MSG_LOADSTATE: 492 case SVC_MSG_SAVESTATE: return new HGCMMsgLoadSaveStateClient 493 case SVC_MSG_REGEXT: return new HGCMMsgSvcRegisterExtension 494 case SVC_MSG_UNREGEXT: return new HGCMMsgSvcUnregisterExtension 495 case SVC_MSG_SAVESTATE: return new HGCMMsgLoadSaveStateClient(); 496 case SVC_MSG_REGEXT: return new HGCMMsgSvcRegisterExtension(); 497 case SVC_MSG_UNREGEXT: return new HGCMMsgSvcUnregisterExtension(); 495 498 default: 496 499 AssertReleaseMsgFailed(("Msg id = %08X\n", u32MsgId)); … … 503 506 * The service thread. Loads the service library and calls the service entry points. 504 507 */ 505 DECLCALLBACK(void) hgcmServiceThread 508 DECLCALLBACK(void) hgcmServiceThread(HGCMTHREADHANDLE ThreadHandle, void *pvUser) 506 509 { 507 510 HGCMService *pSvc = (HGCMService *)pvUser; … … 513 516 { 514 517 HGCMMsgCore *pMsgCore; 515 int rc = hgcmMsgGet 518 int rc = hgcmMsgGet(ThreadHandle, &pMsgCore); 516 519 517 520 if (RT_FAILURE(rc)) 518 521 { 519 522 /* The error means some serious unrecoverable problem in the hgcmMsg/hgcmThread layer. */ 520 AssertMsgFailed 523 AssertMsgFailed(("%Rrc\n", rc)); 521 524 break; 522 525 } 523 526 524 527 /* Cache required information to avoid unnecessary pMsgCore access. */ 525 uint32_t u32MsgId = pMsgCore->MsgId 528 uint32_t u32MsgId = pMsgCore->MsgId(); 526 529 527 530 switch (u32MsgId) … … 534 537 LogFlowFunc(("SVC_MSG_HOSTFASTCALLASYNC u32Function = %d, pParm = %p\n", pMsg->u32Function, &pMsg->Param)); 535 538 536 rc = pSvc->m_fntable.pfnHostCall 539 rc = pSvc->m_fntable.pfnHostCall(pSvc->m_fntable.pvService, pMsg->u32Function, 1, &pMsg->Param); 537 540 } break; 538 541 #endif … … 540 543 { 541 544 LogFlowFunc(("SVC_MSG_LOAD\n")); 542 rc = pSvc->loadServiceDLL 545 rc = pSvc->loadServiceDLL(); 543 546 } break; 544 547 … … 548 551 if (pSvc->m_fntable.pfnUnload) 549 552 { 550 pSvc->m_fntable.pfnUnload 551 } 552 553 pSvc->unloadServiceDLL 553 pSvc->m_fntable.pfnUnload(pSvc->m_fntable.pvService); 554 } 555 556 pSvc->unloadServiceDLL(); 554 557 fQuit = true; 555 558 } break; … … 561 564 LogFlowFunc(("SVC_MSG_CONNECT u32ClientId = %d\n", pMsg->u32ClientId)); 562 565 563 HGCMClient *pClient = (HGCMClient *)hgcmObjReference 566 HGCMClient *pClient = (HGCMClient *)hgcmObjReference(pMsg->u32ClientId, HGCMOBJ_CLIENT); 564 567 565 568 if (pClient) 566 569 { 567 rc = pSvc->m_fntable.pfnConnect (pSvc->m_fntable.pvService, pMsg->u32ClientId, HGCM_CLIENT_DATA(pSvc, pClient)); 568 569 hgcmObjDereference (pClient); 570 rc = pSvc->m_fntable.pfnConnect(pSvc->m_fntable.pvService, pMsg->u32ClientId, 571 HGCM_CLIENT_DATA(pSvc, pClient)); 572 573 hgcmObjDereference(pClient); 570 574 } 571 575 else … … 581 585 LogFlowFunc(("SVC_MSG_DISCONNECT u32ClientId = %d\n", pMsg->u32ClientId)); 582 586 583 HGCMClient *pClient = (HGCMClient *)hgcmObjReference 587 HGCMClient *pClient = (HGCMClient *)hgcmObjReference(pMsg->u32ClientId, HGCMOBJ_CLIENT); 584 588 585 589 if (pClient) 586 590 { 587 rc = pSvc->m_fntable.pfnDisconnect (pSvc->m_fntable.pvService, pMsg->u32ClientId, HGCM_CLIENT_DATA(pSvc, pClient)); 588 589 hgcmObjDereference (pClient); 591 rc = pSvc->m_fntable.pfnDisconnect(pSvc->m_fntable.pvService, pMsg->u32ClientId, 592 HGCM_CLIENT_DATA(pSvc, pClient)); 593 594 hgcmObjDereference(pClient); 590 595 } 591 596 else … … 602 607 pMsg->u32ClientId, pMsg->u32Function, pMsg->cParms, pMsg->paParms)); 603 608 604 HGCMClient *pClient = (HGCMClient *)hgcmObjReference 609 HGCMClient *pClient = (HGCMClient *)hgcmObjReference(pMsg->u32ClientId, HGCMOBJ_CLIENT); 605 610 606 611 if (pClient) 607 612 { 608 pSvc->m_fntable.pfnCall (pSvc->m_fntable.pvService, (VBOXHGCMCALLHANDLE)pMsg, pMsg->u32ClientId, HGCM_CLIENT_DATA(pSvc, pClient), pMsg->u32Function, pMsg->cParms, pMsg->paParms); 609 610 hgcmObjDereference (pClient); 613 pSvc->m_fntable.pfnCall(pSvc->m_fntable.pvService, (VBOXHGCMCALLHANDLE)pMsg, pMsg->u32ClientId, 614 HGCM_CLIENT_DATA(pSvc, pClient), pMsg->u32Function, 615 pMsg->cParms, pMsg->paParms); 616 617 hgcmObjDereference(pClient); 611 618 } 612 619 else … … 620 627 HGCMMsgHostCallSvc *pMsg = (HGCMMsgHostCallSvc *)pMsgCore; 621 628 622 LogFlowFunc(("SVC_MSG_HOSTCALL u32Function = %d, cParms = %d, paParms = %p\n", pMsg->u32Function, pMsg->cParms, pMsg->paParms)); 623 624 rc = pSvc->m_fntable.pfnHostCall (pSvc->m_fntable.pvService, pMsg->u32Function, pMsg->cParms, pMsg->paParms); 629 LogFlowFunc(("SVC_MSG_HOSTCALL u32Function = %d, cParms = %d, paParms = %p\n", 630 pMsg->u32Function, pMsg->cParms, pMsg->paParms)); 631 632 rc = pSvc->m_fntable.pfnHostCall(pSvc->m_fntable.pvService, pMsg->u32Function, pMsg->cParms, pMsg->paParms); 625 633 } break; 626 634 … … 631 639 LogFlowFunc(("SVC_MSG_LOADSTATE\n")); 632 640 633 HGCMClient *pClient = (HGCMClient *)hgcmObjReference 641 HGCMClient *pClient = (HGCMClient *)hgcmObjReference(pMsg->u32ClientId, HGCMOBJ_CLIENT); 634 642 635 643 if (pClient) … … 637 645 if (pSvc->m_fntable.pfnLoadState) 638 646 { 639 rc = pSvc->m_fntable.pfnLoadState (pSvc->m_fntable.pvService, pMsg->u32ClientId, HGCM_CLIENT_DATA(pSvc, pClient), pMsg->pSSM); 647 rc = pSvc->m_fntable.pfnLoadState(pSvc->m_fntable.pvService, pMsg->u32ClientId, 648 HGCM_CLIENT_DATA(pSvc, pClient), pMsg->pSSM); 640 649 } 641 650 642 hgcmObjDereference 651 hgcmObjDereference(pClient); 643 652 } 644 653 else … … 654 663 LogFlowFunc(("SVC_MSG_SAVESTATE\n")); 655 664 656 HGCMClient *pClient = (HGCMClient *)hgcmObjReference 665 HGCMClient *pClient = (HGCMClient *)hgcmObjReference(pMsg->u32ClientId, HGCMOBJ_CLIENT); 657 666 658 667 rc = VINF_SUCCESS; … … 663 672 { 664 673 g_fSaveState = true; 665 rc = pSvc->m_fntable.pfnSaveState (pSvc->m_fntable.pvService, pMsg->u32ClientId, HGCM_CLIENT_DATA(pSvc, pClient), pMsg->pSSM); 674 rc = pSvc->m_fntable.pfnSaveState(pSvc->m_fntable.pvService, pMsg->u32ClientId, 675 HGCM_CLIENT_DATA(pSvc, pClient), pMsg->pSSM); 666 676 g_fSaveState = false; 667 677 } 668 678 669 hgcmObjDereference 679 hgcmObjDereference(pClient); 670 680 } 671 681 else … … 689 699 if (pSvc->m_fntable.pfnRegisterExtension) 690 700 { 691 rc = pSvc->m_fntable.pfnRegisterExtension (pSvc->m_fntable.pvService, pMsg->pfnExtension, pMsg->pvExtension); 701 rc = pSvc->m_fntable.pfnRegisterExtension(pSvc->m_fntable.pvService, pMsg->pfnExtension, 702 pMsg->pvExtension); 692 703 } 693 704 else … … 717 728 if (pSvc->m_fntable.pfnRegisterExtension) 718 729 { 719 rc = pSvc->m_fntable.pfnRegisterExtension 730 rc = pSvc->m_fntable.pfnRegisterExtension(pSvc->m_fntable.pvService, NULL, NULL); 720 731 } 721 732 else … … 745 756 } 746 757 747 /* static */ DECLCALLBACK(void) HGCMService::svcHlpCallComplete 758 /* static */ DECLCALLBACK(void) HGCMService::svcHlpCallComplete(VBOXHGCMCALLHANDLE callHandle, int32_t rc) 748 759 { 749 760 HGCMMsgCore *pMsgCore = (HGCMMsgCore *)callHandle; … … 755 766 * any other messages. 756 767 */ 757 hgcmMsgComplete 768 hgcmMsgComplete(pMsgCore, rc); 758 769 } 759 770 else 760 771 { 761 AssertFailed 772 AssertFailed(); 762 773 } 763 774 } 764 775 765 /* static */ DECLCALLBACK(void) HGCMService::svcHlpDisconnectClient 776 /* static */ DECLCALLBACK(void) HGCMService::svcHlpDisconnectClient(void *pvInstance, uint32_t u32ClientId) 766 777 { 767 778 HGCMService *pService = static_cast <HGCMService *> (pvInstance); … … 769 780 if (pService) 770 781 { 771 pService->DisconnectClient 782 pService->DisconnectClient(u32ClientId, true); 772 783 } 773 784 } 774 785 775 static DECLCALLBACK(void) hgcmMsgCompletionCallback 786 static DECLCALLBACK(void) hgcmMsgCompletionCallback(int32_t result, HGCMMsgCore *pMsgCore) 776 787 { 777 788 /* Call the VMMDev port interface to issue IRQ notification. */ … … 782 793 if (pMsgHdr->pHGCMPort && !g_fResetting) 783 794 { 784 pMsgHdr->pHGCMPort->pfnCompleted 795 pMsgHdr->pHGCMPort->pfnCompleted(pMsgHdr->pHGCMPort, g_fSaveState? VINF_HGCM_SAVE_STATE: result, pMsgHdr->pCmd); 785 796 } 786 797 } … … 790 801 */ 791 802 792 int HGCMService::instanceCreate 803 int HGCMService::instanceCreate(const char *pszServiceLibrary, const char *pszServiceName) 793 804 { 794 805 LogFlowFunc(("name %s, lib %s\n", pszServiceName, pszServiceLibrary)); … … 796 807 /* The maximum length of the thread name, allowed by the RT is 15. */ 797 808 char szThreadName[16]; 798 if (!strncmp 799 RTStrPrintf (szThreadName, sizeof(szThreadName), "Sh%s", pszServiceName + 10);800 else if (!strncmp 801 RTStrCopy (szThreadName, sizeof(szThreadName), pszServiceName + 4);809 if (!strncmp(pszServiceName, RT_STR_TUPLE("VBoxShared"))) 810 RTStrPrintf(szThreadName, sizeof(szThreadName), "Sh%s", pszServiceName + 10); 811 else if (!strncmp(pszServiceName, RT_STR_TUPLE("VBox"))) 812 RTStrCopy(szThreadName, sizeof(szThreadName), pszServiceName + 4); 802 813 else 803 RTStrCopy (szThreadName, sizeof(szThreadName), pszServiceName);804 805 int rc = hgcmThreadCreate 814 RTStrCopy(szThreadName, sizeof(szThreadName), pszServiceName); 815 816 int rc = hgcmThreadCreate(&m_thread, szThreadName, hgcmServiceThread, this); 806 817 807 818 if (RT_SUCCESS(rc)) 808 819 { 809 m_pszSvcName = RTStrDup 810 m_pszSvcLibrary = RTStrDup 820 m_pszSvcName = RTStrDup(pszServiceName); 821 m_pszSvcLibrary = RTStrDup(pszServiceLibrary); 811 822 812 823 if (!m_pszSvcName || !m_pszSvcLibrary) 813 824 { 814 RTStrFree 825 RTStrFree(m_pszSvcLibrary); 815 826 m_pszSvcLibrary = NULL; 816 827 817 RTStrFree 828 RTStrFree(m_pszSvcName); 818 829 m_pszSvcName = NULL; 819 830 … … 829 840 /* Execute the load request on the service thread. */ 830 841 HGCMMSGHANDLE hMsg; 831 rc = hgcmMsgAlloc 842 rc = hgcmMsgAlloc(m_thread, &hMsg, SVC_MSG_LOAD, hgcmMessageAllocSvc); 832 843 833 844 if (RT_SUCCESS(rc)) 834 845 { 835 rc = hgcmMsgSend 846 rc = hgcmMsgSend(hMsg); 836 847 } 837 848 } … … 840 851 if (RT_FAILURE(rc)) 841 852 { 842 instanceDestroy 853 instanceDestroy(); 843 854 } 844 855 … … 847 858 } 848 859 849 void HGCMService::instanceDestroy 860 void HGCMService::instanceDestroy(void) 850 861 { 851 862 LogFlowFunc(("%s\n", m_pszSvcName)); 852 863 853 864 HGCMMSGHANDLE hMsg; 854 int rc = hgcmMsgAlloc 865 int rc = hgcmMsgAlloc(m_thread, &hMsg, SVC_MSG_UNLOAD, hgcmMessageAllocSvc); 855 866 856 867 if (RT_SUCCESS(rc)) 857 868 { 858 rc = hgcmMsgSend 869 rc = hgcmMsgSend(hMsg); 859 870 860 871 if (RT_SUCCESS(rc)) 861 872 { 862 hgcmThreadWait 863 } 864 } 865 866 RTStrFree 873 hgcmThreadWait(m_thread); 874 } 875 } 876 877 RTStrFree(m_pszSvcLibrary); 867 878 m_pszSvcLibrary = NULL; 868 879 869 RTStrFree 880 RTStrFree(m_pszSvcName); 870 881 m_pszSvcName = NULL; 871 882 } … … 876 887 877 888 HGCMMSGHANDLE hMsg; 878 int rc = hgcmMsgAlloc 889 int rc = hgcmMsgAlloc(m_thread, &hMsg, SVC_MSG_SAVESTATE, hgcmMessageAllocSvc); 879 890 880 891 if (RT_SUCCESS(rc)) 881 892 { 882 HGCMMsgLoadSaveStateClient *pMsg = (HGCMMsgLoadSaveStateClient *)hgcmObjReference 893 HGCMMsgLoadSaveStateClient *pMsg = (HGCMMsgLoadSaveStateClient *)hgcmObjReference(hMsg, HGCMOBJ_MSG); 883 894 AssertRelease(pMsg); 884 895 … … 886 897 pMsg->pSSM = pSSM; 887 898 888 hgcmObjDereference 889 890 rc = hgcmMsgSend 899 hgcmObjDereference(pMsg); 900 901 rc = hgcmMsgSend(hMsg); 891 902 } 892 903 … … 895 906 } 896 907 897 int HGCMService::loadClientState 908 int HGCMService::loadClientState(uint32_t u32ClientId, PSSMHANDLE pSSM) 898 909 { 899 910 LogFlowFunc(("%s\n", m_pszSvcName)); 900 911 901 912 HGCMMSGHANDLE hMsg; 902 int rc = hgcmMsgAlloc 913 int rc = hgcmMsgAlloc(m_thread, &hMsg, SVC_MSG_LOADSTATE, hgcmMessageAllocSvc); 903 914 904 915 if (RT_SUCCESS(rc)) 905 916 { 906 HGCMMsgLoadSaveStateClient *pMsg = (HGCMMsgLoadSaveStateClient *)hgcmObjReference 917 HGCMMsgLoadSaveStateClient *pMsg = (HGCMMsgLoadSaveStateClient *)hgcmObjReference(hMsg, HGCMOBJ_MSG); 907 918 908 919 AssertRelease(pMsg); … … 911 922 pMsg->pSSM = pSSM; 912 923 913 hgcmObjDereference 914 915 rc = hgcmMsgSend 924 hgcmObjDereference(pMsg); 925 926 rc = hgcmMsgSend(hMsg); 916 927 } 917 928 … … 928 939 * @thread main HGCM 929 940 */ 930 /* static */ int HGCMService::LoadService 941 /* static */ int HGCMService::LoadService(const char *pszServiceLibrary, const char *pszServiceName) 931 942 { 932 943 LogFlowFunc(("lib %s, name = %s\n", pszServiceLibrary, pszServiceName)); … … 935 946 936 947 HGCMService *pSvc; 937 int rc = HGCMService::ResolveService 948 int rc = HGCMService::ResolveService(&pSvc, pszServiceName); 938 949 939 950 if (RT_SUCCESS(rc)) 940 951 { 941 952 /* The service is already loaded. */ 942 pSvc->ReleaseService 953 pSvc->ReleaseService(); 943 954 rc = VERR_HGCM_SERVICE_EXISTS; 944 955 } … … 946 957 { 947 958 /* Create the new service. */ 948 pSvc = new HGCMService 959 pSvc = new HGCMService(); 949 960 950 961 if (!pSvc) … … 955 966 { 956 967 /* Load the library and call the initialization entry point. */ 957 rc = pSvc->instanceCreate 968 rc = pSvc->instanceCreate(pszServiceLibrary, pszServiceName); 958 969 959 970 if (RT_SUCCESS(rc)) … … 977 988 978 989 /* Reference the service (for first time) until it is unloaded on HGCM termination. */ 979 AssertRelease 980 pSvc->ReferenceService 990 AssertRelease(pSvc->m_u32RefCnt == 0); 991 pSvc->ReferenceService(); 981 992 982 993 LogFlowFunc(("service %p\n", pSvc)); … … 993 1004 * @thread main HGCM 994 1005 */ 995 void HGCMService::UnloadService 1006 void HGCMService::UnloadService(void) 996 1007 { 997 1008 LogFlowFunc(("name = %s\n", m_pszSvcName)); … … 1020 1031 /* The service must be unloaded only if all clients were disconnected. */ 1021 1032 LogFlowFunc(("m_u32RefCnt = %d\n", m_u32RefCnt)); 1022 AssertRelease 1033 AssertRelease(m_u32RefCnt == 1); 1023 1034 1024 1035 /* Now the service can be released. */ 1025 ReleaseService 1036 ReleaseService(); 1026 1037 } 1027 1038 … … 1030 1041 * @thread main HGCM 1031 1042 */ 1032 /* static */ void HGCMService::UnloadAll 1043 /* static */ void HGCMService::UnloadAll(void) 1033 1044 { 1034 1045 while (sm_pSvcListHead) 1035 1046 { 1036 sm_pSvcListHead->UnloadService 1047 sm_pSvcListHead->UnloadService(); 1037 1048 } 1038 1049 } … … 1047 1058 * @thread main HGCM 1048 1059 */ 1049 /* static */ int HGCMService::ResolveService 1060 /* static */ int HGCMService::ResolveService(HGCMService **ppSvc, const char *pszServiceName) 1050 1061 { 1051 1062 LogFlowFunc(("ppSvc = %p name = %s\n", … … 1061 1072 while (pSvc) 1062 1073 { 1063 if (strcmp 1074 if (strcmp(pSvc->m_pszSvcName, pszServiceName) == 0) 1064 1075 { 1065 1076 break; … … 1077 1088 } 1078 1089 1079 pSvc->ReferenceService 1090 pSvc->ReferenceService(); 1080 1091 1081 1092 *ppSvc = pSvc; … … 1088 1099 * @thread main HGCM 1089 1100 */ 1090 void HGCMService::ReferenceService 1091 { 1092 ASMAtomicIncU32 1101 void HGCMService::ReferenceService(void) 1102 { 1103 ASMAtomicIncU32(&m_u32RefCnt); 1093 1104 LogFlowFunc(("[%s] m_u32RefCnt = %d\n", m_pszSvcName, m_u32RefCnt)); 1094 1105 } … … 1098 1109 * @thread main HGCM 1099 1110 */ 1100 void HGCMService::ReleaseService 1111 void HGCMService::ReleaseService(void) 1101 1112 { 1102 1113 LogFlowFunc(("m_u32RefCnt = %d\n", m_u32RefCnt)); 1103 uint32_t u32RefCnt = ASMAtomicDecU32 1114 uint32_t u32RefCnt = ASMAtomicDecU32(&m_u32RefCnt); 1104 1115 AssertRelease(u32RefCnt != ~0U); 1105 1116 … … 1108 1119 if (u32RefCnt == 0) 1109 1120 { 1110 instanceDestroy 1121 instanceDestroy(); 1111 1122 delete this; 1112 1123 } … … 1118 1129 * @thread main HGCM 1119 1130 */ 1120 /* static */ void HGCMService::Reset 1131 /* static */ void HGCMService::Reset(void) 1121 1132 { 1122 1133 g_fResetting = true; … … 1129 1140 { 1130 1141 LogFlowFunc(("handle %d\n", pSvc->m_paClientIds[0])); 1131 pSvc->DisconnectClient 1142 pSvc->DisconnectClient(pSvc->m_paClientIds[0], false); 1132 1143 } 1133 1144 … … 1137 1148 while (pSvc->m_cHandleAcquires) 1138 1149 { 1139 pSvc->HandleReleased 1140 pSvc->ReleaseService 1150 pSvc->HandleReleased(); 1151 pSvc->ReleaseService(); 1141 1152 } 1142 1153 pSvc = pNextSvc; … … 1155 1166 * @thread main HGCM 1156 1167 */ 1157 /* static */ int HGCMService::SaveState 1168 /* static */ int HGCMService::SaveState(PSSMHANDLE pSSM) 1158 1169 { 1159 1170 /* Save the current handle count and restore afterwards to avoid client id conflicts. */ … … 1203 1214 1204 1215 /* Call the service, so the operation is executed by the service thread. */ 1205 rc = pSvc->saveClientState 1216 rc = pSvc->saveClientState(u32ClientId, pSSM); 1206 1217 AssertRCReturn(rc, rc); 1207 1218 } … … 1219 1230 * @thread main HGCM 1220 1231 */ 1221 /* static */ int HGCMService::LoadState 1232 /* static */ int HGCMService::LoadState(PSSMHANDLE pSSM) 1222 1233 { 1223 1234 /* Restore handle count to avoid client id conflicts. */ … … 1244 1255 AssertReturn(u32 <= VBOX_HGCM_SVC_NAME_MAX_BYTES, VERR_SSM_UNEXPECTED_DATA); 1245 1256 1246 char *pszServiceName = (char *)alloca 1257 char *pszServiceName = (char *)alloca(u32); 1247 1258 1248 1259 /* Get the service name. */ … … 1254 1265 /* Resolve the service instance. */ 1255 1266 HGCMService *pSvc; 1256 rc = ResolveService 1267 rc = ResolveService(&pSvc, pszServiceName); 1257 1268 AssertLogRelMsgReturn(pSvc, ("rc=%Rrc, %s\n", rc, pszServiceName), VERR_SSM_UNEXPECTED_DATA); 1258 1269 … … 1262 1273 if (RT_FAILURE(rc)) 1263 1274 { 1264 pSvc->ReleaseService 1275 pSvc->ReleaseService(); 1265 1276 AssertFailed(); 1266 1277 return rc; … … 1274 1285 if (RT_FAILURE(rc)) 1275 1286 { 1276 pSvc->ReleaseService 1287 pSvc->ReleaseService(); 1277 1288 AssertFailed(); 1278 1289 return rc; … … 1280 1291 1281 1292 /* Connect the client. */ 1282 rc = pSvc->CreateAndConnectClient 1293 rc = pSvc->CreateAndConnectClient(NULL, u32ClientId); 1283 1294 if (RT_FAILURE(rc)) 1284 1295 { 1285 pSvc->ReleaseService 1296 pSvc->ReleaseService(); 1286 1297 AssertLogRelMsgFailed(("rc=%Rrc %s\n", rc, pszServiceName)); 1287 1298 return rc; … … 1289 1300 1290 1301 /* Call the service, so the operation is executed by the service thread. */ 1291 rc = pSvc->loadClientState 1302 rc = pSvc->loadClientState(u32ClientId, pSSM); 1292 1303 if (RT_FAILURE(rc)) 1293 1304 { 1294 pSvc->ReleaseService 1305 pSvc->ReleaseService(); 1295 1306 AssertLogRelMsgFailed(("rc=%Rrc %s\n", rc, pszServiceName)); 1296 1307 return rc; … … 1298 1309 } 1299 1310 1300 pSvc->ReleaseService 1311 pSvc->ReleaseService(); 1301 1312 } 1302 1313 … … 1311 1322 * @return VBox rc. 1312 1323 */ 1313 int HGCMService::CreateAndConnectClient 1324 int HGCMService::CreateAndConnectClient(uint32_t *pu32ClientIdOut, uint32_t u32ClientIdIn) 1314 1325 { 1315 1326 LogFlowFunc(("pu32ClientIdOut = %p, u32ClientIdIn = %d\n", pu32ClientIdOut, u32ClientIdIn)); 1316 1327 1317 1328 /* Allocate a client information structure. */ 1318 HGCMClient *pClient = new HGCMClient 1329 HGCMClient *pClient = new HGCMClient(); 1319 1330 1320 1331 if (!pClient) … … 1328 1339 if (pu32ClientIdOut != NULL) 1329 1340 { 1330 handle = hgcmObjGenerateHandle 1341 handle = hgcmObjGenerateHandle(pClient); 1331 1342 } 1332 1343 else 1333 1344 { 1334 handle = hgcmObjAssignHandle 1345 handle = hgcmObjAssignHandle(pClient, u32ClientIdIn); 1335 1346 } 1336 1347 … … 1340 1351 1341 1352 /* Initialize the HGCM part of the client. */ 1342 int rc = pClient->Init 1353 int rc = pClient->Init(this); 1343 1354 1344 1355 if (RT_SUCCESS(rc)) … … 1347 1358 HGCMMSGHANDLE hMsg; 1348 1359 1349 rc = hgcmMsgAlloc 1360 rc = hgcmMsgAlloc(m_thread, &hMsg, SVC_MSG_CONNECT, hgcmMessageAllocSvc); 1350 1361 1351 1362 if (RT_SUCCESS(rc)) 1352 1363 { 1353 HGCMMsgSvcConnect *pMsg = (HGCMMsgSvcConnect *)hgcmObjReference 1364 HGCMMsgSvcConnect *pMsg = (HGCMMsgSvcConnect *)hgcmObjReference(hMsg, HGCMOBJ_MSG); 1354 1365 AssertRelease(pMsg); 1355 1366 1356 1367 pMsg->u32ClientId = handle; 1357 1368 1358 hgcmObjDereference 1359 1360 rc = hgcmMsgSend 1369 hgcmObjDereference(pMsg); 1370 1371 rc = hgcmMsgSend(hMsg); 1361 1372 1362 1373 if (RT_SUCCESS(rc)) … … 1365 1376 if (m_cClients == m_cClientsAllocated) 1366 1377 { 1367 m_paClientIds = (uint32_t *)RTMemRealloc (m_paClientIds, (m_cClientsAllocated + 64) * sizeof (m_paClientIds[0])); 1378 m_paClientIds = (uint32_t *)RTMemRealloc(m_paClientIds, (m_cClientsAllocated + 64) * 1379 sizeof(m_paClientIds[0])); 1368 1380 Assert(m_paClientIds); 1369 1381 m_cClientsAllocated += 64; … … 1378 1390 if (RT_FAILURE(rc)) 1379 1391 { 1380 hgcmObjDeleteHandle 1392 hgcmObjDeleteHandle(handle); 1381 1393 } 1382 1394 else … … 1387 1399 } 1388 1400 1389 ReferenceService 1401 ReferenceService(); 1390 1402 } 1391 1403 … … 1399 1411 * @return VBox rc. 1400 1412 */ 1401 int HGCMService::DisconnectClient 1413 int HGCMService::DisconnectClient(uint32_t u32ClientId, bool fFromService) 1402 1414 { 1403 1415 int rc = VINF_SUCCESS; … … 1410 1422 HGCMMSGHANDLE hMsg; 1411 1423 1412 rc = hgcmMsgAlloc 1424 rc = hgcmMsgAlloc(m_thread, &hMsg, SVC_MSG_DISCONNECT, hgcmMessageAllocSvc); 1413 1425 1414 1426 if (RT_SUCCESS(rc)) 1415 1427 { 1416 HGCMMsgSvcDisconnect *pMsg = (HGCMMsgSvcDisconnect *)hgcmObjReference 1428 HGCMMsgSvcDisconnect *pMsg = (HGCMMsgSvcDisconnect *)hgcmObjReference(hMsg, HGCMOBJ_MSG); 1417 1429 AssertRelease(pMsg); 1418 1430 1419 1431 pMsg->u32ClientId = u32ClientId; 1420 1432 1421 hgcmObjDereference 1422 1423 rc = hgcmMsgSend 1433 hgcmObjDereference(pMsg); 1434 1435 rc = hgcmMsgSend(hMsg); 1424 1436 } 1425 1437 else … … 1441 1453 if (m_cClients > i) 1442 1454 { 1443 memmove (&m_paClientIds[i], &m_paClientIds[i + 1], sizeof 1455 memmove (&m_paClientIds[i], &m_paClientIds[i + 1], sizeof(m_paClientIds[0]) * (m_cClients - i)); 1444 1456 } 1445 1457 1446 1458 /* Delete the client handle. */ 1447 hgcmObjDeleteHandle 1459 hgcmObjDeleteHandle(u32ClientId); 1448 1460 1449 1461 /* The service must be released. */ 1450 ReleaseService 1462 ReleaseService(); 1451 1463 1452 1464 break; … … 1458 1470 } 1459 1471 1460 int HGCMService::RegisterExtension 1461 1462 1472 int HGCMService::RegisterExtension(HGCMSVCEXTHANDLE handle, 1473 PFNHGCMSVCEXT pfnExtension, 1474 void *pvExtension) 1463 1475 { 1464 1476 LogFlowFunc(("%s\n", handle->pszServiceName)); … … 1466 1478 /* Forward the message to the service thread. */ 1467 1479 HGCMMSGHANDLE hMsg = 0; 1468 int rc = hgcmMsgAlloc 1480 int rc = hgcmMsgAlloc(m_thread, &hMsg, SVC_MSG_REGEXT, hgcmMessageAllocSvc); 1469 1481 1470 1482 if (RT_SUCCESS(rc)) 1471 1483 { 1472 HGCMMsgSvcRegisterExtension *pMsg = (HGCMMsgSvcRegisterExtension *)hgcmObjReference 1484 HGCMMsgSvcRegisterExtension *pMsg = (HGCMMsgSvcRegisterExtension *)hgcmObjReference(hMsg, HGCMOBJ_MSG); 1473 1485 AssertRelease(pMsg); 1474 1486 … … 1477 1489 pMsg->pvExtension = pvExtension; 1478 1490 1479 hgcmObjDereference 1480 1481 rc = hgcmMsgSend 1491 hgcmObjDereference(pMsg); 1492 1493 rc = hgcmMsgSend(hMsg); 1482 1494 } 1483 1495 … … 1486 1498 } 1487 1499 1488 void HGCMService::UnregisterExtension 1500 void HGCMService::UnregisterExtension(HGCMSVCEXTHANDLE handle) 1489 1501 { 1490 1502 /* Forward the message to the service thread. */ 1491 1503 HGCMMSGHANDLE hMsg = 0; 1492 int rc = hgcmMsgAlloc 1504 int rc = hgcmMsgAlloc(m_thread, &hMsg, SVC_MSG_UNREGEXT, hgcmMessageAllocSvc); 1493 1505 1494 1506 if (RT_SUCCESS(rc)) 1495 1507 { 1496 HGCMMsgSvcUnregisterExtension *pMsg = (HGCMMsgSvcUnregisterExtension *)hgcmObjReference 1508 HGCMMsgSvcUnregisterExtension *pMsg = (HGCMMsgSvcUnregisterExtension *)hgcmObjReference(hMsg, HGCMOBJ_MSG); 1497 1509 AssertRelease(pMsg); 1498 1510 1499 1511 pMsg->handle = handle; 1500 1512 1501 hgcmObjDereference 1502 1503 rc = hgcmMsgSend 1513 hgcmObjDereference(pMsg); 1514 1515 rc = hgcmMsgSend(hMsg); 1504 1516 } 1505 1517 … … 1517 1529 * @return VBox rc. 1518 1530 */ 1519 int HGCMService::GuestCall (PPDMIHGCMPORT pHGCMPort, PVBOXHGCMCMD pCmd, uint32_t u32ClientId, uint32_t u32Function, uint32_t cParms, VBOXHGCMSVCPARM paParms[]) 1531 int HGCMService::GuestCall(PPDMIHGCMPORT pHGCMPort, PVBOXHGCMCMD pCmd, uint32_t u32ClientId, uint32_t u32Function, 1532 uint32_t cParms, VBOXHGCMSVCPARM paParms[]) 1520 1533 { 1521 1534 HGCMMSGHANDLE hMsg = 0; … … 1523 1536 LogFlow(("MAIN::HGCMService::Call\n")); 1524 1537 1525 int rc = hgcmMsgAlloc 1538 int rc = hgcmMsgAlloc(m_thread, &hMsg, SVC_MSG_GUESTCALL, hgcmMessageAllocSvc); 1526 1539 1527 1540 if (RT_SUCCESS(rc)) 1528 1541 { 1529 HGCMMsgCall *pMsg = (HGCMMsgCall *)hgcmObjReference 1542 HGCMMsgCall *pMsg = (HGCMMsgCall *)hgcmObjReference(hMsg, HGCMOBJ_MSG); 1530 1543 1531 1544 AssertRelease(pMsg); … … 1539 1552 pMsg->paParms = paParms; 1540 1553 1541 hgcmObjDereference 1542 1543 rc = hgcmMsgPost 1554 hgcmObjDereference(pMsg); 1555 1556 rc = hgcmMsgPost(hMsg, hgcmMsgCompletionCallback); 1544 1557 } 1545 1558 else … … 1559 1572 * @return VBox rc. 1560 1573 */ 1561 int HGCMService::HostCall 1574 int HGCMService::HostCall(uint32_t u32Function, uint32_t cParms, VBOXHGCMSVCPARM *paParms) 1562 1575 { 1563 1576 LogFlowFunc(("%s u32Function = %d, cParms = %d, paParms = %p\n", … … 1565 1578 1566 1579 HGCMMSGHANDLE hMsg = 0; 1567 int rc = hgcmMsgAlloc 1580 int rc = hgcmMsgAlloc(m_thread, &hMsg, SVC_MSG_HOSTCALL, hgcmMessageAllocSvc); 1568 1581 1569 1582 if (RT_SUCCESS(rc)) 1570 1583 { 1571 HGCMMsgHostCallSvc *pMsg = (HGCMMsgHostCallSvc *)hgcmObjReference 1584 HGCMMsgHostCallSvc *pMsg = (HGCMMsgHostCallSvc *)hgcmObjReference(hMsg, HGCMOBJ_MSG); 1572 1585 AssertRelease(pMsg); 1573 1586 … … 1576 1589 pMsg->paParms = paParms; 1577 1590 1578 hgcmObjDereference 1579 1580 rc = hgcmMsgSend 1591 hgcmObjDereference(pMsg); 1592 1593 rc = hgcmMsgSend(hMsg); 1581 1594 } 1582 1595 … … 1586 1599 1587 1600 #ifdef VBOX_WITH_CRHGSMI 1588 static DECLCALLBACK(void) hgcmMsgFastCallCompletionCallback 1601 static DECLCALLBACK(void) hgcmMsgFastCallCompletionCallback(int32_t result, HGCMMsgCore *pMsgCore) 1589 1602 { 1590 1603 /* Call the VMMDev port interface to issue IRQ notification. */ … … 1594 1607 if (pMsg->pfnCompletion) 1595 1608 { 1596 pMsg->pfnCompletion 1609 pMsg->pfnCompletion(result, pMsg->u32Function, &pMsg->Param, pMsg->pvCompletion); 1597 1610 } 1598 1611 } … … 1615 1628 } 1616 1629 1617 int HGCMService::HostFastCallAsync (uint32_t u32Function, VBOXHGCMSVCPARM *pParm, PHGCMHOSTFASTCALLCB pfnCompletion, void *pvCompletion) 1630 int HGCMService::HostFastCallAsync(uint32_t u32Function, VBOXHGCMSVCPARM *pParm, PHGCMHOSTFASTCALLCB pfnCompletion, 1631 void *pvCompletion) 1618 1632 { 1619 1633 LogFlowFunc(("%s u32Function = %d, pParm = %p\n", … … 1621 1635 1622 1636 HGCMMSGHANDLE hMsg = 0; 1623 int rc = hgcmMsgAlloc 1637 int rc = hgcmMsgAlloc(m_thread, &hMsg, SVC_MSG_HOSTFASTCALLASYNC, hgcmMessageAllocSvc); 1624 1638 1625 1639 if (RT_SUCCESS(rc)) 1626 1640 { 1627 HGCMMsgHostFastCallAsyncSvc *pMsg = (HGCMMsgHostFastCallAsyncSvc *)hgcmObjReference 1641 HGCMMsgHostFastCallAsyncSvc *pMsg = (HGCMMsgHostFastCallAsyncSvc *)hgcmObjReference(hMsg, HGCMOBJ_MSG); 1628 1642 AssertRelease(pMsg); 1629 1643 … … 1633 1647 pMsg->pvCompletion = pvCompletion; 1634 1648 1635 hgcmObjDereference 1649 hgcmObjDereference(pMsg); 1636 1650 1637 1651 rc = hgcmMsgPost(hMsg, hgcmMsgFastCallCompletionCallback); … … 1759 1773 switch (u32MsgId) 1760 1774 { 1761 case HGCM_MSG_CONNECT: return new HGCMMsgMainConnect 1762 case HGCM_MSG_DISCONNECT: return new HGCMMsgMainDisconnect 1763 case HGCM_MSG_LOAD: return new HGCMMsgMainLoad 1764 case HGCM_MSG_HOSTCALL: return new HGCMMsgMainHostCall 1775 case HGCM_MSG_CONNECT: return new HGCMMsgMainConnect(); 1776 case HGCM_MSG_DISCONNECT: return new HGCMMsgMainDisconnect(); 1777 case HGCM_MSG_LOAD: return new HGCMMsgMainLoad(); 1778 case HGCM_MSG_HOSTCALL: return new HGCMMsgMainHostCall(); 1765 1779 case HGCM_MSG_LOADSTATE: 1766 case HGCM_MSG_SAVESTATE: return new HGCMMsgMainLoadSaveState 1767 case HGCM_MSG_RESET: return new HGCMMsgMainReset 1768 case HGCM_MSG_QUIT: return new HGCMMsgMainQuit 1769 case HGCM_MSG_REGEXT: return new HGCMMsgMainRegisterExtension 1770 case HGCM_MSG_UNREGEXT: return new HGCMMsgMainUnregisterExtension 1780 case HGCM_MSG_SAVESTATE: return new HGCMMsgMainLoadSaveState(); 1781 case HGCM_MSG_RESET: return new HGCMMsgMainReset(); 1782 case HGCM_MSG_QUIT: return new HGCMMsgMainQuit(); 1783 case HGCM_MSG_REGEXT: return new HGCMMsgMainRegisterExtension(); 1784 case HGCM_MSG_UNREGEXT: return new HGCMMsgMainUnregisterExtension(); 1771 1785 #ifdef VBOX_WITH_CRHGSMI 1772 1786 case HGCM_MSG_SVCAQUIRE: return new HGCMMsgMainSvcAcquire(); … … 1783 1797 1784 1798 /* The main HGCM thread handler. */ 1785 static DECLCALLBACK(void) hgcmThread 1799 static DECLCALLBACK(void) hgcmThread(HGCMTHREADHANDLE ThreadHandle, void *pvUser) 1786 1800 { 1787 1801 LogFlowFunc(("ThreadHandle = %p, pvUser = %p\n", … … 1795 1809 { 1796 1810 HGCMMsgCore *pMsgCore; 1797 int rc = hgcmMsgGet 1811 int rc = hgcmMsgGet(ThreadHandle, &pMsgCore); 1798 1812 1799 1813 if (RT_FAILURE(rc)) 1800 1814 { 1801 1815 /* The error means some serious unrecoverable problem in the hgcmMsg/hgcmThread layer. */ 1802 AssertMsgFailed 1816 AssertMsgFailed(("%Rrc\n", rc)); 1803 1817 break; 1804 1818 } 1805 1819 1806 uint32_t u32MsgId = pMsgCore->MsgId 1820 uint32_t u32MsgId = pMsgCore->MsgId(); 1807 1821 1808 1822 switch (u32MsgId) … … 1818 1832 */ 1819 1833 HGCMService *pService; 1820 rc = HGCMService::ResolveService 1834 rc = HGCMService::ResolveService(&pService, pMsg->pszServiceName); 1821 1835 1822 1836 if (RT_SUCCESS(rc)) 1823 1837 { 1824 1838 /* Call the service instance method. */ 1825 rc = pService->CreateAndConnectClient 1839 rc = pService->CreateAndConnectClient(pMsg->pu32ClientId, 0); 1826 1840 1827 1841 /* Release the service after resolve. */ 1828 pService->ReleaseService 1842 pService->ReleaseService(); 1829 1843 } 1830 1844 } break; … … 1837 1851 pMsg->u32ClientId)); 1838 1852 1839 HGCMClient *pClient = (HGCMClient *)hgcmObjReference 1853 HGCMClient *pClient = (HGCMClient *)hgcmObjReference(pMsg->u32ClientId, HGCMOBJ_CLIENT); 1840 1854 1841 1855 if (!pClient) … … 1849 1863 1850 1864 /* Call the service instance to disconnect the client. */ 1851 rc = pService->DisconnectClient 1852 1853 hgcmObjDereference 1865 rc = pService->DisconnectClient(pMsg->u32ClientId, false); 1866 1867 hgcmObjDereference(pClient); 1854 1868 } break; 1855 1869 … … 1861 1875 pMsg->pszServiceName, pMsg->pszServiceLibrary)); 1862 1876 1863 rc = HGCMService::LoadService 1877 rc = HGCMService::LoadService(pMsg->pszServiceLibrary, pMsg->pszServiceName); 1864 1878 } break; 1865 1879 … … 1873 1887 /* Resolve the service name to the pointer to service instance. */ 1874 1888 HGCMService *pService; 1875 rc = HGCMService::ResolveService 1889 rc = HGCMService::ResolveService(&pService, pMsg->pszServiceName); 1876 1890 1877 1891 if (RT_SUCCESS(rc)) 1878 1892 { 1879 rc = pService->HostCall 1880 1881 pService->ReleaseService 1893 rc = pService->HostCall(pMsg->u32Function, pMsg->cParms, pMsg->paParms); 1894 1895 pService->ReleaseService(); 1882 1896 } 1883 1897 } break; … … 1892 1906 /* Resolve the service name to the pointer to service instance. */ 1893 1907 HGCMService *pService; 1894 rc = HGCMService::ResolveService 1908 rc = HGCMService::ResolveService(&pService, pMsg->pszServiceName); 1895 1909 if (RT_SUCCESS(rc)) 1896 1910 { 1897 rc = pService->HandleAcquired 1911 rc = pService->HandleAcquired(); 1898 1912 if (RT_SUCCESS(rc)) 1899 1913 { … … 1902 1916 else 1903 1917 { 1904 pService->ReleaseService 1918 pService->ReleaseService(); 1905 1919 } 1906 1920 } … … 1915 1929 /* Resolve the service name to the pointer to service instance. */ 1916 1930 1917 rc = pMsg->pService->HandleReleased 1931 rc = pMsg->pService->HandleReleased(); 1918 1932 if (RT_SUCCESS(rc)) 1919 1933 { 1920 pMsg->pService->ReleaseService 1934 pMsg->pService->ReleaseService(); 1921 1935 } 1922 1936 } break; … … 1927 1941 LogFlowFunc(("HGCM_MSG_RESET\n")); 1928 1942 1929 HGCMService::Reset 1943 HGCMService::Reset(); 1930 1944 } break; 1931 1945 … … 1936 1950 LogFlowFunc(("HGCM_MSG_LOADSTATE\n")); 1937 1951 1938 rc = HGCMService::LoadState 1952 rc = HGCMService::LoadState(pMsg->pSSM); 1939 1953 } break; 1940 1954 … … 1945 1959 LogFlowFunc(("HGCM_MSG_SAVESTATE\n")); 1946 1960 1947 rc = HGCMService::SaveState 1961 rc = HGCMService::SaveState(pMsg->pSSM); 1948 1962 } break; 1949 1963 … … 1952 1966 LogFlowFunc(("HGCM_MSG_QUIT\n")); 1953 1967 1954 HGCMService::UnloadAll 1968 HGCMService::UnloadAll(); 1955 1969 1956 1970 fQuit = true; … … 1964 1978 1965 1979 /* Allocate the handle data. */ 1966 HGCMSVCEXTHANDLE handle = (HGCMSVCEXTHANDLE)RTMemAllocZ (sizeof(struct _HGCMSVCEXTHANDLEDATA)1967 + strlen(pMsg->pszServiceName)1968 + sizeof(char));1980 HGCMSVCEXTHANDLE handle = (HGCMSVCEXTHANDLE)RTMemAllocZ(sizeof(struct _HGCMSVCEXTHANDLEDATA) 1981 + strlen(pMsg->pszServiceName) 1982 + sizeof(char)); 1969 1983 1970 1984 if (handle == NULL) … … 1974 1988 else 1975 1989 { 1976 handle->pszServiceName = (char *)((uint8_t *)handle + sizeof 1977 strcpy 1990 handle->pszServiceName = (char *)((uint8_t *)handle + sizeof(struct _HGCMSVCEXTHANDLEDATA)); 1991 strcpy(handle->pszServiceName, pMsg->pszServiceName); 1978 1992 1979 1993 HGCMService *pService; 1980 rc = HGCMService::ResolveService 1994 rc = HGCMService::ResolveService(&pService, handle->pszServiceName); 1981 1995 1982 1996 if (RT_SUCCESS(rc)) 1983 1997 { 1984 pService->RegisterExtension 1985 1986 pService->ReleaseService 1998 pService->RegisterExtension(handle, pMsg->pfnExtension, pMsg->pvExtension); 1999 2000 pService->ReleaseService(); 1987 2001 } 1988 2002 1989 2003 if (RT_FAILURE(rc)) 1990 2004 { 1991 RTMemFree 2005 RTMemFree(handle); 1992 2006 } 1993 2007 else … … 2005 2019 2006 2020 HGCMService *pService; 2007 rc = HGCMService::ResolveService 2021 rc = HGCMService::ResolveService(&pService, pMsg->handle->pszServiceName); 2008 2022 2009 2023 if (RT_SUCCESS(rc)) 2010 2024 { 2011 pService->UnregisterExtension 2012 2013 pService->ReleaseService 2014 } 2015 2016 RTMemFree 2025 pService->UnregisterExtension(pMsg->handle); 2026 2027 pService->ReleaseService(); 2028 } 2029 2030 RTMemFree(pMsg->handle); 2017 2031 } break; 2018 2032 … … 2025 2039 2026 2040 /* Complete the message processing. */ 2027 hgcmMsgComplete 2041 hgcmMsgComplete(pMsgCore, rc); 2028 2042 2029 2043 LogFlowFunc(("message processed %Rrc\n", rc)); … … 2053 2067 * @return VBox rc. 2054 2068 */ 2055 int HGCMHostLoad 2056 2069 int HGCMHostLoad(const char *pszServiceLibrary, 2070 const char *pszServiceName) 2057 2071 { 2058 2072 LogFlowFunc(("lib = %s, name = %s\n", pszServiceLibrary, pszServiceName)); … … 2066 2080 HGCMMSGHANDLE hMsg = 0; 2067 2081 2068 int rc = hgcmMsgAlloc 2082 int rc = hgcmMsgAlloc(g_hgcmThread, &hMsg, HGCM_MSG_LOAD, hgcmMainMessageAlloc); 2069 2083 2070 2084 if (RT_SUCCESS(rc)) 2071 2085 { 2072 2086 /* Initialize the message. Since the message is synchronous, use the supplied pointers. */ 2073 HGCMMsgMainLoad *pMsg = (HGCMMsgMainLoad *)hgcmObjReference 2087 HGCMMsgMainLoad *pMsg = (HGCMMsgMainLoad *)hgcmObjReference(hMsg, HGCMOBJ_MSG); 2074 2088 AssertRelease(pMsg); 2075 2089 … … 2077 2091 pMsg->pszServiceName = pszServiceName; 2078 2092 2079 hgcmObjDereference 2080 2081 rc = hgcmMsgSend 2093 hgcmObjDereference(pMsg); 2094 2095 rc = hgcmMsgSend(hMsg); 2082 2096 } 2083 2097 … … 2094 2108 * @return VBox rc. 2095 2109 */ 2096 int HGCMHostRegisterServiceExtension 2097 2098 2099 2110 int HGCMHostRegisterServiceExtension(HGCMSVCEXTHANDLE *pHandle, 2111 const char *pszServiceName, 2112 PFNHGCMSVCEXT pfnExtension, 2113 void *pvExtension) 2100 2114 { 2101 2115 LogFlowFunc(("pHandle = %p, name = %s, pfn = %p, rv = %p\n", pHandle, pszServiceName, pfnExtension, pvExtension)); … … 2109 2123 HGCMMSGHANDLE hMsg = 0; 2110 2124 2111 int rc = hgcmMsgAlloc 2125 int rc = hgcmMsgAlloc(g_hgcmThread, &hMsg, HGCM_MSG_REGEXT, hgcmMainMessageAlloc); 2112 2126 2113 2127 if (RT_SUCCESS(rc)) 2114 2128 { 2115 2129 /* Initialize the message. Since the message is synchronous, use the supplied pointers. */ 2116 HGCMMsgMainRegisterExtension *pMsg = (HGCMMsgMainRegisterExtension *)hgcmObjReference 2130 HGCMMsgMainRegisterExtension *pMsg = (HGCMMsgMainRegisterExtension *)hgcmObjReference(hMsg, HGCMOBJ_MSG); 2117 2131 AssertRelease(pMsg); 2118 2132 … … 2122 2136 pMsg->pvExtension = pvExtension; 2123 2137 2124 hgcmObjDereference 2125 2126 rc = hgcmMsgSend 2138 hgcmObjDereference(pMsg); 2139 2140 rc = hgcmMsgSend(hMsg); 2127 2141 } 2128 2142 … … 2131 2145 } 2132 2146 2133 void HGCMHostUnregisterServiceExtension 2147 void HGCMHostUnregisterServiceExtension(HGCMSVCEXTHANDLE handle) 2134 2148 { 2135 2149 LogFlowFunc(("handle = %p\n", handle)); … … 2138 2152 HGCMMSGHANDLE hMsg = 0; 2139 2153 2140 int rc = hgcmMsgAlloc 2154 int rc = hgcmMsgAlloc(g_hgcmThread, &hMsg, HGCM_MSG_UNREGEXT, hgcmMainMessageAlloc); 2141 2155 2142 2156 if (RT_SUCCESS(rc)) 2143 2157 { 2144 2158 /* Initialize the message. */ 2145 HGCMMsgMainUnregisterExtension *pMsg = (HGCMMsgMainUnregisterExtension *)hgcmObjReference 2159 HGCMMsgMainUnregisterExtension *pMsg = (HGCMMsgMainUnregisterExtension *)hgcmObjReference(hMsg, HGCMOBJ_MSG); 2146 2160 AssertRelease(pMsg); 2147 2161 2148 2162 pMsg->handle = handle; 2149 2163 2150 hgcmObjDereference 2151 2152 rc = hgcmMsgSend 2164 hgcmObjDereference(pMsg); 2165 2166 rc = hgcmMsgSend(hMsg); 2153 2167 } 2154 2168 … … 2165 2179 * @return VBox rc. 2166 2180 */ 2167 int HGCMGuestConnect 2168 2169 2170 2181 int HGCMGuestConnect(PPDMIHGCMPORT pHGCMPort, 2182 PVBOXHGCMCMD pCmd, 2183 const char *pszServiceName, 2184 uint32_t *pu32ClientId) 2171 2185 { 2172 2186 LogFlowFunc(("pHGCMPort = %p, pCmd = %p, name = %s, pu32ClientId = %p\n", … … 2181 2195 HGCMMSGHANDLE hMsg = 0; 2182 2196 2183 int rc = hgcmMsgAlloc 2197 int rc = hgcmMsgAlloc(g_hgcmThread, &hMsg, HGCM_MSG_CONNECT, hgcmMainMessageAlloc); 2184 2198 2185 2199 if (RT_SUCCESS(rc)) … … 2189 2203 * use the supplied pointers. 2190 2204 */ 2191 HGCMMsgMainConnect *pMsg = (HGCMMsgMainConnect *)hgcmObjReference 2205 HGCMMsgMainConnect *pMsg = (HGCMMsgMainConnect *)hgcmObjReference(hMsg, HGCMOBJ_MSG); 2192 2206 AssertRelease(pMsg); 2193 2207 … … 2197 2211 pMsg->pu32ClientId = pu32ClientId; 2198 2212 2199 hgcmObjDereference 2200 2201 rc = hgcmMsgPost 2213 hgcmObjDereference(pMsg); 2214 2215 rc = hgcmMsgPost(hMsg, hgcmMsgCompletionCallback); 2202 2216 } 2203 2217 … … 2213 2227 * @return VBox rc. 2214 2228 */ 2215 int HGCMGuestDisconnect 2216 2217 2229 int HGCMGuestDisconnect(PPDMIHGCMPORT pHGCMPort, 2230 PVBOXHGCMCMD pCmd, 2231 uint32_t u32ClientId) 2218 2232 { 2219 2233 LogFlowFunc(("pHGCMPort = %p, pCmd = %p, u32ClientId = %d\n", … … 2228 2242 HGCMMSGHANDLE hMsg = 0; 2229 2243 2230 int rc = hgcmMsgAlloc 2244 int rc = hgcmMsgAlloc(g_hgcmThread, &hMsg, HGCM_MSG_DISCONNECT, hgcmMainMessageAlloc); 2231 2245 2232 2246 if (RT_SUCCESS(rc)) 2233 2247 { 2234 2248 /* Initialize the message. */ 2235 HGCMMsgMainDisconnect *pMsg = (HGCMMsgMainDisconnect *)hgcmObjReference 2249 HGCMMsgMainDisconnect *pMsg = (HGCMMsgMainDisconnect *)hgcmObjReference(hMsg, HGCMOBJ_MSG); 2236 2250 AssertRelease(pMsg); 2237 2251 … … 2240 2254 pMsg->u32ClientId = u32ClientId; 2241 2255 2242 hgcmObjDereference 2243 2244 rc = hgcmMsgPost 2256 hgcmObjDereference(pMsg); 2257 2258 rc = hgcmMsgPost(hMsg, hgcmMsgCompletionCallback); 2245 2259 } 2246 2260 … … 2255 2269 * @return VBox rc. 2256 2270 */ 2257 static int hgcmHostLoadSaveState 2258 2271 static int hgcmHostLoadSaveState(PSSMHANDLE pSSM, 2272 uint32_t u32MsgId) 2259 2273 { 2260 2274 LogFlowFunc(("pSSM = %p, u32MsgId = %d\n", pSSM, u32MsgId)); … … 2262 2276 HGCMMSGHANDLE hMsg = 0; 2263 2277 2264 int rc = hgcmMsgAlloc 2278 int rc = hgcmMsgAlloc(g_hgcmThread, &hMsg, u32MsgId, hgcmMainMessageAlloc); 2265 2279 2266 2280 if (RT_SUCCESS(rc)) 2267 2281 { 2268 HGCMMsgMainLoadSaveState *pMsg = (HGCMMsgMainLoadSaveState *)hgcmObjReference 2282 HGCMMsgMainLoadSaveState *pMsg = (HGCMMsgMainLoadSaveState *)hgcmObjReference(hMsg, HGCMOBJ_MSG); 2269 2283 AssertRelease(pMsg); 2270 2284 2271 2285 pMsg->pSSM = pSSM; 2272 2286 2273 hgcmObjDereference 2274 2275 rc = hgcmMsgSend 2287 hgcmObjDereference(pMsg); 2288 2289 rc = hgcmMsgSend(hMsg); 2276 2290 } 2277 2291 … … 2285 2299 * @return VBox rc. 2286 2300 */ 2287 int HGCMHostSaveState 2288 { 2289 return hgcmHostLoadSaveState 2301 int HGCMHostSaveState(PSSMHANDLE pSSM) 2302 { 2303 return hgcmHostLoadSaveState(pSSM, HGCM_MSG_SAVESTATE); 2290 2304 } 2291 2305 … … 2295 2309 * @return VBox rc. 2296 2310 */ 2297 int HGCMHostLoadState 2298 { 2299 return hgcmHostLoadSaveState 2311 int HGCMHostLoadState(PSSMHANDLE pSSM) 2312 { 2313 return hgcmHostLoadSaveState(pSSM, HGCM_MSG_LOADSTATE); 2300 2314 } 2301 2315 … … 2310 2324 * @return VBox rc. 2311 2325 */ 2312 int HGCMGuestCall 2313 2314 2315 2316 2317 2326 int HGCMGuestCall(PPDMIHGCMPORT pHGCMPort, 2327 PVBOXHGCMCMD pCmd, 2328 uint32_t u32ClientId, 2329 uint32_t u32Function, 2330 uint32_t cParms, 2331 VBOXHGCMSVCPARM *paParms) 2318 2332 { 2319 2333 LogFlowFunc(("pHGCMPort = %p, pCmd = %p, u32ClientId = %d, u32Function = %d, cParms = %d, paParms = %p\n", … … 2328 2342 2329 2343 /* Resolve the client handle to the client instance pointer. */ 2330 HGCMClient *pClient = (HGCMClient *)hgcmObjReference 2344 HGCMClient *pClient = (HGCMClient *)hgcmObjReference(u32ClientId, HGCMOBJ_CLIENT); 2331 2345 2332 2346 if (pClient) … … 2335 2349 2336 2350 /* Forward the message to the service thread. */ 2337 rc = pClient->pService->GuestCall 2338 2339 hgcmObjDereference 2351 rc = pClient->pService->GuestCall(pHGCMPort, pCmd, u32ClientId, u32Function, cParms, paParms); 2352 2353 hgcmObjDereference(pClient); 2340 2354 } 2341 2355 … … 2352 2366 * @return VBox rc. 2353 2367 */ 2354 int HGCMHostCall 2355 2356 2357 2368 int HGCMHostCall(const char *pszServiceName, 2369 uint32_t u32Function, 2370 uint32_t cParms, 2371 VBOXHGCMSVCPARM *paParms) 2358 2372 { 2359 2373 LogFlowFunc(("name = %s, u32Function = %d, cParms = %d, paParms = %p\n", … … 2373 2387 * other non-time-critical functions. 2374 2388 */ 2375 int rc = hgcmMsgAlloc 2389 int rc = hgcmMsgAlloc(g_hgcmThread, &hMsg, HGCM_MSG_HOSTCALL, hgcmMainMessageAlloc); 2376 2390 2377 2391 if (RT_SUCCESS(rc)) 2378 2392 { 2379 HGCMMsgMainHostCall *pMsg = (HGCMMsgMainHostCall *)hgcmObjReference 2393 HGCMMsgMainHostCall *pMsg = (HGCMMsgMainHostCall *)hgcmObjReference(hMsg, HGCMOBJ_MSG); 2380 2394 AssertRelease(pMsg); 2381 2395 … … 2385 2399 pMsg->paParms = paParms; 2386 2400 2387 hgcmObjDereference 2388 2389 rc = hgcmMsgSend 2401 hgcmObjDereference(pMsg); 2402 2403 rc = hgcmMsgSend(hMsg); 2390 2404 } 2391 2405 … … 2395 2409 2396 2410 #ifdef VBOX_WITH_CRHGSMI 2397 int HGCMHostSvcHandleCreate 2411 int HGCMHostSvcHandleCreate(const char *pszServiceName, HGCMCVSHANDLE * phSvc) 2398 2412 { 2399 2413 LogFlowFunc(("name = %s\n", pszServiceName)); … … 2417 2431 * other non-time-critical functions. 2418 2432 */ 2419 int rc = hgcmMsgAlloc 2433 int rc = hgcmMsgAlloc(g_hgcmThread, &hMsg, HGCM_MSG_SVCAQUIRE, hgcmMainMessageAlloc); 2420 2434 2421 2435 if (RT_SUCCESS(rc)) 2422 2436 { 2423 HGCMMsgMainSvcAcquire *pMsg = (HGCMMsgMainSvcAcquire *)hgcmObjReference 2437 HGCMMsgMainSvcAcquire *pMsg = (HGCMMsgMainSvcAcquire *)hgcmObjReference(hMsg, HGCMOBJ_MSG); 2424 2438 AssertRelease(pMsg); 2425 2439 … … 2427 2441 pMsg->pService = NULL; 2428 2442 2429 rc = hgcmMsgSend 2443 rc = hgcmMsgSend(hMsg); 2430 2444 if (RT_SUCCESS(rc)) 2431 2445 { … … 2434 2448 } 2435 2449 2436 hgcmObjDereference 2450 hgcmObjDereference(pMsg); 2437 2451 } 2438 2452 … … 2441 2455 } 2442 2456 2443 int HGCMHostSvcHandleDestroy 2457 int HGCMHostSvcHandleDestroy(HGCMCVSHANDLE hSvc) 2444 2458 { 2445 2459 LogFlowFunc(("hSvc = %p\n", hSvc)); … … 2458 2472 * other non-time-critical functions. 2459 2473 */ 2460 int rc = hgcmMsgAlloc 2474 int rc = hgcmMsgAlloc(g_hgcmThread, &hMsg, HGCM_MSG_SVCRELEASE, hgcmMainMessageAlloc); 2461 2475 2462 2476 if (RT_SUCCESS(rc)) 2463 2477 { 2464 HGCMMsgMainSvcRelease *pMsg = (HGCMMsgMainSvcRelease *)hgcmObjReference 2478 HGCMMsgMainSvcRelease *pMsg = (HGCMMsgMainSvcRelease *)hgcmObjReference(hMsg, HGCMOBJ_MSG); 2465 2479 AssertRelease(pMsg); 2466 2480 2467 2481 pMsg->pService = (HGCMService *)hSvc; 2468 2482 2469 hgcmObjDereference 2470 2471 rc = hgcmMsgSend 2483 hgcmObjDereference(pMsg); 2484 2485 rc = hgcmMsgSend(hMsg); 2472 2486 } 2473 2487 … … 2476 2490 } 2477 2491 2478 int HGCMHostFastCallAsync (HGCMCVSHANDLE hSvc, uint32_t function, VBOXHGCMSVCPARM *pParm, PHGCMHOSTFASTCALLCB pfnCompletion, void *pvCompletion) 2492 int HGCMHostFastCallAsync(HGCMCVSHANDLE hSvc, uint32_t function, VBOXHGCMSVCPARM *pParm, PHGCMHOSTFASTCALLCB pfnCompletion, 2493 void *pvCompletion) 2479 2494 { 2480 2495 LogFlowFunc(("hSvc = %p, u32Function = %d, pParm = %p\n", … … 2487 2502 2488 2503 HGCMService *pService = (HGCMService *)hSvc; 2489 int rc = pService->HostFastCallAsync 2504 int rc = pService->HostFastCallAsync(function, pParm, pfnCompletion, pvCompletion); 2490 2505 2491 2506 LogFlowFunc(("rc = %Rrc\n", rc)); … … 2494 2509 #endif 2495 2510 2496 int HGCMHostReset 2511 int HGCMHostReset(void) 2497 2512 { 2498 2513 LogFlowFunc(("\n")); … … 2503 2518 HGCMMSGHANDLE hMsg = 0; 2504 2519 2505 int rc = hgcmMsgAlloc 2520 int rc = hgcmMsgAlloc(g_hgcmThread, &hMsg, HGCM_MSG_RESET, hgcmMainMessageAlloc); 2506 2521 2507 2522 if (RT_SUCCESS(rc)) 2508 2523 { 2509 rc = hgcmMsgSend 2524 rc = hgcmMsgSend(hMsg); 2510 2525 } 2511 2526 … … 2514 2529 } 2515 2530 2516 int HGCMHostInit 2531 int HGCMHostInit(void) 2517 2532 { 2518 2533 LogFlowFunc(("\n")); 2519 2534 2520 int rc = hgcmThreadInit 2535 int rc = hgcmThreadInit(); 2521 2536 2522 2537 if (RT_SUCCESS(rc)) … … 2526 2541 */ 2527 2542 2528 rc = hgcmThreadCreate 2543 rc = hgcmThreadCreate(&g_hgcmThread, "MainHGCMthread", hgcmThread, NULL); 2529 2544 2530 2545 if (RT_FAILURE(rc)) … … 2538 2553 } 2539 2554 2540 int HGCMHostShutdown 2555 int HGCMHostShutdown(void) 2541 2556 { 2542 2557 LogFlowFunc(("\n")); … … 2546 2561 */ 2547 2562 2548 int rc = HGCMHostReset 2563 int rc = HGCMHostReset(); 2549 2564 2550 2565 if (RT_SUCCESS(rc)) … … 2553 2568 HGCMMSGHANDLE hMsg = 0; 2554 2569 2555 rc = hgcmMsgAlloc 2570 rc = hgcmMsgAlloc(g_hgcmThread, &hMsg, HGCM_MSG_QUIT, hgcmMainMessageAlloc); 2556 2571 2557 2572 if (RT_SUCCESS(rc)) 2558 2573 { 2559 rc = hgcmMsgSend 2574 rc = hgcmMsgSend(hMsg); 2560 2575 2561 2576 if (RT_SUCCESS(rc)) 2562 2577 { 2563 2578 /* Wait for the thread termination. */ 2564 hgcmThreadWait 2579 hgcmThreadWait(g_hgcmThread); 2565 2580 g_hgcmThread = 0; 2566 2581 2567 hgcmThreadUninit 2582 hgcmThreadUninit(); 2568 2583 } 2569 2584 } -
trunk/src/VBox/Main/src-client/HGCMThread.cpp
r47117 r51092 287 287 288 288 RTTHREAD thread; 289 rc = RTThreadCreate (&thread, hgcmWorkerThreadFunc, this, 0, /* default stack size; some service may need quite a bit */ 289 rc = RTThreadCreate (&thread, hgcmWorkerThreadFunc, this, 0, /* default stack size; some service 290 may need quite a bit */ 290 291 RTTHREADTYPE_IO, RTTHREADFLAGS_WAITABLE, 291 292 pszThreadName); … … 696 697 int hgcmMsgAlloc (HGCMTHREADHANDLE hThread, HGCMMSGHANDLE *pHandle, uint32_t u32MsgId, PFNHGCMNEWMSGALLOC pfnNewMessage) 697 698 { 698 LogFlow(("hgcmMsgAlloc: thread handle = 0x%08X, pHandle = %p, sizeof (HGCMMsgCore) = %d\n", hThread, pHandle, sizeof (HGCMMsgCore))); 699 LogFlow(("hgcmMsgAlloc: thread handle = 0x%08X, pHandle = %p, sizeof (HGCMMsgCore) = %d\n", 700 hThread, pHandle, sizeof (HGCMMsgCore))); 699 701 700 702 if (!pHandle) -
trunk/src/VBox/Main/src-client/MachineDebuggerImpl.cpp
r47905 r51092 125 125 * @param a_fEnabled Where to store the result. 126 126 */ 127 STDMETHODIMP MachineDebugger::COMGETTER(SingleStep)(BOOL *a_fEnabled) 128 { 129 CheckComArgOutPointerValid(a_fEnabled); 130 131 AutoCaller autoCaller(this); 132 HRESULT hrc = autoCaller.rc(); 133 if (SUCCEEDED(hrc)) 134 { 135 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 136 Console::SafeVMPtr ptrVM(mParent); 137 hrc = ptrVM.rc(); 138 if (SUCCEEDED(hrc)) 139 { 140 /** @todo */ 141 ReturnComNotImplemented(); 142 } 127 HRESULT MachineDebugger::getSingleStep(BOOL *aSingleStep) 128 { 129 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 130 Console::SafeVMPtr ptrVM(mParent); 131 HRESULT hrc = ptrVM.rc(); 132 if (SUCCEEDED(hrc)) 133 { 134 /** @todo */ 135 ReturnComNotImplemented(); 143 136 } 144 137 return hrc; … … 151 144 * @param a_fEnable The new state. 152 145 */ 153 STDMETHODIMP MachineDebugger::COMSETTER(SingleStep)(BOOL a_fEnable) 154 { 155 AutoCaller autoCaller(this); 156 HRESULT hrc = autoCaller.rc(); 157 if (SUCCEEDED(hrc)) 158 { 159 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 160 Console::SafeVMPtr ptrVM(mParent); 161 hrc = ptrVM.rc(); 162 if (SUCCEEDED(hrc)) 163 { 164 /** @todo */ 165 ReturnComNotImplemented(); 166 } 146 HRESULT MachineDebugger::setSingleStep(BOOL aSingleStep) 147 { 148 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 149 Console::SafeVMPtr ptrVM(mParent); 150 HRESULT hrc = ptrVM.rc(); 151 if (SUCCEEDED(hrc)) 152 { 153 /** @todo */ 154 ReturnComNotImplemented(); 167 155 } 168 156 return hrc; … … 176 164 * @param pfEnforced Where to return the policy setting. 177 165 */ 178 HRESULT MachineDebugger:: getEmExecPolicyProperty(EMEXECPOLICY enmPolicy, BOOL *pfEnforced)166 HRESULT MachineDebugger::i_getEmExecPolicyProperty(EMEXECPOLICY enmPolicy, BOOL *pfEnforced) 179 167 { 180 168 CheckComArgOutPointerValid(pfEnforced); … … 185 173 { 186 174 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 187 if ( queueSettings())175 if (i_queueSettings()) 188 176 *pfEnforced = maiQueuedEmExecPolicyParams[enmPolicy] == 1; 189 177 else … … 207 195 * @param fEnforce Whether to enforce the policy or not. 208 196 */ 209 HRESULT MachineDebugger:: setEmExecPolicyProperty(EMEXECPOLICY enmPolicy, BOOL fEnforce)197 HRESULT MachineDebugger::i_setEmExecPolicyProperty(EMEXECPOLICY enmPolicy, BOOL fEnforce) 210 198 { 211 199 AutoCaller autoCaller(this); … … 214 202 { 215 203 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 216 if ( queueSettings())204 if (i_queueSettings()) 217 205 maiQueuedEmExecPolicyParams[enmPolicy] = fEnforce ? 1 : 0; 218 206 else … … 237 225 * @param a_fEnabled address of result variable 238 226 */ 239 STDMETHODIMP MachineDebugger::COMGETTER(RecompileUser) (BOOL *aEnabled)240 { 241 return getEmExecPolicyProperty(EMEXECPOLICY_RECOMPILE_RING3, aEnabled);227 HRESULT MachineDebugger::getRecompileUser(BOOL *aRecompileUser) 228 { 229 return i_getEmExecPolicyProperty(EMEXECPOLICY_RECOMPILE_RING3, aRecompileUser); 242 230 } 243 231 … … 248 236 * @param aEnable new user mode code recompile flag. 249 237 */ 250 STDMETHODIMP MachineDebugger::COMSETTER(RecompileUser)(BOOL aEnable)251 { 252 LogFlowThisFunc(("enable=%d\n", a Enable));253 return setEmExecPolicyProperty(EMEXECPOLICY_RECOMPILE_RING3, aEnable);238 HRESULT MachineDebugger::setRecompileUser(BOOL aRecompileUser) 239 { 240 LogFlowThisFunc(("enable=%d\n", aRecompileUser)); 241 return i_setEmExecPolicyProperty(EMEXECPOLICY_RECOMPILE_RING3, aRecompileUser); 254 242 } 255 243 … … 260 248 * @param aEnabled address of result variable 261 249 */ 262 STDMETHODIMP MachineDebugger::COMGETTER(RecompileSupervisor) (BOOL *aEnabled)263 { 264 return getEmExecPolicyProperty(EMEXECPOLICY_RECOMPILE_RING0, aEnabled);250 HRESULT MachineDebugger::getRecompileSupervisor(BOOL *aRecompileSupervisor) 251 { 252 return i_getEmExecPolicyProperty(EMEXECPOLICY_RECOMPILE_RING0, aRecompileSupervisor); 265 253 } 266 254 … … 271 259 * @param aEnable new recompile supervisor code flag 272 260 */ 273 STDMETHODIMP MachineDebugger::COMSETTER(RecompileSupervisor)(BOOL aEnable)274 { 275 LogFlowThisFunc(("enable=%d\n", a Enable));276 return setEmExecPolicyProperty(EMEXECPOLICY_RECOMPILE_RING0, aEnable);261 HRESULT MachineDebugger::setRecompileSupervisor(BOOL aRecompileSupervisor) 262 { 263 LogFlowThisFunc(("enable=%d\n", aRecompileSupervisor)); 264 return i_setEmExecPolicyProperty(EMEXECPOLICY_RECOMPILE_RING0, aRecompileSupervisor); 277 265 } 278 266 … … 283 271 * @param aEnabled Address of result variable. 284 272 */ 285 STDMETHODIMP MachineDebugger::COMGETTER(ExecuteAllInIEM) (BOOL *aEnabled)286 { 287 return getEmExecPolicyProperty(EMEXECPOLICY_IEM_ALL, aEnabled);273 HRESULT MachineDebugger::getExecuteAllInIEM(BOOL *aExecuteAllInIEM) 274 { 275 return i_getEmExecPolicyProperty(EMEXECPOLICY_IEM_ALL, aExecuteAllInIEM); 288 276 } 289 277 … … 294 282 * @param aEnable New setting. 295 283 */ 296 STDMETHODIMP MachineDebugger::COMSETTER(ExecuteAllInIEM)(BOOL aEnable)297 { 298 LogFlowThisFunc(("enable=%d\n", aE nable));299 return setEmExecPolicyProperty(EMEXECPOLICY_IEM_ALL, aEnable);284 HRESULT MachineDebugger::setExecuteAllInIEM(BOOL aExecuteAllInIEM) 285 { 286 LogFlowThisFunc(("enable=%d\n", aExecuteAllInIEM)); 287 return i_setEmExecPolicyProperty(EMEXECPOLICY_IEM_ALL, aExecuteAllInIEM); 300 288 } 301 289 … … 306 294 * @param aEnabled address of result variable 307 295 */ 308 STDMETHODIMP MachineDebugger::COMGETTER(PATMEnabled) (BOOL *aEnabled) 309 { 310 CheckComArgOutPointerValid(aEnabled); 311 312 AutoCaller autoCaller(this); 313 if (FAILED(autoCaller.rc())) 314 return autoCaller.rc(); 315 296 HRESULT MachineDebugger::getPATMEnabled(BOOL *aPATMEnabled) 297 { 316 298 #ifdef VBOX_WITH_RAW_MODE 317 299 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); … … 319 301 Console::SafeVMPtrQuiet ptrVM(mParent); 320 302 if (ptrVM.isOk()) 321 *a Enabled = PATMR3IsEnabled (ptrVM.rawUVM());303 *aPATMEnabled = PATMR3IsEnabled (ptrVM.rawUVM()); 322 304 else 323 305 #endif 324 *a Enabled = false;306 *aPATMEnabled = false; 325 307 326 308 return S_OK; … … 333 315 * @param aEnable new patch manager enabled flag 334 316 */ 335 STDMETHODIMP MachineDebugger::COMSETTER(PATMEnabled) (BOOL aEnable) 336 { 337 LogFlowThisFunc(("enable=%d\n", aEnable)); 338 339 AutoCaller autoCaller(this); 340 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 317 HRESULT MachineDebugger::setPATMEnabled(BOOL aPATMEnabled) 318 { 319 LogFlowThisFunc(("enable=%d\n", aPATMEnabled)); 341 320 342 321 #ifdef VBOX_WITH_RAW_MODE 343 322 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 344 323 345 if ( queueSettings())324 if (i_queueSettings()) 346 325 { 347 326 // queue the request 348 mPatmEnabledQueued = a Enable;327 mPatmEnabledQueued = aPATMEnabled; 349 328 return S_OK; 350 329 } … … 354 333 return ptrVM.rc(); 355 334 356 int vrc = PATMR3AllowPatching(ptrVM.rawUVM(), RT_BOOL(a Enable));335 int vrc = PATMR3AllowPatching(ptrVM.rawUVM(), RT_BOOL(aPATMEnabled)); 357 336 if (RT_FAILURE(vrc)) 358 337 return setError(VBOX_E_VM_ERROR, tr("PATMR3AllowPatching returned %Rrc"), vrc); 359 338 360 339 #else /* !VBOX_WITH_RAW_MODE */ 361 if (a Enable)340 if (aPATMEnabled) 362 341 return setError(VBOX_E_VM_ERROR, tr("PATM not present"), VERR_NOT_SUPPORTED); 363 342 #endif /* !VBOX_WITH_RAW_MODE */ … … 371 350 * @param aEnabled address of result variable 372 351 */ 373 STDMETHODIMP MachineDebugger::COMGETTER(CSAMEnabled) (BOOL *aEnabled) 374 { 375 CheckComArgOutPointerValid(aEnabled); 376 377 AutoCaller autoCaller(this); 378 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 379 352 HRESULT MachineDebugger::getCSAMEnabled(BOOL *aCSAMEnabled) 353 { 380 354 #ifdef VBOX_WITH_RAW_MODE 381 355 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); … … 384 358 385 359 if (ptrVM.isOk()) 386 *a Enabled = CSAMR3IsEnabled(ptrVM.rawUVM());360 *aCSAMEnabled = CSAMR3IsEnabled(ptrVM.rawUVM()); 387 361 else 388 362 #endif /* VBOX_WITH_RAW_MODE */ 389 *a Enabled = false;363 *aCSAMEnabled = false; 390 364 391 365 return S_OK; … … 398 372 * @param aEnable new code scanner enabled flag 399 373 */ 400 STDMETHODIMP MachineDebugger::COMSETTER(CSAMEnabled) (BOOL aEnable) 401 { 402 LogFlowThisFunc(("enable=%d\n", aEnable)); 403 404 AutoCaller autoCaller(this); 405 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 374 HRESULT MachineDebugger::setCSAMEnabled(BOOL aCSAMEnabled) 375 { 376 LogFlowThisFunc(("enable=%d\n", aCSAMEnabled)); 406 377 407 378 #ifdef VBOX_WITH_RAW_MODE 408 379 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 409 380 410 if ( queueSettings())381 if (i_queueSettings()) 411 382 { 412 383 // queue the request 413 mCsamEnabledQueued = a Enable;384 mCsamEnabledQueued = aCSAMEnabled; 414 385 return S_OK; 415 386 } … … 419 390 return ptrVM.rc(); 420 391 421 int vrc = CSAMR3SetScanningEnabled(ptrVM.rawUVM(), a Enable!= FALSE);392 int vrc = CSAMR3SetScanningEnabled(ptrVM.rawUVM(), aCSAMEnabled != FALSE); 422 393 if (RT_FAILURE(vrc)) 423 394 return setError(VBOX_E_VM_ERROR, tr("CSAMR3SetScanningEnabled returned %Rrc"), vrc); 424 395 425 396 #else /* !VBOX_WITH_RAW_MODE */ 426 if (a Enable)397 if (aCSAMEnabled) 427 398 return setError(VBOX_E_VM_ERROR, tr("CASM not present"), VERR_NOT_SUPPORTED); 428 399 #endif /* !VBOX_WITH_RAW_MODE */ … … 436 407 * @param aEnabled address of result variable 437 408 */ 438 STDMETHODIMP MachineDebugger::COMGETTER(LogEnabled) (BOOL *aEnabled) 439 { 440 CheckComArgOutPointerValid(aEnabled); 441 442 AutoCaller autoCaller(this); 443 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 444 409 HRESULT MachineDebugger::getLogEnabled(BOOL *aLogEnabled) 410 { 445 411 #ifdef LOG_ENABLED 446 412 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 447 413 448 414 const PRTLOGGER pLogInstance = RTLogDefaultInstance(); 449 *a Enabled = pLogInstance && !(pLogInstance->fFlags & RTLOGFLAGS_DISABLED);415 *aLogEnabled = pLogInstance && !(pLogInstance->fFlags & RTLOGFLAGS_DISABLED); 450 416 #else 451 *a Enabled = false;417 *aLogEnabled = false; 452 418 #endif 453 419 … … 461 427 * @param aEnabled The new code log state. 462 428 */ 463 STDMETHODIMP MachineDebugger::COMSETTER(LogEnabled) (BOOL aEnabled) 464 { 465 LogFlowThisFunc(("aEnabled=%d\n", aEnabled)); 466 467 AutoCaller autoCaller(this); 468 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 429 HRESULT MachineDebugger::setLogEnabled(BOOL aLogEnabled) 430 { 431 LogFlowThisFunc(("aLogEnabled=%d\n", aLogEnabled)); 469 432 470 433 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 471 434 472 if ( queueSettings())435 if (i_queueSettings()) 473 436 { 474 437 // queue the request 475 mLogEnabledQueued = a Enabled;438 mLogEnabledQueued = aLogEnabled; 476 439 return S_OK; 477 440 } … … 481 444 482 445 #ifdef LOG_ENABLED 483 int vrc = DBGFR3LogModifyFlags(ptrVM.rawUVM(), a Enabled ? "enabled" : "disabled");446 int vrc = DBGFR3LogModifyFlags(ptrVM.rawUVM(), aLogEnabled ? "enabled" : "disabled"); 484 447 if (RT_FAILURE(vrc)) 485 448 { … … 491 454 } 492 455 493 HRESULT MachineDebugger::logStringProps(PRTLOGGER pLogger, PFNLOGGETSTR pfnLogGetStr, 494 const char *pszLogGetStr, BSTR *a_pbstrSettings) 495 { 456 HRESULT MachineDebugger::i_logStringProps(PRTLOGGER pLogger, PFNLOGGETSTR pfnLogGetStr, 457 const char *pszLogGetStr, Utf8Str astrSettings) 458 { 459 BSTR *a_pbstrSettings = new BSTR; 460 astrSettings.cloneTo(a_pbstrSettings); 461 496 462 /* Make sure the VM is powered up. */ 497 463 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); … … 541 507 } 542 508 543 544 STDMETHODIMP MachineDebugger::COMGETTER(LogDbgFlags)(BSTR *a_pbstrSettings) 545 { 546 CheckComArgOutPointerValid(a_pbstrSettings); 547 548 AutoCaller autoCaller(this); 549 HRESULT hrc = autoCaller.rc(); 550 if (SUCCEEDED(hrc)) 551 hrc = logStringProps(RTLogGetDefaultInstance(), RTLogGetFlags, "RTGetFlags", a_pbstrSettings); 552 553 return hrc; 554 } 555 556 STDMETHODIMP MachineDebugger::COMGETTER(LogDbgGroups)(BSTR *a_pbstrSettings) 557 { 558 CheckComArgOutPointerValid(a_pbstrSettings); 559 560 AutoCaller autoCaller(this); 561 HRESULT hrc = autoCaller.rc(); 562 if (SUCCEEDED(hrc)) 563 hrc = logStringProps(RTLogGetDefaultInstance(), RTLogGetGroupSettings, "RTLogGetGroupSettings", a_pbstrSettings); 564 565 return hrc; 566 } 567 568 STDMETHODIMP MachineDebugger::COMGETTER(LogDbgDestinations)(BSTR *a_pbstrSettings) 569 { 570 CheckComArgOutPointerValid(a_pbstrSettings); 571 572 AutoCaller autoCaller(this); 573 HRESULT hrc = autoCaller.rc(); 574 if (SUCCEEDED(hrc)) 575 hrc = logStringProps(RTLogGetDefaultInstance(), RTLogGetDestinations, "RTLogGetDestinations", a_pbstrSettings); 576 577 return hrc; 578 } 579 580 581 STDMETHODIMP MachineDebugger::COMGETTER(LogRelFlags)(BSTR *a_pbstrSettings) 582 { 583 CheckComArgOutPointerValid(a_pbstrSettings); 584 585 AutoCaller autoCaller(this); 586 HRESULT hrc = autoCaller.rc(); 587 if (SUCCEEDED(hrc)) 588 hrc = logStringProps(RTLogRelDefaultInstance(), RTLogGetFlags, "RTGetFlags", a_pbstrSettings); 589 590 return hrc; 591 } 592 593 STDMETHODIMP MachineDebugger::COMGETTER(LogRelGroups)(BSTR *a_pbstrSettings) 594 { 595 CheckComArgOutPointerValid(a_pbstrSettings); 596 597 AutoCaller autoCaller(this); 598 HRESULT hrc = autoCaller.rc(); 599 if (SUCCEEDED(hrc)) 600 hrc = logStringProps(RTLogRelDefaultInstance(), RTLogGetGroupSettings, "RTLogGetGroupSettings", a_pbstrSettings); 601 602 return hrc; 603 } 604 605 STDMETHODIMP MachineDebugger::COMGETTER(LogRelDestinations)(BSTR *a_pbstrSettings) 606 { 607 CheckComArgOutPointerValid(a_pbstrSettings); 608 609 AutoCaller autoCaller(this); 610 HRESULT hrc = autoCaller.rc(); 611 if (SUCCEEDED(hrc)) 612 hrc = logStringProps(RTLogRelDefaultInstance(), RTLogGetDestinations, "RTLogGetDestinations", a_pbstrSettings); 509 HRESULT MachineDebugger::getLogDbgFlags(com::Utf8Str &aLogDbgFlags) 510 { 511 HRESULT hrc = i_logStringProps(RTLogGetDefaultInstance(), RTLogGetFlags, "RTGetFlags", aLogDbgFlags); 512 513 return hrc; 514 } 515 516 HRESULT MachineDebugger::getLogDbgGroups(com::Utf8Str &aLogDbgGroups) 517 { 518 HRESULT hrc = i_logStringProps(RTLogGetDefaultInstance(), RTLogGetGroupSettings, "RTLogGetGroupSettings", aLogDbgGroups); 519 520 return hrc; 521 } 522 523 HRESULT MachineDebugger::getLogDbgDestinations(com::Utf8Str &aLogDbgDestinations) 524 { 525 HRESULT hrc = i_logStringProps(RTLogGetDefaultInstance(), RTLogGetDestinations, "RTLogGetDestinations", aLogDbgDestinations); 526 return hrc; 527 } 528 529 HRESULT MachineDebugger::getLogRelFlags(com::Utf8Str &aLogRelFlags) 530 { 531 HRESULT hrc = i_logStringProps(RTLogRelDefaultInstance(), RTLogGetFlags, "RTGetFlags", aLogRelFlags); 532 533 return hrc; 534 } 535 536 HRESULT MachineDebugger::getLogRelGroups(com::Utf8Str &aLogRelGroups) 537 { 538 HRESULT hrc = i_logStringProps(RTLogRelDefaultInstance(), RTLogGetGroupSettings, "RTLogGetGroupSettings", aLogRelGroups); 539 540 return hrc; 541 } 542 543 HRESULT MachineDebugger::getLogRelDestinations(com::Utf8Str &aLogRelDestinations) 544 { 545 HRESULT hrc = i_logStringProps(RTLogRelDefaultInstance(), RTLogGetDestinations, "RTLogGetDestinations", aLogRelDestinations); 613 546 614 547 return hrc; … … 621 554 * @param aEnabled address of result variable 622 555 */ 623 STDMETHODIMP MachineDebugger::COMGETTER(HWVirtExEnabled) (BOOL *aEnabled) 624 { 625 CheckComArgOutPointerValid(aEnabled); 626 627 AutoCaller autoCaller(this); 628 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 629 556 HRESULT MachineDebugger::getHWVirtExEnabled(BOOL *aHWVirtExEnabled) 557 { 630 558 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 631 559 … … 633 561 634 562 if (ptrVM.isOk()) 635 *a Enabled = HMR3IsEnabled(ptrVM.rawUVM());563 *aHWVirtExEnabled = HMR3IsEnabled(ptrVM.rawUVM()); 636 564 else 637 *a Enabled = false;565 *aHWVirtExEnabled = false; 638 566 639 567 return S_OK; … … 646 574 * @param aEnabled address of result variable 647 575 */ 648 STDMETHODIMP MachineDebugger::COMGETTER(HWVirtExNestedPagingEnabled)(BOOL *aEnabled) 649 { 650 CheckComArgOutPointerValid(aEnabled); 651 652 AutoCaller autoCaller(this); 653 if (FAILED(autoCaller.rc())) 654 return autoCaller.rc(); 655 576 HRESULT MachineDebugger::getHWVirtExNestedPagingEnabled(BOOL *aHWVirtExNestedPagingEnabled) 577 { 656 578 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 657 579 … … 659 581 660 582 if (ptrVM.isOk()) 661 *a Enabled = HMR3IsNestedPagingActive(ptrVM.rawUVM());583 *aHWVirtExNestedPagingEnabled = HMR3IsNestedPagingActive(ptrVM.rawUVM()); 662 584 else 663 *a Enabled = false;585 *aHWVirtExNestedPagingEnabled = false; 664 586 665 587 return S_OK; … … 672 594 * @param aEnabled address of result variable 673 595 */ 674 STDMETHODIMP MachineDebugger::COMGETTER(HWVirtExVPIDEnabled) (BOOL *aEnabled) 675 { 676 CheckComArgOutPointerValid(aEnabled); 677 678 AutoCaller autoCaller(this); 679 if (FAILED(autoCaller.rc())) 680 return autoCaller.rc(); 681 596 HRESULT MachineDebugger::getHWVirtExVPIDEnabled(BOOL *aHWVirtExVPIDEnabled) 597 { 682 598 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 683 599 … … 685 601 686 602 if (ptrVM.isOk()) 687 *a Enabled = HMR3IsVpidActive(ptrVM.rawUVM());603 *aHWVirtExVPIDEnabled = HMR3IsVpidActive(ptrVM.rawUVM()); 688 604 else 689 *a Enabled = false;605 *aHWVirtExVPIDEnabled = false; 690 606 691 607 return S_OK; … … 698 614 * @param aEnabled address of result variable 699 615 */ 700 STDMETHODIMP MachineDebugger::COMGETTER(HWVirtExUXEnabled) (BOOL *aEnabled) 701 { 702 CheckComArgOutPointerValid(aEnabled); 703 704 AutoCaller autoCaller(this); 705 if (FAILED(autoCaller.rc())) 706 return autoCaller.rc(); 707 616 HRESULT MachineDebugger::getHWVirtExUXEnabled(BOOL *aHWVirtExUXEnabled) 617 { 708 618 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 709 619 … … 711 621 712 622 if (ptrVM.isOk()) 713 *a Enabled = HMR3IsUXActive(ptrVM.rawUVM());623 *aHWVirtExUXEnabled = HMR3IsUXActive(ptrVM.rawUVM()); 714 624 else 715 *a Enabled = false;716 717 return S_OK; 718 } 719 720 STDMETHODIMP MachineDebugger::COMGETTER(OSName)(BSTR *a_pbstrName)625 *aHWVirtExUXEnabled = false; 626 627 return S_OK; 628 } 629 630 HRESULT MachineDebugger::getOSName(com::Utf8Str &aOSName) 721 631 { 722 632 LogFlowThisFunc(("\n")); 723 CheckComArgNotNull(a_pbstrName); 724 AutoCaller autoCaller(this); 725 HRESULT hrc = autoCaller.rc(); 726 if (SUCCEEDED(hrc)) 727 { 728 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 633 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 634 Console::SafeVMPtr ptrVM(mParent); 635 HRESULT hrc = ptrVM.rc(); 636 if (SUCCEEDED(hrc)) 637 { 638 /* 639 * Do the job and try convert the name. 640 */ 641 char szName[64]; 642 int vrc = DBGFR3OSQueryNameAndVersion(ptrVM.rawUVM(), szName, sizeof(szName), NULL, 0); 643 if (RT_SUCCESS(vrc)) 644 { 645 try 646 { 647 Bstr bstrName(szName); 648 aOSName = Utf8Str(bstrName); 649 } 650 catch (std::bad_alloc) 651 { 652 hrc = E_OUTOFMEMORY; 653 } 654 } 655 else 656 hrc = setError(VBOX_E_VM_ERROR, tr("DBGFR3OSQueryNameAndVersion failed with %Rrc"), vrc); 657 } 658 return hrc; 659 } 660 661 HRESULT MachineDebugger::getOSVersion(com::Utf8Str &aOSVersion) 662 { 663 LogFlowThisFunc(("\n")); 664 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 665 Console::SafeVMPtr ptrVM(mParent); 666 HRESULT hrc = ptrVM.rc(); 667 if (SUCCEEDED(hrc)) 668 { 669 /* 670 * Do the job and try convert the name. 671 */ 672 char szVersion[256]; 673 int vrc = DBGFR3OSQueryNameAndVersion(ptrVM.rawUVM(), NULL, 0, szVersion, sizeof(szVersion)); 674 if (RT_SUCCESS(vrc)) 675 { 676 try 677 { 678 Bstr bstrVersion(szVersion); 679 aOSVersion = Utf8Str(bstrVersion); 680 } 681 catch (std::bad_alloc) 682 { 683 hrc = E_OUTOFMEMORY; 684 } 685 } 686 else 687 hrc = setError(VBOX_E_VM_ERROR, tr("DBGFR3OSQueryNameAndVersion failed with %Rrc"), vrc); 688 } 689 return hrc; 690 } 691 692 /** 693 * Returns the current PAE flag. 694 * 695 * @returns COM status code 696 * @param aEnabled address of result variable 697 */ 698 HRESULT MachineDebugger::getPAEEnabled(BOOL *aPAEEnabled) 699 { 700 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 701 702 Console::SafeVMPtrQuiet ptrVM(mParent); 703 704 if (ptrVM.isOk()) 705 { 706 uint32_t cr4; 707 int rc = DBGFR3RegCpuQueryU32(ptrVM.rawUVM(), 0 /*idCpu*/, DBGFREG_CR4, &cr4); AssertRC(rc); 708 *aPAEEnabled = RT_BOOL(cr4 & X86_CR4_PAE); 709 } 710 else 711 *aPAEEnabled = false; 712 713 return S_OK; 714 } 715 716 /** 717 * Returns the current virtual time rate. 718 * 719 * @returns COM status code. 720 * @param a_puPct Where to store the rate. 721 */ 722 HRESULT MachineDebugger::getVirtualTimeRate(ULONG *aVirtualTimeRate) 723 { 724 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 725 726 Console::SafeVMPtr ptrVM(mParent); 727 HRESULT hrc = ptrVM.rc(); 728 if (SUCCEEDED(hrc)) 729 *aVirtualTimeRate = TMR3GetWarpDrive(ptrVM.rawUVM()); 730 731 return hrc; 732 } 733 734 /** 735 * Returns the current virtual time rate. 736 * 737 * @returns COM status code. 738 * @param aPct Where to store the rate. 739 */ 740 HRESULT MachineDebugger::setVirtualTimeRate(ULONG aVirtualTimeRate) 741 { 742 HRESULT hrc = S_OK; 743 744 if (aVirtualTimeRate < 2 || aVirtualTimeRate > 20000) 745 return setError(E_INVALIDARG, tr("%u is out of range [2..20000]"), aVirtualTimeRate); 746 747 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 748 if (i_queueSettings()) 749 mVirtualTimeRateQueued = aVirtualTimeRate; 750 else 751 { 729 752 Console::SafeVMPtr ptrVM(mParent); 730 753 hrc = ptrVM.rc(); 731 754 if (SUCCEEDED(hrc)) 732 755 { 733 /* 734 * Do the job and try convert the name. 735 */ 736 char szName[64]; 737 int vrc = DBGFR3OSQueryNameAndVersion(ptrVM.rawUVM(), szName, sizeof(szName), NULL, 0); 738 if (RT_SUCCESS(vrc)) 739 { 740 try 741 { 742 Bstr bstrName(szName); 743 bstrName.detachTo(a_pbstrName); 744 } 745 catch (std::bad_alloc) 746 { 747 hrc = E_OUTOFMEMORY; 748 } 749 } 750 else 751 hrc = setError(VBOX_E_VM_ERROR, tr("DBGFR3OSQueryNameAndVersion failed with %Rrc"), vrc); 752 } 753 } 754 return hrc; 755 } 756 757 STDMETHODIMP MachineDebugger::COMGETTER(OSVersion)(BSTR *a_pbstrVersion) 758 { 759 LogFlowThisFunc(("\n")); 760 CheckComArgNotNull(a_pbstrVersion); 761 AutoCaller autoCaller(this); 762 HRESULT hrc = autoCaller.rc(); 763 if (SUCCEEDED(hrc)) 764 { 765 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 766 Console::SafeVMPtr ptrVM(mParent); 767 hrc = ptrVM.rc(); 768 if (SUCCEEDED(hrc)) 769 { 770 /* 771 * Do the job and try convert the name. 772 */ 773 char szVersion[256]; 774 int vrc = DBGFR3OSQueryNameAndVersion(ptrVM.rawUVM(), NULL, 0, szVersion, sizeof(szVersion)); 775 if (RT_SUCCESS(vrc)) 776 { 777 try 778 { 779 Bstr bstrVersion(szVersion); 780 bstrVersion.detachTo(a_pbstrVersion); 781 } 782 catch (std::bad_alloc) 783 { 784 hrc = E_OUTOFMEMORY; 785 } 786 } 787 else 788 hrc = setError(VBOX_E_VM_ERROR, tr("DBGFR3OSQueryNameAndVersion failed with %Rrc"), vrc); 789 } 790 } 791 return hrc; 792 } 793 794 /** 795 * Returns the current PAE flag. 796 * 797 * @returns COM status code 798 * @param aEnabled address of result variable 799 */ 800 STDMETHODIMP MachineDebugger::COMGETTER(PAEEnabled) (BOOL *aEnabled) 801 { 802 CheckComArgOutPointerValid(aEnabled); 803 804 AutoCaller autoCaller(this); 805 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 806 807 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 808 809 Console::SafeVMPtrQuiet ptrVM(mParent); 810 811 if (ptrVM.isOk()) 812 { 813 uint32_t cr4; 814 int rc = DBGFR3RegCpuQueryU32(ptrVM.rawUVM(), 0 /*idCpu*/, DBGFREG_CR4, &cr4); AssertRC(rc); 815 *aEnabled = RT_BOOL(cr4 & X86_CR4_PAE); 816 } 817 else 818 *aEnabled = false; 819 820 return S_OK; 821 } 822 823 /** 824 * Returns the current virtual time rate. 825 * 826 * @returns COM status code. 827 * @param a_puPct Where to store the rate. 828 */ 829 STDMETHODIMP MachineDebugger::COMGETTER(VirtualTimeRate)(ULONG *a_puPct) 830 { 831 CheckComArgOutPointerValid(a_puPct); 832 833 AutoCaller autoCaller(this); 834 HRESULT hrc = autoCaller.rc(); 835 if (SUCCEEDED(hrc)) 836 { 837 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 838 839 Console::SafeVMPtr ptrVM(mParent); 840 hrc = ptrVM.rc(); 841 if (SUCCEEDED(hrc)) 842 *a_puPct = TMR3GetWarpDrive(ptrVM.rawUVM()); 843 } 844 845 return hrc; 846 } 847 848 /** 849 * Returns the current virtual time rate. 850 * 851 * @returns COM status code. 852 * @param aPct Where to store the rate. 853 */ 854 STDMETHODIMP MachineDebugger::COMSETTER(VirtualTimeRate)(ULONG a_uPct) 855 { 856 if (a_uPct < 2 || a_uPct > 20000) 857 return setError(E_INVALIDARG, tr("%u is out of range [2..20000]"), a_uPct); 858 859 AutoCaller autoCaller(this); 860 HRESULT hrc = autoCaller.rc(); 861 if (SUCCEEDED(hrc)) 862 { 863 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 864 if (queueSettings()) 865 mVirtualTimeRateQueued = a_uPct; 866 else 867 { 868 Console::SafeVMPtr ptrVM(mParent); 869 hrc = ptrVM.rc(); 870 if (SUCCEEDED(hrc)) 871 { 872 int vrc = TMR3SetWarpDrive(ptrVM.rawUVM(), a_uPct); 873 if (RT_FAILURE(vrc)) 874 hrc = setError(VBOX_E_VM_ERROR, tr("TMR3SetWarpDrive(, %u) failed with rc=%Rrc"), a_uPct, vrc); 875 } 756 int vrc = TMR3SetWarpDrive(ptrVM.rawUVM(), aVirtualTimeRate); 757 if (RT_FAILURE(vrc)) 758 hrc = setError(VBOX_E_VM_ERROR, tr("TMR3SetWarpDrive(, %u) failed with rc=%Rrc"), aVirtualTimeRate, vrc); 876 759 } 877 760 } … … 892 775 * @remarks Prior to 4.3 this returned PVM. 893 776 */ 894 STDMETHODIMP MachineDebugger::COMGETTER(VM)(LONG64 *a_i64Vm) 895 { 896 CheckComArgOutPointerValid(a_i64Vm); 897 898 AutoCaller autoCaller(this); 899 HRESULT hrc = autoCaller.rc(); 900 if (SUCCEEDED(hrc)) 901 { 902 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 903 904 Console::SafeVMPtr ptrVM(mParent); 905 hrc = ptrVM.rc(); 906 if (SUCCEEDED(hrc)) 907 { 908 VMR3RetainUVM(ptrVM.rawUVM()); 909 *a_i64Vm = (intptr_t)ptrVM.rawUVM(); 910 } 911 912 /* 913 * Note! ptrVM protection provided by SafeVMPtr is no long effective 914 * after we return from this method. 915 */ 916 } 917 777 HRESULT MachineDebugger::getVM(LONG64 *aVM) 778 { 779 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 780 781 Console::SafeVMPtr ptrVM(mParent); 782 HRESULT hrc = ptrVM.rc(); 783 if (SUCCEEDED(hrc)) 784 { 785 VMR3RetainUVM(ptrVM.rawUVM()); 786 *aVM = (intptr_t)ptrVM.rawUVM(); 787 } 788 789 /* 790 * Note! ptrVM protection provided by SafeVMPtr is no long effective 791 * after we return from this method. 792 */ 918 793 return hrc; 919 794 } … … 922 797 ///////////////////////////////////////////////////////////////////////////// 923 798 924 STDMETHODIMP MachineDebugger::DumpGuestCore(IN_BSTR a_bstrFilename, IN_BSTR a_bstrCompression) 925 { 926 CheckComArgStrNotEmptyOrNull(a_bstrFilename); 927 Utf8Str strFilename(a_bstrFilename); 928 if (a_bstrCompression && *a_bstrCompression) 799 HRESULT MachineDebugger::dumpGuestCore(const com::Utf8Str &aFilename, const com::Utf8Str &aCompression) 800 { 801 if (aCompression.length()) 929 802 return setError(E_INVALIDARG, tr("The compression parameter must be empty")); 930 803 931 AutoCaller autoCaller(this); 932 HRESULT hrc = autoCaller.rc(); 933 if (SUCCEEDED(hrc)) 934 { 935 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 936 Console::SafeVMPtr ptrVM(mParent); 937 hrc = ptrVM.rc(); 938 if (SUCCEEDED(hrc)) 939 { 940 int vrc = DBGFR3CoreWrite(ptrVM.rawUVM(), strFilename.c_str(), false /*fReplaceFile*/); 941 if (RT_SUCCESS(vrc)) 942 hrc = S_OK; 943 else 944 hrc = setError(E_FAIL, tr("DBGFR3CoreWrite failed with %Rrc"), vrc); 945 } 946 } 947 948 return hrc; 949 } 950 951 STDMETHODIMP MachineDebugger::DumpHostProcessCore(IN_BSTR a_bstrFilename, IN_BSTR a_bstrCompression) 804 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 805 Console::SafeVMPtr ptrVM(mParent); 806 HRESULT hrc = ptrVM.rc(); 807 if (SUCCEEDED(hrc)) 808 { 809 int vrc = DBGFR3CoreWrite(ptrVM.rawUVM(), aFilename.c_str(), false /*fReplaceFile*/); 810 if (RT_SUCCESS(vrc)) 811 hrc = S_OK; 812 else 813 hrc = setError(E_FAIL, tr("DBGFR3CoreWrite failed with %Rrc"), vrc); 814 } 815 816 return hrc; 817 } 818 819 HRESULT MachineDebugger::dumpHostProcessCore(const com::Utf8Str &aFilename, const com::Utf8Str &aCompression) 952 820 { 953 821 ReturnComNotImplemented(); … … 1062 930 } 1063 931 1064 STDMETHODIMP MachineDebugger::Info(IN_BSTR a_bstrName, IN_BSTR a_bstrArgs, BSTR *a_pbstrInfo)932 HRESULT MachineDebugger::info(const com::Utf8Str &aName, const com::Utf8Str &aArgs, com::Utf8Str &aInfo) 1065 933 { 1066 934 LogFlowThisFunc(("\n")); 1067 1068 /*1069 * Validate and convert input.1070 */1071 CheckComArgStrNotEmptyOrNull(a_bstrName);1072 Utf8Str strName, strArgs;1073 try1074 {1075 strName = a_bstrName;1076 strArgs = a_bstrArgs;1077 }1078 catch (std::bad_alloc)1079 {1080 return E_OUTOFMEMORY;1081 }1082 935 1083 936 /* … … 1098 951 MACHINEDEBUGGERINOFHLP Hlp; 1099 952 MachineDebuggerInfoInit(&Hlp); 1100 int vrc = DBGFR3Info(ptrVM.rawUVM(), strName.c_str(), strArgs.c_str(), &Hlp.Core);953 int vrc = DBGFR3Info(ptrVM.rawUVM(), aName.c_str(), aArgs.c_str(), &Hlp.Core); 1101 954 if (RT_SUCCESS(vrc)) 1102 955 { … … 1109 962 { 1110 963 Bstr bstrInfo(Hlp.pszBuf); 1111 bstrInfo.detachTo(a_pbstrInfo);964 aInfo = bstrInfo; 1112 965 } 1113 966 catch (std::bad_alloc) … … 1127 980 } 1128 981 1129 STDMETHODIMP MachineDebugger::InjectNMI()982 HRESULT MachineDebugger::injectNMI() 1130 983 { 1131 984 LogFlowThisFunc(("\n")); 1132 985 1133 AutoCaller autoCaller(this); 1134 HRESULT hrc = autoCaller.rc(); 1135 if (SUCCEEDED(hrc)) 1136 { 1137 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 1138 Console::SafeVMPtr ptrVM(mParent); 1139 hrc = ptrVM.rc(); 1140 if (SUCCEEDED(hrc)) 1141 { 1142 int vrc = DBGFR3InjectNMI(ptrVM.rawUVM(), 0); 1143 if (RT_SUCCESS(vrc)) 1144 hrc = S_OK; 1145 else 1146 hrc = setError(E_FAIL, tr("DBGFR3InjectNMI failed with %Rrc"), vrc); 1147 } 1148 } 1149 return hrc; 1150 } 1151 1152 STDMETHODIMP MachineDebugger::ModifyLogFlags(IN_BSTR a_bstrSettings) 1153 { 1154 CheckComArgStrNotEmptyOrNull(a_bstrSettings); 1155 Utf8Str strSettings(a_bstrSettings); 1156 1157 LogFlowThisFunc(("a_bstrSettings=%s\n", strSettings.c_str())); 1158 AutoCaller autoCaller(this); 1159 HRESULT hrc = autoCaller.rc(); 1160 if (SUCCEEDED(hrc)) 1161 { 1162 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 1163 Console::SafeVMPtr ptrVM(mParent); 1164 hrc = ptrVM.rc(); 1165 if (SUCCEEDED(hrc)) 1166 { 1167 int vrc = DBGFR3LogModifyFlags(ptrVM.rawUVM(), strSettings.c_str()); 1168 if (RT_SUCCESS(vrc)) 1169 hrc = S_OK; 1170 else 1171 hrc = setError(E_FAIL, tr("DBGFR3LogModifyFlags failed with %Rrc"), vrc); 1172 } 1173 } 1174 return hrc; 1175 } 1176 1177 STDMETHODIMP MachineDebugger::ModifyLogGroups(IN_BSTR a_bstrSettings) 1178 { 1179 CheckComArgStrNotEmptyOrNull(a_bstrSettings); 1180 Utf8Str strSettings(a_bstrSettings); 1181 1182 LogFlowThisFunc(("a_bstrSettings=%s\n", strSettings.c_str())); 1183 AutoCaller autoCaller(this); 1184 HRESULT hrc = autoCaller.rc(); 1185 if (SUCCEEDED(hrc)) 1186 { 1187 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 1188 Console::SafeVMPtr ptrVM(mParent); 1189 hrc = ptrVM.rc(); 1190 if (SUCCEEDED(hrc)) 1191 { 1192 int vrc = DBGFR3LogModifyGroups(ptrVM.rawUVM(), strSettings.c_str()); 1193 if (RT_SUCCESS(vrc)) 1194 hrc = S_OK; 1195 else 1196 hrc = setError(E_FAIL, tr("DBGFR3LogModifyGroups failed with %Rrc"), vrc); 1197 } 1198 } 1199 return hrc; 1200 } 1201 1202 STDMETHODIMP MachineDebugger::ModifyLogDestinations(IN_BSTR a_bstrSettings) 1203 { 1204 CheckComArgStrNotEmptyOrNull(a_bstrSettings); 1205 Utf8Str strSettings(a_bstrSettings); 1206 1207 LogFlowThisFunc(("a_bstrSettings=%s\n", strSettings.c_str())); 1208 AutoCaller autoCaller(this); 1209 HRESULT hrc = autoCaller.rc(); 1210 if (SUCCEEDED(hrc)) 1211 { 1212 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 1213 Console::SafeVMPtr ptrVM(mParent); 1214 hrc = ptrVM.rc(); 1215 if (SUCCEEDED(hrc)) 1216 { 1217 int vrc = DBGFR3LogModifyDestinations(ptrVM.rawUVM(), strSettings.c_str()); 1218 if (RT_SUCCESS(vrc)) 1219 hrc = S_OK; 1220 else 1221 hrc = setError(E_FAIL, tr("DBGFR3LogModifyDestinations failed with %Rrc"), vrc); 1222 } 1223 } 1224 return hrc; 1225 } 1226 1227 STDMETHODIMP MachineDebugger::ReadPhysicalMemory(LONG64 a_Address, ULONG a_cbRead, ComSafeArrayOut(BYTE, a_abData)) 986 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 987 Console::SafeVMPtr ptrVM(mParent); 988 HRESULT hrc = ptrVM.rc(); 989 if (SUCCEEDED(hrc)) 990 { 991 int vrc = DBGFR3InjectNMI(ptrVM.rawUVM(), 0); 992 if (RT_SUCCESS(vrc)) 993 hrc = S_OK; 994 else 995 hrc = setError(E_FAIL, tr("DBGFR3InjectNMI failed with %Rrc"), vrc); 996 } 997 return hrc; 998 } 999 1000 HRESULT MachineDebugger::modifyLogFlags(const com::Utf8Str &aSettings) 1001 { 1002 LogFlowThisFunc(("aSettings=%s\n", aSettings.c_str())); 1003 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 1004 Console::SafeVMPtr ptrVM(mParent); 1005 HRESULT hrc = ptrVM.rc(); 1006 if (SUCCEEDED(hrc)) 1007 { 1008 int vrc = DBGFR3LogModifyFlags(ptrVM.rawUVM(), aSettings.c_str()); 1009 if (RT_SUCCESS(vrc)) 1010 hrc = S_OK; 1011 else 1012 hrc = setError(E_FAIL, tr("DBGFR3LogModifyFlags failed with %Rrc"), vrc); 1013 } 1014 return hrc; 1015 } 1016 1017 HRESULT MachineDebugger::modifyLogGroups(const com::Utf8Str &aSettings) 1018 { 1019 LogFlowThisFunc(("aSettings=%s\n", aSettings.c_str())); 1020 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 1021 Console::SafeVMPtr ptrVM(mParent); 1022 HRESULT hrc = ptrVM.rc(); 1023 if (SUCCEEDED(hrc)) 1024 { 1025 int vrc = DBGFR3LogModifyGroups(ptrVM.rawUVM(), aSettings.c_str()); 1026 if (RT_SUCCESS(vrc)) 1027 hrc = S_OK; 1028 else 1029 hrc = setError(E_FAIL, tr("DBGFR3LogModifyGroups failed with %Rrc"), vrc); 1030 } 1031 return hrc; 1032 } 1033 1034 HRESULT MachineDebugger::modifyLogDestinations(const com::Utf8Str &aSettings) 1035 { 1036 LogFlowThisFunc(("aSettings=%s\n", aSettings.c_str())); 1037 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 1038 Console::SafeVMPtr ptrVM(mParent); 1039 HRESULT hrc = ptrVM.rc(); 1040 if (SUCCEEDED(hrc)) 1041 { 1042 int vrc = DBGFR3LogModifyDestinations(ptrVM.rawUVM(), aSettings.c_str()); 1043 if (RT_SUCCESS(vrc)) 1044 hrc = S_OK; 1045 else 1046 hrc = setError(E_FAIL, tr("DBGFR3LogModifyDestinations failed with %Rrc"), vrc); 1047 } 1048 return hrc; 1049 } 1050 1051 HRESULT MachineDebugger::readPhysicalMemory(LONG64 aAddress, ULONG aSize, std::vector<BYTE> &aBytes) 1228 1052 { 1229 1053 ReturnComNotImplemented(); 1230 1054 } 1231 1055 1232 STDMETHODIMP MachineDebugger::WritePhysicalMemory(LONG64 a_Address, ULONG a_cbRead, ComSafeArrayIn(BYTE, a_abData))1056 HRESULT MachineDebugger::writePhysicalMemory(LONG64 aAddress, ULONG aSize, const std::vector<BYTE> &aBytes) 1233 1057 { 1234 1058 ReturnComNotImplemented(); 1235 1059 } 1236 1060 1237 STDMETHODIMP MachineDebugger::ReadVirtualMemory(ULONG a_idCpu, LONG64 a_Address, ULONG a_cbRead, ComSafeArrayOut(BYTE, a_abData))1061 HRESULT MachineDebugger::readVirtualMemory(ULONG aCpuId, LONG64 aAddress, ULONG aSize, std::vector<BYTE> &aBytes) 1238 1062 { 1239 1063 ReturnComNotImplemented(); 1240 1064 } 1241 1065 1242 STDMETHODIMP MachineDebugger::WriteVirtualMemory(ULONG a_idCpu, LONG64 a_Address, ULONG a_cbRead, ComSafeArrayIn(BYTE, a_abData))1066 HRESULT MachineDebugger::writeVirtualMemory(ULONG aCpuId, LONG64 aAddress, ULONG aSize, const std::vector<BYTE> &aBytes) 1243 1067 { 1244 1068 ReturnComNotImplemented(); 1245 1069 } 1246 1070 1247 STDMETHODIMP MachineDebugger::DetectOS(BSTR *a_pbstrName)1071 HRESULT MachineDebugger::detectOS(com::Utf8Str &aOs) 1248 1072 { 1249 1073 LogFlowThisFunc(("\n")); 1250 CheckComArgNotNull(a_pbstrName);1251 1074 1252 1075 /* 1253 1076 * Do the autocaller and lock bits. 1254 1077 */ 1255 AutoCaller autoCaller(this); 1256 HRESULT hrc = autoCaller.rc(); 1257 if (SUCCEEDED(hrc)) 1258 { 1259 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 1260 Console::SafeVMPtr ptrVM(mParent); 1261 hrc = ptrVM.rc(); 1262 if (SUCCEEDED(hrc)) 1078 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 1079 Console::SafeVMPtr ptrVM(mParent); 1080 HRESULT hrc = ptrVM.rc(); 1081 if (SUCCEEDED(hrc)) 1082 { 1083 /* 1084 * Do the job and try convert the name. 1085 */ 1086 /** @todo automatically load the DBGC plugins or this is a waste of time. */ 1087 char szName[64]; 1088 int vrc = DBGFR3OSDetect(ptrVM.rawUVM(), szName, sizeof(szName)); 1089 if (RT_SUCCESS(vrc) && vrc != VINF_DBGF_OS_NOT_DETCTED) 1263 1090 { 1264 /* 1265 * Do the job and try convert the name. 1266 */ 1267 /** @todo automatically load the DBGC plugins or this is a waste of time. */ 1268 char szName[64]; 1269 int vrc = DBGFR3OSDetect(ptrVM.rawUVM(), szName, sizeof(szName)); 1270 if (RT_SUCCESS(vrc) && vrc != VINF_DBGF_OS_NOT_DETCTED) 1091 try 1271 1092 { 1272 try 1273 { 1274 Bstr bstrName(szName); 1275 bstrName.detachTo(a_pbstrName); 1276 } 1277 catch (std::bad_alloc) 1278 { 1279 hrc = E_OUTOFMEMORY; 1280 } 1093 Bstr bstrName(szName); 1094 aOs = Utf8Str(bstrName); 1281 1095 } 1282 else 1283 hrc = setError(VBOX_E_VM_ERROR, tr("DBGFR3OSDetect failed with %Rrc"), vrc); 1096 catch (std::bad_alloc) 1097 { 1098 hrc = E_OUTOFMEMORY; 1099 } 1284 1100 } 1101 else 1102 hrc = setError(VBOX_E_VM_ERROR, tr("DBGFR3OSDetect failed with %Rrc"), vrc); 1285 1103 } 1286 1104 return hrc; … … 1307 1125 } 1308 1126 1309 STDMETHODIMP MachineDebugger::GetRegister(ULONG a_idCpu, IN_BSTR a_bstrName, BSTR *a_pbstrValue) 1310 { 1311 /* 1312 * Validate and convert input. 1313 */ 1314 CheckComArgStrNotEmptyOrNull(a_bstrName); 1315 CheckComArgNotNull(a_pbstrValue); 1316 Utf8Str strName; 1317 try 1318 { 1319 strName = a_bstrName; 1320 } 1321 catch (std::bad_alloc) 1322 { 1323 return E_OUTOFMEMORY; 1324 } 1325 1127 HRESULT MachineDebugger::getRegister(ULONG aCpuId, const com::Utf8Str &aName, com::Utf8Str &aValue) 1128 { 1326 1129 /* 1327 1130 * The prologue. 1328 1131 */ 1329 1132 LogFlowThisFunc(("\n")); 1330 AutoCaller autoCaller(this); 1331 HRESULT hrc = autoCaller.rc(); 1332 if (SUCCEEDED(hrc)) 1333 { 1334 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 1335 Console::SafeVMPtr ptrVM(mParent); 1336 hrc = ptrVM.rc(); 1337 if (SUCCEEDED(hrc)) 1133 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 1134 Console::SafeVMPtr ptrVM(mParent); 1135 HRESULT hrc = ptrVM.rc(); 1136 if (SUCCEEDED(hrc)) 1137 { 1138 /* 1139 * Real work. 1140 */ 1141 DBGFREGVAL Value; 1142 DBGFREGVALTYPE enmType; 1143 int vrc = DBGFR3RegNmQuery(ptrVM.rawUVM(), aCpuId, aName.c_str(), &Value, &enmType); 1144 if (RT_SUCCESS(vrc)) 1338 1145 { 1339 /* 1340 * Real work. 1341 */ 1342 DBGFREGVAL Value; 1343 DBGFREGVALTYPE enmType; 1344 int vrc = DBGFR3RegNmQuery(ptrVM.rawUVM(), a_idCpu, strName.c_str(), &Value, &enmType); 1345 if (RT_SUCCESS(vrc)) 1146 try 1346 1147 { 1347 try 1348 { 1349 Bstr bstrValue; 1350 hrc = formatRegisterValue(&bstrValue, &Value, enmType); 1351 if (SUCCEEDED(hrc)) 1352 bstrValue.detachTo(a_pbstrValue); 1353 } 1354 catch (std::bad_alloc) 1355 { 1356 hrc = E_OUTOFMEMORY; 1357 } 1148 Bstr bstrValue; 1149 hrc = formatRegisterValue(&bstrValue, &Value, enmType); 1150 if (SUCCEEDED(hrc)) 1151 aValue = Utf8Str(bstrValue); 1358 1152 } 1359 else if (vrc == VERR_DBGF_REGISTER_NOT_FOUND) 1360 hrc = setError(E_FAIL, tr("Register '%s' was not found"), strName.c_str()); 1361 else if (vrc == VERR_INVALID_CPU_ID) 1362 hrc = setError(E_FAIL, tr("Invalid CPU ID: %u"), a_idCpu); 1363 else 1364 hrc = setError(VBOX_E_VM_ERROR, 1365 tr("DBGFR3RegNmQuery failed with rc=%Rrc querying register '%s' with default cpu set to %u"), 1366 vrc, strName.c_str(), a_idCpu); 1153 catch (std::bad_alloc) 1154 { 1155 hrc = E_OUTOFMEMORY; 1156 } 1367 1157 } 1368 } 1369 1370 return hrc; 1371 } 1372 1373 STDMETHODIMP MachineDebugger::GetRegisters(ULONG a_idCpu, ComSafeArrayOut(BSTR, a_bstrNames), ComSafeArrayOut(BSTR, a_bstrValues)) 1158 else if (vrc == VERR_DBGF_REGISTER_NOT_FOUND) 1159 hrc = setError(E_FAIL, tr("Register '%s' was not found"), aName.c_str()); 1160 else if (vrc == VERR_INVALID_CPU_ID) 1161 hrc = setError(E_FAIL, tr("Invalid CPU ID: %u"), aCpuId); 1162 else 1163 hrc = setError(VBOX_E_VM_ERROR, 1164 tr("DBGFR3RegNmQuery failed with rc=%Rrc querying register '%s' with default cpu set to %u"), 1165 vrc, aName.c_str(), aCpuId); 1166 } 1167 1168 return hrc; 1169 } 1170 1171 HRESULT MachineDebugger::getRegisters(ULONG aCpuId, std::vector<com::Utf8Str> &aNames, std::vector<com::Utf8Str> &aValues) 1374 1172 { 1375 1173 /* … … 1377 1175 */ 1378 1176 LogFlowThisFunc(("\n")); 1379 AutoCaller autoCaller(this); 1380 HRESULT hrc = autoCaller.rc(); 1381 if (SUCCEEDED(hrc)) 1382 { 1383 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 1384 Console::SafeVMPtr ptrVM(mParent); 1385 hrc = ptrVM.rc(); 1386 if (SUCCEEDED(hrc)) 1177 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 1178 Console::SafeVMPtr ptrVM(mParent); 1179 HRESULT hrc = ptrVM.rc(); 1180 if (SUCCEEDED(hrc)) 1181 { 1182 /* 1183 * Real work. 1184 */ 1185 size_t cRegs; 1186 int vrc = DBGFR3RegNmQueryAllCount(ptrVM.rawUVM(), &cRegs); 1187 if (RT_SUCCESS(vrc)) 1387 1188 { 1388 /* 1389 * Real work. 1390 */ 1391 size_t cRegs; 1392 int vrc = DBGFR3RegNmQueryAllCount(ptrVM.rawUVM(), &cRegs); 1393 if (RT_SUCCESS(vrc)) 1189 PDBGFREGENTRYNM paRegs = (PDBGFREGENTRYNM)RTMemAllocZ(sizeof(paRegs[0]) * cRegs); 1190 if (paRegs) 1394 1191 { 1395 PDBGFREGENTRYNM paRegs = (PDBGFREGENTRYNM)RTMemAllocZ(sizeof(paRegs[0]) *cRegs);1396 if ( paRegs)1192 vrc = DBGFR3RegNmQueryAll(ptrVM.rawUVM(), paRegs, cRegs); 1193 if (RT_SUCCESS(vrc)) 1397 1194 { 1398 vrc = DBGFR3RegNmQueryAll(ptrVM.rawUVM(), paRegs, cRegs); 1399 if (RT_SUCCESS(vrc)) 1195 try 1400 1196 { 1401 try 1197 1198 for (uint32_t iReg = 0; iReg < cRegs; iReg++) 1402 1199 { 1403 com::SafeArray<BSTR> abstrNames(cRegs); 1404 com::SafeArray<BSTR> abstrValues(cRegs); 1405 1406 for (uint32_t iReg = 0; iReg < cRegs; iReg++) 1407 { 1408 Bstr bstrValue; 1409 1410 hrc = formatRegisterValue(&bstrValue, &paRegs[iReg].Val, paRegs[iReg].enmType); 1411 AssertComRC(hrc); 1412 bstrValue.detachTo(&abstrValues[iReg]); 1413 1414 Bstr bstrName(paRegs[iReg].pszName); 1415 bstrName.detachTo(&abstrNames[iReg]); 1416 } 1417 1418 abstrNames.detachTo(ComSafeArrayOutArg(a_bstrNames)); 1419 abstrValues.detachTo(ComSafeArrayOutArg(a_bstrValues)); 1420 } 1421 catch (std::bad_alloc) 1422 { 1423 hrc = E_OUTOFMEMORY; 1200 Bstr bstrValue; 1201 1202 hrc = formatRegisterValue(&bstrValue, &paRegs[iReg].Val, paRegs[iReg].enmType); 1203 AssertComRC(hrc); 1204 aNames[iReg] = Utf8Str(paRegs[iReg].pszName); 1205 aValues[iReg] = Utf8Str(bstrValue); 1424 1206 } 1425 1207 } 1426 else1427 hrc = setError(E_FAIL, tr("DBGFR3RegNmQueryAll failed with %Rrc"), vrc);1428 1429 RTMemFree(paRegs);1208 catch (std::bad_alloc) 1209 { 1210 hrc = E_OUTOFMEMORY; 1211 } 1430 1212 } 1431 1213 else 1432 hrc = E_OUTOFMEMORY; 1214 hrc = setError(E_FAIL, tr("DBGFR3RegNmQueryAll failed with %Rrc"), vrc); 1215 1216 RTMemFree(paRegs); 1433 1217 } 1434 1218 else 1435 hrc = setError(E_FAIL, tr("DBGFR3RegNmQueryAllCount failed with %Rrc"), vrc);1219 hrc = E_OUTOFMEMORY; 1436 1220 } 1437 } 1438 return hrc; 1439 } 1440 1441 STDMETHODIMP MachineDebugger::SetRegister(ULONG a_idCpu, IN_BSTR a_bstrName, IN_BSTR a_bstrValue) 1221 else 1222 hrc = setError(E_FAIL, tr("DBGFR3RegNmQueryAllCount failed with %Rrc"), vrc); 1223 } 1224 return hrc; 1225 } 1226 1227 HRESULT MachineDebugger::setRegister(ULONG aCpuId, const com::Utf8Str &aName, const com::Utf8Str &aValue) 1442 1228 { 1443 1229 ReturnComNotImplemented(); 1444 1230 } 1445 1231 1446 STDMETHODIMP MachineDebugger::SetRegisters(ULONG a_idCpu, ComSafeArrayIn(IN_BSTR, a_bstrNames), ComSafeArrayIn(IN_BSTR, a_bstrValues)) 1232 HRESULT MachineDebugger::setRegisters(ULONG aCpuId, const std::vector<com::Utf8Str> &aNames, 1233 const std::vector<com::Utf8Str> &aValues) 1447 1234 { 1448 1235 ReturnComNotImplemented(); 1449 1236 } 1450 1237 1451 STDMETHODIMP MachineDebugger::DumpGuestStack(ULONG a_idCpu, BSTR *a_pbstrStack)1238 HRESULT MachineDebugger::dumpGuestStack(ULONG aCpuId, com::Utf8Str &aStack) 1452 1239 { 1453 1240 ReturnComNotImplemented(); … … 1460 1247 * @param aPattern The selection pattern. A bit similar to filename globbing. 1461 1248 */ 1462 STDMETHODIMP MachineDebugger::ResetStats(IN_BSTRaPattern)1249 HRESULT MachineDebugger::resetStats(const com::Utf8Str &aPattern) 1463 1250 { 1464 1251 Console::SafeVMPtrQuiet ptrVM(mParent); … … 1467 1254 return setError(VBOX_E_INVALID_VM_STATE, "Machine is not running"); 1468 1255 1469 STAMR3Reset(ptrVM.rawUVM(), Utf8Str(aPattern).c_str());1256 STAMR3Reset(ptrVM.rawUVM(), aPattern.c_str()); 1470 1257 1471 1258 return S_OK; … … 1478 1265 * @param aPattern The selection pattern. A bit similar to filename globbing. 1479 1266 */ 1480 STDMETHODIMP MachineDebugger::DumpStats(IN_BSTRaPattern)1267 HRESULT MachineDebugger::dumpStats(const com::Utf8Str &aPattern) 1481 1268 { 1482 1269 Console::SafeVMPtrQuiet ptrVM(mParent); … … 1485 1272 return setError(VBOX_E_INVALID_VM_STATE, "Machine is not running"); 1486 1273 1487 STAMR3Dump(ptrVM.rawUVM(), Utf8Str(aPattern).c_str());1274 STAMR3Dump(ptrVM.rawUVM(), aPattern.c_str()); 1488 1275 1489 1276 return S_OK; … … 1498 1285 * @param aStats The XML document containing the statistics. 1499 1286 */ 1500 STDMETHODIMP MachineDebugger::GetStats (IN_BSTR aPattern, BOOL aWithDescriptions, BSTR *aStats)1287 HRESULT MachineDebugger::getStats(const com::Utf8Str &aPattern, BOOL aWithDescriptions, com::Utf8Str &aStats) 1501 1288 { 1502 1289 Console::SafeVMPtrQuiet ptrVM (mParent); … … 1506 1293 1507 1294 char *pszSnapshot; 1508 int vrc = STAMR3Snapshot(ptrVM.rawUVM(), Utf8Str(aPattern).c_str(), &pszSnapshot, NULL,1295 int vrc = STAMR3Snapshot(ptrVM.rawUVM(), aPattern.c_str(), &pszSnapshot, NULL, 1509 1296 !!aWithDescriptions); 1510 1297 if (RT_FAILURE(vrc)) … … 1515 1302 * Until that's done, this method is kind of useless for debugger statistics GUI because 1516 1303 * of the amount statistics in a debug build. */ 1517 Bstr(pszSnapshot).detachTo(aStats);1304 aStats = Utf8Str(pszSnapshot); 1518 1305 STAMR3SnapshotFree(ptrVM.rawUVM(), pszSnapshot); 1519 1306 … … 1525 1312 ///////////////////////////////////////////////////////////////////////////// 1526 1313 1527 void MachineDebugger:: flushQueuedSettings()1314 void MachineDebugger::i_flushQueuedSettings() 1528 1315 { 1529 1316 mFlushMode = true; … … 1536 1323 if (maiQueuedEmExecPolicyParams[i] != UINT8_MAX) 1537 1324 { 1538 setEmExecPolicyProperty((EMEXECPOLICY)i, RT_BOOL(maiQueuedEmExecPolicyParams[i]));1325 i_setEmExecPolicyProperty((EMEXECPOLICY)i, RT_BOOL(maiQueuedEmExecPolicyParams[i])); 1539 1326 maiQueuedEmExecPolicyParams[i] = UINT8_MAX; 1540 1327 } … … 1565 1352 ///////////////////////////////////////////////////////////////////////////// 1566 1353 1567 bool MachineDebugger:: queueSettings() const1354 bool MachineDebugger::i_queueSettings() const 1568 1355 { 1569 1356 if (!mFlushMode) -
trunk/src/VBox/Main/src-client/RemoteUSBBackend.cpp
r50530 r51092 153 153 154 154 /* Called by VRDP server when the client responds to a request on USB channel. */ 155 DECLCALLBACK(int) USBClientResponseCallback 155 DECLCALLBACK(int) USBClientResponseCallback(void *pv, uint32_t u32ClientId, uint8_t code, const void *pvRet, uint32_t cbRet) 156 156 { 157 157 int rc = VINF_SUCCESS; … … 166 166 case VRDE_USB_REQ_DEVICE_LIST: 167 167 { 168 rc = pThis->saveDeviceList 168 rc = pThis->saveDeviceList(pvRet, cbRet); 169 169 } break; 170 170 171 171 case VRDE_USB_REQ_NEGOTIATE: 172 172 { 173 if (pvRet && cbRet >= sizeof 173 if (pvRet && cbRet >= sizeof(VRDEUSBREQNEGOTIATERET)) 174 174 { 175 175 VRDEUSBREQNEGOTIATERET *pret = (VRDEUSBREQNEGOTIATERET *)pvRet; 176 176 177 rc = pThis->negotiateResponse 177 rc = pThis->negotiateResponse(pret, cbRet); 178 178 } 179 179 else 180 180 { 181 181 Log(("USBClientResponseCallback: WARNING: not enough data in response: pv = %p, cb = %d, expected %d.\n", 182 pvRet, cbRet, sizeof 182 pvRet, cbRet, sizeof(VRDEUSBREQNEGOTIATERET))); 183 183 184 184 rc = VERR_INVALID_PARAMETER; … … 188 188 case VRDE_USB_REQ_REAP_URB: 189 189 { 190 rc = pThis->reapURB 190 rc = pThis->reapURB(pvRet, cbRet); 191 191 192 192 LogFlow(("USBClientResponseCallback: reap URB, rc = %Rrc.\n", rc)); … … 212 212 * Device specific responses with status codes. 213 213 */ 214 if (pvRet && cbRet >= sizeof 214 if (pvRet && cbRet >= sizeof(VRDEUSBREQRETHDR)) 215 215 { 216 216 VRDEUSBREQRETHDR *pret = (VRDEUSBREQRETHDR *)pvRet; … … 218 218 if (pret->status != VRDE_USB_STATUS_SUCCESS) 219 219 { 220 REMOTEUSBDEVICE *pDevice = pThis->deviceFromId 220 REMOTEUSBDEVICE *pDevice = pThis->deviceFromId(pret->id); 221 221 222 222 if (!pDevice) … … 235 235 { 236 236 Log(("USBClientResponseCallback: WARNING: not enough data in response: pv = %p, cb = %d, expected %d.\n", 237 pvRet, cbRet, sizeof 237 pvRet, cbRet, sizeof(VRDEUSBREQRETHDR))); 238 238 } 239 239 } break; … … 251 251 * Backend entry points. 252 252 */ 253 static DECLCALLBACK(int) iface_Open (PREMOTEUSBBACKEND pInstance, const char *pszAddress, size_t cbAddress, PREMOTEUSBDEVICE *ppDevice) 253 static DECLCALLBACK(int) iface_Open(PREMOTEUSBBACKEND pInstance, const char *pszAddress, 254 size_t cbAddress, PREMOTEUSBDEVICE *ppDevice) 254 255 { 255 256 int rc = VINF_SUCCESS; … … 257 258 RemoteUSBBackend *pThis = (RemoteUSBBackend *)pInstance; 258 259 259 REMOTEUSBDEVICE *pDevice = (REMOTEUSBDEVICE *)RTMemAllocZ (sizeof(REMOTEUSBDEVICE));260 REMOTEUSBDEVICE *pDevice = (REMOTEUSBDEVICE *)RTMemAllocZ(sizeof(REMOTEUSBDEVICE)); 260 261 261 262 if (!pDevice) … … 269 270 * and CCCCDDDD is hex client id. 270 271 */ 271 if (strncmp 272 if (strncmp(pszAddress, REMOTE_USB_BACKEND_PREFIX_S, REMOTE_USB_BACKEND_PREFIX_LEN) != 0) 272 273 { 273 274 AssertFailed(); … … 285 286 if (RT_SUCCESS(rc)) 286 287 { 287 pDevice->id = RTStrToUInt32 288 289 size_t l = strlen 290 291 if (l >= REMOTE_USB_BACKEND_PREFIX_LEN + strlen 288 pDevice->id = RTStrToUInt32(&pszAddress[REMOTE_USB_BACKEND_PREFIX_LEN]); 289 290 size_t l = strlen(pszAddress); 291 292 if (l >= REMOTE_USB_BACKEND_PREFIX_LEN + strlen("0x12345678&0x87654321")) 292 293 { 293 const char *p = &pszAddress[REMOTE_USB_BACKEND_PREFIX_LEN + strlen 294 const char *p = &pszAddress[REMOTE_USB_BACKEND_PREFIX_LEN + strlen("0x12345678")]; 294 295 if (*p == '&') 295 296 { 296 pDevice->u32ClientId = RTStrToUInt32 297 pDevice->u32ClientId = RTStrToUInt32(p + 1); 297 298 } 298 299 else 299 300 { 300 AssertFailed 301 AssertFailed(); 301 302 rc = VERR_INVALID_PARAMETER; 302 303 } … … 304 305 else 305 306 { 306 AssertFailed 307 AssertFailed(); 307 308 rc = VERR_INVALID_PARAMETER; 308 309 } … … 315 316 parm.id = pDevice->id; 316 317 317 pThis->VRDPServer()->SendUSBRequest (pDevice->u32ClientId, &parm, sizeof(parm));318 pThis->VRDPServer()->SendUSBRequest(pDevice->u32ClientId, &parm, sizeof(parm)); 318 319 } 319 320 } … … 325 326 *ppDevice = pDevice; 326 327 327 pThis->addDevice 328 pThis->addDevice(pDevice); 328 329 } 329 330 else 330 331 { 331 RTMemFree 332 RTMemFree(pDevice); 332 333 } 333 334 … … 335 336 } 336 337 337 static DECLCALLBACK(void) iface_Close 338 static DECLCALLBACK(void) iface_Close(PREMOTEUSBDEVICE pDevice) 338 339 { 339 340 RemoteUSBBackend *pThis = pDevice->pOwner; … … 344 345 parm.id = pDevice->id; 345 346 346 pThis->VRDPServer()->SendUSBRequest (pDevice->u32ClientId, &parm, sizeof(parm));347 348 pThis->removeDevice 349 350 if (RTCritSectIsInitialized 351 { 352 RTCritSectDelete 353 } 354 355 RTMemFree 347 pThis->VRDPServer()->SendUSBRequest(pDevice->u32ClientId, &parm, sizeof(parm)); 348 349 pThis->removeDevice(pDevice); 350 351 if (RTCritSectIsInitialized(&pDevice->critsect)) 352 { 353 RTCritSectDelete(&pDevice->critsect); 354 } 355 356 RTMemFree(pDevice); 356 357 357 358 return; 358 359 } 359 360 360 static DECLCALLBACK(int) iface_Reset 361 static DECLCALLBACK(int) iface_Reset(PREMOTEUSBDEVICE pDevice) 361 362 { 362 363 RemoteUSBBackend *pThis = pDevice->pOwner; … … 372 373 parm.id = pDevice->id; 373 374 374 pThis->VRDPServer()->SendUSBRequest (pDevice->u32ClientId, &parm, sizeof(parm));375 pThis->VRDPServer()->SendUSBRequest(pDevice->u32ClientId, &parm, sizeof(parm)); 375 376 376 377 return VINF_SUCCESS; 377 378 } 378 379 379 static DECLCALLBACK(int) iface_SetConfig 380 static DECLCALLBACK(int) iface_SetConfig(PREMOTEUSBDEVICE pDevice, uint8_t u8Cfg) 380 381 { 381 382 RemoteUSBBackend *pThis = pDevice->pOwner; … … 392 393 parm.configuration = u8Cfg; 393 394 394 pThis->VRDPServer()->SendUSBRequest (pDevice->u32ClientId, &parm, sizeof(parm));395 pThis->VRDPServer()->SendUSBRequest(pDevice->u32ClientId, &parm, sizeof(parm)); 395 396 396 397 return VINF_SUCCESS; 397 398 } 398 399 399 static DECLCALLBACK(int) iface_ClaimInterface 400 static DECLCALLBACK(int) iface_ClaimInterface(PREMOTEUSBDEVICE pDevice, uint8_t u8Ifnum) 400 401 { 401 402 RemoteUSBBackend *pThis = pDevice->pOwner; … … 412 413 parm.iface = u8Ifnum; 413 414 414 pThis->VRDPServer()->SendUSBRequest (pDevice->u32ClientId, &parm, sizeof(parm));415 pThis->VRDPServer()->SendUSBRequest(pDevice->u32ClientId, &parm, sizeof(parm)); 415 416 416 417 return VINF_SUCCESS; 417 418 } 418 419 419 static DECLCALLBACK(int) iface_ReleaseInterface 420 static DECLCALLBACK(int) iface_ReleaseInterface(PREMOTEUSBDEVICE pDevice, uint8_t u8Ifnum) 420 421 { 421 422 RemoteUSBBackend *pThis = pDevice->pOwner; … … 432 433 parm.iface = u8Ifnum; 433 434 434 pThis->VRDPServer()->SendUSBRequest (pDevice->u32ClientId, &parm, sizeof(parm));435 pThis->VRDPServer()->SendUSBRequest(pDevice->u32ClientId, &parm, sizeof(parm)); 435 436 436 437 return VINF_SUCCESS; 437 438 } 438 439 439 static DECLCALLBACK(int) iface_InterfaceSetting 440 static DECLCALLBACK(int) iface_InterfaceSetting(PREMOTEUSBDEVICE pDevice, uint8_t u8Ifnum, uint8_t u8Setting) 440 441 { 441 442 RemoteUSBBackend *pThis = pDevice->pOwner; … … 453 454 parm.setting = u8Setting; 454 455 455 pThis->VRDPServer()->SendUSBRequest (pDevice->u32ClientId, &parm, sizeof(parm));456 pThis->VRDPServer()->SendUSBRequest(pDevice->u32ClientId, &parm, sizeof(parm)); 456 457 457 458 return VINF_SUCCESS; 458 459 } 459 460 460 static DECLCALLBACK(int) iface_ClearHaltedEP 461 static DECLCALLBACK(int) iface_ClearHaltedEP(PREMOTEUSBDEVICE pDevice, uint8_t u8Ep) 461 462 { 462 463 RemoteUSBBackend *pThis = pDevice->pOwner; … … 473 474 parm.ep = u8Ep; 474 475 475 pThis->VRDPServer()->SendUSBRequest (pDevice->u32ClientId, &parm, sizeof(parm));476 pThis->VRDPServer()->SendUSBRequest(pDevice->u32ClientId, &parm, sizeof(parm)); 476 477 477 478 return VINF_SUCCESS; 478 479 } 479 480 480 static DECLCALLBACK(void) iface_CancelURB 481 static DECLCALLBACK(void) iface_CancelURB(PREMOTEUSBDEVICE pDevice, PREMOTEUSBQURB pRemoteURB) 481 482 { 482 483 RemoteUSBBackend *pThis = pDevice->pOwner; … … 488 489 parm.handle = pRemoteURB->u32Handle; 489 490 490 pThis->VRDPServer()->SendUSBRequest (pDevice->u32ClientId, &parm, sizeof(parm));491 492 requestDevice 491 pThis->VRDPServer()->SendUSBRequest(pDevice->u32ClientId, &parm, sizeof(parm)); 492 493 requestDevice(pDevice); 493 494 494 495 /* Remove this urb from the queue. It is safe because if … … 514 515 } 515 516 516 qurbFree 517 518 releaseDevice 517 qurbFree(pRemoteURB); 518 519 releaseDevice(pDevice); 519 520 520 521 return; 521 522 } 522 523 523 static DECLCALLBACK(int) iface_QueueURB (PREMOTEUSBDEVICE pDevice, uint8_t u8Type, uint8_t u8Ep, uint8_t u8Direction, uint32_t u32Len, void *pvData, void *pvURB, PREMOTEUSBQURB *ppRemoteURB) 524 static DECLCALLBACK(int) iface_QueueURB(PREMOTEUSBDEVICE pDevice, uint8_t u8Type, uint8_t u8Ep, uint8_t u8Direction, 525 uint32_t u32Len, void *pvData, void *pvURB, PREMOTEUSBQURB *ppRemoteURB) 524 526 { 525 527 int rc = VINF_SUCCESS; 526 528 527 529 #ifdef DEBUG_sunlover 528 LogFlow(("RemoteUSBBackend::iface_QueueURB: u8Type = %d, u8Ep = %d, u8Direction = %d, data\n%.*Rhxd\n", u8Type, u8Ep, u8Direction, u32Len, pvData)); 530 LogFlow(("RemoteUSBBackend::iface_QueueURB: u8Type = %d, u8Ep = %d, u8Direction = %d, data\n%.*Rhxd\n", 531 u8Type, u8Ep, u8Direction, u32Len, pvData)); 529 532 #endif /* DEBUG_sunlover */ 530 533 … … 540 543 uint32_t u32DataLen = 0; 541 544 542 REMOTEUSBQURB *qurb = qurbAlloc 545 REMOTEUSBQURB *qurb = qurbAlloc(pDevice); 543 546 544 547 if (qurb == NULL) … … 644 647 pDevice->pTailQURBs = qurb; 645 648 646 releaseDevice 649 releaseDevice(pDevice); 647 650 648 651 *ppRemoteURB = qurb; 649 652 650 pThis->VRDPServer()->SendUSBRequest (pDevice->u32ClientId, &parm, sizeof(parm));653 pThis->VRDPServer()->SendUSBRequest(pDevice->u32ClientId, &parm, sizeof(parm)); 651 654 652 655 l_leave: 653 656 if (RT_FAILURE(rc)) 654 657 { 655 qurbFree 658 qurbFree(qurb); 656 659 } 657 660 … … 662 665 * has requested URB polling, the function will send URB poll requests. 663 666 */ 664 static DECLCALLBACK(int) iface_ReapURB (PREMOTEUSBDEVICE pDevice, uint32_t u32Millies, void **ppvURB, uint32_t *pu32Len, uint32_t *pu32Err) 667 static DECLCALLBACK(int) iface_ReapURB(PREMOTEUSBDEVICE pDevice, uint32_t u32Millies, void **ppvURB, 668 uint32_t *pu32Len, uint32_t *pu32Err) 665 669 { 666 670 int rc = VINF_SUCCESS; … … 676 680 677 681 /* Wait for transaction completion. */ 678 uint64_t u64StartTime = RTTimeMilliTS 679 680 if (pThis->pollingEnabledURB 682 uint64_t u64StartTime = RTTimeMilliTS(); 683 684 if (pThis->pollingEnabledURB()) 681 685 { 682 686 VRDE_USB_REQ_REAP_URB_PARM parm; … … 684 688 parm.code = VRDE_USB_REQ_REAP_URB; 685 689 686 pThis->VRDPServer()->SendUSBRequest (pDevice->u32ClientId, &parm, sizeof(parm));690 pThis->VRDPServer()->SendUSBRequest(pDevice->u32ClientId, &parm, sizeof(parm)); 687 691 } 688 692 … … 697 701 698 702 /* Scan queued URBs, look for completed. */ 699 requestDevice 703 requestDevice(pDevice); 700 704 701 705 u32ClientId = pDevice->u32ClientId; … … 735 739 } 736 740 737 releaseDevice 741 releaseDevice(pDevice); 738 742 739 743 if ( qurb … … 741 745 || u32Millies == 0 742 746 || pDevice->fFailed 743 || (RTTimeMilliTS 747 || (RTTimeMilliTS() - u64StartTime >= (uint64_t)u32Millies)) 744 748 { 745 749 /* Got an URB or do not have to wait for an URB. */ … … 749 753 LogFlow(("RemoteUSBBackend::iface_ReapURB iteration.\n")); 750 754 751 RTThreadSleep 752 753 if (pThis->pollingEnabledURB 755 RTThreadSleep(10); 756 757 if (pThis->pollingEnabledURB()) 754 758 { 755 759 VRDE_USB_REQ_REAP_URB_PARM parm; … … 757 761 parm.code = VRDE_USB_REQ_REAP_URB; 758 762 759 pThis->VRDPServer()->SendUSBRequest (u32ClientId, &parm, sizeof(parm));763 pThis->VRDPServer()->SendUSBRequest(u32ClientId, &parm, sizeof(parm)); 760 764 } 761 765 } … … 783 787 #endif 784 788 785 qurbFree 789 qurbFree(qurb); 786 790 } 787 791 … … 789 793 } 790 794 791 static DECLCALLBACK(int) iface_Wakeup 795 static DECLCALLBACK(int) iface_Wakeup(PREMOTEUSBDEVICE pDevice) 792 796 { 793 797 ASMAtomicXchgBool(&pDevice->fWokenUp, true); … … 795 799 } 796 800 797 void RemoteUSBBackend::AddRef 801 void RemoteUSBBackend::AddRef(void) 798 802 { 799 803 cRefs++; 800 804 } 801 805 802 void RemoteUSBBackend::Release 806 void RemoteUSBBackend::Release(void) 803 807 { 804 808 cRefs--; … … 810 814 } 811 815 812 void RemoteUSBBackend::PollRemoteDevices 816 void RemoteUSBBackend::PollRemoteDevices(void) 813 817 { 814 818 if ( mfWillBeDeleted … … 816 820 { 817 821 /* Unmount all remote USB devices. */ 818 mConsole->processRemoteUSBDevices 822 mConsole->processRemoteUSBDevices(mu32ClientId, NULL, 0, false); 819 823 820 824 menmPollRemoteDevicesStatus = PollRemoteDevicesStatus_Dereferenced; 821 825 822 Release 826 Release(); 823 827 824 828 return; 825 829 } 826 830 827 switch 831 switch(menmPollRemoteDevicesStatus) 828 832 { 829 833 case PollRemoteDevicesStatus_Negotiate: … … 836 840 parm.flags = VRDE_USB_SERVER_CAPS_PORT_VERSION; 837 841 838 mServer->SendUSBRequest (mu32ClientId, &parm, sizeof(parm));842 mServer->SendUSBRequest(mu32ClientId, &parm, sizeof(parm)); 839 843 840 844 /* Reference the object. When the client disconnects and … … 842 846 * to disconnect the USB devices (as stated above). 843 847 */ 844 AddRef 848 AddRef(); 845 849 846 850 /* Goto the disabled state. When a response will be received … … 865 869 parm.code = VRDE_USB_REQ_DEVICE_LIST; 866 870 867 mServer->SendUSBRequest (mu32ClientId, &parm, sizeof(parm));871 mServer->SendUSBRequest(mu32ClientId, &parm, sizeof(parm)); 868 872 869 873 menmPollRemoteDevicesStatus = PollRemoteDevicesStatus_WaitResponse; … … 876 880 if (mfHasDeviceList) 877 881 { 878 mConsole->processRemoteUSBDevices 882 mConsole->processRemoteUSBDevices(mu32ClientId, (VRDEUSBDEVICEDESC *)mpvDeviceList, mcbDeviceList, mfDescExt); 879 883 LogFlow(("USB::PollRemoteDevices: WaitResponse after process\n")); 880 884 … … 893 897 default: 894 898 { 895 AssertFailed 899 AssertFailed(); 896 900 } break; 897 901 } 898 902 } 899 903 900 void RemoteUSBBackend::NotifyDelete 904 void RemoteUSBBackend::NotifyDelete(void) 901 905 { 902 906 mfWillBeDeleted = true; … … 907 911 * which are managed by the backend. 908 912 */ 909 bool RemoteUSBBackend::addUUID 913 bool RemoteUSBBackend::addUUID(const Guid *pUuid) 910 914 { 911 915 unsigned i; … … 922 926 } 923 927 924 bool RemoteUSBBackend::findUUID 928 bool RemoteUSBBackend::findUUID(const Guid *pUuid) 925 929 { 926 930 unsigned i; … … 936 940 } 937 941 938 void RemoteUSBBackend::removeUUID 942 void RemoteUSBBackend::removeUUID(const Guid *pUuid) 939 943 { 940 944 unsigned i; … … 943 947 if (aGuids[i] == *pUuid) 944 948 { 945 aGuids[i].clear 949 aGuids[i].clear(); 946 950 break; 947 951 } … … 951 955 RemoteUSBBackend::RemoteUSBBackend(Console *console, ConsoleVRDPServer *server, uint32_t u32ClientId) 952 956 : 953 mConsole 954 mServer 955 cRefs 956 mu32ClientId 957 mfHasDeviceList 958 mpvDeviceList 959 mcbDeviceList 960 menmPollRemoteDevicesStatus 961 mfPollURB 962 mpDevices 963 mfWillBeDeleted 964 mClientVersion 965 mfDescExt 957 mConsole(console), 958 mServer(server), 959 cRefs(0), 960 mu32ClientId(u32ClientId), 961 mfHasDeviceList(false), 962 mpvDeviceList(NULL), 963 mcbDeviceList(0), 964 menmPollRemoteDevicesStatus(PollRemoteDevicesStatus_Negotiate), 965 mfPollURB(true), 966 mpDevices(NULL), 967 mfWillBeDeleted(false), 968 mClientVersion(0), /* VRDE_USB_VERSION_2: the client version. */ 969 mfDescExt(false) /* VRDE_USB_VERSION_3: VRDE_USB_REQ_DEVICE_LIST_EXT_RET. */ 966 970 { 967 971 Assert(console); 968 972 Assert(server); 969 973 970 int rc = RTCritSectInit 974 int rc = RTCritSectInit(&mCritsect); 971 975 972 976 if (RT_FAILURE(rc)) 973 977 { 974 AssertFailed 978 AssertFailed(); 975 979 RT_ZERO(mCritsect); 976 980 } … … 995 999 Assert(cRefs == 0); 996 1000 997 if (RTCritSectIsInitialized 998 { 999 RTCritSectDelete 1000 } 1001 1002 RTMemFree 1003 1004 mServer->usbBackendRemoveFromList 1005 } 1006 1007 int RemoteUSBBackend::negotiateResponse 1001 if (RTCritSectIsInitialized(&mCritsect)) 1002 { 1003 RTCritSectDelete(&mCritsect); 1004 } 1005 1006 RTMemFree(mpvDeviceList); 1007 1008 mServer->usbBackendRemoveFromList(this); 1009 } 1010 1011 int RemoteUSBBackend::negotiateResponse(const VRDEUSBREQNEGOTIATERET *pret, uint32_t cbRet) 1008 1012 { 1009 1013 int rc = VINF_SUCCESS; … … 1028 1032 { 1029 1033 /* This could be a client version > 1. */ 1030 if (cbRet >= sizeof 1034 if (cbRet >= sizeof(VRDEUSBREQNEGOTIATERET_2)) 1031 1035 { 1032 1036 VRDEUSBREQNEGOTIATERET_2 *pret2 = (VRDEUSBREQNEGOTIATERET_2 *)pret; … … 1062 1066 if (mClientVersion == VRDE_USB_VERSION_3) 1063 1067 { 1064 if (cbRet >= sizeof 1068 if (cbRet >= sizeof(VRDEUSBREQNEGOTIATERET_3)) 1065 1069 { 1066 1070 VRDEUSBREQNEGOTIATERET_3 *pret3 = (VRDEUSBREQNEGOTIATERET_3 *)pret; … … 1081 1085 } 1082 1086 1083 int RemoteUSBBackend::saveDeviceList 1087 int RemoteUSBBackend::saveDeviceList(const void *pvList, uint32_t cbList) 1084 1088 { 1085 1089 Log(("RemoteUSBBackend::saveDeviceList: pvList = %p, cbList = %d\n", pvList, cbList)); … … 1087 1091 if (!mfHasDeviceList) 1088 1092 { 1089 RTMemFree 1093 RTMemFree(mpvDeviceList); 1090 1094 mpvDeviceList = NULL; 1091 1095 … … 1094 1098 if (cbList > 0) 1095 1099 { 1096 mpvDeviceList = RTMemAlloc 1097 memcpy 1100 mpvDeviceList = RTMemAlloc(cbList); 1101 memcpy(mpvDeviceList, pvList, cbList); 1098 1102 } 1099 1103 … … 1104 1108 } 1105 1109 1106 void RemoteUSBBackend::request 1110 void RemoteUSBBackend::request(void) 1107 1111 { 1108 1112 int rc = RTCritSectEnter(&mCritsect); … … 1110 1114 } 1111 1115 1112 void RemoteUSBBackend::release 1116 void RemoteUSBBackend::release(void) 1113 1117 { 1114 1118 RTCritSectLeave(&mCritsect); 1115 1119 } 1116 1120 1117 PREMOTEUSBDEVICE RemoteUSBBackend::deviceFromId 1118 { 1119 request 1121 PREMOTEUSBDEVICE RemoteUSBBackend::deviceFromId(VRDEUSBDEVID id) 1122 { 1123 request(); 1120 1124 1121 1125 REMOTEUSBDEVICE *pDevice = mpDevices; … … 1126 1130 } 1127 1131 1128 release 1132 release(); 1129 1133 1130 1134 return pDevice; 1131 1135 } 1132 1136 1133 void RemoteUSBBackend::addDevice 1134 { 1135 request 1137 void RemoteUSBBackend::addDevice(PREMOTEUSBDEVICE pDevice) 1138 { 1139 request(); 1136 1140 1137 1141 pDevice->next = mpDevices; … … 1144 1148 mpDevices = pDevice; 1145 1149 1146 release 1147 } 1148 1149 void RemoteUSBBackend::removeDevice 1150 { 1151 request 1150 release(); 1151 } 1152 1153 void RemoteUSBBackend::removeDevice(PREMOTEUSBDEVICE pDevice) 1154 { 1155 request(); 1152 1156 1153 1157 if (pDevice->prev) … … 1165 1169 } 1166 1170 1167 release 1168 } 1169 1170 int RemoteUSBBackend::reapURB 1171 release(); 1172 } 1173 1174 int RemoteUSBBackend::reapURB(const void *pvBody, uint32_t cbBody) 1171 1175 { 1172 1176 int rc = VINF_SUCCESS; … … 1176 1180 VRDEUSBREQREAPURBBODY *pBody = (VRDEUSBREQREAPURBBODY *)pvBody; 1177 1181 1178 while (cbBody >= sizeof 1182 while (cbBody >= sizeof(VRDEUSBREQREAPURBBODY)) 1179 1183 { 1180 1184 Log(("RemoteUSBBackend::reapURB: id = %d, flags = %02X, error = %d, handle %d, len = %d.\n", … … 1194 1198 /* Verify client's data. */ 1195 1199 if ( (pBody->flags & ~fu8ReapValidFlags) != 0 1196 || sizeof 1200 || sizeof(VRDEUSBREQREAPURBBODY) > cbBody 1197 1201 || pBody->handle == 0) 1198 1202 { … … 1202 1206 } 1203 1207 1204 PREMOTEUSBDEVICE pDevice = deviceFromId 1208 PREMOTEUSBDEVICE pDevice = deviceFromId(pBody->id); 1205 1209 1206 1210 if (!pDevice) … … 1213 1217 uint32_t cbBodyData = 0; /* Data contained in the URB body structure for input URBs. */ 1214 1218 1215 requestDevice 1219 requestDevice(pDevice); 1216 1220 1217 1221 /* Search the queued URB for given handle. */ -
trunk/src/VBox/Main/src-client/VMMDevInterface.cpp
r50613 r51092 627 627 /* HGCM connector interface */ 628 628 629 static DECLCALLBACK(int) iface_hgcmConnect (PPDMIHGCMCONNECTOR pInterface, PVBOXHGCMCMD pCmd, PHGCMSERVICELOCATION pServiceLocation, uint32_t *pu32ClientID) 629 static DECLCALLBACK(int) iface_hgcmConnect(PPDMIHGCMCONNECTOR pInterface, PVBOXHGCMCMD pCmd, 630 PHGCMSERVICELOCATION pServiceLocation, 631 uint32_t *pu32ClientID) 630 632 { 631 633 LogSunlover(("Enter\n")); … … 646 648 } 647 649 648 static DECLCALLBACK(int) iface_hgcmDisconnect 650 static DECLCALLBACK(int) iface_hgcmDisconnect(PPDMIHGCMCONNECTOR pInterface, PVBOXHGCMCMD pCmd, uint32_t u32ClientID) 649 651 { 650 652 LogSunlover(("Enter\n")); … … 658 660 } 659 661 660 static DECLCALLBACK(int) iface_hgcmCall (PPDMIHGCMCONNECTOR pInterface, PVBOXHGCMCMD pCmd, uint32_t u32ClientID, uint32_t u32Function,661 uint32_t cParms, PVBOXHGCMSVCPARM paParms)662 static DECLCALLBACK(int) iface_hgcmCall(PPDMIHGCMCONNECTOR pInterface, PVBOXHGCMCMD pCmd, uint32_t u32ClientID, 663 uint32_t u32Function, uint32_t cParms, PVBOXHGCMSVCPARM paParms) 662 664 { 663 665 LogSunlover(("Enter\n")); … … 718 720 if (!hgcmIsActive()) 719 721 return VERR_INVALID_STATE; 720 return HGCMHostCall 722 return HGCMHostCall(pszServiceName, u32Function, cParms, paParms); 721 723 } 722 724 … … 728 730 729 731 # ifdef VBOX_WITH_CRHGSMI 730 int VMMDev::hgcmHostSvcHandleCreate 732 int VMMDev::hgcmHostSvcHandleCreate(const char *pszServiceName, HGCMCVSHANDLE * phSvc) 731 733 { 732 734 if (!hgcmIsActive()) … … 735 737 } 736 738 737 int VMMDev::hgcmHostSvcHandleDestroy 739 int VMMDev::hgcmHostSvcHandleDestroy(HGCMCVSHANDLE hSvc) 738 740 { 739 741 if (!hgcmIsActive()) … … 742 744 } 743 745 744 int VMMDev::hgcmHostFastCallAsync (HGCMCVSHANDLE hSvc, uint32_t function, PVBOXHGCMSVCPARM pParm, PHGCMHOSTFASTCALLCB pfnCompletion, void *pvCompletion) 746 int VMMDev::hgcmHostFastCallAsync(HGCMCVSHANDLE hSvc, uint32_t function, PVBOXHGCMSVCPARM pParm, 747 PHGCMHOSTFASTCALLCB pfnCompletion, void *pvCompletion) 745 748 { 746 749 if (!hgcmIsActive()) -
trunk/src/VBox/Main/src-client/xpcom/module.cpp
r50919 r51092 72 72 NS_DECL_CLASSINFO(Display) 73 73 NS_IMPL_THREADSAFE_ISUPPORTS2_CI(Display, IDisplay, IEventListener) 74 NS_DECL_CLASSINFO(MachineDebugger)75 NS_IMPL_THREADSAFE_ISUPPORTS1_CI(MachineDebugger, IMachineDebugger)76 74 NS_DECL_CLASSINFO(RemoteUSBDevice) 77 75 NS_IMPL_THREADSAFE_ISUPPORTS2_CI(RemoteUSBDevice, IHostUSBDevice, IUSBDevice) -
trunk/src/VBox/Main/src-server/ApplianceImplExport.cpp
r50447 r51092 433 433 lChannelVsys = 1; 434 434 } 435 else if (lChannel == 1 && lDevice == 0) // secondary master; by default this is the CD-ROM but as of VirtualBox 3.1 that can change 435 else if (lChannel == 1 && lDevice == 0) // secondary master; by default this is the CD-ROM but 436 // as of VirtualBox 3.1 that can change 436 437 { 437 438 lControllerVsys = lIDEControllerSecondaryIndex; … … 445 446 else 446 447 throw setError(VBOX_E_NOT_SUPPORTED, 447 tr("Cannot handle medium attachment: channel is %d, device is %d"), lChannel, lDevice);448 tr("Cannot handle medium attachment: channel is %d, device is %d"), lChannel, lDevice); 448 449 break; 449 450 … … 466 467 default: 467 468 throw setError(VBOX_E_NOT_SUPPORTED, 468 tr("Cannot handle medium attachment: storageBus is %d, channel is %d, device is %d"), storageBus, lChannel, lDevice); 469 tr("Cannot handle medium attachment: storageBus is %d, channel is %d, device is %d"), 470 storageBus, lChannel, lDevice); 469 471 break; 470 472 } … … 599 601 } 600 602 601 // AssertReturn(!(m->optListExport.contains(ExportOptions_CreateManifest) && m->optListExport.contains(ExportOptions_ExportDVDImages)), E_INVALIDARG); 603 // AssertReturn(!(m->optListExport.contains(ExportOptions_CreateManifest) 604 // && m->optListExport.contains(ExportOptions_ExportDVDImages)), E_INVALIDARG); 602 605 603 606 m->fExportISOImages = m->optListExport.contains(ExportOptions_ExportDVDImages); … … 1303 1306 desc.strVBoxCurrent.toInt(uTemp); 1304 1307 lVirtualQuantity = (int32_t)uTemp; 1305 strCaption = Utf8StrFmt("%d virtual CPU", lVirtualQuantity); // without this ovftool won't eat the item 1308 strCaption = Utf8StrFmt("%d virtual CPU", lVirtualQuantity); // without this ovftool 1309 // won't eat the item 1306 1310 } 1307 1311 break; … … 1324 1328 lVirtualQuantity = (int32_t)(uTemp / _1M); 1325 1329 strAllocationUnits = "MegaBytes"; 1326 strCaption = Utf8StrFmt("%d MB of memory", lVirtualQuantity); // without this ovftool won't eat the item 1330 strCaption = Utf8StrFmt("%d MB of memory", lVirtualQuantity); // without this ovftool 1331 // won't eat the item 1327 1332 } 1328 1333 break; … … 1433 1438 else 1434 1439 throw setError(VBOX_E_NOT_SUPPORTED, 1435 tr("Invalid config string \"%s\" in SCSI/SAS controller"), desc.strVBoxCurrent.c_str()); 1440 tr("Invalid config string \"%s\" in SCSI/SAS controller"), 1441 desc.strVBoxCurrent.c_str()); 1436 1442 1437 1443 // remember this ID … … 1482 1488 1483 1489 LogFlowFunc(("HardDiskImage details: pos1=%d, pos2=%d, lControllerIndex=%d, lIDEPrimaryControllerIndex=%d, lIDESecondaryControllerIndex=%d, ulParent=%d, lAddressOnParent=%d\n", 1484 pos1, pos2, lControllerIndex, lIDEPrimaryControllerIndex, lIDESecondaryControllerIndex, ulParent, lAddressOnParent)); 1490 pos1, pos2, lControllerIndex, lIDEPrimaryControllerIndex, lIDESecondaryControllerIndex, 1491 ulParent, lAddressOnParent)); 1485 1492 1486 1493 if ( !ulParent … … 1488 1495 ) 1489 1496 throw setError(VBOX_E_NOT_SUPPORTED, 1490 tr("Missing or bad extra config string in hard disk image: \"%s\""), desc.strExtraConfigCurrent.c_str()); 1497 tr("Missing or bad extra config string in hard disk image: \"%s\""), 1498 desc.strExtraConfigCurrent.c_str()); 1491 1499 1492 1500 stack.mapDisks[strDiskID] = &desc; … … 1552 1560 1553 1561 LogFlowFunc(("DVD drive details: pos1=%d, pos2=%d, lControllerIndex=%d, lIDEPrimaryControllerIndex=%d, lIDESecondaryControllerIndex=%d, ulParent=%d, lAddressOnParent=%d\n", 1554 pos1, pos2, lControllerIndex, lIDEPrimaryControllerIndex, lIDESecondaryControllerIndex, ulParent, lAddressOnParent)); 1562 pos1, pos2, lControllerIndex, lIDEPrimaryControllerIndex, 1563 lIDESecondaryControllerIndex, ulParent, lAddressOnParent)); 1555 1564 1556 1565 if ( !ulParent … … 1558 1567 ) 1559 1568 throw setError(VBOX_E_NOT_SUPPORTED, 1560 tr("Missing or bad extra config string in DVD drive medium: \"%s\""), desc.strExtraConfigCurrent.c_str()); 1569 tr("Missing or bad extra config string in DVD drive medium: \"%s\""), 1570 desc.strExtraConfigCurrent.c_str()); 1561 1571 1562 1572 stack.mapDisks[strDiskID] = &desc; … … 2149 2159 pTask->pProgress->SetNextOperation(BstrFmt(tr("Exporting to disk image '%s'"), 2150 2160 RTPathFilename(strTargetFilePath.c_str())).raw(), 2151 pDiskEntry->ulSizeMB); // operation's weight, as set up with the IProgress originally 2161 pDiskEntry->ulSizeMB); // operation's weight, as set up 2162 // with the IProgress originally 2152 2163 2153 2164 // create a flat copy of the source disk image … … 2156 2167 ComObjPtr<Progress> pProgress2; 2157 2168 pProgress2.createObject(); 2158 rc = pProgress2->init(mVirtualBox, static_cast<IAppliance*>(this), BstrFmt(tr("Creating medium '%s'"), 2159 strTargetFilePath.c_str()).raw(), TRUE); 2169 rc = pProgress2->init(mVirtualBox, static_cast<IAppliance*>(this), 2170 BstrFmt(tr("Creating medium '%s'"), 2171 strTargetFilePath.c_str()).raw(), TRUE); 2160 2172 if (FAILED(rc)) throw rc; 2161 2173 -
trunk/src/VBox/Main/src-server/ApplianceImplIO.cpp
r50355 r51092 168 168 169 169 /** @interface_method_impl{VDINTERFACEIO,pfnWriteSync} */ 170 static DECLCALLBACK(int) notImpl_WriteSync(void *pvUser, void *pvStorage, uint64_t off, const void *pvBuf, size_t cbWrite, size_t *pcbWritten) 170 static DECLCALLBACK(int) notImpl_WriteSync(void *pvUser, void *pvStorage, uint64_t off, const void *pvBuf, 171 size_t cbWrite, size_t *pcbWritten) 171 172 { 172 173 NOREF(pvUser); NOREF(pvStorage); NOREF(off); NOREF(pvBuf); NOREF(cbWrite); NOREF(pcbWritten); … … 507 508 508 509 /** @interface_method_impl{VDINTERFACEIO,pfnOpen} */ 509 static DECLCALLBACK(int) fssRdOnly_Open(void *pvUser, const char *pszLocation, uint32_t fOpen, PFNVDCOMPLETED pfnCompleted, void **ppInt) 510 static DECLCALLBACK(int) fssRdOnly_Open(void *pvUser, const char *pszLocation, uint32_t fOpen, 511 PFNVDCOMPLETED pfnCompleted, void **ppInt) 510 512 { 511 513 PFSSRDONLYINTERFACEIO pThis = (PFSSRDONLYINTERFACEIO)pvUser; … … 613 615 614 616 /** @interface_method_impl{VDINTERFACEIO,pfnRead} */ 615 static DECLCALLBACK(int) fssRdOnly_ReadSync(void *pvUser, void *pvStorage, uint64_t off, void *pvBuf, size_t cbToRead, size_t *pcbRead) 617 static DECLCALLBACK(int) fssRdOnly_ReadSync(void *pvUser, void *pvStorage, uint64_t off, void *pvBuf, 618 size_t cbToRead, size_t *pcbRead) 616 619 { 617 620 PIOSRDONLYINTERNAL pFile = (PIOSRDONLYINTERNAL)pvStorage; … … 867 870 size_t cbToWrite = cbMemRead - cbAllWritten; 868 871 size_t cbWritten = 0; 869 rc = vdIfIoFileWriteSync(pIfIo, pInt->pvStorage, pInt->cbCurFile, &pcBuf[cbAllWritten], cbToWrite, &cbWritten); 872 rc = vdIfIoFileWriteSync(pIfIo, pInt->pvStorage, pInt->cbCurFile, &pcBuf[cbAllWritten], 873 cbToWrite, &cbWritten); 870 874 // RTPrintf ("%lu %lu %lu %Rrc\n", pInt->cbCurFile, cbToRead, cbRead, rc); 871 875 if (RT_FAILURE(rc)) … … 1077 1081 break; 1078 1082 /* Create the worker thread. */ 1079 rc = RTThreadCreate(&pInt->pWorkerThread, shaCalcWorkerThread, pInt, 0, RTTHREADTYPE_MAIN_HEAVY_WORKER, RTTHREADFLAGS_WAITABLE, "SHA-Worker"); 1083 rc = RTThreadCreate(&pInt->pWorkerThread, shaCalcWorkerThread, pInt, 0, RTTHREADTYPE_MAIN_HEAVY_WORKER, 1084 RTTHREADFLAGS_WAITABLE, "SHA-Worker"); 1080 1085 if (RT_FAILURE(rc)) 1081 1086 break; … … 1318 1323 1319 1324 /* Check that the write is linear */ 1320 AssertMsgReturn(pInt->cbCurAll <= uOffset, ("Backward seeking is not allowed (uOffset: %7lu cbCurAll: %7lu)!", uOffset, pInt->cbCurAll), VERR_INVALID_PARAMETER); 1325 AssertMsgReturn(pInt->cbCurAll <= uOffset, ("Backward seeking is not allowed (uOffset: %7lu cbCurAll: %7lu)!", 1326 uOffset, pInt->cbCurAll), VERR_INVALID_PARAMETER); 1321 1327 1322 1328 int rc = VINF_SUCCESS; -
trunk/src/VBox/Main/src-server/ApplianceImplImport.cpp
r51014 r51092 1840 1840 { 1841 1841 ComObjPtr<VirtualSystemDescription> vsdescThis = (*it); 1842 std::list<VirtualSystemDescriptionEntry*> avsdeHDs = vsdescThis->i_findByType(VirtualSystemDescriptionType_HardDiskImage); 1842 std::list<VirtualSystemDescriptionEntry*> avsdeHDs = 1843 vsdescThis->i_findByType(VirtualSystemDescriptionType_HardDiskImage); 1843 1844 std::list<VirtualSystemDescriptionEntry*>::const_iterator itH; 1844 1845 for (itH = avsdeHDs.begin(); … … 2171 2172 if(vrc == VINF_X509_NOT_SELFSIGNED_CERTIFICATE) 2172 2173 { 2173 setWarning(VBOX_E_FILE_ERROR, 2174 setWarning(VBOX_E_FILE_ERROR, 2174 2175 tr("Signature from the X509 certificate has been verified. " 2175 2176 "But VirtualBox can't validate the given X509 certificate. " … … 2866 2867 2867 2868 // IDE Hard disk controller 2868 std::list<VirtualSystemDescriptionEntry*> vsdeHDCIDE = vsdescThis->i_findByType(VirtualSystemDescriptionType_HardDiskControllerIDE); 2869 std::list<VirtualSystemDescriptionEntry*> vsdeHDCIDE = 2870 vsdescThis->i_findByType(VirtualSystemDescriptionType_HardDiskControllerIDE); 2869 2871 /* 2870 2872 * In OVF (at least VMware's version of it), an IDE controller has two ports, … … 2898 2900 2899 2901 /* Hard disk controller SATA */ 2900 std::list<VirtualSystemDescriptionEntry*> vsdeHDCSATA = vsdescThis->i_findByType(VirtualSystemDescriptionType_HardDiskControllerSATA); 2902 std::list<VirtualSystemDescriptionEntry*> vsdeHDCSATA = 2903 vsdescThis->i_findByType(VirtualSystemDescriptionType_HardDiskControllerSATA); 2901 2904 if (vsdeHDCSATA.size() > 1) 2902 2905 throw setError(VBOX_E_FILE_ERROR, … … 2920 2923 2921 2924 /* Hard disk controller SCSI */ 2922 std::list<VirtualSystemDescriptionEntry*> vsdeHDCSCSI = vsdescThis->i_findByType(VirtualSystemDescriptionType_HardDiskControllerSCSI); 2925 std::list<VirtualSystemDescriptionEntry*> vsdeHDCSCSI = 2926 vsdescThis->i_findByType(VirtualSystemDescriptionType_HardDiskControllerSCSI); 2923 2927 if (vsdeHDCSCSI.size() > 1) 2924 2928 throw setError(VBOX_E_FILE_ERROR, … … 2954 2958 2955 2959 /* Hard disk controller SAS */ 2956 std::list<VirtualSystemDescriptionEntry*> vsdeHDCSAS = vsdescThis->i_findByType(VirtualSystemDescriptionType_HardDiskControllerSAS); 2960 std::list<VirtualSystemDescriptionEntry*> vsdeHDCSAS = 2961 vsdescThis->i_findByType(VirtualSystemDescriptionType_HardDiskControllerSAS); 2957 2962 if (vsdeHDCSAS.size() > 1) 2958 2963 throw setError(VBOX_E_FILE_ERROR, … … 3070 3075 { 3071 3076 size_t i = 0; 3072 for (list<VirtualSystemDescriptionEntry*>::const_iterator itHD = avsdeHDs.begin(); itHD != avsdeHDs.end(); ++itHD, i++) 3073 Log(("avsdeHDs[%zu]: strRef=%s strOvf=%s\n", i, (*itHD)->strRef.c_str(), (*itHD)->strOvf.c_str())); 3077 for (list<VirtualSystemDescriptionEntry*>::const_iterator itHD = 3078 avsdeHDs.begin(); itHD != avsdeHDs.end(); ++itHD, i++) 3079 Log(("avsdeHDs[%zu]: strRef=%s strOvf=%s\n", i, (*itHD)->strRef.c_str(), (*itHD)->strOvf.c_str())); 3074 3080 i = 0; 3075 3081 for (ovf::DiskImagesMap::const_iterator itDisk = stack.mapDisks.begin(); itDisk != stack.mapDisks.end(); ++itDisk) 3076 Log(("mapDisks[%zu]: strDiskId=%s strHref=%s\n", i, itDisk->second.strDiskId.c_str(), itDisk->second.strHref.c_str())); 3082 Log(("mapDisks[%zu]: strDiskId=%s strHref=%s\n", 3083 i, itDisk->second.strDiskId.c_str(), itDisk->second.strHref.c_str())); 3077 3084 3078 3085 } … … 3444 3451 if (stack.fUSBEnabled) 3445 3452 { 3446 /** @todo r=klaus add support for arbitrary USB controller types, this can't handle multiple controllers due to its design anyway */3447 3453 /** @todo r=klaus add support for arbitrary USB controller types, this can't handle 3454 * multiple controllers due to its design anyway */ 3448 3455 /* usually the OHCI controller is enabled already, need to check */ 3449 3456 bool fOHCIEnabled = false; … … 4004 4011 #ifdef VBOX_WITH_USB 4005 4012 // USB controller 4006 std::list<VirtualSystemDescriptionEntry*> vsdeUSBController = vsdescThis->i_findByType(VirtualSystemDescriptionType_USBController); 4013 std::list<VirtualSystemDescriptionEntry*> vsdeUSBController = 4014 vsdescThis->i_findByType(VirtualSystemDescriptionType_USBController); 4007 4015 // USB support is enabled if there's at least one such entry; to disable USB support, 4008 4016 // the type of the USB item would have been changed to "ignore" … … 4010 4018 #endif 4011 4019 // audio adapter 4012 std::list<VirtualSystemDescriptionEntry*> vsdeAudioAdapter = vsdescThis->i_findByType(VirtualSystemDescriptionType_SoundCard); 4020 std::list<VirtualSystemDescriptionEntry*> vsdeAudioAdapter = 4021 vsdescThis->i_findByType(VirtualSystemDescriptionType_SoundCard); 4013 4022 /* @todo: we support one audio adapter only */ 4014 4023 if (vsdeAudioAdapter.size() > 0) … … 4016 4025 4017 4026 // for the description of the new machine, always use the OVF entry, the user may have changed it in the import config 4018 std::list<VirtualSystemDescriptionEntry*> vsdeDescription = vsdescThis->i_findByType(VirtualSystemDescriptionType_Description); 4027 std::list<VirtualSystemDescriptionEntry*> vsdeDescription = 4028 vsdescThis->i_findByType(VirtualSystemDescriptionType_Description); 4019 4029 if (vsdeDescription.size()) 4020 4030 stack.strDescription = vsdeDescription.front()->strVBoxCurrent; -
trunk/src/VBox/Main/src-server/HostImpl.cpp
r50472 r51092 2378 2378 if (RT_LIKELY(pDrive)) 2379 2379 { 2380 RTStrPrintf(pDrive->szDescription, sizeof(pDrive->szDescription), "%s %s", pszVendor, pszProduct); 2380 RTStrPrintf(pDrive->szDescription, sizeof(pDrive->szDescription), 2381 "%s %s", pszVendor, pszProduct); 2381 2382 RTStrCopy(pDrive->szRawDiskPath, sizeof(pDrive->szRawDiskPath), pszDevLinkPath); 2382 2383 if (*ppDrives) … … 2551 2552 if (!gLibHalCtxShutdown(halContext, &dbusError)) /* what now? */ 2552 2553 { 2553 LogRel(("Host::COMGETTER(DVDDrives): failed to shutdown the libhal context. dbus error: %s (%s)\n", dbusError.name, dbusError.message)); 2554 LogRel(("Host::COMGETTER(DVDDrives): failed to shutdown the libhal context. dbus error: %s (%s)\n", 2555 dbusError.name, dbusError.message)); 2554 2556 gDBusErrorFree(&dbusError); 2555 2557 } … … 2557 2559 else 2558 2560 { 2559 LogRel(("Host::COMGETTER(DVDDrives): failed to initialise libhal context. dbus error: %s (%s)\n", dbusError.name, dbusError.message)); 2561 LogRel(("Host::COMGETTER(DVDDrives): failed to initialise libhal context. dbus error: %s (%s)\n", 2562 dbusError.name, dbusError.message)); 2560 2563 gDBusErrorFree(&dbusError); 2561 2564 } … … 2575 2578 else 2576 2579 { 2577 LogRel(("Host::COMGETTER(DVDDrives): failed to connect to dbus. dbus error: %s (%s)\n", dbusError.name, dbusError.message)); 2580 LogRel(("Host::COMGETTER(DVDDrives): failed to connect to dbus. dbus error: %s (%s)\n", 2581 dbusError.name, dbusError.message)); 2578 2582 gDBusErrorFree(&dbusError); 2579 2583 } … … 2710 2714 if (!gLibHalCtxShutdown(halContext, &dbusError)) /* what now? */ 2711 2715 { 2712 LogRel(("Host::COMGETTER(FloppyDrives): failed to shutdown the libhal context. dbus error: %s (%s)\n", dbusError.name, dbusError.message)); 2716 LogRel(("Host::COMGETTER(FloppyDrives): failed to shutdown the libhal context. dbus error: %s (%s)\n", 2717 dbusError.name, dbusError.message)); 2713 2718 gDBusErrorFree(&dbusError); 2714 2719 } … … 2716 2721 else 2717 2722 { 2718 LogRel(("Host::COMGETTER(FloppyDrives): failed to initialise libhal context. dbus error: %s (%s)\n", dbusError.name, dbusError.message)); 2723 LogRel(("Host::COMGETTER(FloppyDrives): failed to initialise libhal context. dbus error: %s (%s)\n", 2724 dbusError.name, dbusError.message)); 2719 2725 gDBusErrorFree(&dbusError); 2720 2726 } … … 2734 2740 else 2735 2741 { 2736 LogRel(("Host::COMGETTER(FloppyDrives): failed to connect to dbus. dbus error: %s (%s)\n", dbusError.name, dbusError.message)); 2742 LogRel(("Host::COMGETTER(FloppyDrives): failed to connect to dbus. dbus error: %s (%s)\n", 2743 dbusError.name, dbusError.message)); 2737 2744 gDBusErrorFree(&dbusError); 2738 2745 } … … 2821 2828 { 2822 2829 // skip devices we are not interested in 2823 if ((*mountName && mountName[0] == '/') && // skip 'fake' devices (like -hosts, proc, fd, swap) 2824 (*mountFSType && (strncmp(mountFSType, RT_STR_TUPLE("devfs")) != 0 && // skip devfs (i.e. /devices) 2830 if ((*mountName && mountName[0] == '/') && // skip 'fake' devices (like -hosts, 2831 // proc, fd, swap) 2832 (*mountFSType && (strncmp(mountFSType, RT_STR_TUPLE("devfs")) != 0 && // skip devfs 2833 // (i.e. /devices) 2825 2834 strncmp(mountFSType, RT_STR_TUPLE("dev")) != 0 && // skip dev (i.e. /dev) 2826 2835 strncmp(mountFSType, RT_STR_TUPLE("lofs")) != 0))) // skip loop-back file-system (lofs) -
trunk/src/VBox/Main/src-server/HostUSBDeviceImpl.cpp
r49960 r51092 566 566 } 567 567 else 568 AssertMsgReturn( mUniState == kHostUSBDeviceState_DetachingFromVM /** @todo capturing for VM ends up here on termination. */ 568 AssertMsgReturn( mUniState == kHostUSBDeviceState_DetachingFromVM /** @todo capturing for VM 569 ends up here on termination. */ 569 570 || (mUniState == kHostUSBDeviceState_UsedByVM && aAbnormal), 570 571 ("{%s} %s\n", mName, i_getStateName()), E_UNEXPECTED); … … 1405 1406 { 1406 1407 LogFlowThisFunc(("%p {%s} %s - no change %d\n", this, mName, i_getStateName(), enmOldState)); 1407 /** @todo might have to handle some stuff here too if we cannot make the release/capture handling deal with that above ... */ 1408 /** @todo might have to handle some stuff here too if we cannot make the release/capture 1409 * handling deal with that above ... */ 1408 1410 } 1409 1411 … … 2107 2109 else 2108 2110 LogFlowThisFunc(("%s -> %s (prev: %s) [%s]\n", 2109 i_getStateName(), i_stateName(aNewState, aNewPendingState, aNewSubState), i_stateName(NewPrevState), mName)); 2111 i_getStateName(), i_stateName(aNewState, aNewPendingState, aNewSubState), 2112 i_stateName(NewPrevState), mName)); 2110 2113 mPrevUniState = NewPrevState; 2111 2114 mUniState = aNewState; … … 2201 2204 break; 2202 2205 default: 2203 AssertMsgFailedReturn(("this=%p invalid pending state %d: %s\n", this, enmPending, i_getStateName()), false); 2206 AssertMsgFailedReturn(("this=%p invalid pending state %d: %s\n", 2207 this, enmPending, i_getStateName()), false); 2204 2208 } 2205 2209 break; … … 2229 2233 break; 2230 2234 default: 2231 AssertMsgFailedReturn(("this=%p invalid pending state %d: %s\n", this, enmPending, i_getStateName()), false); 2235 AssertMsgFailedReturn(("this=%p invalid pending state %d: %s\n", 2236 this, enmPending, i_getStateName()), false); 2232 2237 } 2233 2238 break; … … 2254 2259 break; 2255 2260 default: 2256 AssertMsgFailedReturn(("this=%p invalid pending state %d: %s\n", this, enmPending, i_getStateName()), false); 2261 AssertMsgFailedReturn(("this=%p invalid pending state %d: %s\n", 2262 this, enmPending, i_getStateName()), false); 2257 2263 } 2258 2264 break; … … 2282 2288 break; 2283 2289 default: 2284 AssertMsgFailedReturn(("this=%p invalid pending state %d: %s\n", this, enmPending, i_getStateName()), false); 2290 AssertMsgFailedReturn(("this=%p invalid pending state %d: %s\n", 2291 this, enmPending, i_getStateName()), false); 2285 2292 } 2286 2293 break; … … 2301 2308 break; 2302 2309 default: 2303 AssertMsgFailedReturn(("this=%p invalid pending state %d: %s\n", this, enmPending, i_getStateName()), false); 2310 AssertMsgFailedReturn(("this=%p invalid pending state %d: %s\n", 2311 this, enmPending, i_getStateName()), false); 2304 2312 } 2305 2313 break; -
trunk/src/VBox/Main/src-server/MediumAttachmentImpl.cpp
r49871 r51092 367 367 hrc = m->pMachine->getBandwidthGroup(m->bd->strBandwidthGroup, pBwGroup, true /* fSetError */); 368 368 369 Assert(SUCCEEDED(hrc)); /* This is not allowed to fail because the existence of the group was checked when it was attached. */ 369 Assert(SUCCEEDED(hrc)); /* This is not allowed to fail because the existence of the 370 group was checked when it was attached. */ 370 371 371 372 if (SUCCEEDED(hrc)) -
trunk/src/VBox/Main/src-server/MediumImpl.cpp
r50874 r51092 112 112 // pParent and llChildren are protected by VirtualBox::i_getMediaTreeLockHandle() 113 113 ComObjPtr<Medium> pParent; 114 MediaList llChildren; // to add a child, just call push_back; to remove a child, call child->deparent() which does a lookup 114 MediaList llChildren; // to add a child, just call push_back; to remove 115 // a child, call child->deparent() which does a lookup 115 116 116 117 GuidList llRegistryIDs; // media registries in which this medium is listed … … 896 897 * @param aFormat 897 898 * @param aLocation Storage unit location. 898 * @param uuidMachineRegistry The registry to which this medium should be added (global registry UUID or machine UUID or empty if none). 899 * @param uuidMachineRegistry The registry to which this medium should be added 900 * (global registry UUID or machine UUID or empty if none). 899 901 */ 900 902 HRESULT Medium::init(VirtualBox *aVirtualBox, … … 1110 1112 * @param aParent Parent medium disk or NULL for a root (base) medium. 1111 1113 * @param aDeviceType Device type of the medium. 1112 * @param uuidMachineRegistry The registry to which this medium should be added (global registry UUID or machine UUID). 1114 * @param uuidMachineRegistry The registry to which this medium should be 1115 * added (global registry UUID or machine UUID). 1113 1116 * @param aNode Configuration settings. 1114 * @param strMachineFolder The machine folder with which to resolve relative paths; if empty, then we use the VirtualBox home directory 1117 * @param strMachineFolder The machine folder with which to resolve relative paths; 1118 * if empty, then we use the VirtualBox home directory 1115 1119 * 1116 1120 * @note Locks the medium tree for writing. … … 3886 3890 rc = pProgress->init(m->pVirtualBox, 3887 3891 static_cast<IMedium*>(this), 3888 BstrFmt(tr("Creating differencing medium storage unit '%s'"), aTarget->m->strLocationFull.c_str()).raw(), 3892 BstrFmt(tr("Creating differencing medium storage unit '%s'"), 3893 aTarget->m->strLocationFull.c_str()).raw(), 3889 3894 TRUE /* aCancelable */); 3890 3895 if (FAILED(rc)) … … 3955 3960 * the object is no longer usable ("not ready" state). 3956 3961 * 3957 * @param autoCaller AutoCaller instance which must have been created on the caller's stack for this medium. This gets released here 3958 * upon which the Medium instance gets uninitialized. 3962 * @param autoCaller AutoCaller instance which must have been created on the caller's 3963 * stack for this medium. This gets released hereupon 3964 * which the Medium instance gets uninitialized. 3959 3965 * @return 3960 3966 */ … … 4006 4012 // in i_saveModifiedRegistries(), which needs the media tree lock, which 4007 4013 // the other thread holds until after uninit() below. 4008 /// @todo redesign the locking here, as holding the locks over uninit causes lock order trouble which the lock validator can't detect 4014 // @todo redesign the locking here, as holding the locks over uninit 4015 // causes lock order trouble which the lock validator can't detect 4009 4016 autoCaller.release(); 4010 4017 m->pVirtualBox->i_saveModifiedRegistries(); … … 5349 5356 * 5350 5357 * @param fSetImageId Whether to reset the UUID contained in the image file to the UUID in the medium instance data (see SetIDs()) 5351 * @param fSetParentId Whether to reset the parent UUID contained in the image file to the parent UUID in the medium instance data (see SetIDs()) 5358 * @param fSetParentId Whether to reset the parent UUID contained in the image file to the parent 5359 * UUID in the medium instance data (see SetIDs()) 5352 5360 * @return 5353 5361 */ … … 6758 6766 if (capabilities & MediumFormatCapabilities_File) 6759 6767 { 6760 HRESULT rc = VirtualBox::i_ensureFilePathExists(targetLocation, !(task.mVariant & MediumVariant_NoCreateDir) /* fCreate */); 6768 HRESULT rc = VirtualBox::i_ensureFilePathExists(targetLocation, 6769 !(task.mVariant & MediumVariant_NoCreateDir) /* fCreate */); 6761 6770 if (FAILED(rc)) 6762 6771 throw rc; … … 7257 7266 if (capabilities & MediumFormatCapabilities_File) 7258 7267 { 7259 HRESULT rc = VirtualBox::i_ensureFilePathExists(targetLocation, !(task.mVariant & MediumVariant_NoCreateDir) /* fCreate */); 7268 HRESULT rc = VirtualBox::i_ensureFilePathExists(targetLocation, 7269 !(task.mVariant & MediumVariant_NoCreateDir) /* fCreate */); 7260 7270 if (FAILED(rc)) 7261 7271 throw rc; … … 7938 7948 if (capabilities & MediumFormatCapabilities_File) 7939 7949 { 7940 rc = VirtualBox::i_ensureFilePathExists(targetLocation, !(task.mVariant & MediumVariant_NoCreateDir) /* fCreate */); 7950 rc = VirtualBox::i_ensureFilePathExists(targetLocation, 7951 !(task.mVariant & MediumVariant_NoCreateDir) /* fCreate */); 7941 7952 if (FAILED(rc)) 7942 7953 throw rc; … … 8064 8075 if (capabilities & MediumFormatCapabilities_File) 8065 8076 { 8066 HRESULT rc = VirtualBox::i_ensureFilePathExists(targetLocation, !(task.mVariant & MediumVariant_NoCreateDir) /* fCreate */); 8077 HRESULT rc = VirtualBox::i_ensureFilePathExists(targetLocation, 8078 !(task.mVariant & MediumVariant_NoCreateDir) /* fCreate */); 8067 8079 if (FAILED(rc)) 8068 8080 throw rc; -
trunk/src/VBox/Main/src-server/NATEngineImpl.cpp
r49875 r51092 285 285 } 286 286 287 HRESULT NATEngine::addRedirect(const com::Utf8Str &aName, NATProtocol_T aProto, const com::Utf8Str &aHostIP, USHORT aHostPort, const com::Utf8Str &aGuestIP, USHORT aGuestPort) 287 HRESULT NATEngine::addRedirect(const com::Utf8Str &aName, NATProtocol_T aProto, const com::Utf8Str &aHostIP, 288 USHORT aHostPort, const com::Utf8Str &aGuestIP, USHORT aGuestPort) 288 289 { 289 290 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); … … 333 334 334 335 alock.release(); 335 mParent->onNATRedirectRuleChange(ulSlot, FALSE, Bstr(name).raw(), aProto, Bstr(r.strHostIP).raw(), r.u16HostPort, Bstr(r.strGuestIP).raw(), r.u16GuestPort); 336 mParent->onNATRedirectRuleChange(ulSlot, FALSE, Bstr(name).raw(), aProto, Bstr(r.strHostIP).raw(), 337 r.u16HostPort, Bstr(r.strGuestIP).raw(), r.u16GuestPort); 336 338 return S_OK; 337 339 } … … 358 360 mData->m.commit(); 359 361 alock.release(); 360 mParent->onNATRedirectRuleChange(ulSlot, TRUE, Bstr(aName).raw(), proto, Bstr(strHostIP).raw(), u16HostPort, Bstr(strGuestIP).raw(), u16GuestPort); 362 mParent->onNATRedirectRuleChange(ulSlot, TRUE, Bstr(aName).raw(), proto, Bstr(strHostIP).raw(), 363 u16HostPort, Bstr(strGuestIP).raw(), u16GuestPort); 361 364 return S_OK; 362 365 } -
trunk/src/VBox/Main/src-server/NetworkAdapterImpl.cpp
r50469 r51092 1305 1305 hrc = mParent->getBandwidthGroup(mData->mBandwidthGroup, pBwGroup, true /* fSetError */); 1306 1306 1307 Assert(SUCCEEDED(hrc)); /* This is not allowed to fail because the existence of the group was checked when it was attached. */ 1307 Assert(SUCCEEDED(hrc)); /* This is not allowed to fail because the existence 1308 i of the group was checked when it was attached. */ 1308 1309 if (SUCCEEDED(hrc)) 1309 1310 pBwGroup.queryInterfaceTo(aBandwidthGroup.asOutParam()); … … 1336 1337 HRESULT hrc = mParent->getBandwidthGroup(strBwGroup, pBwGroup, false /* fSetError */); 1337 1338 NOREF(hrc); 1338 Assert(SUCCEEDED(hrc)); /* This is not allowed to fail because the existence of the group was checked when it was attached. */ 1339 Assert(SUCCEEDED(hrc)); /* This is not allowed to fail because the existence 1340 of the group was checked when it was attached. */ 1339 1341 } 1340 1342 … … 1367 1369 HRESULT hrc = mParent->getBandwidthGroup(mData->mBandwidthGroup, pOldBwGroup, false /* fSetError */); 1368 1370 NOREF(hrc); 1369 Assert(SUCCEEDED(hrc)); /* This is not allowed to fail because the existence of the group was checked when it was attached. */ 1371 Assert(SUCCEEDED(hrc)); /* This is not allowed to fail because the existence of 1372 the group was checked when it was attached. */ 1370 1373 } 1371 1374 -
trunk/src/VBox/Main/src-server/Performance.cpp
r49795 r51092 73 73 } 74 74 75 int CollectorHAL::getRawProcessCpuLoad(RTPROCESS /* process */, uint64_t * /* user */, uint64_t * /* kernel */, uint64_t * /* total */) 75 int CollectorHAL::getRawProcessCpuLoad(RTPROCESS /* process */, uint64_t * /* user */, 76 uint64_t * /* kernel */, uint64_t * /* total */) 76 77 { 77 78 return VERR_NOT_IMPLEMENTED; … … 83 84 } 84 85 85 int CollectorHAL::getHostFilesystemUsage(const char * /* name */, ULONG * /* total */, ULONG * /* used */, ULONG * /* available */) 86 int CollectorHAL::getHostFilesystemUsage(const char * /* name */, ULONG * /* total */, ULONG * /* used */, 87 ULONG * /* available */) 86 88 { 87 89 return VERR_NOT_IMPLEMENTED; -
trunk/src/VBox/Main/src-server/PerformanceImpl.cpp
r44528 r51092 582 582 583 583 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 584 LogAleksey(("{%p} " LOG_FN_FMT ": obj=%p name=%s\n", this, __PRETTY_FUNCTION__, (void *)baseMetric->getObject(), baseMetric->getName())); 584 LogAleksey(("{%p} " LOG_FN_FMT ": obj=%p name=%s\n", this, __PRETTY_FUNCTION__, 585 (void *)baseMetric->getObject(), baseMetric->getName())); 585 586 m.baseMetrics.push_back (baseMetric); 586 587 //LogFlowThisFuncLeave(); … … 594 595 595 596 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 596 LogAleksey(("{%p} " LOG_FN_FMT ": obj=%p name=%s\n", this, __PRETTY_FUNCTION__, (void *)metric->getObject(), metric->getName())); 597 LogAleksey(("{%p} " LOG_FN_FMT ": obj=%p name=%s\n", this, __PRETTY_FUNCTION__, 598 (void *)metric->getObject(), metric->getName())); 597 599 m.metrics.push_back (metric); 598 600 //LogFlowThisFuncLeave(); … … 750 752 * Those should be destroyed now. 751 753 */ 752 LogAleksey(("{%p} " LOG_FN_FMT ": before remove_if: toBeCollected.size()=%d\n", this, __PRETTY_FUNCTION__, toBeCollected.size())); 754 LogAleksey(("{%p} " LOG_FN_FMT ": before remove_if: toBeCollected.size()=%d\n", this, __PRETTY_FUNCTION__, 755 toBeCollected.size())); 753 756 toBeCollected.remove_if(std::mem_fun(&pm::BaseMetric::isUnregistered)); 754 LogAleksey(("{%p} " LOG_FN_FMT ": after remove_if: toBeCollected.size()=%d\n", this, __PRETTY_FUNCTION__, toBeCollected.size())); 755 LogAleksey(("{%p} " LOG_FN_FMT ": before remove_if: m.baseMetrics.size()=%d\n", this, __PRETTY_FUNCTION__, m.baseMetrics.size())); 757 LogAleksey(("{%p} " LOG_FN_FMT ": after remove_if: toBeCollected.size()=%d\n", this, __PRETTY_FUNCTION__, 758 toBeCollected.size())); 759 LogAleksey(("{%p} " LOG_FN_FMT ": before remove_if: m.baseMetrics.size()=%d\n", this, __PRETTY_FUNCTION__, 760 m.baseMetrics.size())); 756 761 for (it = m.baseMetrics.begin(); it != m.baseMetrics.end();) 757 762 if ((*it)->isUnregistered()) … … 762 767 else 763 768 ++it; 764 LogAleksey(("{%p} " LOG_FN_FMT ": after remove_if: m.baseMetrics.size()=%d\n", this, __PRETTY_FUNCTION__, m.baseMetrics.size())); 769 LogAleksey(("{%p} " LOG_FN_FMT ": after remove_if: m.baseMetrics.size()=%d\n", this, __PRETTY_FUNCTION__, 770 m.baseMetrics.size())); 765 771 /* 766 772 * Now when we have destroyed all base metrics that could -
trunk/src/VBox/Main/src-server/USBDeviceFilterImpl.cpp
r50472 r51092 122 122 else 123 123 { 124 aErrStr = Utf8StrFmt(tr("The %s value '%s' is too big (max 0xFFFF)"), i_describeUSBFilterIdx(aIdx), pcszValue); 124 aErrStr = Utf8StrFmt(tr("The %s value '%s' is too big (max 0xFFFF)"), 125 i_describeUSBFilterIdx(aIdx), pcszValue); 125 126 return E_INVALIDARG; 126 127 } … … 155 156 if (vrc == VERR_BUFFER_OVERFLOW) 156 157 { 157 aErrStr = Utf8StrFmt(tr("Insufficient expression space for the '%s' filter expression '%s'"), i_describeUSBFilterIdx(aIdx), aValue.c_str()); 158 aErrStr = Utf8StrFmt(tr("Insufficient expression space for the '%s' filter expression '%s'"), 159 i_describeUSBFilterIdx(aIdx), aValue.c_str()); 158 160 return E_FAIL; 159 161 } 160 162 AssertRC(vrc); 161 aErrStr = Utf8StrFmt(tr("Encountered unexpected status %Rrc when setting '%s' to '%s'"), vrc, i_describeUSBFilterIdx(aIdx), aValue.c_str()); 163 aErrStr = Utf8StrFmt(tr("Encountered unexpected status %Rrc when setting '%s' to '%s'"), 164 vrc, i_describeUSBFilterIdx(aIdx), aValue.c_str()); 162 165 return E_FAIL; 163 166 } -
trunk/src/VBox/Main/src-server/USBProxyService.cpp
r50355 r51092 356 356 && fRunFilters) 357 357 { 358 Assert(aDone && pHostDevice->i_getUnistate() == kHostUSBDeviceState_HeldByProxy && pHostDevice->i_getMachine().isNull()); 358 Assert(aDone && pHostDevice->i_getUnistate() == 359 kHostUSBDeviceState_HeldByProxy && pHostDevice->i_getMachine().isNull()); 359 360 devLock.release(); 360 361 alock.release(); … … 404 405 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 405 406 AutoWriteLock devLock(aDevice COMMA_LOCKVAL_SRC_POS); 406 AssertMsgReturn(aDevice->i_isCapturableOrHeld(), ("{%s} %s\n", aDevice->i_getName().c_str(), aDevice->i_getStateName()), E_FAIL); 407 AssertMsgReturn(aDevice->i_isCapturableOrHeld(), ("{%s} %s\n", aDevice->i_getName().c_str(), 408 aDevice->i_getStateName()), E_FAIL); 407 409 408 410 /* … … 1081 1083 * @param aRunFilters Whether or not to run filters. 1082 1084 */ 1083 bool USBProxyService::updateDeviceStateFake(HostUSBDevice *aDevice, PUSBDEVICE aUSBDevice, bool *aRunFilters, SessionMachine **aIgnoreMachine) 1085 bool USBProxyService::updateDeviceStateFake(HostUSBDevice *aDevice, PUSBDEVICE aUSBDevice, bool *aRunFilters, 1086 SessionMachine **aIgnoreMachine) 1084 1087 { 1085 1088 *aRunFilters = false; … … 1106 1109 * @param aIgnoreMachine Machine to ignore when running filters. 1107 1110 */ 1108 bool USBProxyService::updateDeviceState(HostUSBDevice *aDevice, PUSBDEVICE aUSBDevice, bool *aRunFilters, SessionMachine **aIgnoreMachine) 1111 bool USBProxyService::updateDeviceState(HostUSBDevice *aDevice, PUSBDEVICE aUSBDevice, bool *aRunFilters, 1112 SessionMachine **aIgnoreMachine) 1109 1113 { 1110 1114 AssertReturn(aDevice, false); … … 1125 1129 * @param aIgnoreMachine Machine to ignore when running filters. 1126 1130 */ 1127 void USBProxyService::deviceChanged(ComObjPtr<HostUSBDevice> &aDevice, SessionMachinesList *pllOpenedMachines, SessionMachine *aIgnoreMachine) 1131 void USBProxyService::deviceChanged(ComObjPtr<HostUSBDevice> &aDevice, SessionMachinesList *pllOpenedMachines, 1132 SessionMachine *aIgnoreMachine) 1128 1133 { 1129 1134 /* -
trunk/src/VBox/Main/src-server/VirtualBoxImpl.cpp
r51041 r51092 1454 1454 { 1455 1455 LogFlowThisFuncEnter(); 1456 LogFlowThisFunc(("aSettingsFile=\"%s\", aName=\"%s\", aOsTypeId =\"%s\", aCreateFlags=\"%s\"\n", aSettingsFile.c_str(), aName.c_str(), aOsTypeId.c_str(), aFlags.c_str())); 1456 LogFlowThisFunc(("aSettingsFile=\"%s\", aName=\"%s\", aOsTypeId =\"%s\", aCreateFlags=\"%s\"\n", 1457 aSettingsFile.c_str(), aName.c_str(), aOsTypeId.c_str(), aFlags.c_str())); 1457 1458 /** @todo tighten checks on aId? */ 1458 1459 … … 3853 3854 * 3854 3855 * @param mediaRegistry Settings structure to fill. 3855 * @param uuidRegistry The UUID of the media registry; either a machine UUID (if machine registry) or the UUID of the global registry. 3856 * @param uuidRegistry The UUID of the media registry; either a machine UUID ( 3857 * if machine registry) or the UUID of the global registry. 3856 3858 * @param strMachineFolder The machine folder for relative paths, if machine registry, or an empty string otherwise. 3857 3859 */ -
trunk/src/VBox/Main/src-server/freebsd/HostHardwareFreeBSD.cpp
r48424 r51092 251 251 PeriphMatchPattern.pattern.periph_pattern.target_id = paMatches[i].result.device_result.target_id; 252 252 PeriphMatchPattern.pattern.periph_pattern.target_lun = paMatches[i].result.device_result.target_lun; 253 PeriphMatchPattern.pattern.periph_pattern.flags = PERIPH_MATCH_PATH | PERIPH_MATCH_TARGET | PERIPH_MATCH_LUN; 253 PeriphMatchPattern.pattern.periph_pattern.flags = PERIPH_MATCH_PATH | PERIPH_MATCH_TARGET | 254 PERIPH_MATCH_LUN; 254 255 PeriphCCB.cdm.num_patterns = 1; 255 256 PeriphCCB.cdm.pattern_buf_len = sizeof(struct dev_match_result); -
trunk/src/VBox/Main/src-server/freebsd/USBProxyServiceFreeBSD.cpp
r47117 r51092 147 147 148 148 149 bool USBProxyServiceFreeBSD::updateDeviceState(HostUSBDevice *aDevice, PUSBDEVICE aUSBDevice, bool *aRunFilters, SessionMachine **aIgnoreMachine) 149 bool USBProxyServiceFreeBSD::updateDeviceState(HostUSBDevice *aDevice, PUSBDEVICE aUSBDevice, bool *aRunFilters, 150 SessionMachine **aIgnoreMachine) 150 151 { 151 152 AssertReturn(aDevice, false); … … 161 162 * See USBProxyService::deviceAdded for details. 162 163 */ 163 void USBProxyServiceFreeBSD::deviceAdded(ComObjPtr<HostUSBDevice> &aDevice, SessionMachinesList &llOpenedMachines, PUSBDEVICE aUSBDevice) 164 void USBProxyServiceFreeBSD::deviceAdded(ComObjPtr<HostUSBDevice> &aDevice, SessionMachinesList &llOpenedMachines, 165 PUSBDEVICE aUSBDevice) 164 166 { 165 167 USBProxyService::deviceAdded(aDevice, llOpenedMachines, aUSBDevice); -
trunk/src/VBox/Main/src-server/linux/USBGetDevices.cpp
r50783 r51092 466 466 467 467 /** Just a worker for USBProxyServiceLinux::getDevices that avoids some code duplication. */ 468 static int addDeviceToChain(PUSBDEVICE pDev, PUSBDEVICE *ppFirst, PUSBDEVICE **pppNext, const char *pcszUsbfsRoot, bool testfs, int rc) 468 static int addDeviceToChain(PUSBDEVICE pDev, PUSBDEVICE *ppFirst, PUSBDEVICE **pppNext, const char *pcszUsbfsRoot, 469 bool testfs, int rc) 469 470 { 470 471 /* usbDeterminState requires the address. */ -
trunk/src/VBox/Main/src-server/linux/USBProxyServiceLinux.cpp
r49960 r51092 258 258 259 259 260 bool USBProxyServiceLinux::updateDeviceState(HostUSBDevice *aDevice, PUSBDEVICE aUSBDevice, bool *aRunFilters, SessionMachine **aIgnoreMachine) 260 bool USBProxyServiceLinux::updateDeviceState(HostUSBDevice *aDevice, PUSBDEVICE aUSBDevice, bool *aRunFilters, 261 SessionMachine **aIgnoreMachine) 261 262 { 262 263 AssertReturn(aDevice, false); … … 277 278 * See USBProxyService::deviceAdded for details. 278 279 */ 279 void USBProxyServiceLinux::deviceAdded(ComObjPtr<HostUSBDevice> &aDevice, SessionMachinesList &llOpenedMachines, PUSBDEVICE aUSBDevice) 280 void USBProxyServiceLinux::deviceAdded(ComObjPtr<HostUSBDevice> &aDevice, SessionMachinesList &llOpenedMachines, 281 PUSBDEVICE aUSBDevice) 280 282 { 281 283 AssertReturnVoid(aDevice); -
trunk/src/VBox/Main/src-server/os2/USBProxyServiceOs2.cpp
r41528 r51092 166 166 167 167 168 bool USBProxyServiceOs2::updateDeviceState(HostUSBDevice *aDevice, PUSBDEVICE aUSBDevice, bool *aRunFilters, SessionMachine **aIgnoreMachine) 168 bool USBProxyServiceOs2::updateDeviceState(HostUSBDevice *aDevice, PUSBDEVICE aUSBDevice, bool *aRunFilters, 169 SessionMachine **aIgnoreMachine) 169 170 { 170 171 AssertReturn(aDevice, false); -
trunk/src/VBox/Main/src-server/solaris/NetIf-solaris.cpp
r48020 r51092 124 124 static void vboxSolarisAddHostIface(char *pszIface, int Instance, void *pvHostNetworkInterfaceList) 125 125 { 126 std::list<ComObjPtr<HostNetworkInterface> > *pList = (std::list<ComObjPtr<HostNetworkInterface> > *)pvHostNetworkInterfaceList; 126 std::list<ComObjPtr<HostNetworkInterface> > *pList = 127 (std::list<ComObjPtr<HostNetworkInterface> > *)pvHostNetworkInterfaceList; 127 128 Assert(pList); 128 129 -
trunk/src/VBox/Main/src-server/solaris/USBProxyServiceSolaris.cpp
r49964 r51092 441 441 442 442 443 bool USBProxyServiceSolaris::updateDeviceState(HostUSBDevice *aDevice, PUSBDEVICE aUSBDevice, bool *aRunFilters, SessionMachine **aIgnoreMachine) 443 bool USBProxyServiceSolaris::updateDeviceState(HostUSBDevice *aDevice, PUSBDEVICE aUSBDevice, bool *aRunFilters, 444 SessionMachine **aIgnoreMachine) 444 445 { 445 446 AssertReturn(aDevice, false); -
trunk/src/VBox/Main/src-server/win/HostPowerWin.cpp
r49938 r51092 172 172 if (GetSystemPowerStatus(&SystemPowerStatus) == TRUE) 173 173 { 174 Log(("PBT_APMPOWERSTATUSCHANGE ACLineStatus=%d BatteryFlag=%d\n", SystemPowerStatus.ACLineStatus, SystemPowerStatus.BatteryFlag)); 174 Log(("PBT_APMPOWERSTATUSCHANGE ACLineStatus=%d BatteryFlag=%d\n", SystemPowerStatus.ACLineStatus, 175 SystemPowerStatus.BatteryFlag)); 175 176 176 177 if (SystemPowerStatus.ACLineStatus == 0) /* offline */ … … 181 182 SYSTEM_BATTERY_STATE BatteryState; 182 183 183 rc = CallNtPowerInformation(SystemBatteryState, NULL, 0, (PVOID)&BatteryState, sizeof(BatteryState)); 184 rc = CallNtPowerInformation(SystemBatteryState, NULL, 0, (PVOID)&BatteryState, 185 sizeof(BatteryState)); 184 186 #ifdef LOG_ENABLED 185 187 if (rc == 0 /* STATUS_SUCCESS */) 186 Log(("CallNtPowerInformation claims %d seconds of power left\n", BatteryState.EstimatedTime)); 188 Log(("CallNtPowerInformation claims %d seconds of power left\n", 189 BatteryState.EstimatedTime)); 187 190 #endif 188 191 if ( rc == 0 /* STATUS_SUCCESS */ … … 193 196 } 194 197 else 195 /* If the machine has less than 5% battery left (and is not connected to the AC), then we should save the state. */ 198 /* If the machine has less than 5% battery left (and is not connected 199 * to the AC), then we should save the state. */ 196 200 if (SystemPowerStatus.BatteryFlag == 4 /* critical battery status; less than 5% */) 197 201 { -
trunk/src/VBox/Main/src-server/win/NetIf-win.cpp
r50355 r51092 668 668 Bstr bstrErr; 669 669 670 hrc = VBoxNetCfgWinCreateHostOnlyNetworkInterface(NULL, false, guid.asOutParam(), name.asOutParam(), bstrErr.asOutParam()); 670 hrc = VBoxNetCfgWinCreateHostOnlyNetworkInterface(NULL, false, guid.asOutParam(), name.asOutParam(), 671 bstrErr.asOutParam()); 671 672 672 673 if (hrc == S_OK) … … 1272 1273 } 1273 1274 1274 int NetIfEnableStaticIpConfigV6(VirtualBox *vBox, HostNetworkInterface * pIf, IN_BSTR aOldIPV6Address, IN_BSTR aIPV6Address, ULONG aIPV6MaskPrefixLength) 1275 int NetIfEnableStaticIpConfigV6(VirtualBox *vBox, HostNetworkInterface * pIf, IN_BSTR aOldIPV6Address, 1276 IN_BSTR aIPV6Address, ULONG aIPV6MaskPrefixLength) 1275 1277 { 1276 1278 #ifndef VBOX_WITH_NETFLT … … 1530 1532 if (uComponentStatus == 0) 1531 1533 { 1532 vboxNetWinAddComponent(&list, pMpNcc, HostNetworkInterfaceType_Bridged, iDefault); 1534 vboxNetWinAddComponent(&list, pMpNcc, HostNetworkInterfaceType_Bridged, 1535 iDefault); 1533 1536 } 1534 1537 } -
trunk/src/VBox/Main/src-server/win/PerformanceWin.cpp
r46593 r51092 269 269 uint64_t uTotalMhz = 0; 270 270 RTCPUID nProcessors = RTMpGetCount(); 271 PPROCESSOR_POWER_INFORMATION ppi = (PPROCESSOR_POWER_INFORMATION)RTMemAllocZ(nProcessors * sizeof(PROCESSOR_POWER_INFORMATION)); 271 PPROCESSOR_POWER_INFORMATION ppi = (PPROCESSOR_POWER_INFORMATION) 272 RTMemAllocZ(nProcessors * sizeof(PROCESSOR_POWER_INFORMATION)); 272 273 273 274 if (!ppi) -
trunk/src/VBox/Main/src-server/win/USBProxyServiceWindows.cpp
r49960 r51092 220 220 221 221 222 bool USBProxyServiceWindows::updateDeviceState(HostUSBDevice *aDevice, PUSBDEVICE aUSBDevice, bool *aRunFilters, SessionMachine **aIgnoreMachine) 222 bool USBProxyServiceWindows::updateDeviceState(HostUSBDevice *aDevice, PUSBDEVICE aUSBDevice, bool *aRunFilters, 223 SessionMachine **aIgnoreMachine) 223 224 { 224 225 AssertReturn(aDevice, false);
Note:
See TracChangeset
for help on using the changeset viewer.