OLD | NEW |
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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 #ifndef CHROME_INSTALLER_MINI_INSTALLER_PE_RESOURCE_H_ | 5 #ifndef CHROME_INSTALLER_MINI_INSTALLER_PE_RESOURCE_H_ |
6 #define CHROME_INSTALLER_MINI_INSTALLER_PE_RESOURCE_H_ | 6 #define CHROME_INSTALLER_MINI_INSTALLER_PE_RESOURCE_H_ |
7 | 7 |
8 #include <windows.h> | 8 #include <windows.h> |
| 9 #include <stddef.h> |
9 | 10 |
10 // This class models a windows PE resource. It does not pretend to be a full | 11 // This class models a windows PE resource. It does not pretend to be a full |
11 // API wrapper and it is just concerned with loading it to memory and writing | 12 // API wrapper and it is just concerned with loading it to memory and writing |
12 // it to disk. Each resource is unique only in the context of a loaded module, | 13 // it to disk. Each resource is unique only in the context of a loaded module, |
13 // that is why you need to specify one on each constructor. | 14 // that is why you need to specify one on each constructor. |
14 class PEResource { | 15 class PEResource { |
15 public: | 16 public: |
16 // This ctor takes the handle to the resource and the module where it was | 17 // This ctor takes the handle to the resource and the module where it was |
17 // found. Ownership of the resource is transfered to this object. | 18 // found. Ownership of the resource is transfered to this object. |
18 PEResource(HRSRC resource, HMODULE module); | 19 PEResource(HRSRC resource, HMODULE module); |
(...skipping 13 matching lines...) Expand all Loading... |
32 // not be loaded into memory or if it cannot be written to disk it returns | 33 // not be loaded into memory or if it cannot be written to disk it returns |
33 // false. | 34 // false. |
34 bool WriteToDisk(const wchar_t* path); | 35 bool WriteToDisk(const wchar_t* path); |
35 | 36 |
36 private: | 37 private: |
37 HRSRC resource_; | 38 HRSRC resource_; |
38 HMODULE module_; | 39 HMODULE module_; |
39 }; | 40 }; |
40 | 41 |
41 #endif // CHROME_INSTALLER_MINI_INSTALLER_PE_RESOURCE_H_ | 42 #endif // CHROME_INSTALLER_MINI_INSTALLER_PE_RESOURCE_H_ |
OLD | NEW |