Index: sandbox/win/src/filesystem_interception.cc |
diff --git a/sandbox/win/src/filesystem_interception.cc b/sandbox/win/src/filesystem_interception.cc |
index 179cad5e62f2e676322751ef7513148fd86045c2..043e1fa4012cdc2513121d7f95b86fb27bb4c203 100644 |
--- a/sandbox/win/src/filesystem_interception.cc |
+++ b/sandbox/win/src/filesystem_interception.cc |
@@ -74,14 +74,15 @@ NTSTATUS WINAPI TargetNtCreateFile(NtCreateFileFunction orig_CreateFile, |
if (SBOX_ALL_OK != code) |
break; |
+ status = answer.nt_status; |
+ |
if (!NT_SUCCESS(answer.nt_status)) |
- return answer.nt_status; |
+ break; |
__try { |
*file = answer.handle; |
io_status->Status = answer.nt_status; |
io_status->Information = answer.extended[0].ulong_ptr; |
- status = io_status->Status; |
} __except(EXCEPTION_EXECUTE_HANDLER) { |
break; |
} |
@@ -145,14 +146,15 @@ NTSTATUS WINAPI TargetNtOpenFile(NtOpenFileFunction orig_OpenFile, PHANDLE file, |
if (SBOX_ALL_OK != code) |
break; |
+ status = answer.nt_status; |
+ |
if (!NT_SUCCESS(answer.nt_status)) |
- return answer.nt_status; |
+ break; |
__try { |
*file = answer.handle; |
io_status->Status = answer.nt_status; |
io_status->Information = answer.extended[0].ulong_ptr; |
- status = io_status->Status; |
} __except(EXCEPTION_EXECUTE_HANDLER) { |
break; |
} |
@@ -208,12 +210,10 @@ NTSTATUS WINAPI TargetNtQueryAttributesFile( |
ResultCode code = CrossCall(ipc, IPC_NTQUERYATTRIBUTESFILE_TAG, name, |
attributes, file_info, &answer); |
- operator delete(name, NT_ALLOC); |
- |
if (SBOX_ALL_OK != code) |
break; |
- return answer.nt_status; |
+ status = answer.nt_status; |
} while (false); |
@@ -269,12 +269,10 @@ NTSTATUS WINAPI TargetNtQueryFullAttributesFile( |
ResultCode code = CrossCall(ipc, IPC_NTQUERYFULLATTRIBUTESFILE_TAG, name, |
attributes, file_info, &answer); |
- operator delete(name, NT_ALLOC); |
- |
if (SBOX_ALL_OK != code) |
break; |
- return answer.nt_status; |
+ status = answer.nt_status; |
} while (false); |
if (name) |