38 #include "wine/list.h" 42 #define TOOLID_INCORRECTPASSWORD 1 43 #define TOOLID_CAPSLOCKON 2 45 #define ID_CAPSLOCKPOP 1 65 0, 0, { (
DWORD_PTR)(__FILE__
": csPendingCredentials") }
77 case DLL_WINE_PREATTACH:
129 ERR(
"CredWriteW failed with error %d\n",
ret);
165 if (!credentials[
i]->UserName)
183 for (
j = 0;
j <
i;
j++)
184 if (credentials[
j]->UserName
185 && !
lstrcmpW(credentials[
i]->UserName, credentials[
j]->UserName))
195 comboitem.
iItem = -1;
208 if (
params->hwndBalloonTip)
220 ERR(
"failed to load IDS_INCORRECTPASSWORD\n");
224 toolinfo.
cbSize =
sizeof(toolinfo);
226 toolinfo.
hwnd = hwndDlg;
237 ERR(
"failed to load IDS_CAPSLOCKON\n");
256 if (!
params->pszUsername[0])
260 if (
params->fBalloonTipActive)
265 ERR(
"failed to load IDS_INCORRECTPASSWORDTITLE\n");
271 memset(&toolinfo, 0,
sizeof(toolinfo));
272 toolinfo.
cbSize =
sizeof(toolinfo);
273 toolinfo.
hwnd = hwndDlg;
280 x = rcPassword.
right - 12;
298 if (
params->fBalloonTipActive)
303 ERR(
"failed to load IDS_IDSCAPSLOCKONTITLE\n");
309 memset(&toolinfo, 0,
sizeof(toolinfo));
310 toolinfo.
cbSize =
sizeof(toolinfo);
311 toolinfo.
hwnd = hwndDlg;
318 x = rcPassword.
left + 12;
335 if (!
params->hwndBalloonTip)
338 memset(&toolinfo, 0,
sizeof(toolinfo));
340 toolinfo.
cbSize =
sizeof(toolinfo);
341 toolinfo.
hwnd = hwndDlg;
389 if (
params->pszMessageText)
404 if (
params->pszUsername[0])
414 if (
params->pszCaptionText)
465 if (len_target + 1 <
params->ulUsernameMaxChars)
466 params->pszUsername[len_target] =
'\\';
467 if (len_target + 2 <
params->ulUsernameMaxChars)
468 params->pszUsername[len_target + 1] =
'\0';
470 else if (
params->ulUsernameMaxChars > 0)
471 params->pszUsername[0] =
'\0';
475 if (
params->ulUsernameMaxChars)
481 params->ulPasswordMaxChars);
575 FIXME(
"no support for type %u credentials\n", credentials[
i]->
Type);
579 lstrlenW(credentials[
i]->UserName) < len_username &&
580 credentials[
i]->CredentialBlobSize /
sizeof(
WCHAR) < len_password)
582 TRACE(
"found existing credential for %s\n",
debugstr_w(credentials[
i]->UserName));
585 memcpy(
password, credentials[
i]->CredentialBlob, credentials[
i]->CredentialBlobSize);
604 ULONG ulUsernameMaxChars,
613 TRACE(
"(%p, %s, %p, %d, %s, %d, %p, %d, %p, 0x%08x)\n", pUIInfo,
615 ulUsernameMaxChars, pszPassword, ulPasswordMaxChars, pfSave,
dwFlags);
631 params.pszTargetName = pszTargetName;
644 params.pszUsername = pszUsername;
645 params.ulUsernameMaxChars = ulUsernameMaxChars;
646 params.pszPassword = pszPassword;
647 params.ulPasswordMaxChars = ulPasswordMaxChars;
661 TRACE(
"dialog cancelled\n");
724 TRACE(
"(%s, %s)\n",
debugstr_w(pszTargetName), bConfirm ?
"TRUE" :
"FALSE");
763 ULONG ulMaxDomainChars)
768 ulMaxUserChars, pszDomain, ulMaxDomainChars);
770 if (!pszUserName || !pszUser || !ulMaxUserChars || !pszDomain ||
779 if (
p - pszUserName > ulMaxDomainChars - 1)
781 if (
lstrlenW(
p + 1) > ulMaxUserChars - 1)
784 memcpy(pszDomain, pszUserName, (
p - pszUserName)*
sizeof(
WCHAR));
785 pszDomain[
p - pszUserName] =
'\0';
793 if (
p + 1 - pszUserName > ulMaxUserChars - 1)
795 if (
lstrlenW(
p + 1) > ulMaxDomainChars - 1)
798 memcpy(pszUser, pszUserName, (
p - pszUserName)*
sizeof(
WCHAR));
799 pszUser[
p - pszUserName] =
'\0';
804 if (
lstrlenW(pszUserName) > ulMaxUserChars - 1)
819 pszPassword, bPersist);
830 pszPassword, bPersist);
841 *ppszUsername =
NULL;
852 *ppszUsername =
NULL;
874 static const WCHAR basicW[] = {
'B',
'a',
's',
'i',
'c',0};
875 static const WCHAR ntlmW[] = {
'N',
'T',
'L',
'M',0};
876 static const WCHAR negotiateW[] = {
'N',
'e',
'g',
'o',
't',
'i',
'a',
't',
'e',0};
885 FIXME(
"(%s, %p, %u, %s, %p, %p, %p, %x) stub\n",
debugstr_w(
target),
info,
922 DWORD size =
sizeof(*id), len_domain = 0;
939 size += (len_username + 1) *
sizeof(
WCHAR);
940 size += (len_domain + 1) *
sizeof(
WCHAR);
941 size += (len_password + 1) *
sizeof(
WCHAR);
947 id->UserLength = len_username;
948 ptr += len_username + 1;
953 id->DomainLength = len_domain;
954 ptr += len_domain + 1;
959 id->DomainLength = 0;
963 id->PasswordLength = len_password;
976 const void *in_buf,
ULONG in_buf_size,
void **out_buf,
979 FIXME(
"(%p, %u, %p, %p, %u, %p, %p, %p, %08x) stub\n",
info,
error, package, in_buf, in_buf_size,
980 out_buf, out_buf_size, save,
flags );
1001 FIXME(
"(%08x, %p, %u, %p, %p, %p, %p, %p, %p) stub\n",
flags,
buf,
size,
username, len_username,
static const WCHAR basicW[]
static LRESULT CALLBACK CredDialogPasswordSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, UINT_PTR uIdSubclass, DWORD_PTR dwRefData)
#define ERROR_INVALID_PARAMETER
#define SSPIPFC_CREDPROV_DO_NOT_SAVE
BOOL WINAPI CheckDlgButton(_In_ HWND, _In_ int, _In_ UINT)
#define CREDUI_FLAGS_PERSIST
#define IDS_CAPSLOCKONTITLE
static void CredDialogShowCapsLockBalloon(HWND hwndDlg, struct cred_dialog_params *params)
UINT WINAPI GetDlgItemTextW(HWND hDlg, int nIDDlgItem, LPWSTR lpString, int nMaxCount)
static DWORD save_credentials(PCWSTR pszTargetName, PCWSTR pszUsername, PCWSTR pszPassword, BOOL generic)
INT_PTR WINAPI DialogBoxParamW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_opt_ HWND, _In_opt_ DLGPROC, _In_ LPARAM)
#define IDS_MESSAGEFORMAT
static INT_PTR CALLBACK CredDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
DWORD WINAPI CredUIPromptForCredentialsW(PCREDUI_INFOW pUIInfo, PCWSTR pszTargetName, PCtxtHandle Reserved, DWORD dwAuthError, PWSTR pszUsername, ULONG ulUsernameMaxChars, PWSTR pszPassword, ULONG ulPasswordMaxChars, PBOOL pfSave, DWORD dwFlags)
static BOOL CredDialogCapsLockOn(void)
#define IDS_INCORRECTPASSWORDTITLE
static CRITICAL_SECTION csPendingCredentials
int WINAPI lstrcmpW(LPCWSTR lpString1, LPCWSTR lpString2)
static HINSTANCE hinstCredUI
static void CredDialogShowIncorrectPasswordBalloon(HWND hwndDlg, struct cred_dialog_params *params)
GLuint GLuint GLsizei count
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG x1
_In_ SUBCLASSPROC _In_ UINT_PTR _In_ DWORD_PTR dwRefData
#define CREDUI_FLAGS_INCORRECT_PASSWORD
#define TTM_TRACKPOSITION
#define CREDUI_FLAGS_GENERIC_CREDENTIALS
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
BOOL WINAPI CredUIInitControls(void)
DWORD WINAPI CredUIReadSSOCredA(PCSTR pszRealm, PSTR *ppszUsername)
DWORD WINAPI GetLastError(VOID)
BOOL WINAPI CredEnumerateW(LPCWSTR Filter, DWORD Flags, DWORD *Count, PCREDENTIALW **Credentials)
GLint GLint GLint GLint GLint x
HWND WINAPI SetFocus(_In_opt_ HWND)
#define DLL_PROCESS_ATTACH
BOOL WINAPI SetWindowTextW(_In_ HWND, _In_opt_ LPCWSTR)
#define GetWindowLongPtrW
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
static BOOL find_existing_credential(const WCHAR *target, WCHAR *username, ULONG len_username, WCHAR *password, ULONG len_password)
BOOL WINAPI DestroyWindow(_In_ HWND)
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
DWORD WINAPI CredUIPromptForWindowsCredentialsW(CREDUI_INFOW *info, DWORD error, ULONG *package, const void *in_buf, ULONG in_buf_size, void **out_buf, ULONG *out_buf_size, BOOL *save, DWORD flags)
static void CredDialogCreateBalloonTip(HWND hwndDlg, struct cred_dialog_params *params)
static void CredDialogHideBalloonTip(HWND hwndDlg, struct cred_dialog_params *params)
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
static IN DWORD IN LPVOID lpvReserved
static const WCHAR negotiateW[]
BOOL WINAPI CredWriteW(PCREDENTIALW Credential, DWORD Flags)
BOOL WINAPI SetDlgItemTextW(_In_ HWND, _In_ int, _In_ LPCWSTR)
__WINE_SERVER_LIST_INLINE void list_add_tail(struct list *list, struct list *elem)
GLenum GLuint GLenum GLsizei const GLchar * buf
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
#define CREDUI_FLAGS_DO_NOT_PERSIST
GLenum const GLfloat * params
BOOL WINAPI CredUnPackAuthenticationBufferW(DWORD flags, void *buf, DWORD size, WCHAR *username, DWORD *len_username, WCHAR *domain, DWORD *len_domain, WCHAR *password, DWORD *len_password)
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
static struct _test_info info[]
#define CREDUI_MAX_USERNAME_LENGTH
static void CredDialogFillUsernameCombo(HWND hwndUsername, const struct cred_dialog_params *params)
#define CREDUI_MAX_PASSWORD_LENGTH
static struct list pending_credentials_list
DWORD WINAPI CredUIStoreSSOCredW(PCWSTR pszRealm, PCWSTR pszUsername, PCWSTR pszPassword, BOOL bPersist)
_Reserved_ PVOID Reserved
LRESULT WINAPI DefSubclassProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
BOOL WINAPI LockSetForegroundWindow(UINT uLockCode)
static const WCHAR ntlmW[]
UINT WINAPI IsDlgButtonChecked(_In_ HWND, _In_ int)
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
#define CRED_TYPE_DOMAIN_PASSWORD
#define DLL_PROCESS_DETACH
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
SHORT WINAPI GetKeyState(_In_ int)
BOOL WINAPI SetWindowSubclass(HWND hWnd, SUBCLASSPROC pfnSubclass, UINT_PTR uIDSubclass, DWORD_PTR dwRef)
static void CredDialogCommandOk(HWND hwndDlg, struct cred_dialog_params *params)
#define CREDUI_FLAGS_EXPECT_CONFIRMATION
__WINE_SERVER_LIST_INLINE void list_remove(struct list *elem)
#define CRED_PERSIST_ENTERPRISE
#define SSPIPFC_NO_CHECKBOX
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
_CONST_RETURN wchar_t *__cdecl wcschr(_In_z_ const wchar_t *_Str, wchar_t _Ch)
VOID WINAPI CredFree(PVOID Buffer)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define CREDUI_FLAGS_ALWAYS_SHOW_UI
void WINAPI DeleteCriticalSection(PCRITICAL_SECTION)
int WINAPI GetWindowTextLengthW(_In_ HWND)
unsigned __int3264 UINT_PTR
static BOOL CredDialogInit(HWND hwndDlg, struct cred_dialog_params *params)
#define ERROR_NO_SUCH_PACKAGE
PCREDENTIAL_ATTRIBUTEW Attributes
DWORD WINAPI CredUIStoreSSOCredA(PCSTR pszRealm, PCSTR pszUsername, PCSTR pszPassword, BOOL bPersist)
HWND WINAPI CreateWindowExW(_In_ DWORD dwExStyle, _In_opt_ LPCWSTR lpClassName, _In_opt_ LPCWSTR lpWindowName, _In_ DWORD dwStyle, _In_ int X, _In_ int Y, _In_ int nWidth, _In_ int nHeight, _In_opt_ HWND hWndParent, _In_opt_ HMENU hMenu, _In_opt_ HINSTANCE hInstance, _In_opt_ LPVOID lpParam)
T1_FIELD_DICT_PRIVATE password
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
#define CRED_TYPE_GENERIC
#define memcpy(s1, s2, n)
BOOL WINAPI CredPackAuthenticationBufferW(DWORD flags, WCHAR *username, WCHAR *password, BYTE *buf, DWORD *size)
BOOL WINAPI SetRectEmpty(_Out_ LPRECT)
LIST_ENTRY ProcessLocksList
int _cdecl swprintf(const WCHAR *,...)
DWORD WINAPI CredUIParseUserNameW(PCWSTR pszUserName, PWSTR pszUser, ULONG ulMaxUserChars, PWSTR pszDomain, ULONG ulMaxDomainChars)
#define IDS_INCORRECTPASSWORD
HWND WINAPI GetParent(_In_ HWND)
#define TTM_TRACKACTIVATE
#define LIST_FOR_EACH_ENTRY_SAFE(cursor, cursor2, list, type, field)
BOOL WINAPI RemoveWindowSubclass(HWND hWnd, SUBCLASSPROC pfnSubclass, UINT_PTR uID)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
int WINAPI GetWindowTextW(HWND hWnd, LPWSTR lpString, int nMaxCount)
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
GLint GLint GLint GLint GLint GLint y
WINE_DEFAULT_DEBUG_CHANNEL(credui)
HWND WINAPI GetFocus(void)
ULONG SEC_ENTRY SspiPromptForCredentialsW(PCWSTR target, void *info, DWORD error, PCWSTR package, PSEC_WINNT_AUTH_IDENTITY_OPAQUE input_id, PSEC_WINNT_AUTH_IDENTITY_OPAQUE *output_id, BOOL *save, DWORD sspi_flags)
DWORD WINAPI CredUIReadSSOCredW(PCWSTR pszRealm, PWSTR *ppszUsername)
#define ERROR_CALL_NOT_IMPLEMENTED
DWORD WINAPI CredUIConfirmCredentialsW(PCWSTR pszTargetName, BOOL bConfirm)
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
#define SetWindowLongPtrW
VOID WINAPI InitCommonControls(void)
#define MAKEINTRESOURCEW(i)
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
#define TOOLID_CAPSLOCKON
void user(int argc, const char *argv[])
_In_ SUBCLASSPROC _In_ UINT_PTR uIdSubclass
#define HeapFree(x, y, z)
#define ERROR_INVALID_FLAGS
#define CREDUI_FLAGS_SHOW_SAVE_CHECK_BOX
static CRITICAL_SECTION_DEBUG critsect_debug
#define ERROR_INSUFFICIENT_BUFFER
#define TOOLID_INCORRECTPASSWORD