| OLD | NEW |
| 1 // Copyright (c) 2009 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 is the transformation for Windows X86 executables. | 5 // This is the transformation for Windows X86 executables. |
| 6 | 6 |
| 7 #ifndef COURGETTE_WIN32_X86_PATCHER_H_ | 7 #ifndef COURGETTE_WIN32_X86_PATCHER_H_ |
| 8 #define COURGETTE_WIN32_X86_PATCHER_H_ | 8 #define COURGETTE_WIN32_X86_PATCHER_H_ |
| 9 | 9 |
| 10 #include "courgette/ensemble.h" | 10 #include "courgette/ensemble.h" |
| 11 | 11 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 return status; | 53 return status; |
| 54 | 54 |
| 55 EncodedProgram* encoded = NULL; | 55 EncodedProgram* encoded = NULL; |
| 56 status = Encode(program, &encoded); | 56 status = Encode(program, &encoded); |
| 57 DeleteAssemblyProgram(program); | 57 DeleteAssemblyProgram(program); |
| 58 if (status != C_OK) | 58 if (status != C_OK) |
| 59 return status; | 59 return status; |
| 60 | 60 |
| 61 status = WriteEncodedProgram(encoded, transformed_element); | 61 status = WriteEncodedProgram(encoded, transformed_element); |
| 62 DeleteEncodedProgram(encoded); | 62 DeleteEncodedProgram(encoded); |
| 63 if (status != C_OK) | |
| 64 return status; | |
| 65 | 63 |
| 66 return status; | 64 return status; |
| 67 } | 65 } |
| 68 | 66 |
| 69 Status Reform(SourceStreamSet* transformed_element, | 67 Status Reform(SourceStreamSet* transformed_element, |
| 70 SinkStream* reformed_element) { | 68 SinkStream* reformed_element) { |
| 71 Status status; | 69 Status status; |
| 72 EncodedProgram* encoded_program = NULL; | 70 EncodedProgram* encoded_program = NULL; |
| 73 status = ReadEncodedProgram(transformed_element, &encoded_program); | 71 status = ReadEncodedProgram(transformed_element, &encoded_program); |
| 74 if (status != C_OK) | 72 if (status != C_OK) |
| (...skipping 11 matching lines...) Expand all Loading... |
| 86 Region ensemble_region_; | 84 Region ensemble_region_; |
| 87 | 85 |
| 88 uint32 base_offset_; | 86 uint32 base_offset_; |
| 89 uint32 base_length_; | 87 uint32 base_length_; |
| 90 | 88 |
| 91 DISALLOW_COPY_AND_ASSIGN(CourgetteWin32X86Patcher); | 89 DISALLOW_COPY_AND_ASSIGN(CourgetteWin32X86Patcher); |
| 92 }; | 90 }; |
| 93 | 91 |
| 94 } // namespace | 92 } // namespace |
| 95 #endif // COURGETTE_WIN32_X86_PATCHER_H_ | 93 #endif // COURGETTE_WIN32_X86_PATCHER_H_ |
| OLD | NEW |