OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // windows.h must be first otherwise Win8 SDK breaks. | 5 // windows.h must be first otherwise Win8 SDK breaks. |
6 #include <windows.h> | 6 #include <windows.h> |
7 #include <wincred.h> | 7 #include <wincred.h> |
8 #include <LM.h> | 8 #include <LM.h> |
9 | 9 |
10 // SECURITY_WIN32 must be defined in order to get | 10 // SECURITY_WIN32 must be defined in order to get |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 } | 179 } |
180 | 180 |
181 // Try and obtain a friendly display name. | 181 // Try and obtain a friendly display name. |
182 username_length = CREDUI_MAX_USERNAME_LENGTH; | 182 username_length = CREDUI_MAX_USERNAME_LENGTH; |
183 if (GetUserNameEx(NameDisplay, displayname, &username_length)) | 183 if (GetUserNameEx(NameDisplay, displayname, &username_length)) |
184 use_displayname = true; | 184 use_displayname = true; |
185 | 185 |
186 cui.cbSize = sizeof(CREDUI_INFO); | 186 cui.cbSize = sizeof(CREDUI_INFO); |
187 cui.hwndParent = NULL; | 187 cui.hwndParent = NULL; |
188 #if defined(USE_AURA) | 188 #if defined(USE_AURA) |
189 cui.hwndParent = window->GetDispatcher()->host()->GetAcceleratedWidget(); | 189 cui.hwndParent = window->GetHost()->GetAcceleratedWidget(); |
190 #else | 190 #else |
191 cui.hwndParent = window; | 191 cui.hwndParent = window; |
192 #endif | 192 #endif |
193 | 193 |
194 cui.pszMessageText = password_prompt.c_str(); | 194 cui.pszMessageText = password_prompt.c_str(); |
195 cui.pszCaptionText = product_name.c_str(); | 195 cui.pszCaptionText = product_name.c_str(); |
196 | 196 |
197 cui.hbmBanner = NULL; | 197 cui.hbmBanner = NULL; |
198 BOOL save_password = FALSE; | 198 BOOL save_password = FALSE; |
199 DWORD credErr = NO_ERROR; | 199 DWORD credErr = NO_ERROR; |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 } | 235 } |
236 } | 236 } |
237 SecureZeroMemory(password, sizeof(password)); | 237 SecureZeroMemory(password, sizeof(password)); |
238 } | 238 } |
239 } while (credErr == NO_ERROR && | 239 } while (credErr == NO_ERROR && |
240 (retval == false && tries < kMaxPasswordRetries)); | 240 (retval == false && tries < kMaxPasswordRetries)); |
241 return retval; | 241 return retval; |
242 } | 242 } |
243 | 243 |
244 } // namespace password_manager_util | 244 } // namespace password_manager_util |
OLD | NEW |