summaryrefslogtreecommitdiffstats
path: root/vendor/object/src/pe.rs
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/object/src/pe.rs')
-rw-r--r--vendor/object/src/pe.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/vendor/object/src/pe.rs b/vendor/object/src/pe.rs
index c89b86caa..00105adac 100644
--- a/vendor/object/src/pe.rs
+++ b/vendor/object/src/pe.rs
@@ -1977,6 +1977,21 @@ pub struct ImageDelayloadDescriptor {
pub time_date_stamp: U32<LE>,
}
+impl ImageDelayloadDescriptor {
+ /// Tell whether this delay-load import descriptor is the null descriptor
+ /// (used to mark the end of the iterator array in a PE)
+ pub fn is_null(&self) -> bool {
+ self.attributes.get(LE) == 0
+ && self.dll_name_rva.get(LE) == 0
+ && self.module_handle_rva.get(LE) == 0
+ && self.import_address_table_rva.get(LE) == 0
+ && self.import_name_table_rva.get(LE) == 0
+ && self.bound_import_address_table_rva.get(LE) == 0
+ && self.unload_information_table_rva.get(LE) == 0
+ && self.time_date_stamp.get(LE) == 0
+ }
+}
+
/// Delay load version 2 flag for `ImageDelayloadDescriptor::attributes`.
pub const IMAGE_DELAYLOAD_RVA_BASED: u32 = 0x8000_0000;