From b2d315b729a459a0663685cc65df22b5b6a33a3b Mon Sep 17 00:00:00 2001 From: DavidXanatos <3890945+DavidXanatos@users.noreply.github.com> Date: Fri, 7 Apr 2023 22:30:15 +0200 Subject: [PATCH] 1.8.4 --- CHANGELOG.md | 1 + Sandboxie/core/drv/ipc.c | 28 +++++++++++++++++++++++----- 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index de32b668d7..aee736f54d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/Sandboxie/core/drv/ipc.c b/Sandboxie/core/drv/ipc.c index 3149d9cd20..642da0f66b 100644 --- a/Sandboxie/core/drv/ipc.c +++ b/Sandboxie/core/drv/ipc.c @@ -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); } //