网站首页  词典首页

请输入您要查询的函数:

 

术语 rmshutdown
释义 RmShutdown
语法:
C++
DWORD WINAPI RmShutdown(
__in DWORD dwSessionHandle,
__in ULONG lActionFlags,
__in_opt RM_WRITE_STATUS_CALLBACK fnStatus
);
RmShutdown功能
启动关闭的应用程序。此功能只能称为从安装程序开始重新启动管理器会话使用的RmStartSession功能。
参数
dwSessionHandle [in]
句柄到现有的重新启动管理会议。
lActionFlags [in]
一个或多个RM_SHUTDOWN_TYPE选项配置关闭的组成部分。下面的值可以组合由一个或运算符,指明响应的应用程序和服务被迫关闭,当且仅当所有的申请已被重新注册。
ValueMeaning
RmForceShutdown
0x1Force响应的应用程序和服务关闭后,超时时间。应用程序不响应关机请求而被迫关闭了30秒之内。一个服务不响应关机请求后被迫关闭了20秒。
RmShutdownOnlyRegistered
下应用0x10Shut当且仅当所有的申请已重新登记使用RegisterApplicationRestart功能。如果任何程序或服务无法重新启动,那么任何程序或服务被关闭。
fnStatus [中,可选]
对一个RM_WRITE_STATUS_CALLBACK函数,用于通信的详细情况,而这一功能是执行指针。如果为NULL,没有地位提供。
返回值
这是最近收到的错误。该函数可以返回的系统错误在Winerror.h中定义的代码之一。
ValueMeaning
ERROR_SUCCESS
0All关机,重新启动和回调操作成功完成。
ERROR_FAIL_NOACTION_REBOOT
350No关闭行动执行。一个或多个程序或服务需要重新启动该系统被关闭。此错误代码返回时,重新启动管理器检测到的系统重新启动之前关闭所有应用程序所需的。
ERROR_FAIL_SHUTDOWN
351Some应用程序不能被关闭。在RM_PROCESS_INFO结构的RmGetList函数返回的AppStatus包含更新的状态信息。
ERROR_CANCELLED
1223This错误值是由RmShutdown函数返回时,要求取消一项行动是成功的。
ERROR_SEM_TIMEOUT
121A条重新启动管理器的功能无法得到一个注册表写在规定的时间互斥。重新启动系统的建议,因为重新启动管理器进一步使用很可能会失败。
ERROR_BAD_ARGUMENTS
160One或多个参数不正确。此错误值返回的重新启动管理器的功能,如果一个NULL指针或0是一个参数,需要一个非空和非零值传递。
ERROR_WRITE_FAULT
29An行动是无法读取或写入注册表。
ERROR_OUTOFMEMORY
第14A条重新启动管理器操作无法完成,因为没有足够的内存可用。
出现ERROR_INVALID_HANDLE
6No存在重新启动管理会议提供的句柄。
备注
该RmShutdown函数调用RmGetList和更新过程的名单目前使用的注册资金,然后再尝试关闭任何进程。该RmShutdown函数然后尝试关闭过程中使用的最新名单上登记的资源。该RmShutdown功能更新了RM_PROCESS_INFO是由RmGetList函数返回的详细状态信息结构AppStatus成员。
重新启动管理方面的权限分开不同的用户或终端会话。一个安装程序,作为使用LocalSystem权限运行的服务无法关闭或重新启动另一个用户或终端会话的任何申请。安装人员应实现自定义的方法来关闭并重新启动应用程序,在其他会议上运行。一种方法是将开始在其他会议来执行关机并重新启动一个新的安装程序操作的过程。
安装人员应经常重新启动应用程序和服务使用RmRestart函数即使RmShutdown函数返回一个错误,指出并不是所有的应用程序和服务可以被关闭。
要求:
client最低支持Vista
server最低支持 Windows Server 2008
HeaderRestartManager.h
LibraryRstrtmgr.lib
DLLRstrtmgr.dll
参见
RegisterApplicationRestart
RmCancelCurrentTask
RmRestart
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年7月30日
==英文原文==RmShutdown Function
Initiates the shutdown of applications. This function can only be called from the installer that started the Restart Manager session using the RmStartSession function.
Syntax
C++
DWORD WINAPI RmShutdown(
__in DWORD dwSessionHandle,
__in ULONG lActionFlags,
__in_opt RM_WRITE_STATUS_CALLBACK fnStatus
);
Parameters
dwSessionHandle [in]
A handle to an existing Restart Manager session.
lActionFlags [in]
One or more RM_SHUTDOWN_TYPE options that configure the shut down of components. The following values can be combined by an OR operator to specify that unresponsive applications and services are to be forced to shut down if, and only if, all applications have been registered for restart.
ValueMeaning
RmForceShutdown
0x1Force unresponsive applications and services to shut down after the timeout period. An application that does not respond to a shutdown request is forced to shut down within 30 seconds. A service that does not respond to a shutdown request is forced to shut down after 20 seconds.
RmShutdownOnlyRegistered
0x10Shut down applications if and only if all the applications have been registered for restart using the RegisterApplicationRestart function. If any processes or services cannot be restarted, then no processes or services are shut down.

fnStatus [in, optional]
A pointer to an RM_WRITE_STATUS_CALLBACK function that is used to communicate detailed status while this function is executing. If NULL, no status is provided.
Return Value
This is the most recent error received. The function can return one of the system error codes that are defined in Winerror.h.
ValueMeaning
ERROR_SUCCESS
0All shutdown, restart, and callback operations were successfully completed.
ERROR_FAIL_NOACTION_REBOOT
350No shutdown actions were performed. One or more processes or services require a restart of the system to be shut down. This error code is returned when the Restart Manager detects that a restart of the system is required before shutting down any application.
ERROR_FAIL_SHUTDOWN
351Some applications could not be shut down. The AppStatus of the RM_PROCESS_INFO structures returned by the RmGetList function contain updated status information.
ERROR_CANCELLED
1223This error value is returned by the RmShutdown function when the request to cancel an operation is successful.
ERROR_SEM_TIMEOUT
121A Restart Manager function could not obtain a Registry write mutex in the allotted time. A system restart is recommended because further use of the Restart Manager is likely to fail.
ERROR_BAD_ARGUMENTS
160One or more arguments are not correct. This error value is returned by the Restart Manager function if a NULL pointer or 0 is passed in a parameter that requires a non-null and non-zero value.
ERROR_WRITE_FAULT
29An operation was unable to read or write to the registry.
ERROR_OUTOFMEMORY
14A Restart Manager operation could not be completed because not enough memory is available.
ERROR_INVALID_HANDLE
6No Restart Manager session exists for the handle supplied.

Remarks
The RmShutdown function calls RmGetList and updates the list of processes currently using registered resources before attempting to shut down any processes. The RmShutdown function then attempts to shut down the processes using registered resources in the most current list. The RmShutdown function updates the AppStatus member of the RM_PROCESS_INFO structures that are returned by the RmGetList function with detailed status information.
The Restart Manager respects the privileges that separate different user or terminal sessions. An installer that is running as a service with LocalSystem privileges cannot shut down or restart any applications in another user or terminal session. Installers should implement custom methods to shut down and restart applications that are running in other sessions. One method would be to start a new installer process in the other session to perform shutdown and restart operations.
Installers should always restart application and services using the RmRestart function even when the RmShutdown function returns an error indicating that not all applications and services could be shut down.
Requirements
Minimum supported clientWindows Vista
Minimum supported serverWindows Server 2008
HeaderRestartManager.h
LibraryRstrtmgr.lib
DLLRstrtmgr.dll
See Also
RegisterApplicationRestart
RmCancelCurrentTask
RmRestart
Send comments about this topic to Microsoft
Build date: 7/30/2009
==原始网址==http://msdn.microsoft.com/en-us/library/aa373667(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 11:28:02