OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "stdafx.h" | 5 #include "stdafx.h" |
6 #include "win8/metro_driver/metro_driver.h" | 6 #include "win8/metro_driver/metro_driver.h" |
7 | 7 |
8 #include <roerrorapi.h> | 8 #include <roerrorapi.h> |
9 #include <shobjidl.h> | 9 #include <shobjidl.h> |
10 | 10 |
(...skipping 12 matching lines...) Expand all Loading... |
23 #pragma comment(lib, "runtimeobject.lib") | 23 #pragma comment(lib, "runtimeobject.lib") |
24 | 24 |
25 namespace { | 25 namespace { |
26 | 26 |
27 LONG WINAPI ErrorReportingHandler(EXCEPTION_POINTERS* ex_info) { | 27 LONG WINAPI ErrorReportingHandler(EXCEPTION_POINTERS* ex_info) { |
28 // See roerrorapi.h for a description of the | 28 // See roerrorapi.h for a description of the |
29 // exception codes and parameters. | 29 // exception codes and parameters. |
30 DWORD code = ex_info->ExceptionRecord->ExceptionCode; | 30 DWORD code = ex_info->ExceptionRecord->ExceptionCode; |
31 ULONG_PTR* info = ex_info->ExceptionRecord->ExceptionInformation; | 31 ULONG_PTR* info = ex_info->ExceptionRecord->ExceptionInformation; |
32 if (code == EXCEPTION_RO_ORIGINATEERROR) { | 32 if (code == EXCEPTION_RO_ORIGINATEERROR) { |
33 string16 msg(reinterpret_cast<wchar_t*>(info[2]), info[1]); | 33 base::string16 msg(reinterpret_cast<wchar_t*>(info[2]), info[1]); |
34 LOG(ERROR) << "VEH: Metro error 0x" << std::hex << info[0] << ": " << msg; | 34 LOG(ERROR) << "VEH: Metro error 0x" << std::hex << info[0] << ": " << msg; |
35 } else if (code == EXCEPTION_RO_TRANSFORMERROR) { | 35 } else if (code == EXCEPTION_RO_TRANSFORMERROR) { |
36 string16 msg(reinterpret_cast<wchar_t*>(info[3]), info[2]); | 36 base::string16 msg(reinterpret_cast<wchar_t*>(info[3]), info[2]); |
37 LOG(ERROR) << "VEH: Metro old error 0x" << std::hex << info[0] | 37 LOG(ERROR) << "VEH: Metro old error 0x" << std::hex << info[0] |
38 << " new error 0x" << info[1] << ": " << msg; | 38 << " new error 0x" << info[1] << ": " << msg; |
39 } | 39 } |
40 | 40 |
41 return EXCEPTION_CONTINUE_SEARCH; | 41 return EXCEPTION_CONTINUE_SEARCH; |
42 } | 42 } |
43 | 43 |
44 // TODO(robertshield): This GUID is hard-coded in a bunch of places that | 44 // TODO(robertshield): This GUID is hard-coded in a bunch of places that |
45 // don't allow explicit includes. Find a single place for it to live. | 45 // don't allow explicit includes. Find a single place for it to live. |
46 // {7FE69228-633E-4f06-80C1-527FEA23E3A7} | 46 // {7FE69228-633E-4f06-80C1-527FEA23E3A7} |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 extern "C" __declspec(dllexport) | 115 extern "C" __declspec(dllexport) |
116 HRESULT ActivateApplication(const wchar_t* app_id) { | 116 HRESULT ActivateApplication(const wchar_t* app_id) { |
117 base::win::ScopedComPtr<IApplicationActivationManager> activator; | 117 base::win::ScopedComPtr<IApplicationActivationManager> activator; |
118 HRESULT hr = activator.CreateInstance(CLSID_ApplicationActivationManager); | 118 HRESULT hr = activator.CreateInstance(CLSID_ApplicationActivationManager); |
119 if (SUCCEEDED(hr)) { | 119 if (SUCCEEDED(hr)) { |
120 DWORD pid = 0; | 120 DWORD pid = 0; |
121 hr = activator->ActivateApplication(app_id, L"", AO_NONE, &pid); | 121 hr = activator->ActivateApplication(app_id, L"", AO_NONE, &pid); |
122 } | 122 } |
123 return hr; | 123 return hr; |
124 } | 124 } |
OLD | NEW |