| 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 |
| 388 bool SetAppIdForPropertyStore(IPropertyStore* property_store, | 396 bool SetAppIdForPropertyStore(IPropertyStore* property_store, |
| 389 const wchar_t* app_id) { | 397 const wchar_t* app_id) { |
| 390 DCHECK(property_store); | 398 DCHECK(property_store); |
| 391 | 399 |
| 392 // App id should be less than 128 chars and contain no space. And recommended | 400 // App id should be less than 128 chars and contain no space. And recommended |
| 393 // format is CompanyName.ProductName[.SubProduct.ProductNumber]. | 401 // format is CompanyName.ProductName[.SubProduct.ProductNumber]. |
| 394 // See http://msdn.microsoft.com/en-us/library/dd378459%28VS.85%29.aspx | 402 // See http://msdn.microsoft.com/en-us/library/dd378459%28VS.85%29.aspx |
| 395 DCHECK(lstrlen(app_id) < 128 && wcschr(app_id, L' ') == NULL); | 403 DCHECK(lstrlen(app_id) < 128 && wcschr(app_id, L' ') == NULL); |
| 396 | 404 |
| 397 PROPVARIANT property_value; | 405 PROPVARIANT property_value; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 437 | 445 |
| 438 #ifndef COPY_FILE_COPY_SYMLINK | 446 #ifndef COPY_FILE_COPY_SYMLINK |
| 439 #error You must install the Windows 2008 or Vista Software Development Kit and \ | 447 #error You must install the Windows 2008 or Vista Software Development Kit and \ |
| 440 set it as your default include path to build this library. You can grab it by \ | 448 set it as your default include path to build this library. You can grab it by \ |
| 441 searching for "download windows sdk 2008" in your favorite web search engine. \ | 449 searching for "download windows sdk 2008" in your favorite web search engine. \ |
| 442 Also make sure you register the SDK with Visual Studio, by selecting \ | 450 Also make sure you register the SDK with Visual Studio, by selecting \ |
| 443 "Integrate Windows SDK with Visual Studio 2005" from the Windows SDK \ | 451 "Integrate Windows SDK with Visual Studio 2005" from the Windows SDK \ |
| 444 menu (see Start - All Programs - Microsoft Windows SDK - \ | 452 menu (see Start - All Programs - Microsoft Windows SDK - \ |
| 445 Visual Studio Registration). | 453 Visual Studio Registration). |
| 446 #endif | 454 #endif |
| OLD | NEW |