- Timestamp:
- Oct 12, 2015 1:46:16 PM (9 years ago)
- svn:sync-xref-src-repo-rev:
- 103297
- Location:
- trunk/src/VBox/Additions/common/VBoxGuestLib
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/src/VBox/Additions/common/VBoxGuestLib/GenericRequest.cpp ¶
r58178 r58183 105 105 } 106 106 107 DECLVBGL(int) VbglGRAlloc(VMMDevRequestHeader **ppReq, uint32_t cbReq, VMMDevRequestType enmReqType)107 DECLVBGL(int) VbglGRAlloc(VMMDevRequestHeader **ppReq, size_t cbReq, VMMDevRequestType enmReqType) 108 108 { 109 109 int rc = vbglR0Enter(); 110 110 if (RT_SUCCESS(rc)) 111 111 { 112 if (ppReq && cbReq >= sizeof(VMMDevRequestHeader)) 112 if ( ppReq 113 && cbReq >= sizeof(VMMDevRequestHeader) 114 && cbReq == (uint32_t)cbReq) 113 115 { 114 VMMDevRequestHeader *pReq = (VMMDevRequestHeader *)VbglPhysHeapAlloc( cbReq);116 VMMDevRequestHeader *pReq = (VMMDevRequestHeader *)VbglPhysHeapAlloc((uint32_t)cbReq); 115 117 AssertMsgReturn(pReq, ("VbglGRAlloc: no memory (cbReq=%u)\n", cbReq), VERR_NO_MEMORY); 116 118 memset(pReq, 0xAA, cbReq); 117 119 118 pReq->size = cbReq;120 pReq->size = (uint32_t)cbReq; 119 121 pReq->version = VMMDEV_REQUEST_HEADER_VERSION; 120 122 pReq->requestType = enmReqType; -
TabularUnified trunk/src/VBox/Additions/common/VBoxGuestLib/HGCMInternal.cpp ¶
r57358 r58183 487 487 HGCMFunctionParameter *pDstParm = VMMDEV_HGCM_CALL_PARMS(pHGCMCall); 488 488 uint32_t cParms = pCallInfo->cParms; 489 uint32_t offExtra = (uint ptr_t)(pDstParm + cParms) - (uintptr_t)pHGCMCall;489 uint32_t offExtra = (uint32_t)((uintptr_t)(pDstParm + cParms) - (uintptr_t)pHGCMCall); 490 490 uint32_t iLockBuf = 0; 491 491 uint32_t iParm; … … 575 575 #endif 576 576 pDstPgLst->offFirstPage = pSrcParm->u.Pointer.u.linearAddr & PAGE_OFFSET_MASK; 577 pDstPgLst->cPages = cPages; Assert(pDstPgLst->cPages == cPages);577 pDstPgLst->cPages = (uint32_t)cPages; Assert(pDstPgLst->cPages == cPages); 578 578 for (iPage = 0; iPage < cPages; iPage++) 579 579 { -
TabularUnified trunk/src/VBox/Additions/common/VBoxGuestLib/Mouse.cpp ¶
r56294 r58183 41 41 * @param pvUser user supplied data/cookie to be passed to the function. 42 42 */ 43 DECLVBGL(int) VbglSetMouseNotifyCallback(PFNVBOXGUESTMOUSENOTIFY pfnNotify, 44 void *pvUser) 43 DECLVBGL(int) VbglSetMouseNotifyCallback(PFNVBOXGUESTMOUSENOTIFY pfnNotify, void *pvUser) 45 44 { 46 45 VBoxGuestMouseSetNotifyCallback NotifyCallback; … … 51 50 NotifyCallback.pfnNotify = pfnNotify; 52 51 NotifyCallback.pvUser = pvUser; 53 return vbglDriverIOCtl(pDriver, VBOXGUEST_IOCTL_SET_MOUSE_NOTIFY_CALLBACK, 54 &NotifyCallback, sizeof(NotifyCallback)); 52 return vbglDriverIOCtl(pDriver, VBOXGUEST_IOCTL_SET_MOUSE_NOTIFY_CALLBACK, &NotifyCallback, sizeof(NotifyCallback)); 55 53 } 56 54 … … 65 63 * @param py Where to store the Y co-ordinate. 66 64 */ 67 DECLVBGL(int) VbglGetMouseStatus(uint32_t *pfFeatures, uint32_t *px, 68 uint32_t *py) 65 DECLVBGL(int) VbglGetMouseStatus(uint32_t *pfFeatures, uint32_t *px, uint32_t *py) 69 66 { 70 67 VMMDevReqMouseStatus Req; … … 79 76 Req.pointerXPos = 0; 80 77 Req.pointerYPos = 0; 81 rc = vbglDriverIOCtl(pDriver, VBOXGUEST_IOCTL_VMMREQUEST(sizeof(Req)), 82 &Req.header, sizeof(Req)); 78 rc = vbglDriverIOCtl(pDriver, VBOXGUEST_IOCTL_VMMREQUEST(sizeof(Req)), &Req.header, sizeof(Req)); 83 79 if (RT_FAILURE(rc)) 84 80 return rc; … … 112 108 if (RT_FAILURE(rc)) 113 109 return rc; 114 return vbglDriverIOCtl(pDriver, VBOXGUEST_IOCTL_SET_MOUSE_STATUS, 115 &fFeatures, sizeof(fFeatures)); 110 return vbglDriverIOCtl(pDriver, VBOXGUEST_IOCTL_SET_MOUSE_STATUS, &fFeatures, sizeof(fFeatures)); 116 111 } 112 -
TabularUnified trunk/src/VBox/Additions/common/VBoxGuestLib/SysHlp.cpp ¶
r56294 r58183 51 51 * @param fFlags HGCM call flags, VBGLR0_HGCM_F_XXX. 52 52 */ 53 int vbglLockLinear 53 int vbglLockLinear(void **ppvCtx, void *pv, uint32_t u32Size, bool fWriteAccess, uint32_t fFlags) 54 54 { 55 55 int rc = VINF_SUCCESS; … … 74 74 * Then we can move all this up one level even. */ 75 75 #ifdef RT_OS_WINDOWS 76 PMDL pMdl = IoAllocateMdl 76 PMDL pMdl = IoAllocateMdl(pv, u32Size, FALSE, FALSE, NULL); 77 77 78 78 if (pMdl == NULL) … … 85 85 __try { 86 86 /* Calls to MmProbeAndLockPages must be enclosed in a try/except block. */ 87 MmProbeAndLockPages 88 89 90 87 MmProbeAndLockPages(pMdl, 88 /** @todo (fFlags & VBGLR0_HGCMCALL_F_MODE_MASK) == VBGLR0_HGCMCALL_F_USER? UserMode: KernelMode */ 89 KernelMode, 90 (fWriteAccess) ? IoModifyAccess : IoReadAccess); 91 91 92 92 *ppvCtx = pMdl; … … 94 94 } __except(EXCEPTION_EXECUTE_HANDLER) { 95 95 96 IoFreeMdl 96 IoFreeMdl(pMdl); 97 97 /** @todo */ 98 98 rc = VERR_INVALID_PARAMETER; … … 124 124 } 125 125 126 void vbglUnlockLinear 126 void vbglUnlockLinear(void *pvCtx, void *pv, uint32_t u32Size) 127 127 { 128 128 #ifdef RT_OS_WINDOWS … … 132 132 if (pMdl != NULL) 133 133 { 134 MmUnlockPages 135 IoFreeMdl 134 MmUnlockPages(pMdl); 135 IoFreeMdl(pMdl); 136 136 } 137 137 … … 164 164 && !defined(RT_OS_WINDOWS) 165 165 RT_C_DECLS_BEGIN 166 extern DECLVBGL(void *) VBoxGuestIDCOpen 167 extern DECLVBGL(void) VBoxGuestIDCClose 168 extern DECLVBGL(int) VBoxGuestIDCCall 166 extern DECLVBGL(void *) VBoxGuestIDCOpen(uint32_t *pu32Version); 167 extern DECLVBGL(void) VBoxGuestIDCClose(void *pvOpaque); 168 extern DECLVBGL(int) VBoxGuestIDCCall(void *pvOpaque, unsigned int iCmd, void *pvData, size_t cbSize, size_t *pcbReturn); 169 169 RT_C_DECLS_END 170 170 # endif 171 171 172 bool vbglDriverIsOpened 172 bool vbglDriverIsOpened(VBGLDRIVER *pDriver) 173 173 { 174 174 # ifdef RT_OS_WINDOWS … … 181 181 } 182 182 183 int vbglDriverOpen 183 int vbglDriverOpen(VBGLDRIVER *pDriver) 184 184 { 185 185 # ifdef RT_OS_WINDOWS 186 186 UNICODE_STRING uszDeviceName; 187 RtlInitUnicodeString 187 RtlInitUnicodeString(&uszDeviceName, L"\\Device\\VBoxGuest"); 188 188 189 189 PDEVICE_OBJECT pDeviceObject = NULL; 190 190 PFILE_OBJECT pFileObject = NULL; 191 191 192 NTSTATUS rc = IoGetDeviceObjectPointer (&uszDeviceName, FILE_ALL_ACCESS, 193 &pFileObject, &pDeviceObject); 194 195 if (NT_SUCCESS (rc)) 192 NTSTATUS rc = IoGetDeviceObjectPointer(&uszDeviceName, FILE_ALL_ACCESS, &pFileObject, &pDeviceObject); 193 if (NT_SUCCESS(rc)) 196 194 { 197 195 Log(("vbglDriverOpen VBoxGuest successful pDeviceObject=%x\n", pDeviceObject)); … … 208 206 * Just check whether the connection was made or not. 209 207 */ 210 if ( 211 && 212 && 208 if ( g_VBoxGuestIDC.u32Version == VMMDEV_VERSION 209 && RT_VALID_PTR(g_VBoxGuestIDC.u32Session) 210 && RT_VALID_PTR(g_VBoxGuestIDC.pfnServiceEP)) 213 211 { 214 212 pDriver->u32Session = g_VBoxGuestIDC.u32Session; … … 221 219 # else 222 220 uint32_t u32VMMDevVersion; 223 pDriver->pvOpaque = VBoxGuestIDCOpen 224 if ( 225 && 221 pDriver->pvOpaque = VBoxGuestIDCOpen(&u32VMMDevVersion); 222 if ( pDriver->pvOpaque 223 && u32VMMDevVersion == VMMDEV_VERSION) 226 224 return VINF_SUCCESS; 227 225 … … 232 230 233 231 # ifdef RT_OS_WINDOWS 234 static NTSTATUS vbglDriverIOCtlCompletion (IN PDEVICE_OBJECT DeviceObject, 235 IN PIRP Irp, 236 IN PVOID Context) 232 static NTSTATUS vbglDriverIOCtlCompletion(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp, IN PVOID Context) 237 233 { 238 234 Log(("VBGL completion %x\n", Irp)); 239 235 240 236 KEVENT *pEvent = (KEVENT *)Context; 241 KeSetEvent 237 KeSetEvent(pEvent, IO_NO_INCREMENT, FALSE); 242 238 243 239 return STATUS_MORE_PROCESSING_REQUIRED; … … 245 241 # endif 246 242 247 int vbglDriverIOCtl 243 int vbglDriverIOCtl(VBGLDRIVER *pDriver, uint32_t u32Function, void *pvData, uint32_t cbData) 248 244 { 249 245 Log(("vbglDriverIOCtl: pDriver: %p, Func: %x, pvData: %p, cbData: %d\n", pDriver, u32Function, pvData, cbData)); … … 252 248 KEVENT Event; 253 249 254 KeInitializeEvent 250 KeInitializeEvent(&Event, NotificationEvent, FALSE); 255 251 256 252 /* Have to use the IoAllocateIRP method because this code is generic and … … 259 255 * when APCs are disabled, for example. 260 256 */ 261 PIRP irp = IoAllocateIrp 257 PIRP irp = IoAllocateIrp(pDriver->pDeviceObject->StackSize, FALSE); 262 258 263 259 Log(("vbglDriverIOCtl: irp %p, IRQL = %d\n", irp, KeGetCurrentIrql())); … … 273 269 */ 274 270 275 PIO_STACK_LOCATION nextStack = IoGetNextIrpStackLocation 271 PIO_STACK_LOCATION nextStack = IoGetNextIrpStackLocation(irp); 276 272 277 273 nextStack->MajorFunction = IRP_MJ_DEVICE_CONTROL; … … 287 283 288 284 /* A completion routine is required to signal the Event. */ 289 IoSetCompletionRoutine 290 291 NTSTATUS rc = IoCallDriver 285 IoSetCompletionRoutine(irp, vbglDriverIOCtlCompletion, &Event, TRUE, TRUE, TRUE); 286 287 NTSTATUS rc = IoCallDriver(pDriver->pDeviceObject, irp); 292 288 293 289 if (NT_SUCCESS (rc)) 294 290 { 295 291 /* Wait the event to be signalled by the completion routine. */ 296 KeWaitForSingleObject (&Event, 297 Executive, 298 KernelMode, 299 FALSE, 300 NULL); 292 KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL); 301 293 302 294 rc = irp->IoStatus.Status; … … 305 297 } 306 298 307 IoFreeIrp 299 IoFreeIrp(irp); 308 300 309 301 if (rc != STATUS_SUCCESS) … … 331 323 } 332 324 333 void vbglDriverClose 325 void vbglDriverClose(VBGLDRIVER *pDriver) 334 326 { 335 327 # ifdef RT_OS_WINDOWS 336 328 Log(("vbglDriverClose pDeviceObject=%x\n", pDriver->pDeviceObject)); 337 ObDereferenceObject 329 ObDereferenceObject(pDriver->pFileObject); 338 330 pDriver->pFileObject = NULL; 339 331 pDriver->pDeviceObject = NULL; … … 343 335 344 336 # else 345 VBoxGuestIDCClose 337 VBoxGuestIDCClose(pDriver->pvOpaque); 346 338 pDriver->pvOpaque = NULL; 347 339 # endif -
TabularUnified trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR0LibCrOgl.cpp ¶
r58181 r58183 75 75 } 76 76 77 DECLVBGL(int) VbglR0CrCtlConConnect(HVBOXCRCTL hCtl, uint32_t *pu32ClientID)77 DECLVBGL(int) VbglR0CrCtlConConnect(HVBOXCRCTL hCtl, HGCMCLIENTID *pidClient) 78 78 { 79 79 VBoxGuestHGCMConnectInfo info; 80 80 int rc; 81 81 82 if (!hCtl || !p u32ClientID)82 if (!hCtl || !pidClient) 83 83 return VERR_INVALID_PARAMETER; 84 84 … … 93 93 { 94 94 Assert(info.u32ClientID); 95 *p u32ClientID= info.u32ClientID;95 *pidClient = info.u32ClientID; 96 96 return rc; 97 97 } … … 99 99 100 100 AssertRC(rc); 101 *p u32ClientID= 0;101 *pidClient = 0; 102 102 return rc; 103 103 } 104 104 105 DECLVBGL(int) VbglR0CrCtlConDisconnect(HVBOXCRCTL hCtl, uint32_t u32ClientID)105 DECLVBGL(int) VbglR0CrCtlConDisconnect(HVBOXCRCTL hCtl, HGCMCLIENTID idClient) 106 106 { 107 107 VBoxGuestHGCMDisconnectInfo info; 108 108 RT_ZERO(info); 109 info.u32ClientID = u32ClientID;109 info.u32ClientID = idClient; 110 110 return vbglDriverIOCtl(&hCtl->driver, VBOXGUEST_IOCTL_HGCM_DISCONNECT, &info, sizeof(info)); 111 111 } -
TabularUnified trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibAutoLogon.cpp ¶
r57358 r58183 53 53 if (s_enmLastStatus != VBoxGuestFacilityStatus_Failed) 54 54 { 55 int rc = VbglR3ReportAdditionsStatus(VBoxGuestFacilityType_AutoLogon, 56 enmStatus, 0 /* Flags */); 55 int rc = VbglR3ReportAdditionsStatus(VBoxGuestFacilityType_AutoLogon, enmStatus, 0 /* Flags */); 57 56 if (rc == VERR_NOT_SUPPORTED) 58 57 { … … 63 62 */ 64 63 #ifdef VBOX_WITH_GUEST_PROPS 65 uint32_t u32ClientId= 0;66 rc = VbglR3GuestPropConnect(& u32ClientId);64 HGCMCLIENTID idClient = 0; 65 rc = VbglR3GuestPropConnect(&idClient); 67 66 if (RT_SUCCESS(rc)) 68 67 { … … 87 86 */ 88 87 static const char s_szPath[] = "/VirtualBox/GuestInfo/OS/AutoLogonStatus"; 89 rc = VbglR3GuestPropWrite( u32ClientId, s_szPath, pszStatus, "TRANSRESET");88 rc = VbglR3GuestPropWrite(idClient, s_szPath, pszStatus, "TRANSRESET"); 90 89 if (rc == VERR_PARSE_ERROR) 91 rc = VbglR3GuestPropWrite( u32ClientId, s_szPath, pszStatus, "TRANSIENT");90 rc = VbglR3GuestPropWrite(idClient, s_szPath, pszStatus, "TRANSIENT"); 92 91 } 93 92 else 94 93 rc = VERR_INVALID_PARAMETER; 95 94 96 VbglR3GuestPropDisconnect( u32ClientId);95 VbglR3GuestPropDisconnect(idClient); 97 96 } 98 97 #endif -
TabularUnified trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibBalloon.cpp ¶
r57358 r58183 46 46 { 47 47 *pcChunks = Info.cBalloonChunks; 48 Assert(Info.fHandleInR3 == false || Info.fHandleInR3 == true ||RT_FAILURE(rc));48 Assert(Info.fHandleInR3 == (uint32_t)false || Info.fHandleInR3 == (uint32_t)true || RT_FAILURE(rc)); 49 49 *pfHandleInR3 = Info.fHandleInR3 != false; 50 50 } -
TabularUnified trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibClipboard.cpp ¶
r57358 r58183 39 39 * 40 40 * @returns VBox status code 41 * @param p u32ClientIdWhere to put the client id on success. The client id41 * @param pidClient Where to put the client id on success. The client id 42 42 * must be passed to all the other clipboard calls. 43 43 */ 44 VBGLR3DECL(int) VbglR3ClipboardConnect( uint32_t *pu32ClientId)44 VBGLR3DECL(int) VbglR3ClipboardConnect(HGCMCLIENTID *pidClient ) 45 45 { 46 46 VBoxGuestHGCMConnectInfo Info; … … 56 56 rc = Info.result; 57 57 if (RT_SUCCESS(rc)) 58 *p u32ClientId= Info.u32ClientID;58 *pidClient = Info.u32ClientID; 59 59 } 60 60 if (rc == VERR_HGCM_SERVICE_NOT_FOUND) … … 68 68 * 69 69 * @returns VBox status code. 70 * @param u32ClientIdThe client id returned by VbglR3ClipboardConnect().71 */ 72 VBGLR3DECL(int) VbglR3ClipboardDisconnect( uint32_t u32ClientId)70 * @param idClientId The client id returned by VbglR3ClipboardConnect(). 71 */ 72 VBGLR3DECL(int) VbglR3ClipboardDisconnect(HGCMCLIENTID idClient) 73 73 { 74 74 VBoxGuestHGCMDisconnectInfo Info; 75 75 Info.result = VERR_WRONG_ORDER; 76 Info.u32ClientID = u32ClientId;76 Info.u32ClientID = idClient; 77 77 78 78 int rc = vbglR3DoIOCtl(VBOXGUEST_IOCTL_HGCM_DISCONNECT, &Info, sizeof(Info)); … … 89 89 * 90 90 * @returns VBox status code. 91 * @param u32ClientIdThe client id returned by VbglR3ClipboardConnect().91 * @param idClient The client id returned by VbglR3ClipboardConnect(). 92 92 * @param pMsg Where to store the message id. 93 93 * @param pfFormats Where to store the format(s) the message applies to. 94 94 */ 95 VBGLR3DECL(int) VbglR3ClipboardGetHostMsg( uint32_t u32ClientId, uint32_t *pMsg, uint32_t *pfFormats)95 VBGLR3DECL(int) VbglR3ClipboardGetHostMsg(HGCMCLIENTID idClient, uint32_t *pMsg, uint32_t *pfFormats) 96 96 { 97 97 VBoxClipboardGetHostMsg Msg; 98 98 99 99 Msg.hdr.result = VERR_WRONG_ORDER; 100 Msg.hdr.u32ClientID = u32ClientId;100 Msg.hdr.u32ClientID = idClient; 101 101 Msg.hdr.u32Function = VBOX_SHARED_CLIPBOARD_FN_GET_HOST_MSG; 102 102 Msg.hdr.cParms = 2; … … 136 136 * @retval VINF_BUFFER_OVERFLOW If there is more data available than the caller provided buffer space for. 137 137 * 138 * @param u32ClientIdThe client id returned by VbglR3ClipboardConnect().138 * @param idClient The client id returned by VbglR3ClipboardConnect(). 139 139 * @param fFormat The format we're requesting the data in. 140 140 * @param pv Where to store the data. … … 142 142 * @param pcb The actual size of the host clipboard data. May be larger than cb. 143 143 */ 144 VBGLR3DECL(int) VbglR3ClipboardReadData( uint32_t u32ClientId, uint32_t fFormat, void *pv, uint32_t cb, uint32_t *pcb)144 VBGLR3DECL(int) VbglR3ClipboardReadData(HGCMCLIENTID idClient, uint32_t fFormat, void *pv, uint32_t cb, uint32_t *pcb) 145 145 { 146 146 VBoxClipboardReadData Msg; 147 147 148 148 Msg.hdr.result = VERR_WRONG_ORDER; 149 Msg.hdr.u32ClientID = u32ClientId;149 Msg.hdr.u32ClientID = idClient; 150 150 Msg.hdr.u32Function = VBOX_SHARED_CLIPBOARD_FN_READ_DATA; 151 151 Msg.hdr.cParms = 3; … … 179 179 * 180 180 * @returns VBox status code. 181 * @param u32ClientIdThe client id returned by VbglR3ClipboardConnect().181 * @param idClient The client id returned by VbglR3ClipboardConnect(). 182 182 * @param fFormats The formats to advertise. 183 183 */ 184 VBGLR3DECL(int) VbglR3ClipboardReportFormats( uint32_t u32ClientId, uint32_t fFormats)184 VBGLR3DECL(int) VbglR3ClipboardReportFormats(HGCMCLIENTID idClient, uint32_t fFormats) 185 185 { 186 186 VBoxClipboardFormats Msg; 187 187 188 188 Msg.hdr.result = VERR_WRONG_ORDER; 189 Msg.hdr.u32ClientID = u32ClientId;189 Msg.hdr.u32ClientID = idClient; 190 190 Msg.hdr.u32Function = VBOX_SHARED_CLIPBOARD_FN_FORMATS; 191 191 Msg.hdr.cParms = 1; … … 206 206 * 207 207 * @returns VBox status code. 208 * @param u32ClientIdThe client id returned by VbglR3ClipboardConnect().208 * @param idClient The client id returned by VbglR3ClipboardConnect(). 209 209 * @param fFormat The format of the data. 210 210 * @param pv The data. 211 211 * @param cb The size of the data. 212 212 */ 213 VBGLR3DECL(int) VbglR3ClipboardWriteData( uint32_t u32ClientId, uint32_t fFormat, void *pv, uint32_t cb)213 VBGLR3DECL(int) VbglR3ClipboardWriteData(HGCMCLIENTID idClient, uint32_t fFormat, void *pv, uint32_t cb) 214 214 { 215 215 VBoxClipboardWriteData Msg; 216 216 Msg.hdr.result = VERR_WRONG_ORDER; 217 Msg.hdr.u32ClientID = u32ClientId;217 Msg.hdr.u32ClientID = idClient; 218 218 Msg.hdr.u32Function = VBOX_SHARED_CLIPBOARD_FN_WRITE_DATA; 219 219 Msg.hdr.cParms = 2; -
TabularUnified trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibDragAndDrop.cpp ¶
r57776 r58183 1488 1488 /* Include total bytes of all file paths, 1489 1489 * file sizes etc. */ 1490 lstURI.TotalBytes());1490 (uint32_t)lstURI.TotalBytes()); 1491 1491 } 1492 1492 -
TabularUnified trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibGuestProp.cpp ¶
r57407 r58183 124 124 * @returns VBox status code 125 125 * @returns VERR_NOT_SUPPORTED if guest properties are not available on the host. 126 * @param p u32ClientId Where to put the client id on success. The client id126 * @param pidClient Where to put the client ID on success. The client ID 127 127 * must be passed to all the other calls to the service. 128 128 */ 129 VBGLR3DECL(int) VbglR3GuestPropConnect( uint32_t *pu32ClientId)129 VBGLR3DECL(int) VbglR3GuestPropConnect(HGCMCLIENTID *pidClient) 130 130 { 131 131 VBoxGuestHGCMConnectInfo Info; … … 141 141 rc = Info.result; 142 142 if (RT_SUCCESS(rc)) 143 *p u32ClientId= Info.u32ClientID;143 *pidClient = Info.u32ClientID; 144 144 if (rc == VERR_NOT_IMPLEMENTED || rc == VERR_HGCM_SERVICE_NOT_FOUND) 145 145 rc = VERR_NOT_SUPPORTED; … … 153 153 * 154 154 * @returns VBox status code. 155 * @param u32ClientIdThe client id returned by VbglR3InfoSvcConnect().156 */ 157 VBGLR3DECL(int) VbglR3GuestPropDisconnect( uint32_t u32ClientId)155 * @param idClient The client id returned by VbglR3InfoSvcConnect(). 156 */ 157 VBGLR3DECL(int) VbglR3GuestPropDisconnect(HGCMCLIENTID idClient) 158 158 { 159 159 VBoxGuestHGCMDisconnectInfo Info; 160 160 Info.result = VERR_WRONG_ORDER; 161 Info.u32ClientID = u32ClientId;161 Info.u32ClientID = idClient; 162 162 163 163 int rc = vbglR3DoIOCtl(VBOXGUEST_IOCTL_HGCM_DISCONNECT, &Info, sizeof(Info)); … … 172 172 * 173 173 * @returns VBox status code. 174 * @param u32ClientIdThe client id returned by VbglR3InvsSvcConnect().174 * @param idClient The client id returned by VbglR3InvsSvcConnect(). 175 175 * @param pszName The property to save to. Utf8 176 176 * @param pszValue The value to store. Utf8. If this is NULL then … … 178 178 * @param pszFlags The flags for the property 179 179 */ 180 VBGLR3DECL(int) VbglR3GuestPropWrite( uint32_t u32ClientId, const char *pszName, const char *pszValue, const char *pszFlags)180 VBGLR3DECL(int) VbglR3GuestPropWrite(HGCMCLIENTID idClient, const char *pszName, const char *pszValue, const char *pszFlags) 181 181 { 182 182 int rc; … … 187 187 188 188 Msg.hdr.result = VERR_WRONG_ORDER; 189 Msg.hdr.u32ClientID = u32ClientId;189 Msg.hdr.u32ClientID = idClient; 190 190 Msg.hdr.u32Function = SET_PROP_VALUE; 191 191 Msg.hdr.cParms = 3; … … 202 202 203 203 Msg.hdr.result = VERR_WRONG_ORDER; 204 Msg.hdr.u32ClientID = u32ClientId;204 Msg.hdr.u32ClientID = idClient; 205 205 Msg.hdr.u32Function = DEL_PROP; 206 206 Msg.hdr.cParms = 1; … … 219 219 * @returns VBox status code. 220 220 * 221 * @param u32ClientIdThe client id returned by VbglR3InvsSvcConnect().221 * @param idClient The client id returned by VbglR3InvsSvcConnect(). 222 222 * @param pszName The property to save to. Must be valid UTF-8. 223 223 * @param pszValue The value to store. Must be valid UTF-8. … … 227 227 * property's flags field will be left unchanged 228 228 */ 229 VBGLR3DECL(int) VbglR3GuestPropWriteValue( uint32_t u32ClientId, const char *pszName, const char *pszValue)229 VBGLR3DECL(int) VbglR3GuestPropWriteValue(HGCMCLIENTID idClient, const char *pszName, const char *pszValue) 230 230 { 231 231 int rc; … … 236 236 237 237 Msg.hdr.result = VERR_WRONG_ORDER; 238 Msg.hdr.u32ClientID = u32ClientId;238 Msg.hdr.u32ClientID = idClient; 239 239 Msg.hdr.u32Function = SET_PROP_VALUE; 240 240 Msg.hdr.cParms = 2; … … 250 250 251 251 Msg.hdr.result = VERR_WRONG_ORDER; 252 Msg.hdr.u32ClientID = u32ClientId;252 Msg.hdr.u32ClientID = idClient; 253 253 Msg.hdr.u32Function = DEL_PROP; 254 254 Msg.hdr.cParms = 1; … … 267 267 * @returns The same as VbglR3GuestPropWriteValue with the addition of VERR_NO_STR_MEMORY. 268 268 * 269 * @param u32ClientIdThe client ID returned by VbglR3InvsSvcConnect().269 * @param idClient The client ID returned by VbglR3InvsSvcConnect(). 270 270 * @param pszName The property to save to. Must be valid UTF-8. 271 271 * @param pszValueFormat The value format. This must be valid UTF-8 when fully formatted. 272 272 * @param va The format arguments. 273 273 */ 274 VBGLR3DECL(int) VbglR3GuestPropWriteValueV( uint32_t u32ClientId, const char *pszName, const char *pszValueFormat, va_list va)274 VBGLR3DECL(int) VbglR3GuestPropWriteValueV(HGCMCLIENTID idClient, const char *pszName, const char *pszValueFormat, va_list va) 275 275 { 276 276 /* … … 281 281 if (RTStrAPrintfV(&pszValue, pszValueFormat, va) >= 0) 282 282 { 283 rc = VbglR3GuestPropWriteValue( u32ClientId, pszName, pszValue);283 rc = VbglR3GuestPropWriteValue(idClient, pszName, pszValue); 284 284 RTStrFree(pszValue); 285 285 } … … 293 293 * @returns The same as VbglR3GuestPropWriteValue with the addition of VERR_NO_STR_MEMORY. 294 294 * 295 * @param u32ClientIdThe client ID returned by VbglR3InvsSvcConnect().295 * @param idClient The client ID returned by VbglR3InvsSvcConnect(). 296 296 * @param pszName The property to save to. Must be valid UTF-8. 297 297 * @param pszValueFormat The value format. This must be valid UTF-8 when fully formatted. 298 298 * @param ... The format arguments. 299 299 */ 300 VBGLR3DECL(int) VbglR3GuestPropWriteValueF( uint32_t u32ClientId, const char *pszName, const char *pszValueFormat, ...)300 VBGLR3DECL(int) VbglR3GuestPropWriteValueF(HGCMCLIENTID idClient, const char *pszName, const char *pszValueFormat, ...) 301 301 { 302 302 va_list va; 303 303 va_start(va, pszValueFormat); 304 int rc = VbglR3GuestPropWriteValueV( u32ClientId, pszName, pszValueFormat, va);304 int rc = VbglR3GuestPropWriteValueV(idClient, pszName, pszValueFormat, va); 305 305 va_end(va); 306 306 return rc; … … 319 319 * @retval VERR_NOT_FOUND if the key wasn't found. 320 320 * 321 * @param u32ClientIdThe client id returned by VbglR3GuestPropConnect().321 * @param idClient The client id returned by VbglR3GuestPropConnect(). 322 322 * @param pszName The value to read. Utf8 323 323 * @param pvBuf A scratch buffer to store the data retrieved into. … … 332 332 * Optional. 333 333 */ 334 VBGLR3DECL(int) VbglR3GuestPropRead( uint32_t u32ClientId, const char *pszName,334 VBGLR3DECL(int) VbglR3GuestPropRead(HGCMCLIENTID idClient, const char *pszName, 335 335 void *pvBuf, uint32_t cbBuf, 336 336 char **ppszValue, uint64_t *pu64Timestamp, … … 344 344 345 345 Msg.hdr.result = VERR_WRONG_ORDER; 346 Msg.hdr.u32ClientID = u32ClientId;346 Msg.hdr.u32ClientID = idClient; 347 347 Msg.hdr.u32Function = GET_PROP; 348 348 Msg.hdr.cParms = 4; … … 415 415 * property value. 416 416 * 417 * @param u32ClientIdThe client id returned by VbglR3GuestPropConnect().417 * @param idClient The client id returned by VbglR3GuestPropConnect(). 418 418 * @param pszName The value to read. Must be valid UTF-8. 419 419 * @param ppszValue Where to store the pointer to the value returned. … … 421 421 * on failure. 422 422 */ 423 VBGLR3DECL(int) VbglR3GuestPropReadValueAlloc(uint32_t u32ClientId, 424 const char *pszName, 425 char **ppszValue) 423 VBGLR3DECL(int) VbglR3GuestPropReadValueAlloc(HGCMCLIENTID idClient, const char *pszName, char **ppszValue) 426 424 { 427 425 /* … … 449 447 { 450 448 pvBuf = pvTmpBuf; 451 rc = VbglR3GuestPropRead( u32ClientId, pszName, pvBuf, cchBuf,449 rc = VbglR3GuestPropRead(idClient, pszName, pvBuf, cchBuf, 452 450 &pszValue, NULL, NULL, &cchBuf); 453 451 } … … 497 495 * needed to hold the value and the value being updated. 498 496 * 499 * @param u32ClientIdThe client id returned by VbglR3GuestPropConnect().497 * @param idClient The client id returned by VbglR3GuestPropConnect(). 500 498 * @param pszName The value to read. Utf8 501 499 * @param pszValue Where to store the value retrieved. … … 504 502 * the buffer supplied is too small. Optional. 505 503 */ 506 VBGLR3DECL(int) VbglR3GuestPropReadValue( uint32_t u32ClientId, const char *pszName,504 VBGLR3DECL(int) VbglR3GuestPropReadValue(HGCMCLIENTID idClient, const char *pszName, 507 505 char *pszValue, uint32_t cchValue, 508 506 uint32_t *pcchValueActual) … … 510 508 void *pvBuf = pszValue; 511 509 uint32_t cchValueActual; 512 int rc = VbglR3GuestPropRead(u32ClientId, pszName, pvBuf, cchValue, 513 &pszValue, NULL, NULL, &cchValueActual); 510 int rc = VbglR3GuestPropRead(idClient, pszName, pvBuf, cchValue, &pszValue, NULL, NULL, &cchValueActual); 514 511 if (pcchValueActual != NULL) 515 512 *pcchValueActual = cchValueActual; … … 531 528 * @returns IPRT error code in other cases, and pchBufActual is undefined. 532 529 * 533 * @param u32ClientIdThe client ID returned by VbglR3GuestPropConnect530 * @param idClient The client ID returned by VbglR3GuestPropConnect 534 531 * @param paszPatterns A packed array of zero terminated strings, terminated 535 532 * by an empty string. … … 540 537 * small. 541 538 */ 542 VBGLR3DECL(int) VbglR3GuestPropEnumRaw( uint32_t u32ClientId,539 VBGLR3DECL(int) VbglR3GuestPropEnumRaw(HGCMCLIENTID idClient, 543 540 const char *pszzPatterns, 544 541 char *pcBuf, … … 549 546 550 547 Msg.hdr.result = VERR_WRONG_ORDER; 551 Msg.hdr.u32ClientID = u32ClientId;548 Msg.hdr.u32ClientID = idClient; 552 549 Msg.hdr.u32Function = ENUM_PROPS; 553 550 Msg.hdr.cParms = 3; … … 593 590 * uninitialised 594 591 * 595 * @param u32ClientIdThe client id returned by VbglR3InfoSvcConnect().592 * @param idClient The client id returned by VbglR3InfoSvcConnect(). 596 593 * @param papszPatterns The patterns against which the properties are 597 594 * matched. Pass NULL if everything should be matched. … … 617 614 * figure out when to stop. 618 615 */ 619 VBGLR3DECL(int) VbglR3GuestPropEnum( uint32_t u32ClientId,616 VBGLR3DECL(int) VbglR3GuestPropEnum(HGCMCLIENTID idClient, 620 617 char const * const *papszPatterns, 621 618 uint32_t cPatterns, … … 664 661 break; 665 662 } 666 rc = VbglR3GuestPropEnumRaw( u32ClientId, pszzPatterns, pchBuf, cbBuf, &cbBuf);663 rc = VbglR3GuestPropEnumRaw(idClient, pszzPatterns, pchBuf, cbBuf, &cbBuf); 667 664 if (rc != VERR_BUFFER_OVERFLOW) 668 665 break; … … 809 806 * 810 807 * @returns VBox status code. 811 * @param u32ClientIdThe client id returned by VbglR3InvsSvcConnect().808 * @param idClient The client id returned by VbglR3InvsSvcConnect(). 812 809 * @param pszName The property to delete. Utf8 813 810 */ 814 VBGLR3DECL(int) VbglR3GuestPropDelete( uint32_t u32ClientId, const char *pszName)811 VBGLR3DECL(int) VbglR3GuestPropDelete(HGCMCLIENTID idClient, const char *pszName) 815 812 { 816 813 AssertPtrReturn(pszName, VERR_INVALID_POINTER); … … 819 816 820 817 Msg.hdr.result = VERR_WRONG_ORDER; 821 Msg.hdr.u32ClientID = u32ClientId;818 Msg.hdr.u32ClientID = idClient; 822 819 Msg.hdr.u32Function = DEL_PROP; 823 820 Msg.hdr.cParms = 1; … … 839 836 * See also VbglR3GuestPropEnum. 840 837 * 841 * @param u32ClientIdThe client id returned by VbglR3InfoSvcConnect().838 * @param idClient The client id returned by VbglR3InfoSvcConnect(). 842 839 * @param papszPatterns The patterns against which the properties are 843 840 * matched. Pass NULL if everything should be matched. … … 845 842 * match everything. 846 843 */ 847 VBGLR3DECL(int) VbglR3GuestPropDelSet( uint32_t u32ClientId,844 VBGLR3DECL(int) VbglR3GuestPropDelSet(HGCMCLIENTID idClient, 848 845 const char * const *papszPatterns, 849 846 uint32_t cPatterns) … … 852 849 char const *pszName, *pszValue, *pszFlags; 853 850 uint64_t pu64Timestamp; 854 int rc = VbglR3GuestPropEnum( u32ClientId,851 int rc = VbglR3GuestPropEnum(idClient, 855 852 (char **)papszPatterns, /** @todo fix this cast. */ 856 853 cPatterns, … … 863 860 while (RT_SUCCESS(rc) && pszName) 864 861 { 865 rc = VbglR3GuestPropWriteValue( u32ClientId, pszName, NULL);862 rc = VbglR3GuestPropWriteValue(idClient, pszName, NULL); 866 863 if (RT_FAILURE(rc)) 867 864 break; … … 895 892 * @retval VERR_TIMEOUT if a timeout occurred before a notification was seen. 896 893 * 897 * @param u32ClientIdThe client id returned by VbglR3GuestPropConnect().894 * @param idClient The client id returned by VbglR3GuestPropConnect(). 898 895 * @param pszPatterns The patterns that the property names must matchfor 899 896 * the change to be reported. … … 915 912 * Optional. 916 913 */ 917 VBGLR3DECL(int) VbglR3GuestPropWait( uint32_t u32ClientId,914 VBGLR3DECL(int) VbglR3GuestPropWait(HGCMCLIENTID idClient, 918 915 const char *pszPatterns, 919 916 void *pvBuf, uint32_t cbBuf, … … 931 928 Msg.hdr.fInterruptible = true; 932 929 Msg.hdr.info.result = VERR_WRONG_ORDER; 933 Msg.hdr.info.u32ClientID = u32ClientId;930 Msg.hdr.info.u32ClientID = idClient; 934 931 Msg.hdr.info.u32Function = GET_NOTIFICATION; 935 932 Msg.hdr.info.cParms = 4; -
TabularUnified trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibHostVersion.cpp ¶
r57358 r58183 46 46 * @returns VBox status code 47 47 * 48 * @param u32ClientIdThe client id returned by48 * @param idClient The client id returned by 49 49 * VbglR3InfoSvcConnect(). 50 50 * @param pfUpdate Receives pointer to boolean flag indicating … … 59 59 * NULL. 60 60 */ 61 VBGLR3DECL(int) VbglR3HostVersionCheckForUpdate( uint32_t u32ClientId, bool *pfUpdate, char **ppszHostVersion, char **ppszGuestVersion)61 VBGLR3DECL(int) VbglR3HostVersionCheckForUpdate(HGCMCLIENTID idClient, bool *pfUpdate, char **ppszHostVersion, char **ppszGuestVersion) 62 62 { 63 Assert( u32ClientId> 0);63 Assert(idClient > 0); 64 64 AssertPtr(pfUpdate); 65 65 AssertPtr(ppszHostVersion); … … 75 75 /* Do we need to do all this stuff? */ 76 76 char *pszCheckHostVersion; 77 int rc = VbglR3GuestPropReadValueAlloc( u32ClientId, "/VirtualBox/GuestAdd/CheckHostVersion", &pszCheckHostVersion);77 int rc = VbglR3GuestPropReadValueAlloc(idClient, "/VirtualBox/GuestAdd/CheckHostVersion", &pszCheckHostVersion); 78 78 if (RT_FAILURE(rc)) 79 79 { … … 100 100 { 101 101 /* Look up host version */ 102 rc = VbglR3GuestPropReadValueAlloc( u32ClientId, "/VirtualBox/HostInfo/VBoxVer", ppszHostVersion);102 rc = VbglR3GuestPropReadValueAlloc(idClient, "/VirtualBox/HostInfo/VBoxVer", ppszHostVersion); 103 103 if (RT_FAILURE(rc)) 104 104 { … … 111 111 /* Get last checked host version */ 112 112 char *pszLastCheckedHostVersion; 113 rc = VbglR3HostVersionLastCheckedLoad( u32ClientId, &pszLastCheckedHostVersion);113 rc = VbglR3HostVersionLastCheckedLoad(idClient, &pszLastCheckedHostVersion); 114 114 if (RT_SUCCESS(rc)) 115 115 { … … 173 173 * @returns VBox status code. 174 174 * 175 * @param u32ClientIdThe client id returned by VbglR3InfoSvcConnect().175 * @param idClient The client id returned by VbglR3InfoSvcConnect(). 176 176 * @param ppszVer Receives pointer of allocated version string. 177 177 * The returned pointer must be freed using RTStrFree() on VINF_SUCCESS. 178 178 */ 179 VBGLR3DECL(int) VbglR3HostVersionLastCheckedLoad( uint32_t u32ClientId, char **ppszVer)179 VBGLR3DECL(int) VbglR3HostVersionLastCheckedLoad(HGCMCLIENTID idClient, char **ppszVer) 180 180 { 181 Assert( u32ClientId> 0);181 Assert(idClient > 0); 182 182 AssertPtr(ppszVer); 183 return VbglR3GuestPropReadValueAlloc( u32ClientId, "/VirtualBox/GuestAdd/HostVerLastChecked", ppszVer);183 return VbglR3GuestPropReadValueAlloc(idClient, "/VirtualBox/GuestAdd/HostVerLastChecked", ppszVer); 184 184 } 185 185 … … 190 190 * @returns VBox status code. 191 191 * 192 * @param u32ClientIdThe client id returned by VbglR3InfoSvcConnect().192 * @param idClient The client id returned by VbglR3InfoSvcConnect(). 193 193 * @param pszVer Pointer to version string to store. 194 194 */ 195 VBGLR3DECL(int) VbglR3HostVersionLastCheckedStore( uint32_t u32ClientId, const char *pszVer)195 VBGLR3DECL(int) VbglR3HostVersionLastCheckedStore(HGCMCLIENTID idClient, const char *pszVer) 196 196 { 197 Assert( u32ClientId> 0);197 Assert(idClient > 0); 198 198 AssertPtr(pszVer); 199 return VbglR3GuestPropWriteValue( u32ClientId, "/VirtualBox/GuestAdd/HostVerLastChecked", pszVer);199 return VbglR3GuestPropWriteValue(idClient, "/VirtualBox/GuestAdd/HostVerLastChecked", pszVer); 200 200 } 201 -
TabularUnified trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibMouse.cpp ¶
r57358 r58183 73 73 VBGLR3DECL(int) VbglR3SetMouseStatus(uint32_t fFeatures) 74 74 { 75 return vbglR3DoIOCtl(VBOXGUEST_IOCTL_SET_MOUSE_STATUS, &fFeatures, 76 sizeof(fFeatures)); 75 return vbglR3DoIOCtl(VBOXGUEST_IOCTL_SET_MOUSE_STATUS, &fFeatures, sizeof(fFeatures)); 77 76 } 78 77 -
TabularUnified trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibSharedFolders.cpp ¶
r57358 r58183 44 44 * 45 45 * @returns VBox status code 46 * @param p u32ClientIdWhere to put the client id on success. The client id46 * @param pidClient Where to put the client id on success. The client id 47 47 * must be passed to all the other calls to the service. 48 48 */ 49 VBGLR3DECL(int) VbglR3SharedFolderConnect( uint32_t *pu32ClientId)49 VBGLR3DECL(int) VbglR3SharedFolderConnect(HGCMCLIENTID *pidClient) 50 50 { 51 51 VBoxGuestHGCMConnectInfo Info; … … 61 61 rc = Info.result; 62 62 if (RT_SUCCESS(rc)) 63 *p u32ClientId= Info.u32ClientID;63 *pidClient = Info.u32ClientID; 64 64 } 65 65 return rc; … … 71 71 * 72 72 * @returns VBox status code. 73 * @param u32ClientIdThe client id returned by VbglR3InfoSvcConnect().74 */ 75 VBGLR3DECL(int) VbglR3SharedFolderDisconnect( uint32_t u32ClientId)73 * @param idClient The client id returned by VbglR3InfoSvcConnect(). 74 */ 75 VBGLR3DECL(int) VbglR3SharedFolderDisconnect(HGCMCLIENTID idClient) 76 76 { 77 77 VBoxGuestHGCMDisconnectInfo Info; 78 78 Info.result = VERR_WRONG_ORDER; 79 Info.u32ClientID = u32ClientId;79 Info.u32ClientID = idClient; 80 80 81 81 int rc = vbglR3DoIOCtl(VBOXGUEST_IOCTL_HGCM_DISCONNECT, &Info, sizeof(Info)); … … 90 90 * 91 91 * @returns True if shared folder exists, false if not. 92 * @param u32ClientIdThe client id returned by VbglR3InfoSvcConnect().92 * @param idClient The client id returned by VbglR3InfoSvcConnect(). 93 93 * @param pszShareName Shared folder name to check. 94 94 */ 95 VBGLR3DECL(bool) VbglR3SharedFolderExists( uint32_t u32ClientId, const char *pszShareName)95 VBGLR3DECL(bool) VbglR3SharedFolderExists(HGCMCLIENTID idClient, const char *pszShareName) 96 96 { 97 97 AssertPtr(pszShareName); … … 102 102 /** @todo Use some caching here? */ 103 103 bool fFound = false; 104 int rc = VbglR3SharedFolderGetMappings(u32ClientId, true /* Only process auto-mounted folders */, 105 &paMappings, &cMappings); 104 int rc = VbglR3SharedFolderGetMappings(idClient, true /* Only process auto-mounted folders */, &paMappings, &cMappings); 106 105 if (RT_SUCCESS(rc)) 107 106 { … … 109 108 { 110 109 char *pszName = NULL; 111 rc = VbglR3SharedFolderGetName( u32ClientId, paMappings[i].u32Root, &pszName);110 rc = VbglR3SharedFolderGetName(idClient, paMappings[i].u32Root, &pszName); 112 111 if ( RT_SUCCESS(rc) 113 112 && *pszName) … … 128 127 * 129 128 * @returns VBox status code. 130 * @param u32ClientIdThe client id returned by VbglR3SharedFolderConnect().129 * @param idClient The client id returned by VbglR3SharedFolderConnect(). 131 130 * @param fAutoMountOnly Flag whether only auto-mounted shared folders 132 131 * should be reported. … … 135 134 * @param pcMappings The number of mappings returned in @a ppaMappings. 136 135 */ 137 VBGLR3DECL(int) VbglR3SharedFolderGetMappings( uint32_t u32ClientId, bool fAutoMountOnly,136 VBGLR3DECL(int) VbglR3SharedFolderGetMappings(HGCMCLIENTID idClient, bool fAutoMountOnly, 138 137 PVBGLR3SHAREDFOLDERMAPPING *ppaMappings, uint32_t *pcMappings) 139 138 { … … 147 146 148 147 Msg.callInfo.result = VERR_WRONG_ORDER; 149 Msg.callInfo.u32ClientID = u32ClientId;148 Msg.callInfo.u32ClientID = idClient; 150 149 Msg.callInfo.u32Function = SHFL_FN_QUERY_MAPPINGS; 151 150 Msg.callInfo.cParms = 3; … … 228 227 * 229 228 * @returns VBox status code. 230 * @param u32ClientIdThe client id returned by VbglR3InvsSvcConnect().229 * @param idClient The client id returned by VbglR3InvsSvcConnect(). 231 230 * @param u32Root Root ID of shared folder to get the name for. 232 231 * @param ppszName Where to return the name string. This shall be 233 232 * freed by calling RTStrFree. 234 233 */ 235 VBGLR3DECL(int) VbglR3SharedFolderGetName( uint32_t u32ClientId, uint32_t u32Root, char **ppszName)234 VBGLR3DECL(int) VbglR3SharedFolderGetName(HGCMCLIENTID idClient, uint32_t u32Root, char **ppszName) 236 235 { 237 236 AssertPtr(ppszName); … … 240 239 241 240 Msg.callInfo.result = VERR_WRONG_ORDER; 242 Msg.callInfo.u32ClientID = u32ClientId;241 Msg.callInfo.u32ClientID = idClient; 243 242 Msg.callInfo.u32Function = SHFL_FN_QUERY_MAP_NAME; 244 243 Msg.callInfo.cParms = 2; … … 288 287 int rc; 289 288 #ifdef VBOX_WITH_GUEST_PROPS 290 uint32_t u32ClientIdGuestProp;291 rc = VbglR3GuestPropConnect(& u32ClientIdGuestProp);292 if (RT_SUCCESS(rc)) 293 { 294 rc = VbglR3GuestPropReadValueAlloc( u32ClientIdGuestProp, "/VirtualBox/GuestAdd/SharedFolders/MountPrefix", ppszPrefix);289 HGCMCLIENTID idClientGuestProp; 290 rc = VbglR3GuestPropConnect(&idClientGuestProp); 291 if (RT_SUCCESS(rc)) 292 { 293 rc = VbglR3GuestPropReadValueAlloc(idClientGuestProp, "/VirtualBox/GuestAdd/SharedFolders/MountPrefix", ppszPrefix); 295 294 if (rc == VERR_NOT_FOUND) /* No prefix set? Then set the default. */ 296 295 { … … 299 298 #ifdef VBOX_WITH_GUEST_PROPS 300 299 } 301 VbglR3GuestPropDisconnect( u32ClientIdGuestProp);300 VbglR3GuestPropDisconnect(idClientGuestProp); 302 301 } 303 302 #endif … … 320 319 int rc; 321 320 #ifdef VBOX_WITH_GUEST_PROPS 322 uint32_t u32ClientIdGuestProp;323 rc = VbglR3GuestPropConnect(& u32ClientIdGuestProp);324 if (RT_SUCCESS(rc)) 325 { 326 rc = VbglR3GuestPropReadValueAlloc( u32ClientIdGuestProp, "/VirtualBox/GuestAdd/SharedFolders/MountDir", ppszDir);327 VbglR3GuestPropDisconnect( u32ClientIdGuestProp);321 HGCMCLIENTID idClientGuestProp; 322 rc = VbglR3GuestPropConnect(&idClientGuestProp); 323 if (RT_SUCCESS(rc)) 324 { 325 rc = VbglR3GuestPropReadValueAlloc(idClientGuestProp, "/VirtualBox/GuestAdd/SharedFolders/MountDir", ppszDir); 326 VbglR3GuestPropDisconnect(idClientGuestProp); 328 327 } 329 328 #endif -
TabularUnified trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibVideo.cpp ¶
r58154 r58183 314 314 315 315 int rc, rc2 = VERR_UNRESOLVED_ERROR; 316 uint32_t u32ClientId= 0;316 HGCMCLIENTID idClient = 0; 317 317 const char *pszPattern = VIDEO_PROP_PREFIX"*"; 318 318 PVBGLR3GUESTPROPENUM pHandle = NULL; … … 321 321 322 322 AssertPtrReturn(pcScreen, VERR_INVALID_POINTER); 323 rc = VbglR3GuestPropConnect(&u32ClientId); 324 if (RT_SUCCESS(rc)) 325 rc = VbglR3GuestPropEnum(u32ClientId, &pszPattern, 1, &pHandle, 326 &pszName, NULL, NULL, NULL); 323 rc = VbglR3GuestPropConnect(&idClient); 324 if (RT_SUCCESS(rc)) 325 rc = VbglR3GuestPropEnum(idClient, &pszPattern, 1, &pHandle, &pszName, NULL, NULL, NULL); 327 326 if (u32ClientId != 0) 328 327 rc2 = VbglR3GuestPropDisconnect(u32ClientId); … … 333 332 uint32_t cScreen; 334 333 335 rc = RTStrToUInt32Full(pszName + sizeof(VIDEO_PROP_PREFIX) - 1, 10, 336 &cScreen); 334 rc = RTStrToUInt32Full(pszName + sizeof(VIDEO_PROP_PREFIX) - 1, 10, &cScreen); 337 335 if (RT_SUCCESS(rc)) /* There may be similar properties with text. */ 338 336 cHighestScreen = RT_MAX(cHighestScreen, cScreen); … … 366 364 using namespace guestProp; 367 365 368 uint32_t u32ClientId= 0;366 HGCMCLIENTID idClient = 0; 369 367 unsigned cx2, cy2, cBits2, x2, y2, cHighestScreen, cHighestScreen2; 370 368 bool fEnabled2; … … 374 372 rc = VbglR3VideoModeGetHighestSavedScreen(&cHighestScreen); 375 373 if (RT_SUCCESS(rc)) 376 rc = VbglR3GuestPropConnect(& u32ClientId);374 rc = VbglR3GuestPropConnect(&idClient); 377 375 if (RT_SUCCESS(rc)) 378 376 { … … 382 380 RTStrPrintf(szModeParms, sizeof(szModeParms), "%ux%ux%u,%ux%u,%u", cx, cy, cBits, x, y, (unsigned) fEnabled); 383 381 384 rc = VbglR3GuestPropWriteValue( u32ClientId, szModeName, szModeParms);382 rc = VbglR3GuestPropWriteValue(idClient, szModeName, szModeParms); 385 383 /* Write out the mode using the legacy name too, in case the user 386 384 * re-installs older Additions. */ … … 388 386 { 389 387 RTStrPrintf(szModeParms, sizeof(szModeParms), "%ux%ux%u", cx, cy, cBits); 390 VbglR3GuestPropWriteValue( u32ClientId, VIDEO_PROP_PREFIX "SavedMode", szModeParms);388 VbglR3GuestPropWriteValue(idClient, VIDEO_PROP_PREFIX "SavedMode", szModeParms); 391 389 } 392 390 } 393 if ( u32ClientId!= 0)394 rc2 = VbglR3GuestPropDisconnect( u32ClientId);391 if (idClient != 0) 392 rc2 = VbglR3GuestPropDisconnect(idClient); 395 393 if (rc == VINF_PERMISSION_DENIED) 396 394 return rc; … … 440 438 using namespace guestProp; 441 439 442 /*443 * First we retrieve the video mode which is saved as a string in the444 * guest property store.445 */440 /* 441 * First we retrieve the video mode which is saved as a string in the 442 * guest property store. 443 */ 446 444 /* The buffer for VbglR3GuestPropReadValue. If this is too small then 447 445 * something is wrong with the data stored in the property. */ 448 446 char szModeParms[1024]; 449 uint32_t u32ClientId= 0;447 HGCMCLIENTID idClient = 0; 450 448 int cMatches; 451 449 unsigned cx, cy, cBits; … … 456 454 int rc2 = VERR_UNRESOLVED_ERROR; 457 455 458 rc = VbglR3GuestPropConnect(& u32ClientId);456 rc = VbglR3GuestPropConnect(&idClient); 459 457 if (RT_SUCCESS(rc)) 460 458 { … … 462 460 char szModeName[MAX_NAME_LEN]; 463 461 RTStrPrintf(szModeName, sizeof(szModeName), VIDEO_PROP_PREFIX "%u", idScreen); 464 rc = VbglR3GuestPropReadValue(u32ClientId, szModeName, szModeParms, 465 sizeof(szModeParms), NULL); 462 rc = VbglR3GuestPropReadValue(idClient, szModeName, szModeParms, sizeof(szModeParms), NULL); 466 463 /* Try legacy single screen name. */ 467 464 if (rc == VERR_NOT_FOUND && idScreen == 0) 468 rc = VbglR3GuestPropReadValue( u32ClientId,465 rc = VbglR3GuestPropReadValue(idClient, 469 466 VIDEO_PROP_PREFIX"SavedMode", 470 467 szModeParms, sizeof(szModeParms), 471 468 NULL); 472 469 } 473 if ( u32ClientId!= 0)474 rc2 = VbglR3GuestPropDisconnect( u32ClientId);470 if (idClient != 0) 471 rc2 = VbglR3GuestPropDisconnect(idClient); 475 472 if (RT_SUCCESS(rc)) 476 473 rc = rc2; 477 474 478 /*479 * Now we convert the string returned to numeric values.480 */475 /* 476 * Now we convert the string returned to numeric values. 477 */ 481 478 if (RT_SUCCESS(rc)) 482 479 { 483 480 char c1, c2; 484 cMatches = sscanf(szModeParms, "%5ux%5ux%2u%c%5ux%5u,%1u%c", &cx, &cy, &cBits, 485 &c1, &x, &y, &fEnabled, &c2); 481 cMatches = sscanf(szModeParms, "%5ux%5ux%2u%c%5ux%5u,%1u%c", &cx, &cy, &cBits, &c1, &x, &y, &fEnabled, &c2); 486 482 if ((cMatches == 7 && c1 == ',') || cMatches == 3) 487 483 rc = VINF_SUCCESS; … … 491 487 rc = VERR_PARSE_ERROR; 492 488 } 493 /* 494 * And clean up and return the values if we successfully obtained them. 495 */ 489 490 /* 491 * And clean up and return the values if we successfully obtained them. 492 */ 496 493 if (RT_SUCCESS(rc)) 497 494 {
Note:
See TracChangeset
for help on using the changeset viewer.