| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // This file contains utility functions for accessing resources in external | 5 // This file contains utility functions for accessing resources in external |
| 6 // files (DLLs) or embedded in the executable itself. | 6 // files (DLLs) or embedded in the executable itself. |
| 7 | 7 |
| 8 #ifndef BASE_WIN_RESOURCE_UTIL_H__ | 8 #ifndef BASE_WIN_RESOURCE_UTIL_H__ |
| 9 #define BASE_WIN_RESOURCE_UTIL_H__ | 9 #define BASE_WIN_RESOURCE_UTIL_H__ |
| 10 | 10 |
| 11 #include <windows.h> | 11 #include <windows.h> |
| 12 | 12 |
| 13 #include "base/base_export.h" | 13 #include "base/base_export.h" |
| 14 #include "base/basictypes.h" | 14 #include "base/basictypes.h" |
| 15 | 15 |
| 16 namespace base { | 16 namespace base { |
| 17 namespace win { | 17 namespace win { |
| 18 | 18 |
| 19 // Function for getting a data resource of the specified |resource_type| from |
| 20 // a dll. Some resources are optional, especially in unit tests, so this |
| 21 // returns false but doesn't raise an error if the resource can't be loaded. |
| 22 bool BASE_EXPORT GetResourceFromModule(HMODULE module, int resource_id, |
| 23 LPCTSTR resource_type, void** data, |
| 24 size_t* length); |
| 25 |
| 19 // Function for getting a data resource (BINDATA) from a dll. Some | 26 // Function for getting a data resource (BINDATA) from a dll. Some |
| 20 // resources are optional, especially in unit tests, so this returns false | 27 // resources are optional, especially in unit tests, so this returns false |
| 21 // but doesn't raise an error if the resource can't be loaded. | 28 // but doesn't raise an error if the resource can't be loaded. |
| 22 bool BASE_EXPORT GetDataResourceFromModule(HMODULE module, int resource_id, | 29 bool BASE_EXPORT GetDataResourceFromModule(HMODULE module, int resource_id, |
| 23 void** data, size_t* length); | 30 void** data, size_t* length); |
| 24 | 31 |
| 25 } // namespace win | 32 } // namespace win |
| 26 } // namespace base | 33 } // namespace base |
| 27 | 34 |
| 28 #endif // BASE_WIN_RESOURCE_UTIL_H__ | 35 #endif // BASE_WIN_RESOURCE_UTIL_H__ |
| OLD | NEW |