{"id":3198,"date":"2020-10-21T10:11:22","date_gmt":"2020-10-21T02:11:22","guid":{"rendered":"https:\/\/www.aoisnow.net\/blog\/?p=3198"},"modified":"2020-10-21T10:11:22","modified_gmt":"2020-10-21T02:11:22","slug":"tont-33673-%e4%b8%ba%e4%bb%80%e4%b9%88%e7%a6%81%e7%94%a8%e6%a1%8c%e9%9d%a2%e8%bf%99%e4%bb%b6%e4%ba%8b%e6%98%af%e8%a2%ab%e5%85%81%e8%ae%b8%e7%9a%84%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/www.aoisnow.net\/blog\/archives\/3198","title":{"rendered":"TONT 33673 \u4e3a\u4ec0\u4e48\u7981\u7528\u684c\u9762\u8fd9\u4ef6\u4e8b\u662f\u88ab\u5141\u8bb8\u7684\uff1f"},"content":{"rendered":"<p>\u539f\u6587\u94fe\u63a5\uff1a<a href=\"https:\/\/devblogs.microsoft.com\/oldnewthing\/20051021-11\/?p=33673\" target=\"_blank\" rel=\"noopener\">https:\/\/devblogs.microsoft.com\/oldnewthing\/20051021-11\/?p=33673<\/a><\/p>\n<p>Some time ago, I mentioned <a href=\"http:\/\/blogs.msdn.com\/oldnewthing\/archive\/2004\/02\/24\/79212.aspx\" target=\"_blank\" rel=\"noopener\">the dangers of disabling the desktop window<\/a>. But why is it even possible to disable the desktop anyway?<\/p>\n<p>\u4e4b\u524d\u6211\u66fe\u8ba8\u8bba\u8fc7\u7981\u7528\u684c\u9762\u7a97\u4f53\u7684\u5371\u9669\u6027\uff08\u8bd1\u6ce8\uff1a\u539f\u6587\u94fe\u63a5\u5df2\u5931\u6548\uff09\u3002\u4e0d\u8fc7\uff0c\u4e3a\u4ec0\u4e48\u7981\u7528\u684c\u9762\u8fd9\u4ef6\u4e8b\u672c\u8eab\u662f\u5141\u8bb8\u7684\u5462\uff1f<\/p>\n<p>This is simply an artifact of the history of philosophy of Windows operating system design.<\/p>\n<p>\u8fd9\u4e0d\u8fc7\u662f Windows \u64cd\u4f5c\u7cfb\u7edf\u8bbe\u8ba1\u54f2\u5b66\u4e2d\u7684\u4e00\u4e2a\u4eba\u4e3a\u8bbe\u8ba1\u7f62\u4e86\u3002<\/p>\n<p>Back in the old days, memory was tight, hard drives were luxuries, the most popular CPU for the IBM PC didn\u2019t have memory protection, and software development was reserved for the rarefied elite who could afford to drop a few thousand dollars on an SDK. This had several consequences:<\/p>\n<p>\u8fc7\u53bb\u7684\u65f6\u5019\uff0c\u5185\u5b58\u662f\u7d27\u7f3a\u7269\u8d44\uff0c\u786c\u76d8\u662f\u53ea\u6709\u6709\u94b1\u4eba\u624d\u7528\u5f97\u8d77\u7684\u4e1c\u897f\uff0cIBM PC \u6700\u53d7\u6b22\u8fce\u7684 CPU \u6ca1\u6709\u5185\u5b58\u4fdd\u62a4\u673a\u5236\uff0c\u8f6f\u4ef6\u5f00\u53d1\u4e5f\u53ea\u662f\u9762\u5411\u90a3\u4e9b\u80fd\u5728 SDK \u4e0a\u7838\u4e0b\u51e0\u5343\u7f8e\u5143\u7684\u9ad8\u7b49\u7cbe\u82f1\u4eba\u58eb\u7684\u4e8b\u60c5\u3002\u4ee5\u4e0a\u8fd9\u4e9b\u73b0\u5b9e\u60c5\u51b5\u9020\u6210\u4e86\u4e0b\u8ff0\u5f71\u54cd\uff1a<\/p>\n<ul>\n<li>Tight memory means that anything optional had to be left behind.\uff08\u5185\u5b58\u7d27\u7f3a\u610f\u5473\u7740\u53ef\u505a\u53ef\u4e0d\u505a\u7684\u529f\u80fd\u90fd\u8981\u820d\u5f03\u6389\uff09<\/li>\n<li>Software developers were trusted not to be stupid.\uff08\u4eba\u4eec\u76f8\u4fe1\u8f6f\u4ef6\u5f00\u53d1\u8005\u4e0d\u4f1a\u505a\u50bb\u4e8b\uff09<\/li>\n<li>Software developers were trusted not to be malicious.\uff08\u4eba\u4eec\u76f8\u4fe1\u8f6f\u4ef6\u5f00\u53d1\u8005\u4e0d\u4f1a\u505a\u574f\u4e8b\uff09<\/li>\n<li>Software developers were trusted to do the right thing.\uff08\u4eba\u4eec\u76f8\u4fe1\u8f6f\u4ef6\u5f00\u53d1\u8005\u4f1a\u53bb\u505a\u6b63\u786e\u7684\u4e8b\uff09<\/li>\n<\/ul>\n<p>Certainly there could have been a check in all the places where windows can be disabled to reject attempts to disable the desktop window, but that would have made one window \u201cmore special\u201d than others, undermining the \u201csimplicity\u201d of the window manager. Anything optional had to be left behind.<\/p>\n<p>\u5f53\u7136\u4e86\uff0c\u5728\u6240\u6709\u7981\u7528\u7a97\u4f53\u7684\u6d41\u7a0b\u4e2d\u505a\u68c0\u67e5\uff0c\u7136\u540e\u62d2\u7edd\u6240\u6709\u5c1d\u8bd5\u7981\u7528\u684c\u9762\u7a97\u4f53\u7684\u5c1d\u8bd5\u4e5f\u4e0d\u662f\u4e0d\u53ef\u4ee5\uff0c\u4e0d\u8fc7\u90a3\u6837\u5c31\u8ba9\uff08\u684c\u9762\uff09\u8fd9\u4e00\u4e2a\u7a97\u4f53\u663e\u5f97\u6bd4\u5176\u5b83\u7a97\u4f53\u300e\u66f4\u52a0\u7279\u522b\u300f\uff0c\u7531\u6b64\u4fbf\u524a\u5f31\u4e86\u7a97\u4f53\u7ba1\u7406\u5668\u7684\u300e\u7b80\u6d01\u6027\u300f\uff08\u5c31\u50cf\u521a\u521a\u6240\u8bf4\u7684\u90a3\u6837\uff0c\uff09\u53ef\u505a\u53ef\u4e0d\u505a\u7684\u529f\u80fd\u90fd\u8981\u820d\u5f03\u6389\u3002<\/p>\n<p>Software developers were trusted not to make the sort of stupid mistakes that led to the desktop being disabled, the heap being corrupted, or any of the other \u201cdon\u2019t do that\u201d types of mistakes lurking in the shadows Windows programming. If such a serious mistake were to creep in, certainly their testing department would have caught it before the program was released. Software development was hard because <strong>nobody said this was going to be easy<\/strong>.<\/p>\n<p>\u8f6f\u4ef6\u5f00\u53d1\u8005\u4eec\u88ab\u7ed9\u4e88\u4e86\u4fe1\u4efb\uff0c\u4e0d\u4f1a\u505a\u51fa\u8ba9\u684c\u9762\u88ab\u7981\u7528\u3001\u8ba9\u5806\u6570\u636e\u635f\u574f\u3001\u6216\u8005\u4efb\u4f55\u300e\u4e0d\u80fd\u8fd9\u6837\u505a\u300f\u8fd9\u7c7b\u6f5c\u4f0f\u5728 Windows \u7f16\u7a0b\u4e2d\u7684\u5931\u8bef\u884c\u4e3a\u3002\u5982\u679c\u8fd9\u7c7b\u4e25\u91cd\u7684\u758f\u5ffd\u4e0d\u5c0f\u5fc3\u53d1\u751f\u4e86\uff0c\u5f00\u53d1\u56e2\u961f\u7684\u6d4b\u8bd5\u90e8\u95e8\u7406\u5f53\u5728\u7a0b\u5e8f\u6b63\u5f0f\u53d1\u5e03\u524d\u5c06\u5176\u68c0\u67e5\u51fa\u6765\u3002\u8f6f\u4ef6\u5f00\u53d1\u662f\u4ef6\u56f0\u96be\u7684\u4e8b\uff0c<strong>\u6bd5\u7adf\u4ece\u6ca1\u6709\u4eba\u8bf4\u8fc7\u8fd9\u4ef6\u4e8b\u5f88\u5bb9\u6613<\/strong>\u3002<\/p>\n<p>Software developers were trusted to treat their customers with respect. Because, after all, software developers who abuse their customers won\u2019t have customers for very long. If a program put itself in the Startup group, then it was doing so not for selfish reasons but rather because the customer actually wanted it.<\/p>\n<p>\u4eba\u4eec\u76f8\u4fe1\u8f6f\u4ef6\u5f00\u53d1\u8005\u4f1a\u5c0a\u91cd\u4ed6\u4eec\u7684\u5ba2\u6237\uff0c\u6bd5\u7adf\u8bf4\u5230\u5e95\uff0c\u6298\u817e\u81ea\u5df1\u5ba2\u6237\u7684\u8f6f\u4ef6\u5f00\u53d1\u5546\u662f\u6d3b\u4e0d\u957f\u7684\u3002\u5982\u679c\u67d0\u4e2a\u5e94\u7528\u5c06\u81ea\u5df1\u653e\u5230\u542f\u52a8\u7fa4\u7ec4\u91cc\uff0c\u90a3\u4e48\u5b83\u8fd9\u4e48\u505a\u5c31\u5e94\u5f53\u662f\u7531\u4e8e\u5ba2\u6237\u7684\u771f\u5b9e\u9700\u6c42\uff0c\u800c\u4e0d\u662f\u51fa\u4e8e\u81ea\u79c1\u7684\u76ee\u7684\u3002<\/p>\n<p>The window manager was left fairly exposed, granting software developers the power to do things like install hooks, subclass windows that were owned by other processes, and manipulate the contents of the Startup group, with the assumption that software developers would use the power for good, not for evil. Don\u2019t bother stopping a program from disabling the desktop window, because maybe that program is doing it for a good reason that we hadn\u2019t thought of.<\/p>\n<p>\u7a97\u4f53\u7ba1\u7406\u5668\u662f\u5f00\u653e\u7684\uff0c\u7ed9\u4e88\u4e86\u8f6f\u4ef6\u5f00\u53d1\u8005\u4eec\u8fdb\u884c\u4f8b\u5982\u5b89\u88c5\u94a9\u5b50\u3001\u5728\u5176\u5b83\u8fdb\u7a0b\u7684\u7a97\u4f53\u4e2d\u521b\u5efa\u5b50\u7c7b\u3001\u4fee\u6539\u542f\u52a8\u7fa4\u7ec4\u7684\u5185\u5bb9\u4e4b\u7c7b\u4e8b\u60c5\u7684\u6743\u529b\uff0c\u8fd9\u4e5f\u662f\u51fa\u4e8e\u5bf9\u8f6f\u4ef6\u5f00\u53d1\u8005\u7684\u4fe1\u4efb\uff0c\u76f8\u4fe1\u4ed6\u4eec\u4f1a\u5408\u7406\u8fd0\u7528\u8fd9\u4e9b\u6743\u529b\uff0c\u800c\u4e0d\u662f\u53bb\u505a\u574f\u4e8b\u3002\u4e0d\u8981\u53bb\u7ba1\u67d0\u4e2a\u7a0b\u5e8f\u7981\u7528\u4e86\u684c\u9762\u7a97\u4f53\uff0c\u6bd5\u7adf\u53ef\u80fd\u5f00\u53d1\u8005\u8fd9\u4e48\u505a\uff0c\u4f1a\u6709\u6211\u4eec\u6ca1\u60f3\u5230\u7684\u5408\u7406\u7406\u7531\u3002<\/p>\n<p>The world of software has changed much since those simpler days. I had a nice chat with my colleague Zeke where we discussed how philosophy has changed over the years. Maybe he\u2019ll write a few words on the subject\u2026<\/p>\n<p>\u4e0d\u8fc7\uff0c\u8f6f\u4ef6\u5f00\u53d1\u65e9\u5df2\u4e0d\u662f\u65e9\u5e74\u90a3\u6837\u7b80\u7b80\u5355\u5355\u7684\u4e16\u754c\u4e86\u3002\u6211\u548c<a href=\"http:\/\/blogs.msdn.com\/freeassociations\/\" target=\"_blank\" rel=\"noopener\">\u6211\u7684\u540c\u4e8b Zeke<\/a> \u5bf9\u8fd9\u4e9b\u5e74\u8f6f\u4ef6\u5f00\u53d1\u7684\u54f2\u5b66\u53d1\u751f\u4e86\u54ea\u4e9b\u53d8\u5316\u8fdb\u884c\u4e86\u4e00\u6b21\u6109\u5feb\u7684\u4ea4\u6d41\uff0c\u53ef\u80fd\u4ed6\u4f1a\u9488\u5bf9\u8fd9\u4e2a\u8bdd\u9898\u5199\u51e0\u7bc7\u535a\u6587\u6765\u8c08\u8c08\u5427\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u539f\u6587\u94fe\u63a5\uff1ahttps:\/\/devblogs.microsoft.com\/oldnewthing\/2005102 [&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-3198","post","type-post","status-publish","format-standard","hentry","category-tont_history"],"_links":{"self":[{"href":"https:\/\/www.aoisnow.net\/blog\/wp-json\/wp\/v2\/posts\/3198","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=3198"}],"version-history":[{"count":0,"href":"https:\/\/www.aoisnow.net\/blog\/wp-json\/wp\/v2\/posts\/3198\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.aoisnow.net\/blog\/wp-json\/wp\/v2\/media?parent=3198"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.aoisnow.net\/blog\/wp-json\/wp\/v2\/categories?post=3198"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.aoisnow.net\/blog\/wp-json\/wp\/v2\/tags?post=3198"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}