I can't say about exact patch but here is a working solution (found 
here and tested by myself). Unfortunately it is not the call-to-get-answer one, it requires a window message processing.
We need to register main Miranda window for 
WM_WTSSESSION_CHANGE notifications using 
WTSRegisterSessionNotification function. Then we need to set a lock flag when OS reports that workstation is locked/unlocked. All notifications that are sent with this message are listed 
here. We are interested in two ones: 
wParam==WTS_SESSION_LOCK and 
wParam==WTS_SESSION_UNLOCK. So, fixed 
IsWorkstationLocked should simply return this flag state (it may simply be a static variable in 
winver.cpp source file).
I tried some things with 
OpenInputDesktop function but it returns 
ERROR_ACCESS_DENIED on both lock and UAC prompt.