![]() ![]() And and a program that monitors processes in user sessions, that runs in the same session. For example, you could write a tool that monitors a single service, and then run it once for each service you want to monitor. Splitting this into smaller tools that can be used in conjunction will simplify the problem and could also eliminate the need to do any p/invoke or C interop at all. There is fundamentally no reason why you would need one program that runs in a single process to do both jobs. (2) I don't agree with your assessment of the constraints on this problem. The building blocks are there and you just need to figure out how to put them together. (1) If you're dead-set on your single process solution and solving the problem in this exact way, you're going to have to figure out how to correctly use CreateProcessAsUser. If someone on my team came to me with this problem and the feedback you have, this is what I would tell them: I would challenge you to question some of your assumptions on this. There are quite a number of ways to solve this problem. I was hoping someone here could point me to a way I haven't tried yet, if there is any. This has forced me to create a separate task for each application I'm restarting. In the end I've settled for creating a scheduled task that starts the application, but as soon as I stop that task the application shuts down as well. I've tried hijacking the current user's token, starting the application with that token but that doesn't work, and frankly I was way out of my depths because this was with C++. This is because since windows 7, Microsoft has introduced session 0 isolation, meaning the service can start an application with a GUI, but that GUI would never show in the current user's session. However, if the applications that need to be monitored are running as an application with a GUI, I have to go out of my way to be able to start them from the windows service. The applications that need to be monitored can also be run as a windows service, and if this is the case I have no issue whatsoever to stop the service and restart it. If those applications to monitor become non responsive, I have a windows service that can take the request of the monitoring application to restart that non responsive application. I've got a project which has an application monitoring a set of applications through API's. Read detailed descriptions of the rules here. Rule 8: No unattributed use or automated use of AI Generation Tools. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |