<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Hi Seongjun,  in Media (Intel® Video Processing Library, Intel Media SDK)</title>
    <link>https://community.intel.com/t5/Media-Intel-Video-Processing/DirectX-11-CreateSwapChainForHwnd-fails-with-E-ACCESSDENIED/m-p/1019891#M5976</link>
    <description>&lt;P&gt;Hi Seongjun,&amp;nbsp;&lt;/P&gt;

&lt;P&gt;So far we are not able to reproduce this issue, so I am discussing this issue with experts and we are suspecting this to be sample issue. Thanks for reporting the behavior. Can you please confirm are you using any discrete graphics card present in addition to Intel Integrated graphics card.&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;Thanks,&lt;BR /&gt;
	Surbhi&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 27 Jul 2015 18:20:50 GMT</pubDate>
    <dc:creator>Surbhi_M_Intel</dc:creator>
    <dc:date>2015-07-27T18:20:50Z</dc:date>
    <item>
      <title>DirectX 11 CreateSwapChainForHwnd fails with E_ACCESSDENIED</title>
      <link>https://community.intel.com/t5/Media-Intel-Video-Processing/DirectX-11-CreateSwapChainForHwnd-fails-with-E-ACCESSDENIED/m-p/1019888#M5973</link>
      <description>&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;

&lt;DIV&gt;
	&lt;P style="font-size: 13.0080003738403px; line-height: 19.5120010375977px;"&gt;Hello.&lt;BR /&gt;
		&lt;SPAN style="font-size: 13.0080003738403px; line-height: 19.5120010375977px;"&gt;I am trying to encode YUV media file to H.264 media file using sample_encode sources in&amp;nbsp;MediaSamples_6.0.0.49 on Windows 8.1.&amp;nbsp;&lt;BR /&gt;
		Command line is below.&amp;nbsp;I used DirectX11.1 (&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0080003738403px; line-height: 19.5120010375977px;"&gt;D3D_FEATURE_LEVEL_11_1) using -d3d11 option.&lt;/SPAN&gt;&lt;BR /&gt;
		&lt;BR /&gt;
		&lt;EM&gt;&lt;SPAN style="font-size: 13.0080003738403px; line-height: 19.5120010375977px;"&gt;sample_encode.exe h264 -i C:\Users\test\Downloads\akiyo_qcif\akiyo_qcif.yuv -o C:\Users\test\Downloads\test.264 -w 176 -h 144 -d3d11 -hw&lt;/SPAN&gt;&lt;/EM&gt;&lt;/P&gt;

	&lt;P style="font-size: 13.0080003738403px; line-height: 19.5120010375977px;"&gt;&lt;SPAN style="font-size: 13.0080003738403px; line-height: 19.5120010375977px;"&gt;On the first run, encoding succeeds no problem.&amp;nbsp;But on the second run, encoding failed because IDXGIFactory2::&lt;/SPAN&gt;CreateSwapChainForHwnd() returned&amp;nbsp;E_ACCESSDENIED.&lt;BR /&gt;
		&lt;BR /&gt;
		&lt;EM&gt;&lt;STRONG&gt;d3d11_device.cpp&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;

	&lt;PRE class="brush:cpp;"&gt;mfxStatus CD3D11Device::Init(
    mfxHDL hWindow,
    mfxU16 nViews,
    mfxU32 nAdapterNum)
{    
    .....
    // create swap chain only for rendering use case (hWindow != 0)
    if (hWindow)
    {
        MSDK_CHECK_POINTER(m_pDXGIFactory.p, MFX_ERR_NULL_PTR);
        DXGI_SWAP_CHAIN_DESC1 swapChainDesc = {0};

        sts = FillSCD1(swapChainDesc);
        MSDK_CHECK_RESULT(sts, MFX_ERR_NONE, sts);

        hres = m_pDXGIFactory-&amp;gt;CreateSwapChainForHwnd(m_pD3D11Device,
            (HWND)hWindow,
            &amp;amp;swapChainDesc,
            NULL,
            NULL,
            reinterpret_cast&amp;lt;IDXGISwapChain1**&amp;gt;(&amp;amp;m_pSwapChain));
        if (FAILED(hres))
            return MFX_ERR_DEVICE_FAILED;
    }

    return sts;
}&lt;/PRE&gt;

	&lt;P style="font-size: 13.0080003738403px; line-height: 19.5120010375977px;"&gt;I think that some objects was not being freed on destroy. Please check this.&lt;BR /&gt;
		Thank you.&lt;/P&gt;

	&lt;P style="font-size: 13.0080003738403px; line-height: 19.5120010375977px;"&gt;===============================================================&lt;BR /&gt;
		&amp;nbsp;&lt;/P&gt;
&lt;/DIV&gt;

&lt;BLOCKQUOTE&gt;
	&lt;P&gt;Intel Media SDK System Analyzer (64 bit)&lt;/P&gt;

	&lt;P&gt;&lt;BR /&gt;
		The following versions of Media SDK API are supported by platform/driver:&lt;/P&gt;

	&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Version Target &amp;nbsp;Supported &amp;nbsp; &amp;nbsp; &amp;nbsp; Dec &amp;nbsp; &amp;nbsp; Enc&lt;BR /&gt;
		&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1.0 &amp;nbsp; &amp;nbsp; HW &amp;nbsp; &amp;nbsp; &amp;nbsp;Yes &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; X &amp;nbsp; &amp;nbsp; &amp;nbsp; X&lt;BR /&gt;
		&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1.0 &amp;nbsp; &amp;nbsp; SW &amp;nbsp; &amp;nbsp; &amp;nbsp;Yes &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; X &amp;nbsp; &amp;nbsp; &amp;nbsp; X&lt;BR /&gt;
		&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1.1 &amp;nbsp; &amp;nbsp; HW &amp;nbsp; &amp;nbsp; &amp;nbsp;Yes &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; X &amp;nbsp; &amp;nbsp; &amp;nbsp; X&lt;BR /&gt;
		&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1.1 &amp;nbsp; &amp;nbsp; SW &amp;nbsp; &amp;nbsp; &amp;nbsp;Yes &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; X &amp;nbsp; &amp;nbsp; &amp;nbsp; X&lt;BR /&gt;
		&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1.3 &amp;nbsp; &amp;nbsp; HW &amp;nbsp; &amp;nbsp; &amp;nbsp;Yes &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; X &amp;nbsp; &amp;nbsp; &amp;nbsp; X&lt;BR /&gt;
		&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1.3 &amp;nbsp; &amp;nbsp; SW &amp;nbsp; &amp;nbsp; &amp;nbsp;Yes &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; X &amp;nbsp; &amp;nbsp; &amp;nbsp; X&lt;BR /&gt;
		&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1.4 &amp;nbsp; &amp;nbsp; HW &amp;nbsp; &amp;nbsp; &amp;nbsp;Yes &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; X &amp;nbsp; &amp;nbsp; &amp;nbsp; X&lt;BR /&gt;
		&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1.4 &amp;nbsp; &amp;nbsp; SW &amp;nbsp; &amp;nbsp; &amp;nbsp;Yes &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; X &amp;nbsp; &amp;nbsp; &amp;nbsp; X&lt;BR /&gt;
		&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1.5 &amp;nbsp; &amp;nbsp; HW &amp;nbsp; &amp;nbsp; &amp;nbsp;Yes &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; X &amp;nbsp; &amp;nbsp; &amp;nbsp; X&lt;BR /&gt;
		&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1.5 &amp;nbsp; &amp;nbsp; SW &amp;nbsp; &amp;nbsp; &amp;nbsp;Yes &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; X &amp;nbsp; &amp;nbsp; &amp;nbsp; X&lt;BR /&gt;
		&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1.6 &amp;nbsp; &amp;nbsp; HW &amp;nbsp; &amp;nbsp; &amp;nbsp;Yes &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; X &amp;nbsp; &amp;nbsp; &amp;nbsp; X&lt;BR /&gt;
		&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1.6 &amp;nbsp; &amp;nbsp; SW &amp;nbsp; &amp;nbsp; &amp;nbsp;Yes &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; X &amp;nbsp; &amp;nbsp; &amp;nbsp; X&lt;BR /&gt;
		&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1.7 &amp;nbsp; &amp;nbsp; HW &amp;nbsp; &amp;nbsp; &amp;nbsp;Yes &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; X &amp;nbsp; &amp;nbsp; &amp;nbsp; X&lt;BR /&gt;
		&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1.7 &amp;nbsp; &amp;nbsp; SW &amp;nbsp; &amp;nbsp; &amp;nbsp;Yes &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; X &amp;nbsp; &amp;nbsp; &amp;nbsp; X&lt;BR /&gt;
		&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1.8 &amp;nbsp; &amp;nbsp; HW &amp;nbsp; &amp;nbsp; &amp;nbsp;Yes &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; X &amp;nbsp; &amp;nbsp; &amp;nbsp; X&lt;BR /&gt;
		&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1.8 &amp;nbsp; &amp;nbsp; SW &amp;nbsp; &amp;nbsp; &amp;nbsp;Yes &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; X &amp;nbsp; &amp;nbsp; &amp;nbsp; X&lt;/P&gt;

	&lt;P&gt;Graphics Devices:&lt;BR /&gt;
		&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Name &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Version &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; State&lt;BR /&gt;
		&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Intel(R) HD Graphics 4600 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;10.18.14.4170 &amp;nbsp; &amp;nbsp; &amp;nbsp; Active&lt;/P&gt;

	&lt;P&gt;System info:&lt;BR /&gt;
		&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; CPU: &amp;nbsp; &amp;nbsp;Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz&lt;BR /&gt;
		&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; OS: &amp;nbsp; &amp;nbsp; Microsoft Windows 8.1 K&lt;BR /&gt;
		&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Arch: &amp;nbsp; 64&lt;BR /&gt;
		Installed Media SDK packages (be patient...processing takes some time):&lt;/P&gt;

	&lt;P&gt;Analysis complete... [press ENTER]&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Tue, 21 Jul 2015 05:52:19 GMT</pubDate>
      <guid>https://community.intel.com/t5/Media-Intel-Video-Processing/DirectX-11-CreateSwapChainForHwnd-fails-with-E-ACCESSDENIED/m-p/1019888#M5973</guid>
      <dc:creator>Seongjun_Kim</dc:creator>
      <dc:date>2015-07-21T05:52:19Z</dc:date>
    </item>
    <item>
      <title>Hi Seongjun, </title>
      <link>https://community.intel.com/t5/Media-Intel-Video-Processing/DirectX-11-CreateSwapChainForHwnd-fails-with-E-ACCESSDENIED/m-p/1019889#M5974</link>
      <description>&lt;P&gt;Hi Seongjun,&amp;nbsp;&lt;/P&gt;

&lt;P&gt;We don't expect to see this issue.We need little more information&amp;nbsp;to understand this issue better-&amp;nbsp;&lt;BR /&gt;
	1. Which product and version are using- &amp;nbsp;Are you using INDE-Media SDK Client or Media Server Studio? What is the release no. - Media Server Studio 2015 R6 or INDE 2015 Gold U2?&amp;nbsp;&lt;/P&gt;

&lt;P&gt;2. Can you please send us the tracer logs to see whats happening wrong. Tracer logs captures the Media SDK API calls. You can find info about this tool and how to use it in &amp;lt;installed folder&amp;gt;\tools\mediasdk_tracer&lt;/P&gt;

&lt;P&gt;3. Can you please update the driver and check, though the one you are using are not too old. But it is of best interest to use the latest one. With every driver release, we fix lot of issues.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;4. Can you test the same scenario with d3d9 option and confirm if you can replicate the issue. This is just to understand if the issue exists only for d3d11 surfaces.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;5. Are you giving any sleep period between two encode sessions or is it back to back? We have tested back to back encode sessions and have not seen this issue.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Please let us know your findings.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
	Surbhi&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jul 2015 17:49:09 GMT</pubDate>
      <guid>https://community.intel.com/t5/Media-Intel-Video-Processing/DirectX-11-CreateSwapChainForHwnd-fails-with-E-ACCESSDENIED/m-p/1019889#M5974</guid>
      <dc:creator>Surbhi_M_Intel</dc:creator>
      <dc:date>2015-07-21T17:49:09Z</dc:date>
    </item>
    <item>
      <title>1. Which product and version</title>
      <link>https://community.intel.com/t5/Media-Intel-Video-Processing/DirectX-11-CreateSwapChainForHwnd-fails-with-E-ACCESSDENIED/m-p/1019890#M5975</link>
      <description>&lt;P&gt;1. Which product and version are using- &amp;nbsp;Are you using INDE-Media SDK Client or Media Server Studio? What is the release no. - Media Server Studio 2015 R6 or INDE 2015 Gold U2?&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;==&amp;gt; I use Intel Media SDK 6.0.0.349 and MediaSamples 6.0.0.49 included in INDE 2015.2.027.&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;2. Can you please send us the tracer logs to see whats happening wrong. Tracer logs captures the Media SDK API calls. You can find info about this tool and how to use it in &amp;lt;installed folder&amp;gt;\tools\mediasdk_tracer&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;==&amp;gt; I attached tracer log files. (tracer_first_turn__success.log, tracer_second_turn__accessdenied.log)&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;3. Can you please update the driver and check, though the one you are using are not too old. But it is of best interest to use the latest one. With every driver release, we fix lot of issues.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;==&amp;gt; I use win64_153621 version for Windows8.1. (https://downloadcenter.intel.com/download/24964)&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;4. Can you test the same scenario with d3d9 option and confirm if you can replicate the issue. This is just to understand if the issue exists only for d3d11 surfaces.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;==&amp;gt; I tried encoding test two times using same command line replaced d3d11 option of d3d9 option. All the test result in SUCCESS.&lt;BR /&gt;
	&lt;EM&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;samle_encode.exe h264 -i C:\Users\withsmilo\Downloads\akiyo_qcif\akiyo_qcif.yuv -o C:\Users\withsmilo\Downloads\smilo.264 -w 176 -h 144 -d3d9 -hw&lt;/SPAN&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;5. Are you giving any sleep period between two encode sessions or is it back to back? We have tested back to back encode sessions and have not seen this issue.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;==&amp;gt; I gave 1min, 10min, 30min sleep period between continuous tests, first test results in success ONLY. Other tests result in FAILED.&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;I built sample_encode sources on &lt;STRONG&gt;x64 debug mode&lt;/STRONG&gt; using Visual Studio 2013.&lt;BR /&gt;
	After debugging it, I found that&amp;nbsp;IDXGIFactory2::CreateSwapChainForHwnd() returned E_ACCESSDENIED,&lt;BR /&gt;
	I think that error point is not Media SDK API but d3d11_device.cpp source in which&amp;nbsp;some objects was not being freed on destroy.&lt;BR /&gt;
	&lt;BR /&gt;
	I tried to encode it with D3D11 option on "CLEAN" Windows8.1+INDE+Driver, but still first run success and second run failed. :(&lt;/P&gt;

&lt;P&gt;Thank you! :)&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jul 2015 03:45:12 GMT</pubDate>
      <guid>https://community.intel.com/t5/Media-Intel-Video-Processing/DirectX-11-CreateSwapChainForHwnd-fails-with-E-ACCESSDENIED/m-p/1019890#M5975</guid>
      <dc:creator>Seongjun_Kim</dc:creator>
      <dc:date>2015-07-24T03:45:12Z</dc:date>
    </item>
    <item>
      <title>Hi Seongjun, </title>
      <link>https://community.intel.com/t5/Media-Intel-Video-Processing/DirectX-11-CreateSwapChainForHwnd-fails-with-E-ACCESSDENIED/m-p/1019891#M5976</link>
      <description>&lt;P&gt;Hi Seongjun,&amp;nbsp;&lt;/P&gt;

&lt;P&gt;So far we are not able to reproduce this issue, so I am discussing this issue with experts and we are suspecting this to be sample issue. Thanks for reporting the behavior. Can you please confirm are you using any discrete graphics card present in addition to Intel Integrated graphics card.&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;Thanks,&lt;BR /&gt;
	Surbhi&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jul 2015 18:20:50 GMT</pubDate>
      <guid>https://community.intel.com/t5/Media-Intel-Video-Processing/DirectX-11-CreateSwapChainForHwnd-fails-with-E-ACCESSDENIED/m-p/1019891#M5976</guid>
      <dc:creator>Surbhi_M_Intel</dc:creator>
      <dc:date>2015-07-27T18:20:50Z</dc:date>
    </item>
    <item>
      <title>Hello SURBHI,</title>
      <link>https://community.intel.com/t5/Media-Intel-Video-Processing/DirectX-11-CreateSwapChainForHwnd-fails-with-E-ACCESSDENIED/m-p/1019892#M5977</link>
      <description>&lt;P&gt;Hello SURBHI,&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;Thank you for your reply! I think that sample codes have a bug, too.&lt;BR /&gt;
	I use Intel(R) HD Graphics 4600 ONLY as display adapter, and do not use any other graphics cards in my computer.&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;Thanks.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jul 2015 23:48:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Media-Intel-Video-Processing/DirectX-11-CreateSwapChainForHwnd-fails-with-E-ACCESSDENIED/m-p/1019892#M5977</guid>
      <dc:creator>Seongjun_Kim</dc:creator>
      <dc:date>2015-07-27T23:48:00Z</dc:date>
    </item>
    <item>
      <title>I found why sample codes</title>
      <link>https://community.intel.com/t5/Media-Intel-Video-Processing/DirectX-11-CreateSwapChainForHwnd-fails-with-E-ACCESSDENIED/m-p/1019893#M5978</link>
      <description>&lt;P&gt;I found why sample codes generate&amp;nbsp;&lt;SPAN style="font-size: 12px; line-height: 18px;"&gt;E_ACCESSDENIED error.&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 12px; line-height: 18px;"&gt;* Test scenario&lt;/SPAN&gt;&lt;/P&gt;

&lt;OL&gt;
	&lt;LI&gt;I built sample_encode sources on x64 debug mode using Visual Studio 2013.&lt;/LI&gt;
	&lt;LI&gt;Encoding test using sample_encode.exe binary file succeeds &lt;STRONG&gt;ALWAYS&lt;/STRONG&gt; no problem.&lt;/LI&gt;
	&lt;LI&gt;Next, I will stop sample_encode's operation during its initialization step.&lt;/LI&gt;
	&lt;LI&gt;I add a breakpoint to the line below&amp;nbsp;CreateSwapChainForHwnd() on d3d11_device.cpp (148 line) file.
		&lt;PRE class="brush:cpp;"&gt;hres = m_pDXGIFactory-&amp;gt;CreateSwapChainForHwnd(m_pD3D11Device,
            (HWND)hWindow,
            &amp;amp;swapChainDesc,
            NULL,
            NULL,
            reinterpret_cast&amp;lt;IDXGISwapChain1**&amp;gt;(&amp;amp;m_pSwapChain));
if (FAILED(hres))  // &amp;lt;====================== Add a breakpoint HERE!
            return MFX_ERR_DEVICE_FAILED;&lt;/PRE&gt;
	&lt;/LI&gt;
	&lt;LI&gt;
		&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;Run on debug mode and check to hang in upper breakpoint. You can see S_OK as hres value, and then STOP to debug.&lt;/SPAN&gt;&lt;/P&gt;
	&lt;/LI&gt;
	&lt;LI&gt;
		&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;Retry to run debug mode, you will find E_ACCESSDENIED error returned by CreateSwapChainForHwnd().&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
	&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;* &amp;nbsp;Problem solution&lt;/P&gt;

&lt;UL&gt;
	&lt;LI&gt;I think that the window handle(hWindow) taken by WindowFromPoint() was NOT freed on the step 5, So on the second run, CreateSwapChainForHwnd() returned E_ACCESSDENIED error. This is maybe a bug of sample codes.&lt;/LI&gt;
	&lt;LI&gt;My workaround code is below. Whenever encoder runs, I will take the window handle of an window created NEWLY.
		&lt;PRE class="brush:plain;"&gt;MediaSamples_6.0.0.49/sample_encode/src/pipeline_encode.cpp
@@ -474,13 +474,45 @@ mfxStatus CEncodingPipeline::InitMfxVppParams(sInputParams *pInParams)
     return MFX_ERR_NONE;
 }

+LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
+{
+    switch (message)
+    {
+    case WM_CLOSE:
+    {
+        DestroyWindow(hWnd);
+        break;
+    }
+    case WM_DESTROY:
+    {
+        PostQuitMessage(0);
+        break;
+    }
+    default:
+        return DefWindowProc(hWnd, message, wParam, lParam);
+        DestroyWindow(hWnd);
+        break;
+    }
+    case WM_DESTROY:
+    {
+        PostQuitMessage(0);
+        break;
+    }
+    default:
+        return DefWindowProc(hWnd, message, wParam, lParam);
+    }
+
+    return 0;
+}
+
 mfxStatus CEncodingPipeline::CreateHWDevice()
 {
     mfxStatus sts = MFX_ERR_NONE;
 #if D3D_SURFACES_SUPPORT
-    POINT point = {0, 0};
-    HWND window = WindowFromPoint(point);
-
+    HWND window;
+    if (D3D11_MEMORY == m_memType)
+    {
+        WNDCLASS wc = { 0 };
+        wc.lpfnWndProc = WndProc;
+        wc.lpszClassName = _T("SampleWnd");
+        RegisterClass(&amp;amp;wc);
+        window = CreateWindow(_T("SampleWnd"), _T(""), 0, 0, 0, 0, 0, NULL, NULL, NULL, 0);
+    }
+    else
+    {
+        POINT point = { 0, 0 };
+        window = WindowFromPoint(point);
+    }
 #if MFX_D3D11_SUPPORT
     if (D3D11_MEMORY == m_memType)
         m_hwdev = new CD3D11Device();&lt;/PRE&gt;

		&lt;P&gt;&amp;nbsp;&lt;/P&gt;
	&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Tue, 28 Jul 2015 07:46:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Media-Intel-Video-Processing/DirectX-11-CreateSwapChainForHwnd-fails-with-E-ACCESSDENIED/m-p/1019893#M5978</guid>
      <dc:creator>Seongjun_Kim</dc:creator>
      <dc:date>2015-07-28T07:46:00Z</dc:date>
    </item>
    <item>
      <title>We did replicate this issue</title>
      <link>https://community.intel.com/t5/Media-Intel-Video-Processing/DirectX-11-CreateSwapChainForHwnd-fails-with-E-ACCESSDENIED/m-p/1019894#M5979</link>
      <description>&lt;P&gt;We did replicate this issue after multiple trials and as we discussed the problem is in the logic of sample. We suspect this to because of window handle being corrupted somewhere in between which is resulting the access denied or trying to access wrong window which might not exist.&amp;nbsp;&lt;BR /&gt;
	I think your work around defies both of the possibilities, so this can be definitely used. I have also reported this to be a bug and should be solved in our future releases. Thank your for identifying it.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;-Surbhi&lt;/P&gt;

&lt;P&gt;P.S. Since we have identified the problem and solution here, so I am closing this thread, if you do see any issues with Media SDK or samples, feel free start a new thread.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jul 2015 01:00:43 GMT</pubDate>
      <guid>https://community.intel.com/t5/Media-Intel-Video-Processing/DirectX-11-CreateSwapChainForHwnd-fails-with-E-ACCESSDENIED/m-p/1019894#M5979</guid>
      <dc:creator>Surbhi_M_Intel</dc:creator>
      <dc:date>2015-07-30T01:00:43Z</dc:date>
    </item>
  </channel>
</rss>

