diff options
author | Daniel Erat <derat@google.com> | 2015-07-06 13:18:13 -0600 |
---|---|---|
committer | Daniel Erat <derat@google.com> | 2015-07-07 08:49:02 -0600 |
commit | b8cf94937c52feb53b55c39e3f82094d27de464c (patch) | |
tree | 20cd8f9867dfe9c0c2510899346c744605425b75 /base/win/resource_util.h | |
parent | 5bb0a2e04cf1346d5a2819f277381c0415549600 (diff) | |
download | libchrome-b8cf94937c52feb53b55c39e3f82094d27de464c.tar.gz |
Add upstream code as of Chromium r334380.
Copy the unchanged source from
https://chromium.googlesource.com/chromium/src/base/ as of
r334380 (really r334285 a.k.a. 23911a0c in the base/
subtree).
Also add MODULE_LICENSE_BSD and copy Chromium's current
LICENSE file to NOTICE.
Bug: 22317122
Change-Id: I89863bfeca67b3a1ff05e6078f2f9ee4e31c5c99
Diffstat (limited to 'base/win/resource_util.h')
-rw-r--r-- | base/win/resource_util.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/base/win/resource_util.h b/base/win/resource_util.h new file mode 100644 index 0000000000..8a8baa0f53 --- /dev/null +++ b/base/win/resource_util.h @@ -0,0 +1,39 @@ +// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// This file contains utility functions for accessing resources in external +// files (DLLs) or embedded in the executable itself. + +#ifndef BASE_WIN_RESOURCE_UTIL_H_ +#define BASE_WIN_RESOURCE_UTIL_H_ + +#include <windows.h> + +#include "base/base_export.h" +#include "base/basictypes.h" + +namespace base { +namespace win { + +// Function for getting a data resource of the specified |resource_type| from +// a dll. Some resources are optional, especially in unit tests, so this +// returns false but doesn't raise an error if the resource can't be loaded. +bool BASE_EXPORT GetResourceFromModule(HMODULE module, + int resource_id, + LPCTSTR resource_type, + void** data, + size_t* length); + +// Function for getting a data resource (BINDATA) from a dll. Some +// resources are optional, especially in unit tests, so this returns false +// but doesn't raise an error if the resource can't be loaded. +bool BASE_EXPORT GetDataResourceFromModule(HMODULE module, + int resource_id, + void** data, + size_t* length); + +} // namespace win +} // namespace base + +#endif // BASE_WIN_RESOURCE_UTIL_H_ |