Changeset 21523 in vbox for trunk/src/VBox/HostServices/SharedOpenGL
- Timestamp:
- Jul 13, 2009 8:54:34 AM (15 years ago)
- Location:
- trunk/src/VBox/HostServices/SharedOpenGL
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostServices/SharedOpenGL/crserver/crservice.cpp
r18637 r21523 131 131 g_pFrameBuffer->COMGETTER(WinId)(&g_winId); 132 132 renderspuSetWindowId((uint32_t)g_winId); 133 crVBoxServerAddClient(u32ClientID);133 rc = crVBoxServerAddClient(u32ClientID); 134 134 #endif 135 135 … … 222 222 } 223 223 224 static void svcClientVersionUnsupported(uint32_t minor, uint32_t major) 225 { 226 LogRel(("SHARED_CROPENGL: unsupported client version %d.%d\n", minor, major)); 227 /*todo add warning window*/ 228 } 229 224 230 static DECLCALLBACK(void) svcCall (void *, VBOXHGCMCALLHANDLE callHandle, uint32_t u32ClientID, void *pvClient, uint32_t u32Function, uint32_t cParms, VBOXHGCMSVCPARM paParms[]) 225 231 { … … 264 270 265 271 /* Execute the function. */ 266 crVBoxServerClientWrite(u32ClientID, pBuffer, cbBuffer); 272 rc = crVBoxServerClientWrite(u32ClientID, pBuffer, cbBuffer); 273 if (!RT_SUCCESS(rc)) 274 { 275 Assert(VERR_NOT_SUPPORTED==rc); 276 svcClientVersionUnsupported(0, 0); 277 } 278 267 279 } 268 280 break; … … 297 309 /* Update parameters.*/ 298 310 paParms[0].u.pointer.size = cbBuffer; //@todo guest doesn't see this change somehow? 311 } else if (VERR_NOT_SUPPORTED==rc) 312 { 313 svcClientVersionUnsupported(0, 0); 299 314 } 300 315 … … 332 347 333 348 /* Execute the function. */ 334 crVBoxServerClientWrite(u32ClientID, pBuffer, cbBuffer); 349 rc = crVBoxServerClientWrite(u32ClientID, pBuffer, cbBuffer); 350 if (!RT_SUCCESS(rc)) 351 { 352 Assert(VERR_NOT_SUPPORTED==rc); 353 svcClientVersionUnsupported(0, 0); 354 } 355 335 356 rc = crVBoxServerClientRead(u32ClientID, pWriteback, &cbWriteback); 336 357 … … 343 364 paParms[2].u.uint32 = cbWriteback; 344 365 } 366 break; 367 } 368 369 case SHCRGL_GUEST_FN_SET_VERSION: 370 { 371 Log(("svcCall: SHCRGL_GUEST_FN_SET_VERSION\n")); 372 373 /* Verify parameter count and types. */ 374 if (cParms != SHCRGL_CPARMS_SET_VERSION) 375 { 376 rc = VERR_INVALID_PARAMETER; 377 } 378 else 379 if ( paParms[0].type != VBOX_HGCM_SVC_PARM_32BIT /* vMajor */ 380 || paParms[1].type != VBOX_HGCM_SVC_PARM_32BIT /* vMinor */ 381 ) 382 { 383 rc = VERR_INVALID_PARAMETER; 384 } 385 else 386 { 387 /* Fetch parameters. */ 388 uint32_t vMajor = paParms[0].u.uint32; 389 uint32_t vMinor = paParms[1].u.uint32; 390 391 /* Execute the function. */ 392 rc = crVBoxServerClientSetVersion(u32ClientID, vMajor, vMinor); 393 394 if (!RT_SUCCESS(rc)) 395 { 396 /*@todo, add warning window*/ 397 svcClientVersionUnsupported(vMajor, vMinor); 398 } 399 } 400 345 401 break; 346 402 } -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_main.c
r21028 r21523 319 319 } 320 320 321 void crVBoxServerAddClient(uint32_t u32ClientID) 322 { 323 CRClient *newClient = (CRClient *) crCalloc(sizeof(CRClient)); 324 321 int32_t crVBoxServerAddClient(uint32_t u32ClientID) 322 { 323 CRClient *newClient; 324 325 if (cr_server.numClients>=CR_MAX_CLIENTS) 326 { 327 return VERR_MAX_THRDS_REACHED; 328 } 329 330 newClient = (CRClient *) crCalloc(sizeof(CRClient)); 325 331 crDebug("crServer: AddClient u32ClientID=%d", u32ClientID); 326 332 … … 336 342 337 343 crServerAddToRunQueue(newClient); 344 345 return VINF_SUCCESS; 338 346 } 339 347 … … 363 371 } 364 372 365 voidcrVBoxServerClientWrite(uint32_t u32ClientID, uint8_t *pBuffer, uint32_t cbBuffer)373 int32_t crVBoxServerClientWrite(uint32_t u32ClientID, uint8_t *pBuffer, uint32_t cbBuffer) 366 374 { 367 375 CRClient *pClient; … … 380 388 pClient = cr_server.clients[i]; 381 389 CRASSERT(pClient); 390 391 if (!pClient->conn->vMajor) return VERR_NOT_SUPPORTED; 382 392 383 393 CRASSERT(pBuffer); … … 436 446 437 447 CRASSERT(!pClient->conn->allow_redir_ptr || crNetNumMessages(pClient->conn)==0); 448 449 return VINF_SUCCESS; 438 450 } 439 451 … … 456 468 CRASSERT(pClient); 457 469 470 if (!pClient->conn->vMajor) return VERR_NOT_SUPPORTED; 471 458 472 if (pClient->conn->cbHostBuffer > *pcbBuffer) 459 473 { … … 478 492 479 493 return VINF_SUCCESS; 494 } 495 496 int32_t crVBoxServerClientSetVersion(uint32_t u32ClientID, uint32_t vMajor, uint32_t vMinor) 497 { 498 CRClient *pClient; 499 int32_t i; 500 501 for (i = 0; i < cr_server.numClients; i++) 502 { 503 if (cr_server.clients[i] && cr_server.clients[i]->conn 504 && cr_server.clients[i]->conn->u32ClientID==u32ClientID) 505 { 506 break; 507 } 508 } 509 pClient = cr_server.clients[i]; 510 CRASSERT(pClient); 511 512 pClient->conn->vMajor = vMajor; 513 pClient->conn->vMinor = vMinor; 514 515 if (vMajor != CR_PROTOCOL_VERSION_MAJOR 516 || vMinor != CR_PROTOCOL_VERSION_MINOR) 517 { 518 return VERR_NOT_SUPPORTED; 519 } 520 else return VINF_SUCCESS; 480 521 } 481 522
Note:
See TracChangeset
for help on using the changeset viewer.