网站大量收购独家精品文档,联系QQ:2885784924

Windows进程和进程间通信 操作系统教材.ppt

  1. 1、本文档共29页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 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

文档评论(0)

yuzongxu123 + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档