<?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 Intel SGX, sgx_create_enclave() never returns if called from dllmain() in Intel® Software Guard Extensions (Intel® SGX)</title>
    <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Intel-SGX-sgx-create-enclave-never-returns-if-called-from/m-p/1108220#M1235</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;SGX API works fine if it's called from a process. I can create an enclave successfully.&lt;/P&gt;

&lt;P&gt;But when sgx_create_enclave() is called from dllmain(), it never returns. It eventually calls WaitForSingleObject() and wait there.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;No matter the dll is injected into a process or load by a process.&lt;/P&gt;

&lt;P&gt;Thanks :)&lt;BR /&gt;
	uty&lt;/P&gt;</description>
    <pubDate>Sat, 12 Mar 2016 04:32:53 GMT</pubDate>
    <dc:creator>mingbo_z_1</dc:creator>
    <dc:date>2016-03-12T04:32:53Z</dc:date>
    <item>
      <title>Intel SGX, sgx_create_enclave() never returns if called from dllmain()</title>
      <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Intel-SGX-sgx-create-enclave-never-returns-if-called-from/m-p/1108220#M1235</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;SGX API works fine if it's called from a process. I can create an enclave successfully.&lt;/P&gt;

&lt;P&gt;But when sgx_create_enclave() is called from dllmain(), it never returns. It eventually calls WaitForSingleObject() and wait there.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;No matter the dll is injected into a process or load by a process.&lt;/P&gt;

&lt;P&gt;Thanks :)&lt;BR /&gt;
	uty&lt;/P&gt;</description>
      <pubDate>Sat, 12 Mar 2016 04:32:53 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Intel-SGX-sgx-create-enclave-never-returns-if-called-from/m-p/1108220#M1235</guid>
      <dc:creator>mingbo_z_1</dc:creator>
      <dc:date>2016-03-12T04:32:53Z</dc:date>
    </item>
    <item>
      <title>I installed the latest</title>
      <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Intel-SGX-sgx-create-enclave-never-returns-if-called-from/m-p/1108221#M1236</link>
      <description>&lt;P&gt;I installed the latest version of SDK, still got the same problem.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Mar 2016 20:25:13 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Intel-SGX-sgx-create-enclave-never-returns-if-called-from/m-p/1108221#M1236</guid>
      <dc:creator>Mingbo_Z_</dc:creator>
      <dc:date>2016-03-23T20:25:13Z</dc:date>
    </item>
    <item>
      <title>I believe this is due to a</title>
      <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Intel-SGX-sgx-create-enclave-never-returns-if-called-from/m-p/1108222#M1237</link>
      <description>&lt;P&gt;I believe this is due to:&lt;BR /&gt;
	&lt;BR /&gt;
	Dynamic-Link Library Best Practices &lt;A href="https://msdn.microsoft.com/en-us/library/windows/desktop/dn633971(v=vs.85).aspx"&gt;https://msdn.microsoft.com/en-us/library/windows/desktop/dn633971(v=vs.85).aspx&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;"You should never perform the following tasks from within DllMain:&lt;BR /&gt;
	*&amp;nbsp; Call LoadLibrary or LoadLibraryEx (either directly or indirectly). This can cause a deadlock or a crash."&lt;/P&gt;

&lt;P&gt;(edited to fix link)&lt;/P&gt;</description>
      <pubDate>Mon, 28 Mar 2016 18:35:18 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Intel-SGX-sgx-create-enclave-never-returns-if-called-from/m-p/1108222#M1237</guid>
      <dc:creator>Francisco_C_Intel</dc:creator>
      <dc:date>2016-03-28T18:35:18Z</dc:date>
    </item>
    <item>
      <title>Quote:FRANCISCO C. (Intel)</title>
      <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Intel-SGX-sgx-create-enclave-never-returns-if-called-from/m-p/1108223#M1238</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;FRANCISCO C. (Intel) wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;I believe this is due to:&lt;/P&gt;

&lt;P&gt;Dynamic-Link Library Best Practices &lt;A href="https://msdn.microsoft.com/en-us/library/windows/desktop/dn633971(v=vs.85).aspx" rel="nofollow"&gt;https://msdn.microsoft.com/en-us/library/windows/desktop/dn633971(v=vs.85).aspx&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;"You should never perform the following tasks from within DllMain:&lt;BR /&gt;
	*&amp;nbsp; Call LoadLibrary or LoadLibraryEx (either directly or indirectly). This can cause a deadlock or a crash."&lt;/P&gt;

&lt;P&gt;(edited to fix link)&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;Thanks for the reply and link :)&lt;/P&gt;

&lt;P&gt;I know sgx_create_enclave() &amp;nbsp;will load xxx.signed.dll at some point. &amp;nbsp; I want use sgx in some processes which I don't have source code. I guess I have to use sgx_create_enclave() lazily (The first time I need to use enclave).&lt;/P&gt;

&lt;P&gt;Thanks :)&lt;/P&gt;</description>
      <pubDate>Tue, 29 Mar 2016 20:11:51 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Intel-SGX-sgx-create-enclave-never-returns-if-called-from/m-p/1108223#M1238</guid>
      <dc:creator>Mingbo_Z_</dc:creator>
      <dc:date>2016-03-29T20:11:51Z</dc:date>
    </item>
  </channel>
</rss>

