以前一直对线程的创建、运行过程不清楚,现在看了Windows核心编程的讲解之后总算是比较清楚了,现在就将我看的知识点总结一下。先介绍一下线程的创建函数CreateThread,函数原型如下(摘至MSDN的说明,加上了一些简单的字面翻译):
HANDLE CreateThread (
SEC_ATTRSSecurityAttributes,
ULONGStackSize,
SEC_THREAD_STARTStartFunction,
PVOIDThreadParameter,
ULONGCreationFlags,
PULONGThreadId
);
Parameters
-
[in] Pointer to a SEC_ATTRS structure that determines whether the returned handle can be inherited by child processes.
-
指向一个 SEC_ATTRS 结构
SecurityAttributes