1 // Copyright 2011 The Chromium Authors 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 // This file contains utility functions for accessing resources in external 6 // files (DLLs) or embedded in the executable itself. 7 8 #ifndef BASE_WIN_RESOURCE_UTIL_H_ 9 #define BASE_WIN_RESOURCE_UTIL_H_ 10 11 #include <windows.h> 12 13 #include <stddef.h> 14 15 #include "base/base_export.h" 16 17 namespace base { 18 namespace win { 19 20 // Function for getting a data resource of the specified |resource_type| from 21 // a dll. Some resources are optional, especially in unit tests, so this 22 // returns false but doesn't raise an error if the resource can't be loaded. 23 bool BASE_EXPORT GetResourceFromModule(HMODULE module, 24 int resource_id, 25 LPCTSTR resource_type, 26 void** data, 27 size_t* length); 28 29 // Function for getting a data resource (BINDATA) from a dll. Some 30 // resources are optional, especially in unit tests, so this returns false 31 // but doesn't raise an error if the resource can't be loaded. 32 bool BASE_EXPORT GetDataResourceFromModule(HMODULE module, 33 int resource_id, 34 void** data, 35 size_t* length); 36 37 } // namespace win 38 } // namespace base 39 40 #endif // BASE_WIN_RESOURCE_UTIL_H_ 41