Windows service program shuts down on log-off mode - c

I am working on a service program that reads the event log which shows how many times the user failed to log-in.
From my code, once a user click the switch profile button and try to log-in again, it stops.
As far as I know, the service program should run still during the log-off mode, am I wrong?
Please let me know the reason and any idea is welcome.

Related

C call to NetShareEnum fails with 5 'Access Denied' on Win 10 while same user can browse the SMB shares

We're running Win10 LTS-B.
Using SMB shares and no domain.
The user is able to access the remote share using file explorer.
But the signed executable which runs as the same user
fails with code 5 'access denied' when calling the function "netShareEnum".
The code is a direct copy from the msdn example.
https://learn.microsoft.com/en-us/windows/desktop/api/lmshare/nf-lmshare-netshareenum
When starting the executable,
The remote systen with the SMB share shows in the Eventlog "security" a successful login, and approx 10 seconds later a logoff entry.(seems triggered by my call)
So something else is wrong.
I dont know where to look next..
I also enabled dcom/ole access- and failure-logging on the remote system in the hope of finding something, but nothing.
I found it ! :) It was because someone pressed [cancel] on the next popup

Windows Credential provider - password expired while desktop locked

im working on a credential provider and got stuck with the following issue:
When the desktop is locked on a terminal server and the password expires, the CP cant seem to change the password.
I can dectect that the password must be changed in ReportResult(), then open a dialog asking for the new password and packing a KERB_CHANGEPASSWORD_REQUEST to hand over in GetSerialization(). This works when the user logs on initially (CPUS_LOGON).
But in CPUS_UNLOCK_WORKSTATION (when the user is already logged in) I get the same ntsStatus (which is 0xC0000224) again in ReportResult() after handing over the KERB_CHANGEPASSWORD_REQUEST
So i wonder if anybody knows what the difference is between those two scenarios - is logonUI expecting a package other than KERB_CHANGEPASSWORD_REQUEST ?
I also tried setting the GetSerializationResponse "status" from CPGSR_RETURN_CREDENTIAL_FINISHED to CPGSR_NO_CREDENTIAL_FINISHED (in the technical reference its said to be the indicator that a password change completed, but thats probably for CPUS_CHANGE_PASSWORD).
The setup im testing this is on is a Win2012 R2 terminal server with a Win2016 DC.
I'd be grateful for any help, thanks!

Scheduled Task to kill specific internet explorer tab

Is it possible to schedule a task that will kill a specific internet tab every 15 minutes?
Our operatives all access a reports dashboard, but due to the number of licenses we keep finding ourselves being unable to log on as people leave their screen open despite not using it.
If there was a scheduled task that ran every 15 minutes, perhaps that just kicked off a batch file that looked for an internet tab that's always called 'Dashboard' then it would kill it, that would be great.
Can anyone help please?
Thanks
I don't think this can be done easily if it can be done at all.
Does the application you use - Dashboard? - have a setting to handle a session after some time of inactivity as being closed like when closing the page in the browser or terminate the browser?
It would be better to control the session and license management from server side instead of from client side.
Do you use OpenStack Dashboard (Horizon) as I found the page Horizon does not implement a browser session timeout with the information that there is now such a feature.

DevExpress - Show Alert Window for all users in app

We've got a program that runs on our network (it's published to our app-server and run from there as well) and I'd like to show an Alert window (by DevExpress) to all users who are running the app, whenever a new item is entered. Obviously the code would go in the Save event but when I put it in there, it only works for me, meaning I'm the only user who sees the alert, no one else. The same can be said for other users...they only see the alert when they enter it, not when someone else enters it.
Any ideas as to how this can be accomplished?
You can use straight MSMQ to put on a message and have clients listen on that queue. You can also use NServiceBus (which does use MSMQ) that has a publish subscribe framework built in. This way your clients can subscribe to all clients or certain clients.
Since WinXP, Vista and Win7 have MSMQ it just maybe a matter of installation and configuration (which NServiceBus will do 'automatically' for you)
You could try with Comet if you want true push mechanism. Otherwise you could use periodical pull using setInterval and ajax calls. However, both techniques have some performance repercussions.

Start application from driver

Can I start another application from a driver code? The code is written in C and compiled with DDK.
I don't think so. Instead:
You can have a service which sends down a DeviceIoControl to the device.
The device then keeps (doesn't complete) the associated IOCTL
When the device wants to launch the application, then it completes the IOCTL
When the service notices that its DeviceIoControl has been completed, then it starts the other application
A service could launch an application but I don't know whether it can launch it on the user's desktop. If you want the launched application to interact with the logged-in end-user user then, instead of having a service as described above, it would be better to put the DeviceIoControl functionality in a (visible or invisible) application, which is started automatically in the user's workstation when the user logs in.
If you do this then beware assuming that there is only one logged-in user (there may be many, on a Citrix/terminal server).

Resources