Changeset 42023 in vbox
- Timestamp:
- Jul 5, 2012 8:52:27 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/vboxext.c
r39602 r42023 287 287 } 288 288 289 290 static HRESULT vboxExtWndCleanup(); 291 289 292 static HRESULT vboxExtTerm() 290 293 { 291 HRESULT hr = VBoxExtWorkerDestroy(&g_VBoxExtGlobal.Worker); 292 return hr; 294 HRESULT hr = vboxExtWndCleanup(); 295 if (!SUCCEEDED(hr)) 296 { 297 ERR("vboxExtWndCleanup failed, hr %d", hr); 298 return hr; 299 } 300 301 hr = VBoxExtWorkerDestroy(&g_VBoxExtGlobal.Worker); 302 if (!SUCCEEDED(hr)) 303 { 304 ERR("VBoxExtWorkerDestroy failed, hr %d", hr); 305 return hr; 306 } 307 return S_OK; 293 308 } 294 309 … … 465 480 #define VBOXEXTWND_NAME "VboxDispD3DWineWnd" 466 481 467 HRESULT vboxExtWndDoCreate(DWORD w, DWORD h, HWND *phWnd, HDC *phDC) 482 static HRESULT vboxExtWndDoCleanup() 483 { 484 HRESULT hr = S_OK; 485 HINSTANCE hInstance = (HINSTANCE)GetModuleHandle(NULL); 486 WNDCLASS wc; 487 if (GetClassInfo(hInstance, VBOXEXTWND_NAME, &wc)) 488 { 489 if (!UnregisterClass(VBOXEXTWND_NAME, hInstance)) 490 { 491 DWORD winEr = GetLastError(); 492 ERR("UnregisterClass failed, winErr(%d)\n", winEr); 493 hr = E_FAIL; 494 } 495 } 496 return hr; 497 } 498 499 static HRESULT vboxExtWndDoCreate(DWORD w, DWORD h, HWND *phWnd, HDC *phDC) 468 500 { 469 501 HRESULT hr = S_OK; … … 557 589 } VBOXEXTWND_DESTROY_INFO; 558 590 559 DECLCALLBACK(void) vboxExtWndDestroyWorker(void *pvUser) 591 typedef struct VBOXEXTWND_CLEANUP_INFO 592 { 593 int hr; 594 } VBOXEXTWND_CLEANUP_INFO; 595 596 static DECLCALLBACK(void) vboxExtWndDestroyWorker(void *pvUser) 560 597 { 561 598 VBOXEXTWND_DESTROY_INFO *pInfo = (VBOXEXTWND_DESTROY_INFO*)pvUser; … … 564 601 } 565 602 566 DECLCALLBACK(void) vboxExtWndCreateWorker(void *pvUser)603 static DECLCALLBACK(void) vboxExtWndCreateWorker(void *pvUser) 567 604 { 568 605 VBOXEXTWND_CREATE_INFO *pInfo = (VBOXEXTWND_CREATE_INFO*)pvUser; 569 606 pInfo->hr = vboxExtWndDoCreate(pInfo->width, pInfo->height, &pInfo->hWnd, &pInfo->hDC); 570 607 Assert(pInfo->hr == S_OK); 608 } 609 610 static DECLCALLBACK(void) vboxExtWndCleanupWorker(void *pvUser) 611 { 612 VBOXEXTWND_CLEANUP_INFO *pInfo = (VBOXEXTWND_CLEANUP_INFO*)pvUser; 613 pInfo-> hr = vboxExtWndDoCleanup(); 571 614 } 572 615 … … 579 622 Info.hDC = hDC; 580 623 hr = VBoxExtDwSubmitProcSync(vboxExtWndDestroyWorker, &Info); 581 Assert(hr == S_OK); 582 if (hr == S_OK) 583 { 584 Assert(Info.hr == S_OK); 624 if (!SUCCEEDED(hr)) 625 { 626 ERR("VBoxExtDwSubmitProcSync-vboxExtWndDestroyWorker failed hr %d", hr); 627 return hr; 628 } 629 630 if (!SUCCEEDED(Info.hr)) 631 { 632 ERR("vboxExtWndDestroyWorker failed hr %d", Info.hr); 585 633 return Info.hr; 586 634 } 587 return hr; 635 636 return S_OK; 588 637 } 589 638 … … 596 645 Info.height = height; 597 646 hr = VBoxExtDwSubmitProcSync(vboxExtWndCreateWorker, &Info); 598 Assert(hr == S_OK); 599 if (hr == S_OK) 600 { 601 Assert(Info.hr == S_OK); 602 if (Info.hr == S_OK) 603 { 604 *phWnd = Info.hWnd; 605 *phDC = Info.hDC; 606 } 647 if (!SUCCEEDED(hr)) 648 { 649 ERR("VBoxExtDwSubmitProcSync-vboxExtWndCreateWorker failed hr %d", hr); 650 return hr; 651 } 652 653 Assert(Info.hr == S_OK); 654 if (!SUCCEEDED(Info.hr)) 655 { 656 ERR("vboxExtWndCreateWorker failed hr %d", Info.hr); 607 657 return Info.hr; 608 658 } 609 return hr; 610 } 659 660 *phWnd = Info.hWnd; 661 *phDC = Info.hDC; 662 return S_OK; 663 } 664 665 static HRESULT vboxExtWndCleanup() 666 { 667 HRESULT hr; 668 VBOXEXTWND_CLEANUP_INFO Info; 669 Info.hr = E_FAIL; 670 hr = VBoxExtDwSubmitProcSync(vboxExtWndCleanupWorker, &Info); 671 if (!SUCCEEDED(hr)) 672 { 673 ERR("VBoxExtDwSubmitProcSync-vboxExtWndCleanupWorker failed hr %d", hr); 674 return hr; 675 } 676 677 if (!SUCCEEDED(Info.hr)) 678 { 679 ERR("vboxExtWndCleanupWorker failed hr %d", Info.hr); 680 return Info.hr; 681 } 682 683 return S_OK; 684 }
Note:
See TracChangeset
for help on using the changeset viewer.