You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Remove all `#[repr(packed)]` on the IMAGE structs due to a misunderstanding of the Windows.h struct definitions:
Only the old 16-bit headers want 2 byte packing, all the others want 4 byte packing. However all of these structs end up already aligned anyway.
Safeguard their implementation by asserting their sizes.
Fixesrust-lang/rust#46043
* Explicitly specify the raw pointer type when casting from reference and calling a method on it.
Fixesrust-lang/rust#46906
Copy file name to clipboardExpand all lines: src/resources/mod.rs
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -80,7 +80,7 @@ impl<'a> Directory<'a> {
80
80
pubfnentries(&self) -> Entries<'a>{
81
81
// Validated by constructor
82
82
let slice = unsafe{
83
-
let p = (self.imageas*const_).offset(1)as*constIMAGE_RESOURCE_DIRECTORY_ENTRY;
83
+
let p = (self.imageas*constIMAGE_RESOURCE_DIRECTORY).offset(1)as*constIMAGE_RESOURCE_DIRECTORY_ENTRY;
84
84
let len = self.image.NumberOfNamedEntriesasusize + self.image.NumberOfIdEntriesasusize;
85
85
slice::from_raw_parts(p, len)
86
86
};
@@ -93,7 +93,7 @@ impl<'a> Directory<'a> {
93
93
// Validated by constructor
94
94
let slice = unsafe{
95
95
// Named entries come first in the array (see chapter "PE File Resources" in "Peering Inside the PE: A Tour of the Win32 Portable Executable File Format")
96
-
let p = (self.imageas*const_).offset(1)as*constIMAGE_RESOURCE_DIRECTORY_ENTRY;
96
+
let p = (self.imageas*constIMAGE_RESOURCE_DIRECTORY).offset(1)as*constIMAGE_RESOURCE_DIRECTORY_ENTRY;
97
97
let len = self.image.NumberOfNamedEntriesasusize;
98
98
slice::from_raw_parts(p, len)
99
99
};
@@ -106,7 +106,7 @@ impl<'a> Directory<'a> {
106
106
// Validated by the constructor
107
107
let slice = unsafe{
108
108
// Id entries come last in the array
109
-
let p = (self.imageas*const_).offset(1 + self.image.NumberOfNamedEntriesasisize)as*constIMAGE_RESOURCE_DIRECTORY_ENTRY;
109
+
let p = (self.imageas*constIMAGE_RESOURCE_DIRECTORY).offset(1 + self.image.NumberOfNamedEntriesasisize)as*constIMAGE_RESOURCE_DIRECTORY_ENTRY;
0 commit comments