Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiple services from the same executable

I've written a small service (plain Win32) and I'd like to know if it's possible to run multiple instances of it when multiple users are logged on.

Basically, let's say we've got UserA and UserB for UserA the service would log on as "domain\UserA" and for UserB the service would log on as "domain\UserB" - this is from the same executable of course. I can change the logon dynamically using the ChangeServiceConfig() function, but it changes it system-wide it seems, while I'd like each user to have his own copy of the service running only for him.

Thank you in advance for any pointers.

like image 519
dennisV Avatar asked Apr 01 '26 06:04

dennisV


1 Answers

Win32 services are designed to be system-wide, and start running before any user is logged in. If you want something to run on a per-user basis, it's probably better to design it as a regular application and run it from the user's Startup group.

like image 121
Greg Hewgill Avatar answered Apr 03 '26 20:04

Greg Hewgill



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!