{"id":3105,"date":"2020-06-27T16:59:37","date_gmt":"2020-06-27T08:59:37","guid":{"rendered":"https:\/\/www.aoisnow.net\/blog\/?p=3105"},"modified":"2020-06-27T16:59:37","modified_gmt":"2020-06-27T08:59:37","slug":"tont-35213-%e4%b8%ba%e4%bb%80%e4%b9%88-createprocess-%e5%87%bd%e6%95%b0%e4%bc%9a%e5%81%9a%e8%87%aa%e5%8a%a8%e4%bf%ae%e6%ad%a3%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/www.aoisnow.net\/blog\/archives\/3105","title":{"rendered":"TONT 35213 \u4e3a\u4ec0\u4e48 CreateProcess \u51fd\u6570\u4f1a\u505a\u81ea\u52a8\u4fee\u6b63\uff1f"},"content":{"rendered":"<p>\u539f\u6587\u94fe\u63a5\uff1a<a href=\"https:\/\/devblogs.microsoft.com\/oldnewthing\/20050623-03\/?p=35213\" target=\"_blank\" rel=\"noopener\">https:\/\/devblogs.microsoft.com\/oldnewthing\/20050623-03\/?p=35213<\/a><\/p>\n<p>Programs that weren\u2019t designed to handle long file names would make mistakes like taking the path to the executable and writing it into the registry, unaware that the path might contain a space that needs quoting. (Spaces\u2014while technically legal\u2014were extremely rare in SFN paths.) The CreateProcess function had to decide whether to \u201cautocorrect\u201d these invalid paths or to let those programs simply stop working.<\/p>\n<p>\u5728\u8bbe\u8ba1\u9636\u6bb5\u6ca1\u6709\u8003\u8651\u5904\u7406\u957f\u6587\u4ef6\u540d\u7684\u5e94\u7528\u7a0b\u5e8f\uff0c\u5728\u5b9e\u9645\u8fd0\u884c\u65f6\u5904\u7406\u8bf8\u5982\u83b7\u53d6\u53ef\u6267\u884c\u6587\u4ef6\u8def\u5f84\u3001\u5e76\u5c06\u5176\u5199\u5165\u6ce8\u518c\u8868\u65f6\u53ef\u80fd\u51fa\u73b0\u4e00\u4e9b\u7eb0\u6f0f\uff0c\u56e0\u4e3a\u5176\u610f\u8bc6\u4e0d\u5230\u8def\u5f84\u4e2d\u53ef\u80fd\u5305\u542b\u7a7a\u683c\uff0c\u9700\u8981\u7528\uff08\u82f1\u6587\uff09\u5f15\u53f7\u5305\u88f9\u8d77\u6765\u3002\uff08\u867d\u7136\u5728\u77ed\u6587\u4ef6\u540d\u4f53\u7cfb\u4e0b\u7684\u8def\u5f84\u4e2d\u5305\u542b\u7a7a\u683c\u662f\u5408\u6cd5\u7684\uff0c\u4f46\u8fd9\u79cd\u60c5\u51b5\u6781\u4e3a\u7f55\u89c1\uff09\u3002CreateProcess \u51fd\u6570\u4e0d\u5f97\u4e0d\u505a\u51fa\u4e00\u4e9b\uff08\u989d\u5916\u7684\uff09\u52aa\u529b\uff0c\u6765\u5224\u5b9a\u662f\u4e3a\u8fd9\u4e9b\u65e0\u6548\u8def\u5f84\u505a\u4e00\u4e9b\u300e\u81ea\u52a8\u4fee\u6b63\u300f\uff0c\u8fd8\u662f\u653e\u4efb\u5176\u505c\u6b62\u5de5\u4f5c\u7b97\u4e86\u3002<\/p>\n<p>This is the battle between pragmatism and purity.<\/p>\n<p>\u8fd9\u662f\u4e00\u573a\u6709\u5173\u5b9e\u7528\u4e3b\u4e49\u4e0e\u7eaf\u7cb9\u4e3b\u4e49\u7684\u8bba\u6218\u3002<\/p>\n<p>Purity says, \u201cLet them suffer for their mistake. We\u2019re not going to sully our beautiful architecture to accomodate such stupidity.\u201d Of course, such an attitude comes with a cost: People aren\u2019t going to use your \u201cpure\u201d system if it can\u2019t run the programs that they require.<\/p>\n<p>\u7eaf\u7cb9\u4e3b\u4e49\u8005\u8bf4\uff0c\u300e\u8ba9\u90a3\u4e9b\u7a0b\u5e8f\u53bb\u627f\u62c5\u81ea\u5df1\u72af\u4e0b\u7684\u9519\u8bef\u5427\uff0c\u6211\u4eec\u4e0d\u5e94\u8be5\u4e3a\u4e86\u9002\u5e94\u8fd9\u79cd\u611a\u8822\u7684\u505a\u6cd5\u800c\u73b7\u6c61\u6211\u4eec\u534e\u4e3d\u7684\u67b6\u6784\u3002\u300f\u5f53\u7136\u4e86\uff0c\u8fd9\u79cd\u6001\u5ea6\u7684\u4ee3\u4ef7\u5c31\u662f\uff1a\u5f53\u4eba\u4eec\u65e0\u6cd5\u8fd0\u884c\u6240\u9700\u7684\u7a0b\u5e8f\u65f6\uff0c\u662f\u4e0d\u4f1a\u53bb\u9009\u7528\u4f60\u90a3\u6240\u8c13\u300e\u7eaf\u7cb9\u300f\u7684\u7cfb\u7edf\u7684\u3002<\/p>\n<p>Put another way, it doesn\u2019t matter how great your 1.0 version is if you don\u2019t survive long enough to make a 2.0.<\/p>\n<p>\u6362\u4e2a\u89d2\u5ea6\u6765\u8bf4\uff0c\u8981\u662f\u4f60\u6d3b\u4e0d\u5230\u51fa2.0\u7248\u672c\u7684\u65f6\u5019\u7684\u8bdd\uff0c\u4e0d\u7ba1\u4f60\u76841.0\u7248\u6709\u591a\u4f1f\u5927\u90fd\u6ca1\u4ec0\u4e48\u610f\u4e49\u3002<\/p>\n<p>Your choice is between \u201cbeing pure and unpopular\u201d or \u201cbeing pragmatic and popular\u201d. Look at all the wonderful technologies that died for lack of popularity despite technical superiority. Sony Betamax. Mattel Intellivision. (And, in the United States: The metric system.)<\/p>\n<p>\u4f60\u9700\u8981\u5728\u300e\u7eaf\u7cb9\u4f46\u65e0\u4eba\u95ee\u6d25\u300f\u548c\u300e\u6d3b\u8dc3\u4e14\u5e7f\u4e3a\u63a5\u53d7\u300f\u505a\u51fa\u9009\u62e9\u3002\u56de\u987e\u4e00\u4e0b\u90a3\u4e9b\u867d\u7136\u6280\u672f\u4e0a\u4f18\u8d8a\u3001\u4f46\u7531\u4e8e\u7f3a\u4e4f\u6d41\u884c\u5ea6\u6700\u7ec8\u60bb\u60bb\u800c\u7ec8\u7684\u6280\u672f\u5427\u3002Sony Betamax\uff0cMattel Intellivison\u90fd\u662f\u4f8b\u5b50\u3002\uff08\u5728\u7f8e\u56fd\uff0c\u8fd8\u6709\u516c\u5236\u7cfb\u7edf\u4e5f\u4e00\u6837\u3002\uff09<\/p>\n<p>Electric cars are another example. As great as electric cars are, they never reached any significant market success. Only after conceding to popularity and \u201csullying\u201d their \u201cpurity\u201d by adding a gasoline hybrid engine did they finally gain acceptance.<\/p>\n<p>\u7535\u52a8\u6c7d\u8f66\u662f\u53e6\u4e00\u4e2a\u4f8b\u5b50\uff08\u8bd1\u6ce8\uff1a\u672c\u6587\u64b0\u5199\u65f62005\u5e74\uff09\u3002\u867d\u7136\u7535\u52a8\u6c7d\u8f66\u8fd9\u4e2a\u6982\u5ff5\u5f88\u5148\u8fdb\uff0c\u4f46\u5374\u4ece\u6765\u6ca1\u6709\u53d6\u5f97\u4efb\u4f55\u5546\u4e1a\u4e0a\u7684\u6210\u529f\uff0c\u53ea\u6709\u5728\u9762\u5411\u5927\u4f17\u65f6\u505a\u51fa\u9000\u8ba9\u3001\u901a\u8fc7\u589e\u52a0\u6cb9\u7535\u6df7\u52a8\u5f15\u64ce\u800c\u300e\u73b7\u6c61\u300f\u4e86\u5176\u300e\u7eaf\u7cb9\u6027\u300f\u4e4b\u540e\uff0c\u624d\u6700\u7ec8\u88ab\u4eba\u4eec\u6240\u63a5\u53d7\u3002<\/p>\n<p>I see this happening over and over again. A product team that, hypothetically, makes automated diagramming software, says, \u201cI can\u2019t believe we\u2019re losing to Z. Sure, Z\u2019s diagrams may be fast and snazzy, but ours gets &lt;subtle detail&gt; right, and when you go to &lt;extreme case&gt; their diagrams come out a little distorted, and they\u2019re faster only because they don\u2019t try to prevent X and Y from overlapping each other in &lt;scenario Q&gt;. We\u2019re doing all those things; that\u2019s why we\u2019re slower, but that\u2019s also why we\u2019re better. Those people over at Z just don\u2019t \u2018get it\u2019.\u201d<\/p>\n<p>\u6211\u5df2\u7ecf\u770b\u5230\u7c7b\u4f3c\u7684\u4e8b\u60c5\u53d1\u751f\u4e86\u4e00\u6b21\u53c8\u4e00\u6b21\uff1a\u5047\u8bbe\u6709\u67d0\u4e2a\u7814\u53d1\u4e86\u4e00\u6b3e\u81ea\u52a8\u56fe\u8868\u8f6f\u4ef6\u7684\u4ea7\u54c1\u56e2\u961f\u58f0\u79f0\uff1a\u300e\u7b80\u76f4\u96be\u4ee5\u7f6e\u4fe1\u6211\u4eec\u4f1a\u8f93\u7ed9Z\u516c\u53f8\u3002\u662f\u554a\uff0cZ\u7684\u56fe\u8868\u8f6f\u4ef6\u7684\u786e\u662f\u5feb\u4e86\u4e00\u70b9\u3001\u65f6\u9ae6\u4e86\u4e00\u70b9\uff0c\u4f46\u6211\u4eec\u7684\u4ea7\u54c1\u5728\uff08\u67d0\u4e2a\u7ec6\u679d\u672b\u8282\uff09\u4e0a\u505a\u4e86\u6b63\u786e\u7684\u4e8b\uff0c\u800c\u4e14\u5728\uff08\u67d0\u4e2a\u6781\u7aef\u6761\u4ef6\u4e0b\uff09\u65f6\uff0cZ\u516c\u53f8\u7684\u8f6f\u4ef6\u751f\u6210\u7684\u56fe\u8868\u4f1a\u6709\u70b9\u626d\u66f2\uff0c\u4f55\u51b5\u4ed6\u4eec\u7684\u8f6f\u4ef6\u4e4b\u6240\u4ee5\u5feb\uff0c\u662f\u56e0\u4e3a\u4ed6\u4eec\u6ca1\u6709\u518d\uff08\u573a\u666fQ\uff09\u4e0b\u907f\u514dX\u548cY\u91cd\u53e0\u3002\u6211\u4eec\u628a\u8fd9\u4e00\u5207\u90fd\u8003\u8651\u5230\u4e86\uff0c\u6240\u4ee5\u6211\u4eec\u7684\u8f6f\u4ef6\u4f1a\u6162\u4e86\u4e00\u70b9\uff0c\u4f46\u8fd9\u4e5f\u662f\u6211\u4eec\u7684\u8f6f\u4ef6\u66f4\u4f18\u7684\u539f\u56e0\u3002\u90a3\u4e9b\u5439\u6367Z\u516c\u53f8\u8f6f\u4ef6\u7684\u4eba\u6839\u672c\u4e0d\u61c2\u201c\u8fd9\u4e9b\u201d\u3002\u300f<\/p>\n<p>Guess what. People are voting with their wallets, and right now their wallets are saying that Z is better in spite of all those \u201chorrible flaws\u201d. Whatever part of \u201cit\u201d they don\u2019t get, it\u2019s certainly not the \u201cmake lots of people so happy that they send you money\u201d part.<\/p>\n<p>\u4f60\u731c\u600e\u4e48\u7740\uff0c\u4eba\u4eec\u662f\u7528\u94b1\u5305\u6765\u6295\u7968\u7684\uff0c\u800c\u5f53\u4e0b\u4ed6\u4eec\u7684\u94b1\u5305\u6b63\u5728\u5450\u558a\u300eZ\u516c\u53f8\u7684\u8f6f\u4ef6\u66f4\u597d\u300f\u800c\u65e0\u89c6\u4e86\u90a3\u4e9b\u201c\u53ef\u6015\u7684\u7f3a\u70b9\u201d\u3002\u4e0d\u7ba1\u8fd9\u4e9b\u4eba\u4e0d\u61c2\u7684\u201c\u90a3\u4e9b\u201d\u662f\u4ec0\u4e48\uff0c\u80af\u5b9a\u4e0d\u662f\u201c\u8ba9\u5f88\u591a\u4eba\u7528\u5f97\u5f00\u5fc3\u6240\u4ee5\u9001\u94b1\u7ed9\u4f60\u201d\u8fd9\u90e8\u5206\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u539f\u6587\u94fe\u63a5\uff1ahttps:\/\/devblogs.microsoft.com\/oldnewthing\/2005062 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-3105","post","type-post","status-publish","format-standard","hentry","category-tont_history"],"_links":{"self":[{"href":"https:\/\/www.aoisnow.net\/blog\/wp-json\/wp\/v2\/posts\/3105","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.aoisnow.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.aoisnow.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.aoisnow.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.aoisnow.net\/blog\/wp-json\/wp\/v2\/comments?post=3105"}],"version-history":[{"count":0,"href":"https:\/\/www.aoisnow.net\/blog\/wp-json\/wp\/v2\/posts\/3105\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.aoisnow.net\/blog\/wp-json\/wp\/v2\/media?parent=3105"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.aoisnow.net\/blog\/wp-json\/wp\/v2\/categories?post=3105"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.aoisnow.net\/blog\/wp-json\/wp\/v2\/tags?post=3105"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}