<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>

<channel>
	<title>DEAN LEE:/DEV/BLOG &#187; Windows</title>
	<atom:link href="http://www.deanlee.cn/category/windows/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.deanlee.cn</link>
	<description>mount /dev/brain &#124;&#124; tail -f /var/log/thoughts &#62;&#62; /pub/www</description>
	<pubDate>Thu, 22 Mar 2012 06:55:19 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.2</generator>
	<language>en</language>
	<atom:link rel="hub" href="http://pubsubhubbub.appspot.com"/><atom:link rel="hub" href="http://superfeedr.com/hubbub"/>		<item>
		<title>inffas32.asm: error A2070: invalid instruction operands</title>
		<link>http://www.deanlee.cn/windows/inffas32asm-error-a2070-invalid-instruction-operands/</link>
		<comments>http://www.deanlee.cn/windows/inffas32asm-error-a2070-invalid-instruction-operands/#comments</comments>
		<pubDate>Wed, 29 Apr 2009 17:28:32 +0000</pubDate>
		<dc:creator>Dean Lee</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<category><![CDATA[Windows]]></category>

		<category><![CDATA[a2070]]></category>

		<category><![CDATA[compile]]></category>

		<category><![CDATA[inffas32.asm]]></category>

		<category><![CDATA[vs2005]]></category>

		<category><![CDATA[zlib]]></category>

		<guid isPermaLink="false">http://www.deanlee.cn/?p=805</guid>
		<description><![CDATA[I got the following errors while compiling zlib on windows with Visual studio 2005:

1>inffas32.asm(649) : error A2070: invalid instruction operands
1>inffas32.asm(663) : error A2070: invalid instruction operands
1>inffas32.asm(720) : error A2070: invalid instruction operands
these errors are due to an issue with Microsoft Macro Assembler ,included with Visual C++ 2005.it refuses to assemble a MOVD instruction with a [...]]]></description>
			<content:encoded><![CDATA[<p>I got the following errors while compiling <a href="http://www.zlib.net/" target="_blank">zlib </a>on windows with Visual studio 2005:</p>
<pre class="prettyprint">
1>inffas32.asm(649) : error A2070: invalid instruction operands
1>inffas32.asm(663) : error A2070: invalid instruction operands
1>inffas32.asm(720) : error A2070: invalid instruction operands</pre>
<p>these errors are due to an issue with Microsoft Macro Assembler ,included with Visual C++ 2005.it refuses to assemble a MOVD instruction with a memory operand with an implied size, and requires that &quot;dword ptr&quot; prefix the memory operand.</p>
<p>to fix these problems,simply adding<span style="font-style: italic;">&#8221;</span><em>DWORD PTR&#8217; before</em> the operands:</p>
<pre class="prettyprint">
movd mm5,dword ptr [esp+4](649)
movd mm7,dword ptr [esi](663)
movd mm7,dword ptr [esi](720)
</pre>
<p><span id="more-805"></span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.deanlee.cn/windows/inffas32asm-error-a2070-invalid-instruction-operands/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Windows Live Space says:&#34;Server is too busy&#34;</title>
		<link>http://www.deanlee.cn/windows/windows-live-space-says-server-is-too-busy/</link>
		<comments>http://www.deanlee.cn/windows/windows-live-space-says-server-is-too-busy/#comments</comments>
		<pubDate>Thu, 30 Aug 2007 16:41:55 +0000</pubDate>
		<dc:creator>Dean Lee</dc:creator>
		
		<category><![CDATA[Windows]]></category>

		<category><![CDATA[live]]></category>

		<guid isPermaLink="false">http://www.deanlee.cn/technology/msn-space-saysserver-is-too-busy/</guid>
		<description><![CDATA[What the hell is going on?Too many users or bad design?I would rather believe it&#8217;s the first case. because there are ton of amazing articles written by&#160;Microsoft about Scalability and Availability,such as &#8220;Scalability, Sweet Scalability&#8221; or &#8220;Improving Both Availability and Scalability&#8220;. they can\&#8217;t possibly have made an incredibly dumb mistake.
I don\&#8217;t know what happened and [...]]]></description>
			<content:encoded><![CDATA[<p>What the hell is going on?Too many users or bad design?I would rather believe it&#8217;s the first case. because there are ton of amazing articles written by&nbsp;Microsoft about <strong>Scalability</strong> and <strong>Availability</strong>,such as &#8220;<a href="http://msdn2.microsoft.com/en-us/library/ms810285.aspx" target="_blank">Scalability, Sweet Scalability</a>&#8221; or &#8220;<a href="http://technet.microsoft.com/en-us/library/ms151244.aspx" target="_blank">Improving Both Availability and Scalability</a>&#8220;. they can\&#8217;t possibly have made an incredibly dumb mistake.</p>
<p>I don\&#8217;t know what happened and I don\&#8217;t want to know.I only know that I even can\&#8217;t leave a comment to my friends who&nbsp;have written on&nbsp;Windows Live Space&nbsp;till now.</p>
<p><a href="http://www.deanlee.cn/wp-content/uploads/2007/08/msn-space-busy.png" atomicselection="true" rel="lightbox"><img height="326" alt="msn_space_busy" src="http://www.deanlee.cn/wp-content/uploads/2007/08/msn-space-busy-thumb.png" width="389"></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.deanlee.cn/windows/windows-live-space-says-server-is-too-busy/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Compiler warning C4022 when building OpenSSL 0.9.8e On Windows</title>
		<link>http://www.deanlee.cn/windows/compiler-warning-c4022-when-building-openssl-098e-on-windows/</link>
		<comments>http://www.deanlee.cn/windows/compiler-warning-c4022-when-building-openssl-098e-on-windows/#comments</comments>
		<pubDate>Sat, 25 Aug 2007 10:46:15 +0000</pubDate>
		<dc:creator>Dean Lee</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<category><![CDATA[Windows]]></category>

		<category><![CDATA[c4022]]></category>

		<category><![CDATA[compile]]></category>

		<category><![CDATA[openssl]]></category>

		<guid isPermaLink="false">http://www.deanlee.cn/windows/compile-errorc4022-when-trying-to-build-openssl-098e-on-windows/</guid>
		<description><![CDATA[I got the following compiler error&#160;when building OpenSSL-0.9.8e in Windows environments with Visual studio 2005:
.\apps\enc.c(380) : error C2220: warning treated as error - no &#8216;object&#8217; file generated
.\apps\enc.c(380) : warning C4022: &#8216;BIO_ctrl&#8217; : pointer mismatch for actual parameter 4
Here is the quick fix to solve this compile error:
Open file .\apps\enc.c,Go to line 380:
if (BIO_read_filename(in,inf ]]></description>
			<content:encoded><![CDATA[<p>I got the following compiler error&nbsp;when building <a href="http://www.openssl.org/" target="_blank">OpenSSL-0.9.8e</a> in Windows environments with Visual studio 2005:</p>
<p>.\apps\enc.c(380) : error C2220: warning treated as error - no &#8216;object&#8217; file generated<br />
.\apps\enc.c(380) : warning C4022: &#8216;BIO_ctrl&#8217; : pointer mismatch for actual parameter 4</p>
<p>Here is the quick fix to solve this compile error:</p>
<p>Open file .\apps\enc.c,Go to line 380:</p>
<pre class="prettyprint">if (BIO_read_filename(in,inf <= 0))
{
	perror(inf);
	goto end;
}</pre>
<p>&nbsp;Change it to</p>
<pre class="prettyprint">if (BIO_read_filename(in,(char*)(inf <= 0)))
{
	perror(inf);
	goto end;
}</pre>
<p>you can download the compiled binary <a href="http://www.deanlee.cn/programming/openssl-for-windows/" target="_blank">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.deanlee.cn/windows/compiler-warning-c4022-when-building-openssl-098e-on-windows/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How to detect whether or not user is running a full-screen program</title>
		<link>http://www.deanlee.cn/windows/how-to-detect-whether-or-not-user-is-running-a-full-screen-program/</link>
		<comments>http://www.deanlee.cn/windows/how-to-detect-whether-or-not-user-is-running-a-full-screen-program/#comments</comments>
		<pubDate>Fri, 20 Apr 2007 07:21:56 +0000</pubDate>
		<dc:creator>Dean Lee</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<category><![CDATA[Windows]]></category>

		<category><![CDATA[code-snippet]]></category>

		<guid isPermaLink="false">http://www.deanlee.cn/windows/how-to-detect-whether-or-not-user-is-running-a-full-screen-program/</guid>
		<description><![CDATA[Recently I was asked how to detect&#160;whether or not user is runing a full screen program,here is the code snippet:&#160;
bool IsFullScreenMode()
{
  int w = GetSystemMetrics(SM_CXSCREEN);
  int h = GetSystemMetrics(SM_CYSCREEN); 

  HWND hWnd = 0;
  while (hWnd = FindWindowEx(NULL, hWnd, NULL, NULL))
  {
    if (GetWindowLong(hWnd, GWL_EXSTYLE) &#38; WS_EX_TOPMOST)
 [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I was asked how to detect&nbsp;whether or not user is runing a full screen program,here is the code snippet:&nbsp;</p>
<pre class="prettyprint">bool IsFullScreenMode()
{
  int w = GetSystemMetrics(SM_CXSCREEN);
  int h = GetSystemMetrics(SM_CYSCREEN); 

  HWND hWnd = 0;
  while (hWnd = FindWindowEx(NULL, hWnd, NULL, NULL))
  {
    if (GetWindowLong(hWnd, GWL_EXSTYLE) &amp; WS_EX_TOPMOST)
    {
      RECT rcWindow;
      GetWindowRect(hWnd, &amp;rcWindow);
      if ((w == (rcWindow.right - rcWindow.left)) &amp;&amp;
         (h == (rcWindow.bottom - rcWindow.top)))
           return true;
     }
  }
  return false;
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.deanlee.cn/windows/how-to-detect-whether-or-not-user-is-running-a-full-screen-program/feed/</wfw:commentRss>
		</item>
		<item>
		<title>windows下内存分配方式的性能对比</title>
		<link>http://www.deanlee.cn/windows/alloc_performance/</link>
		<comments>http://www.deanlee.cn/windows/alloc_performance/#comments</comments>
		<pubDate>Tue, 06 Jun 2006 06:40:59 +0000</pubDate>
		<dc:creator>Dean Lee</dc:creator>
		
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://deanlee.cn:8080/index.php/2006/06/06/alloc_performance/</guid>
		<description><![CDATA[今天写了一个小程序测试了一下在windows系统上不同内存分配方式间的性能差异，比较内容:VirtualAlloc,malloc,new,和HeapAlloc。代码很简单，循环分配并释放内存，最后计算每种方法所耗用的时间。
测试结果:
Virtual Memory  total time:125,kernel:125,user:0
new     total time:203,kernel:171,user:31
malloc  total time:125,kernel:125,user:0
heap    total time:125,kernel:109,user:15
Press any key to continue . . .
代码:
#include &#34;stdafx.h&#34;
#include &#34;dlclib.h&#34;
#include
using namespace std;
const int LOOPS = 1000;
void PrintResult&#40;CProfileWatch&#38; watch, LPCSTR pszMethod&#41;
&#123;
cout &#60;&#60; pszMethod &#60;&#60; &#34;t&#34;
&#60;&#60; &#34;total time:&#34; &#60;&#60; watch.GetTotalTimeElapsedMs&#40;&#41;
&#60;&#60; &#34;,kernel:&#34; &#60;&#60; watch.GetKernelTimeElapsedMs&#40;&#41;
&#60;&#60; &#34;,user:&#34; &#60;&#60; watch.GetUserTimeElapsedMs&#40;&#41;
&#60;&#60; &#34;n&#34;;
&#125;
int _tmain&#40;int argc, [...]]]></description>
			<content:encoded><![CDATA[<p>今天写了一个小程序测试了一下在windows系统上不同内存分配方式间的性能差异，比较内容:VirtualAlloc,malloc,new,和HeapAlloc。代码很简单，循环分配并释放内存，最后计算每种方法所耗用的时间。</p>
<p>测试结果:</p>
<p>Virtual Memory  total time:125,kernel:125,user:0<br />
new     total time:203,kernel:171,user:31<br />
malloc  total time:125,kernel:125,user:0<br />
heap    total time:125,kernel:109,user:15<br />
Press any key to continue . . .</p>
<p>代码:</p>
<div class="dean_ch" style="white-space: wrap;"><span class="co2">#include &quot;stdafx.h&quot;</span><br />
<span class="co2">#include &quot;dlclib.h&quot;</span><br />
<span class="co2">#include</span><br />
<span class="kw2">using</span> <span class="kw2">namespace</span> std;<br />
<span class="kw4">const</span> <span class="kw4">int</span> LOOPS = <span class="nu0">1000</span>;</p>
<p><span class="kw4">void</span> PrintResult<span class="br0">&#40;</span>CProfileWatch&amp; watch, LPCSTR pszMethod<span class="br0">&#41;</span><br />
<span class="br0">&#123;</span><br />
<span class="kw3">cout</span> &lt;&lt; pszMethod &lt;&lt; <span class="st0">&quot;t&quot;</span><br />
&lt;&lt; <span class="st0">&quot;total time:&quot;</span> &lt;&lt; watch.<span class="me1">GetTotalTimeElapsedMs</span><span class="br0">&#40;</span><span class="br0">&#41;</span><br />
&lt;&lt; <span class="st0">&quot;,kernel:&quot;</span> &lt;&lt; watch.<span class="me1">GetKernelTimeElapsedMs</span><span class="br0">&#40;</span><span class="br0">&#41;</span><br />
&lt;&lt; <span class="st0">&quot;,user:&quot;</span> &lt;&lt; watch.<span class="me1">GetUserTimeElapsedMs</span><span class="br0">&#40;</span><span class="br0">&#41;</span><br />
&lt;&lt; <span class="st0">&quot;n&quot;</span>;<br />
<span class="br0">&#125;</span><br />
<span class="kw4">int</span> _tmain<span class="br0">&#40;</span><span class="kw4">int</span> argc, _TCHAR* argv<span class="br0">&#91;</span><span class="br0">&#93;</span><span class="br0">&#41;</span><br />
<span class="br0">&#123;</span><br />
SYSTEM_INFO info;<br />
::<span class="me2">GetSystemInfo</span><span class="br0">&#40;</span>&amp;info<span class="br0">&#41;</span>;<br />
DWORD dwPageSize = info.<span class="me1">dwPageSize</span>;<br />
CProfileWatch watch;<br />
DWORD dwSize = MemAlign<span class="br0">&#40;</span><span class="nu0">1024</span> * <span class="nu0">1024</span> * <span class="nu0">10</span>, dwPageSize<span class="br0">&#41;</span>;<br />
watch.<span class="me1">Start</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
<span class="kw1">for</span> <span class="br0">&#40;</span><span class="kw4">int</span> i = <span class="nu0">0</span>; i &lt; LOOPS; ++i<span class="br0">&#41;</span><br />
<span class="br0">&#123;</span><br />
<span class="kw4">void</span>* pMem = ::<span class="me2">VirtualAlloc</span><span class="br0">&#40;</span><span class="kw2">NULL</span>, dwSize, MEM_RESERVE |<br />
MEM_COMMIT | MEM_TOP_DOWN, PAGE_READWRITE<span class="br0">&#41;</span>;<br />
::<span class="me2">VirtualFree</span><span class="br0">&#40;</span>pMem, <span class="nu0">0</span>, MEM_RELEASE<span class="br0">&#41;</span>;<br />
<span class="br0">&#125;</span><br />
watch.<span class="me1">Stop</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
PrintResult<span class="br0">&#40;</span>watch, <span class="st0">&quot;Virtual Memory&quot;</span><span class="br0">&#41;</span>;</p>
<p>watch.<span class="me1">Start</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
<span class="kw1">for</span> <span class="br0">&#40;</span><span class="kw4">int</span> i = <span class="nu0">0</span>; i &lt; LOOPS; ++i<span class="br0">&#41;</span><br />
<span class="br0">&#123;</span><br />
<span class="kw4">void</span>* pMem = <span class="kw3">new</span> <span class="kw4">char</span><span class="br0">&#91;</span>dwSize<span class="br0">&#93;</span>;<br />
<span class="kw3">delete</span> <span class="br0">&#91;</span><span class="br0">&#93;</span>pMem;<br />
<span class="br0">&#125;</span><br />
watch.<span class="me1">Stop</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
PrintResult<span class="br0">&#40;</span>watch, <span class="st0">&quot;new&quot;</span><span class="br0">&#41;</span>;</p>
<p>watch.<span class="me1">Start</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
<span class="kw1">for</span> <span class="br0">&#40;</span><span class="kw4">int</span> i = <span class="nu0">0</span>; i &lt; LOOPS; ++i<span class="br0">&#41;</span><br />
<span class="br0">&#123;</span><br />
<span class="kw4">void</span>* pMem = <span class="kw3">malloc</span><span class="br0">&#40;</span>dwSize<span class="br0">&#41;</span>;<br />
<span class="kw3">free</span><span class="br0">&#40;</span>pMem<span class="br0">&#41;</span>;<br />
<span class="br0">&#125;</span><br />
watch.<span class="me1">Stop</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
PrintResult<span class="br0">&#40;</span>watch, <span class="st0">&quot;malloc&quot;</span><span class="br0">&#41;</span>;<br />
HANDLE hHeap = ::<span class="me2">HeapCreate</span><span class="br0">&#40;</span>HEAP_NO_SERIALIZE, <span class="nu0">0</span>, <span class="nu0">0</span><span class="br0">&#41;</span>;<br />
watch.<span class="me1">Start</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
<span class="kw1">for</span> <span class="br0">&#40;</span><span class="kw4">int</span> i = <span class="nu0">0</span>; i &lt; LOOPS; ++i<span class="br0">&#41;</span><br />
<span class="br0">&#123;</span><br />
<span class="kw4">void</span>* pMem = ::<span class="me2">HeapAlloc</span><span class="br0">&#40;</span>hHeap, HEAP_NO_SERIALIZE, dwSize<span class="br0">&#41;</span>;<br />
::<span class="me2">HeapFree</span><span class="br0">&#40;</span>hHeap, HEAP_NO_SERIALIZE, pMem<span class="br0">&#41;</span>;<br />
<span class="br0">&#125;</span><br />
watch.<span class="me1">Stop</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
PrintResult<span class="br0">&#40;</span>watch, <span class="st0">&quot;heap&quot;</span><span class="br0">&#41;</span>;<br />
::<span class="me2">HeapDestroy</span><span class="br0">&#40;</span>hHeap<span class="br0">&#41;</span>;<br />
<span class="kw1">return</span> <span class="nu0">0</span>;</p>
<p><span class="br0">&#125;</span></div>
]]></content:encoded>
			<wfw:commentRss>http://www.deanlee.cn/windows/alloc_performance/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>

