- Timestamp:
- Nov 14, 2009 11:55:35 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/ConsoleImpl.cpp
r24618 r24664 507 507 508 508 #ifdef VBOX_WITH_GUEST_PROPS 509 509 510 bool Console::enabledGuestPropertiesVRDP(void) 510 511 { … … 607 608 return; 608 609 } 610 609 611 #endif /* VBOX_WITH_GUEST_PROPS */ 610 612 … … 1162 1164 1163 1165 #ifdef VBOX_WITH_GUEST_PROPS 1166 1164 1167 // static 1165 1168 DECLCALLBACK(int) 1166 Console::doGuestPropNotification(void *pvExtension, uint32_t ,1169 Console::doGuestPropNotification(void *pvExtension, uint32_t u32Function, 1167 1170 void *pvParms, uint32_t cbParms) 1168 1171 { 1169 1172 using namespace guestProp; 1170 1173 1171 // LogFlowFunc(("pvExtension=%p, pvParms=%p, cbParms=%u\n", pvExtension, pvParms, cbParms)); 1172 int rc = VINF_SUCCESS; 1173 /* No locking, as this is purely a notification which does not make any 1174 * changes to the object state. */ 1175 PHOSTCALLBACKDATA pCBData = reinterpret_cast<PHOSTCALLBACKDATA>(pvParms); 1174 Assert(u32Function == 0); NOREF(u32Function); 1175 1176 /* 1177 * No locking, as this is purely a notification which does not make any 1178 * changes to the object state. 1179 */ 1180 PHOSTCALLBACKDATA pCBData = reinterpret_cast<PHOSTCALLBACKDATA>(pvParms); 1176 1181 AssertReturn(sizeof(HOSTCALLBACKDATA) == cbParms, VERR_INVALID_PARAMETER); 1177 1182 AssertReturn(HOSTCALLBACKMAGIC == pCBData->u32Magic, VERR_INVALID_PARAMETER); 1178 ComObjPtr<Console> pConsole = reinterpret_cast<Console *>(pvExtension); 1179 // LogFlowFunc(("pCBData->pcszName=%s, pCBData->pcszValue=%s, pCBData->pcszFlags=%s\n", pCBData->pcszName, pCBData->pcszValue, pCBData->pcszFlags)); 1183 Log5(("Console::doGuestPropNotification: pCBData={.pcszName=%s, .pcszValue=%s, .pcszFlags=%s}\n", 1184 pCBData->pcszName, pCBData->pcszValue, pCBData->pcszFlags)); 1185 1186 int rc; 1180 1187 Bstr name(pCBData->pcszName); 1181 1188 Bstr value(pCBData->pcszValue); 1182 1189 Bstr flags(pCBData->pcszFlags); 1183 if ( name.isNull()1184 || (value.isNull() && (pCBData->pcszValue != NULL))1185 || (flags.isNull() && (pCBData->pcszFlags != NULL))1190 if ( !name.isNull() 1191 && (!value.isNull() || pCBData->pcszValue == NULL) 1192 && (!flags.isNull() || pCBData->pcszFlags == NULL) 1186 1193 ) 1194 { 1195 ComObjPtr<Console> ptrConsole = reinterpret_cast<Console *>(pvExtension); 1196 HRESULT hrc = ptrConsole->mControl->PushGuestProperty(name, 1197 value, 1198 pCBData->u64Timestamp, 1199 flags); 1200 if (SUCCEEDED(hrc)) 1201 rc = VINF_SUCCESS; 1202 else 1203 { 1204 LogFunc(("Console::doGuestPropNotification: hrc=%Rhrc pCBData={.pcszName=%s, .pcszValue=%s, .pcszFlags=%s}\n", 1205 pCBData->pcszName, pCBData->pcszValue, pCBData->pcszFlags)); 1206 rc = Global::vboxStatusCodeFromCOM(hrc); 1207 } 1208 } 1209 else 1187 1210 rc = VERR_NO_MEMORY; 1188 else1189 {1190 HRESULT hrc = pConsole->mControl->PushGuestProperty(name, value,1191 pCBData->u64Timestamp,1192 flags);1193 if (FAILED(hrc))1194 {1195 // LogFunc(("pConsole->mControl->PushGuestProperty failed, hrc=0x%x\n", hrc));1196 // LogFunc(("pCBData->pcszName=%s\n", pCBData->pcszName));1197 // LogFunc(("pCBData->pcszValue=%s\n", pCBData->pcszValue));1198 // LogFunc(("pCBData->pcszFlags=%s\n", pCBData->pcszFlags));1199 rc = Global::vboxStatusCodeFromCOM(hrc);1200 }1201 }1202 // LogFlowFunc(("rc=%Rrc\n", rc));1203 1211 return rc; 1204 1212 } … … 1300 1308 return S_OK; 1301 1309 } 1302 #endif 1310 1311 #endif /* VBOX_WITH_GUEST_PROPS */ 1303 1312 1304 1313 … … 3897 3906 #ifndef VBOX_WITH_GUEST_PROPS 3898 3907 ReturnComNotImplemented(); 3899 #else 3908 #else /* VBOX_WITH_GUEST_PROPS */ 3900 3909 if (!VALID_PTR(aName)) 3901 3910 return E_INVALIDARG; … … 3974 3983 #ifndef VBOX_WITH_GUEST_PROPS 3975 3984 ReturnComNotImplemented(); 3976 #else 3985 #else /* VBOX_WITH_GUEST_PROPS */ 3977 3986 if (!VALID_PTR(aName)) 3978 3987 return E_INVALIDARG; … … 4050 4059 #ifndef VBOX_WITH_GUEST_PROPS 4051 4060 ReturnComNotImplemented(); 4052 #else 4061 #else /* VBOX_WITH_GUEST_PROPS */ 4053 4062 if (!VALID_PTR(aPatterns) && (aPatterns != NULL)) 4054 4063 return E_POINTER;
Note:
See TracChangeset
for help on using the changeset viewer.