locked
DXGI Trim(); causes hang and crash.

    Question

  • My app failed because it didn't call Trim(); on suspend.

    I added in the trim(); command and now I get the software hanging during certification.

    I have run the app on its own and despite trying all scenarios I cant get it to crash.

    void SimpleSample::OnSuspending(Platform::Object^ sender, SuspendingEventArgs^ args)
    {
    	// Save app state asynchronously after requesting a deferral. Holding a deferral
    	// indicates that the application is busy performing suspending operations. Be
    	// aware that a deferral may not be held indefinitely. After about five seconds,
    	// the app will be forced to exit.
    	SuspendingDeferral^ deferral = args->SuspendingOperation->GetDeferral();
    
    	create_task([this, deferral]()
    	{
    		Direct3DBase::Trimmer();
    		deferral->Complete();
    	});
    }
    ////////////////////////////////////////////////
    
    
    
    
    void Direct3DBase::Trimmer()
    {
    	
    	IDXGIDevice3 * pDXGIDevice;
    	HRESULT hr = pDXGIDevice->QueryInterface(__uuidof(dxgiDevice), (void **) &pDXGIDevice);
    	pDXGIDevice->Trim();
    	
    }
    


    n.Wright

    Monday, September 30, 2013 9:35 PM

Answers

  • IDXGIDevice3 is new for Windows 8.1.

    Your QI should fail on Windows 8, and since you're not checking for failure the call to Trim should crash.

    --Rob

    Tuesday, October 1, 2013 7:37 PM
    Owner

All replies

  • IDXGIDevice3 is new for Windows 8.1.

    Your QI should fail on Windows 8, and since you're not checking for failure the call to Trim should crash.

    --Rob

    Tuesday, October 1, 2013 7:37 PM
    Owner
  • I am using Windows 8.1RTM.


    n.Wright

    Tuesday, October 1, 2013 11:33 PM
  • The store is not yet open for Windows 8.1 apps, and you cannot expect this interface to be available for Windows 8 apps. If you update the code to check for success before using the results of the QI then the app shouldn't crash because IDXGIDevice3 isn't available.

    --Rob

    Tuesday, October 1, 2013 11:47 PM
    Owner