From 0e175eedfde50198a3fa7bdef3a91fdbad5f5226 Mon Sep 17 00:00:00 2001 From: DavidXanatos <3890945+DavidXanatos@users.noreply.github.com> Date: Sat, 30 Sep 2023 21:13:40 +0200 Subject: [PATCH] 1.11.4 --- CHANGELOG.md | 3 ++- Sandboxie/core/dll/dllmain.c | 2 +- Sandboxie/core/dll/ipc.c | 34 ++++++++++++++++++++-------------- 3 files changed, 23 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ab9349af..61a0c749 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,12 +12,13 @@ This project adheres to [Semantic Versioning](http://semver.org/). ### Changed - improved lock all boxes behavioure [#3350](https://github.com/sandboxie-plus/Sandboxie/issues/3350) +- fixed type in option name 'NoRestartOnPAC' -> 'NoRestartOnPCA' ### Fixed - fixed issue with unmounting protected images [#3347](https://github.com/sandboxie-plus/Sandboxie/issues/3347) - fixed Unable to turn off highlight in Sbie Messages search results [#3338](https://github.com/sandboxie-plus/Sandboxie/issues/3338) - fixed cannot display programs installed in the sandbox via Run from Start Menu [#3334](https://github.com/sandboxie-plus/Sandboxie/issues/3334) - +- fixed issue with NtQueryDirectoryObject [#3310](https://github.com/sandboxie-plus/Sandboxie/issues/3310) diff --git a/Sandboxie/core/dll/dllmain.c b/Sandboxie/core/dll/dllmain.c index 2023bd25..e8118c37 100644 --- a/Sandboxie/core/dll/dllmain.c +++ b/Sandboxie/core/dll/dllmain.c @@ -834,7 +834,7 @@ _FX VOID Dll_Ordinal1(INJECT_DATA * inject) int MustRestartProcess = 0; if (Dll_ProcessFlags & SBIE_FLAG_PROCESS_IN_PCA_JOB) { - if (!SbieApi_QueryConfBool(NULL, L"NoRestartOnPAC", FALSE)) + if (!SbieApi_QueryConfBool(NULL, L"NoRestartOnPCA", FALSE)) MustRestartProcess = 1; } diff --git a/Sandboxie/core/dll/ipc.c b/Sandboxie/core/dll/ipc.c index a40a238e..284cc3be 100644 --- a/Sandboxie/core/dll/ipc.c +++ b/Sandboxie/core/dll/ipc.c @@ -4344,19 +4344,22 @@ _FX NTSTATUS Ipc_NtQueryDirectoryObject( ULONG EndIndex = indexCounter + CountToGo; for (; entry && indexCounter < EndIndex; indexCounter++) { - directoryInfo->Name.Length = entry->Name.Length; - directoryInfo->Name.MaximumLength = entry->Name.MaximumLength; - directoryInfo->Name.Buffer = ptr; - memcpy(ptr, entry->Name.Buffer, entry->Name.MaximumLength); - ptr += directoryInfo->Name.MaximumLength / sizeof(WCHAR); + if (directoryInfo) { - directoryInfo->TypeName.Length = entry->TypeName.Length; - directoryInfo->TypeName.MaximumLength = entry->TypeName.MaximumLength; - directoryInfo->TypeName.Buffer = ptr; - memcpy(ptr, entry->TypeName.Buffer, entry->TypeName.MaximumLength); - ptr += directoryInfo->TypeName.MaximumLength / sizeof(WCHAR); + directoryInfo->Name.Length = entry->Name.Length; + directoryInfo->Name.MaximumLength = entry->Name.MaximumLength; + directoryInfo->Name.Buffer = ptr; + memcpy(ptr, entry->Name.Buffer, entry->Name.MaximumLength); + ptr += directoryInfo->Name.MaximumLength / sizeof(WCHAR); - directoryInfo++; + directoryInfo->TypeName.Length = entry->TypeName.Length; + directoryInfo->TypeName.MaximumLength = entry->TypeName.MaximumLength; + directoryInfo->TypeName.Buffer = ptr; + memcpy(ptr, entry->TypeName.Buffer, entry->TypeName.MaximumLength); + ptr += directoryInfo->TypeName.MaximumLength / sizeof(WCHAR); + + directoryInfo++; + } entry = List_Next(entry); } @@ -4365,9 +4368,12 @@ _FX NTSTATUS Ipc_NtQueryDirectoryObject( // terminate listing with an empty entry // - directoryInfo->Name.Length = directoryInfo->TypeName.Length = 0; - directoryInfo->Name.MaximumLength = directoryInfo->TypeName.MaximumLength = 0; - directoryInfo->Name.Buffer = directoryInfo->TypeName.Buffer = NULL; + if (directoryInfo) { + + directoryInfo->Name.Length = directoryInfo->TypeName.Length = 0; + directoryInfo->Name.MaximumLength = directoryInfo->TypeName.MaximumLength = 0; + directoryInfo->Name.Buffer = directoryInfo->TypeName.Buffer = NULL; + } // // set return values