{"id":2243,"date":"2013-12-27T07:00:00","date_gmt":"2013-12-27T07:00:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/oldnewthing\/2013\/12\/27\/brief-qa-on-the-heapenableterminationoncorruption-heap-information-flag\/"},"modified":"2013-12-27T07:00:00","modified_gmt":"2013-12-27T07:00:00","slug":"brief-qa-on-the-heapenableterminationoncorruption-heap-information-flag","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/oldnewthing\/20131227-00\/?p=2243","title":{"rendered":"Brief Q&#038;A on the HeapEnableTerminationOnCorruption heap information flag"},"content":{"rendered":"<p><b>Question<\/b>: What type of heaps are controlled by the <code>Heap&shy;Enable&shy;Termination&shy;On&shy;Corruption<\/code> flag?\n <b>Answer<\/b>: Any user-mode heap created by the <code>Heap&shy;Create<\/code> function. This includes the process heap (<code>Get&shy;Process&shy;Heap<\/code>) but <a href=\"http:\/\/blogs.msdn.com\/b\/oldnewthing\/archive\/2013\/01\/30\/10389330.aspx\"> not the managed heap<\/a>. Some components use <code>Heap&shy;Create<\/code> under the hood. If so, then those heaps would also be affected.\n <b>Question<\/b>: What versions of Windows support <code>Heap&shy;Enable&shy;Termination&shy;On&shy;Corruption<\/code>?\n <b>Answer<\/b>: The flag was introduced in Windows Vista and Windows Server 2008. It is also available on Windows XP Service Pack 3. In table form:<\/p>\n<table border=\"1\" cellpadding=\"3\" style=\"border-collapse: collapse;border: solid .75pt black;text-align: center\">\n<tr>\n<th>Support<\/th>\n<th>Client<\/th>\n<th>Server<\/th>\n<\/tr>\n<tr>\n<th valign=\"bottom\">     <font size=\"+3\" face=\"Arial Unicode MS\">&#9785;<\/font><br \/>     Not Available     <\/th>\n<td valign=\"bottom\">     &#8230;<br \/>     Windows 2000<br \/>     Windows XP RTM, SP1, SP2     <\/td>\n<td valign=\"bottom\">     &#8230;<br \/>     Windows Server 2000<br \/>     Windows Server 2003     <\/td>\n<\/tr>\n<tr>\n<th valign=\"top\">     Available<br \/>     <font size=\"+3\" face=\"Arial Unicode MS\">&#9786;<\/font>     <\/th>\n<td valign=\"top\">     Windows XP SP3<br \/>     Windows Vista<br \/>     Windows 7<br \/>     &#8230;     <\/td>\n<td valign=\"top\">     Windows Server 2008<br \/>     Windows Server 2008 R2<br \/>     &#8230;     <\/td>\n<\/tr>\n<\/table>\n<p> <b>Question<\/b>: For operating systems that support it, under what conditions will  termination on corruption be enabled?\n <b>Answer<\/b>:<\/p>\n<ol>\n<li>For all 64-bit processes. <\/li>\n<li>For all 32-bit processes whose executable sets the     <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/fcc1zstk.aspx\">     subsystem major version<\/a>     to 6 or higher in the image header. <\/li>\n<li>If you call     <code>Heap&shy;Set&shy;Information<\/code> with the     <code>Heap&shy;Enable&shy;Termination&shy;On&shy;Corruption<\/code>     parameter. <\/li>\n<\/ol>\n<p> <b>Question<\/b>: What is the effect of setting the subsystem major version in a DLL? Will that control whether termination on corruption is enabled for any heaps created by my DLL?\n <b>Answer<\/b>: No. For the purpose of rule&nbsp;2 above, it is the major subsystem of the executable that decides whether termination on corruption. The major subsystem of any DLLs loaded by the process have no effect. This is consistent with <a href=\"http:\/\/blogs.msdn.com\/b\/oldnewthing\/archive\/2011\/08\/24\/10199218.aspx\"> other process decisions<\/a>.\n <b>Question<\/b>: Can I enable termination on corruption for some heaps but not others?\n <b>Answer<\/b>: No. Turning on termination on corruption turns it on for <i>all<\/i> heaps in the process.\n <b>Question<\/b>: Can I disable termination on corruption after it has been enabled?<\/p>\n<p> <b>Answer<\/b>: No. It is a one-way door. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Question: What type of heaps are controlled by the Heap&shy;Enable&shy;Termination&shy;On&shy;Corruption flag? Answer: Any user-mode heap created by the Heap&shy;Create function. This includes the process heap (Get&shy;Process&shy;Heap) but not the managed heap. Some components use Heap&shy;Create under the hood. If so, then those heaps would also be affected. Question: What versions of Windows support Heap&shy;Enable&shy;Termination&shy;On&shy;Corruption? Answer: [&hellip;]<\/p>\n","protected":false},"author":1069,"featured_media":111744,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[25],"class_list":["post-2243","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oldnewthing","tag-code"],"acf":[],"blog_post_summary":"<p>Question: What type of heaps are controlled by the Heap&shy;Enable&shy;Termination&shy;On&shy;Corruption flag? Answer: Any user-mode heap created by the Heap&shy;Create function. This includes the process heap (Get&shy;Process&shy;Heap) but not the managed heap. Some components use Heap&shy;Create under the hood. If so, then those heaps would also be affected. Question: What versions of Windows support Heap&shy;Enable&shy;Termination&shy;On&shy;Corruption? Answer: [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/2243","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/users\/1069"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/comments?post=2243"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/2243\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media\/111744"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media?parent=2243"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/categories?post=2243"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/tags?post=2243"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}