[ 转载 ] kernel32.BaseThreadInitThunk
2015-08-23 16:21
2181 查看
Edited by wap2k, 20 October 2014 - 07:52 PM.
This function is called to start a Win32 thread. Its purpose is to call the thread start address.
If the thread returns it will terminate the thread and delete it's stack.
Arguments:
DWORD LdrReserved - Should always be 0 for user threads
LPTHREAD_START_ROUTINE lpStartAddress - Supplies the starting address of the new thread. The address is a function that never returns and that accepts a single DWORD pointer argument.
LPVOID lpParameter - Supplies a single parameter value passed to the thread.
Return value is nothing.
Before Vista:
After Vista similar to this:
VOID BaseThreadInitThunk(DWORD LdrReserved, LPTHREAD_START_ROUTINE lpStartAddress, LPVOID lpParameter)
{
int tUserThread;
if ( !LdrReserved )
{
tUserThread = (lpStartAddress)(lpParameter);
RtlExitUserThread(tUserThread);
}
if(Flag_v7FFE02D0 & 0x10) BasepInitializeTermsrvFpns();
}
[/code]
This function is called to start a Win32 thread. Its purpose is to call the thread start address.
If the thread returns it will terminate the thread and delete it's stack.
Arguments:
DWORD LdrReserved - Should always be 0 for user threads
LPTHREAD_START_ROUTINE lpStartAddress - Supplies the starting address of the new thread. The address is a function that never returns and that accepts a single DWORD pointer argument.
LPVOID lpParameter - Supplies a single parameter value passed to the thread.
Return value is nothing.
Before Vista:
VOID BaseThreadInitThunk(IN DWORD LdrReserved, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter)]VOID BaseThreadStart( IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter ){ try { // // test for fiber start or new thread // if ( NtCurrentTeb()->NtTib.Version == OS2_VERSION ) { if ( !BaseRunningInServerProcess ) { CsrNewThread(); } } ExitThread((lpStartAddress)(lpParameter)); } except(UnhandledExceptionFilter( GetExceptionInformation() )) { if ( !BaseRunningInServerProcess ) { ExitProcess(GetExceptionCode()); } else { ExitThread(GetExceptionCode()); } } }
After Vista similar to this:
VOID BaseThreadInitThunk(DWORD LdrReserved, LPTHREAD_START_ROUTINE lpStartAddress, LPVOID lpParameter)
{
int tUserThread;
if ( !LdrReserved )
{
tUserThread = (lpStartAddress)(lpParameter);
RtlExitUserThread(tUserThread);
}
if(Flag_v7FFE02D0 & 0x10) BasepInitializeTermsrvFpns();
}
[/code]
相关文章推荐
- Contains Duplicate III
- Sql 表查询 1-5
- Mongoose 一些查询方法
- overfitting(过度拟合)的概念
- js笔试题
- NSAttributedString
- Sql 表查询 1-5
- L脚本语言的数组
- JAVA 集合的使用
- [思路题] cf 571A Lengthening Sticks
- 再识Cortex-M3之概述
- xampp安装完成后mysql无法启动
- 进程间关系:进程、僵尸进程、孤儿进程、进程组、前台进程组、后台进程组、孤儿进程组、会话、控制终端
- 【黑马程序员】ARC机制介绍及使用
- elasticsearch的研究与使用(四)Query
- 高级语言反汇编程序的函数调用过程
- SqlHelper
- LeetCode 06 ZigZag Conversion
- UNIX环境高级编程之第7章:进程环境
- 二分图最大匹配值的模板