manual_slice_size_calculation
This commit is contained in:
parent
bfbeb3ebd9
commit
fe255695f9
@ -82,7 +82,7 @@ pub fn nt_success(status: NTSTATUS) -> bool {
|
||||
|
||||
impl UNICODE_STRING {
|
||||
pub fn from_ref(slice: &[u16]) -> Self {
|
||||
let len = slice.len() * mem::size_of::<u16>();
|
||||
let len = mem::size_of_val(slice);
|
||||
Self { Length: len as _, MaximumLength: len as _, Buffer: slice.as_ptr() as _ }
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user