Skip to content

Commit d1a417d

Browse files
committed
Add error logging when MapViewOfFileNuma2 fails
Signed-off-by: Ludvig Liljenberg <[email protected]>
1 parent 58d0487 commit d1a417d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/hyperlight_host/src/hypervisor/surrogate_process_manager.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,11 @@ impl SurrogateProcessManager {
169169
};
170170

171171
if allocated_address.Value.is_null() {
172+
// Safety: `MapViewOfFileNuma2` will set the last error code if it fails.
173+
let error = unsafe { windows::Win32::Foundation::GetLastError() };
172174
log_then_return!(
173-
"MapViewOfFileNuma2 failed for mem address {:?}",
175+
"MapViewOfFileNuma2 failed with error code: {:?} for mem address {:?} ",
176+
error,
174177
raw_source_address
175178
);
176179
}

0 commit comments

Comments
 (0)