Am I missing something? I run the following code on my Vista laptop from a user-mode process:
BOOL bSecure = -100;
if(::SystemParametersInfo(SPI_GETSCREENSAVESECURE, NULL, &bSecure, 0))
{
int success = 1;
}
The purpose is to obtain the "On resume, display logon screen" screensaver setting (circled in red below):
SystemParametersInfo
succeeds but bSecure
is not changed.
For those who may not believe me, here's the screenshot from the VS debugger:
Upon further debugging it turns out that SystemParametersInfo
actually returns 0xC0000002
when on my other computer it returns 1
when it succeeds. I thought it is not supposed to return HRESULT, or is it?
Anyway, the question -- how to reliably obtain this setting?