延长Windows服务停止的时间
Extend the time the Windows service is stopped
我需要服务才能停止足够长的时间。大约5-10分钟。现在,在Windows 10上,我的服务系统在60秒后杀死,而无需等待正确完成。使用NET函数requestAdditionaltime看到了C#的类似问题。但是我需要在API上实现C 。
设置注册表中的密钥值不会影响hkey_local_machine system CurrentControlset Control WaittokillService设置为300000
您不应该弄乱全局注册表设置。
停止服务时,请使用SERVICE_STOP_PENDING
调用SetServiceStatus
,并将dwCheckPoint
和dwWaitHint
设置为适当的值。根据dwWaitHint
的文档多次致电ServServiceStatus
,直到完成并停止服务(SetServiceStatus(h, SERVICE_STOPPED, ...)
)。
相关文章:
- Google protobuf 时间戳未声明标识符,在 Windows 上具有C++
- 0xc000007b Windows 上的 OpenCL 库的加载时间错误
- 如何在 Windows 上的 C++ 中根据文件的修改时间读取目录中的文件
- 测量任何 Windows 可执行文件的内存使用情况和执行时间
- 如何在跨平台C++中以毫秒为单位获得系统启动/启动时间(它应该在Windows / IOS / Android / MA
- 延长Windows服务停止的时间
- 从1970年1月1日起,C 设置了MS的Windows时间
- 用C++设置windows系统时间
- 如何检查用户登录到Windows的时间
- Windows UTC时间夏令时是否独立
- Windows Batch - 如何在将标准输出重定向到文件时添加时间戳
- 测量Windows平台上本机C++的运行时间(秒)
- 在Windows上使用GCC的链接时间优化构建wxWidgets DLL时出错
- 使用SNTP(Windows C )从服务器获取时间/日期
- 在没有Chrono的Windows上使用C ,在纳秒中获得时间
- 有没有办法在Windows上测量时间到微秒的精度
- Windows 7 VS 2010 的时间规范转换
- 在 Windows 上以C++计算 CPU 时间
- 为srand()提供Windows的时间函数
- 以非管理员身份在 Windows 上的 C 中检查上次文件修改时间