Registry Services Start Value

0 views
Skip to first unread message

Thomas Merino

unread,
Aug 5, 2024, 3:06:10 AM8/5/24
to stasoutompa
Viathe registry you won't be able to tell what state a service is currently in, only it's start-up mode setting (manual, automatic, disabled, etc.). This will be held in a key named "Start" within the service's branch in the registry.

The HKLM\SYSTEM\CurrentControlSet\Services registry tree stores information about each service on the system. Each driver has a key of the form HKLM\SYSTEM\CurrentControlSet\Services\DriverName.


The PnP manager passes this path of a driver in the RegistryPath parameter when it calls the driver's DriverEntry routine. A driver can store global driver-defined data under the Parameters subkey of its key in the Services tree using an AddReg directive in the driver's INF file. To access that key at runtime, a WDM driver should use IoOpenDriverRegistryKey with a DRIVER_REGKEY_TYPE of DriverRegKeyParameters and a WDF driver should use WdfDriverOpenParametersRegistryKey. Information that is stored under this key is available to the driver during its initialization.


ImagePath

A value entry that specifies the fully qualified path of the driver's image file. Windows creates this value by using the required ServiceBinary entry in the driver's INF file. This entry is in the service-install-section referenced by the driver's INF AddService directive.


Parameters

A key that is used to store driver-specific data. For some types of drivers, the system expects to find specific value entries. You can add value entries to this subkey using AddReg directives in the driver's INF file.


Performance

A key that specifies information for optional performance monitoring. The values under this key specify the name of the driver's performance DLL and the names of certain exported functions in that DLL. You can add value entries to this subkey using AddReg directives in the driver's INF file.


Hai every oneI am developing an windows application in which i have to block the removable storage devices such as pendrives.I found that its possible by changing the registry value of HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\UsbStor,start value to 4.But the problem is I have to block it on remote systems too.Can any one suggest me how to change the value of registry of remote system using c# with a code or sites where i can i find the code for this.


I would like to disable service programmatically through registry. To do that, I modify the following registry key : Computer\HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\SensorDataService\Start, where I set its value 0x4 which corresponds to disabled state. Now, when I check service in Windows Service Manager - it's reported as disabled and I can't start it.


I was able to reproduce this, and to make it work with the plain registry change for service with name "SensorDataService" as you want Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SensorDataService\Start and then change the value to 0x4 which indeed means disabled, then you have to restart your computer and then the exception you want is thrown when you start the service from code.


When one changes it by hand in the Services GUI, I assume they call Service Control Manager and it changes the registry entry and also something internal like in memory cache or creates some file somewhere, if you are able to reload it maybe restart is not necessary.


By default, "Automatic (Delayed Start)" services will start at 120 seconds after all other "Automatic" services have started.



This value can be changed on a global or on a per-service basis.


Using Set-Service, I'm able to change the StartType of my services between the accepted values of Boot, System, Automatic, Manual, Disabled. Using services.msc, I'm able to set some services to startup with a Priority of Automatic (Delayed Start). However, Get-Service still reports these delayed-start services as StartType : Automatic, and Set-Service errors out when attempting to set these values.


However, before I make the registry change and restart, could someone kindly please explain what the FSDepends.sys does and why Symantec Backup Exec requires the registry value to be set to a value of 3 in the first place? Was there an error in Backup Exec?


Afaik, fsdepends.sys is a mini-filter driver and not directly called / used by Backup Exec. When BE loads its tape driver, it conflicts with fsdepends.sys being loaded as well. By setting the registry key to 0, it allows the fsdepends.sys to load immediately during boot up and thereby avoiding the conflict with the tape drivers. fsdepends.sys actually tracks file system dependencies and i believe either having a read at Windows Internals or checking with MS will provide more details.


Btw, it is originally a MS article and since it affects BE (and other backup software which supports tapes), it has been referenced on the other vendor sites. (I have posted an example link below) And as pkh suggested earlier, if you really would like more detail as to why fsdepends.sys does, then MS is indeed the appropriate place to ask.


Just ran the start service again with the following:

$ confluent local services start

The local commands are intended for a single-node development environment only,

NOT for production usage.


Using CONFLUENT_CURRENT: /tmp/confluent.184303

Starting ZooKeeper

ZooKeeper is [UP]

Starting Kafka

Kafka is [UP]

Starting Schema Registry

Schema Registry is [UP]

Starting Kafka REST

Kafka REST is [UP]

Starting Connect

Error: Connect failed to start


Using CONFLUENT_CURRENT: /tmp/confluent.184303

Connect is [DOWN]

Control Center is [DOWN]

Kafka is [DOWN]

Kafka REST is [UP]

ksqlDB Server is [DOWN]

Schema Registry is [UP]

ZooKeeper is [UP]


WARN [Producer clientId=confluent-telemetry-reporter-local-producer] Connection to node 0 (/127.0.1.1:9092) could not be established. Broker may not be available. (org.apache.kafka.clients.NetworkClient)


In this context, a service is described by a service definition or service model thatdefines the technical details of how to invoke the service. For example,it describes that the service is invoked as an HTTP REST call,what the input or output parameters are, how to map the response, etc.


Once such a service model is made, it can then be used in BPMN orCMMN models to invoke the service. The main benefits of using the service registry engine(versus, for example, using and configuring a service task directly) are:


Encapsulating service implementation details: a technical person can createservice models that contain the low-level configuration on how a serviceis invoked. The modeling user can use these services in theirmodels without having ever to know these details.


A service is described by a service definition or service model, which contains the service implementation details.Such a service model is visually created in Flowable Design(see the Service Registry Modeler Guide for examples).


Operations: Each service consists of one or more operations. For example,a customer service could expose an operation to look up a customer,create a customer, or even remove a customer object.


Input and output parameters: Each operation can have zero or more parameters.The input parameters (name, type, default value, etc.) for an operation and theoutput parameters that the operation produces (if any) determines the kind of dataused and produced when invoking the service.


The service definition only describes the input and outputparameters for the service as they are when invoking the service.The service definition does not define how these parameters are mappedto process or case variables. The actual mapping is done in the BPMN or CMMN taskattributes that are used in the process or case model in Flowable Design.In Design, it is possible to map variables to input parameters for theservice and output parameter values to variables. This way, the servicedefinition is not bound to any model implementation, and it can bereused in different models, with different parameter mapping configurations.


Let us start with a simple example to explain the concepts behind a servicedefinition. In this example, someone has written a customer lookupservice and exposed that service as a Spring bean (e.g., a custom configurationwith @Configuration that exposes this bean was added to the classpath).The actual way of how this is done is not important for the service registry.It could be that service is doing a database lookup to fulfill its purpose, ormaybe it is using a message queue to send a message to a remote microservice.The point is: for the user of the service in a model, this is not important.What matters is how data can be passed into this service and what type ofdata is getting returned.


Notice how the return type of the service iscom.fasterxml.jackson.databind.node.ObjectNode and not String.When using the service registry engine, returning an ObjectNode or an ArrayNode (since 3.11) is mandatory.The reason is to force the author of the service to think about theserialization of data. Having arbitrary object instances as a return valuewould lead to storing these as serializable variables in process orcase instance, which is a bad practice.


Services, like most models in Flowable, can be versioned. Versioning happens throughthe version property. In Flowable Design, this is done automatically, but itcan be set manually in the JSON.


Creating a script-based service definition is similar to the expression-backed example, but instead ofan expression, a JSR-223 compatible scripting language, for instance JavaScript or Groovy is used instead.This allows you to write complex service logic without having to write it in Java, which requires the class to beadded to the classpath and an instance being exposed as a Spring bean.

3a8082e126
Reply all
Reply to author
Forward
0 new messages