﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>C++博客-RTY 实践出真知-随笔分类-Windows</title><link>http://www.cppblog.com/lauer3912/category/16485.html</link><description>没有理由不学习</description><language>zh-cn</language><lastBuildDate>Sat, 19 Jul 2014 10:37:21 GMT</lastBuildDate><pubDate>Sat, 19 Jul 2014 10:37:21 GMT</pubDate><ttl>60</ttl><item><title>找不到 dirent.h 文件</title><link>http://www.cppblog.com/lauer3912/archive/2012/04/28/172990.html</link><dc:creator>RTY</dc:creator><author>RTY</author><pubDate>Fri, 27 Apr 2012 22:42:00 GMT</pubDate><guid>http://www.cppblog.com/lauer3912/archive/2012/04/28/172990.html</guid><wfw:comment>http://www.cppblog.com/lauer3912/comments/172990.html</wfw:comment><comments>http://www.cppblog.com/lauer3912/archive/2012/04/28/172990.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/lauer3912/comments/commentRss/172990.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/lauer3912/services/trackbacks/172990.html</trackback:ping><description><![CDATA[转载：http://www.cnblogs.com/fzzl/archive/2009/07/14/1522913.html<br /><h1><a id="cb_post_title_url" href="http://www.cnblogs.com/fzzl/archive/2009/07/14/1522913.html">【转】vs2005下的dirent.h</a>&nbsp; 该方法同样适用于VS2008 及VS2010</h1> 	<div id="cnblogs_post_body"><p><a href="http://www.analogcn.com/Article/wz3/200802/20080202211037.html">http://www.analogcn.com/Article/wz3/200802/20080202211037.html</a><br /></p><p>&nbsp;</p> <p>dirent.h是gcc下的一个头文件，而在VS2005中是没有的。这个文件中封装了几个对目录进行操作函数：</p> <p>static DIR *opendir (const char *dirname);<br />static struct dirent *readdir (DIR *dirp);<br />static int closedir (DIR *dirp);</p> <p>&nbsp;对于在linux-&gt;windows之间进行程序移植来讲常常会造成一些困扰，在网上仔细搜了一下，发现原来已经有位好同志写了相应的移植代码，如下所示：</p> <p><br />typedef struct dirent {<br />&nbsp; /* name of current directory entry (a multi-byte character string) */<br />&nbsp; char d_name[MAX_PATH + 1];</p> <p>&nbsp; /* file attributes */<br />&nbsp; WIN32_FIND_DATA data;<br />} dirent;</p> <p><br />typedef struct DIR {<br />&nbsp; /* current directory entry */<br />&nbsp; dirent current;</p> <p>&nbsp; /* is there an un-processed entry in current? */<br />&nbsp; int cached;</p> <p>&nbsp; /* file search handle */<br />&nbsp; HANDLE search_handle;</p> <p>&nbsp; /* search pattern (3 = zero terminator + pattern "\\*") */<br />&nbsp; TCHAR patt[MAX_PATH + 3];<br />} DIR;</p> <p><br />static DIR *opendir (const char *dirname);<br />static struct dirent *readdir (DIR *dirp);<br />static int closedir (DIR *dirp);</p> <p><br />/* use the new safe string functions introduced in Visual Studio 2005 */<br />#if defined(_MSC_VER) &amp;&amp; _MSC_VER &gt;= 1400<br /># define STRNCPY(dest,src,size) strncpy_s((dest),(size),(src),_TRUNCATE)<br />#else<br /># define STRNCPY(dest,src,size) strncpy((dest),(src),(size))<br />#endif</p> <p><br />/*<br />&nbsp;* Open directory stream DIRNAME for read and return a pointer to the<br />&nbsp;* internal working area that is used to retrieve individual directory<br />&nbsp;* entries.<br />&nbsp;*/<br />static DIR*<br />opendir(<br />&nbsp;&nbsp;&nbsp; const char *dirname)<br />{<br />&nbsp; DIR *dirp;<br />&nbsp; assert (dirname != NULL);<br />&nbsp; assert (strlen (dirname) &lt; MAX_PATH);</p> <p>&nbsp; /* construct new DIR structure */<br />&nbsp; dirp = (DIR*) malloc (sizeof (struct DIR));<br />&nbsp; if (dirp != NULL) {<br />&nbsp;&nbsp;&nbsp; TCHAR *p;<br />&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; /* prepare search pattern */<br />#ifdef _UNICODE</p> <p>&nbsp;&nbsp;&nbsp; /* convert directory name to wide character string */<br />&nbsp;&nbsp;&nbsp; MultiByteToWideChar(<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CP_ACP,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* code page */<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* conversion flags */<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dirname,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* mb-string to convert */<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -1,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* length of mb-string */<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dirp-&gt;patt,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* wc-string to produce */<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MAX_PATH);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* max length of wc-string */<br />&nbsp;&nbsp;&nbsp; dirp-&gt;patt[MAX_PATH] = '\0';<br />&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; /* append search pattern to directory name */<br />&nbsp;&nbsp;&nbsp; p = wcschr (dirp-&gt;patt, '\0');<br />&nbsp;&nbsp;&nbsp; if (dirp-&gt;patt &lt; p&nbsp; &amp;&amp;&nbsp; *(p-1) != '\\'&nbsp; &amp;&amp;&nbsp; *(p-1) != ':') {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *p++ = '\\';<br />&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp; *p++ = '*';<br />&nbsp;&nbsp;&nbsp; *p = '\0';</p> <p>#else /* !_UNICODE */<br />&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; /* take directory name... */<br />&nbsp;&nbsp;&nbsp; STRNCPY (dirp-&gt;patt, dirname, sizeof(dirp-&gt;patt));<br />&nbsp;&nbsp;&nbsp; dirp-&gt;patt[MAX_PATH] = '\0';<br />&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; /* ... and append search pattern to it */<br />&nbsp;&nbsp;&nbsp; p = strchr (dirp-&gt;patt, '\0');<br />&nbsp;&nbsp;&nbsp; if (dirp-&gt;patt &lt; p&nbsp; &amp;&amp;&nbsp; *(p-1) != '\\'&nbsp; &amp;&amp;&nbsp; *(p-1) != ':') {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *p++ = '\\';<br />&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp; *p++ = '*';<br />&nbsp;&nbsp;&nbsp; *p = '\0';<br />&nbsp;&nbsp;&nbsp; <br />#endif /* !_UNICODE */</p> <p>&nbsp;&nbsp;&nbsp; /* open stream and retrieve first file */<br />&nbsp;&nbsp;&nbsp; dirp-&gt;search_handle = FindFirstFile (dirp-&gt;patt, &amp;dirp-&gt;current.data);<br />&nbsp;&nbsp;&nbsp; if (dirp-&gt;search_handle == INVALID_HANDLE_VALUE) {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* invalid search pattern? */<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; free (dirp);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return NULL;<br />&nbsp;&nbsp;&nbsp; }</p> <p>&nbsp;&nbsp;&nbsp; /* there is an un-processed directory entry in memory now */<br />&nbsp;&nbsp;&nbsp; dirp-&gt;cached = 1;<br />&nbsp;&nbsp;&nbsp; <br />&nbsp; }<br />&nbsp; return dirp;<br />}</p> <p> <br />/*<br />&nbsp;* Read a directory entry, and return a pointer to a dirent structure<br />&nbsp;* containing the name of the entry in d_name field.&nbsp; Individual directory<br />&nbsp;* entries returned by this very function include regular files,<br />&nbsp;* sub-directories, pseudo-directories "." and "..", but also volume labels,<br />&nbsp;* hidden files and system files may be returned.&nbsp; <br />&nbsp;*/<br />static struct dirent *<br />readdir(<br />&nbsp;&nbsp;&nbsp; DIR *dirp)<br />{<br />&nbsp; assert (dirp != NULL);</p> <p>&nbsp; if (dirp-&gt;search_handle == INVALID_HANDLE_VALUE) {<br />&nbsp;&nbsp;&nbsp; /* directory stream was opened/rewound incorrectly or it ended normally */<br />&nbsp;&nbsp;&nbsp; return NULL;<br />&nbsp; }</p> <p>&nbsp; /* get next directory entry */<br />&nbsp; if (dirp-&gt;cached != 0) {<br />&nbsp;&nbsp;&nbsp; /* a valid directory entry already in memory */<br />&nbsp;&nbsp;&nbsp; dirp-&gt;cached = 0;<br />&nbsp; } else {<br />&nbsp;&nbsp;&nbsp; /* read next directory entry from disk */<br />&nbsp;&nbsp;&nbsp; if (FindNextFile (dirp-&gt;search_handle, &amp;dirp-&gt;current.data) == FALSE) {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* the very last file has been processed or an error occured */<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FindClose (dirp-&gt;search_handle);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dirp-&gt;search_handle = INVALID_HANDLE_VALUE;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return NULL;<br />&nbsp;&nbsp;&nbsp; }<br />&nbsp; }</p> <p>&nbsp; /* copy directory entry to d_name */<br />#ifdef _UNICODE<br />&nbsp; <br />&nbsp; /* convert entry name to multibyte */<br />&nbsp; WideCharToMultiByte(<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CP_ACP,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* code page */<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* conversion flags */<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dirp-&gt;current.data.cFileName,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* wc-string to convert */<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -1,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* length of wc-string */<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dirp-&gt;current.d_name,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* mb-string to produce */<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MAX_PATH,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* max length of mb-string */<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NULL,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* use sys default character */<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NULL);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* don't care&nbsp; */<br />&nbsp; dirp-&gt;current.d_name[MAX_PATH] = '\0';<br />&nbsp; <br />#else /* !_UNICODE */</p> <p>&nbsp; /* copy as a multibyte character string */<br />&nbsp; STRNCPY (dirp-&gt;current.d_name, dirp-&gt;current.data.cFileName, sizeof(dirp-&gt;current.d_name));<br />&nbsp; dirp-&gt;current.d_name[MAX_PATH] = '\0';</p> <p>#endif /* !_UNICODE */<br />&nbsp; <br />&nbsp; return &amp;dirp-&gt;current;<br />}</p> <p><br />/*<br />&nbsp;* Close directory stream opened by opendir() function.&nbsp; Close of the<br />&nbsp;* directory stream invalidates the DIR structure as well as any previously<br />&nbsp;* read directory entry.<br />&nbsp;*/<br />static int<br />closedir(<br />&nbsp;&nbsp;&nbsp; DIR *dirp)<br />{<br />&nbsp; assert (dirp != NULL);<br />&nbsp;<br />&nbsp; /* release search handle */<br />&nbsp; if (dirp-&gt;search_handle != INVALID_HANDLE_VALUE) {<br />&nbsp;&nbsp;&nbsp; FindClose (dirp-&gt;search_handle);<br />&nbsp;&nbsp;&nbsp; dirp-&gt;search_handle = INVALID_HANDLE_VALUE;<br />&nbsp; }</p> <p>&nbsp; /* release directory handle */<br />&nbsp; free (dirp);<br />&nbsp; return 0;<br />}<br /></p> <p>此文件可从<a href="http://www.softagalleria.net/dirent/index.en.html"><u>http://www.softagalleria.net/dirent/index.en.html</u></a>下载得到，直接将它放在VS2005的include目录就OK 了！</p><p style="margin-bottom:0pt; margin-top:0pt; "><a href="http://www.5678520.com/"><span style=" color:#0000ff; text-decoration:underline ;font-family:'宋体'; ">开网店</span></a><a href="http://www.5678520.com/"><span style=" color:#800080; text-decoration:underline ;font-family:'宋体'; ">http://www.5678520.com/</span></a><span style=" font-size:10.5000pt; font-family:'宋体'; ">怎么样开网店</span></p></div><img src ="http://www.cppblog.com/lauer3912/aggbug/172990.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/lauer3912/" target="_blank">RTY</a> 2012-04-28 06:42 <a href="http://www.cppblog.com/lauer3912/archive/2012/04/28/172990.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>vc调试窗口表达式格式化资料</title><link>http://www.cppblog.com/lauer3912/archive/2012/04/24/172670.html</link><dc:creator>RTY</dc:creator><author>RTY</author><pubDate>Tue, 24 Apr 2012 14:37:00 GMT</pubDate><guid>http://www.cppblog.com/lauer3912/archive/2012/04/24/172670.html</guid><wfw:comment>http://www.cppblog.com/lauer3912/comments/172670.html</wfw:comment><comments>http://www.cppblog.com/lauer3912/archive/2012/04/24/172670.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.cppblog.com/lauer3912/comments/commentRss/172670.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/lauer3912/services/trackbacks/172670.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 2011-04-15 11:09&nbsp;46人阅读&nbsp;评论(0)&nbsp;收藏&nbsp;举报摘自msdn，列在这里方便查阅。The following tables show the format specifiers recognized by the debugger.&nbsp;SpecifierFormatExpressionValue Displayedd,isigned...&nbsp;&nbsp;<a href='http://www.cppblog.com/lauer3912/archive/2012/04/24/172670.html'>阅读全文</a><img src ="http://www.cppblog.com/lauer3912/aggbug/172670.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/lauer3912/" target="_blank">RTY</a> 2012-04-24 22:37 <a href="http://www.cppblog.com/lauer3912/archive/2012/04/24/172670.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Context Operator (C/C++ Language Expressions)</title><link>http://www.cppblog.com/lauer3912/archive/2012/04/24/172665.html</link><dc:creator>RTY</dc:creator><author>RTY</author><pubDate>Tue, 24 Apr 2012 13:42:00 GMT</pubDate><guid>http://www.cppblog.com/lauer3912/archive/2012/04/24/172665.html</guid><wfw:comment>http://www.cppblog.com/lauer3912/comments/172665.html</wfw:comment><comments>http://www.cppblog.com/lauer3912/archive/2012/04/24/172665.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/lauer3912/comments/commentRss/172665.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/lauer3912/services/trackbacks/172665.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: HomeLibraryLearnDownloadsSupportCommunitySign in&nbsp;|&nbsp;中国（简体中文）&nbsp;|&nbsp;&nbsp;|&nbsp;MSDN LibraryDevelopment Tools and LanguagesVisual Studio 2008Visual StudioApplication Development in Visu...&nbsp;&nbsp;<a href='http://www.cppblog.com/lauer3912/archive/2012/04/24/172665.html'>阅读全文</a><img src ="http://www.cppblog.com/lauer3912/aggbug/172665.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/lauer3912/" target="_blank">RTY</a> 2012-04-24 21:42 <a href="http://www.cppblog.com/lauer3912/archive/2012/04/24/172665.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Managed Expressions in C++ (VC 2010 调试)</title><link>http://www.cppblog.com/lauer3912/archive/2012/04/24/172664.html</link><dc:creator>RTY</dc:creator><author>RTY</author><pubDate>Tue, 24 Apr 2012 13:39:00 GMT</pubDate><guid>http://www.cppblog.com/lauer3912/archive/2012/04/24/172664.html</guid><wfw:comment>http://www.cppblog.com/lauer3912/comments/172664.html</wfw:comment><comments>http://www.cppblog.com/lauer3912/archive/2012/04/24/172664.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/lauer3912/comments/commentRss/172664.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/lauer3912/services/trackbacks/172664.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: HomeLibraryLearnDownloadsSupportCommunitySign in&nbsp;|&nbsp;中国（简体中文）&nbsp;|&nbsp;&nbsp;|&nbsp;MSDN LibraryDevelopment Tools and LanguagesVisual Studio 2010Visual StudioApplication Development in Visu...&nbsp;&nbsp;<a href='http://www.cppblog.com/lauer3912/archive/2012/04/24/172664.html'>阅读全文</a><img src ="http://www.cppblog.com/lauer3912/aggbug/172664.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/lauer3912/" target="_blank">RTY</a> 2012-04-24 21:39 <a href="http://www.cppblog.com/lauer3912/archive/2012/04/24/172664.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>VMware虚拟机从Mac OS Lion 10.7.1更新到Mac OS Lion 10.7.2后无法正常启动解决方案</title><link>http://www.cppblog.com/lauer3912/archive/2012/04/07/170356.html</link><dc:creator>RTY</dc:creator><author>RTY</author><pubDate>Sat, 07 Apr 2012 06:24:00 GMT</pubDate><guid>http://www.cppblog.com/lauer3912/archive/2012/04/07/170356.html</guid><wfw:comment>http://www.cppblog.com/lauer3912/comments/170356.html</wfw:comment><comments>http://www.cppblog.com/lauer3912/archive/2012/04/07/170356.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/lauer3912/comments/commentRss/170356.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/lauer3912/services/trackbacks/170356.html</trackback:ping><description><![CDATA[原文：http://blog.sina.com.cn/s/blog_5a6efa330100x3sp.html<br /><span style="color: #494949; font-family: simsun; background-color: #ecf0fc; "><p style="margin-top: 0px; margin-right: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; word-wrap: normal; word-break: normal; text-indent: 2em; ">10月12日全新的IOS 5系统可供下载后，Mac OS也升级到了10.7.2，10.7.2支持iCloud 全套云服务，用户可以将自己的数据自动存储到iCloud中并推送到所有设备。另外本次更新主要包括常规性修复，增强了稳定性、兼容性和安全性等。<br />但很多黑苹果的朋友在更新10.7.2版本后，发现系统无法启动，出现五国或者禁止符号等错误。本文只针对采用虚拟机（VMware或者VirtualBOX）的朋友，具体解决方案如下；<br />原因就是：升级后AppleLSIFusionMPT.kext 出了问题，这个可以在升级补丁前备份AppleLSIFusionMPT.kext，完了后AppleLSIFusionMPT.kext备份到之前的文件夹。<br />具体解决方法是：<br />1、首先正常启动虚拟机后，进入Mac OS X 10.7.1操作系统内。</p><p style="margin-top: 0px; margin-right: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; word-wrap: normal; word-break: normal; text-indent: 2em; ">原版本为：11B26</p><p style="margin-top: 0px; margin-right: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; word-wrap: normal; word-break: normal; text-indent: 2em; "><a href="http://photo.blog.sina.com.cn/showpic.html#blogid=5a6efa330100x3sp&amp;url=http://s2.sinaimg.cn/orignal/5a6efa33gb2da7e7c7b81" target="_blank" style="text-decoration: none; color: #3e6e2b; "><img src="http://s2.sinaimg.cn/middle/5a6efa33gb2da7e7c7b81&amp;690" real_src="http://s2.sinaimg.cn/middle/5a6efa33gb2da7e7c7b81&amp;690" width="553" height="314" name="image_operate_60111322551427550" alt="VMware虚拟机从Mac&nbsp;&lt;wbr&gt;OS&nbsp;&lt;wbr&gt;Lion&nbsp;&lt;wbr&gt;10.7.1更新到Mac&nbsp;&lt;wbr&gt;OS&nbsp;&lt;wbr&gt;Lion&nbsp;&lt;wbr&gt;10.7.2后无法正常启动解决方案" title="VMware虚拟机从Mac&nbsp;&lt;wbr&gt;OS&nbsp;&lt;wbr&gt;Lion&nbsp;&lt;wbr&gt;10.7.1更新到Mac&nbsp;&lt;wbr&gt;OS&nbsp;&lt;wbr&gt;Lion&nbsp;&lt;wbr&gt;10.7.2后无法正常启动解决方案" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; " /></a><br /><br /><a href="http://photo.blog.sina.com.cn/showpic.html#blogid=5a6efa330100x3sp&amp;url=http://s8.sinaimg.cn/orignal/5a6efa33gefc88f5f6687" target="_blank" style="text-decoration: none; color: #3e6e2b; "><img src="http://s8.sinaimg.cn/middle/5a6efa33gefc88f5f6687&amp;690" real_src="http://s8.sinaimg.cn/middle/5a6efa33gefc88f5f6687&amp;690" width="553" height="527" name="image_operate_11611322551421013" alt="VMware虚拟机从Mac&nbsp;&lt;wbr&gt;OS&nbsp;&lt;wbr&gt;Lion&nbsp;&lt;wbr&gt;10.7.1更新到Mac&nbsp;&lt;wbr&gt;OS&nbsp;&lt;wbr&gt;Lion&nbsp;&lt;wbr&gt;10.7.2后无法正常启动解决方案" title="VMware虚拟机从Mac&nbsp;&lt;wbr&gt;OS&nbsp;&lt;wbr&gt;Lion&nbsp;&lt;wbr&gt;10.7.1更新到Mac&nbsp;&lt;wbr&gt;OS&nbsp;&lt;wbr&gt;Lion&nbsp;&lt;wbr&gt;10.7.2后无法正常启动解决方案" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; " /></a><br /><br />2、启动&#8220;终端&#8221;程序（在&#8220;前往-实用工具&#8221;中）<br />3、在终端命令行下完整输入如下引号内的命令（意思是备份AppleLSIFusionMPT.kext文件到当前目录）<br />&#8220;cp -rv /System/Library/Extensions/AppleLSIFusionMPT.kext&nbsp;<wbr>&nbsp;.&#8220;<br />注意最后一个点号不要忘记(指备份到当前目录)，而且大小写也不能错（我没试过全部小写，我印象中Unix系统都是大小写敏感的，这一点和windows不一样）<br />输入之后，按回车，会出现一大堆文字，表示一些文件被正常备份下来。<br /><a href="http://photo.blog.sina.com.cn/showpic.html#blogid=5a6efa330100x3sp&amp;url=http://s2.sinaimg.cn/orignal/5a6efa33g7846ff767081" target="_blank" style="text-decoration: none; color: #3e6e2b; "><img name="image_operate_64211322463327223" src="http://s2.sinaimg.cn/middle/5a6efa33g7846ff767081&amp;690" real_src="http://s2.sinaimg.cn/middle/5a6efa33g7846ff767081&amp;690" width="612" height="384" alt="VMware虚拟机从Mac&nbsp;&lt;wbr&gt;OS&nbsp;&lt;wbr&gt;Lion&nbsp;&lt;wbr&gt;10.7.1更新到Mac&nbsp;&lt;wbr&gt;OS&nbsp;&lt;wbr&gt;Lion&nbsp;&lt;wbr&gt;10.7.2后无法正常启动解决方案" title="VMware虚拟机从Mac&nbsp;&lt;wbr&gt;OS&nbsp;&lt;wbr&gt;Lion&nbsp;&lt;wbr&gt;10.7.1更新到Mac&nbsp;&lt;wbr&gt;OS&nbsp;&lt;wbr&gt;Lion&nbsp;&lt;wbr&gt;10.7.2后无法正常启动解决方案" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; " /></a><br /><br />&nbsp;<wbr><br />4、不要关闭终端，然后开始正常的10.7.2补丁升级操作（这个步骤不会很快，尤其是在虚拟机下，可以干点别的，或者看我继续往下说）<br />苹果官方10.7.2升级包地址<br /><a href="http://support.apple.com/downloads/DL1459/en_US/MacOSXUpdCombo10.7.2.dmg" style="text-decoration: none; color: #3e6e2b; ">http://support.apple.com/downloads/DL1459/en_US/MacOSXUpdCombo10.7.2.dmg</a><br />5、【切记】顺利升级完成后，不要立刻启动操作系统！而是重新回到终端命令行下<br />6、输入如下引号内命令（意思是删除在Lion10.7.2升级过程中系统又安装上的AppleLSIFusionMPT.kext，这个文件是Lion10.7.2版本的，不好用，必须先删除！）<br />&#8221;sudo rm -rfv /System/Library/Extensions/AppleLSIFusionMPT.kext&#8220;<br />回车，会提示你输入密码，输入你登录密码即可。可能屏幕没有显示，所以你一定要看好了提示文字（懂点英文还是必须的）<br />&nbsp;<wbr><a href="http://photo.blog.sina.com.cn/showpic.html#blogid=5a6efa330100x3sp&amp;url=http://s13.sinaimg.cn/orignal/5a6efa33g7846ffb3d70c" target="_blank" style="text-decoration: none; color: #3e6e2b; "><img name="image_operate_53361322463352134" src="http://s13.sinaimg.cn/middle/5a6efa33g7846ffb3d70c&amp;690" real_src="http://s13.sinaimg.cn/middle/5a6efa33g7846ffb3d70c&amp;690" alt="VMware虚拟机从Mac&nbsp;&lt;wbr&gt;OS&nbsp;&lt;wbr&gt;Lion&nbsp;&lt;wbr&gt;10.7.1更新到Mac&nbsp;&lt;wbr&gt;OS&nbsp;&lt;wbr&gt;Lion&nbsp;&lt;wbr&gt;10.7.2后无法正常启动解决方案" title="VMware虚拟机从Mac&nbsp;&lt;wbr&gt;OS&nbsp;&lt;wbr&gt;Lion&nbsp;&lt;wbr&gt;10.7.1更新到Mac&nbsp;&lt;wbr&gt;OS&nbsp;&lt;wbr&gt;Lion&nbsp;&lt;wbr&gt;10.7.2后无法正常启动解决方案" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; " /></a><br /><br /><br />再输入引号内命令（意思是将升级前备份在当前目录下的AppleLSIFusionMPT.kext文件，是Lion 10.7.1版本的，重新拷贝到原系统中）<br />&#8221;sudo cp -rv AppleLSIFusionMPT.kext /System/Library/Extensions&#8220;</p><p style="margin-top: 0px; margin-right: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; word-wrap: normal; word-break: normal; text-indent: 2em; "><a href="http://photo.blog.sina.com.cn/showpic.html#blogid=5a6efa330100x3sp&amp;url=http://s2.sinaimg.cn/orignal/5a6efa33gb2c5fe9bf3d1" target="_blank" style="text-decoration: none; color: #3e6e2b; "><img name="image_operate_36761322463371091" src="http://s2.sinaimg.cn/middle/5a6efa33gb2c5fe9bf3d1&amp;690" real_src="http://s2.sinaimg.cn/middle/5a6efa33gb2c5fe9bf3d1&amp;690" width="612" height="383" alt="VMware虚拟机从Mac&nbsp;&lt;wbr&gt;OS&nbsp;&lt;wbr&gt;Lion&nbsp;&lt;wbr&gt;10.7.1更新到Mac&nbsp;&lt;wbr&gt;OS&nbsp;&lt;wbr&gt;Lion&nbsp;&lt;wbr&gt;10.7.2后无法正常启动解决方案" title="VMware虚拟机从Mac&nbsp;&lt;wbr&gt;OS&nbsp;&lt;wbr&gt;Lion&nbsp;&lt;wbr&gt;10.7.1更新到Mac&nbsp;&lt;wbr&gt;OS&nbsp;&lt;wbr&gt;Lion&nbsp;&lt;wbr&gt;10.7.2后无法正常启动解决方案" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; " /></a><br /><br /><br /></p><p style="margin-top: 0px; margin-right: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; word-wrap: normal; word-break: normal; text-indent: 2em; ">7、正常重启，大功告成！看到版本已经变成10.7.2了。版本号为：Mac OS X Lion (11C74)<br />&nbsp;<wbr><a href="http://photo.blog.sina.com.cn/showpic.html#blogid=5a6efa330100x3sp&amp;url=http://s3.sinaimg.cn/orignal/5a6efa33gb2c5ffbf4262" target="_blank" style="text-decoration: none; color: #3e6e2b; "><img src="http://s3.sinaimg.cn/middle/5a6efa33gb2c5ffbf4262&amp;690" real_src="http://s3.sinaimg.cn/middle/5a6efa33gb2c5ffbf4262&amp;690" width="311" height="355" name="image_operate_58641322551030381" alt="VMware虚拟机从Mac&nbsp;&lt;wbr&gt;OS&nbsp;&lt;wbr&gt;Lion&nbsp;&lt;wbr&gt;10.7.1更新到Mac&nbsp;&lt;wbr&gt;OS&nbsp;&lt;wbr&gt;Lion&nbsp;&lt;wbr&gt;10.7.2后无法正常启动解决方案" title="VMware虚拟机从Mac&nbsp;&lt;wbr&gt;OS&nbsp;&lt;wbr&gt;Lion&nbsp;&lt;wbr&gt;10.7.1更新到Mac&nbsp;&lt;wbr&gt;OS&nbsp;&lt;wbr&gt;Lion&nbsp;&lt;wbr&gt;10.7.2后无法正常启动解决方案" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; " /></a></p><a href="http://photo.blog.sina.com.cn/showpic.html#blogid=5a6efa330100x3sp&amp;url=http://s5.sinaimg.cn/orignal/5a6efa33gb2da6a28c1f4" target="_blank" style="text-decoration: none; color: #3e6e2b; "></a><p style="margin-top: 0px; margin-right: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; word-wrap: normal; word-break: normal; text-indent: 2em; "><a href="http://photo.blog.sina.com.cn/showpic.html#blogid=5a6efa330100x3sp&amp;url=http://s8.sinaimg.cn/orignal/5a6efa33gb2da6bddd1a7" target="_blank" style="text-decoration: none; color: #3e6e2b; "><img src="http://s8.sinaimg.cn/middle/5a6efa33gb2da6bddd1a7&amp;690" real_src="http://s8.sinaimg.cn/middle/5a6efa33gb2da6bddd1a7&amp;690" width="553" height="314" name="image_operate_95481322551108877" alt="VMware虚拟机从Mac&nbsp;&lt;wbr&gt;OS&nbsp;&lt;wbr&gt;Lion&nbsp;&lt;wbr&gt;10.7.1更新到Mac&nbsp;&lt;wbr&gt;OS&nbsp;&lt;wbr&gt;Lion&nbsp;&lt;wbr&gt;10.7.2后无法正常启动解决方案" title="VMware虚拟机从Mac&nbsp;&lt;wbr&gt;OS&nbsp;&lt;wbr&gt;Lion&nbsp;&lt;wbr&gt;10.7.1更新到Mac&nbsp;&lt;wbr&gt;OS&nbsp;&lt;wbr&gt;Lion&nbsp;&lt;wbr&gt;10.7.2后无法正常启动解决方案" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; " /></a><br /><br /><a href="http://photo.blog.sina.com.cn/showpic.html#blogid=5a6efa330100x3sp&amp;url=http://s6.sinaimg.cn/orignal/5a6efa33gb2da6e03b4b5" target="_blank" style="text-decoration: none; color: #3e6e2b; "></a><a href="http://photo.blog.sina.com.cn/showpic.html#blogid=5a6efa330100x3sp&amp;url=http://s13.sinaimg.cn/orignal/5a6efa33gb2da6ee797dc" target="_blank" style="text-decoration: none; color: #3e6e2b; "><img src="http://s13.sinaimg.cn/middle/5a6efa33gb2da6ee797dc&amp;690" real_src="http://s13.sinaimg.cn/middle/5a6efa33gb2da6ee797dc&amp;690" width="553" height="527" name="image_operate_83801322551344488" alt="VMware虚拟机从Mac&nbsp;&lt;wbr&gt;OS&nbsp;&lt;wbr&gt;Lion&nbsp;&lt;wbr&gt;10.7.1更新到Mac&nbsp;&lt;wbr&gt;OS&nbsp;&lt;wbr&gt;Lion&nbsp;&lt;wbr&gt;10.7.2后无法正常启动解决方案" title="VMware虚拟机从Mac&nbsp;&lt;wbr&gt;OS&nbsp;&lt;wbr&gt;Lion&nbsp;&lt;wbr&gt;10.7.1更新到Mac&nbsp;&lt;wbr&gt;OS&nbsp;&lt;wbr&gt;Lion&nbsp;&lt;wbr&gt;10.7.2后无法正常启动解决方案" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; " /></a><br />&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;Lion 10.7.2的主要功能之一，iCloud出来了。</p><p style="margin-top: 0px; margin-right: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; word-wrap: normal; word-break: normal; text-indent: 2em; ">这个修改版起码小的升级都没有问题，而且常用的功能都使用正常，起码我的iphone连上了itunes<br />假如已经升级了，显然是无法启动的，那么可以用笔者以下的解决方案来解决。实现原理就是使用Windows PE盘进入系统，然后利用Transmac工具（至于为什么不用Macdrive，因为它不能在PE下使用，而且还不免费）打开系统盘/System/Library/Extensions/，将AppleLSIFusionMPT.kext替换，可能需要两次才能生效，但是此教程是一定能够成功的。图文教程如下；（当然也是从insanelymac学来的），我直接把重要的地方粘贴过来了（部分加上了细节）<br />*本文将利用到的工具*（Transmac和AppleLSIFusionMPT.kext文件）<br />下载地址:&nbsp;<a href="http://m1.mail.sina.com.cn/apps/netdisk/download.php?id=e6f5482c11f317df981ddb0f1307cfca" style="text-decoration: none; color: #3e6e2b; ">http://m1.mail.sina.com.cn/apps/netdisk/download.php?id=e6f5482c11f317df981ddb0f<wbr>1307cfca</a><br />Mac_OS_X_10.7.2系统替换文件和工具by_dehe1988.rar<br />&nbsp;<wbr><a href="http://photo.blog.sina.com.cn/showpic.html#blogid=5a6efa330100x3sp&amp;url=http://s9.sinaimg.cn/orignal/5a6efa33gb2c60397c268" target="_blank" style="text-decoration: none; color: #3e6e2b; "><img name="image_operate_77191322463511528" src="http://s9.sinaimg.cn/middle/5a6efa33gb2c60397c268&amp;690" real_src="http://s9.sinaimg.cn/middle/5a6efa33gb2c60397c268&amp;690" width="625" height="461" alt="VMware虚拟机从Mac&nbsp;&lt;wbr&gt;OS&nbsp;&lt;wbr&gt;Lion&nbsp;&lt;wbr&gt;10.7.1更新到Mac&nbsp;&lt;wbr&gt;OS&nbsp;&lt;wbr&gt;Lion&nbsp;&lt;wbr&gt;10.7.2后无法正常启动解决方案" title="VMware虚拟机从Mac&nbsp;&lt;wbr&gt;OS&nbsp;&lt;wbr&gt;Lion&nbsp;&lt;wbr&gt;10.7.1更新到Mac&nbsp;&lt;wbr&gt;OS&nbsp;&lt;wbr&gt;Lion&nbsp;&lt;wbr&gt;10.7.2后无法正常启动解决方案" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; " /></a><br />使用PE工具进入系统，本人使用的是&#8220;深山红叶&#8221;大神工具包。PS：各种PE系统都行，这个只是提供一个修改的环境！<br />&nbsp;<wbr><br /><br /><a href="http://photo.blog.sina.com.cn/showpic.html#blogid=5a6efa330100x3sp&amp;url=http://s2.sinaimg.cn/orignal/5a6efa33gb2c6050ef8e1" target="_blank" style="text-decoration: none; color: #3e6e2b; "><img name="image_operate_38121322463519884" src="http://s2.sinaimg.cn/middle/5a6efa33gb2c6050ef8e1&amp;690" real_src="http://s2.sinaimg.cn/middle/5a6efa33gb2c6050ef8e1&amp;690" width="579" height="427" alt="VMware虚拟机从Mac&nbsp;&lt;wbr&gt;OS&nbsp;&lt;wbr&gt;Lion&nbsp;&lt;wbr&gt;10.7.1更新到Mac&nbsp;&lt;wbr&gt;OS&nbsp;&lt;wbr&gt;Lion&nbsp;&lt;wbr&gt;10.7.2后无法正常启动解决方案" title="VMware虚拟机从Mac&nbsp;&lt;wbr&gt;OS&nbsp;&lt;wbr&gt;Lion&nbsp;&lt;wbr&gt;10.7.1更新到Mac&nbsp;&lt;wbr&gt;OS&nbsp;&lt;wbr&gt;Lion&nbsp;&lt;wbr&gt;10.7.2后无法正常启动解决方案" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; " /></a><br />系统界面<br />&nbsp;<wbr><br /><a href="http://photo.blog.sina.com.cn/showpic.html#blogid=5a6efa330100x3sp&amp;url=http://s16.sinaimg.cn/orignal/5a6efa33gb2c608a8d51f" target="_blank" style="text-decoration: none; color: #3e6e2b; "><img name="image_operate_5321322463813171" src="http://s16.sinaimg.cn/middle/5a6efa33gb2c608a8d51f&amp;690" real_src="http://s16.sinaimg.cn/middle/5a6efa33gb2c608a8d51f&amp;690" alt="VMware虚拟机从Mac&nbsp;&lt;wbr&gt;OS&nbsp;&lt;wbr&gt;Lion&nbsp;&lt;wbr&gt;10.7.1更新到Mac&nbsp;&lt;wbr&gt;OS&nbsp;&lt;wbr&gt;Lion&nbsp;&lt;wbr&gt;10.7.2后无法正常启动解决方案" title="VMware虚拟机从Mac&nbsp;&lt;wbr&gt;OS&nbsp;&lt;wbr&gt;Lion&nbsp;&lt;wbr&gt;10.7.1更新到Mac&nbsp;&lt;wbr&gt;OS&nbsp;&lt;wbr&gt;Lion&nbsp;&lt;wbr&gt;10.7.2后无法正常启动解决方案" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; " /></a><br /><br /><br /><br />输入下载地址。如果很懒，也可以先下载，再发送到自己的邮箱中，再登陆自己邮箱下载，貌似更复杂？<br />&nbsp;<wbr><a href="http://photo.blog.sina.com.cn/showpic.html#blogid=5a6efa330100x3sp&amp;url=http://s5.sinaimg.cn/orignal/5a6efa33gb2c609ef8f64" target="_blank" style="text-decoration: none; color: #3e6e2b; "><img name="image_operate_54381322463607223" src="http://s5.sinaimg.cn/middle/5a6efa33gb2c609ef8f64&amp;690" real_src="http://s5.sinaimg.cn/middle/5a6efa33gb2c609ef8f64&amp;690" width="542" height="400" alt="VMware虚拟机从Mac&nbsp;&lt;wbr&gt;OS&nbsp;&lt;wbr&gt;Lion&nbsp;&lt;wbr&gt;10.7.1更新到Mac&nbsp;&lt;wbr&gt;OS&nbsp;&lt;wbr&gt;Lion&nbsp;&lt;wbr&gt;10.7.2后无法正常启动解决方案" title="VMware虚拟机从Mac&nbsp;&lt;wbr&gt;OS&nbsp;&lt;wbr&gt;Lion&nbsp;&lt;wbr&gt;10.7.1更新到Mac&nbsp;&lt;wbr&gt;OS&nbsp;&lt;wbr&gt;Lion&nbsp;&lt;wbr&gt;10.7.2后无法正常启动解决方案" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; " /></a><br /><br /><br />文件约1.5MB，很好下载的！<br />&nbsp;<wbr><a href="http://photo.blog.sina.com.cn/showpic.html#blogid=5a6efa330100x3sp&amp;url=http://s11.sinaimg.cn/orignal/5a6efa33gb2c60e4c27ba" target="_blank" style="text-decoration: none; color: #3e6e2b; "><img name="image_operate_7841322464207975" src="http://s11.sinaimg.cn/middle/5a6efa33gb2c60e4c27ba&amp;690" real_src="http://s11.sinaimg.cn/middle/5a6efa33gb2c60e4c27ba&amp;690" width="531" height="392" alt="VMware虚拟机从Mac&nbsp;&lt;wbr&gt;OS&nbsp;&lt;wbr&gt;Lion&nbsp;&lt;wbr&gt;10.7.1更新到Mac&nbsp;&lt;wbr&gt;OS&nbsp;&lt;wbr&gt;Lion&nbsp;&lt;wbr&gt;10.7.2后无法正常启动解决方案" title="VMware虚拟机从Mac&nbsp;&lt;wbr&gt;OS&nbsp;&lt;wbr&gt;Lion&nbsp;&lt;wbr&gt;10.7.1更新到Mac&nbsp;&lt;wbr&gt;OS&nbsp;&lt;wbr&gt;Lion&nbsp;&lt;wbr&gt;10.7.2后无法正常启动解决方案" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; " /></a><br /><br /><br />Transmac的界面，该软件可以读取览苹果文件系统HFS+，而且可以在PE环境下运行。但Transmac默认只能读取，因此需要设置。&nbsp;<wbr><br />&nbsp;<wbr><a href="http://photo.blog.sina.com.cn/showpic.html#blogid=5a6efa330100x3sp&amp;url=http://s7.sinaimg.cn/orignal/5a6efa33gb2c634480f96" target="_blank" style="text-decoration: none; color: #3e6e2b; "><img name="image_operate_41981322464438732" src="http://s7.sinaimg.cn/middle/5a6efa33gb2c634480f96&amp;690" real_src="http://s7.sinaimg.cn/middle/5a6efa33gb2c634480f96&amp;690" width="534" height="394" alt="VMware虚拟机从Mac&nbsp;&lt;wbr&gt;OS&nbsp;&lt;wbr&gt;Lion&nbsp;&lt;wbr&gt;10.7.1更新到Mac&nbsp;&lt;wbr&gt;OS&nbsp;&lt;wbr&gt;Lion&nbsp;&lt;wbr&gt;10.7.2后无法正常启动解决方案" title="VMware虚拟机从Mac&nbsp;&lt;wbr&gt;OS&nbsp;&lt;wbr&gt;Lion&nbsp;&lt;wbr&gt;10.7.1更新到Mac&nbsp;&lt;wbr&gt;OS&nbsp;&lt;wbr&gt;Lion&nbsp;&lt;wbr&gt;10.7.2后无法正常启动解决方案" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; " /></a><br /><br /><br />容许读写打开。关闭，再一次打开就会生效了。<br />&nbsp;<wbr><br /><a href="http://photo.blog.sina.com.cn/showpic.html#blogid=5a6efa330100x3sp&amp;url=http://s9.sinaimg.cn/orignal/5a6efa33gb2c611632c78" target="_blank" style="text-decoration: none; color: #3e6e2b; "></a><a href="http://photo.blog.sina.com.cn/showpic.html#blogid=5a6efa330100x3sp&amp;url=http://s15.sinaimg.cn/orignal/5a6efa33gb2c638509e9e" target="_blank" style="text-decoration: none; color: #3e6e2b; "><img name="image_operate_74161322464332543" src="http://s15.sinaimg.cn/middle/5a6efa33gb2c638509e9e&amp;690" real_src="http://s15.sinaimg.cn/middle/5a6efa33gb2c638509e9e&amp;690" width="544" height="401" alt="VMware虚拟机从Mac&nbsp;&lt;wbr&gt;OS&nbsp;&lt;wbr&gt;Lion&nbsp;&lt;wbr&gt;10.7.1更新到Mac&nbsp;&lt;wbr&gt;OS&nbsp;&lt;wbr&gt;Lion&nbsp;&lt;wbr&gt;10.7.2后无法正常启动解决方案" title="VMware虚拟机从Mac&nbsp;&lt;wbr&gt;OS&nbsp;&lt;wbr&gt;Lion&nbsp;&lt;wbr&gt;10.7.1更新到Mac&nbsp;&lt;wbr&gt;OS&nbsp;&lt;wbr&gt;Lion&nbsp;&lt;wbr&gt;10.7.2后无法正常启动解决方案" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; " /></a><br /><br /><br />找到/System/Library/Extensions/目录下，将AppleLSIFusionMPT.kext复制到此替换。</p><p style="margin-top: 0px; margin-right: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; word-wrap: normal; word-break: normal; text-indent: 2em; "><a href="http://photo.blog.sina.com.cn/showpic.html#blogid=5a6efa330100x3sp&amp;url=http://s10.sinaimg.cn/orignal/5a6efa33gb2c639c3af09" target="_blank" style="text-decoration: none; color: #3e6e2b; "></a><a href="http://photo.blog.sina.com.cn/showpic.html#blogid=5a6efa330100x3sp&amp;url=http://s9.sinaimg.cn/orignal/5a6efa33gb2c63b322688" target="_blank" style="text-decoration: none; color: #3e6e2b; "><img name="image_operate_13801322464435189" src="http://s9.sinaimg.cn/middle/5a6efa33gb2c63b322688&amp;690" real_src="http://s9.sinaimg.cn/middle/5a6efa33gb2c63b322688&amp;690" alt="VMware虚拟机从Mac&nbsp;&lt;wbr&gt;OS&nbsp;&lt;wbr&gt;Lion&nbsp;&lt;wbr&gt;10.7.1更新到Mac&nbsp;&lt;wbr&gt;OS&nbsp;&lt;wbr&gt;Lion&nbsp;&lt;wbr&gt;10.7.2后无法正常启动解决方案" title="VMware虚拟机从Mac&nbsp;&lt;wbr&gt;OS&nbsp;&lt;wbr&gt;Lion&nbsp;&lt;wbr&gt;10.7.1更新到Mac&nbsp;&lt;wbr&gt;OS&nbsp;&lt;wbr&gt;Lion&nbsp;&lt;wbr&gt;10.7.2后无法正常启动解决方案" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; " /></a><br /><br /><a href="http://photo.blog.sina.com.cn/showpic.html#blogid=5a6efa330100x3sp&amp;url=http://s3.sinaimg.cn/orignal/5a6efa33gb2c63c772302" target="_blank" style="text-decoration: none; color: #3e6e2b; "><img name="image_operate_9301322464399323" src="http://s3.sinaimg.cn/middle/5a6efa33gb2c63c772302&amp;690" real_src="http://s3.sinaimg.cn/middle/5a6efa33gb2c63c772302&amp;690" width="543" height="401" alt="VMware虚拟机从Mac&nbsp;&lt;wbr&gt;OS&nbsp;&lt;wbr&gt;Lion&nbsp;&lt;wbr&gt;10.7.1更新到Mac&nbsp;&lt;wbr&gt;OS&nbsp;&lt;wbr&gt;Lion&nbsp;&lt;wbr&gt;10.7.2后无法正常启动解决方案" title="VMware虚拟机从Mac&nbsp;&lt;wbr&gt;OS&nbsp;&lt;wbr&gt;Lion&nbsp;&lt;wbr&gt;10.7.1更新到Mac&nbsp;&lt;wbr&gt;OS&nbsp;&lt;wbr&gt;Lion&nbsp;&lt;wbr&gt;10.7.2后无法正常启动解决方案" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; " /></a><br /></p><p style="margin-top: 0px; margin-right: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; word-wrap: normal; word-break: normal; text-indent: 2em; "><br />&nbsp;<wbr><a href="http://photo.blog.sina.com.cn/showpic.html#blogid=5a6efa330100x3sp&amp;url=http://s11.sinaimg.cn/orignal/5a6efa33gb2c61332e9aa" target="_blank" style="text-decoration: none; color: #3e6e2b; "><img name="image_operate_56131322464429293" src="http://s11.sinaimg.cn/middle/5a6efa33gb2c61332e9aa&amp;690" real_src="http://s11.sinaimg.cn/middle/5a6efa33gb2c61332e9aa&amp;690" alt="VMware虚拟机从Mac&nbsp;&lt;wbr&gt;OS&nbsp;&lt;wbr&gt;Lion&nbsp;&lt;wbr&gt;10.7.1更新到Mac&nbsp;&lt;wbr&gt;OS&nbsp;&lt;wbr&gt;Lion&nbsp;&lt;wbr&gt;10.7.2后无法正常启动解决方案" title="VMware虚拟机从Mac&nbsp;&lt;wbr&gt;OS&nbsp;&lt;wbr&gt;Lion&nbsp;&lt;wbr&gt;10.7.1更新到Mac&nbsp;&lt;wbr&gt;OS&nbsp;&lt;wbr&gt;Lion&nbsp;&lt;wbr&gt;10.7.2后无法正常启动解决方案" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; " /></a><br /></p><p style="margin-top: 0px; margin-right: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; word-wrap: normal; word-break: normal; text-indent: 2em; "><a href="http://photo.blog.sina.com.cn/showpic.html#blogid=5a6efa330100x3sp&amp;url=http://s16.sinaimg.cn/orignal/5a6efa33gb2c63d9cc5bf" target="_blank" style="text-decoration: none; color: #3e6e2b; "><img name="image_operate_36161322464418123" src="http://s16.sinaimg.cn/middle/5a6efa33gb2c63d9cc5bf&amp;690" real_src="http://s16.sinaimg.cn/middle/5a6efa33gb2c63d9cc5bf&amp;690" width="536" height="301" alt="VMware虚拟机从Mac&nbsp;&lt;wbr&gt;OS&nbsp;&lt;wbr&gt;Lion&nbsp;&lt;wbr&gt;10.7.1更新到Mac&nbsp;&lt;wbr&gt;OS&nbsp;&lt;wbr&gt;Lion&nbsp;&lt;wbr&gt;10.7.2后无法正常启动解决方案" title="VMware虚拟机从Mac&nbsp;&lt;wbr&gt;OS&nbsp;&lt;wbr&gt;Lion&nbsp;&lt;wbr&gt;10.7.1更新到Mac&nbsp;&lt;wbr&gt;OS&nbsp;&lt;wbr&gt;Lion&nbsp;&lt;wbr&gt;10.7.2后无法正常启动解决方案" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; " /></a><br /><br /><br />&nbsp;</p></span><img src ="http://www.cppblog.com/lauer3912/aggbug/170356.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/lauer3912/" target="_blank">RTY</a> 2012-04-07 14:24 <a href="http://www.cppblog.com/lauer3912/archive/2012/04/07/170356.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>error C2143: syntax error : missing ';' before 'type' in Visual C++ 可能的原因</title><link>http://www.cppblog.com/lauer3912/archive/2012/04/05/170196.html</link><dc:creator>RTY</dc:creator><author>RTY</author><pubDate>Thu, 05 Apr 2012 11:53:00 GMT</pubDate><guid>http://www.cppblog.com/lauer3912/archive/2012/04/05/170196.html</guid><wfw:comment>http://www.cppblog.com/lauer3912/comments/170196.html</wfw:comment><comments>http://www.cppblog.com/lauer3912/archive/2012/04/05/170196.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/lauer3912/comments/commentRss/170196.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/lauer3912/services/trackbacks/170196.html</trackback:ping><description><![CDATA[<p style="color: #333333; font-family: Arial; line-height: 26px; text-align: left; background-color: #ffffff; ">今天偶然写了下面的程序(原来我写的程序不一样，下面的只是为了把问题简化)</p><p style="color: #333333; font-family: Arial; line-height: 26px; text-align: left; background-color: #ffffff; ">&nbsp;</p><p style="color: #333333; font-family: Arial; line-height: 26px; text-align: left; background-color: #ffffff; "></p><div bg_cpp"="" style="width: 687px; "><div><div><strong>[cpp]</strong>&nbsp;<a href="http://blog.csdn.net/cdjogh/article/details/5961742#" title="view plain" style="background-image: url(http://static.blog.csdn.net/scripts/SyntaxHighlighter/styles/images/default/ico_plain.gif); padding-top: 1px; padding-right: 1px; padding-bottom: 1px; padding-left: 1px; display: inline-block; width: 16px; height: 16px; text-indent: -2000px; background-position: 0% 0%; background-repeat: no-repeat no-repeat; ">view plain</a><a href="http://blog.csdn.net/cdjogh/article/details/5961742#" title="copy" style="background-image: url(http://static.blog.csdn.net/scripts/SyntaxHighlighter/styles/images/default/ico_copy.gif); padding-top: 1px; padding-right: 1px; padding-bottom: 1px; padding-left: 1px; display: inline-block; width: 16px; height: 16px; text-indent: -2000px; background-position: 0% 0%; background-repeat: no-repeat no-repeat; ">copy</a><div style="position: absolute; left: 557px; top: 420px; width: 18px; height: 18px; z-index: 99; border-image: initial; "><embed id="ZeroClipboardMovie_1" src="http://static.blog.csdn.net/scripts/ZeroClipboard/ZeroClipboard.swf" loop="false" menu="false" quality="best" bgcolor="#ffffff" width="18" height="18" name="ZeroClipboardMovie_1" align="center" allowscriptaccess="always" allowfullscreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="id=1&amp;width=18&amp;height=18" wmode="transparent"></div></div></div><ol start="1"><li style="border-width: initial; border-color: initial; line-height: 18px; ">void&nbsp;foo()&nbsp;&nbsp;</li><li style="border-width: initial; border-color: initial; line-height: 18px; ">{&nbsp;&nbsp;</li><li style="border-width: initial; border-color: initial; line-height: 18px; ">&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #2e8b57; font-weight: bold; ">int</span>&nbsp;p&nbsp;=&nbsp;0;&nbsp;&nbsp;</li><li style="border-width: initial; border-color: initial; line-height: 18px; ">&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(&nbsp;p&nbsp;==&nbsp;0&nbsp;)&nbsp;&nbsp;</li><li style="border-width: initial; border-color: initial; line-height: 18px; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #2e8b57; font-weight: bold; ">int</span>&nbsp;i&nbsp;=&nbsp;0;&nbsp;&nbsp;</li><li style="border-width: initial; border-color: initial; line-height: 18px; ">&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #2e8b57; font-weight: bold; ">int</span>&nbsp;a;&nbsp;&nbsp;</li><li style="border-width: initial; border-color: initial; line-height: 18px; ">}&nbsp;&nbsp;</li><li style="border-width: initial; border-color: initial; line-height: 18px; ">&nbsp;&nbsp;</li><li style="border-width: initial; border-color: initial; line-height: 18px; "><span style="color: #2e8b57; font-weight: bold; ">int</span>&nbsp;main()&nbsp;&nbsp;</li><li style="border-width: initial; border-color: initial; line-height: 18px; ">{&nbsp;&nbsp;</li><li style="border-width: initial; border-color: initial; line-height: 18px; ">&nbsp;&nbsp;&nbsp;&nbsp;foo();&nbsp;&nbsp;</li><li style="border-width: initial; border-color: initial; line-height: 18px; ">}&nbsp;&nbsp;</li></ol></div>&nbsp;&nbsp;<span style="color: #333333; font-family: Arial; line-height: 26px; text-align: left; background-color: #ffffff; ">本文来自CSDN博客，转载请标明出处：</span><a href="http://blog.csdn.net/fancylea/archive/2009/06/10/4256793.aspx" style="color: #336699; text-decoration: none; font-family: Arial; line-height: 26px; text-align: left; background-color: #ffffff; ">http://blog.csdn.net/fancylea/archive/2009/06/10/4256793.aspx</a>&nbsp;<br /><p>&nbsp;</p><p style="color: #333333; font-family: Arial; line-height: 26px; text-align: left; background-color: #ffffff; ">&nbsp;</p><p style="color: #333333; font-family: Arial; line-height: 26px; text-align: left; background-color: #ffffff; ">不幸的是偶然将这个文件保存成了test.c，然后编译的时候出现了</p><p style="color: #333333; font-family: Arial; line-height: 26px; text-align: left; background-color: #ffffff; ">&nbsp;</p><p style="color: #333333; font-family: Arial; line-height: 26px; text-align: left; background-color: #ffffff; ">error， error C2143: syntax error : missing ';' before 'type'</p><p style="color: #333333; font-family: Arial; line-height: 26px; text-align: left; background-color: #ffffff; ">&nbsp;</p><p style="color: #333333; font-family: Arial; line-height: 26px; text-align: left; background-color: #ffffff; ">感觉很奇怪,细细看来所有的语法都似乎都是对的，更奇怪的是把文件改成cpp或者cc能正常编译，把int a;和if调换下也能正常编译。这样的错误可能发生在当变量的声明放在可执行代码之后。而这个是在K&amp;R C中规定的，但在ANSI C中废除。</p><p style="color: #333333; font-family: Arial; line-height: 26px; text-align: left; background-color: #ffffff; ">MSDN (<a href="http://support.microsoft.com/kb/58559" style="color: #336699; text-decoration: none; ">http://support.microsoft.com/kb/58559</a>)给出的解释如下：</p><p style="color: #333333; font-family: Arial; line-height: 26px; text-align: left; background-color: #ffffff; ">&nbsp;</p><hr style="color: #333333; font-family: Arial; line-height: 26px; text-align: left; background-color: #ffffff; " /><p style="color: #333333; font-family: Arial; line-height: 26px; text-align: left; background-color: #ffffff; ">&nbsp;</p><p style="color: #333333; font-family: Arial; line-height: 26px; text-align: left; background-color: #ffffff; ">In Microsoft C, compiler errors C2143 and C2144 are defined as follows:</p><div style="color: #333333; font-family: Arial; line-height: 26px; text-align: left; background-color: #ffffff; "><div><div>&nbsp;&nbsp;&nbsp; C2143: syntax error : missing 'token1' before 'token2'<br />&nbsp;&nbsp;&nbsp; C2144: syntax error : missing 'token' before type 'type'</div></div></div><p style="color: #333333; font-family: Arial; line-height: 26px; text-align: left; background-color: #ffffff; ">&nbsp;</p><p style="color: #333333; font-family: Arial; line-height: 26px; text-align: left; background-color: #ffffff; ">You may receive this error message if your program places executable code before a data declaration, an acceptable practice in Kernighan-and-Ritchie C. This practice has been outlawed in later versions of the ANSI drafts.&nbsp;<br /><br />This error message will normally occur if a required closing curly brace (}), right parenthesis [)], or semicolon (;) is missing.</p><hr style="color: #333333; font-family: Arial; line-height: 26px; text-align: left; background-color: #ffffff; " /><p style="color: #333333; font-family: Arial; line-height: 26px; text-align: left; background-color: #ffffff; ">&nbsp;</p><p style="color: #333333; font-family: Arial; line-height: 26px; text-align: left; background-color: #ffffff; ">注: The C Programming Language的作者简称K&amp;R，也是C语言之父, 经常用K&amp;R C来和ANSI C做对比。这本书的第二版已经用ANSI.</p><p style="color: #333333; font-family: Arial; line-height: 26px; text-align: left; background-color: #ffffff; ">我用的编译器是VS2008, 看来微软向来无视标准。</p><p style="color: #333333; font-family: Arial; line-height: 26px; text-align: left; background-color: #ffffff; ">&nbsp;</p><p style="color: #333333; font-family: Arial; line-height: 26px; text-align: left; background-color: #ffffff; ">总结：</p><p style="color: #333333; font-family: Arial; line-height: 26px; text-align: left; background-color: #ffffff; ">在 ANSI C或者C++中，在可执行代码中随时定义变量是允许的，但是在K&amp;R C中是不允许的，VS2008实现的C竟然是K&amp;R C。注意这样的错误也体现在VS中要是用for (int i = 0; i++; i&lt;10)同时你的文件名是.c的也会出现这样的错误。</p><p style="color: #333333; font-family: Arial; line-height: 26px; text-align: left; background-color: #ffffff; ">&nbsp;</p><p style="color: #333333; font-family: Arial; line-height: 26px; text-align: left; background-color: #ffffff; ">Code complete中讨论过变量名的最迟绑定有利于增加代码的可读性等。所以在VS中写c要注意了。</p><img src ="http://www.cppblog.com/lauer3912/aggbug/170196.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/lauer3912/" target="_blank">RTY</a> 2012-04-05 19:53 <a href="http://www.cppblog.com/lauer3912/archive/2012/04/05/170196.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>CL.exe的全部命令开关(摘) - 酱坛子 - C++博客 </title><link>http://www.cppblog.com/lauer3912/archive/2012/03/30/169568.html</link><dc:creator>RTY</dc:creator><author>RTY</author><pubDate>Fri, 30 Mar 2012 12:46:00 GMT</pubDate><guid>http://www.cppblog.com/lauer3912/archive/2012/03/30/169568.html</guid><wfw:comment>http://www.cppblog.com/lauer3912/comments/169568.html</wfw:comment><comments>http://www.cppblog.com/lauer3912/archive/2012/03/30/169568.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/lauer3912/comments/commentRss/169568.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/lauer3912/services/trackbacks/169568.html</trackback:ping><description><![CDATA[<div>导读： <br /> <br /><p>/C:在预处理输出中保留注释语句<br />/c:只编译，不连接，相当于在"Build"菜单下选择了"Compile"<br />/D:定义常量和宏，与源程序里的#define 有相同效果<br />/E:预处理C、C＋＋源文件，将源文件中所有的预编译指令及宏展开，将注释去掉，然后将预处理器的输出拷贝至标准输出设备输出，并且在每个文件的开头和末尾加入#line<br />/EH:指定编译器用何种异常处理模型<br />/EP:同/E,只是去掉了#line<br />/F:设置程序的堆栈大小<br />/FA:设置生成何种列表文件（汇编、汇编与机器码、汇编与源码、汇编与机器码以及源码）<br />/Fa:指定用/FA设置的列表文件的存放路径及（或）文件名<br />/FD:生成文件的相互依赖信息<br />/Fd:设置程序数据库文件（PDB）的存放路径及（或）文件名<br />/Fe:设置最终可执行文件的存放路径及（或）文件名<br />/FI:预处理指定的头文件，与源文件中的＃include有相同效果<br />/Fm:创建map文件<br />/Fo:设置编译后Obj文件的存放路径及（或）文件名<br />/Fp:设置预编译文件（pch）的存放路径及（或）文件名<br />/FR:生成浏览信息（sbr）文件<br />/Fr:同/FR,不同之处在于/Fr不包括局部变量信息<br />/G3:为80386处理器优化代码生成<br />/G4:为80486处理器优化代码生成<br />/G5:为Pentium处理器优化代码生成<br />/G6:为Pentium Pro处理器优化代码生成<br />/GA:为Windows应用程序作优化<br />/GB:为Pentium处理器优化代码生成，使用80386、80486、Pentium、Pentium Pro的混合指令集，是代码生成的默认选项（程序属性选项中Processor对应Blend）<br />/GD:为Windows动态库（dll）作优化，此开关在VC6中没有实现<br />/Gd:指定使用__cdecl的函数调用规则<br />/Ge:激活堆栈检测<br />/GF:消除程序中的重复的字符串，并将她放到只读的缓冲区中<br />/Gf:消除程序中的重复字符串<br />/Gh:在每个函数的开头调用钩子（hook）函数--penter<br />/Gi:允许渐进编译<br />/Gm:允许最小化rebuild<br />/GR:允许运行时类型信息(Run-Time Type Infomation)<br />/Gr:指定使用__fastcall的函数调用规则<br />/Gs:控制堆栈检测所用内存大小<br />/GT:支持用__declspec(thread)分配的数据的fier-safety<br />/GX:允许同步异常处理，与/EHsc开关等价<br />/Gy:允许编译器将每一个函数封装成COMDATs的形式，供连接器调用<br />/GZ:允许在Debug build 的时候捕捉Release build的错误<br />/Gz:指定使用__stdcall的函数调用规则<br />/H:限制外部名字的长度<br />/HELP:列出编译器的所有的命令开关<br />/I:指定头文件的搜索路径<br />/J:将char的缺省类型从signed char改成unsigned char<br />/LD:创建一个动态连接库<br />/LDd:创建一个Debug版本的动态链接库<br />/link:将指定的选项传给连接器<br />/MD:选择多线程、DLL版本的C Run－Time库<br />/MDd:选择多线程、DLL、Debug版本的C Run－Time库<br />/ML:选择单线程版本的C Run&#8212;Time库<br />/MLd:选择单线程、Debug版本的C Run&#8212;Time库<br />/MT:选择多线程版本的C Run-Time库<br />/MTd:选择多线程、Debug版本的C Run&#8212;Time库<br />/nologo:不显示程序的版权信息<br />/O1:优化使产生的可执行代码最小<br />/O2:优化使产生的可执行代码速度最快<br />/Oa:指示编译器程序里没有使用别名，可以提高程序的执行速度<br />/Ob:控制内联（inline）函数的展开<br />/Od:禁止代码优化<br />/Og:使用全局优化<br />/Oi:用内部函数去代替程序里的函数调用，可以使程序运行的更快，但程序的长度变长<br />/Op:提高浮点数比较运算的一致性<br />/Os:产生尽可能小的可执行代码<br />/Ot:产生尽可能块的可执行代码<br />/Ow:指示编译器在函数体内部没有使用别名<br />/Ox:组合了几个优化开关，达到尽可能多的优化<br />/Oy:阻止调用堆栈里创建帧指针<br />/Q1f:对核心级的设备驱动程序生成单独的调试信息<br />/QI0f:对Pentium 0x0f错误指令作修正<br />/Qifdiv:对Pentium FDIV错误指令作修正<br />/P:将预处理输出写到指定文件里，文件的后缀名为I<br />/TC:将命令行上的所有文件都当作C源程序编译，不管后缀名是否为.c<br />/Tc:将指定的文件当作C源程序编译，不管后缀名是否为.c<br />/TP:将命令行上的所有文件都当作C＋＋源程序编译，不管后缀名是否为.cpp<br />/Tp:将指定文件当作C＋＋源程序编译，不管后缀名是否为.cpp<br />/U:去掉一个指定的前面定义的符号或常量<br />/u:去掉所有前面定义的符号或常量<br />/V:在编译的obj文件里嵌入版本号<br />/vd:禁止/允许构造函数置换<br />/vmb:选择指针的表示方法，使用这个开关，在声明指向某个类的成员的指针之前，必须先定义这个类<br />/vmg:选择指针的表示方法，使用这个开关，在声明指向某个类的成员的指针之前，不必先定义这个类，但要首先指定这个类是使用何种继承方法<br />/vmm:设置指针的表示方法为Single Inheritance and Multiple Inheritance<br />/vms:设置指针的表示方法为Single Inheritance<br />/vmv:设置指针的表示方法为Any class<br />/W:设置警告等级<br />/w:禁止所有警告<br />/X:阻止编译器搜索标准的include 目录<br />/Yc:创建预编译头文件（pch）<br />/Yd:在所有的obj文件里写上完全的调试信息<br />/Yu:在build过程中使用指定的预编译头文件<br />/YX:指示编译器若预编译头文件存在，则使用它，若不存在，则创建一个<br />/Z7:生成MSC7.0兼容的调试信息<br />/Za:禁止语言扩展(Microsoft Extensions to C)<br />/Zd:调试信息只包含外部和全局的符号信息以及行号信息<br />/Ze:允许语言扩展(Microsoft Extensions to C)<br />/Zg:为源文件里面定义的每个函数生成函数原型<br />/ZI:生成程序库文件（Pdb）并支持Edit and Continue调试特性<br />/Zi:生成程序库文件（pdb），包含类型信息和符号调试信息<br />/ZL:从obj文件里去掉缺省的库文件名<br />/Zm:设置编译器的内存分配xianzhi<br />/Zn:禁止浏览信息文件里面的封装<br />/Zp:设置结构成员在内存里面的封装格式<br />/Zs:快速检查语法错误<br />－－－－－－－－－－－－－－－－－－－－－－－－－－<br />vc所支持的文件类型</p> <br /><p>DSW:全称是Developer Studio Workspace，最高级别的配置文件，记录了整个工作空间的配置信息，她是一个纯文本的文件，在vc创建新项目的时候自动生成<br />DSP:全称是Developer Studio Project，也是一个配置文件，不过她记录的是一个项目的所有配置信息，纯文本文件<br />OPT：与DSW、DSP配合使用的配置文件，她记录了与机器硬件有关的信息，同一个项目在不同的机器上的opt文件内容是不同的<br />CLW：记录了跟ClassWizard相关的信息，如果丢失了clw文件，那么在Class View面板里就没有类信息<br />PLG：实际上是一个超文本文件，可以用Internet Explorer打开，记录了Build的过程，是一个日志型文件<br />RC：资源描述文件，记录了所有的资源信息，在资源编辑器里作的修改，实际上都是对RC文件的修改<br />RC2：附加的资源描述文件，不能直接资源编辑器修改，只能手工添加，可以用来添加额外的资源<br />RES：经过资源编辑器编译之后的资源文件，以二进制方式存放<br />SBR：编译器生成的浏览信息文件，在代码导航的时候非常有用，她需要在编译时指定/FR或者/Fr开关<br />BSC：BSCMAKE.EXE将所有的SBR文件作为输入，经过处理之后输出一个BSC文件，在代码导航的时候实际用到的是BSC文件<br />ILK：当选定渐增型编译连接时，连接器自动生成ILK文件，记录连接信息<br />PDB：全称是Program DataBase，即程序数据库文件，用来记录调试信息，是一个相当重要的文件，没有他，程序无法正常调试<br />LIB：如果项目输出是Dll的话，一般会输出一个跟项目同名的Lib文件，记录输出的函数信息<br />EXP：同Lib，是跟Dll一起生成的输出文件<br />PCH：全称是PreCompiled Header，就是预先编译好的头文件，在编译时指定/Yu开关时编译器自动生成</p><br /><br />本文转自 <br /><a href="http://www.cppblog.com/sunraiing9/archive/2007/11/26/37323.html">http://www.cppblog.com/sunraiing9/archive/2007/11/26/37323.html</a></div><img src ="http://www.cppblog.com/lauer3912/aggbug/169568.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/lauer3912/" target="_blank">RTY</a> 2012-03-30 20:46 <a href="http://www.cppblog.com/lauer3912/archive/2012/03/30/169568.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Windows平台下的调试技术 - 小夜曲的孤伤 - 博客大巴 </title><link>http://www.cppblog.com/lauer3912/archive/2012/03/30/169567.html</link><dc:creator>RTY</dc:creator><author>RTY</author><pubDate>Fri, 30 Mar 2012 12:45:00 GMT</pubDate><guid>http://www.cppblog.com/lauer3912/archive/2012/03/30/169567.html</guid><wfw:comment>http://www.cppblog.com/lauer3912/comments/169567.html</wfw:comment><comments>http://www.cppblog.com/lauer3912/archive/2012/03/30/169567.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/lauer3912/comments/commentRss/169567.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/lauer3912/services/trackbacks/169567.html</trackback:ping><description><![CDATA[<div>导读： <br /><br /> <br /><p style="line-height: 180%"><a href="http://creativecommons.org/licenses/by/3.0/deed.zh" target="_blank">版权声明</a>：转载时请以超链接形式标明文章原始出处和作者信息及<a href="http://bangzhuzhongxin.blogbus.com/logs/11205960.html" target="_blank">本声明</a><br /><a href="http://chenshine.blogbus.com/logs/4414354.html">http://chenshine.blogbus.com/logs/4414354.html</a><br /><br /></p> <br /><div style="padding-right: 10px; padding-left: 10px; padding-bottom: 10px; padding-top: 10px">刚 进入计算机相关专业领域时，大家最先用过的调试器大多会是Turbo C。它虽然古老但用过的人却很多，然而严格的讲，Turbo  C是一个集成开发环境，虽然拥有独立的编译器，链接器，却没有独立的调试器，这和Visual  Studio一样。如果你做过DOS，早期Windows下的汇编，也许你会对Debug，CodeView等调试工具熟悉，但这些工具太老 了，Debug甚至不能调试32位程序，介绍它们与这篇文章的主旨不符，如果你对它们感兴趣，可以去查阅相关资料。本文主要是介绍与调试技术相关的理论知 识以及常用调试器的使用，Windows设备驱动程序与内核的调试等。具体的讲解方法是理论结合实践，并且是站在给新手看的角度，循序渐进的，用一个一个 调试会话向你展示每个重要命令的使用。</div> <br /><hr style="color: blue" /> <br />目录<br /><br />1。调试器<br />2。调试信息<br />3。用户模式程序的调试<br />4。驱动程序与内核的调试<br /><br /><span style="color: #0033ff">1 调试器</span><br /><br /><span style="color: #0033ff">1。1 概览</span><br /><br />调 试器，与编译器，链接器一样，都属于基础软件，它们在制作上都有很大的难度，但尽管如此，现实中还是有不少专业级的调试器，微软官方的就有 cdb，ntsd，WinDbg，kd等，还有SoftIce，OllyDbg等来自于其它公司的优秀调试器。本文不可能对这几个调试器一一介绍，一个是 限于篇幅，另一个是上面列举的这几个调试器无论是哪一个都需要你花很长的时间去完全掌握（在市面上有很多书籍甚至专门讲解某一个调试器的使用，比如 SoftIce）。虽然本文不会讲解SoftIce的详细使用，但我还是要对它进行简短的介绍，因为它太有名了，甚至比Windows出生的早。<br /><br /><span style="color: #0033ff">1。2 SoftIce</span><br /><br />SoftIce 是NuMega公司生产的调试器，产于80年代后期，直到今天为止，这个软件已经变革过好几次了，因为处理器的体系结构在更新，操作系统也在更新，所以调 试器也必须相应的更新。它之所以有名，那是与历史有关的，在Intel推出386 Cpu的时候，NuMega立即让SoftIce支持了386  Cpu的新特性，同时吸引了大量黑客的使用，使它在黑客界产生了一定的地位(功能强大的调试器可以对软件的保护机制进行破解，如突破序列号之类的)。在 Windows推出时，所有的调试器都不适用这种新的系统软件体系结构了，唯一能用的就是微软自己生产的调试器，却很拙劣，这时NuMega又对 SoftIce进行了变革，不仅让它可以在新的系统上很好的工作，甚至还可以调试Windows的内核，这是当时是不敢想象的。也正是因为它很好的性能， 卓越的功能，它成为了黑客们的宠儿，并且培养了几代的黑客。读完本文后，你自己应该有能力去探索它，或许你也可以在这几款调试器里找到适合自己的。<br /><br style="color: #0033ff" /><span style="color: #0033ff">1。3 微软的调试工具</span><br /><br />本 文主要介绍的是微软官方的调试器，并且MS微软也最积极，调试工具包一直在更新中。在微软的调试器里，大家可能最为熟悉Visual Studio  Debugger，就是你在Visual C++里使用的那个，它并不是一个单独可运行的程序，而是内嵌在Visual  Studio中的，它的功能相对于上面几个调试器来说要弱很多，这里并不会对它进行介绍，如果你想全方面的了解它的话，你可以去参考MSDN，那里专门有 几章讲解它，是一份很好的文档化的资源(而且还是中文的)。其它的微软调试工具cdb，ntsd，WinDbg，kd都在微软的一个安装包里，被称作<a href="http://www.microsoft.com/whdc/devtools/debugging/default.mspx" target="_blank">Debugging Tools for Windows</a>(10 多M的大小，请通过这个链接下载并安装，一会儿就要用到)。这些调试器在下文中会分别介绍，这里先做一个简单的区别，cdb与ntsd几乎是一样的程序， 唯一的不同是cdb是一个CUI程序，即Console程序，而ntsd是GUI程序，但ntsd并没有产生窗口，而是又分配了一个Console窗口， 这个Console窗口就相当于是cdb。它与真正的cdb执行完全一样的功能(官方如是说，然而实际上还有一些个不同)。在命令行中启动它们时下面两句 命令有一样的效果(C:/Progs/Debug是调试工具包的安装位置)：<br /><br /><pre style="border-right: #b78c67 1px solid; padding-right: 8px; border-top: #b78c67 1px solid; margin-top: 10px; padding-left: 8px; padding-bottom: 3px; margin-left: 15px; border-left: #b78c67 1px solid; width: 90%; padding-top: 5px; border-bottom: #b78c67 1px solid; font-family: 'Courier New',Fixedsys; background-color: #edeef0">C:/Progs/Debug/&gt;start cdb<br />C:/Progs/Debug/&gt;ntsd<br /></pre><br />cdb 与ntsd是用来调试用户模式应用程序的。kd调试器也是一个命令行程序，不过正如其名kernel  debugger所描述的一样，它是内核调试器的，是驱动程序开发者，系统Hacker的最爱。WinDbg是一个称职的GUI程序，它有菜单，有工具 栏，还有多个子窗口，可以分别显示源代码，调用栈，命令等，它既可以调试ring 0程序，也可以调试ring  3程序，其实它只是一个壳而已，当调试ring 3级程序时它实际上是用cdb/ntsd，而当调试ring  0级程序时是用kd。WinDbg的到来吸引了很多的人使用，你也将会发现，它确实是一款优秀的调试器。<br /><br />2 调试信息<br /><br />调试器之所以能够工作，完全是依赖于编译和链接程序时所生成的调试信息，当然调试信息是具有一定的格式的。<br /><br /><span style="color: #0033ff">2。1 格式</span><br /><br />微 软的调试信息格式经过了几代变化，最终形成了Program  DataBase这种格式，并且这种格式还在进行版本上的更新，VS.Net所用的新的Program DataBase版本与Visual C++  6.0所用的老的版本是不兼容的，并且你也可以用编译器和链接器明确指定你想要生成的调试信息格式，这一点下文中有阐述。<br /><br /><span style="color: #0033ff">2。2 内容</span><br /><br />关 于调试信息我们还必须知道两件事，一是调试信息包括哪些内容，二是调试信息储存在什么地方。其实调试信息所应该包括的内容正是调试信息格式变化的原因，从 COFF格式，到CodeView格式，到Program DataBase格式，调试信息变得越来越丰富了，并且是只多不少。Program  DataBase格式的调试信息中主要包括了所有全局函数，static  函数，全局变量，static变量，局部变量，函数形参的名字及其位置，源代码与可执行文件中指令的映射信息，每个函数与变量的类型，以及FPO信息，编 辑和继续信息。编辑与继续信息主要用于在Visual Studio中调试时，可以在调试的同时编辑源代码，并在接下来的调试中得到体现。Program  DataBase格式的调试信息包含了这么多的内容，所以用这种调试信息来调试程序时，你将能够得到更多，更准确，更深入的反馈。<br /><br /><span style="color: #0033ff">2。3 存储位置</span><br /><br />调 试信息的存储位置是与其格式相关的，Program  DataBase格式的调试信息存储在一个单独的文件里，扩展名为pdb。像以前的CodeView格式的调试信息即可存储在单独的文件里，又可存储在编 译时所生成的obj文件中。知道了这些知识后，我们就可以正确地生成调试信息了。在后面的内核调试中我们还要继续谈到它。<br /><br /><span style="color: #0033ff">3 用户模式程序的调试</span><br /><br />根 据上面的讲述，我们可以用cdb或WinDbg来进行ring  3程序的调试，这里先讲解cdb。cdb允许你启动某个被调试程序(以下称debugee)的一个新的实例来进行调试，即先创建cdb，然后cdb再把你 所指定的程序创建为一个新进程进而对其调试，也允许debugee在已经运行的情况下被cdb attach上。cdb还可以对Crash  Dump(程序崩溃时的内存Copy，下文将会说明)进行调试，只需要加上-z选项，后面再加上Crash  Dump的文件名即可。这几种调试方式下面将会一一讲述。<br /><br />3。1 调试前的准备<br /><br />第 2节中对调试信息进行了理论上的说明，接下来我们来看看在实际中应该如何操作。首先我们的程序必须要经过编译，链接，并且在编译和链接时还要指定一些选项 以正确地生成调试信息。这里所使用的编译器是cl.exe，链接器是link.exe，都是微软官方的，Visual  Studio就是用的这两个(CTRL+F5就是顺序调用cl和link的快捷键)，如果你安装了Visual C++或Visual  Studio，就会有它们，另外一种选择是安装SDK，也能够得到它们。本文所用的cl.exe和link.exe是Visual C++  6.0的版本。若要生成调试信息，编译时我们需要加上的选项应是/Zi，而链接时则要加上/debug。在下面的调试中，我们将用C语言来写程序，所以你 有必要知道用C语言写出来的程序与用汇编写出来的有什么不同。首先，每个程序都有一个入口函数，它的地址需要在链接时指定，并被链接器放到最终可执行文件 的头部，通常用汇编语言写的程序，有选择的，你可以在源代码中指定入口函数，而用C语言写的程序则需要在链接的时候来指定入口函数，说到这你可能不以为 然，&#8220;C语言写的程序的入口函数不就是main吗？&#8220;。实际上，控制台C程序的入口函数默认情况下是C运行时的启动函数：mainCRTStartup。 然后由这个函数调用你写的main函数，所以可执行文件的头部存放的入口地址是mainCRTStartup的地址，而不是你写的main函数地址。 mainCRTStartup主要做了一些为了正确执行C/C++程序的初始化工作。它已经由微软写好了，由链接器自动链接到可执行文件中。如果你在程序 中不使用C语言的库以及一些ANSI规定的全局变量，只是单纯地使用C语言这种语法，那么你也可以不链接mainCRTStartup，直接指定你自己写 的某个函数为入口函数，这也是我们在下文中所使用的方法，具体的做法是在链接时加入如下选项：/subsystem:console  /entry:你的入口函数名称。这个入口函数应该是不带参数的。现在我们来总结一下上面所讲的内容，假定你的源程序名为exam.c，你想指定的入口函 数为main，那么应该如下生成可执行程序：<br /><br /><pre style="border-right: #b78c67 1px solid; padding-right: 8px; border-top: #b78c67 1px solid; margin-top: 10px; padding-left: 8px; padding-bottom: 3px; margin-left: 15px; border-left: #b78c67 1px solid; width: 90%; padding-top: 5px; border-bottom: #b78c67 1px solid; font-family: 'Courier New',Fixedsys; background-color: #edeef0">C:/Pro/&gt;cl /Zi exam.c /link /debug /subsystem:console /entry:main</pre>另 外，就算你不链接mainCRTStartup(它会调用很多的Win32  API)，也不在源程序中调用任何的系统函数。那么系统还是会把一些动态链接库，如kernel32.dll，Ntdll.dll等动态链接到你的程序所 对应的进程里，即把它们映射到你的程序对应的进程地址空间里。这是因为在你所指定的入口函数运行之前，还会有一系列的 Kernel32.dll，Ntdll.dll中的函数要运行。即在用户空间中你指定的入口函数，例如上面的main，根本不是第一个运行的函数。那么那 些函数是做什么的呢，通过大量的反汇编和调试能够推断出它们是做一些进程，线程在用户空间的初始化，设置一些异常桢等。在下面的调试中我们将会用一些手段 来研究它们。这些函数是操作系统的一部分，因些我们必须从官方网站下载它的符号文件，当然不下载也行，那么你将面临的会是一大堆的警告。说到下载，没有比 这更简单的了，你不需要预先的下载，只需要添加一个环境变量_NT_SYMBOL_PATH即可，而真正的下载工作由调试器来做，这个环境变量的值与已存 在的PATH环境变量类似，是由分号分隔的一系列的路径组成。这些路径应该包括你的调试信息文件(pdb文件)所在地，如前面的C:/Pro/。如果要下 载系统文件如Kernel32.dll，Ntdll.dll的pdb文件，你仅仅需要再加一个这样的路径：SRV*D:/Symbols*http: //msdl.microsoft.com/download/symbols，其中D:/Symbols是可更换的，你可以换成任何一个其它的路径，这 个D:/Symbls是用来存放从后面的URL路径所下载下来的系统调试信息文件的。其实你也可以预先下载系统调试信息文件到一个路径里，然后在 _NT_SYMBOL_PATH里指定那个目录，但这样一来有两个缺点，一是你必须得进行版本的匹配，做这件事简直太乏味了，二是你一次需要把整个操作系 统的调试信息文件都下载下来，可能会需要1G的空间。而通过前面设置环境变量的方式，调试器会根据需要只下载这次调试会话所需要的调试信息文件，并且它会 自动给你匹配版本。由于我们将要编写的源代码都在C:/Pro/文件夹中，生成的pdb文件也在C:/Pro/中，所以我们的 _NT_SYMBOL_PATH环境变量应该如下设置，假设你希望系统pdb文件下载到D:/Symbols：<br /><pre style="border-right: #b78c67 1px solid; padding-right: 8px; border-top: #b78c67 1px solid; margin-top: 10px; padding-left: 8px; padding-bottom: 3px; margin-left: 15px; border-left: #b78c67 1px solid; width: 90%; padding-top: 5px; border-bottom: #b78c67 1px solid; font-family: 'Courier New',Fixedsys; background-color: #edeef0">C:/Pro/&gt;set _NT_SYMBOL_PATH=SRV*D:/Symbols*http://msdl.microsoft.com/download/symbols;C:/Pro/<br /></pre>最后，我们需要在命令行中启动cdb调试器，但当前目录通常是源代码文件夹C:/Pro/，为了避免如下冗余的键入：<br /><br /><pre style="border-right: #b78c67 1px solid; padding-right: 8px; border-top: #b78c67 1px solid; margin-top: 10px; padding-left: 8px; padding-bottom: 3px; margin-left: 15px; border-left: #b78c67 1px solid; width: 90%; padding-top: 5px; border-bottom: #b78c67 1px solid; font-family: 'Courier New',Fixedsys; background-color: #edeef0">C:/Pro/&gt;<span style="color: #ff0000">C:/Progs/Debug/</span>cdb example1.exe</pre>应该为cdb，ntsd，WinDbg设置PATH环境变量：<br /><br /><pre style="border-right: #b78c67 1px solid; padding-right: 8px; border-top: #b78c67 1px solid; margin-top: 10px; padding-left: 8px; padding-bottom: 3px; margin-left: 15px; border-left: #b78c67 1px solid; width: 90%; padding-top: 5px; border-bottom: #b78c67 1px solid; font-family: 'Courier New',Fixedsys; background-color: #edeef0">C:/Pro/&gt;set PATH=%PATH%;C:/Progs/Debug/</pre>这里的C:/Progs/Debug是Debugging Tools for Windows的安装目录。以后就可以这样来调试了：<br /><br /><pre style="border-right: #b78c67 1px solid; padding-right: 8px; border-top: #b78c67 1px solid; margin-top: 10px; padding-left: 8px; padding-bottom: 3px; margin-left: 15px; border-left: #b78c67 1px solid; width: 90%; padding-top: 5px; border-bottom: #b78c67 1px solid; font-family: 'Courier New',Fixedsys; background-color: #edeef0">C:/Pro/&gt;cdb example1.exe</pre><br /><span style="color: #0033ff">3。2 cdb启动新实例的调试</span><br /><br /><span style="color: #0033ff">3。2。1 编写一源程序，启动cdb</span><br /><br />首先我编写了下面的C程序，先用这个程序来介绍一些基本的命令，并且来验证一下调试信息中是否确切包含了上面所说的那些内容:<br /><br /><span style="color: #0033ff">[example1.c]</span><br /><pre style="border-right: #b78c67 1px solid; padding-right: 8px; border-top: #b78c67 1px solid; margin-top: 10px; padding-left: 8px; padding-bottom: 3px; margin-left: 15px; border-left: #b78c67 1px solid; width: 90%; padding-top: 5px; border-bottom: #b78c67 1px solid; font-family: 'Courier New',Fixedsys; background-color: #edeef0"><span style="color: #0033ff">int</span> 		gVar;<br /><span style="color: #0033ff">static</span> 	<span style="color: #0033ff">int</span>	sgVar;<br /><span style="color: #0033ff">int</span> 		Inc(<span style="color: #0033ff">int</span> Param);<br /><span style="color: #0033ff">static</span>	<span style="color: #0033ff">int</span>	sDec(<span style="color: #0033ff">int</span> sParam);<br /><span style="color: #0033ff">void</span> main(<span style="color: #0033ff">void</span>)<br />{<br />	<span style="color: #0033ff">int</span> lVar;<br />	<span style="color: #0033ff">static</span> <span style="color: #0033ff">int</span> slVar;<br />	lVar = 3;<br />	slVar = 4;<br />	gVar = Inc(lVar);<br />	sgVar = sDec(slVar);<br />}<br /><span style="color: #0033ff">int</span> Inc(<span style="color: #0033ff">int</span> Param)<br />{<br />	<span style="color: #0033ff">return</span> (Param+1);<br />}<br /><span style="color: #0033ff">int</span> sDec(<span style="color: #0033ff">int</span> sParam)<br />{<br />	<span style="color: #0033ff">return</span> (sParam-1);<br />}<br /></pre>对这个程序用上面所讲的方法编译链接：<br /><pre style="border-right: #b78c67 1px solid; padding-right: 8px; border-top: #b78c67 1px solid; margin-top: 10px; padding-left: 8px; padding-bottom: 3px; margin-left: 0px; border-left: #b78c67 1px solid; width: 99%; padding-top: 5px; border-bottom: #b78c67 1px solid; font-family: 'Courier New',Fixedsys; background-color: #edeef0">C:/Pro/&gt;cl /Zi example1.c /link /debug /subsystem:console /entry:main</pre>接下来启动cdb调试器：<br /><br /><pre style="border-right: #b78c67 1px solid; padding-right: 8px; border-top: #b78c67 1px solid; margin-top: 10px; padding-left: 8px; padding-bottom: 3px; margin-left: 1px; border-left: #b78c67 1px solid; width: 99%; padding-top: 5px; border-bottom: #b78c67 1px solid; font-family: 'Courier New',Fixedsys; background-color: #edeef0">C:/Pro/&gt;cdb example1.exe<br /><br />Microsoft (R) Windows Debugger <br />Copyright (c) Microsoft Corporation. All rights reserved.<br /><br />CommandLine: example1.exe<br />Symbol search path is: SRV*D:/Symbols*http://msdl.microsoft.com/download/symbols<br />Executable search path is:<br />ModLoad: 00400000 00406000   example1.exe<br />ModLoad: 7c920000 7c9b4000   ntdll.dll<br />ModLoad: 7c800000 7c91c000   C:/WINDOWS/system32/kernel32.dll<br />(c94.c24): Break instruction exception - code 80000003 (first chance)<br />eax=00251eb4 ebx=7ffd4000 ecx=00000001 edx=00000002 esi=00251f48 edi=00251eb4<br />eip=7c921230 esp=0012fb20 ebp=0012fc94 iopl=0         nv up ei pl nz na po nc<br />cs=001b  ss=0023  ds=0023  es=0023  fs=003b  gs=0000             efl=00000202<br />ntdll!DbgBreakPoint:<br />7c921230 cc              int     3<br />0:000&gt;<br /></pre>cdb 输出了此时主线程的上下文信息(这个例子中也只有这一个线程)以及程序断点信息后便会进入一个新的提示符：0:000&gt;。以后我们会一直工作在这种 类型的提示符上，下面在这个提示符上输入一个命令来加载所有的调试信息文件，此时可能会慢一些，因为要下载系统DLL的pdb文件，所以要确保你能上网。<br /><br /><pre style="border-right: #b78c67 1px solid; padding-right: 8px; border-top: #b78c67 1px solid; margin-top: 10px; padding-left: 8px; padding-bottom: 3px; margin-left: 15px; border-left: #b78c67 1px solid; width: 90%; padding-top: 5px; border-bottom: #b78c67 1px solid; font-family: 'Courier New',Fixedsys; background-color: #edeef0">0:000&gt;.reload /f</pre><br />看到这个以"."号做为前缀的命令，可能你会觉得怪怪的，但实际上还有用"!"号做前缀的呢，用"."号做前缀的命令表示元命令，而用"!&#8220;号做前缀的命令表示扩展命令，这里只做一个简单的区分即可。<br /><br />其 实这时我们所要调试的程序已经运行起来了，不过停在了某处，主线程处于冻结状态。这一点和Linux的Gnu调试器GDB不一样，对于GDB调试器，你先 要设置一个断点，然后再键入运行命令(如果自己不手动设置一个断点，那么程序将会一直运行直到结束，你根本没有调试的机会。)，这时程序才处于运行状态。 没有运行和运行之后处于冻结状态是两个完全不同的概念。那么我们这个example1.exe停在了什么地方呢。下面我将介绍一个很重要的命令，用它我们 可以来研究这方面的问题。<br /><br /><span style="color: #0033ff">3。2。2 查看堆栈及用户空间的初始化</span><br /><br />用kb命令可以来查看堆栈，它显示栈上一些重要的信息。<br /><br /><pre style="border-right: #b78c67 1px solid; padding-right: 8px; border-top: #b78c67 1px solid; margin-top: 10px; padding-left: 8px; padding-bottom: 3px; margin-left: 5px; border-left: #b78c67 1px solid; width: 99%; padding-top: 5px; border-bottom: #b78c67 1px solid; font-family: 'Courier New',Fixedsys; background-color: #edeef0">0:000&gt;kb<br />ChildEBP RetAddr  Args to Child<br />0012fb1c 7c95edc0 7ffdf000 7ffd4000 00000000 ntdll!DbgBreakPoint<br />0012fc94 7c941639 0012fd30 7c920000 0012fce0 ntdll!LdrpInitializeProcess+0xffa<br />0012fd1c 7c92eac7 0012fd30 7c920000 00000000 ntdll!_LdrpInitialize+0x183<br />00000000 00000000 00000000 00000000 00000000 ntdll!KiUserApcDispatcher+0x7<br /></pre>这个命令所列出来的信息后面还要详细介绍，这里先关注一下函数的调用关系。从上面的列表可以看到有四个函数，这四个函数都是ntdll模块里的，从下至上函数依次被调用。要注意这是当前线程的用户栈里所有的东西，就四个函数，<span style="font-family: Courier New">KiUserApcDispatcher</span>是第一个，上面已经提到过，在你指定的入口函数执行之前还有很多的函数被调用，<span style="font-family: Courier New">KiUserApcDispatcher</span>是第一个被调用的，接下来它再调用<span style="font-family: Courier New">_LdrpInitialize</span>，<span style="font-family: Courier New">_LdrpInitialize</span>调用<span style="font-family: Courier New">LdrpInitializeProcess</span>，再调用<span style="font-family: Courier New">DbgBreakPoint</span>。至于是谁调用的<span style="font-family: Courier New">KiUserApcDispatcher</span>，我现在只能简单的告诉你是操作系统调度例程调度的结果。深入地探讨它就离开本文的主题了。现在我们可以肯定的是程序停在了<span style="font-family: Courier New">DbgBreakPoint</span>里，因为它是栈上最后一个函数。从cdb调试器的输出可以看到example1.exe停在了<span style="font-family: Courier New">DbgBreakPoint</span>函数里的<span style="font-family: Courier New">int 3</span>语句上，<span style="font-family: Courier New">int 3</span>是一个异常，它将会通知操作系统挂起这个线程，并且通知调试器，这是操作系统对调试的一个支持。其实<span style="font-family: Courier New">DbgBreakPoint</span>函数只有一条语句，那就是<span style="font-family: Courier New">int 3</span>。敏感点的人可能会想到，这样一来，所有的程序，无论是否被调试，在运行的时候最初都会执行<span style="font-family: Courier New">DbgBreakPoint</span>函数了，这也太傻了吧？情况并非如此，当我们键入cdb example1.exe时，cdb在启动example1.exe的时候会加一个特殊的标记，在这种情况下<span style="font-family: Courier New">LdrpInitializeProcess</span>才会调用<span style="font-family: Courier New">DbgBreakPoint</span>，这又是操作系统对调试的一个支持。<br /><br /><br />本文转自 <br /><a href="http://chenshine.blogbus.com/logs/4414354.html">http://chenshine.blogbus.com/logs/4414354.html</a></div><img src ="http://www.cppblog.com/lauer3912/aggbug/169567.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/lauer3912/" target="_blank">RTY</a> 2012-03-30 20:45 <a href="http://www.cppblog.com/lauer3912/archive/2012/03/30/169567.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Download Torrent and Hackintosh Versions of Mac OS X 10.8 Mountain Lion DP1</title><link>http://www.cppblog.com/lauer3912/archive/2012/03/18/168236.html</link><dc:creator>RTY</dc:creator><author>RTY</author><pubDate>Sun, 18 Mar 2012 01:31:00 GMT</pubDate><guid>http://www.cppblog.com/lauer3912/archive/2012/03/18/168236.html</guid><wfw:comment>http://www.cppblog.com/lauer3912/comments/168236.html</wfw:comment><comments>http://www.cppblog.com/lauer3912/archive/2012/03/18/168236.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/lauer3912/comments/commentRss/168236.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/lauer3912/services/trackbacks/168236.html</trackback:ping><description><![CDATA[<p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; ">Most of us would not have expected the next major version of Mac OS X so quickly this time. But, Apple has released the developer preview-1 of OS X 10.8 Mountain Lion recently.&nbsp; While people were talking about iPad 3 and iPhone 5, Mac desktop users surprised by latest OS from Apple (though it is not a final version for end users). Mac OS X 10.8 is still a developer preview version to run and test the new OS. You can directly download the official distribution of 10.8 if you have valid Apple developer ID.&nbsp; Here I&#8217;m sharing few useful links to download OS X 10.8 Mountain Lion without developer login.</p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; ">These files should be enough to run on normal Intel or virtual machines by using hackintosh methods.</p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; ">Mountain Lion OS brings most of the features of iOS (iPad and iPhone) to desktop OS environment on top of existing Lion OS X 10.7. The major features of new OS include;</p><ul style="list-style-type: none; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; background-color: #ffffff; "><li style="list-style-type: square; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 30px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">Messages &#8211; replaces iChat to bring full iMessage support to the Mac</li><li style="list-style-type: square; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 30px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">Notification Center &#8211; just like iOS</li><li style="list-style-type: square; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 30px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">Share Sheets &#8211; allows easy sharing of links, videos, photos between apps</li><li style="list-style-type: square; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 30px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">AirPlay mirroring &#8211; send wireless video to an Apple TV</li><li style="list-style-type: square; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 30px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">Notes</li><li style="list-style-type: square; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 30px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">Reminders</li><li style="list-style-type: square; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 30px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">Game Center</li><li style="list-style-type: square; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 30px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">Twitter Integration</li><li style="list-style-type: square; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 30px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">Gatekeeper &#8211; anti-Malware app installation guard</li></ul><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; ">You can find out more information here at&nbsp;<a href="http://www.apple.com/macosx/mountain-lion/" target="_blank" style="color: #509ac9; ">official link to Mountain Lion.</a></p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; text-align: center; "><a href="http://www.sysprobs.com/wp-content/uploads/2012/02/mountainlion.jpg" style="color: #509ac9; "><img title="mountain lion" src="http://www.sysprobs.com/wp-content/uploads/2012/02/mountainlion_thumb.jpg" alt="Hackintosh Versions of Mac OS X 10.8," width="547" height="309" border="0" style="max-width: 98%; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; border-image: initial; display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; border-style: initial; border-color: initial; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; " /></a></p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; "><a href="https://developer.apple.com/technologies/mountain-lion/" rel="nofollow" target="_blank" style="color: #509ac9; ">Here is the link to download developer preview &#8211;1 of OS X 10.8 Mountain Lion</a>&nbsp;(you must have developer id to download form apple site)</p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; ">&nbsp;</p><blockquote style="background-color: #ffffff; clear: both; margin-top: 5px; margin-right: 15px; margin-bottom: 20px; margin-left: 15px; padding-top: 3px; padding-right: 20px; padding-bottom: 0px; padding-left: 20px; color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; "><h2>How to Download Torrent and Hackintosh versions of Mac OS X 10.8 Mountain Lion</h2></blockquote><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; ">As I mentioned earlier, the official download works only with developer login. If you are trying to download though torrent sites, here is the good news.</p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; "><strong>1) Untouched version</strong></p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; ">This torrent should be working fine as per the comments on this torrent forum. I have just finished downloading this torrent, and will update you soon on how to install it on VMware or VirtualBox. This version is not modified (as mentioned&nbsp;<strong><em>&#8216;untouched&#8217;</em></strong>) to work on Hackintosh platform, but I&#8217;m hoping this will work with VMware and VirtualBox on Intel based Windows computers. I could see a comment saying he managed to install it on VMware successfully.</p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; "><a href="http://thepiratebay.se/torrent/7037731/OS_X_10.8_Mountain_Lion_Developer_Preview_1_(Fixed)" rel="nofollow" target="_blank" style="color: #509ac9; ">Download link of torrent</a></p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; "><strong>2) Hackintosh Version</strong></p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; ">On the same forum someone called this as Hackintosh version, but I&#8217;m not sure how it will be working.&nbsp; I think this image doesn&#8217;t require installation. Just you can restore to USB stick or virtual machine hard disk, install Chameleon bootloader and boot the Hackintosh or virtual machine. If this works as said, I&#8217;m sure that will save huge time and work around. I will have a try after few days once I succeeded with above original image.</p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; "><a href="http://thepiratebay.se/torrent/7041615/10.8_Ready_for_USB_stick_image_Hackintosh" rel="nofollow" target="_blank" style="color: #509ac9; ">Download link of torrent</a></p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; "><a href="http://facebook.com/sysprobs" rel="nofollow" target="_blank" style="color: #509ac9; ">Stay tuned with Sysprobs</a>&nbsp;for more Hackintosh on VMware and VirtualBox of Mac OS X 10.8 Mountain Lion news.</p><h2>Recommended Posts</h2><ul style="list-style-type: none; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; background-color: #ffffff; "><li style="list-style-type: square; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 30px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><a href="http://www.sysprobs.com/manual-download-safari-5-1-4-download-for-windows-7" title="[Manual Download] Safari 5.1.4 Download for Windows 7" style="color: #509ac9; ">[Manual Download] Safari 5.1.4 Download for Windows 7</a></li><li style="list-style-type: square; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 30px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><a href="http://www.sysprobs.com/guide-how-to-boot-os-x-10-8-mountain-lion-dmg-on-vmware-workstation-with-windows-7" title="[Guide] How to Boot OS X 10.8 Mountain Lion DMG on VMware Workstation with Windows 7" style="color: #509ac9; ">[Guide] How to Boot OS X 10.8 Mountain Lion DMG on VMware Workstation with Windows 7</a></li><li style="list-style-type: square; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 30px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><a href="http://www.sysprobs.com/download-lion-os-x-10-7-3-combo-update-for-client-and-server-links-from-official-site" title="Download Lion OS X 10.7.3 Combo Update for Client and Server &#8211;  Links from Official Site" style="color: #509ac9; ">Download Lion OS X 10.7.3 Combo Update for Client and Server &#8211; Links from Official Site</a></li><li style="list-style-type: square; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 30px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; position: static; "><a href="http://www.sysprobs.com/top-10-articles-of-sysprobs-in-2011-with-your-support-and-contribution" title="Top 10 Articles of Sysprobs in 2011 &#8211;  With Your Support and Contribution" style="color: #509ac9; ">Top 10 Articles of Sysprobs in 2011 &#8211; With Your Support and Contribution</a></li></ul><img src ="http://www.cppblog.com/lauer3912/aggbug/168236.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/lauer3912/" target="_blank">RTY</a> 2012-03-18 09:31 <a href="http://www.cppblog.com/lauer3912/archive/2012/03/18/168236.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title> How to Boot OS X 10.8 Mountain Lion DMG on VMware Workstation with Windows 7</title><link>http://www.cppblog.com/lauer3912/archive/2012/03/18/168235.html</link><dc:creator>RTY</dc:creator><author>RTY</author><pubDate>Sun, 18 Mar 2012 01:29:00 GMT</pubDate><guid>http://www.cppblog.com/lauer3912/archive/2012/03/18/168235.html</guid><wfw:comment>http://www.cppblog.com/lauer3912/comments/168235.html</wfw:comment><comments>http://www.cppblog.com/lauer3912/archive/2012/03/18/168235.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/lauer3912/comments/commentRss/168235.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/lauer3912/services/trackbacks/168235.html</trackback:ping><description><![CDATA[<p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; ">This article explains how to create a bootable (Mac) OS X 10.8 mountain Lion image (and ISO) for VMware workstation on Intel based Windows 7 computer. Recently I have mentioned about&nbsp;<a href="http://www.sysprobs.com/download-mac-os-x-10-8-mountain-lion-torrent-and-hackintosh-versions" target="_blank" style="color: #509ac9; ">official 10.8 developer preview download and torrent download of latest OS</a>&nbsp;from Apple. The original DMG file can not be booted on any hackintosh methods. But, by using this guide we can prepare a bootable image of Mountain Lion OS X and start the installation on VMware workstation as guest virtual machine.</p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; ">This guide is nothing to do with Hackintosh on physical computer. I have tested on desktop virtualization software VMware workstation only. So, it will be useful to run the developer preview version of OS X 10.8 without disturbing your physical Operating Systems.&nbsp; Also, it is very safe, easy and possible to use with multiple Operating Systems simultaneously.</p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; ">OK, let&#8217;s come to our point. Here I&#8217;m explaining how to prepare the OS X 10.8 image and ISO which can be booted on VMware workstation with Intel based Windows computers. Usually the official dmg file should be used inside an existing Mac OS machine to install it in different partition (dual boot) or update the existing OS X. So, starting the installation on fresh virtual machine with same dmg file is not possible without doing few modifications.</p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; ">This method is exactly same which we used&nbsp;<a href="http://www.sysprobs.com/create-bootable-lion-os-installer-image-vmware-windows-intel-based-computers" target="_blank" style="color: #509ac9; ">earlier to prepare Lion OS X 10.7 bootable image</a>. Since I already explained each steps with Lion OS X earlier, I&#8217;m not going to repeat the same instructions here. Anyhow, keep reading&#8230;..</p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; ">&nbsp;</p><blockquote style="background-color: #ffffff; clear: both; margin-top: 5px; margin-right: 15px; margin-bottom: 20px; margin-left: 15px; padding-top: 3px; padding-right: 20px; padding-bottom: 0px; padding-left: 20px; color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; "><h2>What You Need?</h2></blockquote><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; "><strong>1)</strong>&nbsp;A working Snow Leopard or Lion OS X virtual machine on VMware or VirtualBox.</p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; ">More information available on how to&nbsp;<a href="http://www.sysprobs.com/fresh-snow-leopard-1064-installation-vmware-player-3-intel-amd-pc" target="_blank" style="color: #509ac9; ">install Snow Leopard on VMware,</a>&nbsp;<a href="http://www.sysprobs.com/install-mac-snow-leopard-1063-oracle-virtualbox-32-apple-intel-pc" target="_blank" style="color: #509ac9; ">VirtualBox</a>&nbsp;and&nbsp;<a href="http://www.sysprobs.com/working-method-install-mac-107-lion-vmware-windows-7-intel-pc" target="_blank" style="color: #509ac9; ">Lion OS X on VMware</a>,&nbsp;<a href="http://www.sysprobs.com/guide-mac-os-x-10-7-lion-on-virtualbox-with-windows-7-and-intel-pc" target="_blank" style="color: #509ac9; ">VirtualBox.</a></p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; "><strong>2)</strong>&nbsp;<a href="http://www.sysprobs.com/download-mac-os-x-10-8-mountain-lion-torrent-and-hackintosh-versions" target="_blank" style="color: #509ac9; ">Mountain Lion DMG file (Click here to read more)</a></p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; ">&nbsp;</p><blockquote style="background-color: #ffffff; clear: both; margin-top: 5px; margin-right: 15px; margin-bottom: 20px; margin-left: 15px; padding-top: 3px; padding-right: 20px; padding-bottom: 0px; padding-left: 20px; color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; "><h2>Summary &#8211; What We Are Going to Do?</h2></blockquote><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; "><strong>1)</strong>&nbsp;We will attach a new virtual hard disk (5GB) to existing Mac OS X virtual machine.</p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; "><strong>2)</strong>&nbsp;Mount the Mountain Lion dmg file inside virtual machine.</p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; "><strong>3)</strong>&nbsp;Restore the BaseSystem and packages (from downloaded dmg file) to newly attached virtual hard disk from virtual machine. Also few modifications.</p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; "><strong>4)</strong>&nbsp;Now we can attach the &#8216;prepared&#8217; 5GB virtual hard disk to new virtual machine to boot and start the installation.</p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; ">That&#8217;s it. Its very easy.&nbsp;<strong><em>But please follow the instruction correctly</em></strong>.</p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; ">&nbsp;</p><blockquote style="background-color: #ffffff; clear: both; margin-top: 5px; margin-right: 15px; margin-bottom: 20px; margin-left: 15px; padding-top: 3px; padding-right: 20px; padding-bottom: 0px; padding-left: 20px; color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; "><h2>Steps to Create Bootable OS X 10.8 Mountain Lion DMG on VMware Workstation</h2></blockquote><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; "><strong>1)</strong>&nbsp;Attach a 5GB new virtual hard disk to working Mac OS X&nbsp; virtual machine. In this example, I&#8217;m doing it with&nbsp;<a href="http://www.sysprobs.com/install-and-run-lion-os-x-from-vmware-pre-installed-image" target="_blank" style="color: #509ac9; ">Lion OS X (10.7) VM on VMware workstation</a>, my host is Windows 7 32 bit.</p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; "><a href="http://www.sysprobs.com/wp-content/uploads/2012/02/addeddisk.png" style="color: #509ac9; "><img title="added disk" src="http://www.sysprobs.com/wp-content/uploads/2012/02/addeddisk_thumb.png" alt="added disk" width="585" height="280" border="0" style="max-width: 98%; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; border-image: initial; display: inline; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; " /></a></p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; "><strong>2)</strong>&nbsp;Start the VM. Initialize the disk and format the newly added 5GB external hard disk with following configuration.</p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; "><strong>Single partition</strong>&nbsp;with &#8216;<strong>Mac OS X Extended (Journaled)&#8217;</strong>&nbsp;and&nbsp;<strong>&#8216;Apple Partition Map&#8217;</strong>&nbsp;type which is available under Options in below screen.</p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; "><a href="http://www.sysprobs.com/wp-content/uploads/2012/02/createnewpartition.png" style="color: #509ac9; "><img title="create new partition" src="http://www.sysprobs.com/wp-content/uploads/2012/02/createnewpartition_thumb.png" alt="create new partition" width="573" height="424" border="0" style="max-width: 98%; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; border-image: initial; display: inline; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; " /></a></p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; "><strong>3)</strong>&nbsp;Now, we need to mount the 10.8 installation file. As you are aware OS X 10.8 installation file is in DMG format which will not work directly with VMware workstation. I tried to convert the&nbsp;<a href="http://www.sysprobs.com/convert-mac-dmg-iso-windows" target="_blank" style="color: #509ac9; ">DMG file to ISO on Windows 7 host as mentioned earlier in Sysprobs</a>, but for some reasons&nbsp;<strong><em>it failed</em></strong>.</p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; ">So, I have directly copied mountain Lion dmg file (using USB disk) into working Lion 10.7 virtual machine. Then mounted by double clicking the dmg file.</p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; "><a href="http://www.sysprobs.com/wp-content/uploads/2012/02/mountingdmgfile.png" style="color: #509ac9; "><img title="mounting dmg file" src="http://www.sysprobs.com/wp-content/uploads/2012/02/mountingdmgfile_thumb.png" alt="mounting dmg file" width="425" height="391" border="0" style="max-width: 98%; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; border-image: initial; display: inline; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; " /></a></p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; "><strong>4)</strong>&nbsp;Make sure its mounted properly. Check the listed volumes as shown below.</p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; "><a href="http://www.sysprobs.com/wp-content/uploads/2012/02/mounteddisk.png" style="color: #509ac9; "><img title="mounted disk" src="http://www.sysprobs.com/wp-content/uploads/2012/02/mounteddisk_thumb.png" alt="mounted disk" width="546" height="166" border="0" style="max-width: 98%; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; border-image: initial; display: inline; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; " /></a></p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; ">Above screen shows the mounted OS X 10.8 dmg file as<strong><em>&nbsp;&#8216;Mac OS X Install ESD&#8217;</em></strong>&nbsp;and my new hard disk which I formatted in Step 2 as<strong><em>&nbsp;&#8216;bootablelion&#8217;</em></strong>.</p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; "><strong>5)</strong>&nbsp;We are ready to start the restore and copy important packages process from mounted dmg file to new hard disk.</p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; ">As I said, the further steps clearly mentioned with screen shots earlier for Lion OS X (10.7).</p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; "><strong>Please&nbsp;</strong><a href="http://www.sysprobs.com/create-bootable-lion-os-installer-image-vmware-windows-intel-based-computers" target="_blank" style="color: #509ac9; "><strong>click here to visit the previous</strong></a><strong>&nbsp;guide and follow the steps carefully.</strong></p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; ">Also, you can create Mountain Lion bootable ISO file using the same method, which is&nbsp;<a href="http://www.sysprobs.com/video-create-bootable-lion-os-iso-file-dmg" target="_blank" style="color: #509ac9; ">clearly mentioned by these videos ( Click here)</a></p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; ">&nbsp;</p><blockquote style="background-color: #ffffff; clear: both; margin-top: 5px; margin-right: 15px; margin-bottom: 20px; margin-left: 15px; padding-top: 3px; padding-right: 20px; padding-bottom: 0px; padding-left: 20px; color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; "><h2><strong>IMPORTANT NOTE:</strong></h2></blockquote><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; ">In previous guide, the new hard disk named as&nbsp;<strong>&#8216;LionInstaller&#8217;</strong>, but in this new example it is named as&nbsp;<strong>&#8216;bootablelion&#8217;</strong>. Also, when you restore the BaseSystem image, it&nbsp;<em><strong>may overwrite the partition name</strong></em>&nbsp;and you will get a new name as&nbsp;<strong>&#8216;Mac OS X Install ESD 1&#8217;</strong>. So, either rename the partition again before continue next steps or type the new name correctly on appropriate places while typing the commands.</p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; "><strong>6)</strong>&nbsp;After new disk created properly, it can be attached to new virtual machine and start Mountain Lion installation. Please make sure,&nbsp;<a href="http://www.sysprobs.com/vmware-workstation-8-0-8-0-1-unlocker-to-run-mac-os-x-guest-in-windows-7" target="_blank" style="color: #509ac9; ">you have already applied VMware unlocker</a>&nbsp;to be able to run Mac OS X guest virtual machines on Windows platform.&nbsp;<a href="http://www.sysprobs.com/vmware-workstation-8-0-8-0-1-unlocker-to-run-mac-os-x-guest-in-windows-7" target="_blank" style="color: #509ac9; ">Check our earlier guide on VMware 8.0 and 8.0.1 unlocker.</a></p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; ">Here is the first screen booted by &#8216;prepared&#8217; 5GB hard disk on VMware workstation 8.0.1 on Windows 7 32 bit host.</p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; ">I will provide the step by step guide and additional required installation for Mountain Lion OS X 10.8 on VMware workstation in coming days.</p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; "><a href="http://www.sysprobs.com/wp-content/uploads/2012/02/firstscreen.png" style="color: #509ac9; "><img title="first screen" src="http://www.sysprobs.com/wp-content/uploads/2012/02/firstscreen_thumb.png" alt="first screen" width="567" height="461" border="0" style="max-width: 98%; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; border-image: initial; display: inline; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; " /></a></p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; ">I&#8217;m sure this guide will be helpful to prepare the bootable image of Mountain Lion for VMware workstation and VM Player. Mostly this should work with Oracle VirtualBox too, but we need to find out the correct boot loader for that. I will keep searching for that and update in this blog later.</p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; ">Have fun!</p><h2>Recommended Posts</h2><ul style="list-style-type: none; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; background-color: #ffffff; "><li style="list-style-type: square; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 30px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><a href="http://www.sysprobs.com/vmware-workstation-8-0-8-0-1-unlocker-to-run-mac-os-x-guest-in-windows-7" title="VMware Workstation 8.0/8.0.1 Unlocker to Run Mac OS X Guest in Windows 7" style="color: #509ac9; ">VMware Workstation 8.0/8.0.1 Unlocker to Run Mac OS X Guest in Windows 7</a></li><li style="list-style-type: square; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 30px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><a href="http://www.sysprobs.com/top-ten-articles-2010-virtualization-windows-7-sysprobs" title="The Top Ten Articles of 2010 in Virtualization and Windows 7 at Sysprobs" style="color: #509ac9; ">The Top Ten Articles of 2010 in Virtualization and Windows 7 at Sysprobs</a></li><li style="list-style-type: square; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 30px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; position: static; "><a href="http://www.sysprobs.com/fresh-snow-leopard-1064-installation-vmware-player-3-intel-amd-pc" title="Fresh Snow Leopard 10.6.4 Installation on VMware Player 3 &#8211; Intel, AMD PC" style="color: #509ac9; ">Fresh Snow Leopard 10.6.4 Installation on VMware Player 3 &#8211; Intel, AMD PC</a></li><li style="list-style-type: square; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 30px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><a href="http://www.sysprobs.com/mac-snow-leopard-amd-pc-vmware-image" title="Mac Snow Leopard on AMD PC, by VMware Image" style="color: #509ac9; ">Mac Snow Leopard on AMD PC, by VMware Image</a></li></ul><img src ="http://www.cppblog.com/lauer3912/aggbug/168235.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/lauer3912/" target="_blank">RTY</a> 2012-03-18 09:29 <a href="http://www.cppblog.com/lauer3912/archive/2012/03/18/168235.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Mac OS X 10.7 Lion on VirtualBox with Windows 7 and Intel PC</title><link>http://www.cppblog.com/lauer3912/archive/2012/03/18/168234.html</link><dc:creator>RTY</dc:creator><author>RTY</author><pubDate>Sun, 18 Mar 2012 01:27:00 GMT</pubDate><guid>http://www.cppblog.com/lauer3912/archive/2012/03/18/168234.html</guid><wfw:comment>http://www.cppblog.com/lauer3912/comments/168234.html</wfw:comment><comments>http://www.cppblog.com/lauer3912/archive/2012/03/18/168234.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/lauer3912/comments/commentRss/168234.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/lauer3912/services/trackbacks/168234.html</trackback:ping><description><![CDATA[<p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; ">Finally I managed to find out the working method to install and run latest Mac OS X 10.7 Lion on Oracle VirtualBox with normal Intel computer. The main issue every hackintosh users faced with Lion, is the boot loader to start the installation in normal PC or in any desktop virtualization software. Here I explain and demonstrate step by step method to install Mac OS X 10.7 Lion on VirtualBox in Windows 7 host Intel computer.</p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; ">Please note this is just for testing and learning purpose only. This method is not recommended for production or long term use, also not all applications will be working on Mac Lion virtual machine as its not recommended by Apple company. Highly advisable to go with original Apple hardware and Mac OS to get the all features and power of Mac.</p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; ">OK, I demonstrate these steps in my Windows 7 32 Bit computer with Oracle VirtualBox 4.1.2.</p><blockquote style="background-color: #ffffff; clear: both; margin-top: 5px; margin-right: 15px; margin-bottom: 20px; margin-left: 15px; padding-top: 3px; padding-right: 20px; padding-bottom: 0px; padding-left: 20px; color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; "><h2>My PC Configurations.</h2></blockquote><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; ">Intel Core2Duo 2.66GHz, 3GB RAM on Host and Windows 7 32 Bit Operating System. Hardware Virtualization Technology (VT) is enabled in the host processor and processor is 64 bit ready.</p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; ">&nbsp;</p><blockquote style="background-color: #ffffff; clear: both; margin-top: 5px; margin-right: 15px; margin-bottom: 20px; margin-left: 15px; padding-top: 3px; padding-right: 20px; padding-bottom: 0px; padding-left: 20px; color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; "><h2>What You Need?</h2></blockquote><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; "><strong>1)</strong>&nbsp;Oracle VirtualBox 4.1 or later.&nbsp; (<a href="http://www.sysprobs.com/oracle-virtualbox-extension-pack-4-1-and-4-1-2-download-and-install" style="color: #509ac9; ">Install the latest VirtualBox extension pack also</a>)</p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; "><strong>2)</strong>&nbsp;The pre created Lion OS X installation disk. This is the very important part in this installation. The ordinary installation DMG file you download from Apple or any torrent sites will not work here. We need to modify some packages and create a new disk which can be booted in VirtualBox or VMware.</p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; ">For this process, you must have a working Snow Leopard on physical or virtual machine.</p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; ">The procedure is already covered in Sysprobs clearly, please check&nbsp;<a href="http://www.sysprobs.com/create-bootable-lion-os-installer-image-vmware-windows-intel-based-computers" style="color: #509ac9; ">this guide on creating bootable Lion OS X disk</a>.</p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; ">I have used this pre created disk to boot and install&nbsp;<a href="http://www.sysprobs.com/working-method-install-mac-107-lion-vmware-windows-7-intel-pc" style="color: #509ac9; ">Lion OS X in VMware workstation, which is already covered here</a>.</p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; "><strong><em><span style="text-decoration: underline; ">The bootable Lion OS X disk can be created by two methods,</span></em></strong></p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; "><strong>a)</strong>&nbsp;Create as a VMDK or VDI file. So this file can be attached to the virtual machine as the first disk to boot the Lion OS. This file can be used in VMware and VirtualBox whenever needed.</p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; ">Follow the steps&nbsp;<a href="http://www.sysprobs.com/create-bootable-lion-os-installer-image-vmware-windows-intel-based-computers" style="color: #509ac9; ">here to create bootable Lion OS X VMDK (or VDI) file</a>.</p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; "><strong>b)</strong>&nbsp;Create an ISO file. This is also ideal method to use with all virtualization software and physical computer also.</p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; ">One of my reader created a nice video on&nbsp;<a href="http://www.sysprobs.com/video-create-bootable-lion-os-iso-file-dmg" style="color: #509ac9; ">creating bootable Lion OS X ISO file from DMG</a>.</p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; "><object width="590" height="360" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" style="height: 390px; width: 590px; "><embed width="590" height="360" type="application/x-shockwave-flash" src="http://www.youtube.com/v/3pC4uYCjE5s?version=3" allowfullscreen="true" allowscriptaccess="always" style="height: 390px; width: 590px; "></object></p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; ">&nbsp;</p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; "><strong>3)</strong>&nbsp;Minimum 1GB memory to Virtual machine.</p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; "><strong>4)</strong>&nbsp;VT and 64bit supported processor.&nbsp;<a href="http://www.sysprobs.com/disable-enable-virtualization-technology-bios" style="color: #509ac9; ">Check this guide and make sure your processor supports these features</a>.</p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; "><strong>5)</strong>&nbsp;<a href="http://www.mediafire.com/file/ue5d849o5odp9lt/HackBoot_Lion.zip" rel="nofollow" target="_blank" style="color: #509ac9; ">Download the boot loader</a>&nbsp;which can boot the Lion OS in VirtualBox (HackBoot.iso which is uploaded by me, no virus.)</p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; ">&nbsp;</p><blockquote style="background-color: #ffffff; clear: both; margin-top: 5px; margin-right: 15px; margin-bottom: 20px; margin-left: 15px; padding-top: 3px; padding-right: 20px; padding-bottom: 0px; padding-left: 20px; color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; "><h2>How to Install Lion OS X on VirtualBox</h2></blockquote><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; "><strong>1)</strong>&nbsp;Double check the VT support and 64Bit in BIOS. If its not enabled, then enable it in BIOS and make sure the host Operating System is detecting it.</p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; "><a href="http://www.sysprobs.com/disable-enable-virtualization-technology-bios" style="color: #509ac9; ">Check this guide on how to enable VT in BIOS</a></p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; "><strong>2)</strong>&nbsp;Create a new virtual machine.&nbsp;<strong>OS is Mac OS X</strong>&nbsp;, the version should be&nbsp;<strong>&#8220;64bit</strong>&#8221;. Do not ask me why, because normal 32bit version did not work on my computer.</p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; "><a href="http://www.sysprobs.com/wp-content/uploads/2011/09/OStype.png" style="color: #509ac9; "><img title="OS type" src="http://www.sysprobs.com/wp-content/uploads/2011/09/OStype_thumb.png" alt="Lion OS X 64bit version" width="555" height="187" border="0" style="max-width: 98%; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; border-image: initial; display: inline; border-style: initial; border-color: initial; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; " /></a></p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; "><strong>3)</strong>&nbsp;Set the memory size to 1GB or more than that, 2GB is recommended.</p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; "><strong>4)</strong>&nbsp;Create a virtual hard disk, minimum is 20GB.</p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; "><strong>5)</strong>&nbsp;Here is System settings.</p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; ">You can deselect the floppy drive.</p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; ">Make sure&nbsp;<strong>&#8216;Enable IO APIC&#8221;</strong>&nbsp;and others are selected as shown below.</p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; "><strong>Remove the Enable EFI option</strong>. Leave the ICH9 chipset as default.</p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; "><a href="http://www.sysprobs.com/wp-content/uploads/2011/09/SystemSettings.png" style="color: #509ac9; "><img title="System Settings" src="http://www.sysprobs.com/wp-content/uploads/2011/09/SystemSettings_thumb.png" alt="Mac OS X 10.7 System Settings in virtualbox" width="563" height="417" border="0" style="max-width: 98%; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; border-image: initial; display: inline; border-style: initial; border-color: initial; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; " /></a></p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; ">Under Acceleration,&nbsp;<strong>&#8220;Enable VT-x/AMD-V&#8221;</strong>&nbsp;and&nbsp;<strong>&#8220;Enable Nested Paging&#8221;</strong>&nbsp;should be enabled. If Acceleration tab is missing in your VirtualBox settings, it means VT is not enabled in host computer BIOS.</p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; "><a href="http://www.sysprobs.com/wp-content/uploads/2011/09/acceleration.png" style="color: #509ac9; "><img title="acceleration" src="http://www.sysprobs.com/wp-content/uploads/2011/09/acceleration_thumb.png" alt="desktop virtualization software" width="568" height="176" border="0" style="max-width: 98%; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; border-image: initial; display: inline; border-style: initial; border-color: initial; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; " /></a></p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; "><strong>Processor Settings.</strong></p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; ">This is slightly tricky. My processor is Core2Duo, so I could select 2 processors. Unfortunately during the installation the virtual machine crashed. I had to put it back to 1 processor (core). If you are using Intel i-series processor you can increase the number up to 4. Increase to maximum and try, if it doesn&#8217;t work then try with single core (1 processor).</p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; "><strong>6)</strong>&nbsp;Attach the bootable ISO or VMDK file to virtual machine. In all cases we have to set Hackboot.iso in CD drive and boot with it.</p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; ">If you are trying to install with bootable VMDK file (which I did), here is the setup.</p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; "><a href="http://www.sysprobs.com/wp-content/uploads/2011/09/Storagesettings.png" style="color: #509ac9; "><img title="Storage settings" src="http://www.sysprobs.com/wp-content/uploads/2011/09/Storagesettings_thumb.png" alt="lion on virtualbox" width="578" height="259" border="0" style="max-width: 98%; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; border-image: initial; display: inline; border-style: initial; border-color: initial; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; " /></a></p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; "><strong><em>If you are going to try with ISO file, then you do not need to add the &#8216;bootabelhdd.vmdk&#8217; file.</em></strong></p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; "><strong>7)</strong>&nbsp;Start the Lion OS X virtual machine now in VirtualBox.</p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; ">It will boot with HackBoot.iso file.</p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; ">If it&#8217;s from VMDK file, select the disk by pressing right arrow key in keyboard and press ENTER.</p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; "><a href="http://www.sysprobs.com/wp-content/uploads/2011/09/firstbootloaderscreen.png" style="color: #509ac9; "><img title="first boot loader screen" src="http://www.sysprobs.com/wp-content/uploads/2011/09/firstbootloaderscreen_thumb.png" alt="lion boot loader for virtualbox" width="582" height="470" border="0" style="max-width: 98%; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; border-image: initial; display: inline; border-style: initial; border-color: initial; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; " /></a></p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; "><strong><em>If you are trying with ISO file, then once the above screen loaded, click on the CD icon of VirtualBox console and browse the Lion bootable ISO file. Wait for 5 seconds and press F5 to refresh the loaded CD, select it and press ENTER to start the installation.</em></strong></p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; "><strong>8.)</strong>&nbsp;Are you lucky enough? The first screen should start normally. Select the language and continue.</p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; "><strong>9)</strong>&nbsp;If you do not see the virtual hard disk to install, then it should be created in&nbsp;<strong>Disk Utility</strong>&nbsp;during the installation. Click on&nbsp;<strong><em>&#8216;Utilities&#8217; and select &#8216;Disk Utility&#8217;</em></strong>.</p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; "><a href="http://www.sysprobs.com/wp-content/uploads/2011/09/createpartitiontoinstall.png" style="color: #509ac9; "><img title="create partition to install" src="http://www.sysprobs.com/wp-content/uploads/2011/09/createpartitiontoinstall_thumb.png" alt="create partition to install" width="601" height="212" border="0" style="max-width: 98%; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; border-image: initial; display: inline; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; " /></a></p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; ">Press Apply and close the disk utility box. Now you should be able to see and select the newly created partition for installation. Select and begin the process.</p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; "><strong>10)</strong>&nbsp;After the installation automatic restart will be attempted&nbsp;<strong><em>but it will not work here</em></strong>. The virtual machine will stop with following screen which is ready for manual restart.</p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; "><a href="http://www.sysprobs.com/wp-content/uploads/2011/09/rebootscreen.png" style="color: #509ac9; "><img title="reboot screen" src="http://www.sysprobs.com/wp-content/uploads/2011/09/rebootscreen_thumb.png" alt="reboot screen" width="386" height="163" border="0" style="max-width: 98%; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; border-image: initial; display: inline; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; " /></a></p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; ">Reset the virtual machine from menu. It may give a guru meditation error sometimes. Do not worry, just close the virtual machine.</p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; ">We need to start the VM now,&nbsp;<strong>so load the HackBoot.iso file again to CD drive</strong>&nbsp;if it was removed during the installation. Incase virtual machine hangs with ash color screen now, again restart.</p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; "><strong>11)</strong>&nbsp;After few initial settings, you must land on working Lion OS X desktop in VirtualBox.</p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; "><a href="http://www.sysprobs.com/wp-content/uploads/2011/09/workinglionosxinvirtualbox.png" style="color: #509ac9; "><img title="working lion os x in virtualbox" src="http://www.sysprobs.com/wp-content/uploads/2011/09/workinglionosxinvirtualbox_thumb.png" alt="working lion os x in virtualbox" width="573" height="467" border="0" style="max-width: 98%; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; border-image: initial; display: inline; border-style: initial; border-color: initial; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; " /></a></p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; ">The performance of Lion OS X in VirtualBox is manageable. I could play around with few new changes and applications. Still there are few small drawbacks and issues on method. I will try my best to find out the solutions to fix them in future.</p><blockquote style="background-color: #ffffff; clear: both; margin-top: 5px; margin-right: 15px; margin-bottom: 20px; margin-left: 15px; padding-top: 3px; padding-right: 20px; padding-bottom: 0px; padding-left: 20px; color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; "><h2>You must consider two issues now,</h2></blockquote><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; "><strong>a)</strong>&nbsp;<strong>Shutting down and restart the Lion VM</strong>- This will not happen automatically. Once the black screen appears (<em>Shown in Step 10</em>), it&#8217;s safe to shutdown or reset from VirtualBox menu.</p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; "><strong>b)</strong>&nbsp;Ab<strong>out the Mac</strong>&nbsp;&#8211; If you try &#8216;About the Mac&#8217; inside virtual machine, it will not work. The virtual machine may crash.</p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; ">I hope this guide would be helpful to install Mac OS X 10.7 Lion on VirtualBox with normal Intel computer with Windows 7, Vista or Windows XP. I&#8217;m NOT sure how this will work on AMD computer. Please someone leave comment about AMD processor.&nbsp; Your responses are highly expected.</p><p style="color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; background-color: #ffffff; ">Have fun.</p><h2>Recommended Posts</h2><ul style="list-style-type: none; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; color: #444444; font-family: Arial, Helvetica, Tahoma, sans-serif; font-size: 15px; line-height: 20px; background-color: #ffffff; "><li style="list-style-type: square; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 30px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><a href="http://www.sysprobs.com/manual-download-safari-5-1-4-download-for-windows-7" title="[Manual Download] Safari 5.1.4 Download for Windows 7" style="color: #509ac9; ">[Manual Download] Safari 5.1.4 Download for Windows 7</a></li><li style="list-style-type: square; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 30px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><a href="http://www.sysprobs.com/guide-how-to-boot-os-x-10-8-mountain-lion-dmg-on-vmware-workstation-with-windows-7" title="[Guide] How to Boot OS X 10.8 Mountain Lion DMG on VMware Workstation with Windows 7" style="color: #509ac9; ">[Guide] How to Boot OS X 10.8 Mountain Lion DMG on VMware Workstation with Windows 7</a></li><li style="list-style-type: square; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 30px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><a href="http://www.sysprobs.com/download-mac-os-x-10-8-mountain-lion-torrent-and-hackintosh-versions" title="Download Torrent and Hackintosh Versions of Mac OS X 10.8 Mountain Lion DP1" style="color: #509ac9; ">Download Torrent and Hackintosh Versions of Mac OS X 10.8 Mountain Lion DP1</a></li><li style="list-style-type: square; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 30px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; position: static; "><a href="http://www.sysprobs.com/download-lion-os-x-10-7-3-combo-update-for-client-and-server-links-from-official-site" title="Download Lion OS X 10.7.3 Combo Update for Client and Server &#8211;  Links from Official Site" style="color: #509ac9; ">Download Lion OS X 10.7.3 Combo Update for Client and Server &#8211; Links from Official Site</a></li></ul><img src ="http://www.cppblog.com/lauer3912/aggbug/168234.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/lauer3912/" target="_blank">RTY</a> 2012-03-18 09:27 <a href="http://www.cppblog.com/lauer3912/archive/2012/03/18/168234.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>VirtualBox虚拟机安装Mac OS X Lion</title><link>http://www.cppblog.com/lauer3912/archive/2012/03/18/168233.html</link><dc:creator>RTY</dc:creator><author>RTY</author><pubDate>Sun, 18 Mar 2012 01:26:00 GMT</pubDate><guid>http://www.cppblog.com/lauer3912/archive/2012/03/18/168233.html</guid><wfw:comment>http://www.cppblog.com/lauer3912/comments/168233.html</wfw:comment><comments>http://www.cppblog.com/lauer3912/archive/2012/03/18/168233.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.cppblog.com/lauer3912/comments/commentRss/168233.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/lauer3912/services/trackbacks/168233.html</trackback:ping><description><![CDATA[<div post="" type-post="" status-publish="" format-standard="" hentry="" category-experience="" tag-mac-os="" tag-virtualbox=""  tag-xps"="" id="post-961" style="font-family: 'Microsoft Yahei', Tahoma, Helvetica, Arial, SimSun, sans-serif; background-color: #eeeeee; "><h1>VirtualBox虚拟机安装Mac OS X Lion</h1><div style="font-size: 12px; padding-bottom: 5px; clear: both; ">2011-11-17</div><div id="post_content" style="padding-top: 10px; "><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">之前发过了<a href="http://hhriver.com/xps17/" target="_blank" style="text-decoration: none; color: #004499; ">XPS17评测</a>，这几天突然又想念Mac OS了，刚好<a href="http://hhriver.com/windows-8/" target="_blank" style="text-decoration: none; color: #004499; ">装 Windows 8时用了VirtualBox虚拟机</a>，拿出来装Mac OS X Lion。</p><h4><strong>背景</strong></h4><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">我的笔记本型号为XPS17，i7-2630QM，GT-555M，4GB内存。</p><h4><strong>准备</strong></h4><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">VirtualBox是一款开源虚拟机，如果你还没有，下载地址：<a href="https://www.virtualbox.org/wiki/Downloads" style="text-decoration: none; color: #004499; font-size: 13px; line-height: 18px; ">https://www.virtualbox.org/wiki/Downloads</a>（Windows下点VirtualBox for Windows hosts后面那个&#8220;<a href="http://download.virtualbox.org/virtualbox/4.1.4/VirtualBox-4.1.4-74291-Win.exe" style="text-decoration: none; color: #004499; font-size: 13px; line-height: 18px; ">x86/amd64</a><span style="font-size: 13px; line-height: 18px; ">&#8221;）。安装自不必说。</span></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">安装Mac OS X Lion所需要的两个ISO：<a href="http://hhriver.com/wp-content/uploads/2011/11/VisualBox%E5%AE%89%E8%A3%85Lion%E5%B7%A5%E5%85%B7%E5%8C%850.doc" style="text-decoration: none; color: #004499; ">VisualBox安装Lion工具包(rar)</a>(我这主机传不了RAR文件，下载后手工将扩展名由DOC改为RAR后解压)</p><h4>新建虚拟机</h4><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">运行VirtualBox&#8212;&#8212;新建&#8212;&#8212;下一步&#8212;&#8212;操作系统选择Mac OS X，版本选择Mac OS X Server（64bit）</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><img title="clip_image002" src="http://hhriver.com/wp-content/uploads/2011/11/clip_image002_thumb1.png" alt="clip_image002" width="583" height="436" border="0" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; border-image: initial; display: inline; margin-left: auto; margin-right: auto; max-width: 640px; background-image: none; padding-left: 0px; padding-right: 0px; padding-top: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; " /></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">下一步&#8212;&#8212;（内存建议分配2GB或更多）&#8212;&#8212;下一步</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><img title="clip_image003" src="http://hhriver.com/wp-content/uploads/2011/11/clip_image003_thumb1.png" alt="clip_image003" width="575" height="311" border="0" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; border-image: initial; display: inline; margin-left: auto; margin-right: auto; max-width: 640px; background-image: none; padding-left: 0px; padding-right: 0px; padding-top: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; " /></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">都用默认设置，通通选下一步</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><img title="clip_image005" src="http://hhriver.com/wp-content/uploads/2011/11/clip_image005_thumb1.png" alt="clip_image005" width="578" height="248" border="0" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; border-image: initial; display: inline; margin-left: auto; margin-right: auto; max-width: 640px; background-image: none; padding-left: 0px; padding-right: 0px; padding-top: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; " /></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">硬盘20GB应该差不多了&#8212;&#8212;下一步&#8212;&#8212;creat（创建虚拟机），创建完成。</p><h4>设置虚拟机</h4><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">选中已经创建好的虚拟机，点设置。</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><strong>关键点：照图设置</strong></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><img title="clip_image007" src="http://hhriver.com/wp-content/uploads/2011/11/clip_image007_thumb1.png" alt="clip_image007" width="589" height="353" border="0" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; border-image: initial; display: inline; margin-left: auto; margin-right: auto; max-width: 640px; background-image: none; padding-left: 0px; padding-right: 0px; padding-top: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; " /></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><strong>把软驱和EFI</strong><strong>前面的勾去掉。</strong></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">后面就随意了，CPU数量根据自己的配置多分配几个吧。</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">显存拉到128MB，2D和3D加速都勾起来。（2D貌似不可用）</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><strong>进入Storage</strong><strong>选项，点击CD/DVD</strong><strong>&nbsp;Drive</strong><strong>右边再右边的那个光盘状图标，选择下载的那个Mac OS X lion&nbsp;</strong><strong>的系统ISO</strong><strong>文件（不是图中这个）</strong></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><strong><img title="clip_image009" src="http://hhriver.com/wp-content/uploads/2011/11/clip_image009_thumb1.png" alt="clip_image009" width="602" height="472" border="0" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; border-image: initial; display: inline; margin-left: auto; margin-right: auto; max-width: 640px; background-image: none; padding-left: 0px; padding-right: 0px; padding-top: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; " /></strong></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">确定保存设置。</p><h4>安装Mac OS X Lion</h4><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">选中虚拟机点，点击开始。</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">说明：各步骤中如出现黑底白字不要紧张，正常情况。如鼠标变为彩色旋转圆形说明卡住了，关了重来。</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><img title="clip_image010" src="http://hhriver.com/wp-content/uploads/2011/11/clip_image010_thumb1.png" alt="clip_image010" width="343" height="229" border="0" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; border-image: initial; display: inline; margin-left: auto; margin-right: auto; max-width: 640px; background-image: none; padding-left: 0px; padding-right: 0px; padding-top: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; " /></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">出现如图状态，敲回车，开始安装。</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">选择语言（没用过的同学推荐中文）。</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">点击上方的实用工具&#8212;&#8212;磁盘工具&#8212;&#8212;选择&#8220;抹掉&#8221;（格式为Mac OS扩展（日志式），名称随意）</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-align: center; "><img title="clip_image007" src="http://hhriver.com/wp-content/uploads/2011/11/12-s.png" alt="clip_image007" width="450" height="282" border="0" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; border-image: initial; max-width: 640px; background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-style: initial; border-color: initial; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; " /></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">然后就能选择磁盘了。</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><img title="clip_image012" src="http://hhriver.com/wp-content/uploads/2011/11/clip_image012_thumb1.png" alt="clip_image012" width="351" height="211" border="0" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; border-image: initial; display: inline; margin-left: auto; margin-right: auto; max-width: 640px; background-image: none; padding-left: 0px; padding-right: 0px; padding-top: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; " /></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">经过十几分钟的安装后就完成了。</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">Apple账号和地址什么的随意啦，可不填。</p><h4><strong>更换引导工具</strong></h4><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">关闭系统，进入虚拟机设置，点选CD图标，更改为HJMac.iso（在下载的那个RAR里）</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><img title="clip_image014" src="http://hhriver.com/wp-content/uploads/2011/11/clip_image014_thumb1.png" alt="clip_image014" width="515" height="404" border="0" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; border-image: initial; display: inline; margin-left: auto; margin-right: auto; max-width: 640px; background-image: none; padding-left: 0px; padding-right: 0px; padding-top: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; " /></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">确定，完成。</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">运行虚拟机，看到以下画面：</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><img title="clip_image016" src="http://hhriver.com/wp-content/uploads/2011/11/clip_image016_thumb1.png" alt="clip_image016" width="512" height="419" border="0" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; border-image: initial; display: inline; margin-left: auto; margin-right: auto; max-width: 640px; background-image: none; padding-left: 0px; padding-right: 0px; padding-top: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; " /></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">用键盘换至右边，回车，顺利开机。</p><h4>说明</h4><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">需要关闭Mac OS X Lion系统时可关机，或直接强制关闭虚拟机，每次都需要利用引导工具开机。调节分辨率的方法见底部。</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">两张运行画面：</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><img title="clip_image018" src="http://hhriver.com/wp-content/uploads/2011/11/clip_image018_thumb1.png" alt="clip_image018" width="597" height="338" border="0" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; border-image: initial; display: inline; margin-left: auto; margin-right: auto; max-width: 640px; background-image: none; padding-left: 0px; padding-right: 0px; padding-top: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; " /></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><img title="clip_image020" src="http://hhriver.com/wp-content/uploads/2011/11/clip_image020_thumb1.png" alt="clip_image020" width="592" height="335" border="0" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; border-image: initial; display: inline; margin-left: auto; margin-right: auto; max-width: 640px; background-image: none; padding-left: 0px; padding-right: 0px; padding-top: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; " /></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">另：虚拟机会运行在1024*768分辨率下，如果你想更改分辨率以便全屏显示，看这个：</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><a href="http://hhriver.com/virtualbox-resolution/" target="_blank" style="text-decoration: none; color: #004499; ">修改VirtualBox虚拟机中Mac OS X Lion的系统分辨率</a></p></div><div style="font-size: 12px; padding-bottom: 5px; clear: both; ">作者：HH | 分类：<a href="http://hhriver.com/category/experience/" title="View all posts in 经验" rel="category tag" style="text-decoration: none; color: #45525f; ">经验</a>&nbsp;| 标签：&nbsp;<a href="http://hhriver.com/tag/mac-os/" rel="tag" style="text-decoration: none; color: #45525f; ">Mac OS</a>、<a href="http://hhriver.com/tag/virtualbox/" rel="tag" style="text-decoration: none; color: #45525f; ">VirtualBox</a>、<a href="http://hhriver.com/tag/xps/" rel="tag" style="text-decoration: none; color: #45525f; ">XPS</a></div></div><div id="comments" style="margin-top: 30px; font-family: 'Microsoft Yahei', Tahoma, Helvetica, Arial, SimSun, sans-serif; background-color: #eeeeee; "><h3>7 Comments</h3><ol style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; border-top-width: 1px; border-top-style: solid; border-top-color: #f6f6f6; "><li even="" thread-even="" depth-1=""  parent"="" id="comment-492" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 10px; padding-right: 5px; padding-bottom: 0px; padding-left: 5px; border-bottom-width: 1px; border-bottom-style: dashed; border-bottom-color: #cccccc; "><div id="div-comment-492"><div vcard"="" style="float: left; line-height: 24px; height: 24px; font-size: 12px; margin-bottom: 10px; "><cite>suajun</cite></div><div commentmetadata"="" style="float: right; font-size: 12px; "><a href="http://hhriver.com/virtualbox-mac-os-x-lion/comment-page-1/#comment-492" style="text-decoration: none; color: #999999; ">2012-03-06 at 17:00</a></div><p style="margin-top: 0px; margin-right: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; clear: both; ">按步骤下来卡在starting darwin x86 后黑屏，求解。</p><div style="padding-bottom: 10px; font-size: 12px; "><a href="http://hhriver.com/virtualbox-mac-os-x-lion/?replytocom=492#respond" style="text-decoration: none; color: #5d6673; ">Reply</a></div></div><ul style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; "><li byuser="" comment-author-admin="" bypostauthor="" odd="" alt="" depth-2=""  parent"="" id="comment-496" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 10px; padding-right: 5px; padding-bottom: 0px; padding-left: 20px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #fff6ed; border-bottom-width: initial; border-bottom-style: none; border-bottom-color: initial; border-top-width: 1px; border-top-style: dashed; border-top-color: #cccccc; background-position: initial initial; background-repeat: initial initial; "><div id="div-comment-496"><div vcard"="" style="float: left; line-height: 24px; height: 24px; font-size: 12px; margin-bottom: 10px; "><cite><a href="http://hhriver.com/" rel="external nofollow" style="text-decoration: none; color: #5d6673; ">HH</a></cite></div><div commentmetadata"="" style="float: right; font-size: 12px; "><a href="http://hhriver.com/virtualbox-mac-os-x-lion/comment-page-1/#comment-496" style="text-decoration: none; color: #999999; ">2012-03-06 at 22:32</a></div><p style="margin-top: 0px; margin-right: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; clear: both; ">我在数台不一样的电脑上都试过的，请检查步骤，重新来过。。。<br />PS：starting darwin x86是哪一步。。。</p><div style="padding-bottom: 10px; font-size: 12px; "><a href="http://hhriver.com/virtualbox-mac-os-x-lion/?replytocom=496#respond" style="text-decoration: none; color: #5d6673; ">Reply</a></div></div><ul style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; "><li even="" depth-3=""  parent"="" id="comment-500" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 10px; padding-right: 5px; padding-bottom: 0px; padding-left: 20px; border-bottom-width: initial; border-bottom-style: none; border-bottom-color: initial; border-top-width: 1px; border-top-style: dashed; border-top-color: #cccccc; "><div id="div-comment-500"><div vcard"="" style="float: left; line-height: 24px; height: 24px; font-size: 12px; margin-bottom: 10px; "><cite>suajun</cite></div><div commentmetadata"="" style="float: right; font-size: 12px; "><a href="http://hhriver.com/virtualbox-mac-os-x-lion/comment-page-1/#comment-500" style="text-decoration: none; color: #999999; ">2012-03-07 at 12:41</a></div><p style="margin-top: 0px; margin-right: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; clear: both; ">安装盘install DVD进去之后，跳数据Read HFS几秒钟后到starting darwin x86卡死黑屏。一切按步骤来了，除了只分配1GB内存。</p><div style="padding-bottom: 10px; font-size: 12px; "><a href="http://hhriver.com/virtualbox-mac-os-x-lion/?replytocom=500#respond" style="text-decoration: none; color: #5d6673; ">Reply</a></div></div><ul style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; "><li byuser="" comment-author-admin="" bypostauthor="" odd="" alt="" depth-4=""  parent"="" id="comment-503" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 10px; padding-right: 5px; padding-bottom: 0px; padding-left: 20px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; border-bottom-width: initial; border-bottom-style: none; border-bottom-color: initial; border-top-width: 1px; border-top-style: dashed; border-top-color: #cccccc; "><div id="div-comment-503"><div vcard"="" style="float: left; line-height: 24px; height: 24px; font-size: 12px; margin-bottom: 10px; "><cite><a href="http://hhriver.com/" rel="external nofollow" style="text-decoration: none; color: #5d6673; ">HH</a></cite></div><div commentmetadata"="" style="float: right; font-size: 12px; "><a href="http://hhriver.com/virtualbox-mac-os-x-lion/comment-page-1/#comment-503" style="text-decoration: none; color: #999999; ">2012-03-07 at 15:47</a></div><p style="margin-top: 0px; margin-right: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; clear: both; ">说到starting darwin x86我有印象了，我肯定碰到过，但我不太记得最后是怎么回事了。。。<br />如果还没用引导工具、就开始starting darwin x86，很可能是CPU等硬件配备的影响，是否为AMD处理器？是否是64位处理器？</p><div style="padding-bottom: 10px; font-size: 12px; "><a href="http://hhriver.com/virtualbox-mac-os-x-lion/?replytocom=503#respond" style="text-decoration: none; color: #5d6673; ">Reply</a></div></div><ul style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; "><li even=""  depth-5"="" id="comment-504" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 10px; padding-right: 5px; padding-bottom: 0px; padding-left: 20px; border-bottom-width: initial; border-bottom-style: none; border-bottom-color: initial; border-top-width: 1px; border-top-style: dashed; border-top-color: #cccccc; "><div id="div-comment-504"><div vcard"="" style="float: left; line-height: 24px; height: 24px; font-size: 12px; margin-bottom: 10px; "><cite>suajun</cite></div><div commentmetadata"="" style="float: right; font-size: 12px; "><a href="http://hhriver.com/virtualbox-mac-os-x-lion/comment-page-1/#comment-504" style="text-decoration: none; color: #999999; ">2012-03-07 at 16:33</a></div><p style="margin-top: 0px; margin-right: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; clear: both; ">AMD Athlon(tm) Neo X2 Dual Core Processor L325(1500 Mhz) 64bit 看来是配置的问题，哎，放弃了。</p><div style="padding-bottom: 10px; font-size: 12px; "></div></div></li></ul></li></ul></li></ul></li></ul></li><li odd="" alt="" thread-odd="" thread-alt="" depth-1=""  parent"="" id="comment-497" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 10px; padding-right: 5px; padding-bottom: 0px; padding-left: 5px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; border-bottom-width: 1px; border-bottom-style: dashed; border-bottom-color: #cccccc; "><div id="div-comment-497"><div vcard"="" style="float: left; line-height: 24px; height: 24px; font-size: 12px; margin-bottom: 10px; "><cite>Jackie</cite></div><div commentmetadata"="" style="float: right; font-size: 12px; "><a href="http://hhriver.com/virtualbox-mac-os-x-lion/comment-page-1/#comment-497" style="text-decoration: none; color: #999999; ">2012-03-07 at 09:34</a></div><p style="margin-top: 0px; margin-right: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; clear: both; ">我到安装Mac OS X Lion那一步，点开始，屏幕刷了几页的后，电脑都自动重启了！</p><div style="padding-bottom: 10px; font-size: 12px; "><a href="http://hhriver.com/virtualbox-mac-os-x-lion/?replytocom=497#respond" style="text-decoration: none; color: #5d6673; ">Reply</a></div></div><ul style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; "><li byuser="" comment-author-admin="" bypostauthor="" even=""  depth-2"="" id="comment-498" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 10px; padding-right: 5px; padding-bottom: 0px; padding-left: 20px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #fff6ed; border-bottom-width: initial; border-bottom-style: none; border-bottom-color: initial; border-top-width: 1px; border-top-style: dashed; border-top-color: #cccccc; background-position: initial initial; background-repeat: initial initial; "><div id="div-comment-498"><div vcard"="" style="float: left; line-height: 24px; height: 24px; font-size: 12px; margin-bottom: 10px; "><cite><a href="http://hhriver.com/" rel="external nofollow" style="text-decoration: none; color: #5d6673; ">HH</a></cite></div><div commentmetadata"="" style="float: right; font-size: 12px; "><a href="http://hhriver.com/virtualbox-mac-os-x-lion/comment-page-1/#comment-498" style="text-decoration: none; color: #999999; ">2012-03-07 at 10:59</a></div><p style="margin-top: 0px; margin-right: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; clear: both; ">如果VirtualBox能让电脑重启&#8212;&#8212;那肯定是别的问题。。。</p></div></li></ul></li></ol></div><img src ="http://www.cppblog.com/lauer3912/aggbug/168233.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/lauer3912/" target="_blank">RTY</a> 2012-03-18 09:26 <a href="http://www.cppblog.com/lauer3912/archive/2012/03/18/168233.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>18款能让Win7如虎添翼的软件介绍</title><link>http://www.cppblog.com/lauer3912/archive/2012/03/17/168213.html</link><dc:creator>RTY</dc:creator><author>RTY</author><pubDate>Sat, 17 Mar 2012 09:42:00 GMT</pubDate><guid>http://www.cppblog.com/lauer3912/archive/2012/03/17/168213.html</guid><wfw:comment>http://www.cppblog.com/lauer3912/comments/168213.html</wfw:comment><comments>http://www.cppblog.com/lauer3912/archive/2012/03/17/168213.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/lauer3912/comments/commentRss/168213.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/lauer3912/services/trackbacks/168213.html</trackback:ping><description><![CDATA[<div><div>       <div>我们并不提议大家顺服地听从美国微软公司的指挥，和其花上大价钱再配置一台触摸屏pc，还不如想办法为自个的win7&#8220;升升级&#8221;，有时这种东拼西凑的&#8220;山寨货&#8221;，没准还真比Win8更好玩呢。假设是的话，那么这款软件便是你的不二之选。</div>     </div>            <div id="w_hzhbig">   </div>       <p style="text-indent: 2em">我们并不提议大家顺服地听从美国微软公司的指挥，和其花上大价钱再配置一台触摸屏pc，还不如想办法为自个的<strong>Win7</strong>&#8220;升升级&#8221;，有时这种东拼西凑的&#8220;山寨货&#8221;，没准还真比Win8更好玩呢！</p> <p style="text-indent: 2em"><strong>1. 定时关机 &#8212;&#8212; Win Reboot</strong></p> <p style="text-indent: 2em">推荐指数：&#9733;&#9733;&#9733;&#9733;</p> <p style="text-indent: 2em">天冷了，窝在被窝看大片逐渐成为fashion，不过你是不是常常忘记关机便睡着了呢？假设是的话，那么这款<strong>软件</strong>便是你的不二之选。简单来讲它的功能就是让计算机在规定时间或延后多久后自动关闭，除了关机操作外，我们还能选择休眠、睡眠、重启、注销等其他辅助模式。</p> <p style="text-indent: 2em">而整套<strong>软件</strong>的操作也不复杂，只要依据屏幕提示顺序完成时间（When）、操作（What）、执行（Do It）三项设置即可。接下来<strong>软件</strong>会自动打开计划关机服务，而且在底部显示实时倒计时。</p> <p><img style="border-bottom: black 1px solid; border-left: black 1px solid; border-top: black 1px solid; border-right: black 1px solid" title="win7" alt="18款能让Win7如虎添翼的软件介绍(图一)" src="http://www.qqread.com/ArtImage/20120117/0085_1.jpg" /><br />图1 Win Reboot</p> <p style="text-indent: 2em"><strong>2. 复制也暂停 &#8212;&#8212; Teracopy</strong></p> <p style="text-indent: 2em">推荐指数：&#9733;&#9733;&#9733;&#9733;&#9733;</p> <p style="text-indent: 2em">许多网友都见识过Win8的复制粘贴，除了速度更快外，它的最大看点就是提供了复制暂停功能。而在<strong>Win7</strong>中，我们同样有一个软件能够媲美Win8，它的名字就叫做Teracopy。</p> <p><img style="border-bottom: black 1px solid; border-left: black 1px solid; border-top: black 1px solid; border-right: black 1px solid" title="win7" alt="18款能让Win7如虎添翼的软件介绍(图二)" src="http://www.qqread.com/ArtImage/20120117/0085_2.jpg" /><br />图2 Teracopy</p> <p style="text-indent: 2em">Teracopy是一款专业的文件复制软件，能够提供较原生系统更高效的文件复制服务，与Win8一样，它也支持将多个任务合并到同一窗口，或暂停、跳过某一任务，以便为其他更紧急的任务腾出空间。</p> <p style="text-indent: 2em">甚至你还能让它在超长复制后自动关机，或复制结束后自动发出声音等等。当然最终打动我们的是，Teracopy能够自动接管系统原生复制，而不必在复制时再去选择某一软件。</p> <p style="text-indent: 2em"><strong>3. 文件大小树形看 &#8212;&#8212; TreeSize</strong></p> <p style="text-indent: 2em">推荐指数：&#9733;&#9733;&#9733;</p> <p style="text-indent: 2em">Win为我们提供了多种文件显示方式，但是最大问题就是不够直观，比如当你打算在一大堆文件夹中找出最占空间的那个，便显得十分麻烦了。</p> <p style="text-indent: 2em">TreeSize是一款图形化大小显示软件，它的最大亮点是通过进度条将每一个文件（包括文件夹）的大小展示出来，只要对比不一样文件的进度条长度，就可以直观找出体积最大的那个。如何？够方便够直接的了吧！</p> <p><img style="border-bottom: black 1px solid; border-left: black 1px solid; border-top: black 1px solid; border-right: black 1px solid" title="win7" alt="18款能让Win7如虎添翼的软件介绍(图三)" src="http://www.qqread.com/ArtImage/20120117/0085_3.jpg" /><br />图3 TreeSize</p> <p style="text-indent: 2em"><strong>4. 换代命令提示符 &#8212;&#8212; Color console</strong></p> <p style="text-indent: 2em">推荐指数：&#9733;&#9733;&#9733;</p> <p style="text-indent: 2em">常常使用命令提示符的网友一定对CMD很郁闷，许多常用的Win操作（比如Ctrl+C、Ctrl+V）在这里都不可以使用，有没有什么软件能替换这个家伙呢？答案就是 &#8212;&#8212; Color Console。</p> <p><img style="border-bottom: black 1px solid; border-left: black 1px solid; border-top: black 1px solid; border-right: black 1px solid" title="win7" alt="18款能让Win7如虎添翼的软件介绍(图四)" src="http://www.qqread.com/ArtImage/20120117/0085_4.jpg" /><br />图4 Color Console</p><strong><br /><div><div>       <div>启动软件后会首先询问要扫描的位置，接下来点击&#8220;Scan Shortcuts&#8221;就能了。稍后软件会将当前位置所有已经失效快捷方式列示出来，勾选后便可方便地一键删除了。 图6 Broken Shortcut Fixer。 7. 测试无线网信号 &#8212;&#8212; WIFI Inspector。</div>     </div>            <div id="w_hzhbig">   </div>        <p style="text-indent: 2em">从名称上看，Corlor  Console就是一款能够更换背景颜色的命令控制台，可它的亮点却远不止此。比如我们能任意使用Ctrl+V或Ctrl+V复制粘贴，通过鼠标来对文字 进行拖拽复制。在它的&#8220;Commands&#8221;菜单下，集成了众多常用命令，通过点击就可以直接完成某一操作。而在它的&#8220;Chdir&#8221;菜单下，级连菜单能够帮 我们一键遍历全部硬盘，定位操作特别方便。</p> <p style="text-indent: 2em">甚至你还能像浏览器一样用Corlor Console实现便捷的多标签管理，通过快捷键在标签和标签间复制信息。当然相似的亮点还有许多，剩下的就要靠你自个去摸索了。</p> <p style="text-indent: 2em"><strong>5. 剪贴板增强 &#8212;&#8212; Clipx</strong></p> <p style="text-indent: 2em">推荐指数：&#9733;&#9733;&#9733;&#9733;</p> <p style="text-indent: 2em">剪贴板每日都要用，只不过每次只保存最后一次的内容让人多有不便。来试试这款小工具吧，它的功能就是对系统原有剪贴板模块进行增强，提供了最多1024个剪贴记录（假设这还不够用，那我们也没法儿了~），甚至重开机后保存的内容也不会丢失。</p> <p><img style="border-bottom: black 1px solid; border-left: black 1px solid; border-top: black 1px solid; border-right: black 1px solid" title="win7" alt="18款能让Win7如虎添翼的软件介绍(图五)" src="http://www.qqread.com/ArtImage/20120117/0085_5.jpg" /><br />图5 Clipx</p> <p style="text-indent: 2em"><strong>6. 清理失效快捷办法 &#8212;&#8212; Broken Shortcut Fixer</strong></p> <p style="text-indent: 2em">推荐指数：&#9733;&#9733;&#9733;</p> <p style="text-indent: 2em">因为Win而且未提供快捷方式检测功能，因此一部分因为源文件删除、更改位置所造成的快捷方式失效现象比比皆是，怎么样迅速检测而且清理这些&#8220;系统垃圾&#8221;呢？Broken Shortcut Fixer为我们提供了一个好办法。</p> <p style="text-indent: 2em">启动<strong>软件</strong>后会首先询问要扫描的位置，接下来点击&#8220;Scan Shortcuts&#8221;就能了。稍后<strong>软件</strong>会将当前位置所有已经失效快捷方式列示出来，勾选后便可方便地一键删除了。</p> <p><img style="border-bottom: black 1px solid; border-left: black 1px solid; border-top: black 1px solid; border-right: black 1px solid" title="win7" alt="18款能让Win7如虎添翼的软件介绍(图六)" src="http://www.qqread.com/ArtImage/20120117/0085_6.jpg" /><br />图6 Broken Shortcut Fixer</p> <p style="text-indent: 2em"><strong>7. 测试无线网信号 &#8212;&#8212; WIFI Inspector</strong></p> <p style="text-indent: 2em">推荐指数：&#9733;&#9733;&#9733;</p> <p style="text-indent: 2em">常常外出的人一定对这款<strong>软件</strong>很感兴趣，它的作用简单来讲就是扫描而且找出距自个近来（信号最强）的WIFI信号。</p> <p><img style="border-bottom: black 1px solid; border-left: black 1px solid; border-top: black 1px solid; border-right: black 1px solid" title="win7" alt="18款能让Win7如虎添翼的软件介绍(图七)" src="http://www.qqread.com/ArtImage/20120117/0085_7.jpg" /><br />图7 WIFI Inspector</p> <p style="text-indent: 2em">从界面来看，WIFI Inspector还是显得很专业的，启动后会自动搜索附近范围内的所有WIFI连接，然后依据各个连接的信号强度在地图上定位。这样很短时间内，我们就可以找出距自个近来（或讲信号最强）的WIFI连接，直接Link上去即可。</p> <p style="text-indent: 2em"><strong>8. 系统托盘增强 &#8212;&#8212;Shortcuts to tray</strong></p> <p style="text-indent: 2em">推荐指数：&#9733;&#9733;&#9733;&#9733;</p> <p style="text-indent: 2em">系统托盘往往都是用来存储那些已经打开的程序，除此之外就再没有别的用处了。来试试这款Shortcuts to tray吧，简单来讲它的作用是将一部分常用操作链接进来，方便客户迅速访问文件或网站页面链接。</p> <p style="text-indent: 2em">并且这款软件的支持很丰富，涵盖了文件、文件夹、网站页面链接、内网资源、应用、常用命令、系统操作、系统链接、磁盘设备等所有你能想到的内容，总之这是一款能让你的托盘&#8220;返老还童&#8221;的软件，感兴趣的话不妨试试吧。</p> <p><img style="border-bottom: black 1px solid; border-left: black 1px solid; border-top: black 1px solid; border-right: black 1px solid" title="win7" alt="18款能让Win7如虎添翼的软件介绍(图八)" src="http://www.qqread.com/ArtImage/20120117/0085_8.jpg" /><br />图8 Shortcuts to tray</p> <p style="text-indent: 2em"><strong>9. 屏幕录制 &#8212;&#8212; Screen2exe</strong></p><div><div>       <div>这款Screen2exe与同类软件相比并不算最专业的，但是却是便利性与视频体积两者最平衡的一款。并且它的另一大看点是，所生成的exe 文件没有兼容性麻烦，任何人任何一台pc都能随时观看。 图9 Screen2exe。 Screen2exe提供了许多选项。</div>     </div>            <div id="w_hzhbig">   </div>        <p style="text-indent: 2em">推荐指数：&#9733;&#9733;&#9733;&#9733;</p> <p style="text-indent: 2em">屏幕录制是许多网友最为期待的，当然可选的余地也许多，这款Screen2exe与同类<strong>软件</strong>相比并不算最专业的，但是却是便利性与视频体积两者最平衡的一款。并且它的另一大看点是，所生成的exe 文件没有兼容性麻烦，任何人任何一台pc都能随时观看。</p> <p><img style="border-bottom: black 1px solid; border-left: black 1px solid; border-top: black 1px solid; border-right: black 1px solid" title="win7" alt="18款能让Win7如虎添翼的软件介绍(图九)" src="http://www.qqread.com/ArtImage/20120117/0085_9.jpg" /><br />图9 Screen2exe</p> <p style="text-indent: 2em">Screen2exe提供了许多选项，比如你能全屏或圈选某一区域作为录制范围，借助后期为视频添加批注、图片等内容，单独将某一操作放大来避免对方看不清楚等等，或直接用马塞克遮挡住隐私位置。</p> <p style="text-indent: 2em"><strong>10. 文件夹&#8220;打标&#8221; &#8212;&#8212; Folder Colorizer</strong></p> <p style="text-indent: 2em">推荐指数：&#9733;&#9733;&#9733;&#9733;</p> <p style="text-indent: 2em">日常工作中常常遇到这种情况，几十个文件夹同时存放一起，其中一部分比较重要，却苦于没办法和其他文件夹分开，这让查找与管理变得特别不便。Folder Colorizer是一款能为特定文件夹更改颜色的小<strong>软件</strong>，只要我们通过右键&#8594;&#8220;Colorize！&#8221;&#8594;&#8220;Restore original color&#8221;将某一文件夹更改为其他颜色，那么这个颜色将会一直保持，甚至重启后也不消失。</p> <p style="text-indent: 2em">那么改色后的文件夹到底有什么用呢？试想在数十个黄颜色的文件夹集合中，仅有某几个被单独涂上了颜色，那么这些文件夹是否就很容易区分了呢？</p> <p><img style="border-bottom: black 1px solid; border-left: black 1px solid; border-top: black 1px solid; border-right: black 1px solid" title="win7" alt="18款能让Win7如虎添翼的软件介绍(图十)" src="http://www.qqread.com/ArtImage/20120117/0085_10.jpg" /><br />图10</p> <p style="text-indent: 2em"><strong>11. 加密记事本 &#8212;&#8212; Secret Notes</strong></p> <p style="text-indent: 2em">推荐指数：&#9733;&#9733;&#9733;</p> <p style="text-indent: 2em">这款&#8220;加密记事本&#8221;的最大特点就是简约而不简单，尽管功能仅限加密、记事贴两项，但是设计得却十分精巧。全部界面干净简洁，没有一丁点啰嗦之处。在记事贴中，你能为文字任意更换颜色、加粗或倾斜某一字句，甚至一键撤销、恢复之前的编辑操作等等。</p> <p style="text-indent: 2em">功能虽不算丰富，但是妙就妙在简洁够用，你讲呢？</p> <p><img style="border-bottom: black 1px solid; border-left: black 1px solid; border-top: black 1px solid; border-right: black 1px solid" title="win7" alt="18款能让Win7如虎添翼的软件介绍(图十一)" src="http://www.qqread.com/ArtImage/20120117/0085_11.jpg" /><br />图11 Secret Notes</p> <p style="text-indent: 2em"><strong>12. 系统多标签 &#8212;&#8212; Win Tabs</strong></p> <p style="text-indent: 2em">推荐指数：&#9733;&#9733;&#9733;</p> <p style="text-indent: 2em">多标签浏览器如今已见怪不怪了，想没想过将它移植到系统中来呢？Win Tabs就是这样一款系统多标签<strong>软件</strong>，安装后它会自动在每一个Win窗口顶端建立一个标签页，手工拖拽或按住Ctrl键双击，即可让标签们自动组合。</p> <p style="text-indent: 2em">并且对于那些不希望使用多标签的软件（比如多标签浏览器），我们也能将它的名字（格式为&#8220;xxx.exe&#8221;）输入选项面板的&#8220;Disable tabbing for the following applications&#8221;中，确定后这些软件便不会应用多标签了。</p> <p><img style="border-bottom: black 1px solid; border-left: black 1px solid; border-top: black 1px solid; border-right: black 1px solid" title="win7" alt="18款能让Win7如虎添翼的软件介绍(图十二)" src="http://www.qqread.com/ArtImage/20120117/0085_12.jpg" /><br />图12 Win Tabs</p> <p style="text-indent: 2em"><strong>13. 网速监视 &#8212;&#8212; Network Activity Indicator</strong></p> <p style="text-indent: 2em">推荐指数：&#9733;&#9733;&#9733;&#9733;</p> <p style="text-indent: 2em">Win的网速设计实在让人无语，要专业不专业，要直观不直观，于是我们找到了这款名为 Network Activity  Indicator的流量监测软件。它的功能很简单，就是为使用者提供了实时流量统计。安装后会自动出现在系统托盘处，使用鼠标点击弹出统计菜单。能看到 在这里除了有实时的网络流量外，还加入了30秒上下载统计图及开机流量汇总，很适合非专业人员（比如我们自个喽~）的网速监测需要，至少比起系统原生还是 方便多了。</p> <p><img style="border-bottom: black 1px solid; border-left: black 1px solid; border-top: black 1px solid; border-right: black 1px solid" title="win7" alt="18款能让Win7如虎添翼的软件介绍(图十三)" src="http://www.qqread.com/ArtImage/20120117/0085_13.jpg" /><br />图13 Network Activity Indicator</p> <p style="text-indent: 2em"><strong>14. 文件伪装 &#8212;&#8212; Disguise Folder</strong></p></div><div><div>       <div>众所周知，win7并没有内置PDF阅读模块，而市场上的PDF阅读器也大多臃肿不堪，试一试这款Sumatra PDF吧。其实我们完全能通过一部分第三方软件简化这一操作，比如&#8212;&#8212;Disguise Folder。 图14 Disguise Folder。 严格来讲。</div>     </div>            <div id="w_hzhbig">   </div>        <p style="text-indent: 2em">推荐指数：&#9733;&#9733;&#9733;</p> <p style="text-indent: 2em">美国微软公司总是喜欢将简单的事儿搞复杂，就拿那个EFS加密来讲，安都是安全了，可一旦使用者没有备份密钥，又无意中重装了系统，那么所有加密数据也就随之灰飞烟灭了。其实我们完全能通过一部分第三方<strong>软件</strong>简化这一操作，比如&#8212;&#8212;Disguise Folder。</p> <p><img style="border-bottom: black 1px solid; border-left: black 1px solid; border-top: black 1px solid; border-right: black 1px solid" title="win7" alt="18款能让Win7如虎添翼的软件介绍(图十四)" src="http://www.qqread.com/ArtImage/20120117/0085_14.jpg" /><br />图14 Disguise Folder</p> <p style="text-indent: 2em">严格来讲，Disguise Folder并不是一款加密<strong>软件</strong>， 而是通过将文件夹伪装成其他程序的模样迷惑对方。操作时只要事先选好待处理文件夹，然后选择一种伪装模样即可（比如我们选择的就是一个回收站模样）。经过 伪装后，文件夹的样子不但是与回收站一模一样，甚至双击打开看到的也是回收站效果。那么假设我们想读取原文件夹中的内容该怎么办呢？很简单，点击以下的 Recovery Folder恢复一下就行。</p> <p style="text-indent: 2em"><strong>15. PDF阅读 &#8212;&#8212; Sumatra PDF</strong></p> <p style="text-indent: 2em">推荐指数：&#9733;&#9733;&#9733;&#9733;&#9733;</p> <p style="text-indent: 2em">众所周知，<strong>Win7</strong>并没有内置PDF阅读模块，而市场上的PDF阅读器也大多臃肿不堪，试一试这款Sumatra PDF吧。它的最大特点就是小巧轻便，兴许没有同类<strong>软件</strong>中繁复的功能，但是速度却肯定堪比原装。除了标准的PDF阅读外，Sumatra PDF还提供了一部分附属功能，比如设置默认PDF阅读器、加入Win预览框支持、加入Win搜索支持等等，肯定是居家外出、浏览阅读的不二选择。</p> <p><img style="border-bottom: black 1px solid; border-left: black 1px solid; border-top: black 1px solid; border-right: black 1px solid" title="win7" alt="18款能让Win7如虎添翼的软件介绍(图十五)" src="http://www.qqread.com/ArtImage/20120117/0085_15.jpg" /><br />图15 Sumatra PDF</p> <p style="text-indent: 2em"><strong>16. 重复图片清除 &#8212;&#8212; Awesome Duplicate Photo Finder</strong></p> <p style="text-indent: 2em">推荐指数：&#9733;&#9733;&#9733;</p> <p style="text-indent: 2em">相信许多人都有在网上狂下图片的爱好，时间一长，pc中难免会生出许多重复图片。怎么样查找这些重复图片，一直是个让人头疼的问题。</p> <p><img style="border-bottom: black 1px solid; border-left: black 1px solid; border-top: black 1px solid; border-right: black 1px solid" title="win7" alt="18款能让Win7如虎添翼的软件介绍(图十六)" src="http://www.qqread.com/ArtImage/20120117/0085_16.jpg" /><br />图16 Awesome Duplicate Photo Finder</p> <p style="text-indent: 2em">Awesome Duplicate Photo  Finder是一款能够搜索重复图片的软件，客户只要事先设定好要过滤的图片相似度，高于此相似度的图片就会被自动列示出来。不过有必要讲一句的是，我们 在试用过程中发现Awesome Duplicate Photo  Finder存在一个小小的麻烦，那就是没有批量删除功能。换句话讲你需要很麻烦地一张张清理，对于急性子显然不是好消息。不过对于图片这类东东来讲，确 实还是边看边删的好，幸好大多数人pc中的重复图片也不会许多吧。</p> <p style="text-indent: 2em"><strong>17. 升级任务栏 &#8212;&#8212; Bins</strong></p> <p style="text-indent: 2em">推荐指数：&#9733;&#9733;&#9733;&#9733;&#9733;</p> <p style="text-indent: 2em"><strong>Win7</strong>任务栏变化不少，最大看点是增加了许多和Aero 有关的辅助应用（如Aero  Peek、Aero进度条、Jumplist等），但是这也引发了另一个问题，那就是过多的程序图标开始让任务栏不够用了。Bins是一款能够将图标任意 组合的软件，只要将一个程序图标拖拽到另一个图标上，两个图标就会自动拼合一起。当然这种组合的数量并不只限两个，你能把三个、四个、五个、八个，甚至更 多的图标合并一处，再将鼠标悬停到Bins上就能够看到里面的内容了。</p> <p><img style="border-bottom: black 1px solid; border-left: black 1px solid; border-top: black 1px solid; border-right: black 1px solid" title="win7" alt="18款能让Win7如虎添翼的软件介绍(图十七)" src="http://www.qqread.com/ArtImage/20120117/0085_17.jpg" /><br />图17 Bins</p> <p style="text-indent: 2em">除此之外，Bins的另一大用处是能将文档锁定到任务栏上，操作办法与程序一样，直接用鼠标拖拽上去即可。不用质疑， <strong>Win7</strong>是肯定没有提供的！</p> <p><img style="border-bottom: black 1px solid; border-left: black 1px solid; border-top: black 1px solid; border-right: black 1px solid" title="win7" alt="18款能让Win7如虎添翼的软件介绍(图十八)" src="http://www.qqread.com/ArtImage/20120117/0085_18.jpg" /><br />图18 文档锁定！这可是Win7里没有的哦~</p> <p style="text-indent: 2em"><strong>18. 快捷搜索 &#8212;&#8212; Listary</strong></p> <p><strong></strong><a href="http://www.qqread.com/win7/w471199.html"><strong><div><div>       <div>你是否以为win7的搜索天下无敌了？且仅为增强系统原有功能的小软件。因此像什么Total Commander之流的&#8220;高档货&#8221;便不在本文的列举范围。总体来讲，这些工具我们个人还是比较理想的，基本都是同类软件中最出类拔萃的。</div>     </div>            <div id="w_hzhbig">   </div>        <p style="text-indent: 2em">推荐指数：&#9733;&#9733;&#9733;&#9733;</p> <p style="text-indent: 2em">你是否以为<strong>Win7</strong>的搜索天下无敌了？呵呵，试一试这款 Listary吧。简单来讲，它的作用是为我们提供一种尤其简单的文件定位服务。举个例子吧，比如你要将一份文件保存到E盘某个文件夹，常规的办法是通过 保存面板中的左侧树目录，一级级定位到目的文件夹上，啰嗦并且麻烦。但是假设安装了Listary之后，只要在窗口底部搜索栏内输入首字母&#8220;E&#8221;，就能通 过级连菜单一键定位到目的区域。</p> <p><img style="border-bottom: black 1px solid; border-left: black 1px solid; border-top: black 1px solid; border-right: black 1px solid" title="win7" alt="18款能让Win7如虎添翼的软件介绍(图十九)" src="http://www.qqread.com/ArtImage/20120117/0085_19.jpg" /><br />图19 Listary</p> <p style="text-indent: 2em">此外它的另一大功能是，无论你在Win桌面，还文档&#8221;、&#8220;当前已经打开文件夹&#8221;两项迅速定位服务，此外还有一个&#8220;智能菜单&#8221;，内置了众多常用命令。如何？够拉风了吧！</p> <p><img style="border-bottom: black 1px solid; border-left: black 1px solid; border-top: black 1px solid; border-right: black 1px solid" title="win7" alt="18款能让Win7如虎添翼的软件介绍(图二十)" src="http://www.qqread.com/ArtImage/20120117/0085_20.jpg" /><br />图20 资源管理器的智能菜单</p> <p style="text-indent: 2em"><strong>后记</strong></p> <p style="text-indent: 2em">早在文章之初，我们便决定只推荐一部分小众化，且仅为增强系统原有功能的小<strong>软件</strong>。因此像什么Total Commander之流的&#8220;高档货&#8221;便不在本文的列举范围。总体来讲，这些工具我们个人还是比较理想的，基本都是同类<strong>软件</strong>中最出类拔萃的，并且无论是运行稳定性还是工作效率上都堪比原装。</p> <p style="text-indent: 2em">当然还是那句话，一个人的观点永远不兴许全部正确，假设你感觉哪款<strong>软件</strong>用着不爽，或还有更好选择的话，不妨也在下方的留言中告诉我们，好东西也要与大家一起分享哟！</p></div><br /></strong></a></p></div></div><br /></strong></div><img src ="http://www.cppblog.com/lauer3912/aggbug/168213.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/lauer3912/" target="_blank">RTY</a> 2012-03-17 17:42 <a href="http://www.cppblog.com/lauer3912/archive/2012/03/17/168213.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>常见问题：如何在有线无线网络共存的情况下合理配置路由 常见问题：如何在有线无线网络共存的情况下合理配置路由 常见问题：如何在有线无线网络共存的情况下合理配置路由</title><link>http://www.cppblog.com/lauer3912/archive/2012/03/06/167240.html</link><dc:creator>RTY</dc:creator><author>RTY</author><pubDate>Tue, 06 Mar 2012 05:25:00 GMT</pubDate><guid>http://www.cppblog.com/lauer3912/archive/2012/03/06/167240.html</guid><wfw:comment>http://www.cppblog.com/lauer3912/comments/167240.html</wfw:comment><comments>http://www.cppblog.com/lauer3912/archive/2012/03/06/167240.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/lauer3912/comments/commentRss/167240.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/lauer3912/services/trackbacks/167240.html</trackback:ping><description><![CDATA[<div>http://support1.lenovo.com.cn/lenovo/wsi/htmls/detail_12608716075461918.html<br /><div>文章编号:24625</div> <div>2006-11-28 9:46:54</div><br /> <div> <table border="0" cellspacing="0" cellpadding="3" width="100%"> <tbody> <tr> <td bgcolor="#ffffff">在很多情况下会出现有线与无线双网络共存的情况，此时就需要合理配置路由，否则网络访问时就会出现混乱，无法正常上网。<br />举例而言，公司存在tplink无线网络，为192.168.1.*网段，网关为192.168.1.1；有线网络为10.99.31.*网段，网关为10.99.31.2；要实现访问外网时使用无线，内网使用有线，则配置方法为：<br />1：运行CMD<br />2：route  delete 0.0.0.0 mask 0.0.0.0 10.99.31.2<br />&nbsp;&nbsp;  删除所有网络连接都从网关10.99.31.2走这条路径；<br />3：route add 10.0.0.0 mask 255.0.0.0 10.99.31.2  metric 1<br />&nbsp;&nbsp; 增加内网连接走内网网关路径；如果在该命令后加  －p参数将重新启动后命令有效，无需每次写这条命令了，只需要运行2就可以了。<br />可以将以上命令整合为一个bat文件，保存到所有程序项里面。在双网络都连接成功后，运行该bat文件就可以了。<br />关于Metric：<br />metric是路由算法用以确定到达目的地的最佳路径的计量标准,常用的metric值有:路径长度,可靠性,延迟,带宽,负载,通信代价等.<br />metric值的作用很大,我们常用它来计算路由的优先级,如两条到达相同网络的静态路由,metric小的优先级高;<br />因此，我们可以通过合理设置metric值来达到三个及三个以上多网络存在时的路由配置。<br />路由表示意图：<br /><img src="http://webdoc.lenovo.com.cn/lenovowsi/uploadimages/2006-11-27/5cP136bqpnrU1K2h.jpg"  alt="" /><br />解释：<br />默认网关为无线环境tplink的192.168.1.1，所有的网络数据请求都将通过这个网关出去，也就是说所有的网络请求都从无线出去。<br />persistent  routes列表代表所有10网段的都从有线的网关10.99.31.2出去，也就是说所有属于10网段的请求都从有线出去。通过这个路由来控制内网连接，也就是无线路由配置中所有网络请求走无线环境的例外！<br />另外，如果网络环境中配置有自动配置脚本，那么，配置脚本的优先级最高。网络的数据请求将按照配置脚本的配置实现。在此例中，如果有自动配置脚本proxy.pac，那么优先级别为proxy.pac&gt;192.168.1.1&gt;10.99.31.2；<br />&nbsp; &nbsp;</td></tr></tbody></table></div></div><img src ="http://www.cppblog.com/lauer3912/aggbug/167240.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/lauer3912/" target="_blank">RTY</a> 2012-03-06 13:25 <a href="http://www.cppblog.com/lauer3912/archive/2012/03/06/167240.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>怎样清除windows记住的网络用户名和密码</title><link>http://www.cppblog.com/lauer3912/archive/2012/02/29/166753.html</link><dc:creator>RTY</dc:creator><author>RTY</author><pubDate>Wed, 29 Feb 2012 03:03:00 GMT</pubDate><guid>http://www.cppblog.com/lauer3912/archive/2012/02/29/166753.html</guid><wfw:comment>http://www.cppblog.com/lauer3912/comments/166753.html</wfw:comment><comments>http://www.cppblog.com/lauer3912/archive/2012/02/29/166753.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/lauer3912/comments/commentRss/166753.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/lauer3912/services/trackbacks/166753.html</trackback:ping><description><![CDATA[<h4>怎样清除windows记住的网络用户名和密码</h4><div style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 13px; line-height: normal; color: #bbbbbb; background-color: #ffffff; "><div style="word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; "></div><div style="word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; "><span style="color: #000000; ">在Windows下访问另外一台机器的共享文件夹，一般情况下，只有第一次需要你输入用户名和密码，只要你不重新启动计算机，以后再访问这个网络共享文件夹就不再需要重复输入用户名和密码了</span></div><div style="word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; "><span style="color: #000000; ">如果你想重起计算机后，也不必再输入用户名和密码，那么在第一次输入用户名和密码的时候选中&#8220;记住我的密码&#8221;就可以了</span></div><div style="word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; "></div><div style="word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; "><span style="color: #000000; ">本来这是一个很贴心的设计</span></div><div style="word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; "><span style="color: #000000; ">可是有的时候，由于权限的等问题，我想换个用户访问这个网络共享：</span></div><div style="word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; "><span style="color: #000000; ">有如下方法：</span></div><div style="word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; "><span style="color: #000000; ">1、在命令行里输入 net use * /del ,删除远程连接，如果只想删除特定的远程连接，net use 的具体使用方法 使用 net use /? 察看</span></div><div style="word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; "><span style="color: #000000; ">2、对于使用了&#8220;记住我的密码&#8221; 的用户，还要删除 存储的用户名和密码 ，控制面板-〉存储的用户名和密码，删除相应的网络路径即可</span></div></div><img src ="http://www.cppblog.com/lauer3912/aggbug/166753.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/lauer3912/" target="_blank">RTY</a> 2012-02-29 11:03 <a href="http://www.cppblog.com/lauer3912/archive/2012/02/29/166753.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>VC编译Swig例子注意</title><link>http://www.cppblog.com/lauer3912/archive/2011/09/02/154978.html</link><dc:creator>RTY</dc:creator><author>RTY</author><pubDate>Fri, 02 Sep 2011 15:58:00 GMT</pubDate><guid>http://www.cppblog.com/lauer3912/archive/2011/09/02/154978.html</guid><wfw:comment>http://www.cppblog.com/lauer3912/comments/154978.html</wfw:comment><comments>http://www.cppblog.com/lauer3912/archive/2011/09/02/154978.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/lauer3912/comments/commentRss/154978.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/lauer3912/services/trackbacks/154978.html</trackback:ping><description><![CDATA[<div><div>使用VC编译程序示例源码的时候，碰到一些变量，这些变量需要说明一下。</div><div><strong>$(PYTHON_INCLUDE)</strong></div><div><strong>$(PYTHON_LIB)</strong></div><div></div><div>一般，在WIndows或者Linux上设置PYTHON_INCLUDE、PYTHON_LIB的变量就可以。如Windows的环境变量设置</div><div><strong>PYTHON_INCLUDE=C:\Python27\include</strong></div><div><strong>PYTHON_LIB=C:\Python27\libs\python27.lib</strong></div></div><img src ="http://www.cppblog.com/lauer3912/aggbug/154978.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/lauer3912/" target="_blank">RTY</a> 2011-09-02 23:58 <a href="http://www.cppblog.com/lauer3912/archive/2011/09/02/154978.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title> Visual Studio 2010旗舰版正式版序列号 及Windows 自动化 API 3.0</title><link>http://www.cppblog.com/lauer3912/archive/2011/08/19/153818.html</link><dc:creator>RTY</dc:creator><author>RTY</author><pubDate>Thu, 18 Aug 2011 16:11:00 GMT</pubDate><guid>http://www.cppblog.com/lauer3912/archive/2011/08/19/153818.html</guid><wfw:comment>http://www.cppblog.com/lauer3912/comments/153818.html</wfw:comment><comments>http://www.cppblog.com/lauer3912/archive/2011/08/19/153818.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/lauer3912/comments/commentRss/153818.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/lauer3912/services/trackbacks/153818.html</trackback:ping><description><![CDATA[<span class="Apple-style-span" style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff; "><p>用记事本打开：Setup&#8211;&gt;setup.sdb文件，将<br />[Product Key]<br />YR3W8FCM2B7BKF9HMQFTCH7WK<br />改成<br />[Product Key]<br />YCFHQ9DWCYDKV88T2TMHG7BHP<br />安装的时候就默认是这个正版的序列号了。</p><p>还有一种方法就是，不改这个文件，安装后，再添加删除程序的时候可以输入序列号：<br />YCFHQ-9DWCY-DKV88-T2TMH-G7BHP<br />也可以变成正版。</p><p>&nbsp;</p><p>安装完成后，下载安装Windows 自动化 API 3.0，Visual Studio 2010 的智能提示运行速度更快</p><p><br /><a href="http://support.microsoft.com/kb/981741/zh-cn" style="color: #336699; text-decoration: none; ">http://support.microsoft.com/kb/981741/zh-cn</a></p></span><img src ="http://www.cppblog.com/lauer3912/aggbug/153818.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/lauer3912/" target="_blank">RTY</a> 2011-08-19 00:11 <a href="http://www.cppblog.com/lauer3912/archive/2011/08/19/153818.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>VC调试器高级应用----高级断点篇</title><link>http://www.cppblog.com/lauer3912/archive/2011/08/12/153240.html</link><dc:creator>RTY</dc:creator><author>RTY</author><pubDate>Fri, 12 Aug 2011 15:37:00 GMT</pubDate><guid>http://www.cppblog.com/lauer3912/archive/2011/08/12/153240.html</guid><wfw:comment>http://www.cppblog.com/lauer3912/comments/153240.html</wfw:comment><comments>http://www.cppblog.com/lauer3912/archive/2011/08/12/153240.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/lauer3912/comments/commentRss/153240.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/lauer3912/services/trackbacks/153240.html</trackback:ping><description><![CDATA[<span class="Apple-style-span" style="color: #333333; font-family: Arial; background-color: #ffffff; "><strong><span lang="EN-US" style="font-size: 12pt; color: #000099; line-height: 24px; font-family: 宋体; ">VC</span></strong><strong><span style="font-size: 12pt; color: #000099; line-height: 24px; font-family: 宋体; ">调试器高级应用<span lang="EN-US">----</span>高级断点篇<br /></span></strong></span><span class="Apple-style-span" style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff; "><p class="MsoNormal" align="left" style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; line-height: 21px; text-align: left; "><span lang="EN-US" style="font-size: 12pt; color: black; line-height: 24px; font-family: 宋体; ">VC</span><span style="font-size: 12pt; color: black; line-height: 24px; font-family: 宋体; ">调试器高级应用<span lang="EN-US">----</span>高级断点篇</span></p><p class="MsoNormal" align="left" style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; line-height: 21px; text-align: left; "><span style="font-size: 12pt; color: black; line-height: 24px; font-family: 宋体; ">一<span lang="EN-US">.</span>高级断点语法<span lang="EN-US">&nbsp;&nbsp;<br />&nbsp;<br /></span>高级断点语法由两部分组成<span lang="EN-US">:1.</span>上下文部分<span lang="EN-US">.2.</span>位置<span lang="EN-US">,</span>表达式<span lang="EN-US">,</span>变量或<span lang="EN-US">Windows</span>消息条件<span lang="EN-US">.&nbsp;</span></span></p><p class="MsoNormal" align="left" style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; line-height: 21px; text-align: left; "><span style="font-size: 12pt; color: black; line-height: 24px; font-family: 宋体; ">用函数<span lang="EN-US">,</span>源文件和二进制模块来指定上下文<span lang="EN-US">,</span>上下文的表示方法<span lang="EN-US">:&nbsp;</span></span></p><p class="MsoNormal" align="left" style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; line-height: 21px; text-align: left; "><span lang="EN-US" style="font-size: 12pt; color: black; line-height: 24px; font-family: 宋体; ">{[</span><span style="font-size: 12pt; color: black; line-height: 24px; font-family: 宋体; ">函数<span lang="EN-US">],[</span>源文件<span lang="EN-US">],[</span>二进制模块<span lang="EN-US">]}&nbsp;&nbsp;&nbsp;</span></span></p><p class="MsoNormal" align="left" style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; line-height: 21px; text-align: left; "><span style="font-size: 12pt; color: black; line-height: 24px; font-family: 宋体; ">必须指定唯一的<span lang="EN-US">,</span>足够的上下文信息才能获取断点位置<span lang="EN-US">.</span>如在<span lang="EN-US">TEST.CPP</span>的<span lang="EN-US">20</span>行设一位置断点<span lang="EN-US">,</span>语法为<span lang="EN-US">:{,TEST.CPP,}.20,</span>如<span lang="EN-US">A.DLL</span>或<span lang="EN-US">B.DLL</span>都使用了该行<span lang="EN-US">,</span>又只想在<span lang="EN-US">B.DLL</span>的调用中触发<span lang="EN-US">,</span>则必须使用<span lang="EN-US">:{,TEST.CPP,B.DLL}.20.&nbsp;</span></span></p><p class="MsoNormal" align="left" style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; line-height: 21px; text-align: left; "><span lang="EN-US" style="font-size: 12pt; color: black; line-height: 24px; font-family: 宋体; ">VC</span><span style="font-size: 12pt; color: black; line-height: 24px; font-family: 宋体; ">调试器中可直接输入上下文语法<span lang="EN-US">:Breakpoints</span>对话框的<span lang="EN-US">Location</span>选项卡<span lang="EN-US">BreakAt</span>编辑框中<span lang="EN-US">.</span>更容易的方法是使用<span lang="EN-US">BreatAt</span>框右的箭头打开菜单<span lang="EN-US">,</span>选择<span lang="EN-US">Advanced</span>项<span lang="EN-US">,</span>然后在<span lang="EN-US">Context</span>框中输入断点的相应信息<span lang="EN-US">.&nbsp;</span></span></p><p class="MsoNormal" align="left" style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; line-height: 21px; text-align: left; "><span style="font-size: 12pt; color: black; line-height: 24px; font-family: 宋体; ">如想在一个绝对地址上中断<span lang="EN-US">,</span>直接在<span lang="EN-US">BreakAt</span>框中输入地址就行<span lang="EN-US">.&nbsp;</span></span></p><p class="MsoNormal" align="left" style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; line-height: 21px; text-align: left; "><span style="font-size: 12pt; color: black; line-height: 24px; font-family: 宋体; ">二<span lang="EN-US">.</span>任何函数上快速中断<span lang="EN-US">&nbsp;&nbsp;<br />&nbsp;<br /></span>将函数名输入<span lang="EN-US">BreadAt</span>框中<span lang="EN-US">.</span>如果是<span lang="EN-US">C++</span>代码<span lang="EN-US">,</span>同时还需要类限定符<span lang="EN-US">.</span>支持重载了的函数<span lang="EN-US">,</span>调试器会列出所有满足条件的函数供选择<span lang="EN-US">,</span>如输入时提供足够的信息<span lang="EN-US">,</span>完全可略过选择过程<span lang="EN-US">.</span>如输入<span lang="EN-US">:"CString::operator=(const&nbsp; char&nbsp; *)"</span>可唯一确定要中断的函数<span lang="EN-US">.&nbsp;&nbsp;<br />&nbsp;<br /></span>三<span lang="EN-US">.</span>在系统或<span lang="EN-US">DLL</span>输出的函数中设置断点<span lang="EN-US">&nbsp;&nbsp;<br />&nbsp;<br /></span>在程序中从<span lang="EN-US">DLL</span>输入的函数中设置一个断点可能是毫无作用的<span lang="EN-US">,</span>调试器需要知道在何处可以找到该函数上下文信息<span lang="EN-US">,</span>同时<span lang="EN-US">,</span>函数名取决于是否加载了<span lang="EN-US">DLL</span>的符号<span lang="EN-US">.</span>只有在<span lang="EN-US">W2K</span>以上版本中才能在系统<span lang="EN-US">DLL</span>中设置断点<span lang="EN-US">--</span>原因在于其它系统没有提供边写入边复制保护的功能<span lang="EN-US">,</span>若一定要启用这种方法<span lang="EN-US">,</span>必须要有<span lang="EN-US">COFF(Common&nbsp; Object&nbsp; File&nbsp; Format),</span>并在调试器中输出启动的装载<span lang="EN-US">----</span>在<span lang="EN-US">Options</span>对话框的<span lang="EN-US">Debug</span>页<span lang="EN-US">,</span>将<span lang="EN-US">Load&nbsp; COFF&nbsp; &amp;&nbsp; Exports</span>选中<span lang="EN-US">.&nbsp;</span></span></p><p class="MsoNormal" align="left" style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; line-height: 21px; text-align: left; "><span lang="EN-US" style="font-size: 12pt; color: black; line-height: 24px; font-family: 宋体; ">VC</span><span style="font-size: 12pt; color: black; line-height: 24px; font-family: 宋体; ">调试器用分级的符号信息法<span lang="EN-US">,</span>完整的符号的级别高于不太完整的<span lang="EN-US">.PDB(Program&nbsp; Database)</span>文件具有所有可能的源码行<span lang="EN-US">,</span>函数<span lang="EN-US">,</span>变量和类型信息<span lang="EN-US">,</span>优先级便高于<span lang="EN-US">COFF/DBG</span>文件<span lang="EN-US">,</span>后者只有公用函数符号<span lang="EN-US">,</span>而<span lang="EN-US">COFF/DBG</span>文件高于输出名称<span lang="EN-US">,</span>输入的名称是一种伪符号<span lang="EN-US">.&nbsp;&nbsp;<br /></span>调试时<span lang="EN-US">,</span>如<span lang="EN-US">DEBUG</span>窗口输出<span lang="EN-US">:</span>装载<span lang="EN-US">DLL</span>的符号<span lang="EN-US">,</span>则说明符号已被装入<span lang="EN-US">;</span>否则说明没有装载<span lang="EN-US">DLL</span>的符号<span lang="EN-US">.&nbsp;</span></span></p><p class="MsoNormal" align="left" style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; line-height: 21px; text-align: left; "><span style="font-size: 12pt; color: black; line-height: 24px; font-family: 宋体; ">没有装入符号时<span lang="EN-US">,</span>使用的位置字符串是<span lang="EN-US">DLL</span>输出的名称<span lang="EN-US">,</span>可能用<span lang="EN-US">DUMPBIN</span>程序查看这个名称<span lang="EN-US">:DUMPBIN&nbsp; /EXPORTS&nbsp; DLLname.</span>例<span lang="EN-US">:</span>在<span lang="EN-US">LoadLibraryA</span>中设置中断<span lang="EN-US">:"{,,Kernel32.dll}LoadLibraryA".&nbsp;</span></span></p><p class="MsoNormal" align="left" style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; line-height: 21px; text-align: left; "><span style="font-size: 12pt; color: black; line-height: 24px; font-family: 宋体; ">如装入了符号<span lang="EN-US">,</span>则要根据输出函数和调用协议来计算函数名<span lang="EN-US">.</span>如上例<span lang="EN-US">,LoadLibraryA</span>使用<span lang="EN-US">__stdcall</span>调用协议<span lang="EN-US">,</span>据该协议<span lang="EN-US">,</span>函数名以下划线为前缀<span lang="EN-US">,</span>所跟有进栈的字节数为后缀的<span lang="EN-US">@</span>号<span lang="EN-US">.</span>一般说来<span lang="EN-US">,</span>参数个数<span lang="EN-US">*4,</span>就是参数占用栈空间的总字节数<span lang="EN-US">,LoadLibary</span>的名称便是<span lang="EN-US">:_LoadLibraryA@4,</span>故最后的语法是<span lang="EN-US">:</span>或<span lang="EN-US">"{,,Kernel32.dll}_LoadLibraryA@4"&nbsp;&nbsp;<br />&nbsp;<br /></span>附<span lang="EN-US">:</span>常用的调用协议<span lang="EN-US">&nbsp;</span></span></p><p class="MsoNormal" align="left" style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; line-height: 21px; text-align: left; "><span lang="EN-US" style="font-size: 12pt; color: black; line-height: 24px; font-family: 宋体; ">&nbsp;&nbsp;&nbsp;&nbsp; 1</span><span style="font-size: 12pt; color: black; line-height: 24px; font-family: 宋体; ">、<span lang="EN-US">__stdcall</span>调用约定相当于<span lang="EN-US">16</span>位动态库中经常使用的<span lang="EN-US">PASCAL</span>调用约定。在<span lang="EN-US">32</span>位的<span lang="EN-US">VC++5.0</span>中<span lang="EN-US">PASCAL</span>调用约定不再被支持（实际上它已被定义为<span lang="EN-US">__stdcall</span>。除了<span lang="EN-US">__pascal</span>外，<span lang="EN-US">__fortran</span>和<span lang="EN-US">__syscall</span>也不被支持），取而代之的是<span lang="EN-US">__stdcall</span>调用约定。两者实质上是一致的，即函数的参数自右向左通过栈传递，被调用的函数在返回前清理传送参数的内存栈，但不同的是函数名的修饰部分（关于函数名的修饰部分在后面将详细说明）。<span lang="EN-US">&nbsp;</span></span></p><p class="MsoNormal" align="left" style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; line-height: 21px; text-align: left; "><span lang="EN-US" style="font-size: 12pt; color: black; line-height: 24px; font-family: 宋体; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _stdcall</span><span style="font-size: 12pt; color: black; line-height: 24px; font-family: 宋体; ">是<span lang="EN-US">Pascal</span>程序的缺省调用方式，通常用于<span lang="EN-US">Win32&nbsp; Api</span>中，函数采用从右到左的压栈方式，自己在退出时清空堆栈。<span lang="EN-US">VC</span>将函数编译后会在函数名前面加上下划线前缀，在函数名后加上<span lang="EN-US">"@"</span>和参数的字节数。<span lang="EN-US">&nbsp;</span></span></p><p class="MsoNormal" align="left" style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; line-height: 21px; text-align: left; "><span lang="EN-US" style="font-size: 12pt; color: black; line-height: 24px; font-family: 宋体; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2</span><span style="font-size: 12pt; color: black; line-height: 24px; font-family: 宋体; ">、<span lang="EN-US">C</span>调用约定（即用<span lang="EN-US">__cdecl</span>关键字说明）按从右至左的顺序压参数入栈，由调用者把参数弹出栈。对于传送参数的内存栈是由调用者来维护的（正因为如此，实现可变参数的函数只能使用该调用约定）。另外，在函数名修饰约定方面也有所不同。<span lang="EN-US">&nbsp;</span></span></p><p class="MsoNormal" align="left" style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; line-height: 21px; text-align: left; "><span lang="EN-US" style="font-size: 12pt; color: black; line-height: 24px; font-family: 宋体; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _cdecl</span><span style="font-size: 12pt; color: black; line-height: 24px; font-family: 宋体; ">是<span lang="EN-US">C</span>和<span lang="EN-US">C</span>＋＋程序的缺省调用方式。每一个调用它的函数都包含清空堆栈的代码，所以产生的可执行文件大小会比调用<span lang="EN-US">_stdcall</span>函数的大。函数采用从右到左的压栈方式。<span lang="EN-US">VC</span>将函数编译后会在函数名前面加上下划线前缀。是<span lang="EN-US">MFC</span>缺省调用约定。<span lang="EN-US">&nbsp;</span></span></p><p class="MsoNormal" align="left" style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; line-height: 21px; text-align: left; "><span lang="EN-US" style="font-size: 12pt; color: black; line-height: 24px; font-family: 宋体; ">3</span><span style="font-size: 12pt; color: black; line-height: 24px; font-family: 宋体; ">、<span lang="EN-US">__fastcall</span>调用约定是<span lang="EN-US">&#8220;</span>人<span lang="EN-US">&#8221;</span>如其名，它的主要特点就是快，因为它是通过寄存器来传送参数的（实际上，它用<span lang="EN-US">ECX</span>和<span lang="EN-US">EDX</span>传送前两个双字（<span lang="EN-US">DWORD</span>）或更小的参数，剩下的参数仍旧自右向左压栈传送，被调用的函数在返回前清理传送参数的内存栈），在函数名修饰约定方面，它和前两者均不同。<span lang="EN-US">&nbsp;</span></span></p><p class="MsoNormal" align="left" style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; line-height: 21px; text-align: left; "><span lang="EN-US" style="font-size: 12pt; color: black; line-height: 24px; font-family: 宋体; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _fastcall</span><span style="font-size: 12pt; color: black; line-height: 24px; font-family: 宋体; ">方式的函数采用寄存器传递参数，<span lang="EN-US">VC</span>将函数编译后会在函数名前面加上<span lang="EN-US">"@"</span>前缀，在函数名后加上<span lang="EN-US">"@"</span>和参数的字节数。<span lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span></p><p class="MsoNormal" align="left" style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; line-height: 21px; text-align: left; "><span lang="EN-US" style="font-size: 12pt; color: black; line-height: 24px; font-family: 宋体; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4</span><span style="font-size: 12pt; color: black; line-height: 24px; font-family: 宋体; ">、<span lang="EN-US">thiscall</span>仅仅应用于<span lang="EN-US">&#8220;C++&#8221;</span>成员函数。<span lang="EN-US">this</span>指针存放于<span lang="EN-US">CX</span>寄存器，参数从右到左压。<span lang="EN-US">thiscall</span>不是关键词，因此不能被程序员指定。<span lang="EN-US">&nbsp;</span></span></p><p class="MsoNormal" align="left" style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; line-height: 21px; text-align: left; "><span lang="EN-US" style="font-size: 12pt; color: black; line-height: 24px; font-family: 宋体; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 5</span><span style="font-size: 12pt; color: black; line-height: 24px; font-family: 宋体; ">、<span lang="EN-US">naked&nbsp; call</span>采用<span lang="EN-US">1-4</span>的调用约定时，如果必要的话，进入函数时编译器会产生代码来保存<span lang="EN-US">ESI</span>，<span lang="EN-US">EDI</span>，<span lang="EN-US">EBX</span>，<span lang="EN-US">EBP</span>寄存器，退出函数时则产生代码恢复这些寄存器的内容。<span lang="EN-US">naked&nbsp; call</span>不产生这样的代码。<span lang="EN-US">naked&nbsp; call</span>不是类型修饰符，故必须和<span lang="EN-US">_declspec</span>共同使用。<span lang="EN-US">&nbsp;</span></span></p><p class="MsoNormal" align="left" style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; line-height: 21px; text-align: left; "><span lang="EN-US" style="font-size: 12pt; color: black; line-height: 24px; font-family: 宋体; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="font-size: 12pt; color: black; line-height: 24px; font-family: 宋体; ">关键字<span lang="EN-US">&nbsp; __stdcall</span>、<span lang="EN-US">__cdecl</span>和<span lang="EN-US">__fastcall</span>可以直接加在要输出的函数前，也可以在编译环境的<span lang="EN-US">Setting...C/C++&nbsp; Code&nbsp; Generation</span>项选择。当加在输出函数前的关键字与编译环境中的选择不同时，直接加在输出函数前的关键字有效。它们对应的命令行参数分别为<span lang="EN-US">/Gz</span>、<span lang="EN-US">/Gd</span>和<span lang="EN-US">/Gr</span>。缺省状态为<span lang="EN-US">/Gd</span>，即<span lang="EN-US">__cdecl</span>。<span lang="EN-US">&nbsp;</span></span></p><p class="MsoNormal" align="left" style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; line-height: 21px; text-align: left; "><span lang="EN-US" style="font-size: 12pt; color: black; line-height: 24px; font-family: 宋体; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="font-size: 12pt; color: black; line-height: 24px; font-family: 宋体; ">要完全模仿<span lang="EN-US">PASCAL</span>调用约定首先必须使用<span lang="EN-US">__stdcall</span>调用约定，至于函数名修饰约定，可以通过其它方法模仿。还有一个值得一提的是<span lang="EN-US">WINAPI</span>宏，<span lang="EN-US">Windows.h</span>支持该宏，它可以将出函数翻译成适当的调用约定，在<span lang="EN-US">WIN32</span>中，它被定义为<span lang="EN-US">__stdcall</span>。使用<span lang="EN-US">WINAPI</span>宏可以创建自己的<span lang="EN-US">APIs</span>。<span lang="EN-US">&nbsp;&nbsp;<br />&nbsp;<br /></span>四<span lang="EN-US">.</span>位置断点修饰符<span lang="EN-US">&nbsp;&nbsp;<br />&nbsp;<br />1.</span>跳跃计数<span lang="EN-US">.&nbsp;</span></span></p><p class="MsoNormal" align="left" style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; line-height: 21px; text-align: left; "><span style="font-size: 12pt; color: black; line-height: 24px; font-family: 宋体; ">功能是执行断点但不在断点处停止<span lang="EN-US">,</span>直到执行完了一个特定的次数为止<span lang="EN-US">.&nbsp;</span></span></p><p class="MsoNormal" align="left" style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; line-height: 21px; text-align: left; "><span style="font-size: 12pt; color: black; line-height: 24px; font-family: 宋体; ">使用中首先设置一个标准的位置断点<span lang="EN-US">,</span>打开<span lang="EN-US">BreadPoint</span>对话框<span lang="EN-US">,</span>选中该断点<span lang="EN-US">,</span>单击<span lang="EN-US">Condition,</span>然后在弹出的对话框最下面的编辑控件中输入次数<span lang="EN-US">.&nbsp;</span></span></p><p class="MsoNormal" align="left" style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; line-height: 21px; text-align: left; "><span style="font-size: 12pt; color: black; line-height: 24px; font-family: 宋体; ">只有当程序全速运行时<span lang="EN-US">,</span>未执行的循环次数才有用<span lang="EN-US">.</span>单步执行跨过断点时不会更新跳跃计数<span lang="EN-US">.&nbsp;</span></span></p><p class="MsoNormal" align="left" style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; line-height: 21px; text-align: left; "><span style="font-size: 12pt; color: black; line-height: 24px; font-family: 宋体; ">例<span lang="EN-US">:</span>已知循环可能崩溃<span lang="EN-US">,</span>但不清楚在哪次循环时<span lang="EN-US">,</span>输入远远大于总循环次数的跳跃计数修饰符<span lang="EN-US">,</span>则在崩溃时可打开<span lang="EN-US">Breakpoint</span>框<span lang="EN-US">,</span>其中将列出还未执行的循环次数<span lang="EN-US">,</span>与总次数相减就可得已执行的次数<span lang="EN-US">.&nbsp;&nbsp;<br />&nbsp;<br />2.</span>条件表达式<span lang="EN-US">.&nbsp;</span></span></p><p class="MsoNormal" align="left" style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; line-height: 21px; text-align: left; "><span style="font-size: 12pt; color: black; line-height: 24px; font-family: 宋体; ">只有表达式为真时触发<span lang="EN-US">.Breakpoint</span>框<span lang="EN-US">Condition</span>按钮<span lang="EN-US">,</span>选第一个编辑框<span lang="EN-US">,</span>输入表达式即可<span lang="EN-US">.</span>规则<span lang="EN-US">:&nbsp;</span></span></p><p class="MsoNormal" align="left" style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; line-height: 21px; text-align: left; "><span lang="EN-US" style="font-size: 12pt; color: black; line-height: 24px; font-family: 宋体; ">.</span><span style="font-size: 12pt; color: black; line-height: 24px; font-family: 宋体; ">只可使用<span lang="EN-US">C</span>类型比较运算符<span lang="EN-US">.&nbsp;&nbsp;<br />.</span>表达式中不能调用任何函数<span lang="EN-US">.&nbsp;&nbsp;<br />.</span>表达式中不能包含任何宏值<span lang="EN-US">.&nbsp;</span></span></p><p class="MsoNormal" align="left" style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; line-height: 21px; text-align: left; "><span style="font-size: 12pt; color: black; line-height: 24px; font-family: 宋体; ">表达式为<span lang="EN-US">@TIB=Thread&nbsp; Infomation&nbsp; Block&nbsp; Linear&nbsp; Address,</span>则程序只在该特定线程中才会中断<span lang="EN-US">.</span>例<span lang="EN-US">:</span>线程<span lang="EN-US">@TIB</span>地址值为<span lang="EN-US">0E000,</span>则输入<span lang="EN-US">"@TIB==0xE000",</span>则在切换到该线程时中断<span lang="EN-US">.</span>对<span lang="EN-US">W98,</span>可用<span lang="EN-US">@FS=thread&nbsp; specific&nbsp; value.&nbsp;</span></span></p><p class="MsoNormal" align="left" style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; line-height: 21px; text-align: left; "><span style="font-size: 12pt; color: black; line-height: 24px; font-family: 宋体; ">如在某特定错误后中断<span lang="EN-US">,</span>则可用<span lang="EN-US">@ERR,</span>如<span lang="EN-US">"@ERR=2"</span>表示在最后错误为<span lang="EN-US">ERROR_FILE_NOT_FOUND.</span>除<span lang="EN-US">@CLK</span>外<span lang="EN-US">,</span>所有可在<span lang="EN-US">WATCH</span>窗口中使用的伪寄存器均可用于条件表达式<span lang="EN-US">.&nbsp;&nbsp;<br />&nbsp;<br /></span>条件表达式可与跳跃断点组合使用<span lang="EN-US">.&nbsp;&nbsp;<br />&nbsp;<br />3.</span>变量更改<span lang="EN-US">&nbsp;</span></span></p><p class="MsoNormal" align="left" style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; line-height: 21px; text-align: left; "><span style="font-size: 12pt; color: black; line-height: 24px; font-family: 宋体; ">在变量更改时中断程序<span lang="EN-US">.</span>只有当位置断点执行时才能检查变量<span lang="EN-US">.</span>常用用调用栈高层的函数中发现出错<span lang="EN-US">,</span>需要深入调用栈<span lang="EN-US">,</span>压缩范围找出根源时<span lang="EN-US">.&nbsp;</span></span></p><p class="MsoNormal" align="left" style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; line-height: 21px; text-align: left; "><span style="font-size: 12pt; color: black; line-height: 24px; font-family: 宋体; ">添加时在<span lang="EN-US">Breakpoint</span>框第一个编辑框中输入变量名<span lang="EN-US">(</span>可以是指针指向听对象<span lang="EN-US">:*p),</span>在第二个编辑框中输入要查看的项目数量<span lang="EN-US">.&nbsp;&nbsp;<br />&nbsp;<br /></span>五<span lang="EN-US">.</span>全局表达式和条件断点<span lang="EN-US">.&nbsp;&nbsp;<br />&nbsp;<br /></span>调试器可监控某一地址和该地址上的<span lang="EN-US">1,2</span>或<span lang="EN-US">4</span>字节的内容<span lang="EN-US">.</span>如可用硬件调试寄存器<span lang="EN-US">,</span>则不影响速度<span lang="EN-US">;</span>否则程序将单步执行<span lang="EN-US">ASM</span>指令并在每一步中检查条件<span lang="EN-US">,</span>这将严重影响程序运行速度<span lang="EN-US">.&nbsp;</span></span></p><p class="MsoNormal" align="left" style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; line-height: 21px; text-align: left; "><span style="font-size: 12pt; color: black; line-height: 24px; font-family: 宋体; ">总共有<span lang="EN-US">4</span>个调试寄存器<span lang="EN-US">.</span>硬件调试寄存器不能处理超过<span lang="EN-US">1</span>个双字长的引用<span lang="EN-US">.</span>确保利用硬件调试寄存器的最好方法是使用表达式和数据更改位置的实际地址值<span lang="EN-US">.</span>例如<span lang="EN-US">:g_szGlobal</span>是全局数组指针<span lang="EN-US">,</span>地址为<span lang="EN-US">0x5000,</span>则在<span lang="EN-US">Breakpoint</span>对话框中<span lang="EN-US">DATA</span>选项卡中将表达式断点设为<span lang="EN-US">"*(char*))0x5000=='G'",</span>但如果写为<span lang="EN-US">"WO(0x5000)=='G',</span>则用不到硬件调试寄存器<span lang="EN-US">,</span>会单步执行每条指令<span lang="EN-US">.&nbsp;</span></span></p><p class="MsoNormal" align="left" style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; line-height: 21px; text-align: left; "><span style="font-size: 12pt; color: black; line-height: 24px; font-family: 宋体; ">与全局表达式断点类似<span lang="EN-US">,</span>使用变量的<span lang="EN-US">16</span>进制地址给定长指针计算地址<span lang="EN-US">,</span>并将要查看的单元数设为<span lang="EN-US">1,</span>则全局变量断点可发挥最付佳功效<span lang="EN-US">.</span>如上例要在变量改动时中断<span lang="EN-US">,</span>则输入<span lang="EN-US">:"*(long*)0x5000".&nbsp;&nbsp;<br />&nbsp;<br /></span>六<span lang="EN-US">.WINDOWS</span>消息断点<span lang="EN-US">.&nbsp;&nbsp;<br />&nbsp;<br />Breakpoint</span>框的<span lang="EN-US">Message</span>页<span lang="EN-US">.</span>需要指定一个窗口过程<span lang="EN-US">,</span>注意<span lang="EN-US">:MFC</span>世界中<span lang="EN-US">AfxWndProc</span>是多数窗口的一个窗口过程<span lang="EN-US">,</span>所以总会在该断</span></p></span><img src ="http://www.cppblog.com/lauer3912/aggbug/153240.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/lauer3912/" target="_blank">RTY</a> 2011-08-12 23:37 <a href="http://www.cppblog.com/lauer3912/archive/2011/08/12/153240.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>vc调试窗口表达式格式化资料</title><link>http://www.cppblog.com/lauer3912/archive/2011/08/12/153239.html</link><dc:creator>RTY</dc:creator><author>RTY</author><pubDate>Fri, 12 Aug 2011 15:31:00 GMT</pubDate><guid>http://www.cppblog.com/lauer3912/archive/2011/08/12/153239.html</guid><wfw:comment>http://www.cppblog.com/lauer3912/comments/153239.html</wfw:comment><comments>http://www.cppblog.com/lauer3912/archive/2011/08/12/153239.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/lauer3912/comments/commentRss/153239.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/lauer3912/services/trackbacks/153239.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 摘自msdn，列在这里方便查阅。The following tables show the format specifiers recognized by the debugger.&nbsp;SpecifierFormatExpressionValue Displayedd,isigned decimal integer0xF000F065, d-268373915uunsigned decim...&nbsp;&nbsp;<a href='http://www.cppblog.com/lauer3912/archive/2011/08/12/153239.html'>阅读全文</a><img src ="http://www.cppblog.com/lauer3912/aggbug/153239.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/lauer3912/" target="_blank">RTY</a> 2011-08-12 23:31 <a href="http://www.cppblog.com/lauer3912/archive/2011/08/12/153239.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>DLL导出类的问题</title><link>http://www.cppblog.com/lauer3912/archive/2011/08/10/152912.html</link><dc:creator>RTY</dc:creator><author>RTY</author><pubDate>Tue, 09 Aug 2011 23:23:00 GMT</pubDate><guid>http://www.cppblog.com/lauer3912/archive/2011/08/10/152912.html</guid><wfw:comment>http://www.cppblog.com/lauer3912/comments/152912.html</wfw:comment><comments>http://www.cppblog.com/lauer3912/archive/2011/08/10/152912.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/lauer3912/comments/commentRss/152912.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/lauer3912/services/trackbacks/152912.html</trackback:ping><description><![CDATA[<span class="Apple-style-span" style="color: #0c095a; font-family: 宋体; font-size: 24px; font-weight: bold; line-height: normal; white-space: nowrap; ">DLL导出类的问题<br /><br /></span><div><a href="http://www.diybl.com/course/3_program/c++/cppjs/200833/102641.html">http://www.diybl.com/course/3_program/c++/cppjs/200833/102641.html<br /><span class="Apple-style-span" style="color: #383838; font-family: Arial, Helvetica, sans-serif; line-height: 24px; -webkit-text-decorations-in-effect: none; ">DLL动态链接库是程序复用的重要方式，DLL可以导出函数，使函数被多个程序复用，DLL中的函数实现可以被修改而无需重新编译和连接使用该DLL的应用程序。作为一名面向对象的程序员，希望DLL可以导出类，以便在类的层次上实现复用。所幸的是，DLL确实也可以导出类。<br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " /><br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " />然而事实却没这么简单，导出类的DLL在维护和修改时有很多地方必需很小心，增加成员变量、修改导出类的基类等操作都可能导致意想不到的后果，也许<a class="qs_highlight1" id="hl_2" href="http://clk.qunsee.com/click/click.php?cpid=510&amp;ads_id=46&amp;pid=99000630&amp;cid=634&amp;url=http%3A//www.qunsee.com/sitepage.php&amp;k=%u7528%u6237&amp;s=http%3A//www.diybl.com/course/3_program/c++/cppsl/200819/96118.html&amp;rn=221948&amp;v=1&amp;ref=http%3A//www.diybl.com/course/3_program/c++/cppsl/200819/96118_2.html&amp;province=%u5E7F%u4E1C&amp;city=%u5E7F%u5DDE" target="_blank" style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font-size: 1em; ">用户</a>更新了最新版本的DLL库后，应用程序就再也不能<a class="qs_highlight1" id="hl_0" href="http://clk.qunsee.com/click/click.php?cpid=12&amp;ads_id=227&amp;pid=99000630&amp;cid=634&amp;url=http%3A//www.chanet.com.cn/click.cgi%3Fa%3D59068%26d%3D21733%26u%3D%26e%3D&amp;k=%u5DE5%u4F5C&amp;s=http%3A//www.diybl.com/course/3_program/c++/cppsl/200819/96118.html&amp;rn=402195&amp;v=1&amp;ref=http%3A//www.diybl.com/course/3_program/c++/cppsl/200819/96118_2.html&amp;province=%u5E7F%u4E1C&amp;city=%u5E7F%u5DDE" target="_blank" style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font-size: 1em; ">工作</a>了。这就是著名的DLL Hell（DLL地狱）问题。<br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " /><br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " />DLL地狱问题是怎么产生的呢？看下面的例子，假设DLL有一个导出类ClassD1：<br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " />class ClassD<br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " />{<br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " /><span style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public:</span><br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " />int GetInt();<br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " /><span style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; private:</span><br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " />int m_i;<br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " />};<br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " />int ClassD::GetInt()<br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " />{<br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " /><span style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return m_i;</span><br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " />}<br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " /><br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " />应用程序使用现在的代码来使用这个类：<br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " />ClassD d;<br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " />printf(&#8220;%d&#8221;, d.GetInt());<br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " />&nbsp;<br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " />程序进行正正常，没有什么问题。后来DLL需要升级，对ClassD进行了修改，增加了一个成员变量，如下：<br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " />class ClassD // 修改后<br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " />{<br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " /><span style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public:</span><br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " />int GetInt();<br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " /><span style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; private:</span><br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " /><span style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int m_i2;</span><br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " />int m_i;<br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " />};<br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " /><br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " />把新的DLL编译连接完成后，复制到应用程序目录，这个倒楣的应用程序调用GetInt方法恐怕再也无法得正确的值了。事实上它还算幸运的，如果GetInt的实现改成如下这样，那么它马上就要出错退出了。<br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " />int ClassD::GetInt() // 修改后<br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " />{<br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " /><span style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return m_i++;</span><br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " />}<br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " /><br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " />这样的事情，称它是个地狱（Hell）一点也不夸张。为什么会出错呢？我们要先从类实例的创建开始，看看使用一个类的工作过程。<br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " /><br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " />首先，程序语句&#8220;ClassD d；&#8221;为这个类申请一块内存。这块内存保存该类的所有成员变量，以及虚函数表。内存的大小由类的声明决定，在应用程序编译时就已经确定。<br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " /><br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " />然后，当调用&#8220;d.GetInt()&#8221;时，把申请的这一块内存做为this指针传给GetInt函数，GetInt函数从this指向的位置开始，加上m_i应有的偏移量，计算m_i所在的内存位置，并从该位置取数据返回。m_i相对this的偏移量是由m_i在类中定义的位置决定的，定义在前的成员变量在内存中也更靠前。这个偏移量在DLL编译时确定。<br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " /><br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " />当ClassD的定义改为修改后的状态时，有些东西变了。<br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " /><br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " />第一个变的是内存的大小。因为修改后的ClassD多了一个成员变量，所以内存也变大了。然而这一点应用程序并不知道。<br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " /><br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " />第二个变的是m_i的偏移地址。因为在m_i之前定义了一个m_i2，m_i的实现偏移地址实际已经靠后了。所以d.GetInt()访问的将是原来m_i后面的那个位置，而这个位置已经超出原来那块内存的后部范围了。<br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " /><br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " />很显然，在更换了DLL后，应用程序还按原来的大小申请了一块内存，而它调用的方法却访问了比这块内存更大的区域，出错再在所难免。<br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " /><br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " />同样的情形还会发生在以下这些种情况中：<br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " /><br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " /><span style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">1）&nbsp;</span>应用程序直接访问类的公有变量，而该公有变量在新DLL中定义的位置发生了变化；<br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " /><span style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">2）&nbsp;</span>应用程序调用类的一个虚函数，而新的类中，该虚函数的前面又增加了一个虚函数；<br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " /><span style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">3）&nbsp;</span>新类的后面增加了成员变量，并且新类的成员函数将访问、修改这些变量；<br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " /><span style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">4）&nbsp;</span>修改了新类的基类，基类的大小发生了变化；<br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " /><br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " />等等，总言而之，一不小心，你的程序就会掉进地狱。通过对这些引起出错的情况进行分析，会<a class="qs_highlight1" id="hl_3" href="http://clk.qunsee.com/click/click.php?cpid=12&amp;ads_id=230&amp;pid=99000630&amp;cid=634&amp;url=http%3A//www.chanet.com.cn/click.cgi%3Fa%3D59068%26d%3D21648%26u%3D%26e%3D&amp;k=%u53D1%u73B0&amp;s=http%3A//www.diybl.com/course/3_program/c++/cppsl/200819/96118_2.html&amp;rn=503704&amp;v=1&amp;ref=http%3A//www.diybl.com/course/3_program/c++/cppsl/200819/96118.html&amp;province=%u5E7F%u4E1C&amp;city=%u5E7F%u5DDE" target="_blank" style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font-size: 1em; ">发现</a>其实只有三点变化会引起出错，因为这三点是使用这个DLL的应用程序在编译时就需要确定的内容，它们分别是：<br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " /><span style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">1）&nbsp;</span>类的大小；<br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " /><span style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">2）&nbsp;</span>类成员的偏移地址；<br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " /><span style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">3）&nbsp;</span>虚函数的顺序。<br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " /><br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " />要想做一个可升级的DLL，必需避免以上三个问题。所以以下三点用来使DLL远离地狱。<br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " /><br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " />1，不直接生成类的实例。对于类的大小，当我们定义一个类的实例，或使用new语句生成一个实例时，内存的大小是在编译时决定的。要使应用程序不依赖于类的大小，只有一个办法：应用程序不生成类的实例，使用DLL中的函数来生成。把导出类的构造函数定义为私有的(privated)，在导出类中提供静态(static)成员函数(如NewInstance())用来生成类的实例。因为NewInstance()函数在新的DLL中会被重新编译，所以总能返回大小正确的实例内存。<br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " /><br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " />2，不直接访问成员变量。应用程序直接访问类的成员变量时会用到该变量的偏移地址。所以避免偏移地址依赖的办法就是不要直接访问成员变量。把所有的成员变量的访问控制都定义为保护型(protected)以上的级别，并为需要访问的成员变量定义Get或Set方法。Get或Set方法在编译新DLL时会被重新编译，所以总能访问到正确的变量位置。<br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " /><br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " />3，忘了虚函数吧，就算有也不要让应用程序直接访问它。因为类的构造函数已经是私有(privated)的了，所以应用程序也不会去继承这个类，也不会实现自己的多态。如果导出类的父类中有虚函数，或设计需要（如类工场之类的框架），一定要把这些函数声明为保护的(protected)以上的级别，并为应用程序重新设计调用该虑函数的成员函数。这一点也类似于对成员变量的处理。<br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " /><br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " />如果导出的类能遵循以上三点，那么以后对DLL的升级将可以认为是安全的。<br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " /><br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " />如果对一个已经存在的导出类的DLL进行维护，同样也要注意：不要改动所有的成员变量，包括导出类的父类，无论定义的顺序还是数量；不要动所有的虚函数，无论顺序还是数量。<br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " /><br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " />总结起来，其实是一句话：导出类的DLL不要导出除了函数以外的任何内容。听起来是不是有点可笑呢！<br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " /><br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " />事实上，建议你在发布导出类的DLL的时候，重新定义一个类的声明，这个声明可以不管原来的类里的成员变量之类的，只把接口函数列在类的声明里，如下面的例子：<br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " />class ClassInterface<br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " />{<br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " /><span style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; privated:</span><br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " /><span style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ClassInterface();</span><br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " /><span style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public:</span><br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " /><span style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; static ClassInterface * NewInstance();</span><br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " /><span style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int GetXXX();</span><br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " /><span style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; void SetXXX();</span><br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " /><span style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; void Function();</span><br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " />};<br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " /><br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " />使用该DLL的应用程序用上面的定义作为ClassInterface的头文件，便不会有任何可能导致的安全问题。<br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " /><br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " />DLL地狱问是归根结底是因为DLL当初是作为函数级共享库设计的，并不能真正提供一个类所必需的信息。类层上的程序复用只有Java和C#生成的类文件才能做到。&nbsp;<br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " /></span><br /></a></div><img src ="http://www.cppblog.com/lauer3912/aggbug/152912.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/lauer3912/" target="_blank">RTY</a> 2011-08-10 07:23 <a href="http://www.cppblog.com/lauer3912/archive/2011/08/10/152912.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>用OllDbg中断在dll的入口</title><link>http://www.cppblog.com/lauer3912/archive/2011/08/10/152911.html</link><dc:creator>RTY</dc:creator><author>RTY</author><pubDate>Tue, 09 Aug 2011 23:11:00 GMT</pubDate><guid>http://www.cppblog.com/lauer3912/archive/2011/08/10/152911.html</guid><wfw:comment>http://www.cppblog.com/lauer3912/comments/152911.html</wfw:comment><comments>http://www.cppblog.com/lauer3912/archive/2011/08/10/152911.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/lauer3912/comments/commentRss/152911.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/lauer3912/services/trackbacks/152911.html</trackback:ping><description><![CDATA[<span class="Apple-style-span" style="font-family: Simsun; font-size: 12px; line-height: normal; background-color: #ffffff; ">用OllDbg中断在dll的入口<br /><br /><br /></span><div><a href="http://www.pediy.com/bbshtml/bbs7/pediy7-613.htm">http://www.pediy.com/bbshtml/bbs7/pediy7-613.htm<br /><br /><br /><span class="Apple-style-span" style="color: #000000; font-family: Simsun; line-height: normal; -webkit-text-decorations-in-effect: none; background-color: #ffffff; font-size: medium; "><p><font color="blue"><span class="pediy" style="font-size: 9pt; ">标 题:</span></font><span class="pediy" style="font-size: 9pt; "><span class="pediy" style="font-size: 9pt; "><span class="pediy" style="font-size: 9pt; ">&nbsp;Diy OllyDbg's Loaddll.exe<br /><font color="blue">发帖人:</font>jingulong<br /><font color="blue">时 间:&nbsp;</font><font color="#666686">2005-08-13 13:02&nbsp;</font><br /><font color="blue">原文链接:</font><font color="#999999"><a href="http://bbs.pediy.com/showthread.php?threadid=16140" style="color: #000099; text-decoration: none; "><font color="#666686">http://bbs.pediy.com/showthread.php?threadid=16140</font></a></font>&nbsp;<br /><font color="blue">详细信息:</font>&nbsp;</span></span></span><br /></p><blockquote><p class="pediy" style="font-size: 9pt; ">目的：用OllDbg中断在dll的入口<br />程序下载：http://bbs.pediy.com/showthread.php?s=&amp;threadid=16082&nbsp;<br /><br />一、编写plugin&nbsp;:<br />1.&nbsp;&nbsp;DllEntryPoint如图：<br /><img src="http://www.pediy.com/bbshtml/bbs7/pediy7-613/snap000.jpg" border="0" alt="" width="432" height="232" />&nbsp;<br />2．ODBG_Plugininit如图：新启一个线程，由此线程的函数WinMain创建一个（隐藏）窗口。<br /><img src="http://www.pediy.com/bbshtml/bbs7/pediy7-613/snap0001.jpg" border="0" alt="" width="497" height="145" />&nbsp;<br />3．窗口回调函数如图：<br /><img src="http://www.pediy.com/bbshtml/bbs7/pediy7-613/snap0002.jpg" border="0" alt="" width="454" height="175" />&nbsp;<br />至此，plugin设计完成，它所起的作用是：<br />1．&nbsp;&nbsp;当得到WM_USER消息时返回dll入口地址（在MyLdrpCallInitRoutine中）<br />2．&nbsp;&nbsp;当得到WM_USER＋1消息时在wParam指示的地址（就是你调试点dll入口点）设置临时断点（Tempbreakpoint）。<br /><br />二、&nbsp;&nbsp;在dll的加载进程中与plugin通讯。<br />&nbsp;&nbsp;&nbsp;&nbsp;为此，可以写一个加载程序（就好像DLL_Loader），我这里选择diy&nbsp;llyDbg配套的loaddll.exe，因为只有它可与OD&#8220;无缝对接&#8221;。用LordPE打开程序看看结构，当看到它的ExportTable时，感觉实在妙！下面是其截图：<br /><img src="http://www.pediy.com/bbshtml/bbs7/pediy7-613/snap003.jpg" border="0" alt="" width="331" height="123" />&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;每个导出函数名称叫人看了都如此受用，特别是PatchArea！Oleh&nbsp;Yuschuk为我们考虑得实在周到。Thanks<br />Diy&nbsp;过程：<br />1．&nbsp;&nbsp;把ImportTable中的GetCommandLineA改成GetProcAddress<br />2．&nbsp;&nbsp;Patch&nbsp;<br /><img src="http://www.pediy.com/bbshtml/bbs7/pediy7-613/snap004.jpg" border="0" alt="" width="292" height="10" />&nbsp;<br />&nbsp;&nbsp;&nbsp;为：<br /><img src="http://www.pediy.com/bbshtml/bbs7/pediy7-613/snap0006.jpg" border="0" alt="" width="199" height="11" />&nbsp;<br />并在Patcharea（410298）处键入：<br /><img src="http://www.pediy.com/bbshtml/bbs7/pediy7-613/snap008.jpg" border="0" alt="" width="535" height="71" />&nbsp;<br />以完成原语句的功能。这里程序中原来没有的字符串（如&#8220;GetCommandLineA&#8221;）等在data区或rsrc区段空白处录入。<br />3．Patch<br /><img src="http://www.pediy.com/bbshtml/bbs7/pediy7-613/snap005.jpg_990.jpg" border="0" alt="" width="280" height="10" />&nbsp;<br />为&nbsp;call&nbsp;&nbsp;4102B5，并在4102B5开始写入如下代码：<br /><img src="http://www.pediy.com/bbshtml/bbs7/pediy7-613/snap009.jpg" border="0" alt="" width="565" height="369" />&nbsp;<br /><img src="http://www.pediy.com/bbshtml/bbs7/pediy7-613/snap010.jpg" border="0" alt="" width="655" height="424" />&nbsp;<br /><img src="http://www.pediy.com/bbshtml/bbs7/pediy7-613/snap011.jpg" border="0" alt="" width="594" height="227" />&nbsp;<br />以上代码完成的主要任务是hook&nbsp;dll&nbsp;entrypoint，当程序查到入口处是调试点dll&nbsp;oep&nbsp;时通知plugin设置断点，使OllyDbg中断在那里，这样我们可以少飞许多手脚。</p></blockquote></span><br /></a></div><img src ="http://www.cppblog.com/lauer3912/aggbug/152911.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/lauer3912/" target="_blank">RTY</a> 2011-08-10 07:11 <a href="http://www.cppblog.com/lauer3912/archive/2011/08/10/152911.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>dll中非导出函数的调用</title><link>http://www.cppblog.com/lauer3912/archive/2011/08/10/152910.html</link><dc:creator>RTY</dc:creator><author>RTY</author><pubDate>Tue, 09 Aug 2011 23:08:00 GMT</pubDate><guid>http://www.cppblog.com/lauer3912/archive/2011/08/10/152910.html</guid><wfw:comment>http://www.cppblog.com/lauer3912/comments/152910.html</wfw:comment><comments>http://www.cppblog.com/lauer3912/archive/2011/08/10/152910.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/lauer3912/comments/commentRss/152910.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/lauer3912/services/trackbacks/152910.html</trackback:ping><description><![CDATA[<div><a href="http://hi.baidu.com/51634780/blog/item/6e99de041d682689e850cd2a.html">http://hi.baidu.com/51634780/blog/item/6e99de041d682689e850cd2a.html<br /><span class="Apple-style-span" style="color: #555b6e; font-family: Arial; font-size: 12px; line-height: 18px; -webkit-text-decorations-in-effect: none; background-color: #ffffff; "><table style="table-layout: fixed; width: 898px; "><tbody><tr><td style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 12px; line-height: 18px; "><div id="blog_text" class="cnt" style="font-family: Arial; word-wrap: break-word; word-break: normal; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 12px; line-height: 18px; overflow-x: hidden; overflow-y: hidden; position: relative !important; "><p style="line-height: normal; ">dll中非导出函数的调用<br style="line-height: normal; " />这几天在学习pe，对输出表特别兴趣。程序对导出函数调用，最终是对导出<br style="line-height: normal; " />函数入口地址的调用，非导出函数的入口地址不在导出表里，所以其他程序</p><p style="line-height: normal; ">无法</p><p style="line-height: normal; ">调用非导出函数。<br style="line-height: normal; " />本人刚开始的想法是在内存里修改dll的导出表，使非导出函数变成导出函</p><p style="line-height: normal; ">数，</p><p style="line-height: normal; ">供自己的程序调用。后来想到可不可以直接调用非导出函数的入口地址呢？</p><p style="line-height: normal; ">感觉</p><p style="line-height: normal; ">应该可以，有了这个想法后就马上开始动手试验。</p><p style="line-height: normal; ">自己写了个简单的dll，其中有2个导出函数a1,b1，1个内部函数c1<br style="line-height: normal; " />先用call的方法调用导出函数：a1<br style="line-height: normal; " />invoke LoadLibrary,CTEXT('testdll.dll')<br style="line-height: normal; " />mov @var1,eax&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ;模块句柄（也是模块的基址）存入@var1&nbsp;<br style="line-height: normal; " />invoke GetProcAddress,@var1,CTEXT('a1')<br style="line-height: normal; " />mov @lpProc,eax ;导出函数的入口地址存入@lpProc<br style="line-height: normal; " />push 5&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ;函数参数3<br style="line-height: normal; " />push 9&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ;函数参数2<br style="line-height: normal; " />push hWnd&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ;函数参数1<br style="line-height: normal; " />call @lpProc&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ;函数调用<br style="line-height: normal; " />一切正常。</p><p style="line-height: normal; ">再调用非导出函数试试，在调用非导出函数c1前，必须找到c1的相对虚拟<br style="line-height: normal; " />地址，<br style="line-height: normal; " />先用程序装入dll<br style="line-height: normal; " />invoke LoadLibrary,CTEXT('testdll.dll')<br style="line-height: normal; " />mov @var1,eax&nbsp;&nbsp;&nbsp; ;模块句柄，也是模块的基址<br style="line-height: normal; " />然后运行程序，用OD调试，找到c1的入口地址：1000100C<br style="line-height: normal; " />1000100C&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 55&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; push ebp<br style="line-height: normal; " />1000100D&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 8BEC&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mov ebp,esp<br style="line-height: normal; " />1000100F&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 8B45 08&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mov eax,dword ptr ss:[ebp+8]<br style="line-height: normal; " />10001012&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0345 0C&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; add eax,dword ptr ss:[ebp+C]<br style="line-height: normal; " />10001015&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; C9&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; leave<br style="line-height: normal; " />10001016&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; C2 0800&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; retn 8</p><p style="line-height: normal; ">通过 @var1获得模块的基址是10000000<br style="line-height: normal; " />那末c1的相对虚拟地址就是：1000100C－10000000＝100c<br style="line-height: normal; " />做好了这一步后，就可以在自己的程序里调用非导出函数了。<br style="line-height: normal; " />调用非导出函数：<br style="line-height: normal; " />invoke LoadLibrary,CTEXT('testdll.dll')<br style="line-height: normal; " />mov @var1,eax&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ;模块句柄（也是模块的基址）存入@var1<br style="line-height: normal; " />add @var1,100ch&nbsp;&nbsp;&nbsp; ;得到c1的入口地址<br style="line-height: normal; " />push 5&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ;函数参数2<br style="line-height: normal; " />push 9&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ;函数参数1<br style="line-height: normal; " />call @var1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ;函数调用<br style="line-height: normal; " />得到了想要的结果，一切ok!</p><p style="line-height: normal; ">用这种方法可以调用别人dll的非导出函数。</p></div></td></tr></tbody></table></span><br /></a></div><img src ="http://www.cppblog.com/lauer3912/aggbug/152910.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/lauer3912/" target="_blank">RTY</a> 2011-08-10 07:08 <a href="http://www.cppblog.com/lauer3912/archive/2011/08/10/152910.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>SciTE 简单的编程语言编辑器</title><link>http://www.cppblog.com/lauer3912/archive/2011/08/10/152908.html</link><dc:creator>RTY</dc:creator><author>RTY</author><pubDate>Tue, 09 Aug 2011 22:41:00 GMT</pubDate><guid>http://www.cppblog.com/lauer3912/archive/2011/08/10/152908.html</guid><wfw:comment>http://www.cppblog.com/lauer3912/comments/152908.html</wfw:comment><comments>http://www.cppblog.com/lauer3912/archive/2011/08/10/152908.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/lauer3912/comments/commentRss/152908.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/lauer3912/services/trackbacks/152908.html</trackback:ping><description><![CDATA[网站地址：<a href="http://www.scintilla.org/SciTE.html">http://www.scintilla.org/SciTE.html<br /><br /><span class="Apple-style-span" style="color: #333333; font-family: SimSun, Arial, Helvetica, sans-serif; line-height: 25px; -webkit-text-decorations-in-effect: none; background-color: #ffffff; ">SciTE（Scintilla Text Editor）是一个体积小巧的文本编辑器。虽然它没有像<a title="MS Office" class="link_red" href="http://www.hudong.com/wiki/scite" target="" style="color: #de0000; text-decoration: none; ">MS Office</a>和<a title="OpenOffice" class="innerlink" href="http://www.hudong.com/wiki/OpenOffice" target="_blank" style="color: #0268cd; text-decoration: none; ">OpenOffice</a>那样功能强大可比且体积大的怕人的办公软件。但是它对文本以及源各种源文件却拥有强大的编辑能力，甚至可把它当作<a title="Dreamweaver" class="innerlink" href="http://www.hudong.com/wiki/Dreamweaver" style="color: #0268cd; text-decoration: none; ">Dreamweaver</a>，因为它不仅有其他文本编辑器的语法高亮显示功能，它支持40 种文件类型的语法高亮显示。光这点已经非常吸引人们的眼球，而且还可以达到自动补充完成以及输出窗口（对于编程的人来说很方便的）。这样也能省很多事情，尽管它的界面是简洁甚至说简陋的，但这并不妨碍它做为一个开发环境来使用。因为它默认情况下很多功能还没有展现，需要我们手动设置。 SciTE的标签窗口布局使你可以同时打开多个文件，在这件文件之间拷贝，执行搜索替换的操作。语法高亮显示的功能有助于编辑web页面和源代码。其它的像<a title="PDF" class="innerlink" href="http://www.hudong.com/wiki/PDF" style="color: #0268cd; text-decoration: none; ">PDF</a>导出，word completion，多级的撤消，代码树，全屏和分屏功能也是很有用的。在可设置性上，SciTE是一个相当复杂的软件，比较适合技术人员使用。<br /><div class="content_h2" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><h2 class="mar-t10" style="margin-top: 25px; margin-right: 0px; margin-bottom: 5px; margin-left: 0px; padding-top: 5px; padding-right: 10px; padding-bottom: 3px; padding-left: 10px; font-size: 16px; line-height: 24px; font-weight: bold; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #fafafa; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #f0f0f0; border-right-color: #f0f0f0; border-bottom-color: #f0f0f0; border-left-color: #f0f0f0; display: block; clear: both; background-position: initial initial; background-repeat: initial initial; "><a id="bjbd" href="http://www.hudong.com/wiki/scite#" secid="1" target="_self" style="color: #0268cd; text-decoration: none; background-image: url(http://www.huimg.cn/entry/images/entrybj110721.gif); background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; float: right; height: 16px; display: inline-block; margin-top: 5px; width: 60px; background-position: -132px -173px; background-repeat: no-repeat no-repeat; "></a><a id="tiwen" class="quizhref" href="http://www.hudong.com/wiki/scite" style="color: #0268cd; text-decoration: none; background-image: url(http://www.huimg.cn/entry/images/entrybj110721.gif); background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; float: right; height: 16px; display: inline-block; margin-top: 5px; width: 33px; background-position: -100px -173px; background-repeat: no-repeat no-repeat; "></a><a name="1" style="color: #0268cd; text-decoration: none; width: 20px; height: 20px; text-indent: 20px; background-image: url(http://www.cppblog.com/CuteSoft_Client/CuteEditor/Load.ashx?type=image&amp;file=anchor.gif); background-repeat: no-repeat no-repeat; "></a>scite - 软件安装</h2></div>大家首先到它的官网的<a target="_blank" href="http://scintilla.sourceforge.net/SciTEDownload.html" style="color: #0268cd; text-decoration: none; ">下载页面</a>下载软件或者根据下面的链接下载。&nbsp;<br />如果你是<a title="Windows" class="innerlink" href="http://www.hudong.com/wiki/Windows" style="color: #0268cd; text-decoration: none; ">Windows</a>系统的用户，你可以选择安装版本和免安装绿色版<br />推荐使用免安装绿色版。&nbsp;<br />如果你是<a title="Linux" class="innerlink" href="http://www.hudong.com/wiki/Linux" style="color: #0268cd; text-decoration: none; ">Linux</a>系统的用户，你需要&nbsp;<a title="GTK" class="link_red" href="http://www.hudong.com/wiki/scite" target="" style="color: #de0000; text-decoration: none; ">GTK</a>&nbsp;2.8 以上版本的支持。&nbsp;<br />如果你使用的<a title="Fedora " class="innerlink" href="http://www.hudong.com/wiki/Fedora%20" style="color: #0268cd; text-decoration: none; ">Fedora&nbsp;</a>Core 5系统，点<a target="_blank" href="http://prdownloads.sourceforge.net/scintilla/gscite175.tgz?download" style="color: #0268cd; text-decoration: none; ">这里</a>下载。&nbsp;<br />如果你使用的<a title="Debian" class="innerlink" href="http://www.hudong.com/wiki/Debian" style="color: #0268cd; text-decoration: none; ">Debian</a>/<a title="Ubuntu" class="innerlink" href="http://www.hudong.com/wiki/Ubuntu" style="color: #0268cd; text-decoration: none; ">Ubuntu</a>系统，点<a target="_blank" href="http://packages.debian.org/etch/scite" style="color: #0268cd; text-decoration: none; ">这里</a>下载。&nbsp;<br />最后还有RPMs，点<a target="_blank" href="http://sourceforge.net/project/showfiles.php?group_id=2439" style="color: #0268cd; text-decoration: none; ">这里</a>下载。&nbsp;<br />如果你想基于此软件再开发用户，请看下面的下载点：&nbsp;<br />Windows系统 SciTE 的源代码：<a target="_blank" href="http://prdownloads.sourceforge.net/scintilla/scite175.zip?download" style="color: #0268cd; text-decoration: none; ">下载&nbsp;</a><br />Linux系统 SciTE 的源代码：<a target="_blank" href="http://prdownloads.sourceforge.net/scintilla/scite175.tgz?download" style="color: #0268cd; text-decoration: none; ">下载</a>&nbsp;<br /><div class="content_h2" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><h2 class="mar-t10" style="margin-top: 25px; margin-right: 0px; margin-bottom: 5px; margin-left: 0px; padding-top: 5px; padding-right: 10px; padding-bottom: 3px; padding-left: 10px; font-size: 16px; line-height: 24px; font-weight: bold; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #fafafa; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #f0f0f0; border-right-color: #f0f0f0; border-bottom-color: #f0f0f0; border-left-color: #f0f0f0; display: block; clear: both; background-position: initial initial; background-repeat: initial initial; "><a id="bjbd" href="http://www.hudong.com/wiki/scite#" secid="3" target="_self" style="color: #0268cd; text-decoration: none; background-image: url(http://www.huimg.cn/entry/images/entrybj110721.gif); background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; float: right; height: 16px; display: inline-block; margin-top: 5px; width: 60px; background-position: -132px -173px; background-repeat: no-repeat no-repeat; "></a><a id="tiwen" class="quizhref" href="http://www.hudong.com/wiki/scite" style="color: #0268cd; text-decoration: none; background-image: url(http://www.huimg.cn/entry/images/entrybj110721.gif); background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; float: right; height: 16px; display: inline-block; margin-top: 5px; width: 33px; background-position: -100px -173px; background-repeat: no-repeat no-repeat; "></a><a name="3" style="color: #0268cd; text-decoration: none; width: 20px; height: 20px; text-indent: 20px; background-image: url(http://www.cppblog.com/CuteSoft_Client/CuteEditor/Load.ashx?type=image&amp;file=anchor.gif); background-repeat: no-repeat no-repeat; "></a>scite - 配置文件</h2></div><div class="img img_r" style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 20px; padding-top: 3px; padding-right: 3px; padding-bottom: 3px; padding-left: 3px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #f7f7f7; color: #666666; text-align: center; position: relative; z-index: 0; float: right; clear: right; "><a title="点击查看原图" href="http://tupian.hudong.com/a0_02_54_01300000373433124020548042151_jpg.html?prd=zhengwenye_left_neirong_tupian" target="_blank" style="color: #0268cd; text-decoration: none; "><img title="（图）设置菜单" alt="（图）设置菜单" src="http://a0.att.hudong.com/02/54/01300000373433124020548042151_s.jpg" style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; " /></a><a target="_blank" class="magnify" href="http://tupian.hudong.com/a0_02_54_01300000373433124020548042151_jpg.html?prd=zhengwenye_left_neirong_tupian" name="enlargegif" id="enlargegif" title="（图）设置菜单" style="color: #0268cd; text-decoration: none; background-image: url(http://www.huimg.cn/entry/images/enlarge110301.png); background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; position: absolute; top: 5px; right: 5px; width: 92px; height: 17px; display: block; z-index: 2; background-position: initial initial; background-repeat: no-repeat no-repeat; "></a><strong style="font-size: 12px; display: block; overflow-x: hidden; overflow-y: hidden; line-height: 18px; padding-top: 10px; clear: both; width: 300px; ">scite</strong></div>对于新手来说，如果没有正确的配置，它就不是那么好使，比如选择中文时候出现乱码，缩进也不是你想象中的样子。&nbsp;<br />由于配置参数不是采用图形界面，而且出看配置代码会比较混乱，所以大家要睁大眼睛好好看咯～ 程序中几个比较重要的配置文件（都在 SctTE 目录下面）：&nbsp;<br />SciTEGlobal.properties 全局配置文件，一般不去改动。&nbsp;<br />SciTEUser.properties 用户配置文件。对全局配置要改动的地方，都写在这个文件里。&nbsp;<br />SciTE.properties 本地配置文件，也就是针对当前目录的配置文件，会覆盖全局和用户配置文件。&nbsp;<br />html.properties 特定文件类型的配置文件，比如 html.properties就是专门针对网页文件的配置文件。&nbsp;<br />SciTEGlobal.properties 是程序的核心配置文件，所有的配置信息都在这个文件里面。一般情况下我们是不要改动这个文件。为什么不能在这个里面修改呢，其实也不是不可以，主要是因为yidabu网站的测试，在重装SciTE时，全局配置文件会被覆盖，那么不再这文件修改那在哪修改呢？ 这就用到了程序为我们提供的用户配置文件&nbsp;<br />SciTEUser.properties 。你可以对照SciTE文本编辑器的帮助手册,逐条查看对照&nbsp;<br />SciTEGlobal.properties ，把要修改的属性记下来，写到sciteuser.properties中，因为在用户配置文件的配置优先于全局配置文件。而且在在重装SciTE之后用户配置文件则不会覆盖掉的。<br /><div class="content_h2" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><h2 class="mar-t10" style="margin-top: 25px; margin-right: 0px; margin-bottom: 5px; margin-left: 0px; padding-top: 5px; padding-right: 10px; padding-bottom: 3px; padding-left: 10px; font-size: 16px; line-height: 24px; font-weight: bold; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #fafafa; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #f0f0f0; border-right-color: #f0f0f0; border-bottom-color: #f0f0f0; border-left-color: #f0f0f0; display: block; clear: both; background-position: initial initial; background-repeat: initial initial; "><a id="bjbd" href="http://www.hudong.com/wiki/scite#" secid="5" target="_self" style="color: #0268cd; text-decoration: none; background-image: url(http://www.huimg.cn/entry/images/entrybj110721.gif); background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; float: right; height: 16px; display: inline-block; margin-top: 5px; width: 60px; background-position: -132px -173px; background-repeat: no-repeat no-repeat; "></a><a id="tiwen" class="quizhref" href="http://www.hudong.com/wiki/scite" style="color: #0268cd; text-decoration: none; background-image: url(http://www.huimg.cn/entry/images/entrybj110721.gif); background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; float: right; height: 16px; display: inline-block; margin-top: 5px; width: 33px; background-position: -100px -173px; background-repeat: no-repeat no-repeat; "></a><a name="5" style="color: #0268cd; text-decoration: none; width: 20px; height: 20px; text-indent: 20px; background-image: url(http://www.cppblog.com/CuteSoft_Client/CuteEditor/Load.ashx?type=image&amp;file=anchor.gif); background-repeat: no-repeat no-repeat; "></a>scite - 常用快捷键</h2></div>Ctrl Keypad 放大文字&nbsp;<br />Ctrl Keypad- 缩小文字&nbsp;<br />Ctrl Keypad/ 还原文字大小到默认值&nbsp;<br />Ctrl Tab 在最近打开的两个文件间循环&nbsp;<br />Tab 缩进一个tab. 在用scite写笔记时, 每段一般按Tab缩进, 而不是按空格。 从网上复制一篇文章到scite文本编辑器，全选，按一下tab, 首行标题顶格，二级标题顶部，就完成所用的文档格式化。&nbsp;<br />Shift Tab 取消一个tab的缩进&nbsp;<br />Ctrl BackSpace 从光标位置删除到一个词的开始处, 中文由于无法断词, 如果用的是中文标点，就变成一直删除到行首了。如果用的英文标点，就删除到上一个英文标点处&nbsp;<br />Ctrl Delete 从光标位置删除到一个词的结束处&nbsp;<br />Ctrl Shift BackSpace 从光标位置删除到行首&nbsp;<br />Ctrl Shift Delete 从光标位置删除到行尾&nbsp;<br />Ctrl Home 光标移动到文档开始处&nbsp;<br />Ctrl Shift Home 从光标处开始选择文本一直到行首&nbsp;<br />Alt Home 到显示的行首。按End时光标只是移到行首第一个字的前面&nbsp;<br />Alt Shift Home 扩展选择到行首 Ctrl End 光标移动到文档结束处&nbsp;<br />Ctrl Shift End 从光标处选择文本一直到文档结束处&nbsp;<br />Alt End 光标移动到行尾&nbsp;<br />Alt Shift End 扩展选择到行尾&nbsp;<br />Ctrl Keypad* 展开或收缩光标所在的折叠区域。这个很好记忆，这样理解：*号很象圆形的折叠符号&nbsp;<br />Ctrl F2 创建或删除一条书签. 在写很长的文档或代码时, 加一个书签就很方便地可以跳来跳去 F2 跳到下一条书签&nbsp;<br />Alt F2 扩展选择到下一条书签. 有什么用呢, 创建两条书签, 光标移动到要选中的开始处, 按快捷键, 两条书签之间的内容就选中了&nbsp;<br />Ctrl F3 **向文档结束方向查找选中字符 这个功能很好用, 要在文档内查找, 你不需象通常的那样要按Ctrl F, 你只需要把光标放到词内部或前后, 按Ctrl F3就自动在文档内查找 如果要在文档内查找中文, 由于中文无法断词, 要先手动选择要查询的词, 再按快捷键. 说点题外话,既不媚外, 也不盲目地拔高传统文化. 汉字有汉字的优点, 英文有英文的优点, 若一定要分出高下来, 是很难办到的事情. 曾看到一些对传统文化(如易经)很有偏好的人非常推崇中文, 认为是最优秀的文字, 是英文远不能比的. 但在这里, 中文断词的问题怎么解决, 英文可以简单地以空格来断词, 中文怎么办? 至少在这个文内查找, 英文就比中文方便多了.&nbsp;<br />Ctrl Shift F3 **向文档开始方向查找选择字符 英文是&nbsp;<br />Find selection backwards, 字面翻译是向后查找选中文字, 这个&#8221;向后&#8221;是比较容易引起歧义的, 译为&#8221;文档开始方向&#8221;就不存在这个问题&nbsp;<br />Ctrl Up Scroll up Ctrl Down Scroll down&nbsp;<br />Ctrl L **剪切光标所在行 这个很有用. 如果用记事本来写日记或文档, 剪切行就麻烦多了. 用scite来写 读书笔记什么的, 即使不作任何优化配置, 利用scite的快捷键也提高一些常用操作的效率也不错 提示: 快捷键中L代表Line 这样理解了以后, 就根本不用死记, 自然记住了这个快捷键的用法. 一个聪明的人性化的程序, 所有快捷键都是可以理解而不需要记忆的, 从这里也可以看出程序作者是否别具匠心<br />Ctrl Shift T **复制光标所在行. 应用时可以右手按Ctrl Shift, 左手按T&nbsp;<br />Ctrl Shift L **删除光标所在行 Ctrl T **和上一行互换位置 在 SciTE4AutoIt3中, 用Ctrl T调用Tidy整理源代码. 为避免快捷键撞车, 打开 au3.properties, 找到 JdeB&#8217;s Tidy formatting program for Autoit3 条, 把快捷键改成Ctrl Shift Alt T, 或者修改 Scite用户配置文件sciTEUser.properties 提示: 在这里T表示transpose, 即互换位置. **Ctrl D 复制高亮选中字符. 如果没有高亮选择字符, 则复制光标所在行 这是一个使用频率比较高的快捷键, 在用 SciTE4AutoIt3写代码时, 要临时改写调试一句代码, 按Ctrl D复制当前行, 按小键盘的-注释掉当前行. 调试好后要用回原来代码, 只要Ctrl Shift L删除行, 再按小键盘的-取消注释符号即可, 根本用不到手动选择复制之类. 提示: 在这里D表示duplicate, 使用快捷键的另一个乐处就是记住了字母所代表的单词, 对于程序来说, 多数编程资料是英文形式的, 因此务必知道各种缩写的原型, 一则更容易理解记忆, 二则从某种意义上来说, 英语从某种意义上是程序设计的基础.&nbsp;<br />Ctrl [ 光标移动到上一段, 加Shift的话是扩展选择<br />Ctrl ] 光标移动到下一段, 加Shift的话是扩展选择&nbsp;<br />Ctrl Left 光标跳到上一词. 加Shift的话是扩展选择&nbsp;<br />Ctrl Right 光标跳到下一词. 加Shift的话是扩展选择&nbsp;<br />Ctrl / 光标跳到上一词部分. 加Shift的话是扩展选择&nbsp;<br />Ctrl \ 光标跳到下一词部分. 加Shift的话是扩展选择</span><br /></a><img src ="http://www.cppblog.com/lauer3912/aggbug/152908.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/lauer3912/" target="_blank">RTY</a> 2011-08-10 06:41 <a href="http://www.cppblog.com/lauer3912/archive/2011/08/10/152908.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>API太多(C++版) -- GetTempPath与 GetTempFileName 、GetWindowsDirectory与GetSystemDirectory讲解</title><link>http://www.cppblog.com/lauer3912/archive/2011/08/09/152837.html</link><dc:creator>RTY</dc:creator><author>RTY</author><pubDate>Mon, 08 Aug 2011 23:32:00 GMT</pubDate><guid>http://www.cppblog.com/lauer3912/archive/2011/08/09/152837.html</guid><wfw:comment>http://www.cppblog.com/lauer3912/comments/152837.html</wfw:comment><comments>http://www.cppblog.com/lauer3912/archive/2011/08/09/152837.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/lauer3912/comments/commentRss/152837.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/lauer3912/services/trackbacks/152837.html</trackback:ping><description><![CDATA[<div><a href="http://hi.baidu.com/xx375/blog/item/52f5ccd6ac7671dd51da4b52.html">http://hi.baidu.com/xx375/blog/item/52f5ccd6ac7671dd51da4b52.html<br /><br /><span class="Apple-style-span" style="color: #6f6f6f; font-family: Arial; font-size: 12px; line-height: 18px; -webkit-text-decorations-in-effect: none; background-color: #000000; "><table style="table-layout: fixed; width: 900px; "><tbody><tr><td style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 12px; line-height: 18px; "><div id="blog_text" class="cnt" style="font-family: Arial; word-wrap: break-word; word-break: normal; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 12px; line-height: 18px; overflow-x: hidden; overflow-y: hidden; position: relative !important; "><p style="line-height: normal; "><strong style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; color: #ff0000; font-size: 14px; ">GetTempPath</span></strong><strong style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; color: #ff0000; font-size: 14px; ">函数</span></strong></p><p style="line-height: normal; "><strong style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">功能</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">&nbsp;</span></strong><span style="line-height: normal; font-family: Arial, 宋体; letter-spacing: 0.4pt; font-size: 14px; ">获取为临时文件指定的路径</span><strong style="line-height: normal; "></strong></p><p style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">API</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">中函数原形为</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">: DWORD GetTempPath(DWORD nBufferLength, LPTSTR lpBuffer)</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">　　</span></p><p style="line-height: normal; "><span style="line-height: normal; font-family: 宋体; "><strong style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">参数：</span></strong></span><strong style="line-height: normal; "></strong><strong style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">　　</span></strong></p><p style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">StrLen = GetTempPath(NAME_LEN, OutPath)</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">　　</span></p><p style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">其中：</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">　　</span></p><p style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">OutPath</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">：</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">是输出临时文件夹名称的变量，它的初始值为</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">NAME_LEN</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">个空格</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">,</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">函数调用后，就不是空格了，它会把取得的临时文件夹名称存入此变量。</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">　　</span></p><p style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">NAME_LEN</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">：</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">是告诉函数</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">OutPath</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">变量的长度。</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">　　</span></p><p style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">StrLen</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">：是取得的临时文件夹名称的长度。</span></p><p style="line-height: normal; "><strong style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">返回值</span></strong><strong style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">　　</span></strong><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">Long</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">，装载到</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">lpBuffer</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">的字符数。如当前缓冲区的长度不够，不能容下整个路径，则返回</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">lpBuffer</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">需要的长度。</span></p><p style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 零表示失败。</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">会设置</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">GetLastError</span></p><p style="line-height: normal; "><strong style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">应用小例</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">:</span></strong></p><p style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">CHAR OutPath[MAX_PATH];</span></p><p style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">int StrLen = GetTempPath(MAX_PATH, OutPath);</span></p><p style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">printf("</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">输出临时文件夹名称</span><span style="line-height: normal; font-family: 'Times New Roman'; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">&nbsp;&nbsp;</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">= %s\n",OutPath);</span></span></p><p style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">printf("</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">临时文件夹名称的长度</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">= 0x%x\n",StrLen);</span></p><p style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">//</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">输出临时文件夹名称</span><span style="line-height: normal; font-family: 'Times New Roman'; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">&nbsp;&nbsp;</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">= C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\ (</span></span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">环境变量里有</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">)</span></p><p style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">//</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">临时文件夹名称的长度</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">= 0x23</span></p><p style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">注解</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">临时路径是由</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">TMP</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">环境变量指定的一个路径。如</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">TMP</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">不存在，则是由</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">TEMP</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">环境变量指定的路径。</span></p><p style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">如果这两个环境变量都不存在，就是当前目录</span></p><p style="line-height: normal; "><strong style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; color: #0055ff; font-size: 14px; ">如果查看当前用户的临时文件夹，可以在开始－运行里面输入</span><span style="line-height: normal; font-family: Arial, 宋体; color: #0055ff; font-size: 14px; ">%temp%,</span></strong><strong style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; color: #0055ff; font-size: 14px; ">回车即可</span><span style="line-height: normal; font-family: Arial, 宋体; color: #0055ff; font-size: 14px; ">(</span></strong><strong style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; color: #0055ff; font-size: 14px; ">一般为隐藏的</span><span style="line-height: normal; font-family: Arial, 宋体; color: #0055ff; font-size: 14px; ">)</span></strong></p><p style="line-height: normal; "><strong style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">&nbsp;</span></strong></p><p style="line-height: normal; "><strong style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; color: #ff0000; font-size: 14px; ">GetTempFileName</span></strong><strong style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; color: #ff0000; font-size: 14px; ">函数</span></strong></p><p style="line-height: normal; "><strong style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; letter-spacing: 0.4pt; font-size: 14px; ">这个函数包含了一个临时文件的名字，它可由应用程序使用</span></strong></p><p style="line-height: normal; "><span style="line-height: normal; font-family: 'Times New Roman'; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">UINT</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">&nbsp;</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">GetTempFileName(</span></span></p><p style="line-height: normal; "><span style="line-height: normal; font-family: 'Times New Roman'; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">&nbsp;&nbsp;</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">PChar</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">&nbsp;</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">lpPathName:;</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">{</span></span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">路径</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">}</span></p><p style="line-height: normal; "><span style="line-height: normal; font-family: 'Times New Roman'; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">&nbsp;&nbsp;</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">PChar</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">&nbsp;</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">lpPrefixString:;</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">&nbsp;&nbsp;&nbsp;</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">{</span></span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">前缀</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">}</span></p><p style="line-height: normal; "><span style="line-height: normal; font-family: 'Times New Roman'; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">&nbsp;&nbsp;</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">UINT</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">&nbsp;</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">uUnique:;</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">{</span></span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">指定生成文件名的数字</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">,</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">文件名将根据参数</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">2</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">、参数</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">3</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">来生成</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">}</span></p><p style="line-height: normal; "><span style="line-height: normal; font-family: 'Times New Roman'; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">&nbsp;&nbsp;</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">PChar</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">&nbsp;&nbsp;</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">&nbsp;</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">lpTempFileName: {</span></span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">文件名需要的缓冲区</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">}</span></p><p style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">) {</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">指定生成文件名的数字</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">,</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">如果参数</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">3</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">是</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">0,</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">则返回文件名长度</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">}</span></p><p style="line-height: normal; "><strong style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">应用举例</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">:</span></strong></p><p style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">CHAR OutPath[MAX_PATH];</span></p><p style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">int StrLen = GetTempPath(MAX_PATH, OutPath);</span></p><p style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">CHAR Name[100];</span></p><p style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">GetTempFileNameA(OutPath,"~xx",16,Name);</span></p><p style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">printf("</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">自定义唯一临时文件夹名称</span><span style="line-height: normal; font-family: 'Times New Roman'; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">&nbsp;&nbsp;</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">= %s\n",Name);</span></span></p><p style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">//</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">因为</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">16</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">的十六进制是</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">10,</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">文件名会是</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">: ~xx10.tmp</span></p><p style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">//Name = C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\~xx10.tmp</span></p><p style="line-height: normal; ">&nbsp;</p><span style="line-height: normal; font-family: 'Times New Roman'; "><p style="line-height: normal; "><strong style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; color: #ff0000; font-size: 14px; ">GetWindowsDirectory</span></strong><strong style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; color: #ff0000; font-size: 14px; ">函数</span></strong><strong style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; color: #ff0000; font-size: 14px; ">与</span><span style="line-height: normal; font-family: Arial, 宋体; color: #ff0000; font-size: 14px; ">GetSystemDirectory</span></strong><strong style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; color: #ff0000; font-size: 14px; ">函数用法一样</span></strong></p><p style="line-height: normal; "><strong style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; color: #0055ff; font-size: 14px; ">GetWindowsDirectory</span></strong><strong style="line-height: normal; "><span style="line-height: normal; font-family: 宋体; "><span style="line-height: normal; font-family: Arial, 宋体; color: #0055ff; font-size: 14px; ">是</span><span style="line-height: normal; font-family: Arial, 宋体; letter-spacing: 0.4pt; color: #0055ff; font-size: 14px; ">获取</span></span><span style="line-height: normal; font-family: Arial, 宋体; letter-spacing: 0.4pt; color: #0055ff; font-size: 14px; ">Windows</span></strong><strong style="line-height: normal; "><span style="line-height: normal; font-family: 宋体; letter-spacing: 0.4pt; "><span style="line-height: normal; font-family: Arial, 宋体; color: #0055ff; font-size: 14px; ">文件夹的路径。</span><span style="line-height: normal; font-family: 'Times New Roman'; "><strong style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; color: #0055ff; font-size: 14px; ">GetSystemDirectory是</span><strong style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; letter-spacing: 0.4pt; color: #0055ff; font-size: 14px; ">获取</span><span style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; color: #0055ff; font-size: 14px; ">systrm32</span><span style="line-height: normal; font-family: Arial, 宋体; color: #0055ff; font-size: 14px; ">文件夹的路径</span></span></strong></strong></span></span></strong><strong style="line-height: normal; "></strong></p><p style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">下面是讲解</span><strong style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">GetSystemDirectory</span></strong><strong style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">函数</span></strong></p><p style="line-height: normal; "><span style="line-height: normal; font-family: 'Times New Roman'; "><strong style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">GetSystemDirectory</span></strong><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">&nbsp;</span></span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">函数</span></p><p style="line-height: normal; "><strong style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; letter-spacing: 0.4pt; font-size: 14px; ">获取</span><span style="line-height: normal; font-family: Arial, 宋体; letter-spacing: 0.4pt; font-size: 14px; ">systrm32</span></strong><strong style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; letter-spacing: 0.4pt; font-size: 14px; ">文件夹的路径</span></strong><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">。系统文件夹包含了诸如动态链接库和驱动的系统文件。</span></p><p style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">该函数最初是为了兼容问题而提供的。应用程序应该在</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">Program File</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">文件夹内存储代码和常驻数据。</span></p><p style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">UINT WINAPI GetSystemDirectory(</span></p><p style="line-height: normal; "><span style="line-height: normal; font-family: 'Times New Roman'; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">__out</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">&nbsp;&nbsp;</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">LPTSTR lpBuffer,</span></span></p><p style="line-height: normal; "><span style="line-height: normal; font-family: 'Times New Roman'; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">__in</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">&nbsp;&nbsp;&nbsp;</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">UINT uSize</span></span></p><p style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">);</span></p><p style="line-height: normal; "><strong style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">参数　　</span></strong></p><p style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">lpBuffer String</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">，用于装载系统目录路径名的一个字串缓冲区。它应事先初始化成&#8220;路径&#8221;字符串的长度</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">+1</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">。</span></p><p style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 通常至少要为这个缓冲区分配</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">MAX_PATH</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">个字符的长度</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">　　</span></p><p style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">nSize Long</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">，</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">lpBuffer</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">字串的最大长度</span></p><p style="line-height: normal; "><strong style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">返回值</span></strong></p><p style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">如果函数成功，返回值是缓冲内容副本的长度，但该长度不包含结尾的</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">NULL</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">字符。如果该长度大于给定的长度，则返回值是所需的缓冲大小，且包含结尾的</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">NULL</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">字符。</span></p><p style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">如果函数失败，返回零值。</span></p><p style="line-height: normal; "><strong style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">备注</span></strong></p><p style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">应用程序不应该在系统目录内创建文件。如果用户运行在一个共享版本的</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">Windows</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">操作系统上，应用程序是不能访问系统目录的</span></p><p style="line-height: normal; "><strong style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">应用小例</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">:</span></strong></p><p style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">string str;</span></p><p style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">UINT size=GetSystemDirectory(NULL,0);</span></p><p style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">CHAR *path=new CHAR[size];</span></p><p style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">if (GetSystemDirectory(path,size) != 0)</span></p><p style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">{</span></p><p style="line-height: normal; "><span style="line-height: normal; font-family: 'Times New Roman'; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">str = path;</span></span></p><p style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">}</span></p><p style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">delete[] path;</span></p></span></div></td></tr></tbody></table><br /><div class="opt" id="blogOpt" style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 12px; line-height: 18px; margin-top: 5px; color: #888888; background-image: url(http://hiphotos.baidu.com/mubanceshi/pic/item/b254d9d50df51ff050da4b15.jpg); background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; text-indent: 12px; background-position: 0% 50%; background-repeat: no-repeat no-repeat; "><a href="http://hi.baidu.com/xx375/blog/category/xx_%D4%DA%D1%A7%CF%B0%3A%B8%F7%D6%D6api%D6%AA%CA%B6" title="查看该分类中所有文章" style="color: #949494; font-size: 12px; font-family: Verdana, Arial, Helvetica, sans-serif; text-decoration: none; ">类别：xx_在学习:各种api知识</a>&nbsp;|&nbsp;<a href="http://hi.baidu.com/xx375/blog/item/52f5ccd6ac7671dd51da4b52.html#" target="_blank" style="color: #949494; font-size: 12px; font-family: Verdana, Arial, Helvetica, sans-serif; text-decoration: none; "><img src="http://img.baidu.com/hi/apps/share/share_btn.gif" border="0" align="absbottom"  alt="" /></a>&nbsp;|&nbsp;<a title="将此文章分享到i贴吧" href="http://hi.baidu.com/xx375/blog/item/52f5ccd6ac7671dd51da4b52.html#" target="_blank" style="color: #949494; font-size: 12px; font-family: Verdana, Arial, Helvetica, sans-serif; text-decoration: none; ">分享到i贴吧</a>&nbsp;| 浏览(<span id="result">87</span>) |&nbsp;<a href="http://hi.baidu.com/xx375/blog/item/52f5ccd6ac7671dd51da4b52.html#send" style="color: #949494; font-size: 12px; font-family: Verdana, Arial, Helvetica, sans-serif; text-decoration: none; ">评论</a>&nbsp;(<span id="blogCmtCount">0</span>)<div style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 12px; line-height: 5px; height: 5px; ">&nbsp;</div><div id="in_nav" style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 12px; line-height: 18px; ">上一篇：<a href="http://hi.baidu.com/xx375/blog/item/8e1ad9f71a010677ddc47496.html" title="API太多(C++版) -- GetDriveType  GetVolumeInformation 讲解" style="color: #949494; font-size: 12px; font-family: Verdana, Arial, Helvetica, sans-serif; text-decoration: none; ">API太多(C++版) -- G</a></div></div></span><br /></a></div><img src ="http://www.cppblog.com/lauer3912/aggbug/152837.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/lauer3912/" target="_blank">RTY</a> 2011-08-09 07:32 <a href="http://www.cppblog.com/lauer3912/archive/2011/08/09/152837.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>API太多(C++版) -- GetDriveType GetVolumeInformation 讲解</title><link>http://www.cppblog.com/lauer3912/archive/2011/08/09/152836.html</link><dc:creator>RTY</dc:creator><author>RTY</author><pubDate>Mon, 08 Aug 2011 23:29:00 GMT</pubDate><guid>http://www.cppblog.com/lauer3912/archive/2011/08/09/152836.html</guid><wfw:comment>http://www.cppblog.com/lauer3912/comments/152836.html</wfw:comment><comments>http://www.cppblog.com/lauer3912/archive/2011/08/09/152836.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/lauer3912/comments/commentRss/152836.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/lauer3912/services/trackbacks/152836.html</trackback:ping><description><![CDATA[<span class="Apple-style-span" style="color: #c6c6c6; font-family: Arial; font-weight: bold; line-height: 26px; background-color: #000000; ">API太多(C++版) -- GetDriveType GetVolumeInformation 讲解<br /><div><a href="http://hi.baidu.com/xx375/blog/item/8e1ad9f71a010677ddc47496.html">http://hi.baidu.com/xx375/blog/item/8e1ad9f71a010677ddc47496.html</a></div></span><span class="Apple-style-span" style="color: #6f6f6f; font-family: Arial; font-size: 12px; line-height: 18px; background-color: #000000; "><p style="line-height: normal; "><span style="line-height: normal; font-family: 'Times New Roman'; "><strong style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; color: #ff0000; font-size: 14px; ">GetDriveType</span></strong><span style="line-height: normal; font-family: Arial, 宋体; color: #ff0000; font-size: 14px; ">&nbsp;</span></span><span style="line-height: normal; font-family: Arial, 宋体; color: #ff0000; font-size: 14px; ">函数</span></p><p style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">头文件在&#8220;</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">winbase.h</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">&#8221;</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">GetDriveType&nbsp;</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">是</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">Kernel32.dll</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">中的一个函数</span><span style="line-height: normal; font-family: 'Times New Roman'; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">,</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">&nbsp;</span></span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">　　</span></p><p style="line-height: normal; "><span style="line-height: normal; font-family: 'Times New Roman'; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">UINT GetDriveType (</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">&nbsp;&nbsp;&nbsp;</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">LPCTSTR</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">&nbsp;</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">lpRootPathName</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">// root directory</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">&nbsp;&nbsp;</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">);</span></span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">　　</span></p><p style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">&nbsp;</span></p><p style="line-height: normal; "><strong style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">函数功能</span></strong><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">　　判断磁盘类型</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">　　</span></p><p style="line-height: normal; "><strong style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">参数说明</span></strong><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">　　</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">lpRootPathName</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">包含了根目录路径的字符串指针</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">　　</span></p><p style="line-height: normal; "><strong style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">返回值</span></strong><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">　</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">(</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">返回到</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">EAX</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">中为</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">0 1 2 3 4 5 6)</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">　</span></p><p style="line-height: normal; "><span style="line-height: normal; font-family: 'Times New Roman'; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">0</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">DRIVE_UNKNOWN</span></span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">未知的磁盘类型</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">　</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">　</span></p><p style="line-height: normal; "><span style="line-height: normal; font-family: 'Times New Roman'; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">1</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">DRIVE_NO_ROOT_DIR</span></span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">说明</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">lpRootPathName</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">是无效的</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">　　</span></p><p style="line-height: normal; "><span style="line-height: normal; font-family: 'Times New Roman'; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">2</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">DRIVE_REMOVABLE</span></span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">可移动磁盘</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">　　</span></p><p style="line-height: normal; "><span style="line-height: normal; font-family: 'Times New Roman'; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">3</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">DRIVE_FIXED</span></span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">固定磁盘</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">　　</span></p><p style="line-height: normal; "><span style="line-height: normal; font-family: 'Times New Roman'; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">4</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">DRIVE_REMOTE</span></span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">网络磁盘</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">　　</span></p><p style="line-height: normal; "><span style="line-height: normal; font-family: 'Times New Roman'; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">5</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">DRIVE_CDROM</span></span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">光驱</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">　　</span></p><p style="line-height: normal; "><span style="line-height: normal; font-family: 'Times New Roman'; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">6</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">DRIVE_RAMDISK</span></span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">为</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">RAM</span></p><p style="line-height: normal; "><strong style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">应用小例</span></strong></p><p style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">#include &lt;windows.h&gt;</span></p><p style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">int main()</span></p><p style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">{</span></p><p style="line-height: normal; "><span style="line-height: normal; font-family: 'Times New Roman'; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">if(GetDriveType("C:\\") = = DRIVE_FIXED)</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">&nbsp;&nbsp;</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">(DRIVE_FIXED</span></span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">或者是</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">3 )</span></p><p style="line-height: normal; "><span style="line-height: normal; font-family: 'Times New Roman'; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">{</span></span></p><p style="line-height: normal; "><span style="line-height: normal; font-family: 'Times New Roman'; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">MessageBox(NULL,"</span></span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">固定磁盘</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">","",MB_OK);</span></p><p style="line-height: normal; "><span style="line-height: normal; font-family: 'Times New Roman'; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">}</span></span></p><p style="line-height: normal; "><span style="line-height: normal; font-family: 'Times New Roman'; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">system("pause");</span></span></p><p style="line-height: normal; "><span style="line-height: normal; font-family: 'Times New Roman'; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">return 0;</span></span></p><p style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">}</span></p><p style="line-height: normal; "><strong style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; color: #ff0000; font-size: 14px; ">GetVolumeInformation</span></strong><span style="line-height: normal; font-family: Arial, 宋体; color: #ff0000; font-size: 14px; ">函数</span></p><p style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">GetVolumeInformation</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">函数返回有关文件系统和其根目录调用中指定的卷的信息。在存在几个常见的文件系统</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">（如</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">NTFS</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">、</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">FAT</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">和</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">CDFS</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">）</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">新的文件系统可能会影响存储要求为应用程序，等，以便调用</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">GetVolumeInformation</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">可能会提供有价值的信息，您可以在您的应用程序中使用的开发中。若要计算磁盘空间和文件大小），也可以使用的某些信息此调用返回。</span></p><p style="line-height: normal; "><strong style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">函数功能</span></strong><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">　　获取与一个磁盘卷有关的信息</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">　　</span></p><p style="line-height: normal; "><strong style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">返回值</span></strong><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">　　</span><span style="line-height: normal; font-family: 'Times New Roman'; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">&nbsp;&nbsp;</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">Long</span></span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">，非零表示成功，零表示失败。会设置</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">GetLastError</span></p><p style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">GetVolumeInformation(</span></p><p style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">　　</span><span style="line-height: normal; font-family: 'Times New Roman'; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">PChar</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">&nbsp;&nbsp;</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">lpRootPathName:;</span></span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">　　　　　　　</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">{</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">磁盘驱动器代码字符串</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">}</span></p><p style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">　　</span><span style="line-height: normal; font-family: 'Times New Roman'; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">PChar</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">&nbsp;&nbsp;</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">lpVolumeNameBuffer:;</span></span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">　　　　　</span><span style="line-height: normal; font-family: 'Times New Roman'; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">{</span></span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">磁盘驱动器卷标名称</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">}</span></p><p style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">　　</span><span style="line-height: normal; font-family: 'Times New Roman'; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">DWORD</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">&nbsp;&nbsp;</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">nVolumeNameSize:;</span></span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">　　　　　　　</span><span style="line-height: normal; font-family: 'Times New Roman'; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">&nbsp;&nbsp;</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">{</span></span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">磁盘驱动器卷标名称长度</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">}</span></p><p style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">　　</span><span style="line-height: normal; font-family: 'Times New Roman'; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">PDWORD</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">&nbsp;&nbsp;</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">lpVolumeSerialNumber:;</span></span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">　　　　</span><span style="line-height: normal; font-family: 'Times New Roman'; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">&nbsp;&nbsp;&nbsp;</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">{</span></span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">磁盘驱动器卷标序列号</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">}</span></p><p style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">　　</span><span style="line-height: normal; font-family: 'Times New Roman'; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">DWORD</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">&nbsp;&nbsp;</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">var lpMaximumComponentLength:;</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">&nbsp;</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">&nbsp;</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">{</span></span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">系统允许的最大文件名长度</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">}</span></p><p style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">　</span><span style="line-height: normal; font-family: 'Times New Roman'; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">&nbsp;&nbsp;</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">DWORD</span></span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">　</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">var lpFileSystemFlags:;</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">　　　　</span><span style="line-height: normal; font-family: 'Times New Roman'; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">{</span></span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">文件系统标识</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">}</span></p><p style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">　　</span><span style="line-height: normal; font-family: 'Times New Roman'; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">PChar</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">&nbsp;&nbsp;</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">lpFileSystemNameBuffer:;</span></span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">　　　</span><span style="line-height: normal; font-family: 'Times New Roman'; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">&nbsp;</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">&nbsp;&nbsp;</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">{</span></span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">文件操作系统名称</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">&nbsp;</span><span style="line-height: normal; font-family: Arial, 宋体; letter-spacing: 0.4pt; font-size: 14px; ">如</span><span style="line-height: normal; font-family: Arial, 宋体; letter-spacing: 0.4pt; font-size: 14px; ">FAT</span><span style="line-height: normal; font-family: Arial, 宋体; letter-spacing: 0.4pt; font-size: 14px; ">，</span><span style="line-height: normal; font-family: 'Times New Roman'; "><span style="line-height: normal; font-family: Arial, 宋体; letter-spacing: 0.4pt; font-size: 14px; ">NTFS</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">}</span></span></p><p style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">　　</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">DWORD</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">　</span><span style="line-height: normal; font-family: 'Times New Roman'; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">nFileSystemNameSize:</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">{</span></span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">文件操作系统名称长度</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">}</span></p><p style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">)</span></p><p style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">lpFileSystemFlags Long</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">，用于装载一个或多个二进制位标志的变量。</span></p><p style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">对这些标志位的解释如下：</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">　　</span></p><p style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">FS_CASE_IS_PRESERVED</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">文件名的大小写记录于文件系统</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">　　</span></p><p style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">FS_CASE_SENSITIVE</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">文件名要区分大小写</span></p><p style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">FS_UNICODE_STORED_ON_DISK</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">文件名保存为</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">Unicode</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">格式</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">　　</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">FS_PERSISTANT_ACLS</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">文件系统支持文件的访问控制列表（</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">ACL</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">）安全机制</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">　　</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">FS_FILE_COMPRESSION</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">文件系统支持逐文件的进行文件压缩</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">　　</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">FS_VOL_IS_COMPRESSED</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">整个磁盘卷都是压缩的</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">　　</span></p><p style="line-height: normal; "><strong style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">应用小例</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">:</span></strong></p><p style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">#include &lt;stdio.h&gt;</span></p><p style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">#include &lt;windows.h&gt;</span></p><p style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">int main()</span></p><p style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">{</span></p><p style="line-height: normal; "><span style="line-height: normal; font-family: 'Times New Roman'; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">char Root[] = "C:\\";</span></span></p><p style="line-height: normal; "><span style="line-height: normal; font-family: 'Times New Roman'; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">char Volumelabel[20];</span></span></p><p style="line-height: normal; "><span style="line-height: normal; font-family: 'Times New Roman'; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">DWORD SerialNumber;</span></span></p><p style="line-height: normal; "><span style="line-height: normal; font-family: 'Times New Roman'; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">DWORD MaxCLength;</span></span></p><p style="line-height: normal; "><span style="line-height: normal; font-family: 'Times New Roman'; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">DWORD FileSysFlag;</span></span></p><p style="line-height: normal; "><span style="line-height: normal; font-family: 'Times New Roman'; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">char FileSysName[10];</span></span></p><p style="line-height: normal; "><span style="line-height: normal; font-family: 'Times New Roman'; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">GetVolumeInformation( "C:\\",Volumelabel,255,&amp;SerialNumber,&amp;MaxCLength,&amp;FileSysFlag,FileSysName,255);</span></span></p><p style="line-height: normal; "><span style="line-height: normal; font-family: 'Times New Roman'; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">printf("</span></span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">卷标名称</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">(Volumelabel) = %s\n",Volumelabel);</span></p><p style="line-height: normal; "><span style="line-height: normal; font-family: 'Times New Roman'; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">printf("</span></span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">卷标序列号</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">(SerialNumber) = 0x%x\n",*(&amp;SerialNumber));</span></p><p style="line-height: normal; "><span style="line-height: normal; font-family: 'Times New Roman'; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">printf("</span></span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">系统允许最大文件名长度</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">(MaxCLength) = 0x%x\n",*(&amp;MaxCLength));</span></p><p style="line-height: normal; "><span style="line-height: normal; font-family: 'Times New Roman'; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">printf("</span></span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">文件系统标识</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">(FileSysFlag) = 0x%x\n",*(&amp;FileSysFlag));</span></p><p style="line-height: normal; "><span style="line-height: normal; font-family: 'Times New Roman'; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">printf("</span></span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">文件系统名称</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">(FileSysName) = %s\n",FileSysName);</span></p><p style="line-height: normal; "><span style="line-height: normal; font-family: 'Times New Roman'; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">system("pause");</span></span></p><p style="line-height: normal; "><span style="line-height: normal; font-family: 'Times New Roman'; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">return 0;</span></span></p><p style="line-height: normal; "><span style="line-height: normal; font-family: Arial, 宋体; font-size: 14px; ">}</span></p></span><img src ="http://www.cppblog.com/lauer3912/aggbug/152836.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/lauer3912/" target="_blank">RTY</a> 2011-08-09 07:29 <a href="http://www.cppblog.com/lauer3912/archive/2011/08/09/152836.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Windows 如何获得光盘的名称</title><link>http://www.cppblog.com/lauer3912/archive/2011/08/09/152835.html</link><dc:creator>RTY</dc:creator><author>RTY</author><pubDate>Mon, 08 Aug 2011 23:25:00 GMT</pubDate><guid>http://www.cppblog.com/lauer3912/archive/2011/08/09/152835.html</guid><wfw:comment>http://www.cppblog.com/lauer3912/comments/152835.html</wfw:comment><comments>http://www.cppblog.com/lauer3912/archive/2011/08/09/152835.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/lauer3912/comments/commentRss/152835.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/lauer3912/services/trackbacks/152835.html</trackback:ping><description><![CDATA[<span style="font-family: Arial; font-size: 12pt; ">摘抄了部分网站的文章，主要还是用到Windows的API &nbsp;</span><span class="Apple-style-span" style="color: #666666; font-weight: bold; line-height: normal; font-family: Arial; font-size: 12pt; ">GetVolumeInformation </span><span class="Apple-style-span" style="line-height: normal; font-family: Arial; font-size: 12pt; color: #000000; ">这个函数主要用途是获得文件系统信息<br /><br />1. 摘抄原文地址：</span><a href="http://tech.ddvip.com/2008-11/122655520092169.html">http://tech.ddvip.com/2008-11/122655520092169.html<br /></a><div><a href="http://hackdiy.com/I-214009.html">http://hackdiy.com/I-214009.html<br /><br /><span style="color: #000000; ">2</span></a>. 以下是源码说明：<br />声明：<br /><span class="Apple-style-span" style="font-family: Arial, 宋体, 新宋体; font-size: 12px; line-height: normal; "><p style="margin-top: 14px; margin-right: 0px; margin-bottom: 14px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 22px; font-size: 14px; "><code style="margin-top: 10px; margin-right: 5px; margin-bottom: 10px; margin-left: 5px; padding-top: 10px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px; font-family: Verdana, Arial, 新宋体; font-size: 12px; line-height: 18px; background-color: #e6e6e6; text-indent: 0px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #999999; border-right-color: #999999; border-bottom-color: #999999; border-left-color: #999999; display: block; word-wrap: break-word; word-break: break-all; color: #333333; clear: both; ">GetVolumeInformation(<br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />　lpRootPathName: PChar;　　　　　　　 {磁盘驱动器代码字符串}<br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />　lpVolumeNameBuffer: PChar;　　　　　 {磁盘驱动器卷标名称}<br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />　nVolumeNameSize: DWORD;　　　　　　　{磁盘驱动器卷标名称长度}<br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />　lpVolumeSerialNumber: PDWORD;　　　　{磁盘驱动器卷标序列号}<br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />　var lpMaximumComponentLength: DWORD; {系统允许的最大文件名长度}<br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />　var lpFileSystemFlags: DWORD;　　　　{文件系统标识}<br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />　lpFileSystemNameBuffer: PChar;　　　 {文件操作系统名称}<br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />　nFileSystemNameSize: DWORD　　　　　 {文件操作系统名称长度}<br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />): BOOL;</code>//举例:<code style="margin-top: 10px; margin-right: 5px; margin-bottom: 10px; margin-left: 5px; padding-top: 10px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px; font-family: Verdana, Arial, 新宋体; font-size: 12px; line-height: 18px; background-color: #e6e6e6; text-indent: 0px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #999999; border-right-color: #999999; border-bottom-color: #999999; border-left-color: #999999; display: block; word-wrap: break-word; word-break: break-all; color: #333333; clear: both; ">procedure TForm1.FormCreate(Sender: TObject);<br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />var<br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />　RootPath: array[0..20] of Char;<br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />　VolName: array[0..255] of Char;<br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />　SerialNumber: DWORD;<br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />　MaxCLength: DWORD;<br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />　FileSysFlag: DWORD;<br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />　FileSysName: array[0..255] of Char;<br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />begin<br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />　RootPath := 'C:';<br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />　GetVolumeInformation(<br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />　　RootPath,<br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />　　VolName,<br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />　　255,<br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />　　@SerialNumber,<br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />　　MaxCLength,<br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />　　FileSysFlag,<br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />　　FileSysName,<br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />　　255<br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />　);<br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />　Memo1.Clear;<br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />　with Memo1.Lines do<br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />　begin<br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />　　Add(Format('磁盘驱动器代码字符串:'+ #9#9 +'%s',[RootPath]));<br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />　　Add(Format('磁盘驱动器卷标名称:'+ #9#9 +'%s',[VolName]));<br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />　　Add(Format('磁盘驱动器卷标序列号:'+ #9#9 +'%s',[IntToHex(SerialNumber,8)]));<br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />　　Add(Format('系统允许的最大文件名长度:'+ #9 +'%d',[MaxCLength]));<br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />　　Add(Format('文件系统标识:'+ #9#9#9 +'%d',[FileSysFlag]));<br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />　　Add(Format('文件系统名称:'+ #9#9#9 +'%s',[FileSysName]));<br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />　end;<br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />end;</code>//效果图:</p><p style="margin-top: 14px; margin-right: 0px; margin-bottom: 14px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 22px; font-size: 14px; "><img src="http://img.ddvip.com/2008_11_13/1226555200_ddvip_5265.png" alt="WinAPI: GetVolumeInformation - 读取文件系统信息" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; max-width: 550px; " /></p></span></div><a href="http://tech.ddvip.com/2008-11/122655520092169.html"></a><img src ="http://www.cppblog.com/lauer3912/aggbug/152835.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/lauer3912/" target="_blank">RTY</a> 2011-08-09 07:25 <a href="http://www.cppblog.com/lauer3912/archive/2011/08/09/152835.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>批处理！？？ 返回值的问题??</title><link>http://www.cppblog.com/lauer3912/archive/2011/07/21/151571.html</link><dc:creator>RTY</dc:creator><author>RTY</author><pubDate>Thu, 21 Jul 2011 13:51:00 GMT</pubDate><guid>http://www.cppblog.com/lauer3912/archive/2011/07/21/151571.html</guid><wfw:comment>http://www.cppblog.com/lauer3912/comments/151571.html</wfw:comment><comments>http://www.cppblog.com/lauer3912/archive/2011/07/21/151571.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/lauer3912/comments/commentRss/151571.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/lauer3912/services/trackbacks/151571.html</trackback:ping><description><![CDATA[<span class="Apple-style-span" style="font-family: simsun; line-height: 23px; background-color: #ffffff; ">a.bat<br /><br /><dl class="code" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; width: 718px; overflow-x: auto; overflow-y: auto; font-size: 12px; "><dt style="background-color: #f5f5f5; height: 24px; line-height: 24px; font-weight: bold; text-indent: 6px; color: #333333; ">BatchFile code</dt><dd style="border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: #dddddd; border-right-color: #dddddd; border-bottom-color: #dddddd; border-left-color: #dddddd; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><pre><div><span style="line-height: 18px; color: #0000ff; ">@echo</span><span style="line-height: 18px; color: #000000; "> </span><span style="line-height: 18px; color: #0000ff; ">off</span><span style="line-height: 18px; color: #000000; ">
</span><span style="line-height: 18px; color: #0000ff; ">call</span><span style="line-height: 18px; color: #000000; "> b</span><span style="line-height: 18px; color: #000000; ">.</span><span style="line-height: 18px; color: #000000; ">bat VarReturn
</span><span style="line-height: 18px; color: #0000ff; ">echo</span><span style="line-height: 18px; color: #000000; "> 批处理b</span><span style="line-height: 18px; color: #000000; ">.</span><span style="line-height: 18px; color: #000000; ">bat的返回值是：%VarReturn%</span></div>
</pre></dd></dl><br /><br />b.bat<br /><br /><dl class="code" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; width: 718px; overflow-x: auto; overflow-y: auto; font-size: 12px; "><dt style="background-color: #f5f5f5; height: 24px; line-height: 24px; font-weight: bold; text-indent: 6px; color: #333333; ">BatchFile code</dt><dd style="border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: #dddddd; border-right-color: #dddddd; border-bottom-color: #dddddd; border-left-color: #dddddd; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><pre><div><span style="line-height: 18px; color: #0000ff; ">@echo</span><span style="line-height: 18px; color: #000000; "> </span><span style="line-height: 18px; color: #0000ff; ">off</span><span style="line-height: 18px; color: #000000; ">
</span><span style="line-height: 18px; color: #0000ff; ">set</span><span style="line-height: 18px; color: #000000; "> </span><span style="line-height: 18px; color: #000000; ">/</span><span style="line-height: 18px; color: #000000; ">a sum</span><span style="line-height: 18px; color: #000000; ">=</span><span style="line-height: 18px; color: #000000; ">1</span><span style="line-height: 18px; color: #000000; ">+</span><span style="line-height: 18px; color: #000000; ">2</span><span style="line-height: 18px; color: #000000; ">
</span><span style="line-height: 18px; color: #0000ff; ">set</span><span style="line-height: 18px; color: #000000; "> </span><span style="line-height: 18px; color: #800080; ">%1</span><span style="line-height: 18px; color: #000000; ">=</span><span style="line-height: 18px; color: #000000; ">%sum%</span></div></pre></dd></dl></span><img src ="http://www.cppblog.com/lauer3912/aggbug/151571.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/lauer3912/" target="_blank">RTY</a> 2011-07-21 21:51 <a href="http://www.cppblog.com/lauer3912/archive/2011/07/21/151571.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>mainCRTStartup VC++</title><link>http://www.cppblog.com/lauer3912/archive/2011/06/18/148910.html</link><dc:creator>RTY</dc:creator><author>RTY</author><pubDate>Sat, 18 Jun 2011 07:09:00 GMT</pubDate><guid>http://www.cppblog.com/lauer3912/archive/2011/06/18/148910.html</guid><wfw:comment>http://www.cppblog.com/lauer3912/comments/148910.html</wfw:comment><comments>http://www.cppblog.com/lauer3912/archive/2011/06/18/148910.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/lauer3912/comments/commentRss/148910.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/lauer3912/services/trackbacks/148910.html</trackback:ping><description><![CDATA[<div id="blog_text"><p>操作系统装载应用程序后，做完初始化工作就转到程序的入口点执行。程序的默认入 口点由连接程序设置， 不同的连接器选择的入口函数也不尽相同。在VC++下，连接器对控制台程序设置的入口函数是  mainCRTStartup，mainCRTStartup 再调用main 函数；对图形用户界面（GUI）程序设置的入口函数是  WinMainCRTStartup，WinMainCRTStartup 调用你自己写的 WinMain  函数。具体设置哪个入口点是由连接器的&#8220;/subsystem:&#8221;选项确定的，它告诉操作系统如何运行编译生成的.EXE文件。可以指定四种方 式：CONSOLE|WINDOWS|NATIVE|POSIX。如果这个选项参数的值为  WINDOWS，则表示该应用程序运行时不需要控制台，有关连接器参数选项的详细说明请参考 MSDN 库。 </p> <p>以下四种组合，可以实现console和windows模式的混合，可以达到不弹出DOS窗口的效果，也可以达到在Windows程序中向控制台输出printf信息的目的。<br />#pragma comment( linker, "/subsystem:windows /entry:WinMainCRTStartup" )<br />#pragma comment( linker, "/subsystem:windows /entry:mainCRTStartup" )<br />#pragma comment( linker, "/subsystem:console /entry:mainCRTStartup" )<br />#pragma comment( linker, "/subsystem:console /entry:WinMainCRTStartup" )</p> <p>int APIENTRY WinMain(HINSTANCE hInstance,<br />HINSTANCE hPrevInstance,<br />LPSTR&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lpCmdLine,<br />int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; nCmdShow)<br />{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // ...<br />}</p> <p>int main(void)<br />{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // ...<br />} </p></div><img src ="http://www.cppblog.com/lauer3912/aggbug/148910.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/lauer3912/" target="_blank">RTY</a> 2011-06-18 15:09 <a href="http://www.cppblog.com/lauer3912/archive/2011/06/18/148910.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Intel Parallel Studio XE 2011</title><link>http://www.cppblog.com/lauer3912/archive/2011/06/10/148390.html</link><dc:creator>RTY</dc:creator><author>RTY</author><pubDate>Thu, 09 Jun 2011 22:23:00 GMT</pubDate><guid>http://www.cppblog.com/lauer3912/archive/2011/06/10/148390.html</guid><wfw:comment>http://www.cppblog.com/lauer3912/comments/148390.html</wfw:comment><comments>http://www.cppblog.com/lauer3912/archive/2011/06/10/148390.html#Feedback</comments><slash:comments>3</slash:comments><wfw:commentRss>http://www.cppblog.com/lauer3912/comments/commentRss/148390.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/lauer3912/services/trackbacks/148390.html</trackback:ping><description><![CDATA[<span class="Apple-style-span" style="color: #464646; font-family: simsun; "><div>中文名: 英特尔&#174; 高性能并行程序开发工具套件 2011</div><div>英文名: Intel&#174; Parallel Studio XE 2011</div><div>资源格式: 压缩包</div><div>发行时间: 2010年9月</div><div>制作发行: Intel&#174;</div><div>地区: 美国</div><div>语言: 英文</div><div>简介:&nbsp;<wbr></div><div></div><div><a href="http://photo.blog.sina.com.cn/showpic.html#blogid=72824f680100qi07&amp;url=http://s8.sinaimg.cn/orignal/72824f68t9c76f08a0ba7" target="_blank" style="text-decoration: none; color: #63401b; "><img src="http://s8.sinaimg.cn/middle/72824f68t9c76f08a0ba7&amp;690" width="261" height="338" name="image_operate_84141297935128449" alt="Intel&nbsp;&lt;wbr&gt;Parallel&nbsp;&lt;wbr&gt;Studio&nbsp;&lt;wbr&gt;XE&nbsp;&lt;wbr&gt;2011" title="Intel&nbsp;&lt;wbr&gt;Parallel&nbsp;&lt;wbr&gt;Studio&nbsp;&lt;wbr&gt;XE&nbsp;&lt;wbr&gt;2011" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; " /></a><br /><div>&nbsp;<wbr>&nbsp;<wbr>&nbsp;&nbsp;<wbr>2010年9月3日，北京 &#8212;&#8212; 今天，英特尔正式推出Intel&#174; Parallel Studio XE 2011，该并行程序开发工具套件在C++编译器、错误检查与性能调试工具中增加了扩展的多线程库和强大的多线程编程建议功能。</div><div></div><div>&nbsp;<wbr>&nbsp;<wbr>&nbsp;&nbsp;<wbr>作为功能卓越的、完整的性能优化套件，英特尔&#174; Parallel Studio XE 2011帮助软件开发者更轻松地提高串行和并行应用的性能和可靠性，以便充分利用最新的多核处理器。该版本添加了一套新的旨在充分利用并行处理的并行模块&#8212;&#8212;英特尔&#174;并行构建模块、可引导从串行到并行过渡的强大多线程编程辅助工具&#8212;&#8212;英特尔&#174; Parallel Advisor XE，以及包括全面支持Microsoft Visual Studio 2005、2008、2010开发环境在内的一系列强化功能。</div></div><div></div><div><strong>组件包括：</strong></div><div>1、Intel&#174; VTune&#8482; Amplifier XE</div><div>2、Intel&#174; Inspector XE&nbsp;<wbr></div><div>3、Intel&#174; Static Security Analyzer</div><div>4、Intel&#174; Parallel Building Blocks</div><div>5、Intel&#174; Integrated Performance Primitives&nbsp;<wbr></div><div>6、Intel&#174; Threading Building Blocks</div><div>7、Intel&#174; Math Kernel Library</div><div>8、Intel&#174; C++ Compiler XE</div><div>9、Intel&#174; Visual Fortran Compiler XE</div><div>10、Intel&#174; Parallel Debugger Extension</div><div></div><div><strong><br /></strong></div><div><strong>下载</strong></div><div>1、Parallel Studio XE 2010 Update1安装程序下载地址：</div><div><font color="#4D6DF3" style="word-wrap: normal; word-break: normal; line-height: 21px; ">http://registrationcenter-download.intel.com/akdlm/irc_nas/2069/parallel_studio_xe_2011_update1_setup.exe</font></div><div></div><div>2、正版授权文件下载地址：</div><div><a href="http://u.115.com/file/f7ba634add" style="text-decoration: none; color: #63401b; "><font color="#ED1C24" style="word-wrap: normal; word-break: normal; line-height: 21px; ">http://u.115.com/file/f7ba634add</font></a></div><div></div><div><span style="word-wrap: normal; word-break: normal; line-height: 21px; font-family: Verdana, Arial, Helvetica, sans-serif; ">如果网盘过期，请将以下内容用记事本保存为.LIC文件。</span><div style="font-family: '', Verdana, Arial, Helvetica, sans-serif; line-height: 1.5; "><div style="font-family: '', Verdana, Arial, Helvetica, sans-serif; line-height: 1.5; "><span style="word-wrap: normal; word-break: normal; line-height: 21px; font-family: Verdana, Arial, Helvetica, sans-serif; ">PACKAGE I01584458 INTEL 2014.0228 27243F48B724 \</span></div><div style="font-family: '', Verdana, Arial, Helvetica, sans-serif; line-height: 1.5; ">COMPONENTS="ArBBW ArBBL ArBBM CClusOMPL CComp CCompL CCompM \</div><div style="font-family: '', Verdana, Arial, Helvetica, sans-serif; line-height: 1.5; ">CCompW CCompP CCompPL CCompPM CCompPW CLMKern CLMKernL CLMKernM \</div><div style="font-family: '', Verdana, Arial, Helvetica, sans-serif; line-height: 1.5; ">CLMKernW Dbg DbgL DbgM DbgW DbgMID DbgMIDL DbgMIDM DbgMIDW EBComp \</div><div style="font-family: '', Verdana, Arial, Helvetica, sans-serif; line-height: 1.5; ">FClusOMPL FComp FCompL FCompM FCompW IClsTktL IClsTktM IClsTktW IMemChkL \</div><div style="font-family: '', Verdana, Arial, Helvetica, sans-serif; line-height: 1.5; ">IMemChkM IMemChkW ISVXscDbgWCE ITrAnlL ITrAnlM ITrAnlW ITrColL \</div><div style="font-family: '', Verdana, Arial, Helvetica, sans-serif; line-height: 1.5; ">ITrColM ITrColW MKern MKernL MKernM MKernW MPass MPassL MPassM \</div><div style="font-family: '', Verdana, Arial, Helvetica, sans-serif; line-height: 1.5; ">MPassW OEMXscDbgWCE OEMXscDbgW PAmpl PAmplL PAmplM PAmplW \</div><div style="font-family: '', Verdana, Arial, Helvetica, sans-serif; line-height: 1.5; ">PInsp PInspL PInspM PInspW PerfAnl PerfAnlOmp PerfAnlMID \</div><div style="font-family: '', Verdana, Arial, Helvetica, sans-serif; line-height: 1.5; ">PerfAnlMIDL PerfAnlMIDM PerfAnlMIDW PerfPrim PerfPrimL \</div><div style="font-family: '', Verdana, Arial, Helvetica, sans-serif; line-height: 1.5; ">PerfPrimM PerfPrimW SampEnbL SampEnbM SampEnbW StaticAnlW \</div><div style="font-family: '', Verdana, Arial, Helvetica, sans-serif; line-height: 1.5; ">StaticAnlM StaticAnlL TAnalGuiL TAnalCliL TCheckCliL TCheckCliM \</div><div style="font-family: '', Verdana, Arial, Helvetica, sans-serif; line-height: 1.5; ">TCheckCliW TCheckGuiL TCheckGuiM TCheckGuiW ThrAdv ThrAdvL ThrAdvM ThrAdvW \</div><div style="font-family: '', Verdana, Arial, Helvetica, sans-serif; line-height: 1.5; ">ThreadAnlGui ThreadBB ThreadBBL ThreadBBM ThreadBBW TPITrAnlL \</div><div style="font-family: '', Verdana, Arial, Helvetica, sans-serif; line-height: 1.5; ">TPMathStatW TProfileCliW TProfileGuiW XlbtjL XlbtjM XlbtjW \</div><div style="font-family: '', Verdana, Arial, Helvetica, sans-serif; line-height: 1.5; ">XscaleCCompWCE XscaleCCompW XscOSPlgP XscOSPlgS XscOSPlgN \</div><div style="font-family: '', Verdana, Arial, Helvetica, sans-serif; line-height: 1.5; ">XscOSPlgL XsscL XsscM XsscW XssjL XssjM XssjW" OPTIONS=SUITE \&nbsp;<wbr></div><div style="font-family: '', Verdana, Arial, Helvetica, sans-serif; line-height: 1.5; ">ck=84 SIGN=DF8C3226447E</div><div style="font-family: '', Verdana, Arial, Helvetica, sans-serif; line-height: 1.5; "></div><div style="font-family: '', Verdana, Arial, Helvetica, sans-serif; line-height: 1.5; ">INCREMENT I01584458 INTEL 2014.0228 28-feb-2014 uncounted \</div><div style="font-family: '', Verdana, Arial, Helvetica, sans-serif; line-height: 1.5; ">817ECE176C69 VENDOR_STRING="SUPPORT=COM ENDIAN=EIA \</div><div style="font-family: '', Verdana, Arial, Helvetica, sans-serif; line-height: 1.5; ">https://registrationcenter.intel.com" HOSTID=ID=06752907 \</div><div style="font-family: '', Verdana, Arial, Helvetica, sans-serif; line-height: 1.5; ">PLATFORMS="amd64_re i86_n ia64_n i86_mac i86_r i86_re \</div><div style="font-family: '', Verdana, Arial, Helvetica, sans-serif; line-height: 1.5; ">it64_lr it64_re i86_g i86_l it64_n i86_x" ck=112 SN=SMSATVVN463L \</div><div style="font-family: '', Verdana, Arial, Helvetica, sans-serif; line-height: 1.5; ">TS_OK SIGN=9CDED670EDEC</div><div style="font-family: '', Verdana, Arial, Helvetica, sans-serif; line-height: 1.5; "></div><div style="font-family: '', Verdana, Arial, Helvetica, sans-serif; line-height: 1.5; ">PACKAGE I01584458 INTEL 2014.0228 27243F48B724 \</div><div style="font-family: '', Verdana, Arial, Helvetica, sans-serif; line-height: 1.5; ">COMPONENTS="ArBBW ArBBL ArBBM CClusOMPL CComp CCompL CCompM \</div><div style="font-family: '', Verdana, Arial, Helvetica, sans-serif; line-height: 1.5; ">CCompW CCompP CCompPL CCompPM CCompPW CLMKern CLMKernL CLMKernM \</div><div style="font-family: '', Verdana, Arial, Helvetica, sans-serif; line-height: 1.5; ">CLMKernW Dbg DbgL DbgM DbgW DbgMID DbgMIDL DbgMIDM DbgMIDW EBComp \</div><div style="font-family: '', Verdana, Arial, Helvetica, sans-serif; line-height: 1.5; ">FClusOMPL FComp FCompL FCompM FCompW IClsTktL IClsTktM IClsTktW IMemChkL \</div><div style="font-family: '', Verdana, Arial, Helvetica, sans-serif; line-height: 1.5; ">IMemChkM IMemChkW ISVXscDbgWCE ITrAnlL ITrAnlM ITrAnlW ITrColL \</div><div style="font-family: '', Verdana, Arial, Helvetica, sans-serif; line-height: 1.5; ">ITrColM ITrColW MKern MKernL MKernM MKernW MPass MPassL MPassM \</div><div style="font-family: '', Verdana, Arial, Helvetica, sans-serif; line-height: 1.5; ">MPassW OEMXscDbgWCE OEMXscDbgW PAmpl PAmplL PAmplM PAmplW \</div><div style="font-family: '', Verdana, Arial, Helvetica, sans-serif; line-height: 1.5; ">PInsp PInspL PInspM PInspW PerfAnl PerfAnlOmp PerfAnlMID \</div><div style="font-family: '', Verdana, Arial, Helvetica, sans-serif; line-height: 1.5; ">PerfAnlMIDL PerfAnlMIDM PerfAnlMIDW PerfPrim PerfPrimL \</div><div style="font-family: '', Verdana, Arial, Helvetica, sans-serif; line-height: 1.5; ">PerfPrimM PerfPrimW SampEnbL SampEnbM SampEnbW StaticAnlW \</div><div style="font-family: '', Verdana, Arial, Helvetica, sans-serif; line-height: 1.5; ">StaticAnlM StaticAnlL TAnalGuiL TAnalCliL TCheckCliL TCheckCliM \</div><div style="font-family: '', Verdana, Arial, Helvetica, sans-serif; line-height: 1.5; ">TCheckCliW TCheckGuiL TCheckGuiM TCheckGuiW ThrAdv ThrAdvL ThrAdvM ThrAdvW \</div><div style="font-family: '', Verdana, Arial, Helvetica, sans-serif; line-height: 1.5; ">ThreadAnlGui ThreadBB ThreadBBL ThreadBBM ThreadBBW TPITrAnlL \</div><div style="font-family: '', Verdana, Arial, Helvetica, sans-serif; line-height: 1.5; ">TPMathStatW TProfileCliW TProfileGuiW XlbtjL XlbtjM XlbtjW \</div><div style="font-family: '', Verdana, Arial, Helvetica, sans-serif; line-height: 1.5; ">XscaleCCompWCE XscaleCCompW XscOSPlgP XscOSPlgS XscOSPlgN \</div><div style="font-family: '', Verdana, Arial, Helvetica, sans-serif; line-height: 1.5; ">XscOSPlgL XsscL XsscM XsscW XssjL XssjM XssjW" OPTIONS=SUITE \&nbsp;<wbr></div><div style="font-family: '', Verdana, Arial, Helvetica, sans-serif; line-height: 1.5; ">ck=84 SIGN=DF8C3226447E</div><div style="font-family: '', Verdana, Arial, Helvetica, sans-serif; line-height: 1.5; "></div><div style="font-family: '', Verdana, Arial, Helvetica, sans-serif; line-height: 1.5; ">INCREMENT I01584458 INTEL 2014.0228 28-feb-2014 uncounted \</div><div style="font-family: '', Verdana, Arial, Helvetica, sans-serif; line-height: 1.5; ">74D04C752CBC VENDOR_STRING="SUPPORT=COM ENDIAN=EIA \</div><div style="font-family: '', Verdana, Arial, Helvetica, sans-serif; line-height: 1.5; ">https://registrationcenter.intel.com" HOSTID=ID=06752907 \</div><div style="font-family: '', Verdana, Arial, Helvetica, sans-serif; line-height: 1.5; ">PLATFORMS="amd64_re i86_n ia64_n i86_mac i86_r i86_re it64_lr \</div><div style="font-family: '', Verdana, Arial, Helvetica, sans-serif; line-height: 1.5; ">it64_re i86_g i86_l it64_n i86_x" ck=104 SN=SMSATVVN463L \</div><div style="font-family: '', Verdana, Arial, Helvetica, sans-serif; line-height: 1.5; ">SIGN=34CDAA3606EA</div></div></div></span><img src ="http://www.cppblog.com/lauer3912/aggbug/148390.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/lauer3912/" target="_blank">RTY</a> 2011-06-10 06:23 <a href="http://www.cppblog.com/lauer3912/archive/2011/06/10/148390.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>VirtualBox 4.0.8 发布, 提升3D支持</title><link>http://www.cppblog.com/lauer3912/archive/2011/05/17/146586.html</link><dc:creator>RTY</dc:creator><author>RTY</author><pubDate>Tue, 17 May 2011 10:55:00 GMT</pubDate><guid>http://www.cppblog.com/lauer3912/archive/2011/05/17/146586.html</guid><wfw:comment>http://www.cppblog.com/lauer3912/comments/146586.html</wfw:comment><comments>http://www.cppblog.com/lauer3912/archive/2011/05/17/146586.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/lauer3912/comments/commentRss/146586.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/lauer3912/services/trackbacks/146586.html</trackback:ping><description><![CDATA[<div id="OSChina_News_18038" class="NewsContent TextContent NewsType1">
<p>VirtualBox 宣布了 4.0.8 版本，该版本改进了对 Gnome 3 的 3D 支持。同时还修复了不少bug，包括改变 guest 窗体大小时可能导致程序崩溃的问题以及 Ubuntu 11.04 以及 Fedora 15 下 Gnome 3 的渲染问题。</p>
<p>VirtualBox 是一款功能强大的 x86 虚拟机软件，它不仅具有丰富的特色，而且性能也很优异。</p>
<p><img alt="" src="http://www.oschina.net/uploads/img/201003/26104750_gVMf.png" /></p>
<p class="ProjectOfNews">更多关于<a href="http://www.oschina.net/p/virtualbox"><u><font color="#0066cc">VirtualBox</font></u></a>的详细信息，或者下载地址请点<a href="http://www.oschina.net/action/project/go?id=1196&amp;p=download"><u><font color="#0066cc">这里</font></u></a></p></div><img src ="http://www.cppblog.com/lauer3912/aggbug/146586.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/lauer3912/" target="_blank">RTY</a> 2011-05-17 18:55 <a href="http://www.cppblog.com/lauer3912/archive/2011/05/17/146586.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>