OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #include "base/win_util.h" | 5 #include "base/win_util.h" |
6 | 6 |
7 #include <propvarutil.h> | 7 #include <propvarutil.h> |
8 #include <sddl.h> | 8 #include <sddl.h> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 // The formating failed. simply convert the message value into a string. | 376 // The formating failed. simply convert the message value into a string. |
377 base::SStringPrintf(&formatted_string, L"message number %d", messageid); | 377 base::SStringPrintf(&formatted_string, L"message number %d", messageid); |
378 } | 378 } |
379 return formatted_string; | 379 return formatted_string; |
380 } | 380 } |
381 | 381 |
382 std::wstring FormatLastWin32Error() { | 382 std::wstring FormatLastWin32Error() { |
383 return FormatMessage(GetLastError()); | 383 return FormatMessage(GetLastError()); |
384 } | 384 } |
385 | 385 |
386 WORD KeyboardCodeToWin(base::KeyboardCode keycode) { | 386 WORD KeyboardCodeToWin(app::KeyboardCode keycode) { |
387 return static_cast<WORD>(keycode); | 387 return static_cast<WORD>(keycode); |
388 } | 388 } |
389 | 389 |
390 base::KeyboardCode WinToKeyboardCode(WORD keycode) { | 390 app::KeyboardCode WinToKeyboardCode(WORD keycode) { |
391 return static_cast<base::KeyboardCode>(keycode); | 391 return static_cast<app::KeyboardCode>(keycode); |
392 } | 392 } |
393 | 393 |
394 bool SetAppIdForPropertyStore(IPropertyStore* property_store, | 394 bool SetAppIdForPropertyStore(IPropertyStore* property_store, |
395 const wchar_t* app_id) { | 395 const wchar_t* app_id) { |
396 DCHECK(property_store); | 396 DCHECK(property_store); |
397 | 397 |
398 // App id should be less than 128 chars and contain no space. And recommended | 398 // App id should be less than 128 chars and contain no space. And recommended |
399 // format is CompanyName.ProductName[.SubProduct.ProductNumber]. | 399 // format is CompanyName.ProductName[.SubProduct.ProductNumber]. |
400 // See http://msdn.microsoft.com/en-us/library/dd378459%28VS.85%29.aspx | 400 // See http://msdn.microsoft.com/en-us/library/dd378459%28VS.85%29.aspx |
401 DCHECK(lstrlen(app_id) < 128 && wcschr(app_id, L' ') == NULL); | 401 DCHECK(lstrlen(app_id) < 128 && wcschr(app_id, L' ') == NULL); |
(...skipping 27 matching lines...) Expand all Loading... |
429 | 429 |
430 #ifndef COPY_FILE_COPY_SYMLINK | 430 #ifndef COPY_FILE_COPY_SYMLINK |
431 #error You must install the Windows 2008 or Vista Software Development Kit and \ | 431 #error You must install the Windows 2008 or Vista Software Development Kit and \ |
432 set it as your default include path to build this library. You can grab it by \ | 432 set it as your default include path to build this library. You can grab it by \ |
433 searching for "download windows sdk 2008" in your favorite web search engine. \ | 433 searching for "download windows sdk 2008" in your favorite web search engine. \ |
434 Also make sure you register the SDK with Visual Studio, by selecting \ | 434 Also make sure you register the SDK with Visual Studio, by selecting \ |
435 "Integrate Windows SDK with Visual Studio 2005" from the Windows SDK \ | 435 "Integrate Windows SDK with Visual Studio 2005" from the Windows SDK \ |
436 menu (see Start - All Programs - Microsoft Windows SDK - \ | 436 menu (see Start - All Programs - Microsoft Windows SDK - \ |
437 Visual Studio Registration). | 437 Visual Studio Registration). |
438 #endif | 438 #endif |
OLD | NEW |