Archive for the 'Windows' Category


inffas32.asm: error A2070: invalid instruction operands

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 memory operand with an implied size, and requires that "dword ptr" prefix the memory operand.

to fix these problems,simply addingDWORD PTR’ before the operands:

movd mm5,dword ptr [esp+4](649)
movd mm7,dword ptr [esi](663)
movd mm7,dword ptr [esi](720)

April 30th, 2009 in Programming, Windows | No comments yet


Windows Live Space says:"Server is too busy"

What the hell is going on?Too many users or bad design?I would rather believe it’s the first case. because there are ton of amazing articles written by Microsoft about Scalability and Availability,such as “Scalability, Sweet Scalability” or “Improving Both Availability and Scalability“. they can\’t possibly have made an incredibly dumb mistake.

August 31st, 2007 in Windows | 12 comments


Compiler warning C4022 when building OpenSSL 0.9.8e On Windows

I got the following compiler error when building OpenSSL-0.9.8e in Windows environments with Visual studio 2005:

.\apps\enc.c(380) : error C2220: warning treated as error - no ‘object’ file generated
.\apps\enc.c(380) : warning C4022: ‘BIO_ctrl’ : pointer mismatch for actual parameter 4

August 25th, 2007 in Programming, Windows | 3 comments


How to detect whether or not user is running a full-screen program

Recently I was asked how to detect whether or not user is runing a full screen program,here is the code snippet: 

April 20th, 2007 in Programming, Windows | 7 comments


windows下内存分配方式的性能对比

今天写了一个小程序测试了一下在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 . . .

代码:

June 6th, 2006 in Windows | 2 comments