4 // Password support for Win9x
9 typedef BOOL (WINAPI
*VERIFYSCREENSAVEPWD
)(HWND hwnd
);
10 typedef VOID (WINAPI
*PWDCHANGEPASSWORD
)(LPCTSTR lpcRegkeyname
, HWND hwnd
,UINT uiReserved1
,UINT uiReserved2
);
12 BOOL
VerifyPassword(HWND hwnd
)
14 // Under NT, we return TRUE immediately. This lets the saver quit,
15 // and the system manages passwords. Under '95, we call VerifyScreenSavePwd.
16 // This checks the appropriate registry key and, if necessary,
17 // pops up a verify dialog
20 VERIFYSCREENSAVEPWD VerifyScreenSavePwd
;
23 if(GetVersion() < 0x80000000)
26 hpwdcpl
= LoadLibrary(_T("PASSWORD.CPL"));
34 VerifyScreenSavePwd
= (VERIFYSCREENSAVEPWD
)GetProcAddress(hpwdcpl
, "VerifyScreenSavePwd");
36 if(VerifyScreenSavePwd
== NULL
)
42 fResult
= VerifyScreenSavePwd(hwnd
);
48 BOOL
ChangePassword(HWND hwnd
)
50 // This only ever gets called under '95, when started with the /a option.
51 HINSTANCE hmpr
= LoadLibrary(_T("MPR.DLL"));
52 PWDCHANGEPASSWORD PwdChangePassword
;
57 PwdChangePassword
= (PWDCHANGEPASSWORD
)GetProcAddress(hmpr
, "PwdChangePasswordA");
59 if(PwdChangePassword
== NULL
)
65 PwdChangePassword(_T("SCRSAVE"), hwnd
, 0, 0);