June 26, 2019 11:30 PM, "Zhiyi Zhang" <zzhang(a)codeweavers.com> wrote:
+ hr = IDXGIOutput_GetParent(output, &IID_IDXGIAdapter, (void **)&adapter); + ok(SUCCEEDED(hr), "GetParent failed, hr %#x.\n", hr); + IDXGIOutput_Release(output); + check_swapchain_fullscreen_state(swapchain, &initial_state); hr = IDXGISwapChain_SetFullscreenState(swapchain, TRUE, NULL); ok(SUCCEEDED(hr) || hr == DXGI_ERROR_NOT_CURRENTLY_AVAILABLE @@ -2346,7 +2348,7 @@ static void test_set_fullscreen(void) if (FAILED(hr)) { skip("Could not change fullscreen state.\n"); - goto done; + goto free_adapter; } hr = IDXGISwapChain_SetFullscreenState(swapchain, FALSE, NULL); ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); @@ -2406,17 +2408,16 @@ static void test_set_fullscreen(void) check_swapchain_fullscreen_state(swapchain, &initial_state); test_swapchain_fullscreen_state(swapchain, adapter, &initial_state);
I think you can avoid free_adapter label.
+free_adapter: + IDXGIAdapter_Release(adapter); done:
adapter is initialized later because of the switch to a multi-device test. It will crash if not skipped. Conor