- 1、本文档共29页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
Windows进程和进程间通信 操作系统教材.ppt
Windows进程 Win32操作系统平台提供了强大的多任务功能,其中 “进程”(Process)和“线程”(Thread)是其控制多任务的两个重要概念 进程有独自的内存空间、程序代码、信息以及一堆大大小小的系统资源 Windows 中的每个Win32进程都由一个执行体进程块(executive process block)表示,执行体进程块描述进程的基本信息,并指向其他与进程控制相关的数据结构 Windows 的进程 进程属性:PID, PCB, Access Token, Base Priority, 句柄表,指向进程环境块PEB指针,默认和处理器集合等 在Windows 中,PCB也称为内核进程对象KPROCESS 执行体进程对象EPROCESS EPOCESS和KPROCESS位于内核空间,PEB位于用户空间 kernel process (KPROCESS) block process environment block(PEB) 创建子进程API函数 创建进程函数,CreateProcess函数,其原型为: BOOL CreateProcess( LPCTSTR lpApplicationName, LPTSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCTSTR lpCurrentDirectory, LPSTARTURINFO lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation ); 结束process 如果某个process想停止执行, 可调用ExitProcess(), 不过我们通常不直接调用它, 而是调用C程序库中的exit(), exit()在自动执行一些清除垃圾的工作之后, 再调用ExitProcess()。 VOID ExitProcess(UNT uExitCode); 如果process A 想要迫使process B 停止执行, 可以在取得process B 的handle 之后, 调用TerminateProcess(): BOOL TerminateProcess(HANDLE hProcess, UNIT uExitCode); 与进程相关的API函数 Function Description CreateProcess Creates a new process and thread using the callers security identification CreateProcessAsUser Creates a new process and thread with the specified alternate security token CreateProcessWithLogonW Creates a new process and thread to run under the credentials of the specified username and password CreateProcessWithTokenW Creates a new process and thread with the specified alternate security token, with additional options such as allowing the user profile to be loaded OpenProcess Returns a handle to the specified process object ExitProcess Ends a process, and notifies all attached DLLs TerminateProcess Ends a process without notifying the DLLs FlushInstructionCache Empties the specified processs instruction cache GetProcessTimes Obtains a processs timing information, describing how much time the process has
您可能关注的文档
- VisualBasic.Net程序设计课件第19讲 常用控件与 及界面设计.ppt
- VisualBasic.Net程序设计课件第20讲 综合设计与 及实践.ppt
- visualization的秘密(关于自我思考的作用)教材.ppt
- VITA 玻璃渗透全瓷知识介绍.ppt
- vitd缺乏性佝偻病 教材课程.ppt
- vocabulary for unit5 active reading1东南大学四级英语教材.ppt
- vofr4 技能评估体系教材.ppt
- volume 1 - unit 1 大学英语基础教程1教材.ppt
- volume 1 - unit 2 大学英语基础教程1教材.ppt
- volume 1 - unit 3 大学英语基础教程1教材.ppt
- 澜起科技(688008)公司2024年财务分析研究报告.doc
- 锦江在线(600650)公司2024年财务分析研究报告.doc
- 经纬恒润(688326)公司2024年财务分析研究报告.doc
- 康冠科技(001308)公司2024年财务分析研究报告.doc
- 乐鑫科技(688018)公司2024年财务分析研究报告.doc
- 康德莱(603987)公司2024年财务分析研究报告.doc
- 京新药业(002020)公司2024年财务分析研究报告.doc
- 建新股份(300107)公司2024年财务分析研究报告.doc
- 健盛集团(603558)公司2024年财务分析研究报告.doc
- 江苏神通(002438)公司2024年财务分析研究报告.doc
文档评论(0)