{"id":92012,"date":"2015-11-06T07:00:00","date_gmt":"2015-11-06T22:00:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/oldnewthing\/20151106-00\/?p=92012\/"},"modified":"2019-03-13T12:21:27","modified_gmt":"2019-03-13T19:21:27","slug":"20151106-00","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/oldnewthing\/20151106-00\/?p=92012","title":{"rendered":"Why does the access violation error message put the operation in quotation marks, redux"},"content":{"rendered":"<p>Following up on <a HREF=\"http:\/\/blogs.msdn.com\/b\/oldnewthing\/archive\/2014\/04\/03\/10513315.aspx\">Why does the access violation error message put the operation in quotation marks? Is it some sort of euphemism?<\/a> <\/p>\n<p>Recall that when an application crashes with an access violation, the error message says something like <\/p>\n<blockquote CLASS=\"q\"><p>The instruction at &#8220;XX&#8221; referenced memory at &#8220;YY&#8221;. The memory could not be &#8220;read&#8221;. <\/p><\/blockquote>\n<p>The word at the end is &#8220;read&#8221; or &#8220;written&#8221;, and we saw earlier that it is in quotation marks for localization reasons. <\/p>\n<p>Okay, now some follow-up discussion: <\/p>\n<p>The code that decides whether to use &#8220;read&#8221; or &#8220;written&#8221; was not updated to support the new access violation code added by Data Execution Prevention (DEP), also known as NX (no execute). <\/p>\n<table BORDER=\"1\" CELLPADDING=\"3\" STYLE=\"border: solid 1px black;border-collapse: collapse\">\n<tr>\n<th>Code<\/th>\n<th>Meaning<\/th>\n<\/tr>\n<tr>\n<td>0<\/td>\n<td>unable to read<\/td>\n<\/tr>\n<tr>\n<td>1<\/td>\n<td>unable to write<\/td>\n<\/tr>\n<tr>\n<td>8<\/td>\n<td>unable to execute <font COLOR=\"red\">NEW<\/font><\/td>\n<\/tr>\n<\/table>\n<p>The code assumes that any nonzero value means &#8220;unable to write&#8221;. Therefore, if you encounter a DEP violation, the error will say that &#8220;The memory could not be written&#8221; instead of &#8220;The memory could not be executed.&#8221; <\/p>\n<p>Which is maybe a good thing, because it sounds scary when you say that memory couldn&#8217;t be executed. Like the firing squad didn&#8217;t show up or something. <\/p>\n<p>In Windows Vista, all the quotation remarks were removed, so now the message just reads <\/p>\n<blockquote CLASS=\"q\"><p>The instruction at XX referenced memory at YY. The memory could not be read. <\/p><\/blockquote>\n<p>At least now it doesn&#8217;t look like a euphemism. <\/p>\n<p>However, the words &#8220;read&#8221; and &#8220;written&#8221; are not localized. They are hard-coded in English. This means that in German, you would get <\/p>\n<blockquote CLASS=\"q\" LANG=\"de\"><p>Die Anweisung in XX verweist auf Speicher YY. Der Vorgang <span LANG=\"en\" STYLE=\"border: solid 1px black;padding: 0px 2px\">read<\/span> konnte nicht im Speicher durchgef&uuml;hrt werden. <\/p><\/blockquote>\n<p>with an English word (highlighted) <a HREF=\"http:\/\/www.bing.com\/search?q=der+vorgang+konnte+nicht+im+speicher+durchgef%C3%BChrt+werden\">inserted into the middle of a German sentence<\/a>. <\/p>\n<p>Localizability FAIL. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>It could be.<\/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":[26],"class_list":["post-92012","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oldnewthing","tag-other"],"acf":[],"blog_post_summary":"<p>It could be.<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/92012","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=92012"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/92012\/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=92012"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/categories?post=92012"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/tags?post=92012"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}