{"id":99785,"date":"2018-09-20T07:00:00","date_gmt":"2018-09-20T21:00:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/oldnewthing\/?p=99785"},"modified":"2019-03-13T00:30:15","modified_gmt":"2019-03-13T07:30:15","slug":"20180920-00","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/oldnewthing\/20180920-00\/?p=99785","title":{"rendered":"What do the various <CODE>regsvr32<\/CODE> exit codes mean?"},"content":{"rendered":"<p>The exit codes for the <code>regsvr32<\/code> program are currently as follows: <\/p>\n<table BORDER=\"1\" CLASS=\"cp3\" CELLPADDING=\"3\" CELLSPACING=\"0\" STYLE=\"border-collapse: collapse\">\n<tr>\n<th>Exit code<\/th>\n<th>Meaning<\/th>\n<\/tr>\n<tr>\n<td>0<\/td>\n<td>Success<\/td>\n<\/tr>\n<tr>\n<td>1<\/td>\n<td>Error parsing command line<\/td>\n<\/tr>\n<tr>\n<td>2<\/td>\n<td><code>OleInitialize<\/code> failed<\/td>\n<\/tr>\n<tr>\n<td>3<\/td>\n<td><code>LoadLibrary<\/code> failed<\/td>\n<\/tr>\n<tr>\n<td>4<\/td>\n<td><code>GetProcAddress<\/code> failed<\/td>\n<\/tr>\n<tr>\n<td>5<\/td>\n<td>Registration function failed<\/td>\n<\/tr>\n<\/table>\n<p>This information is included for diagnostic and troubleshooting purposes. I don&#8217;t think the values are contractual. <\/p>\n<p>The <code>regsvr32<\/code> program basically does five things, and the exit codes correspond to each of those steps. <\/p>\n<ol>\n<li>Parse the command line to see what it&#8217;s being     asked to do.<\/li>\n<li>Initialize OLE.<\/li>\n<li>Load the library.<\/li>\n<li>Find the function to be called. The command line options     specify which function to look for.     Could be <code>Dll&shy;Register&shy;Server<\/code>,     <code>Dll&shy;Unregister&shy;Server<\/code>,     or even     <code>Dll&shy;Install<\/code>.<\/li>\n<li>Call it.<\/li>\n<\/ol>\n<p>Steps 4 and 5 may be repeated if the command line options indicate that multiple functions should be called. <\/p>\n<p>If something goes wrong, the <code>regsvr32<\/code> program reports the error details to the user, and the exit code summarizes which step it got stuck at. Future versions of <code>regsvr32<\/code> may add additional steps, or change the order of the steps, which would trigger renumbering. The exit code is for diagnostic and troubleshooting purposes, so you can try to figure out why something went wrong. <\/p>\n<p>We&#8217;ll put this information to use next time. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Reporting which step the problem occurred at.<\/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-99785","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oldnewthing","tag-code"],"acf":[],"blog_post_summary":"<p>Reporting which step the problem occurred at.<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/99785","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=99785"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/99785\/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=99785"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/categories?post=99785"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/tags?post=99785"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}