Skip to content

Commit

Permalink
1.8.4
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidXanatos committed Apr 7, 2023
1 parent 670d644 commit b2d315b
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
- fixed compatybility issue with MSEdge 112.x
- fixed updter issue [#2790](https://github.com/sandboxie-plus/Sandboxie/issues/2790)
- fixed new box wizard issue [#2792](https://github.com/sandboxie-plus/Sandboxie/issues/2792)
- fixed issue with firefox/thunderbird [#2799](https://github.com/sandboxie-plus/Sandboxie/issues/2799)



Expand Down
28 changes: 23 additions & 5 deletions Sandboxie/core/drv/ipc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1444,12 +1444,30 @@ _FX NTSTATUS Ipc_Api_DuplicateObject(PROCESS *proc, ULONG64 *parms)

if (NT_SUCCESS(status)) {

status = NtDuplicateObject(
SourceProcessHandle, SourceHandle,
TargetProcessHandle, &DuplicatedHandle,
DesiredAccess, HandleAttributes, Options);
HANDLE SourceProcessKernelHandle = (HANDLE)-1;
HANDLE TargetProcessKernelHandle = (HANDLE)-1;

*TargetHandle = DuplicatedHandle;
if (!IS_ARG_CURRENT_PROCESS(SourceProcessHandle))
status = Thread_GetKernelHandleForUserHandle(&SourceProcessKernelHandle, SourceProcessHandle);
if (NT_SUCCESS(status)) {

if (!IS_ARG_CURRENT_PROCESS(TargetProcessHandle))
status = Thread_GetKernelHandleForUserHandle(&TargetProcessKernelHandle, TargetProcessHandle);
if (NT_SUCCESS(status)) {

status = ZwDuplicateObject(
SourceProcessKernelHandle, SourceHandle,
TargetProcessKernelHandle, &DuplicatedHandle,
DesiredAccess, HandleAttributes, Options);

*TargetHandle = DuplicatedHandle;
}
}

if (SourceProcessKernelHandle && !IS_ARG_CURRENT_PROCESS(SourceProcessKernelHandle))
ZwClose(SourceProcessKernelHandle);
if (TargetProcessKernelHandle && !IS_ARG_CURRENT_PROCESS(TargetProcessKernelHandle))
ZwClose(TargetProcessKernelHandle);
}

//
Expand Down

0 comments on commit b2d315b

Please sign in to comment.