I was using InitiateSystemShutdownEx() to reboot the system (I asked about it in a separate thread, but this question is not related to it.) On Windows XP, if a workstation is locked that API returns FALSE and Getlasterror returns ERROR_MACHINE_LOCKED, which means "The machine is locked and cannot be shut down without the force option." The function succeeds if I set the bForceAppsClosed parameter to TRUE to "force" the operation, but in that case any unsaved data will be lost.

Can someone explain for me, what is the reason to enforce such behavior?


PS. The workstation may be locked automatically if someone enables password protection in a screen saver.