vista vista Vista Services

导读:爱华网网友为您分享以下“Vista Services”的资讯,希望对您有所帮助,感谢您对aIhUaU.com的支持!

? There is no specific time guarantee for when a delayed auto-start service starts. If

a client application attempts to use a delayed auto-start service before it has

been started, the attempt fails. Clients that depend on delayed auto-start

services must handle the failure gracefully and either retry the attempt later or call StartService to demand-start the service. If such failures happen frequently, the service is probably not a good candidate for delayed auto-start.

? Delayed auto-start services cannot belong to a load-order group. They can belong

to a stand-alone group.

How to Designate a Service as Delayed Auto-Start

To create a delayed auto-start service, set the delayed auto-start flag. The flag can be set for any start type, but takes effect only for auto-start services. If it is set for an auto-start service, startup is delayed until the boot sequence has finished. With the other start types, the flag is simply ignored.

To set the delayed auto-start flag programmatically, call ChangeServiceConfig2 with the following parameter values. The change takes effect the next time the system is booted:

? Set the dwInfoLevel parameter to

SERVICE_CONFIG_DELAYED_AUTO_START_INFO.

? Set the lpInfo buffer to point to a SERVICE_DELAYED_AUTO_START_INFO

structure. This structure contains a single BOOL member that sets or clears the delayed auto-start flag.

The delayed auto-start flag can be modified only by callers with the

SERVICE_CHANGE_CONFIG access right. By default, only local administrators, power users, and server operators on a domain controller receive this right remotely.

Services and interactive users can obtain the SERVICE_CHANGE_CONFIG access right locally.

For information about service startup features in Windows 7, see “Developing Efficient Background Processes for Windows” on the WHDC Web site.

Service State Change Notifications

In Windows versions earlier than Windows Vista, the only way for a client to

determine whether a service had changed its status or been created or deleted was to use the service query API—such as the QueryServiceStatusEx function—and poll the status of the service. This was not the best approach because these polling loops reduced system performance. In addition, polling loops have historically been a significant source of bugs.

Windows Vista introduced a new function, NotifyServiceStatusChange, which allows the SCM to notify a client when a specified service is created, is deleted, or changes its status.

How to Have a Client Notified When a Service's State Changes

To register for state change notifications, a client calls NotifyServiceStatusChange to specify the service and change for which it requires notification. The client also provides the SCM with a pointer to a callback function. When the specified change occurs, the SCM calls the callback function to notify the client.

The following list contains several notes on the use of NotifyServiceStatusChange. For more information, see the function's reference page on MSDN.

? NotifyServiceStatusChange can be used by local or remote clients.

? The callback function is called only once. If the client wants a subsequent

notification for this change, the client must call NotifyServiceStatusChange again and reregister the callback function.

? The callback function is normally called after a transition to the specified state

has occurred. There is an exception to this rule for the first time that the caller invokes NotifyServiceStatusChange. In that case, if the service is already in the specified state, SCM calls the callback function.

? Clients can cancel the notification by calling CloseServiceHandle to close the

service handle.

? Clients should not exit the thread that they used to call

NotifyServiceStatusChange unless the callback function has been called or they have canceled the notification. Otherwise, they will create a memory leak.

? If one or more services hold open handles to a service, the service is not deleted

until the next time the system is booted. If this is the case, no delete notification is sent.

Note: A caller must have the SERVICE_QUERY_STATUS access right to call

NotifyServiceStatusChange. By default, only administrators, power users, and server operators on a domain controller can obtain this right remotely. Services and

interactive users can obtain this right locally.

Other Enhancements

vista vista Vista Services

Windows Vista and later Windows versions include several other services

enhancements, most of which improve reliability or ease of administration.

Preshutdown Notifications and Shutdown Ordering

In versions of Windows earlier than Windows Vista, service shutdown starts when the system notifies the SCM that the computer is shutting down. The SCM then has a default time of approximately 20 seconds to shut down all running services before the system terminates the SCM process (Services.exe). This procedure does not always allow services to gracefully shut themselves down.

When the SCM receives the shutdown notification, it in turn sends shutdown

requests to every service serially, in random order. Each service has a wait hint that specifies how long the SCM should wait before it simply shuts down the service. In practice, the SCM waits for the longest wait hint to expire and then returns to its control handler, which shuts the services down. This shutdown model creates two types of problems for services:

? The shutdown order is essentially random. If a service expects other services to

shut down in a particular order, it may fail to shut itself down gracefully.

? Some services might not have sufficient time to clean up adequately before

shutdown. This cleanup often must be performed when the service is started

again, which often results in long service startup times or data inconsistencies.

Windows Vista addressed these service shutdown issues in two ways:

? The SCM delivers a preshutdown notification before the actual shutdown

notification. The preshutdown notification gives services that have a potentially lengthy shutdown procedure more time to shut down gracefully.

  

爱华网本文地址 » http://www.aihuau.com/a/348051/850902926037.html

更多阅读

增收增利 增收不增利 开发商转型“去住宅化”

     中国房地产行业已经正式进入“下半场”,这是在业内外没有多大争议的一个判断。在调控不放松的大背景下,销售业绩下滑,融资大门紧闭,专注住宅市场的开发商已经所剩无几,转型已成为不争的事实。万科、龙湖加码商业地产,恒大加快推

美好“钱”景涮出来:开家“量贩式”火锅店

近年来火锅的风光可是无可替代的。假如开家“量贩式”火锅店,把它开得有特色,或许,美好的“钱”景就这样涮出来了。 以往上餐厅,要么点菜,要么自助,而净菜火锅自选非同于一般的点菜和自助,一切都是量贩自选的新概念。菜品展台满是红、绿、

吃什么食物排毒养颜 女人吃什么食物能排毒养颜

   女人最注重就是容貌,一张灰暗无光的脸,是任何女人都接受不了的。大部分女性会选择化妆品还是排毒养颜胶囊,但这些东西大都有副作用。不如由内而外来的自然健康,纯天然的食物还是王道。  食物一:蜂蜜  自古就是排毒养颜的

小年 诗词 2015关于过小年的诗词(汇总)

   1.《雨夜南堂独坐》   年代:宋 作者: 陆游  老夫眼暗牙齿疏,七十未满六十余。  故人欲尽谁与娱?独坐默诵小年书。  北风日夜吹雨急,空村泥深屋茆湿。  凤皇览德乃下集,可怜飞萤常熠熠!  2.《鹊桥仙 自寿二首

声明:《vista vista Vista Services》为网友分手随缘分享!如侵犯到您的合法权益请联系我们删除