Changeset 56970 in vbox for trunk/src/VBox
- Timestamp:
- Jul 17, 2015 2:23:43 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_main.c
r56922 r56970 1898 1898 /* Load windows */ 1899 1899 int32_t rc = crServerLsrDataGetU32(pReader, &uiNumElems); 1900 Assert RCReturn(rc, rc);1900 AssertLogRelRCReturn(rc, rc); 1901 1901 for (ui=0; ui<uiNumElems; ++ui) 1902 1902 { … … 1907 1907 1908 1908 rc = crServerLsrDataGetMem(pReader, &key, sizeof(key)); 1909 Assert RCReturn(rc, rc);1909 AssertLogRelRCReturn(rc, rc); 1910 1910 rc = crServerLsrDataGetMem(pReader, &createInfo, sizeof(createInfo)); 1911 Assert RCReturn(rc, rc);1911 AssertLogRelRCReturn(rc, rc); 1912 1912 1913 1913 CRASSERT(!pReader->cbData); … … 1916 1916 { 1917 1917 rc = SSMR3GetStrZEx(pReader->pSSM, psz, 200, NULL); 1918 Assert RCReturn(rc, rc);1918 AssertLogRelRCReturn(rc, rc); 1919 1919 createInfo.pszDpyName = psz; 1920 1920 } … … 1926 1926 /* Load cr_server.muralTable */ 1927 1927 rc = SSMR3GetU32(pReader->pSSM, &uiNumElems); 1928 Assert RCReturn(rc, rc);1928 AssertLogRelRCReturn(rc, rc); 1929 1929 for (ui=0; ui<uiNumElems; ++ui) 1930 1930 { … … 1933 1933 1934 1934 rc = crServerLsrDataGetMem(pReader, &key, sizeof(key)); 1935 Assert RCReturn(rc, rc);1935 AssertLogRelRCReturn(rc, rc); 1936 1936 rc = crServerLsrDataGetMem(pReader, &muralInfo, RT_OFFSETOF(CRMuralInfo, CreateInfo)); 1937 Assert RCReturn(rc, rc);1937 AssertLogRelRCReturn(rc, rc); 1938 1938 1939 1939 if (version <= SHCROGL_SSM_VERSION_BEFORE_FRONT_DRAW_TRACKING) … … 1956 1956 * the mural memory is zero-initialized initially, so we can be sure the padding is zeroed */ 1957 1957 rc = crServerLsrDataGetMem(pReader, &LaBuf, sizeof (LaBuf)); 1958 Assert RCReturn(rc, rc);1958 AssertLogRelRCReturn(rc, rc); 1959 1959 if (LaBuf.apv[0] != NULL && LaBuf.apv[0] != ((void*)1)) 1960 1960 break; … … 2023 2023 2024 2024 rc = crServerLsrDataPutMem(pReader, &LaBuf, sizeof (LaBuf)); 2025 Assert RCReturn(rc, rc);2025 AssertLogRelRCReturn(rc, rc); 2026 2026 } 2027 2027 … … 2030 2030 CR_SERVER_BUGGY_MURAL_DATA Tmp; 2031 2031 rc = crServerLsrDataGetMem(pReader, &Tmp, sizeof (Tmp)); 2032 Assert RCReturn(rc, rc);2032 AssertLogRelRCReturn(rc, rc); 2033 2033 } 2034 2034 … … 2042 2042 2043 2043 rc = crServerLsrDataGetMem(pReader, muralInfo.pVisibleRects, 4*sizeof(GLint)*muralInfo.cVisibleRects); 2044 Assert RCReturn(rc, rc);2044 AssertLogRelRCReturn(rc, rc); 2045 2045 } 2046 2046 … … 2135 2135 CRFBDataElement * pEl = &Data.data.aElements[i]; 2136 2136 rc = SSMR3GetMem(pSSM, pEl->pvData, pEl->cbData); 2137 Assert RCReturn(rc, rc);2137 AssertLogRelRCReturn(rc, rc); 2138 2138 } 2139 2139 … … 2205 2205 /* Read number of clients */ 2206 2206 rc = SSMR3GetU32(pSSM, &g_hackVBoxServerSaveLoadCallsLeft); 2207 Assert RCReturn(rc, rc);2207 AssertLogRelRCReturn(rc, rc); 2208 2208 2209 2209 Assert(g_hackVBoxServerSaveLoadCallsLeft); … … 2238 2238 /* Load and recreate rendering contexts */ 2239 2239 rc = SSMR3GetU32(pSSM, &uiNumElems); 2240 Assert RCReturn(rc, rc);2241 for (ui =0; ui<uiNumElems; ++ui)2240 AssertLogRelRCReturn(rc, rc); 2241 for (ui = 0; ui < uiNumElems; ++ui) 2242 2242 { 2243 2243 CRCreateInfo_t createInfo; … … 2248 2248 2249 2249 rc = SSMR3GetMem(pSSM, &key, sizeof(key)); 2250 Assert RCReturn(rc, rc);2250 AssertLogRelRCReturn(rc, rc); 2251 2251 rc = SSMR3GetMem(pSSM, &createInfo, sizeof(createInfo)); 2252 Assert RCReturn(rc, rc);2252 AssertLogRelRCReturn(rc, rc); 2253 2253 2254 2254 if (createInfo.pszDpyName) 2255 2255 { 2256 2256 rc = SSMR3GetStrZEx(pSSM, psz, 200, NULL); 2257 Assert RCReturn(rc, rc);2257 AssertLogRelRCReturn(rc, rc); 2258 2258 createInfo.pszDpyName = psz; 2259 2259 } … … 2274 2274 /* we have a mural data here */ 2275 2275 rc = crVBoxServerLoadMurals(&Reader, version); 2276 Assert RCReturn(rc, rc);2276 AssertLogRelRCReturn(rc, rc); 2277 2277 CRASSERT(!Reader.pu8Buffer); 2278 2278 } … … 2286 2286 2287 2287 rc = crStateLoadGlobals(pSSM, version); 2288 Assert RCReturn(rc, rc);2288 AssertLogRelRCReturn(rc, rc); 2289 2289 2290 2290 if (uiNumElems) … … 2309 2309 2310 2310 rc = SSMR3GetMem(pSSM, &key, sizeof(key)); 2311 Assert RCReturn(rc, rc);2311 AssertLogRelRCReturn(rc, rc); 2312 2312 2313 2313 pContextInfo = (CRContextInfo*) crHashtableSearch(cr_server.contextTable, key); … … 2319 2319 { 2320 2320 rc = SSMR3GetMem(pSSM, &winId, sizeof(winId)); 2321 Assert RCReturn(rc, rc);2321 AssertLogRelRCReturn(rc, rc); 2322 2322 2323 2323 if (winId) … … 2335 2335 2336 2336 rc = crStateLoadContext(pContext, cr_server.contextTable, crVBoxServerGetContextCB, pSSM, version); 2337 Assert RCReturn(rc, rc);2337 AssertLogRelRCReturn(rc, rc); 2338 2338 2339 2339 /*Restore front/back buffer images*/ 2340 2340 rc = crVBoxServerLoadFBImage(pSSM, version, pContextInfo, pMural); 2341 Assert RCReturn(rc, rc);2341 AssertLogRelRCReturn(rc, rc); 2342 2342 } 2343 2343 … … 2349 2349 2350 2350 rc = SSMR3GetU32(pSSM, &uiNumElems); 2351 Assert RCReturn(rc, rc);2351 AssertLogRelRCReturn(rc, rc); 2352 2352 for (ui=0; ui<uiNumElems; ++ui) 2353 2353 { … … 2356 2356 2357 2357 rc = SSMR3GetMem(pSSM, &key, sizeof(key)); 2358 Assert RCReturn(rc, rc);2358 AssertLogRelRCReturn(rc, rc); 2359 2359 2360 2360 rc = SSMR3GetMem(pSSM, &ctxId, sizeof(ctxId)); 2361 Assert RCReturn(rc, rc);2361 AssertLogRelRCReturn(rc, rc); 2362 2362 2363 2363 pMural = (CRMuralInfo*)crHashtableSearch(cr_server.muralTable, key); … … 2375 2375 2376 2376 rc = crVBoxServerLoadFBImage(pSSM, version, pContextInfo, pMural); 2377 Assert RCReturn(rc, rc);2377 AssertLogRelRCReturn(rc, rc); 2378 2378 2379 2379 /* restore the reference data, we synchronize it with the HW state in a later crServerPerformMakeCurrent call */ … … 2395 2395 /* we have a mural data here */ 2396 2396 rc = crVBoxServerLoadMurals(&Reader, version); 2397 Assert RCReturn(rc, rc);2397 AssertLogRelRCReturn(rc, rc); 2398 2398 2399 2399 /* not used any more, just read it out and ignore */ … … 2412 2412 2413 2413 rc = crServerLsrDataGetU32(&Reader, &ui); 2414 Assert RCReturn(rc, rc);2414 AssertLogRelRCReturn(rc, rc); 2415 2415 /* If this assert fires, then we should search correct client in the list first*/ 2416 2416 CRASSERT(ui == pClient->conn->u32ClientID); … … 2419 2419 { 2420 2420 rc = crServerLsrDataGetU32(&Reader, &pClient->conn->vMajor); 2421 Assert RCReturn(rc, rc);2421 AssertLogRelRCReturn(rc, rc); 2422 2422 2423 2423 rc = crServerLsrDataGetU32(&Reader, &pClient->conn->vMinor); 2424 Assert RCReturn(rc, rc);2424 AssertLogRelRCReturn(rc, rc); 2425 2425 } 2426 2426 … … 2445 2445 { 2446 2446 rc = crServerLsrDataGetMem(&Reader, &ctxID, sizeof(ctxID)); 2447 Assert RCReturn(rc, rc);2447 AssertLogRelRCReturn(rc, rc); 2448 2448 client.currentCtxInfo = (CRContextInfo*) crHashtableSearch(cr_server.contextTable, ctxID); 2449 2449 CRASSERT(client.currentCtxInfo); … … 2456 2456 { 2457 2457 rc = crServerLsrDataGetMem(&Reader, &winID, sizeof(winID)); 2458 Assert RCReturn(rc, rc);2458 AssertLogRelRCReturn(rc, rc); 2459 2459 client.currentMural = (CRMuralInfo*) crHashtableSearch(cr_server.muralTable, winID); 2460 2460 CRASSERT(client.currentMural); … … 2473 2473 2474 2474 rc = crServerPendLoadState(pSSM, version); 2475 Assert RCReturn(rc, rc);2475 AssertLogRelRCReturn(rc, rc); 2476 2476 2477 2477 if (version >= SHCROGL_SSM_VERSION_WITH_SCREEN_INFO) 2478 2478 { 2479 2479 rc = CrPMgrLoadState(pSSM, version); 2480 Assert RCReturn(rc, rc);2480 AssertLogRelRCReturn(rc, rc); 2481 2481 } 2482 2482 … … 2487 2487 { 2488 2488 rc = cr_server.head_spu->dispatch_table.spu_load_state((void *)pSSM); 2489 Assert RCReturn(rc, rc);2489 AssertLogRelRCReturn(rc, rc); 2490 2490 } 2491 2491 else … … 3374 3374 VBOXCMDVBVA_3DCTL_CONNECT Connect; 3375 3375 int rc = SSMR3GetU32(pSSM, &u32); 3376 Assert RCReturn(rc, rc);3376 AssertLogRelRCReturn(rc, rc); 3377 3377 3378 3378 for (i = 0; i < u32; i++) … … 3383 3383 3384 3384 rc = SSMR3GetU32(pSSM, &u32ClientID); 3385 Assert RCReturn(rc, rc);3385 AssertLogRelRCReturn(rc, rc); 3386 3386 rc = SSMR3GetU32(pSSM, &Connect.u32MajorVersion); 3387 Assert RCReturn(rc, rc);3387 AssertLogRelRCReturn(rc, rc); 3388 3388 rc = SSMR3GetU32(pSSM, &Connect.u32MinorVersion); 3389 Assert RCReturn(rc, rc);3389 AssertLogRelRCReturn(rc, rc); 3390 3390 rc = SSMR3GetU64(pSSM, &Connect.u64Pid); 3391 Assert RCReturn(rc, rc);3391 AssertLogRelRCReturn(rc, rc); 3392 3392 3393 3393 rc = crVBoxCrConnectEx(&Connect, u32ClientID); 3394 Assert RCReturn(rc, rc);3394 AssertLogRelRCReturn(rc, rc); 3395 3395 } 3396 3396 … … 3453 3453 int rc = VINF_SUCCESS; 3454 3454 3455 char psz[2000];3455 char szBuf[2000]; 3456 3456 uint32_t ui32; 3457 3457 … … 3459 3459 3460 3460 /* Start of data */ 3461 rc = SSMR3GetStrZEx(pSSM, psz, 2000, NULL); 3462 AssertRCReturn(rc, rc); 3463 if (strcmp(gszVBoxOGLSSMMagic, psz)) 3464 { 3465 WARN(("unexpected data")); 3466 return VERR_SSM_UNEXPECTED_DATA; 3467 } 3461 rc = SSMR3GetStrZEx(pSSM, szBuf, sizeof(szBuf), NULL); 3462 AssertLogRelRCReturn(rc, rc); 3463 AssertLogRelMsgReturn(!strcmp(gszVBoxOGLSSMMagic, szBuf), ("Unexpected data1: '%s'\n", szBuf), VERR_SSM_UNEXPECTED_DATA); 3468 3464 3469 3465 /* num clients */ 3470 3466 rc = SSMR3GetU32(pSSM, &ui32); 3471 Assert RCReturn(rc, rc);3467 AssertLogRelRCReturn(rc, rc); 3472 3468 3473 3469 if (!ui32) 3474 3470 { 3475 3471 /* no clients, dummy stub */ 3476 rc = SSMR3GetStrZEx(pSSM, psz, 2000, NULL); 3477 AssertRCReturn(rc, rc); 3478 if (strcmp(gszVBoxOGLSSMMagic, psz)) 3479 { 3480 WARN(("unexpected data")); 3481 return VERR_SSM_UNEXPECTED_DATA; 3482 } 3472 rc = SSMR3GetStrZEx(pSSM, szBuf, sizeof(szBuf), NULL); 3473 AssertLogRelRCReturn(rc, rc); 3474 AssertLogRelMsgReturn(!strcmp(gszVBoxOGLSSMMagic, szBuf), ("Unexpected data2: '%s'\n", szBuf), VERR_SSM_UNEXPECTED_DATA); 3483 3475 3484 3476 return VINF_SUCCESS; 3485 3477 } 3486 if (ui32 != 1) 3487 { 3488 WARN(("invalid id")); 3489 return VERR_SSM_UNEXPECTED_DATA; 3490 } 3478 AssertLogRelMsgReturn(ui32 == 1, ("Invalid client count: %#x\n", ui32), VERR_SSM_UNEXPECTED_DATA); 3491 3479 3492 3480 /* Version */ 3493 3481 rc = SSMR3GetU32(pSSM, &ui32); 3494 AssertRCReturn(rc, rc); 3495 3496 if (ui32 < SHCROGL_SSM_VERSION_CRCMD) 3497 { 3498 WARN(("unexpected version")); 3499 return VERR_SSM_UNEXPECTED_DATA; 3500 } 3482 AssertLogRelRCReturn(rc, rc); 3483 AssertLogRelMsgReturn(ui32 >= SHCROGL_SSM_VERSION_CRCMD, ("Unexpected version: %#x\n", ui32), VERR_SSM_UNEXPECTED_DATA); 3501 3484 3502 3485 rc = crVBoxCrCmdLoadClients(pSSM, u32Version); 3503 Assert RCReturn(rc, rc);3486 AssertLogRelRCReturn(rc, rc); 3504 3487 3505 3488 /* The state itself */ 3506 3489 rc = crVBoxServerLoadStatePerform(pSSM, ui32); 3507 Assert RCReturn(rc, rc);3490 AssertLogRelRCReturn(rc, rc); 3508 3491 3509 3492 /* Save svc buffers info */ 3510 3493 { 3511 3494 rc = SSMR3GetU32(pSSM, &ui32); 3512 AssertRCReturn(rc, rc); 3513 3514 if (ui32) 3515 { 3516 WARN(("unexpected data1")); 3517 return VERR_SSM_UNEXPECTED_DATA; 3518 } 3495 AssertLogRelRCReturn(rc, rc); 3496 AssertLogRelMsgReturn(ui32 == 0, ("Unexpected data3: %#x\n", ui32), VERR_SSM_UNEXPECTED_DATA); 3519 3497 3520 3498 rc = SSMR3GetU32(pSSM, &ui32); 3521 AssertRCReturn(rc, rc); 3522 3523 if (ui32) 3524 { 3525 WARN(("unexpected data1")); 3526 return VERR_SSM_UNEXPECTED_DATA; 3527 } 3499 AssertLogRelRCReturn(rc, rc); 3500 AssertLogRelMsgReturn(ui32 == 0, ("Unexpected data4: %#x\n", ui32), VERR_SSM_UNEXPECTED_DATA); 3528 3501 } 3529 3502 3530 3503 /* End */ 3531 rc = SSMR3GetStrZEx(pSSM, psz, 2000, NULL); 3532 AssertRCReturn(rc, rc); 3533 if (strcmp(gszVBoxOGLSSMMagic, psz)) 3534 { 3535 WARN(("unexpected data")); 3536 return VERR_SSM_UNEXPECTED_DATA; 3537 } 3504 rc = SSMR3GetStrZEx(pSSM, szBuf, sizeof(szBuf), NULL); 3505 AssertLogRelRCReturn(rc, rc); 3506 AssertLogRelMsgReturn(!strcmp(gszVBoxOGLSSMMagic, szBuf), ("Unexpected data5: '%s'\n", szBuf), VERR_SSM_UNEXPECTED_DATA); 3538 3507 3539 3508 return VINF_SUCCESS;
Note:
See TracChangeset
for help on using the changeset viewer.