ReactOS  0.4.14-dev-614-gbfd8a84
credui_main.c
Go to the documentation of this file.
1 /*
2  * Credentials User Interface
3  *
4  * Copyright 2006 Robert Shearman (for CodeWeavers)
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19  */
20 
21 #include <stdarg.h>
22 #ifdef __REACTOS__
23 #include <wchar.h>
24 #endif
25 
26 #include "windef.h"
27 #include "winbase.h"
28 #include "winnt.h"
29 #include "winuser.h"
30 #include "wincred.h"
31 #include "rpc.h"
32 #include "sspi.h"
33 #include "commctrl.h"
34 
35 #include "credui_resources.h"
36 
37 #include "wine/debug.h"
38 #include "wine/list.h"
39 
41 
42 #define TOOLID_INCORRECTPASSWORD 1
43 #define TOOLID_CAPSLOCKON 2
44 
45 #define ID_CAPSLOCKPOP 1
46 
48 {
49  struct list entry;
53  BOOL generic;
54 };
55 
57 
59 
62 {
63  0, 0, &csPendingCredentials,
65  0, 0, { (DWORD_PTR)(__FILE__ ": csPendingCredentials") }
66 };
67 static CRITICAL_SECTION csPendingCredentials = { &critsect_debug, -1, 0, 0, 0, 0 };
68 
69 
71 {
72  struct pending_credentials *entry, *cursor2;
73  TRACE("(0x%p, %d, %p)\n",hinstDLL,fdwReason,lpvReserved);
74 
75  switch (fdwReason)
76  {
77  case DLL_WINE_PREATTACH:
78  return FALSE; /* prefer native version */
79 
80  case DLL_PROCESS_ATTACH:
81  DisableThreadLibraryCalls(hinstDLL);
82  hinstCredUI = hinstDLL;
84  break;
85 
86  case DLL_PROCESS_DETACH:
87  if (lpvReserved) break;
89  {
90  list_remove(&entry->entry);
91 
92  HeapFree(GetProcessHeap(), 0, entry->pszTargetName);
93  HeapFree(GetProcessHeap(), 0, entry->pszUsername);
94  SecureZeroMemory(entry->pszPassword, lstrlenW(entry->pszPassword) * sizeof(WCHAR));
95  HeapFree(GetProcessHeap(), 0, entry->pszPassword);
97  }
99  break;
100  }
101 
102  return TRUE;
103 }
104 
105 static DWORD save_credentials(PCWSTR pszTargetName, PCWSTR pszUsername,
106  PCWSTR pszPassword, BOOL generic)
107 {
108  CREDENTIALW cred;
109 
110  TRACE("saving servername %s with username %s\n", debugstr_w(pszTargetName), debugstr_w(pszUsername));
111 
112  cred.Flags = 0;
114  cred.TargetName = (LPWSTR)pszTargetName;
115  cred.Comment = NULL;
116  cred.CredentialBlobSize = lstrlenW(pszPassword) * sizeof(WCHAR);
117  cred.CredentialBlob = (LPBYTE)pszPassword;
119  cred.AttributeCount = 0;
120  cred.Attributes = NULL;
121  cred.TargetAlias = NULL;
122  cred.UserName = (LPWSTR)pszUsername;
123 
124  if (CredWriteW(&cred, 0))
125  return ERROR_SUCCESS;
126  else
127  {
128  DWORD ret = GetLastError();
129  ERR("CredWriteW failed with error %d\n", ret);
130  return ret;
131  }
132 }
133 
135 {
148 };
149 
150 static void CredDialogFillUsernameCombo(HWND hwndUsername, const struct cred_dialog_params *params)
151 {
152  DWORD count;
153  DWORD i;
154  PCREDENTIALW *credentials;
155 
156  if (!CredEnumerateW(NULL, 0, &count, &credentials))
157  return;
158 
159  for (i = 0; i < count; i++)
160  {
161  COMBOBOXEXITEMW comboitem;
162  DWORD j;
163  BOOL duplicate = FALSE;
164 
165  if (!credentials[i]->UserName)
166  continue;
167 
169  {
170  if (credentials[i]->Type != CRED_TYPE_GENERIC)
171  {
172  credentials[i]->UserName = NULL;
173  continue;
174  }
175  }
176  else if (credentials[i]->Type == CRED_TYPE_GENERIC)
177  {
178  credentials[i]->UserName = NULL;
179  continue;
180  }
181 
182  /* don't add another item with the same name if we've already added it */
183  for (j = 0; j < i; j++)
184  if (credentials[j]->UserName
185  && !lstrcmpW(credentials[i]->UserName, credentials[j]->UserName))
186  {
187  duplicate = TRUE;
188  break;
189  }
190 
191  if (duplicate)
192  continue;
193 
194  comboitem.mask = CBEIF_TEXT;
195  comboitem.iItem = -1;
196  comboitem.pszText = credentials[i]->UserName;
197  SendMessageW(hwndUsername, CBEM_INSERTITEMW, 0, (LPARAM)&comboitem);
198  }
199 
200  CredFree(credentials);
201 }
202 
204 {
205  TTTOOLINFOW toolinfo;
206  WCHAR wszText[256];
207 
208  if (params->hwndBalloonTip)
209  return;
210 
214  hinstCredUI, NULL);
215  SetWindowPos(params->hwndBalloonTip, HWND_TOPMOST, 0, 0, 0, 0,
217 
218  if (!LoadStringW(hinstCredUI, IDS_INCORRECTPASSWORD, wszText, ARRAY_SIZE(wszText)))
219  {
220  ERR("failed to load IDS_INCORRECTPASSWORD\n");
221  return;
222  }
223 
224  toolinfo.cbSize = sizeof(toolinfo);
225  toolinfo.uFlags = TTF_TRACK;
226  toolinfo.hwnd = hwndDlg;
227  toolinfo.uId = TOOLID_INCORRECTPASSWORD;
228  SetRectEmpty(&toolinfo.rect);
229  toolinfo.hinst = NULL;
230  toolinfo.lpszText = wszText;
231  toolinfo.lParam = 0;
232  toolinfo.lpReserved = NULL;
233  SendMessageW(params->hwndBalloonTip, TTM_ADDTOOLW, 0, (LPARAM)&toolinfo);
234 
235  if (!LoadStringW(hinstCredUI, IDS_CAPSLOCKON, wszText, ARRAY_SIZE(wszText)))
236  {
237  ERR("failed to load IDS_CAPSLOCKON\n");
238  return;
239  }
240 
241  toolinfo.uId = TOOLID_CAPSLOCKON;
242  SendMessageW(params->hwndBalloonTip, TTM_ADDTOOLW, 0, (LPARAM)&toolinfo);
243 }
244 
246 {
247  TTTOOLINFOW toolinfo;
248  RECT rcPassword;
249  INT x;
250  INT y;
251  WCHAR wszTitle[256];
252 
253  /* user name likely wrong so balloon would be confusing. focus is also
254  * not set to the password edit box, so more notification would need to be
255  * handled */
256  if (!params->pszUsername[0])
257  return;
258 
259  /* don't show two balloon tips at once */
260  if (params->fBalloonTipActive)
261  return;
262 
263  if (!LoadStringW(hinstCredUI, IDS_INCORRECTPASSWORDTITLE, wszTitle, ARRAY_SIZE(wszTitle)))
264  {
265  ERR("failed to load IDS_INCORRECTPASSWORDTITLE\n");
266  return;
267  }
268 
270 
271  memset(&toolinfo, 0, sizeof(toolinfo));
272  toolinfo.cbSize = sizeof(toolinfo);
273  toolinfo.hwnd = hwndDlg;
274  toolinfo.uId = TOOLID_INCORRECTPASSWORD;
275 
276  SendMessageW(params->hwndBalloonTip, TTM_SETTITLEW, TTI_ERROR, (LPARAM)wszTitle);
277 
278  GetWindowRect(GetDlgItem(hwndDlg, IDC_PASSWORD), &rcPassword);
279  /* centered vertically and in the right side of the password edit control */
280  x = rcPassword.right - 12;
281  y = (rcPassword.top + rcPassword.bottom) / 2;
282  SendMessageW(params->hwndBalloonTip, TTM_TRACKPOSITION, 0, MAKELONG(x, y));
283 
284  SendMessageW(params->hwndBalloonTip, TTM_TRACKACTIVATE, TRUE, (LPARAM)&toolinfo);
285 
286  params->fBalloonTipActive = TRUE;
287 }
288 
290 {
291  TTTOOLINFOW toolinfo;
292  RECT rcPassword;
293  INT x;
294  INT y;
295  WCHAR wszTitle[256];
296 
297  /* don't show two balloon tips at once */
298  if (params->fBalloonTipActive)
299  return;
300 
301  if (!LoadStringW(hinstCredUI, IDS_CAPSLOCKONTITLE, wszTitle, ARRAY_SIZE(wszTitle)))
302  {
303  ERR("failed to load IDS_IDSCAPSLOCKONTITLE\n");
304  return;
305  }
306 
308 
309  memset(&toolinfo, 0, sizeof(toolinfo));
310  toolinfo.cbSize = sizeof(toolinfo);
311  toolinfo.hwnd = hwndDlg;
312  toolinfo.uId = TOOLID_CAPSLOCKON;
313 
314  SendMessageW(params->hwndBalloonTip, TTM_SETTITLEW, TTI_WARNING, (LPARAM)wszTitle);
315 
316  GetWindowRect(GetDlgItem(hwndDlg, IDC_PASSWORD), &rcPassword);
317  /* just inside the left side of the password edit control */
318  x = rcPassword.left + 12;
319  y = rcPassword.bottom - 3;
320  SendMessageW(params->hwndBalloonTip, TTM_TRACKPOSITION, 0, MAKELONG(x, y));
321 
322  SendMessageW(params->hwndBalloonTip, TTM_TRACKACTIVATE, TRUE, (LPARAM)&toolinfo);
323 
324  SetTimer(hwndDlg, ID_CAPSLOCKPOP,
325  SendMessageW(params->hwndBalloonTip, TTM_GETDELAYTIME, TTDT_AUTOPOP, 0),
326  NULL);
327 
328  params->fBalloonTipActive = TRUE;
329 }
330 
332 {
333  TTTOOLINFOW toolinfo;
334 
335  if (!params->hwndBalloonTip)
336  return;
337 
338  memset(&toolinfo, 0, sizeof(toolinfo));
339 
340  toolinfo.cbSize = sizeof(toolinfo);
341  toolinfo.hwnd = hwndDlg;
342  toolinfo.uId = 0;
343  SendMessageW(params->hwndBalloonTip, TTM_TRACKACTIVATE, FALSE, (LPARAM)&toolinfo);
344  toolinfo.uId = 1;
345  SendMessageW(params->hwndBalloonTip, TTM_TRACKACTIVATE, FALSE, (LPARAM)&toolinfo);
346 
347  params->fBalloonTipActive = FALSE;
348 }
349 
350 static inline BOOL CredDialogCapsLockOn(void)
351 {
352  return (GetKeyState(VK_CAPITAL) & 0x1) != 0;
353 }
354 
357 {
359  switch (uMsg)
360  {
361  case WM_KEYDOWN:
362  if (wParam == VK_CAPITAL)
363  {
364  HWND hwndDlg = GetParent(hwnd);
365  if (CredDialogCapsLockOn())
367  else
369  }
370  break;
371  case WM_DESTROY:
373  break;
374  }
375  return DefSubclassProc(hwnd, uMsg, wParam, lParam);
376 }
377 
379 {
380  HWND hwndUsername = GetDlgItem(hwndDlg, IDC_USERNAME);
381  HWND hwndPassword = GetDlgItem(hwndDlg, IDC_PASSWORD);
382 
384 
385  if (params->hbmBanner)
387  IMAGE_BITMAP, (LPARAM)params->hbmBanner);
388 
389  if (params->pszMessageText)
390  SetDlgItemTextW(hwndDlg, IDC_MESSAGE, params->pszMessageText);
391  else
392  {
393  WCHAR format[256];
394  WCHAR message[256];
396  swprintf(message, format, params->pszTargetName);
398  }
399  SetWindowTextW(hwndUsername, params->pszUsername);
400  SetWindowTextW(hwndPassword, params->pszPassword);
401 
402  CredDialogFillUsernameCombo(hwndUsername, params);
403 
404  if (params->pszUsername[0])
405  {
406  /* prevent showing a balloon tip here */
407  params->fBalloonTipActive = TRUE;
408  SetFocus(hwndPassword);
409  params->fBalloonTipActive = FALSE;
410  }
411  else
412  SetFocus(hwndUsername);
413 
414  if (params->pszCaptionText)
415  SetWindowTextW(hwndDlg, params->pszCaptionText);
416  else
417  {
418  WCHAR format[256];
419  WCHAR title[256];
421  swprintf(title, format, params->pszTargetName);
422  SetWindowTextW(hwndDlg, title);
423  }
424 
425  if (params->dwFlags & CREDUI_FLAGS_PERSIST ||
426  (params->dwFlags & CREDUI_FLAGS_DO_NOT_PERSIST &&
429  else if (params->fSave)
431 
432  /* setup subclassing for Caps Lock detection */
434 
437  else if ((GetFocus() == hwndPassword) && CredDialogCapsLockOn())
439 
440  return FALSE;
441 }
442 
443 static void CredDialogCommandOk(HWND hwndDlg, struct cred_dialog_params *params)
444 {
445  HWND hwndUsername = GetDlgItem(hwndDlg, IDC_USERNAME);
446  LPWSTR user;
447  INT len;
448  INT len2;
449 
450  len = GetWindowTextLengthW(hwndUsername);
451  user = HeapAlloc(GetProcessHeap(), 0, (len + 1) * sizeof(WCHAR));
452  GetWindowTextW(hwndUsername, user, len + 1);
453 
454  if (!user[0])
455  {
457  return;
458  }
459 
460  if (!wcschr(user, '\\') && !wcschr(user, '@'))
461  {
462  ULONG len_target = lstrlenW(params->pszTargetName);
463  memcpy(params->pszUsername, params->pszTargetName,
464  min(len_target, params->ulUsernameMaxChars) * sizeof(WCHAR));
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';
469  }
470  else if (params->ulUsernameMaxChars > 0)
471  params->pszUsername[0] = '\0';
472 
473  len2 = lstrlenW(params->pszUsername);
474  memcpy(params->pszUsername + len2, user, min(len, params->ulUsernameMaxChars - len2) * sizeof(WCHAR));
475  if (params->ulUsernameMaxChars)
476  params->pszUsername[len2 + min(len, params->ulUsernameMaxChars - len2 - 1)] = '\0';
477 
479 
480  GetDlgItemTextW(hwndDlg, IDC_PASSWORD, params->pszPassword,
481  params->ulPasswordMaxChars);
482 
483  params->fSave = IsDlgButtonChecked(hwndDlg, IDC_SAVE) == BST_CHECKED;
484 
485  EndDialog(hwndDlg, IDOK);
486 }
487 
489  LPARAM lParam)
490 {
491  switch (uMsg)
492  {
493  case WM_INITDIALOG:
494  {
496 
497  return CredDialogInit(hwndDlg, params);
498  }
499  case WM_COMMAND:
500  switch (wParam)
501  {
502  case MAKELONG(IDOK, BN_CLICKED):
503  {
504  struct cred_dialog_params *params =
505  (struct cred_dialog_params *)GetWindowLongPtrW(hwndDlg, DWLP_USER);
506  CredDialogCommandOk(hwndDlg, params);
507  return TRUE;
508  }
510  EndDialog(hwndDlg, IDCANCEL);
511  return TRUE;
513  if (CredDialogCapsLockOn())
514  {
515  struct cred_dialog_params *params =
516  (struct cred_dialog_params *)GetWindowLongPtrW(hwndDlg, DWLP_USER);
518  }
519  /* don't allow another window to steal focus while the
520  * user is typing their password */
521  LockSetForegroundWindow(LSFW_LOCK);
522  return TRUE;
524  {
525  struct cred_dialog_params *params =
526  (struct cred_dialog_params *)GetWindowLongPtrW(hwndDlg, DWLP_USER);
527  /* the user is no longer typing their password, so allow
528  * other windows to become foreground ones */
529  LockSetForegroundWindow(LSFW_UNLOCK);
531  return TRUE;
532  }
534  {
535  struct cred_dialog_params *params =
536  (struct cred_dialog_params *)GetWindowLongPtrW(hwndDlg, DWLP_USER);
538  return TRUE;
539  }
540  }
541  return FALSE;
542  case WM_TIMER:
543  if (wParam == ID_CAPSLOCKPOP)
544  {
545  struct cred_dialog_params *params =
546  (struct cred_dialog_params *)GetWindowLongPtrW(hwndDlg, DWLP_USER);
548  return TRUE;
549  }
550  return FALSE;
551  case WM_DESTROY:
552  {
553  struct cred_dialog_params *params =
554  (struct cred_dialog_params *)GetWindowLongPtrW(hwndDlg, DWLP_USER);
555  if (params->hwndBalloonTip) DestroyWindow(params->hwndBalloonTip);
556  return TRUE;
557  }
558  default:
559  return FALSE;
560  }
561 }
562 
564  WCHAR *password, ULONG len_password)
565 {
566  DWORD count, i;
567  CREDENTIALW **credentials;
568 
569  if (!CredEnumerateW(target, 0, &count, &credentials)) return FALSE;
570  for (i = 0; i < count; i++)
571  {
572  if (credentials[i]->Type != CRED_TYPE_DOMAIN_PASSWORD &&
573  credentials[i]->Type != CRED_TYPE_GENERIC)
574  {
575  FIXME("no support for type %u credentials\n", credentials[i]->Type);
576  continue;
577  }
578  if ((!*username || !lstrcmpW(username, credentials[i]->UserName)) &&
579  lstrlenW(credentials[i]->UserName) < len_username &&
580  credentials[i]->CredentialBlobSize / sizeof(WCHAR) < len_password)
581  {
582  TRACE("found existing credential for %s\n", debugstr_w(credentials[i]->UserName));
583 
584  lstrcpyW(username, credentials[i]->UserName);
585  memcpy(password, credentials[i]->CredentialBlob, credentials[i]->CredentialBlobSize);
586  password[credentials[i]->CredentialBlobSize / sizeof(WCHAR)] = 0;
587 
588  CredFree(credentials);
589  return TRUE;
590  }
591  }
592  CredFree(credentials);
593  return FALSE;
594 }
595 
596 /******************************************************************************
597  * CredUIPromptForCredentialsW [CREDUI.@]
598  */
600  PCWSTR pszTargetName,
602  DWORD dwAuthError,
603  PWSTR pszUsername,
604  ULONG ulUsernameMaxChars,
605  PWSTR pszPassword,
606  ULONG ulPasswordMaxChars, PBOOL pfSave,
607  DWORD dwFlags)
608 {
609  INT_PTR ret;
610  struct cred_dialog_params params;
612 
613  TRACE("(%p, %s, %p, %d, %s, %d, %p, %d, %p, 0x%08x)\n", pUIInfo,
614  debugstr_w(pszTargetName), Reserved, dwAuthError, debugstr_w(pszUsername),
615  ulUsernameMaxChars, pszPassword, ulPasswordMaxChars, pfSave, dwFlags);
616 
618  return ERROR_INVALID_FLAGS;
619 
620  if (!pszTargetName)
622 
623  if ((dwFlags & CREDUI_FLAGS_SHOW_SAVE_CHECK_BOX) && !pfSave)
625 
628  find_existing_credential(pszTargetName, pszUsername, ulUsernameMaxChars, pszPassword, ulPasswordMaxChars))
629  return ERROR_SUCCESS;
630 
631  params.pszTargetName = pszTargetName;
632  if (pUIInfo)
633  {
634  params.pszMessageText = pUIInfo->pszMessageText;
635  params.pszCaptionText = pUIInfo->pszCaptionText;
636  params.hbmBanner = pUIInfo->hbmBanner;
637  }
638  else
639  {
640  params.pszMessageText = NULL;
641  params.pszCaptionText = NULL;
642  params.hbmBanner = NULL;
643  }
644  params.pszUsername = pszUsername;
645  params.ulUsernameMaxChars = ulUsernameMaxChars;
646  params.pszPassword = pszPassword;
647  params.ulPasswordMaxChars = ulPasswordMaxChars;
648  params.fSave = pfSave ? *pfSave : FALSE;
649  params.dwFlags = dwFlags;
650  params.hwndBalloonTip = NULL;
651  params.fBalloonTipActive = FALSE;
652 
654  pUIInfo ? pUIInfo->hwndParent : NULL,
656  if (ret <= 0)
657  return GetLastError();
658 
659  if (ret == IDCANCEL)
660  {
661  TRACE("dialog cancelled\n");
662  return ERROR_CANCELLED;
663  }
664 
665  if (pfSave)
666  *pfSave = params.fSave;
667 
668  if (params.fSave)
669  {
671  {
672  BOOL found = FALSE;
673  struct pending_credentials *entry;
674  int len;
675 
677 
678  /* find existing pending credentials for the same target and overwrite */
679  /* FIXME: is this correct? */
681  if (!lstrcmpW(pszTargetName, entry->pszTargetName))
682  {
683  found = TRUE;
684  HeapFree(GetProcessHeap(), 0, entry->pszUsername);
685  SecureZeroMemory(entry->pszPassword, lstrlenW(entry->pszPassword) * sizeof(WCHAR));
686  HeapFree(GetProcessHeap(), 0, entry->pszPassword);
687  }
688 
689  if (!found)
690  {
691  entry = HeapAlloc(GetProcessHeap(), 0, sizeof(*entry));
692  len = lstrlenW(pszTargetName);
693  entry->pszTargetName = HeapAlloc(GetProcessHeap(), 0, (len + 1)*sizeof(WCHAR));
694  memcpy(entry->pszTargetName, pszTargetName, (len + 1)*sizeof(WCHAR));
696  }
697 
698  len = lstrlenW(params.pszUsername);
699  entry->pszUsername = HeapAlloc(GetProcessHeap(), 0, (len + 1)*sizeof(WCHAR));
700  memcpy(entry->pszUsername, params.pszUsername, (len + 1)*sizeof(WCHAR));
701  len = lstrlenW(params.pszPassword);
702  entry->pszPassword = HeapAlloc(GetProcessHeap(), 0, (len + 1)*sizeof(WCHAR));
703  memcpy(entry->pszPassword, params.pszPassword, (len + 1)*sizeof(WCHAR));
704  entry->generic = (dwFlags & CREDUI_FLAGS_GENERIC_CREDENTIALS) != 0;
705 
707  }
708  else if (!(dwFlags & CREDUI_FLAGS_DO_NOT_PERSIST))
709  result = save_credentials(pszTargetName, pszUsername, pszPassword,
711  }
712 
713  return result;
714 }
715 
716 /******************************************************************************
717  * CredUIConfirmCredentialsW [CREDUI.@]
718  */
720 {
721  struct pending_credentials *entry;
723 
724  TRACE("(%s, %s)\n", debugstr_w(pszTargetName), bConfirm ? "TRUE" : "FALSE");
725 
726  if (!pszTargetName)
728 
730 
732  {
733  if (!lstrcmpW(pszTargetName, entry->pszTargetName))
734  {
735  if (bConfirm)
736  result = save_credentials(entry->pszTargetName, entry->pszUsername,
737  entry->pszPassword, entry->generic);
738  else
740 
741  list_remove(&entry->entry);
742 
743  HeapFree(GetProcessHeap(), 0, entry->pszTargetName);
744  HeapFree(GetProcessHeap(), 0, entry->pszUsername);
745  SecureZeroMemory(entry->pszPassword, lstrlenW(entry->pszPassword) * sizeof(WCHAR));
746  HeapFree(GetProcessHeap(), 0, entry->pszPassword);
748 
749  break;
750  }
751  }
752 
754 
755  return result;
756 }
757 
758 /******************************************************************************
759  * CredUIParseUserNameW [CREDUI.@]
760  */
762  ULONG ulMaxUserChars, PWSTR pszDomain,
763  ULONG ulMaxDomainChars)
764 {
765  PWSTR p;
766 
767  TRACE("(%s, %p, %d, %p, %d)\n", debugstr_w(pszUserName), pszUser,
768  ulMaxUserChars, pszDomain, ulMaxDomainChars);
769 
770  if (!pszUserName || !pszUser || !ulMaxUserChars || !pszDomain ||
771  !ulMaxDomainChars)
773 
774  /* FIXME: handle marshaled credentials */
775 
776  p = wcschr(pszUserName, '\\');
777  if (p)
778  {
779  if (p - pszUserName > ulMaxDomainChars - 1)
781  if (lstrlenW(p + 1) > ulMaxUserChars - 1)
783  lstrcpyW(pszUser, p + 1);
784  memcpy(pszDomain, pszUserName, (p - pszUserName)*sizeof(WCHAR));
785  pszDomain[p - pszUserName] = '\0';
786 
787  return ERROR_SUCCESS;
788  }
789 
790  p = wcsrchr(pszUserName, '@');
791  if (p)
792  {
793  if (p + 1 - pszUserName > ulMaxUserChars - 1)
795  if (lstrlenW(p + 1) > ulMaxDomainChars - 1)
797  lstrcpyW(pszDomain, p + 1);
798  memcpy(pszUser, pszUserName, (p - pszUserName)*sizeof(WCHAR));
799  pszUser[p - pszUserName] = '\0';
800 
801  return ERROR_SUCCESS;
802  }
803 
804  if (lstrlenW(pszUserName) > ulMaxUserChars - 1)
806  lstrcpyW(pszUser, pszUserName);
807  pszDomain[0] = '\0';
808 
809  return ERROR_SUCCESS;
810 }
811 
812 /******************************************************************************
813  * CredUIStoreSSOCredA [CREDUI.@]
814  */
816  PCSTR pszPassword, BOOL bPersist)
817 {
818  FIXME("(%s, %s, %p, %d)\n", debugstr_a(pszRealm), debugstr_a(pszUsername),
819  pszPassword, bPersist);
820  return ERROR_SUCCESS;
821 }
822 
823 /******************************************************************************
824  * CredUIStoreSSOCredW [CREDUI.@]
825  */
827  PCWSTR pszPassword, BOOL bPersist)
828 {
829  FIXME("(%s, %s, %p, %d)\n", debugstr_w(pszRealm), debugstr_w(pszUsername),
830  pszPassword, bPersist);
831  return ERROR_SUCCESS;
832 }
833 
834 /******************************************************************************
835  * CredUIReadSSOCredA [CREDUI.@]
836  */
837 DWORD WINAPI CredUIReadSSOCredA(PCSTR pszRealm, PSTR *ppszUsername)
838 {
839  FIXME("(%s, %p)\n", debugstr_a(pszRealm), ppszUsername);
840  if (ppszUsername)
841  *ppszUsername = NULL;
842  return ERROR_NOT_FOUND;
843 }
844 
845 /******************************************************************************
846  * CredUIReadSSOCredW [CREDUI.@]
847  */
848 DWORD WINAPI CredUIReadSSOCredW(PCWSTR pszRealm, PWSTR *ppszUsername)
849 {
850  FIXME("(%s, %p)\n", debugstr_w(pszRealm), ppszUsername);
851  if (ppszUsername)
852  *ppszUsername = NULL;
853  return ERROR_NOT_FOUND;
854 }
855 
856 /******************************************************************************
857  * CredUIInitControls [CREDUI.@]
858  */
860 {
861  FIXME("() stub\n");
862  return TRUE;
863 }
864 
865 /******************************************************************************
866  * SspiPromptForCredentialsW [CREDUI.@]
867  */
869  DWORD error, PCWSTR package,
872  BOOL *save, DWORD sspi_flags )
873 {
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};
879  DWORD len_username = ARRAY_SIZE(username);
880  DWORD len_password = ARRAY_SIZE(password);
881  DWORD ret, flags;
882  CREDUI_INFOW *cred_info = info;
883  SEC_WINNT_AUTH_IDENTITY_W *id = input_id;
884 
885  FIXME( "(%s, %p, %u, %s, %p, %p, %p, %x) stub\n", debugstr_w(target), info,
886  error, debugstr_w(package), input_id, output_id, save, sspi_flags );
887 
888  if (!target) return ERROR_INVALID_PARAMETER;
889  if (!package || (wcsicmp( package, basicW ) && wcsicmp( package, ntlmW ) &&
890  wcsicmp( package, negotiateW )))
891  {
892  FIXME( "package %s not supported\n", debugstr_w(package) );
893  return ERROR_NO_SUCH_PACKAGE;
894  }
895 
897 
898  if (sspi_flags & SSPIPFC_CREDPROV_DO_NOT_SAVE)
900 
901  if (!(sspi_flags & SSPIPFC_NO_CHECKBOX))
903 
904  if (!id) find_existing_credential( target, username, len_username, password, len_password );
905  else
906  {
907  if (id->User && id->UserLength > 0 && id->UserLength <= CREDUI_MAX_USERNAME_LENGTH)
908  {
909  memcpy( username, id->User, id->UserLength * sizeof(WCHAR) );
910  username[id->UserLength] = 0;
911  }
912  if (id->Password && id->PasswordLength > 0 && id->PasswordLength <= CREDUI_MAX_PASSWORD_LENGTH)
913  {
914  memcpy( password, id->Password, id->PasswordLength * sizeof(WCHAR) );
915  password[id->PasswordLength] = 0;
916  }
917  }
918 
919  if (!(ret = CredUIPromptForCredentialsW( cred_info, target, NULL, error, username,
920  len_username, password, len_password, save, flags )))
921  {
922  DWORD size = sizeof(*id), len_domain = 0;
923  WCHAR *ptr, *user = username, *domain = NULL;
924 
925  if ((ptr = wcschr( username, '\\' )))
926  {
927  user = ptr + 1;
928  len_username = lstrlenW( user );
929  if (!wcsicmp( package, ntlmW ) || !wcsicmp( package, negotiateW ))
930  {
931  domain = username;
932  len_domain = ptr - username;
933  }
934  *ptr = 0;
935  }
936  else len_username = lstrlenW( username );
937  len_password = lstrlenW( password );
938 
939  size += (len_username + 1) * sizeof(WCHAR);
940  size += (len_domain + 1) * sizeof(WCHAR);
941  size += (len_password + 1) * sizeof(WCHAR);
942  if (!(id = HeapAlloc( GetProcessHeap(), 0, size ))) return ERROR_OUTOFMEMORY;
943  ptr = (WCHAR *)(id + 1);
944 
945  memcpy( ptr, user, (len_username + 1) * sizeof(WCHAR) );
946  id->User = ptr;
947  id->UserLength = len_username;
948  ptr += len_username + 1;
949  if (len_domain)
950  {
951  memcpy( ptr, domain, (len_domain + 1) * sizeof(WCHAR) );
952  id->Domain = ptr;
953  id->DomainLength = len_domain;
954  ptr += len_domain + 1;
955  }
956  else
957  {
958  id->Domain = NULL;
959  id->DomainLength = 0;
960  }
961  memcpy( ptr, password, (len_password + 1) * sizeof(WCHAR) );
962  id->Password = ptr;
963  id->PasswordLength = len_password;
964  id->Flags = 0;
965 
966  *output_id = id;
967  }
968 
969  return ret;
970 }
971 
972 /******************************************************************************
973  * CredUIPromptForWindowsCredentialsW [CREDUI.@]
974  */
976  const void *in_buf, ULONG in_buf_size, void **out_buf,
977  ULONG *out_buf_size, BOOL *save, DWORD flags )
978 {
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 );
982 }
983 
984 /******************************************************************************
985  * CredPackAuthenticationBufferW [CREDUI.@]
986  */
988  DWORD *size )
989 {
990  FIXME( "(%08x, %s, %p, %p, %p) stub\n", flags, debugstr_w(username), password, buf, size );
992 }
993 
994 /******************************************************************************
995  * CredUnPackAuthenticationBufferW [CREDUI.@]
996  */
998  DWORD *len_username, WCHAR *domain, DWORD *len_domain,
999  WCHAR *password, DWORD *len_password )
1000 {
1001  FIXME( "(%08x, %p, %u, %p, %p, %p, %p, %p, %p) stub\n", flags, buf, size, username, len_username,
1002  domain, len_domain, password, len_password );
1004 }
static const WCHAR basicW[]
#define TTM_GETDELAYTIME
Definition: commctrl.h:1812
static LRESULT CALLBACK CredDialogPasswordSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, UINT_PTR uIdSubclass, DWORD_PTR dwRefData)
Definition: credui_main.c:355
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
DWORD CredentialBlobSize
Definition: wincred.h:89
PCWSTR pszCaptionText
Definition: wincred.h:146
#define SSPIPFC_CREDPROV_DO_NOT_SAVE
Definition: sspi.h:80
LPBYTE CredentialBlob
Definition: wincred.h:90
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
BOOL WINAPI CheckDlgButton(_In_ HWND, _In_ int, _In_ UINT)
#define IDS_CAPSLOCKON
const uint16_t * PCWSTR
Definition: typedefs.h:55
#define CREDUI_FLAGS_PERSIST
Definition: wincred.h:234
#define IDS_CAPSLOCKONTITLE
static void CredDialogShowCapsLockBalloon(HWND hwndDlg, struct cred_dialog_params *params)
Definition: credui_main.c:289
Definition: tftpd.h:59
UINT WINAPI GetDlgItemTextW(HWND hDlg, int nIDDlgItem, LPWSTR lpString, int nMaxCount)
Definition: dialog.c:2265
#define TRUE
Definition: types.h:120
static DWORD save_credentials(PCWSTR pszTargetName, PCWSTR pszUsername, PCWSTR pszPassword, BOOL generic)
Definition: credui_main.c:105
#define IDOK
Definition: winuser.h:824
INT_PTR WINAPI DialogBoxParamW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_opt_ HWND, _In_opt_ DLGPROC, _In_ LPARAM)
#define IDS_MESSAGEFORMAT
Type
Definition: Type.h:6
#define ERROR_SUCCESS
Definition: deptool.c:10
#define DWORD_PTR
Definition: treelist.c:76
#define error(str)
Definition: mkdosfs.c:1605
static INT_PTR CALLBACK CredDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: credui_main.c:488
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
DWORD WINAPI CredUIPromptForCredentialsW(PCREDUI_INFOW pUIInfo, PCWSTR pszTargetName, PCtxtHandle Reserved, DWORD dwAuthError, PWSTR pszUsername, ULONG ulUsernameMaxChars, PWSTR pszPassword, ULONG ulPasswordMaxChars, PBOOL pfSave, DWORD dwFlags)
Definition: credui_main.c:599
static BOOL CredDialogCapsLockOn(void)
Definition: credui_main.c:350
#define SW_HIDE
Definition: winuser.h:762
#define SecureZeroMemory
Definition: winbase.h:1643
uint16_t * PWSTR
Definition: typedefs.h:54
#define IDS_INCORRECTPASSWORDTITLE
#define IDB_BANNER
static CRITICAL_SECTION csPendingCredentials
Definition: credui_main.c:60
int WINAPI lstrcmpW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:170
GLuint GLuint GLsizei count
Definition: gl.h:1545
static HINSTANCE hinstCredUI
Definition: credui_main.c:56
static void CredDialogShowIncorrectPasswordBalloon(HWND hwndDlg, struct cred_dialog_params *params)
Definition: credui_main.c:245
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG x1
Definition: winddi.h:3706
_In_ SUBCLASSPROC _In_ UINT_PTR _In_ DWORD_PTR dwRefData
Definition: commctrl.h:5052
HBITMAP hbmBanner
Definition: wincred.h:147
#define CREDUI_FLAGS_INCORRECT_PASSWORD
Definition: wincred.h:223
#define TTM_TRACKPOSITION
Definition: commctrl.h:1809
#define CREDUI_FLAGS_GENERIC_CREDENTIALS
Definition: wincred.h:237
#define CALLBACK
Definition: compat.h:27
#define IDC_MESSAGE
Definition: resource.h:22
LONG top
Definition: windef.h:307
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
Definition: loader.c:85
BOOL WINAPI CredUIInitControls(void)
Definition: credui_main.c:859
DWORD WINAPI CredUIReadSSOCredA(PCSTR pszRealm, PSTR *ppszUsername)
Definition: credui_main.c:837
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
#define IDD_CREDDIALOG
#define HWND_TOPMOST
Definition: winuser.h:1194
BOOL WINAPI CredEnumerateW(LPCWSTR Filter, DWORD Flags, DWORD *Count, PCREDENTIALW **Credentials)
Definition: cred.c:1289
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
PCWSTR pszMessageText
Definition: wincred.h:145
HWND WINAPI SetFocus(_In_opt_ HWND)
#define DLL_PROCESS_ATTACH
Definition: compat.h:120
BOOL WINAPI SetWindowTextW(_In_ HWND, _In_opt_ LPCWSTR)
UINT_PTR WPARAM
Definition: windef.h:207
#define TTS_BALLOON
Definition: commctrl.h:1757
#define GetWindowLongPtrW
Definition: winuser.h:4804
LONG left
Definition: windef.h:306
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
DWORD AttributeCount
Definition: wincred.h:92
int32_t INT_PTR
Definition: typedefs.h:62
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
static BOOL find_existing_credential(const WCHAR *target, WCHAR *username, ULONG len_username, WCHAR *password, ULONG len_password)
Definition: credui_main.c:563
LONG right
Definition: windef.h:308
#define IDC_SAVE
Definition: resource.h:16
#define lstrlenW
Definition: compat.h:415
BOOL WINAPI DestroyWindow(_In_ HWND)
#define WS_EX_TOOLWINDOW
Definition: winuser.h:404
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
int32_t INT
Definition: typedefs.h:56
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)
Definition: credui_main.c:975
LPWSTR UserName
Definition: wincred.h:95
static void CredDialogCreateBalloonTip(HWND hwndDlg, struct cred_dialog_params *params)
Definition: credui_main.c:203
static void CredDialogHideBalloonTip(HWND hwndDlg, struct cred_dialog_params *params)
Definition: credui_main.c:331
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
WPARAM wParam
Definition: combotst.c:138
struct list entry
Definition: credui_main.c:49
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
static IN DWORD IN LPVOID lpvReserved
#define IDS_TITLEFORMAT
static const WCHAR negotiateW[]
BOOL WINAPI CredWriteW(PCREDENTIALW Credential, DWORD Flags)
Definition: cred.c:1809
struct _test_info info[]
Definition: SetCursorPos.c:19
Definition: cookie.c:41
BOOL WINAPI SetDlgItemTextW(_In_ HWND, _In_ int, _In_ LPCWSTR)
__WINE_SERVER_LIST_INLINE void list_add_tail(struct list *list, struct list *elem)
Definition: list.h:102
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
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
Definition: glfuncs.h:248
#define EN_KILLFOCUS
Definition: winuser.h:2007
LPWSTR lpszText
Definition: commctrl.h:1742
#define EN_SETFOCUS
Definition: winuser.h:2009
unsigned char * LPBYTE
Definition: typedefs.h:52
#define CREDUI_FLAGS_DO_NOT_PERSIST
Definition: wincred.h:224
GLenum const GLfloat * params
Definition: glext.h:5645
unsigned int BOOL
Definition: ntddk_ex.h:94
BOOL WINAPI CredUnPackAuthenticationBufferW(DWORD flags, void *buf, DWORD size, WCHAR *username, DWORD *len_username, WCHAR *domain, DWORD *len_domain, WCHAR *password, DWORD *len_password)
Definition: credui_main.c:997
#define CBEIF_TEXT
Definition: commctrl.h:3782
void * lpReserved
Definition: commctrl.h:1744
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
Definition: credui_main.c:70
#define CREDUI_MAX_USERNAME_LENGTH
Definition: wincred.h:193
#define debugstr_w
Definition: kernel32.h:32
static void CredDialogFillUsernameCombo(HWND hwndUsername, const struct cred_dialog_params *params)
Definition: credui_main.c:150
#define FIXME(fmt,...)
Definition: debug.h:110
static PVOID ptr
Definition: dispmode.c:27
#define CREDUI_MAX_PASSWORD_LENGTH
Definition: wincred.h:194
#define CW_USEDEFAULT
Definition: winuser.h:225
#define MAKELONG(a, b)
Definition: typedefs.h:248
static struct list pending_credentials_list
Definition: credui_main.c:58
smooth NULL
Definition: ftsmooth.c:416
DWORD WINAPI CredUIStoreSSOCredW(PCWSTR pszRealm, PCWSTR pszUsername, PCWSTR pszPassword, BOOL bPersist)
Definition: credui_main.c:826
#define WM_KEYDOWN
Definition: winuser.h:1697
LONG_PTR LPARAM
Definition: windef.h:208
_Check_return_ _CRTIMP _CONST_RETURN wchar_t *__cdecl wcsrchr(_In_z_ const wchar_t *_Str, _In_ wchar_t _Ch)
_Reserved_ PVOID Reserved
Definition: winddi.h:3974
LRESULT WINAPI DefSubclassProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: commctrl.c:1496
BOOL WINAPI LockSetForegroundWindow(UINT uLockCode)
Definition: window.c:1642
static const WCHAR ntlmW[]
BOOL * PBOOL
Definition: windef.h:161
UINT WINAPI IsDlgButtonChecked(_In_ HWND, _In_ int)
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
#define WM_DESTROY
Definition: winuser.h:1591
#define CRED_TYPE_DOMAIN_PASSWORD
Definition: wincred.h:205
#define DLL_PROCESS_DETACH
Definition: compat.h:119
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
Definition: glfuncs.h:250
SHORT WINAPI GetKeyState(_In_ int)
#define SEC_ENTRY
Definition: stubs.c:6
static WCHAR username[]
Definition: url.c:32
BOOL WINAPI SetWindowSubclass(HWND hWnd, SUBCLASSPROC pfnSubclass, UINT_PTR uIDSubclass, DWORD_PTR dwRef)
Definition: commctrl.c:1261
static void CredDialogCommandOk(HWND hwndDlg, struct cred_dialog_params *params)
Definition: credui_main.c:443
#define TTF_TRACK
Definition: commctrl.h:1764
#define CREDUI_FLAGS_EXPECT_CONFIRMATION
Definition: wincred.h:236
__WINE_SERVER_LIST_INLINE void list_remove(struct list *elem)
Definition: list.h:108
#define CRED_PERSIST_ENTERPRISE
Definition: wincred.h:216
#define SSPIPFC_NO_CHECKBOX
Definition: sspi.h:81
#define TRACE(s)
Definition: solgame.cpp:4
#define TTM_SETTITLEW
Definition: commctrl.h:1824
GLsizeiptr size
Definition: glext.h:5919
#define GetProcessHeap()
Definition: compat.h:403
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)
Definition: cred.c:1395
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define LIST_INIT(head)
Definition: queue.h:197
DWORD Flags
Definition: wincred.h:84
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define CREDUI_FLAGS_ALWAYS_SHOW_UI
Definition: wincred.h:229
void WINAPI DeleteCriticalSection(PCRITICAL_SECTION)
#define debugstr_a
Definition: kernel32.h:31
#define SWP_NOACTIVATE
Definition: winuser.h:1227
#define TTI_WARNING
Definition: commctrl.h:1777
#define WM_TIMER
Definition: winuser.h:1724
LPWSTR TargetAlias
Definition: wincred.h:94
UINT_PTR uId
Definition: commctrl.h:1739
LPWSTR TargetName
Definition: wincred.h:86
#define swprintf(buf, format,...)
Definition: sprintf.c:56
int WINAPI GetWindowTextLengthW(_In_ HWND)
#define WINAPI
Definition: msvc.h:6
#define BN_CLICKED
Definition: winuser.h:1907
unsigned long DWORD
Definition: ntddk_ex.h:95
#define ID_CAPSLOCKPOP
Definition: credui_main.c:45
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
#define TOOLTIPS_CLASSW
Definition: commctrl.h:1703
GLbitfield flags
Definition: glext.h:7161
static BOOL CredDialogInit(HWND hwndDlg, struct cred_dialog_params *params)
Definition: credui_main.c:378
#define ERROR_NO_SUCH_PACKAGE
Definition: winerror.h:845
PCREDENTIAL_ATTRIBUTEW Attributes
Definition: wincred.h:93
#define IDC_USERNAME
Definition: resource.h:77
int ret
DWORD WINAPI CredUIStoreSSOCredA(PCSTR pszRealm, PCSTR pszUsername, PCSTR pszPassword, BOOL bPersist)
Definition: credui_main.c:815
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
Definition: t1tokens.h:64
#define DWLP_USER
Definition: winuser.h:866
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
#define CRED_TYPE_GENERIC
Definition: wincred.h:204
uint32_t entry
Definition: isohybrid.c:63
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum GLsizei len
Definition: glext.h:6722
unsigned char BYTE
Definition: mem.h:68
Definition: _list.h:228
HWND hwndParent
Definition: wincred.h:144
BOOL WINAPI CredPackAuthenticationBufferW(DWORD flags, WCHAR *username, WCHAR *password, BYTE *buf, DWORD *size)
Definition: credui_main.c:987
BOOL WINAPI SetRectEmpty(_Out_ LPRECT)
#define WM_COMMAND
Definition: winuser.h:1722
DWORD Type
Definition: wincred.h:85
LIST_ENTRY ProcessLocksList
Definition: winbase.h:855
uint32_t DWORD_PTR
Definition: typedefs.h:63
DWORD WINAPI CredUIParseUserNameW(PCWSTR pszUserName, PWSTR pszUser, ULONG ulMaxUserChars, PWSTR pszDomain, ULONG ulMaxDomainChars)
Definition: credui_main.c:761
#define wcsicmp
Definition: string.h:1152
DWORD Persist
Definition: wincred.h:91
HINSTANCE hinst
Definition: commctrl.h:1741
#define IDS_INCORRECTPASSWORD
#define SWP_NOSIZE
Definition: winuser.h:1230
#define ERR(fmt,...)
Definition: debug.h:109
HWND WINAPI GetParent(_In_ HWND)
#define TTM_TRACKACTIVATE
Definition: commctrl.h:1808
#define LIST_FOR_EACH_ENTRY_SAFE(cursor, cursor2, list, type, field)
Definition: list.h:204
#define CBEM_INSERTITEMW
Definition: commctrl.h:3837
BOOL WINAPI RemoveWindowSubclass(HWND hWnd, SUBCLASSPROC pfnSubclass, UINT_PTR uID)
Definition: commctrl.c:1390
#define lstrcpyW
Definition: compat.h:414
#define ERROR_CANCELLED
Definition: winerror.h:726
int WINAPI GetWindowTextW(HWND hWnd, LPWSTR lpString, int nMaxCount)
Definition: window.c:1408
#define ARRAY_SIZE(a)
Definition: main.h:24
#define TTM_ADDTOOLW
Definition: commctrl.h:1783
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
signed char * PSTR
Definition: retypes.h:7
#define VK_CAPITAL
Definition: winuser.h:2181
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define min(a, b)
Definition: monoChain.cc:55
#define WS_POPUP
Definition: pedump.c:616
unsigned int UINT
Definition: ndis.h:50
#define IMAGE_BITMAP
Definition: winuser.h:211
#define ERROR_NOT_FOUND
Definition: winerror.h:690
#define STM_SETIMAGE
Definition: winuser.h:2075
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
#define BST_CHECKED
Definition: winuser.h:197
WINE_DEFAULT_DEBUG_CHANNEL(credui)
HWND WINAPI GetFocus(void)
Definition: window.c:1905
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)
Definition: credui_main.c:868
unsigned int ULONG
Definition: retypes.h:1
GLenum GLuint id
Definition: glext.h:5579
GLenum target
Definition: glext.h:7315
DWORD WINAPI CredUIReadSSOCredW(PCWSTR pszRealm, PWSTR *ppszUsername)
Definition: credui_main.c:848
#define TTI_ERROR
Definition: commctrl.h:1778
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:92
LONG bottom
Definition: windef.h:309
DWORD WINAPI CredUIConfirmCredentialsW(PCWSTR pszTargetName, BOOL bConfirm)
Definition: credui_main.c:719
#define SWP_NOMOVE
Definition: winuser.h:1229
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
Definition: winuser.h:5321
static HBITMAP
Definition: button.c:44
VOID WINAPI InitCommonControls(void)
Definition: commctrl.c:863
const char * PCSTR
Definition: typedefs.h:51
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
GLfloat GLfloat p
Definition: glext.h:8902
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define IDCANCEL
Definition: winuser.h:825
LONG_PTR LRESULT
Definition: windef.h:209
#define TOOLID_CAPSLOCKON
Definition: credui_main.c:43
GLuint64EXT * result
Definition: glext.h:11304
#define memset(x, y, z)
Definition: compat.h:39
#define WM_INITDIALOG
Definition: winuser.h:1721
LPARAM lParam
Definition: combotst.c:139
static char title[]
Definition: ps.c:92
void user(int argc, const char *argv[])
Definition: cmds.c:1350
#define TTS_NOPREFIX
Definition: commctrl.h:1754
_In_ SUBCLASSPROC _In_ UINT_PTR uIdSubclass
Definition: commctrl.h:5052
#define HeapFree(x, y, z)
Definition: compat.h:402
#define ERROR_INVALID_FLAGS
Definition: winerror.h:583
#define CREDUI_FLAGS_SHOW_SAVE_CHECK_BOX
Definition: wincred.h:228
#define TTDT_AUTOPOP
Definition: commctrl.h:1772
LPWSTR Comment
Definition: wincred.h:87
#define IDC_PASSWORD
Definition: resource.h:12
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13
static CRITICAL_SECTION_DEBUG critsect_debug
Definition: credui_main.c:61
LPARAM lParam
Definition: commctrl.h:1743
#define ERROR_INSUFFICIENT_BUFFER
Definition: dderror.h:10
#define TOOLID_INCORRECTPASSWORD
Definition: credui_main.c:42
#define EN_CHANGE
Definition: winuser.h:2004