ReactOS  0.4.14-dev-342-gdc047f9
password.c File Reference
#include <windows.h>
#include <tchar.h>
Include dependency graph for password.c:

Go to the source code of this file.

Typedefs

typedef BOOL(WINAPIVERIFYSCREENSAVEPWD) (HWND hwnd)
 
typedef VOID(WINAPIPWDCHANGEPASSWORD) (LPCTSTR lpcRegkeyname, HWND hwnd, UINT uiReserved1, UINT uiReserved2)
 

Functions

BOOL VerifyPassword (HWND hwnd)
 
BOOL ChangePassword (HWND hwnd)
 

Typedef Documentation

◆ PWDCHANGEPASSWORD

typedef VOID(WINAPI * PWDCHANGEPASSWORD) (LPCTSTR lpcRegkeyname, HWND hwnd, UINT uiReserved1, UINT uiReserved2)

Definition at line 10 of file password.c.

◆ VERIFYSCREENSAVEPWD

typedef BOOL(WINAPI * VERIFYSCREENSAVEPWD) (HWND hwnd)

Definition at line 9 of file password.c.

Function Documentation

◆ ChangePassword()

BOOL ChangePassword ( HWND  hwnd)

Definition at line 48 of file password.c.

49 {
50  // This only ever gets called under '95, when started with the /a option.
51  HINSTANCE hmpr = LoadLibrary(_T("MPR.DLL"));
52  PWDCHANGEPASSWORD PwdChangePassword;
53 
54  if(hmpr == NULL)
55  return FALSE;
56 
57  PwdChangePassword = (PWDCHANGEPASSWORD)GetProcAddress(hmpr, "PwdChangePasswordA");
58 
59  if(PwdChangePassword == NULL)
60  {
61  FreeLibrary(hmpr);
62  return FALSE;
63  }
64 
65  PwdChangePassword(_T("SCRSAVE"), hwnd, 0, 0);
66  FreeLibrary(hmpr);
67 
68  return TRUE;
69 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define TRUE
Definition: types.h:120
#define LoadLibrary
Definition: winbase.h:3686
smooth NULL
Definition: ftsmooth.c:416
#define _T(x)
Definition: vfdio.h:22
#define FreeLibrary(x)
Definition: compat.h:413
VOID(WINAPI * PWDCHANGEPASSWORD)(LPCTSTR lpcRegkeyname, HWND hwnd, UINT uiReserved1, UINT uiReserved2)
Definition: password.c:10
#define GetProcAddress(x, y)
Definition: compat.h:418

Referenced by wWinMain().

◆ VerifyPassword()

BOOL VerifyPassword ( HWND  hwnd)

Definition at line 12 of file password.c.

13 {
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
18 
19  HINSTANCE hpwdcpl;
20  VERIFYSCREENSAVEPWD VerifyScreenSavePwd;
21  BOOL fResult;
22 
23  if(GetVersion() < 0x80000000)
24  return TRUE;
25 
26  hpwdcpl = LoadLibrary(_T("PASSWORD.CPL"));
27 
28  if(hpwdcpl == NULL)
29  {
30  return FALSE;
31  }
32 
33 
34  VerifyScreenSavePwd = (VERIFYSCREENSAVEPWD)GetProcAddress(hpwdcpl, "VerifyScreenSavePwd");
35 
36  if(VerifyScreenSavePwd == NULL)
37  {
38  FreeLibrary(hpwdcpl);
39  return FALSE;
40  }
41 
42  fResult = VerifyScreenSavePwd(hwnd);
43  FreeLibrary(hpwdcpl);
44 
45  return fResult;
46 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define TRUE
Definition: types.h:120
#define LoadLibrary
Definition: winbase.h:3686
DWORD WINAPI GetVersion(VOID)
Definition: version.c:22
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
#define _T(x)
Definition: vfdio.h:22
#define FreeLibrary(x)
Definition: compat.h:413
BOOL(WINAPI * VERIFYSCREENSAVEPWD)(HWND hwnd)
Definition: password.c:9
#define GetProcAddress(x, y)
Definition: compat.h:418

Referenced by MatrixWndProc().