| 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 <aclapi.h> | 7 #include <aclapi.h> |
| 8 #include <propvarutil.h> | 8 #include <propvarutil.h> |
| 9 #include <sddl.h> | 9 #include <sddl.h> |
| 10 #include <shlobj.h> | 10 #include <shlobj.h> |
| (...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 378 // The formating failed. simply convert the message value into a string. | 378 // The formating failed. simply convert the message value into a string. |
| 379 base::SStringPrintf(&formatted_string, L"message number %d", messageid); | 379 base::SStringPrintf(&formatted_string, L"message number %d", messageid); |
| 380 } | 380 } |
| 381 return formatted_string; | 381 return formatted_string; |
| 382 } | 382 } |
| 383 | 383 |
| 384 std::wstring FormatLastWin32Error() { | 384 std::wstring FormatLastWin32Error() { |
| 385 return FormatMessage(GetLastError()); | 385 return FormatMessage(GetLastError()); |
| 386 } | 386 } |
| 387 | 387 |
| 388 WORD KeyboardCodeToWin(base::KeyboardCode keycode) { | |
| 389 return static_cast<WORD>(keycode); | |
| 390 } | |
| 391 | |
| 392 base::KeyboardCode WinToKeyboardCode(WORD keycode) { | |
| 393 return static_cast<base::KeyboardCode>(keycode); | |
| 394 } | |
| 395 | |
| 396 bool SetAppIdForPropertyStore(IPropertyStore* property_store, | 388 bool SetAppIdForPropertyStore(IPropertyStore* property_store, |
| 397 const wchar_t* app_id) { | 389 const wchar_t* app_id) { |
| 398 DCHECK(property_store); | 390 DCHECK(property_store); |
| 399 | 391 |
| 400 // App id should be less than 128 chars and contain no space. And recommended | 392 // App id should be less than 128 chars and contain no space. And recommended |
| 401 // format is CompanyName.ProductName[.SubProduct.ProductNumber]. | 393 // format is CompanyName.ProductName[.SubProduct.ProductNumber]. |
| 402 // See http://msdn.microsoft.com/en-us/library/dd378459%28VS.85%29.aspx | 394 // See http://msdn.microsoft.com/en-us/library/dd378459%28VS.85%29.aspx |
| 403 DCHECK(lstrlen(app_id) < 128 && wcschr(app_id, L' ') == NULL); | 395 DCHECK(lstrlen(app_id) < 128 && wcschr(app_id, L' ') == NULL); |
| 404 | 396 |
| 405 PROPVARIANT property_value; | 397 PROPVARIANT property_value; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 445 | 437 |
| 446 #ifndef COPY_FILE_COPY_SYMLINK | 438 #ifndef COPY_FILE_COPY_SYMLINK |
| 447 #error You must install the Windows 2008 or Vista Software Development Kit and \ | 439 #error You must install the Windows 2008 or Vista Software Development Kit and \ |
| 448 set it as your default include path to build this library. You can grab it by \ | 440 set it as your default include path to build this library. You can grab it by \ |
| 449 searching for "download windows sdk 2008" in your favorite web search engine. \ | 441 searching for "download windows sdk 2008" in your favorite web search engine. \ |
| 450 Also make sure you register the SDK with Visual Studio, by selecting \ | 442 Also make sure you register the SDK with Visual Studio, by selecting \ |
| 451 "Integrate Windows SDK with Visual Studio 2005" from the Windows SDK \ | 443 "Integrate Windows SDK with Visual Studio 2005" from the Windows SDK \ |
| 452 menu (see Start - All Programs - Microsoft Windows SDK - \ | 444 menu (see Start - All Programs - Microsoft Windows SDK - \ |
| 453 Visual Studio Registration). | 445 Visual Studio Registration). |
| 454 #endif | 446 #endif |
| OLD | NEW |