Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
9d4b8d33
Commit
9d4b8d33
authored
Jan 22, 2007
by
Rob Shearman
Committed by
Alexandre Julliard
Jan 23, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
credui: Implement CredUIPromptForCredentialsW and CredUIConfirmCredentialsW.
parent
c82fde40
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
209 additions
and
4 deletions
+209
-4
.gitignore
.gitignore
+1
-0
Makefile.in
dlls/credui/Makefile.in
+3
-1
credui.rc
dlls/credui/credui.rc
+42
-0
credui.spec
dlls/credui/credui.spec
+2
-2
credui_main.c
dlls/credui/credui_main.c
+138
-1
credui_resources.h
dlls/credui/credui_resources.h
+23
-0
No files found.
.gitignore
View file @
9d4b8d33
...
...
@@ -146,6 +146,7 @@ dlls/comm.drv16
dlls/commdlg.dll16
dlls/compobj.dll16
dlls/compstui/libcompstui.def
dlls/credui/credui.res
dlls/crtdll/libcrtdll.def
dlls/crypt32/crypt32.res
dlls/crypt32/libcrypt32.def
...
...
dlls/credui/Makefile.in
View file @
9d4b8d33
...
...
@@ -3,11 +3,13 @@ TOPOBJDIR = ../..
SRCDIR
=
@srcdir@
VPATH
=
@srcdir@
MODULE
=
credui.dll
IMPORTS
=
kernel32
IMPORTS
=
user32
kernel32
C_SRCS
=
\
credui_main.c
RC_SRCS
=
credui.rc
@MAKE_DLL_RULES@
### Dependencies:
dlls/credui/credui.rc
0 → 100644
View file @
9d4b8d33
/*
* Top level resource file for Credentials UI
*
* Copyright 2007 Robert Shearman (for CodeWeavers)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "winnls.h"
#include "credui_resources.h"
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
IDD_CREDDIALOG DIALOG DISCARDABLE 0, 0, 220, 82
STYLE DS_MODALFRAME | DS_NOIDLEMSG | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Enter User Name and Password"
FONT 8, "MS Shell Dlg"
BEGIN
DEFPUSHBUTTON "OK",IDOK,7,61,50,14
PUSHBUTTON "Cancel",IDCANCEL,67,61,50,14
LTEXT "&User Name:",IDC_STATIC,7,10,72,12,SS_CENTERIMAGE
LTEXT "&Password:",IDC_STATIC,7,27,72,12,SS_CENTERIMAGE
LTEXT "&Domain Name",IDC_STATIC,7,44,72,12,SS_CENTERIMAGE
EDITTEXT IDC_USERNAME,80,10,130,12,ES_AUTOHSCROLL
EDITTEXT IDC_PASSWORD,80,27,130,12,ES_PASSWORD | ES_AUTOHSCROLL
EDITTEXT IDC_DOMAIN,80,44,130,12,ES_AUTOHSCROLL
END
dlls/credui/credui.spec
View file @
9d4b8d33
@ stub CredUICmdLinePromptForCredentialsA
@ stub CredUICmdLinePromptForCredentialsW
@ stub CredUIConfirmCredentialsA
@ st
ub CredUIConfirmCredentialsW
@ st
dcall CredUIConfirmCredentialsW(wstr long)
@ stub CredUIInitControls
@ stub CredUIParseUserNameA
@ stub CredUIParseUserNameW
@ stub CredUIPromptForCredentialsA
@ st
ub CredUIPromptForCredentialsW
@ st
dcall CredUIPromptForCredentialsW(ptr wstr ptr long ptr long ptr long ptr long)
@ stub CredUIReadSSOCredA
@ stub CredUIReadSSOCredW
@ stub CredUIStoreSSOCredA
...
...
dlls/credui/credui_main.c
View file @
9d4b8d33
...
...
@@ -23,11 +23,17 @@
#include "windef.h"
#include "winbase.h"
#include "winnt.h"
#include "winuser.h"
#include "wincred.h"
#include "credui_resources.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
credui
);
static
HINSTANCE
hinstCredUI
;
BOOL
WINAPI
DllMain
(
HINSTANCE
hinstDLL
,
DWORD
fdwReason
,
LPVOID
lpvReserved
)
{
TRACE
(
"(0x%p, %d, %p)
\n
"
,
hinstDLL
,
fdwReason
,
lpvReserved
);
...
...
@@ -35,7 +41,138 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
if
(
fdwReason
==
DLL_WINE_PREATTACH
)
return
FALSE
;
/* prefer native version */
if
(
fdwReason
==
DLL_PROCESS_ATTACH
)
DisableThreadLibraryCalls
(
hinstDLL
);
{
DisableThreadLibraryCalls
(
hinstDLL
);
hinstCredUI
=
hinstDLL
;
}
return
TRUE
;
}
struct
cred_dialog_params
{
PCWSTR
pszTargetName
;
PCWSTR
pszMessageText
;
PCWSTR
pszCaptionText
;
HBITMAP
hbmBanner
;
PWSTR
pszUsername
;
ULONG
ulUsernameMaxChars
;
PWSTR
pszPassword
;
ULONG
ulPasswordMaxChars
;
BOOL
fSave
;
};
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
;
SetWindowLongPtrW
(
hwndDlg
,
DWLP_USER
,
(
LONG_PTR
)
params
);
if
(
params
->
pszCaptionText
)
SetWindowTextW
(
hwndDlg
,
params
->
pszCaptionText
);
return
TRUE
;
}
case
WM_COMMAND
:
switch
(
wParam
)
{
case
MAKELONG
(
IDOK
,
BN_CLICKED
):
{
ULONG
domainlen
;
struct
cred_dialog_params
*
params
=
(
struct
cred_dialog_params
*
)
GetWindowLongPtrW
(
hwndDlg
,
DWLP_USER
);
domainlen
=
GetDlgItemTextW
(
hwndDlg
,
IDC_DOMAIN
,
params
->
pszUsername
,
params
->
ulUsernameMaxChars
);
if
(
domainlen
&&
(
domainlen
<
params
->
ulUsernameMaxChars
))
{
params
->
pszUsername
[
domainlen
++
]
=
'\\'
;
params
->
pszUsername
[
domainlen
]
=
'\0'
;
}
if
(
domainlen
<
params
->
ulUsernameMaxChars
)
GetDlgItemTextW
(
hwndDlg
,
IDC_USERNAME
,
params
->
pszUsername
+
domainlen
,
params
->
ulUsernameMaxChars
-
domainlen
);
GetDlgItemTextW
(
hwndDlg
,
IDC_PASSWORD
,
params
->
pszPassword
,
params
->
ulPasswordMaxChars
);
EndDialog
(
hwndDlg
,
IDOK
);
return
TRUE
;
}
case
MAKELONG
(
IDCANCEL
,
BN_CLICKED
):
EndDialog
(
hwndDlg
,
IDCANCEL
);
return
TRUE
;
}
/* fall through */
default:
return
FALSE
;
}
}
/******************************************************************************
* CredUIPromptForCredentialsW [CREDUI.@]
*/
DWORD
WINAPI
CredUIPromptForCredentialsW
(
PCREDUI_INFOW
pUIInfo
,
PCWSTR
pszTargetName
,
PCtxtHandle
Reserved
,
DWORD
dwAuthError
,
PWSTR
pszUsername
,
ULONG
ulUsernameMaxChars
,
PWSTR
pszPassword
,
ULONG
ulPasswordMaxChars
,
BOOL
*
pfSave
,
DWORD
dwFlags
)
{
INT_PTR
ret
;
struct
cred_dialog_params
params
;
TRACE
(
"(%p, %s, %p, %d, %p, %d, %p, %d, %p, 0x%08x)
\n
"
,
pUIInfo
,
debugstr_w
(
pszTargetName
),
Reserved
,
dwAuthError
,
pszUsername
,
ulUsernameMaxChars
,
pszPassword
,
ulPasswordMaxChars
,
pfSave
,
dwFlags
);
params
.
pszTargetName
=
pszTargetName
;
if
(
pUIInfo
)
{
params
.
pszMessageText
=
pUIInfo
->
pszMessageText
;
params
.
pszCaptionText
=
pUIInfo
->
pszCaptionText
;
params
.
hbmBanner
=
pUIInfo
->
hbmBanner
;
}
else
{
params
.
pszMessageText
=
NULL
;
params
.
pszCaptionText
=
NULL
;
params
.
hbmBanner
=
NULL
;
}
params
.
pszUsername
=
pszUsername
;
params
.
ulUsernameMaxChars
=
ulUsernameMaxChars
;
params
.
pszPassword
=
pszPassword
;
params
.
ulPasswordMaxChars
=
ulPasswordMaxChars
;
params
.
fSave
=
*
pfSave
;
ret
=
DialogBoxParamW
(
hinstCredUI
,
MAKEINTRESOURCEW
(
IDD_CREDDIALOG
),
pUIInfo
->
hwndParent
,
CredDialogProc
,
(
LPARAM
)
&
params
);
if
(
ret
<=
0
)
return
GetLastError
();
if
(
ret
==
IDCANCEL
)
{
TRACE
(
"dialog cancelled
\n
"
);
return
ERROR_CANCELLED
;
}
*
pfSave
=
params
.
fSave
;
return
ERROR_SUCCESS
;
}
/******************************************************************************
* CredUIConfirmCredentialsW [CREDUI.@]
*/
DWORD
WINAPI
CredUIConfirmCredentialsW
(
PCWSTR
pszTargetName
,
BOOL
bConfirm
)
{
FIXME
(
"(%s, %s): stub
\n
"
,
debugstr_w
(
pszTargetName
),
bConfirm
?
"TRUE"
:
"FALSE"
);
return
ERROR_SUCCESS
;
}
dlls/credui/credui_resources.h
0 → 100644
View file @
9d4b8d33
/*
* Copyright 2007 Robert Shearman (for CodeWeavers)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#define IDD_CREDDIALOG 100
#define IDC_USERNAME 101
#define IDC_PASSWORD 102
#define IDC_DOMAIN 103
#define IDC_STATIC 104
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment