Driver.NET icon indicating copy to clipboard operation
Driver.NET copied to clipboard

Why not use the create service API

Open MIAIONE opened this issue 3 years ago • 1 comments

Like OpenSCManager, you can create services dynamically instead of writing your own registry to implement them. Do you abandon using the WIN32 API because of errors in the way it is written in C#, such as "ref address", or have to use the registry because of the API's unrestricted return failure? Although their ultimate goal is the same

MIAIONE avatar Mar 26 '22 09:03 MIAIONE

The API provided by the MS's NET libraries are horrible, and there are none (aside of the ServiceController which is for a single service) to manage services as a whole, properly.

So either we have to re-implement all the SCM APIs, or we completely avoid using them at all. I picked the latter for simplicity, the only downside is not being able to receive notifications when a service is installed or removed, etc.. but that is about it.

Honestly I might as well make an SCM library for Microsoft at this point.

Side note: This lib was written mainly to communicate with kernel devices (Driver.NET.DeviceIoControl).. I never intented to make it be able to load/unload kernel drivers but had to do something along that line ASAP and ended up implement thoses API calls.

BerkanYildiz avatar May 08 '22 17:05 BerkanYildiz

thanks!

MIAIONE avatar Nov 20 '22 09:11 MIAIONE