10 2013 档案
转:C函数调用理解
摘要:1 空函数 int main() { 00411360 push ebp ;压入ebp 00411361 mov ebp,esp ;ebp = esp,保留esp,待函数调用完再恢复,因为函数调用中肯定会用到esp. 00411363 sub esp,0C0h ;esp-=0C0h(192);为该函数留出临时存储区 ;将其他指针或寄存器中... 阅读全文
posted @ 2013-10-31 16:14 qinfengxiaoyue 阅读(599) 评论(0) 推荐(0)
WinDbg:栈帧的含义
摘要:转自:http://www.cppblog.com/weiym/archive/2012/06/07/177958.html 栈从高地址向低地址生长, __stcall和__cdecl调用约定都是函数参数从右到左入栈。 某函数,比如: int add(int a, int b) { return a + b;} 在我们调用 add(1, 2)时: 从栈高地址到低地址入栈,依... 阅读全文
posted @ 2013-10-31 16:07 qinfengxiaoyue 阅读(711) 评论(0) 推荐(0)
C/C++:函数的调用约定(Calling Convention)和名称修饰(Decorated Name)以及两者不匹配引起的问题
摘要:转自:http://blog.csdn.net/zskof/article/details/3475182 注:C++有着与C不同的名称修饰,主要是为了解决重载(overload);调用约定则影响函数参数的入栈顺序和清栈主体;而名称修饰也因调用约定而不同。 调用函数的主体和被调用函数的主体,可能会有不同的调用约定和名称修饰,两者的不匹配会引发问题。 使用C/C++语言开发软件的程序员... 阅读全文
posted @ 2013-10-30 20:09 qinfengxiaoyue 阅读(1195) 评论(0) 推荐(0)
vector/list/set/map 遍历耗时统计
摘要:#include#include #include#include#include#include#include #include using namespace std;#define NUM1 10 //外层循环10次#define NUM2 100000000 //对于int、dword的1亿次i++和++i#define NUM3 100000//对与包含10万个元素容器的iter++... 阅读全文
posted @ 2013-10-29 19:53 qinfengxiaoyue 阅读(1376) 评论(0) 推荐(0)
Windows 线程消息队列和GetMessage实现内幕
摘要:注:转自http://blog.csdn.net/FreeWave/article/details/2056469?reload。 清晰地讲解了Windows线程的消息队列和GetMessage内幕。好文。 也许题目有些夸张,但是Windows消息方面确实存在一些不去探究就摸不着头脑的事情,这种问题不是明显错误,不会抛出异常,但却是最棘手的问题,给调试带来很大麻... 阅读全文
posted @ 2013-10-23 00:10 qinfengxiaoyue 阅读(5132) 评论(0) 推荐(0)
Windows 消息框架: SDK教程
摘要:关键字:WindowsSDK 消息机制 http://www.codeproject.com/Articles/599/Windows-Message-Handling-Part-3 Handling Messages in SDK applications Windows Classes and Window Procedures DefWindowProc Sending Messa... 阅读全文
posted @ 2013-10-22 23:32 qinfengxiaoyue 阅读(403) 评论(0) 推荐(0)
Win SDK 标准程序
摘要://-Registering window class.//-Creating window.//-Creating message loop.//-Implement WndProc function that handles incoming messages.#include LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM) ;int... 阅读全文
posted @ 2013-10-20 22:52 qinfengxiaoyue 阅读(349) 评论(0) 推荐(0)