| 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 "content/child/npapi/webplugin_delegate_impl.h" | 5 #include "content/child/npapi/webplugin_delegate_impl.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 return L""; | 162 return L""; |
| 163 | 163 |
| 164 ZwQueryKeyType func = reinterpret_cast<ZwQueryKeyType>( | 164 ZwQueryKeyType func = reinterpret_cast<ZwQueryKeyType>( |
| 165 ::GetProcAddress(dll, "ZwQueryKey")); | 165 ::GetProcAddress(dll, "ZwQueryKey")); |
| 166 if (func == NULL) | 166 if (func == NULL) |
| 167 return L""; | 167 return L""; |
| 168 | 168 |
| 169 DWORD size = 0; | 169 DWORD size = 0; |
| 170 DWORD result = 0; | 170 DWORD result = 0; |
| 171 result = func(key, KeyNameInformation, 0, 0, &size); | 171 result = func(key, KeyNameInformation, 0, 0, &size); |
| 172 if (result != STATUS_BUFFER_TOO_SMALL) | 172 if (result != static_cast<DWORD>(STATUS_BUFFER_TOO_SMALL)) |
| 173 return L""; | 173 return L""; |
| 174 | 174 |
| 175 scoped_ptr<char[]> buffer(new char[size]); | 175 scoped_ptr<char[]> buffer(new char[size]); |
| 176 if (buffer.get() == NULL) | 176 if (buffer.get() == NULL) |
| 177 return L""; | 177 return L""; |
| 178 | 178 |
| 179 result = func(key, KeyNameInformation, buffer.get(), size, &size); | 179 result = func(key, KeyNameInformation, buffer.get(), size, &size); |
| 180 if (result != STATUS_SUCCESS) | 180 if (result != static_cast<DWORD>(STATUS_SUCCESS)) |
| 181 return L""; | 181 return L""; |
| 182 | 182 |
| 183 KEY_NAME_INFORMATION* info = | 183 KEY_NAME_INFORMATION* info = |
| 184 reinterpret_cast<KEY_NAME_INFORMATION*>(buffer.get()); | 184 reinterpret_cast<KEY_NAME_INFORMATION*>(buffer.get()); |
| 185 return std::wstring(info->Name, info->NameLength / sizeof(wchar_t)); | 185 return std::wstring(info->Name, info->NameLength / sizeof(wchar_t)); |
| 186 } | 186 } |
| 187 | 187 |
| 188 uint32_t GetPluginMajorVersion(const WebPluginInfo& plugin_info) { | 188 uint32_t GetPluginMajorVersion(const WebPluginInfo& plugin_info) { |
| 189 Version plugin_version; | 189 Version plugin_version; |
| 190 WebPluginInfo::CreateVersionFromString(plugin_info.version, &plugin_version); | 190 WebPluginInfo::CreateVersionFromString(plugin_info.version, &plugin_version); |
| (...skipping 1291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1482 case WM_RBUTTONUP: | 1482 case WM_RBUTTONUP: |
| 1483 ::ReleaseCapture(); | 1483 ::ReleaseCapture(); |
| 1484 break; | 1484 break; |
| 1485 | 1485 |
| 1486 default: | 1486 default: |
| 1487 break; | 1487 break; |
| 1488 } | 1488 } |
| 1489 } | 1489 } |
| 1490 | 1490 |
| 1491 } // namespace content | 1491 } // namespace content |
| OLD | NEW |