遍历文件
来源:互联网 发布:淘宝怎么找冰毒 编辑:程序博客网 时间:2024/06/05 07:38
看到《windows核心编程》里说C/C++程序实际上都是由运行时库中的Startup系列函数(mainCRTStartup,wmainCRTStartup, WinMainCRTStartup,wWinMainCRTStartup)来执行一系列初始化后,再调用程序员写的代码中的main、wmain、WinMain或wWinMain,于是很想看看mainCRTStartup的定义,书上说是在crt0.c里,可是明明没有嘛。书是在windows2000下写的,可能现在的微软C/C++运行时库已经变化很多了。
把crt0.c的几个包含文件都看了下,还是没找到,看来还是得遍历C:\Program Files\Microsoft Visual Studio 9.0\VC\crt\src里面的源码文件来找才行,于是写了一个Python脚本,还挺快的。
import os
def find_file_text(root_dir,target_text):
find_file_text(r'C:\Program Files\Microsoft Visual Studio 9.0\VC\crt\src','mainCRTStartup')
终于找到了,原来mainCRTStartup和wmainCRTStartup都是调用的__tmainCRTStartup,在C:\Program Files\Microsoft Visual Studio 9.0\VC\crt\src\crtexe.c中
#ifdef _WINMAIN_
#ifdef WPRFLAG
int wWinMainCRTStartup(
#else
int WinMainCRTStartup(
#endif
#else
#ifdef WPRFLAG
int wmainCRTStartup(
#else
int mainCRTStartup(
#endif
#endif
{
}
__declspec(noinline)
int
__tmainCRTStartup(
{
#ifdef _WINMAIN_
#endif
#ifndef _SYSCRT
#else
#endif
#pragma warning(push)
#pragma warning(disable:4312)
#pragma warning(pop)
#ifdef _WINMAIN_
#ifdef WPRFLAG
#else
#endif
#ifdef _MBCS
#endif
#ifdef WPRFLAG
#else
#endif
#else
#ifdef WPRFLAG
#else
#endif
#endif
}
看的头疼,明天再看了。
- 遍历文件
- 遍历文件
- 文件遍历
- 遍历文件
- 遍历文件
- 遍历文件
- 遍历文件
- 遍历文件
- 遍历文件
- 遍历文件
- 遍历文件
- 文件遍历
- 文件遍历
- 文件遍历
- 文件遍历
- 遍历文件
- 遍历文件
- 遍历文件
- NSString NSMutableString 小总结
- from表单验证的jQuery Validation Plugin的参考文章
- [水]ZOJ1203
- mymuymyumrfy
- 类对象和类指针的区别
- 遍历文件
- 差分约束系统--详讲
- LCA的tarjan算法理解
- 2.给定一个图片文件名,判断字符串中是否以“png”结尾,如果是就替换成“jpg”,如果不是,就拼接”.jpg”。
- Eclipse、MyEclipse常用快捷键
- 从内存管理、内存泄漏、内存回收探讨C++内存管理
- 7.22相同类的不同对象执行相同成员函数输出不同结果
- 规范的规范的鬼地方高
- Oracle笔记之 命令