Commit bb529a49 authored by Rob Shearman's avatar Rob Shearman Committed by Alexandre Julliard

credui: Split CredDialogProc out into separate functions.

parent 678d3965
......@@ -130,15 +130,8 @@ struct cred_dialog_params
DWORD dwFlags;
};
static INT_PTR CALLBACK CredDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam,
LPARAM lParam)
static BOOL CredDialogInit(HWND hwndDlg, struct cred_dialog_params *params)
{
switch (uMsg)
{
case WM_INITDIALOG:
{
struct cred_dialog_params *params = (struct cred_dialog_params *)lParam;
SetWindowLongPtrW(hwndDlg, DWLP_USER, (LONG_PTR)params);
if (params->pszMessageText)
SetDlgItemTextW(hwndDlg, IDC_MESSAGE, params->pszMessageText);
......@@ -175,14 +168,10 @@ static INT_PTR CALLBACK CredDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam,
CheckDlgButton(hwndDlg, IDC_SAVE, BST_CHECKED);
return FALSE;
}
case WM_COMMAND:
switch (wParam)
{
case MAKELONG(IDOK, BN_CLICKED):
{
struct cred_dialog_params *params =
(struct cred_dialog_params *)GetWindowLongPtrW(hwndDlg, DWLP_USER);
}
static void CredDialogCommandOk(HWND hwndDlg, struct cred_dialog_params *params)
{
HWND hwndUsername = GetDlgItem(hwndDlg, IDC_USERNAME);
LPWSTR user;
INT len;
......@@ -195,7 +184,7 @@ static INT_PTR CALLBACK CredDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam,
if (!user[0])
{
HeapFree(GetProcessHeap(), 0, user);
return TRUE;
return;
}
if (!strchrW(user, '\\') && !strchrW(user, '@'))
......@@ -222,6 +211,27 @@ static INT_PTR CALLBACK CredDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam,
params->ulPasswordMaxChars);
EndDialog(hwndDlg, IDOK);
}
static INT_PTR CALLBACK CredDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam,
LPARAM lParam)
{
switch (uMsg)
{
case WM_INITDIALOG:
{
struct cred_dialog_params *params = (struct cred_dialog_params *)lParam;
return CredDialogInit(hwndDlg, params);
}
case WM_COMMAND:
switch (wParam)
{
case MAKELONG(IDOK, BN_CLICKED):
{
struct cred_dialog_params *params =
(struct cred_dialog_params *)GetWindowLongPtrW(hwndDlg, DWLP_USER);
CredDialogCommandOk(hwndDlg, params);
return TRUE;
}
case MAKELONG(IDCANCEL, BN_CLICKED):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment