note description: "Representation of a CLI section header." legal: "See notice at end of class." status: "See notice at end of class." date: "$Date$" revision: "$Revision$" class CLI_SECTION_HEADER inherit MANAGED_POINTER rename make as managed_pointer_make end create make feature {NONE} -- Initialization make (a_name: STRING) -- Create new section with name `a_name'. require a_name_not_void: a_name /= Void a_name_valid: not a_name.is_empty and then a_name.count <= 8 local l_c_string: C_STRING l_name_ptr: POINTER do managed_pointer_make (structure_size) c_set_pointer_to_line_numbers (item, 0) c_set_number_of_line_numbers (item, 0) create l_c_string.make (a_name) l_name_ptr := c_name (item) l_name_ptr.memory_copy (l_c_string.item, a_name.count) end feature -- Measurement structure_size: INTEGER -- Size of IMAGE_SECTION_HEADER. external "C macro use " alias "sizeof(IMAGE_SECTION_HEADER)" end feature -- Settings set_virtual_size (i: INTEGER) -- Set `virtual_size' to `i'. do c_set_virtual_size (item, i) end set_virtual_address (i: INTEGER) -- Set `virtual_address' to `i'. do c_set_virtual_address (item, i) end set_raw_data_size (i: INTEGER) -- Set `raw_data_size' to `i'. do c_set_size_of_raw_data (item, i) end set_pointer_to_raw_data (i: INTEGER) -- Set `pointer_to_raw_data' to `i'. do c_set_pointer_to_raw_data (item, i) end set_characteristics (i: INTEGER) -- Set `characteristics' to `i'. do c_set_characteristics (item, i) end feature -- Debug debug_header (a_name: STRING_32) local l_file: RAW_FILE do create l_file.make_create_read_write (a_name + ".bin") l_file.put_managed_pointer (Current, 0, count) l_file.close end feature {NONE} -- Access c_name (an_item: POINTER): POINTER -- Get `Name'. external "C struct IMAGE_SECTION_HEADER access &Name use " end feature {NONE} -- Settings c_set_virtual_size (an_item: POINTER; i: INTEGER) -- Set `VirtualSize' to `i'. external "C struct IMAGE_SECTION_HEADER access Misc.VirtualSize type DWORD use " end c_set_virtual_address (an_item: POINTER; i: INTEGER) -- Set `VirtualAddress' to `i'. external "C struct IMAGE_SECTION_HEADER access VirtualAddress type DWORD use " end c_set_size_of_raw_data (an_item: POINTER; i: INTEGER) -- Set `SizeOfRawData' to `i'. external "C struct IMAGE_SECTION_HEADER access SizeOfRawData type DWORD use " end c_set_pointer_to_raw_data (an_item: POINTER; i: INTEGER) -- Set `PointerToRawData' to `i'. external "C struct IMAGE_SECTION_HEADER access PointerToRawData type DWORD use " end c_set_pointer_to_relocations (an_item: POINTER; i: INTEGER) -- Set `PointerToRelocations' to `i'. external "C struct IMAGE_SECTION_HEADER access PointerToRelocations type DWORD use " end c_set_pointer_to_line_numbers (an_item: POINTER; i: INTEGER) -- Set `PointerToLinenumbers' to `i'. external "C struct IMAGE_SECTION_HEADER access PointerToLinenumbers type DWORD use " end c_set_number_of_relocations (an_item: POINTER; i: INTEGER_16) -- Set `NumberOfRelocations' to `i'. external "C struct IMAGE_SECTION_HEADER access NumberOfRelocations type WORD use " end c_set_number_of_line_numbers (an_item: POINTER; i: INTEGER_16) -- Set `NumberOfLinenumbers' to `i'. external "C struct IMAGE_SECTION_HEADER access NumberOfLinenumbers type WORD use " end c_set_characteristics (an_item: POINTER; i: INTEGER) -- Set `Characteristics' to `i'. external "C struct IMAGE_SECTION_HEADER access Characteristics type DWORD use " end note copyright: "Copyright (c) 1984-2023, Eiffel Software" license: "GPL version 2 (see http://www.eiffel.com/licensing/gpl.txt)" licensing_options: "http://www.eiffel.com/licensing" copying: "[ This file is part of Eiffel Software's Eiffel Development Environment. Eiffel Software's Eiffel Development Environment is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License (available at the URL listed under "license" above). Eiffel Software's Eiffel Development Environment is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Eiffel Software's Eiffel Development Environment; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ]" source: "[ Eiffel Software 5949 Hollister Ave., Goleta, CA 93117 USA Telephone 805-685-1006, Fax 805-685-6869 Website http://www.eiffel.com Customer support http://support.eiffel.com ]" end -- class CLI_SECTION_HEADER