TerminateProcess Function

 Terminatesthespecifiedprocessandallofitsthreads. BOOLWINAPITerminateProcess(__inHANDLEhProcess,__inUINTuExitCode);ParametershProcessAhand

大家好,又见面了,我是你们的朋友全栈君。

 

Terminates the specified process and all of its threads.

 

BOOL WINAPI TerminateProcess(
  __in          HANDLE hProcess,
  __in          UINT uExitCode
);

Parameters

hProcess

A handle to the process to be terminated.

The handle must have the PROCESS_TERMINATE access right. For more information, see Process Security and Access Rights.

uExitCode

The exit code to be used by the process and threads terminated as a result of this call. Use the GetExitCodeProcess function to retrieve a process’s exit value. Use the GetExitCodeThread function to retrieve a thread’s exit value.

Return Value

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastError .

Remarks

The TerminateProcess function is used to unconditionally cause a process to exit. The state of global data maintained by dynamic-link libraries (DLLs) may be compromised if TerminateProcess is used rather than ExitProcess.

TerminateProcess initiates termination and returns immediately. This stops execution of all threads within the process and requests cancellation of all pending I/O. The terminated process cannot exit until all pending I/O has been completed or canceled.

A process cannot prevent itself from being terminated.

Requirements

Client

Requires Windows Vista, Windows XP, Windows 2000 Professional, Windows NT Workstation, Windows Me, Windows 98, or Windows 95.

Server

Requires Windows Server 2008, Windows Server 2003, Windows 2000 Server, or Windows NT Server.

Header

Declared in Winbase.h; include Windows.h.

Library

Use Kernel32.lib.

DLL

Requires Kernel32.dll.

 

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/126199.html原文链接:https://javaforall.net

(0)
上一篇 2022年4月7日 上午7:00
下一篇 2022年4月7日 上午7:00


相关推荐

  • 医疗器械进销存软件管理系统_简单仓库管理系统

    医疗器械进销存软件管理系统_简单仓库管理系统开发环境:Eclipse/MyEclipse、Tomcat8、Jdk1.8数据库:MySQL适用于:课程设计,毕业设计,学习等等系统介绍有偿

    2025年9月2日
    8
  • es集群搭建_k8s和docker搭建es集群

    es集群搭建_k8s和docker搭建es集群单机的elasticsearch做数据存储,必然面临两个问题:海量数据存储问题、单点故障问题。ES集群搭建_使用docker-海量数据存储问题:将索引库从逻辑上拆分为N个分片(shard),存储到多个节点-单点故障问题:将分片数据在不同节点备份(replica)ES集群介绍为什么需要集群ES集群相关概念搭建ES集群集群职责划分集群脑裂问题…

    2022年10月12日
    7
  • cmd命令打开及切换目录路径

    cmd命令打开及切换目录路径cmd 命令打开及切换目录路径 一 CMD 命令打开 说两种方法获取 cmd 命令 还有 N 种方法 下次说 1 电脑左下角搜索 cmd 出来命令提示符 2 或快捷键 Win R win 键在键盘左下角 ctrl 和 alt 中间是个图标 二 CMD 命令下切换路径 步骤 1 首先打开 CMD 之后 发现默认是在 C Users 我的路径这个文件夹 步骤 2 如下图 在这里输入 D 然后

    2026年3月17日
    2
  • 线程锁EnterCriticalSection和LeaveCriticalSection的用法

    线程锁EnterCriticalSection和LeaveCriticalSection的用法线程锁的概念函数EnterCriticalSection和LeaveCriticalSection的用法注:使用结构CRITICAL_SECTION需加入头文件#include“afxmt.h”定义一个全局的锁CRITICAL_SECTION的实例  和一个静态全局变量CRITICAL_SECTIONcs;//可以理解为锁定一个资源staticintn_AddVal

    2025年12月6日
    3
  • SQL LIKE的用法

    SQL LIKE的用法LIKE 是另一个在 WHERE 子句中会用到的指令。基本上,LIKE 能让我们依据一个套式(pattern)来找出我们要的资料。相对来说,在运用 IN 的时候,我们完全地知道我们需要的条件;在运用 BETWEEN 的时候,我们则是列出一个范围。 LIKE 的语法如下:SELECT”栏位名” FROM”表格名” WHERE”栏位名”LIKE{套式}{套式}经

    2022年7月26日
    9
  • 什么是算法

    什么是算法什么是算法 1 什么是算法算法 algorithm 就是定义良好的计算过程 他取一个或一组的值为输入 并产生出一个或一组值作为输出 简单来说算法就是一系列的计算步骤 用来将输入数据转化成输出结果 mark 我们可以把所有的算法想象为一本 菜谱 特定的算法比如菜谱中的的一道 老醋花生米 的制作流程 只要按照菜谱的要求制作老醋花生米 那么谁都可以做出一道好吃的老醋花生米 so 这个做

    2026年3月19日
    3

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号