windows xp 服务什么时候开始? [英] When do windows xp services get started?

查看:28
本文介绍了windows xp 服务什么时候开始?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当机器重新启动时,是否在用户登录之前运行在帐户(系统/服务/网络服务)下运行的所有服务?

When a machine reboots, do all the services which are run under the accounts (system/service/network service) get run before a user logs on?

京东.

推荐答案

服务具有为每个服务定义的启动类型",这些类型是 boot、system、auto、 demand、disabled. 服务还相互依赖,在注册表中定义.

Services have a "start type" defined per-service, those types are boot, system, auto, demand, disabled. Services also have dependencies on each other, defined in the registry.

具有bootsystem 启动类型的服务在只有NT Native 二进制文件可以运行的时间段内启动(Win32 API 尚未准备好).例如,这些服务包括提供一些 Win32 API 的 csrss.exe.

Services with boot and system start type are started during the time period when only NT Native binaries can run (the Win32 API is not yet ready). For example, these services include such as csrss.exe which provides some of the Win32 API.

Win32 初始化后,启动类型为 automatic 的服务将启动.在此期间,允许用户登录的服务运行 -- 这会显示登录提示并允许用户登录.

Once Win32 has been initialized, the services with start type automatic are started. During this time, the service which allows the user to log in runs -- this displays the login prompt and does allow the user to log in.

在任何情况下,如果正在启动的服务依赖于其他服务,那么其他服务将提前启动.

In every case, if the service being start depends on other services, then the other services will be started in advance.

所以,是的,用户可以在执行服务之前登录.但是,如果登录服务依赖于您的服务...不过,如果您检测到您的服务已启动,那就更好了.考虑使用带有 CreateEvent() api 的命名全局事件.您的服务创建事件,您的应用程序在调用服务之前等待事件.此外,您的应用只能在使用时使用 ServiceControl API 来启动服务.

So, yes, it is possible for users to log in prior to the execution of a service. However, if the login service were to depend on your service... Better, though, if you detect that your service has started. Considering using a named global event with CreateEvent() api. Your service creates the event, your application awaits the event before calling the service. Also, your app can use the ServiceControl API to start the service only when in use.

windowsServices.msc"管理插件隐藏了bootsystem服务.要了解有关这些启动类型的更多信息,请参阅此 API 文档:MSDN:更改服务配置函数.

The windows "Services.msc" management plug-in hides the boot and system services. To learn more about these startup types, refer to this API documentation: MSDN: ChangeServiceConfig Function .

这篇关于windows xp 服务什么时候开始?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆