{"id":106197,"date":"2022-01-26T07:00:00","date_gmt":"2022-01-26T15:00:00","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/oldnewthing\/?p=106197"},"modified":"2022-01-26T07:08:06","modified_gmt":"2022-01-26T15:08:06","slug":"20220126-00","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/oldnewthing\/20220126-00\/?p=106197","title":{"rendered":"What are these weird internal Visual C++ runtime functions named NLG?"},"content":{"rendered":"<p>If you&#8217;re looking at dump files or doing live debugging, you may encounter functions whose names begin with NLG: <code>_NLG_Notify<\/code>, <code>_NLG_Notify1<\/code>, <code>_NLG_Dispatch<\/code>, <code>_NLG_Return<\/code>, <code>_NLG_Return2<\/code>\u00b9 and a few more. What are they for, and what does NLG stand for?<\/p>\n<p>These functions are part of the Visual C++ runtime&#8217;s internal exception handling infrastructure. The &#8220;notify&#8221; functions are used to inform the debugger of the progress of exception handling, and the &#8220;return&#8221; functions are used to tell the debugger that an exception handler returned.<\/p>\n<p>The sneaky thing is that the &#8220;notify&#8221; functions aren&#8217;t really functions. They are labels, and the debugger is expected to set a breakpoint at those labels to learn of the progress of exception handling.<\/p>\n<p>But what does NLG stand for?<\/p>\n<p>It stands for &#8220;non-local goto&#8221;, which is a fancy way to say &#8220;jumping from one function directly to another.&#8221;<\/p>\n<p>\u00b9 I find it amusing that the second <code>_NLG_Notify<\/code> is called <code>_NLG_Notify1<\/code>, but the second <code>_NLG_Return<\/code> is called <code>_NLG_Return2<\/code>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>They are part of exception handling.<\/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-106197","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oldnewthing","tag-code"],"acf":[],"blog_post_summary":"<p>They are part of exception handling.<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/106197","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=106197"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/106197\/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=106197"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/categories?post=106197"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/tags?post=106197"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}