From c8d6c52786a3548058d62af2a0a28ef204ecd04b Mon Sep 17 00:00:00 2001 From: Stephan Troyer Date: Sat, 28 Nov 2020 14:51:27 +0100 Subject: [PATCH] update to windows 10 SDK/WDK & VS 2019 --- Sandboxie/SboxHostDll/SboxHostDll.vcxproj | 10 ++--- Sandboxie/apps/com/BITS/SandboxBITS.vcxproj | 10 ++--- .../apps/com/Crypto/SandboxCrypto.vcxproj | 10 ++--- .../com/DcomLaunch/SboxDcomLaunch.vcxproj | 10 ++--- Sandboxie/apps/com/RpcSs/SandboxRpcSs.vcxproj | 10 ++--- Sandboxie/apps/com/WUAU/SandboxWUAU.vcxproj | 10 ++--- Sandboxie/apps/common/Common.vcxproj | 10 ++--- Sandboxie/apps/control/Control.vcxproj | 10 ++--- Sandboxie/apps/ini/SbieIni.vcxproj | 10 ++--- Sandboxie/apps/ldr/SbieLdr.vcxproj | 10 ++--- Sandboxie/apps/start/Start.vcxproj | 10 ++--- Sandboxie/core/dll/SboxDll.vcxproj | 10 ++--- Sandboxie/core/drv/SboxDrv.vcxproj | 44 ++++++++++++------- Sandboxie/core/drv/conf_expand.c | 2 +- Sandboxie/core/drv/driver.c | 16 ++++++- Sandboxie/core/drv/driver.h | 2 + Sandboxie/core/drv/file_xlat.c | 2 +- Sandboxie/core/drv/hook_32.c | 2 +- Sandboxie/core/drv/ipc.c | 2 +- Sandboxie/core/drv/ipc_spl.c | 2 +- Sandboxie/core/drv/key_flt.c | 6 +-- Sandboxie/core/drv/my_winnt.h | 19 ++++++-- Sandboxie/core/drv/process_api.c | 4 +- Sandboxie/core/drv/process_force.c | 4 +- Sandboxie/core/drv/process_util.c | 2 +- Sandboxie/core/drv/thread_token.c | 2 +- Sandboxie/core/drv/token.c | 6 +-- Sandboxie/core/low/LowLevel.vcxproj | 6 +-- Sandboxie/core/svc/SboxSvc.vcxproj | 10 ++--- Sandboxie/install/kmdutil/kmdutil.vcxproj | 10 ++--- Sandboxie/msgs/Parse.vcxproj | 4 +- Sandboxie/msgs/SboxMsg.vcxproj | 6 +-- 32 files changed, 154 insertions(+), 117 deletions(-) diff --git a/Sandboxie/SboxHostDll/SboxHostDll.vcxproj b/Sandboxie/SboxHostDll/SboxHostDll.vcxproj index fba6a4f4..988d7a9e 100644 --- a/Sandboxie/SboxHostDll/SboxHostDll.vcxproj +++ b/Sandboxie/SboxHostDll/SboxHostDll.vcxproj @@ -22,34 +22,34 @@ {3A42A9F3-E0C7-4633-9570-381802D6647D} Win32Proj SboxHostDll - 8.1 + 10.0 DynamicLibrary true Unicode - v140 + v142 DynamicLibrary true Unicode - v140 + v142 DynamicLibrary false true Unicode - v140 + v142 DynamicLibrary false true Unicode - v140 + v142 diff --git a/Sandboxie/apps/com/BITS/SandboxBITS.vcxproj b/Sandboxie/apps/com/BITS/SandboxBITS.vcxproj index 64f57505..0f169ae2 100644 --- a/Sandboxie/apps/com/BITS/SandboxBITS.vcxproj +++ b/Sandboxie/apps/com/BITS/SandboxBITS.vcxproj @@ -21,28 +21,28 @@ Win32Proj {E40CC819-6990-DA28-3E1F-6708BC98E37B} - 8.1 + 10.0 Application true - v140 + v142 Application true - v140 + v142 Application false - v140 + v142 Application false - v140 + v142 diff --git a/Sandboxie/apps/com/Crypto/SandboxCrypto.vcxproj b/Sandboxie/apps/com/Crypto/SandboxCrypto.vcxproj index 326564d1..f9b7b6ab 100644 --- a/Sandboxie/apps/com/Crypto/SandboxCrypto.vcxproj +++ b/Sandboxie/apps/com/Crypto/SandboxCrypto.vcxproj @@ -21,28 +21,28 @@ Win32Proj {41453A79-CA9B-ABCA-981C-5242AFC72DDF} - 8.1 + 10.0 Application true - v140 + v142 Application true - v140 + v142 Application false - v140 + v142 Application false - v140 + v142 diff --git a/Sandboxie/apps/com/DcomLaunch/SboxDcomLaunch.vcxproj b/Sandboxie/apps/com/DcomLaunch/SboxDcomLaunch.vcxproj index 49c73b03..132c6683 100644 --- a/Sandboxie/apps/com/DcomLaunch/SboxDcomLaunch.vcxproj +++ b/Sandboxie/apps/com/DcomLaunch/SboxDcomLaunch.vcxproj @@ -21,28 +21,28 @@ Win32Proj {8055A629-631E-84F5-8F3C-1908F264C81D} - 8.1 + 10.0 Application true - v140 + v142 Application true - v140 + v142 Application false - v140 + v142 Application false - v140 + v142 diff --git a/Sandboxie/apps/com/RpcSs/SandboxRpcSs.vcxproj b/Sandboxie/apps/com/RpcSs/SandboxRpcSs.vcxproj index bf8b2318..35d5b343 100644 --- a/Sandboxie/apps/com/RpcSs/SandboxRpcSs.vcxproj +++ b/Sandboxie/apps/com/RpcSs/SandboxRpcSs.vcxproj @@ -21,28 +21,28 @@ Win32Proj {5410C534-4858-C748-86AD-0567A2451FDE} - 8.1 + 10.0 Application true - v140 + v142 Application true - v140 + v142 Application false - v140 + v142 Application false - v140 + v142 diff --git a/Sandboxie/apps/com/WUAU/SandboxWUAU.vcxproj b/Sandboxie/apps/com/WUAU/SandboxWUAU.vcxproj index c2c4d606..b8a94724 100644 --- a/Sandboxie/apps/com/WUAU/SandboxWUAU.vcxproj +++ b/Sandboxie/apps/com/WUAU/SandboxWUAU.vcxproj @@ -21,34 +21,34 @@ {42DB5510-0268-4655-B483-B9D6E4E48D62} SandboxWUAU - 8.1 + 10.0 Application true MultiByte - v140 + v142 Application true MultiByte - v140 + v142 Application false true MultiByte - v140 + v142 Application false true MultiByte - v140 + v142 diff --git a/Sandboxie/apps/common/Common.vcxproj b/Sandboxie/apps/common/Common.vcxproj index 80feae4f..698d8efc 100644 --- a/Sandboxie/apps/common/Common.vcxproj +++ b/Sandboxie/apps/common/Common.vcxproj @@ -20,28 +20,28 @@ {67579365-ED6A-C1E4-E0A3-4A7C9F14072D} - 8.1 + 10.0 StaticLibrary true - v140 + v142 StaticLibrary true - v140 + v142 StaticLibrary false - v140 + v142 StaticLibrary false - v140 + v142 diff --git a/Sandboxie/apps/control/Control.vcxproj b/Sandboxie/apps/control/Control.vcxproj index 60008cd0..01f8a27d 100644 --- a/Sandboxie/apps/control/Control.vcxproj +++ b/Sandboxie/apps/control/Control.vcxproj @@ -22,7 +22,7 @@ {D16E291A-1F8A-4B19-AE07-0AF8CB7CCBD0} Control SbieControl - 8.1 + 10.0 @@ -32,7 +32,7 @@ Static false false - v140 + v142 Application @@ -41,7 +41,7 @@ Static false false - v140 + v142 Application @@ -50,7 +50,7 @@ Unicode Static false - v140 + v142 Application @@ -59,7 +59,7 @@ Unicode Static false - v140 + v142 diff --git a/Sandboxie/apps/ini/SbieIni.vcxproj b/Sandboxie/apps/ini/SbieIni.vcxproj index 0db89f95..724fac54 100644 --- a/Sandboxie/apps/ini/SbieIni.vcxproj +++ b/Sandboxie/apps/ini/SbieIni.vcxproj @@ -34,34 +34,34 @@ {B8D7002B-0468-44E7-93A7-94327A5D7C7A} Win32Proj SbieIni - 8.1 + 10.0 Application true Unicode - v140 + v142 Application true Unicode - v140 + v142 Application false true Unicode - v140 + v142 Application false true Unicode - v140 + v142 diff --git a/Sandboxie/apps/ldr/SbieLdr.vcxproj b/Sandboxie/apps/ldr/SbieLdr.vcxproj index fed2a7d4..4916c3d9 100644 --- a/Sandboxie/apps/ldr/SbieLdr.vcxproj +++ b/Sandboxie/apps/ldr/SbieLdr.vcxproj @@ -31,34 +31,34 @@ {352AA425-D224-4F23-AF1D-D54AFADDDB22} Win32Proj SbieLdr - 8.1 + 10.0 Application true Unicode - v140 + v142 Application true Unicode - v140 + v142 Application false true Unicode - v140 + v142 Application false true Unicode - v140 + v142 diff --git a/Sandboxie/apps/start/Start.vcxproj b/Sandboxie/apps/start/Start.vcxproj index d1bc4f2b..f8673155 100644 --- a/Sandboxie/apps/start/Start.vcxproj +++ b/Sandboxie/apps/start/Start.vcxproj @@ -21,32 +21,32 @@ Win32Proj {8B9E1B9D-FB3C-3009-9196-4315871BCD73} - 8.1 + 10.0 Application true Static - v140 + v142 Application true Static - v140 + v142 Application false Static - v140 + v142 Application false Static - v140 + v142 diff --git a/Sandboxie/core/dll/SboxDll.vcxproj b/Sandboxie/core/dll/SboxDll.vcxproj index de762df2..51e7a0c3 100644 --- a/Sandboxie/core/dll/SboxDll.vcxproj +++ b/Sandboxie/core/dll/SboxDll.vcxproj @@ -22,7 +22,7 @@ Win32Proj SboxDll {8E0EAA5B-6F5B-E0E2-338A-453EF2B548E4} - 8.1 + 10.0 @@ -30,28 +30,28 @@ true false Unicode - v140 + v142 DynamicLibrary true false Unicode - v140 + v142 DynamicLibrary false false Unicode - v140 + v142 DynamicLibrary false false Unicode - v140 + v142 diff --git a/Sandboxie/core/drv/SboxDrv.vcxproj b/Sandboxie/core/drv/SboxDrv.vcxproj index 7a99f5d3..1f78fc18 100644 --- a/Sandboxie/core/drv/SboxDrv.vcxproj +++ b/Sandboxie/core/drv/SboxDrv.vcxproj @@ -21,28 +21,38 @@ Win32Proj {4019C5EB-8D1E-40E4-B7D1-5601B4B27288} - 8.1 + 10.0.19041.0 - Application + Driver true - v140 + WindowsKernelModeDriver10.0 + Windows7 + WDM - Application + Driver true - v140 + WindowsKernelModeDriver10.0 + Windows7 + WDM - Application + Driver false - v140 + WindowsKernelModeDriver10.0 + + + WDM + Windows7 - Application + Driver false - v140 + WindowsKernelModeDriver10.0 + Windows7 + WDM @@ -69,32 +79,32 @@ false false SbieDrv - C:\WinDDK\7600.16385.1\inc\ddk;C:\WinDDK\7600.16385.1\inc\crt;C:\WinDDK\7600.16385.1\inc\api;$(IncludePath) - C:\WinDDK\7600.16385.1\lib\wnet\i386;$(LibraryPath) + ..\;..\..\;..\..\..\;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(KM_IncludePath);$(KMDF_INC_PATH)$(KMDF_VER_PATH);$(IncludePath) + $(VCInstallDir)lib;$(SolutionDir)Bin\$(PlatformName)\$(Configuration)\;$(WindowsSdkDir)lib;$(DDK_LibraryPath_DDKPlatform);$(LibraryPath) .sys false false SbieDrv - C:\WinDDK\7600.16385.1\inc\ddk;C:\WinDDK\7600.16385.1\inc\crt;C:\WinDDK\7600.16385.1\inc\api;$(IncludePath) - C:\WinDDK\7600.16385.1\lib\wnet\amd64;$(LibraryPath) + ..\;..\..\;..\..\..\;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(KM_IncludePath);$(KMDF_INC_PATH)$(KMDF_VER_PATH);$(IncludePath) + $(VCInstallDir)lib;$(SolutionDir)Bin\$(PlatformName)\$(Configuration)\;$(WindowsSdkDir)lib;$(DDK_LibraryPath_DDKPlatform);$(LibraryPath) .sys false false SbieDrv - C:\WinDDK\7600.16385.1\inc\ddk;C:\WinDDK\7600.16385.1\inc\crt;C:\WinDDK\7600.16385.1\inc\api;$(IncludePath) - C:\WinDDK\7600.16385.1\lib\wnet\i386;$(LibraryPath) + ..\;..\..\;..\..\..\;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(KM_IncludePath);$(KMDF_INC_PATH)$(KMDF_VER_PATH);$(IncludePath) + $(VCInstallDir)lib;$(SolutionDir)Bin\$(PlatformName)\$(Configuration)\;$(WindowsSdkDir)lib;$(DDK_LibraryPath_DDKPlatform);$(LibraryPath) .sys false false SbieDrv - C:\WinDDK\7600.16385.1\inc\ddk;C:\WinDDK\7600.16385.1\inc\crt;C:\WinDDK\7600.16385.1\inc\api;$(IncludePath) - C:\WinDDK\7600.16385.1\lib\wnet\amd64;$(LibraryPath) + ..\;..\..\;..\..\..\;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(KM_IncludePath);$(KMDF_INC_PATH)$(KMDF_VER_PATH);$(IncludePath) + $(VCInstallDir)lib;$(SolutionDir)Bin\$(PlatformName)\$(Configuration)\;$(WindowsSdkDir)lib;$(DDK_LibraryPath_DDKPlatform);$(LibraryPath) diff --git a/Sandboxie/core/drv/conf_expand.c b/Sandboxie/core/drv/conf_expand.c index edfdb038..e42713f7 100644 --- a/Sandboxie/core/drv/conf_expand.c +++ b/Sandboxie/core/drv/conf_expand.c @@ -308,7 +308,7 @@ _FX WCHAR *Conf_Expand_Helper( static const WCHAR *_DefaultSpoolDirectoryPrefix = L"%SystemRoot%\\System32\\spool\\"; NTSTATUS status; - const WCHAR *ptr1, *ptr2; + const WCHAR *ptr1, *ptr2 = L""; WCHAR varname[66]; ULONG len; WCHAR *buf, *ptr; diff --git a/Sandboxie/core/drv/driver.c b/Sandboxie/core/drv/driver.c index 89b4f78a..466f2872 100644 --- a/Sandboxie/core/drv/driver.c +++ b/Sandboxie/core/drv/driver.c @@ -46,8 +46,8 @@ NTSTATUS DriverEntry( - DRIVER_OBJECT *DriverObject, - UNICODE_STRING *RegistryPath); + IN DRIVER_OBJECT *DriverObject, + IN UNICODE_STRING *RegistryPath); static BOOLEAN Driver_CheckOsVersion(void); @@ -55,7 +55,9 @@ static BOOLEAN Driver_InitPublicSecurity(void); static BOOLEAN Driver_FindHomePath(UNICODE_STRING *RegistryPath); +#ifdef WINXP_SUPPORT static BOOLEAN Driver_FindMissingServices(void); +#endif // WINXP_SUPPORT static void SbieDrv_DriverUnload(DRIVER_OBJECT *DriverObject); @@ -67,7 +69,9 @@ static void SbieDrv_DriverUnload(DRIVER_OBJECT *DriverObject); #pragma alloc_text (INIT, DriverEntry) #pragma alloc_text (INIT, Driver_CheckOsVersion) #pragma alloc_text (INIT, Driver_FindHomePath) +#ifdef WINXP_SUPPORT #pragma alloc_text (INIT, Driver_FindMissingServices) +#endif // WINXP_SUPPORT #endif // ALLOC_PRAGMA @@ -121,7 +125,9 @@ ULONG Process_Flags3 = 0; //--------------------------------------------------------------------------- +#ifdef WINXP_SUPPORT P_NtSetInformationToken ZwSetInformationToken = NULL; +#endif // WINXP_SUPPORT //--------------------------------------------------------------------------- @@ -187,8 +193,10 @@ _FX NTSTATUS DriverEntry( if (ok) ok = Session_Init(); +#ifdef WINXP_SUPPORT if (ok) ok = Driver_FindMissingServices(); +#endif // WINXP_SUPPORT if (ok) ok = Token_Init(); @@ -584,6 +592,8 @@ _FX BOOLEAN Driver_FindHomePath(UNICODE_STRING *RegistryPath) //--------------------------------------------------------------------------- +#ifdef WINXP_SUPPORT + #define FIND_SERVICE(svc,prmcnt) \ { \ static const char *ProcName = #svc; \ @@ -633,6 +643,8 @@ _FX BOOLEAN Driver_FindMissingServices(void) #undef FIND_SERVICE +#endif // WINXP_SUPPORT + //--------------------------------------------------------------------------- // DriverUnload diff --git a/Sandboxie/core/drv/driver.h b/Sandboxie/core/drv/driver.h index bc5be2fa..62d6c9bb 100644 --- a/Sandboxie/core/drv/driver.h +++ b/Sandboxie/core/drv/driver.h @@ -83,7 +83,9 @@ typedef struct _KEY_MOUNT KEY_MOUNT; //--------------------------------------------------------------------------- +#ifdef WINXP_SUPPORT extern P_NtSetInformationToken ZwSetInformationToken; +#endif // WINXP_SUPPORT //--------------------------------------------------------------------------- diff --git a/Sandboxie/core/drv/file_xlat.c b/Sandboxie/core/drv/file_xlat.c index 3823d735..99202359 100644 --- a/Sandboxie/core/drv/file_xlat.c +++ b/Sandboxie/core/drv/file_xlat.c @@ -284,7 +284,7 @@ _FX NTSTATUS File_TranslateShares( _FX NTSTATUS File_TranslateSymlinks(WCHAR *name, ULONG max_len) { NTSTATUS status; - HANDLE handle; + HANDLE handle = NULL; OBJECT_ATTRIBUTES objattrs; UNICODE_STRING uni; ULONG len, rem, ofs; diff --git a/Sandboxie/core/drv/hook_32.c b/Sandboxie/core/drv/hook_32.c index 99cf8853..617954c4 100644 --- a/Sandboxie/core/drv/hook_32.c +++ b/Sandboxie/core/drv/hook_32.c @@ -250,7 +250,7 @@ skip_padding_bytes: _FX ULONG Hook_Find_ZwRoutine_2(ULONG ServiceNum, void **out_routine) { - UCHAR *addr; + UCHAR *addr = NULL; BOOLEAN found = FALSE; ULONG subcode = 0; int i; diff --git a/Sandboxie/core/drv/ipc.c b/Sandboxie/core/drv/ipc.c index 933654fd..3fb50957 100644 --- a/Sandboxie/core/drv/ipc.c +++ b/Sandboxie/core/drv/ipc.c @@ -1314,7 +1314,7 @@ _FX NTSTATUS Ipc_Api_CreateDirOrLink(PROCESS *proc, ULONG64 *parms) NTSTATUS status; HANDLE handle; UNICODE_STRING64 *user_uni; - WCHAR *user_buf, *objname_buf, *target_buf; + WCHAR *user_buf, *objname_buf = L"", *target_buf; ULONG user_len, objname_len, target_len; OBJECT_ATTRIBUTES objattrs; UNICODE_STRING objname, target; diff --git a/Sandboxie/core/drv/ipc_spl.c b/Sandboxie/core/drv/ipc_spl.c index 60de039f..723d6628 100644 --- a/Sandboxie/core/drv/ipc_spl.c +++ b/Sandboxie/core/drv/ipc_spl.c @@ -295,7 +295,7 @@ _FX NTSTATUS Ipc_Api_CopyRpcPortName(enum ENUM_DYNAMIC_PORT_TYPE ePortType, WCHA if (Ipc_Dynamic_Ports[ePortType].pPortLock) { KeEnterCriticalRegion(); - ExAcquireResourceExclusive(Ipc_Dynamic_Ports[ePortType].pPortLock, TRUE); + ExAcquireResourceExclusiveLite(Ipc_Dynamic_Ports[ePortType].pPortLock, TRUE); if (pSrcPortName && (*pSrcPortName)) { diff --git a/Sandboxie/core/drv/key_flt.c b/Sandboxie/core/drv/key_flt.c index d01f0ae2..f3b4b8aa 100644 --- a/Sandboxie/core/drv/key_flt.c +++ b/Sandboxie/core/drv/key_flt.c @@ -486,13 +486,13 @@ WCHAR * Key_GetSandboxPath(ULONG spid, void *Object) if (temp) { // Matches "\REGISTRY\USER\S-1-5-21*\" - if (!wcsnicmp(&KeyName->Buffer[head_len], USERS, wcslen(USERS))) + if (!_wcsnicmp(&KeyName->Buffer[head_len], USERS, wcslen(USERS))) { ULONG sidSize = (ULONG)temp - (ULONG)&KeyName->Buffer[head_len]; if (sidSize < MAX_USER_SID_SIZE) { // Matches "\REGISTRY\USER\S-1-5-21*_Classes\" - if (!wcsnicmp(temp - wcslen(CLASSES), L"_Classes", wcslen(CLASSES))) + if (!_wcsnicmp(temp - wcslen(CLASSES), L"_Classes", wcslen(CLASSES))) { wcscpy(targetName + path_len, L"\\user\\current_classes"); path_len += wcslen(L"\\user\\current_classes"); @@ -509,7 +509,7 @@ WCHAR * Key_GetSandboxPath(ULONG spid, void *Object) } } // starts with "\REGISTRY\\MACHINE\" - else if (!wcsnicmp(KeyName->Buffer, HEADER_MACHINE, wcslen(HEADER_MACHINE))) + else if (!_wcsnicmp(KeyName->Buffer, HEADER_MACHINE, wcslen(HEADER_MACHINE))) { wcscpy(targetName + path_len, KeyName->Buffer + 9); targetFound = 1; diff --git a/Sandboxie/core/drv/my_winnt.h b/Sandboxie/core/drv/my_winnt.h index 605322d8..cf4ecd01 100644 --- a/Sandboxie/core/drv/my_winnt.h +++ b/Sandboxie/core/drv/my_winnt.h @@ -45,7 +45,7 @@ #define SE_GROUP_LOGON_ID (0xC0000000L) #define SE_GROUP_RESOURCE (0x20000000L) - +#ifdef WINXP_SUPPORT typedef enum _TOKEN_INFORMATION_CLASS2 { TokenIsAppContainer = 29, TokenCapabilities, @@ -63,6 +63,7 @@ typedef enum _TOKEN_INFORMATION_CLASS2 { TokenPrivateNameSpace//, //MaxTokenInfoClass // MaxTokenInfoClass should always be the last enum } TOKEN_INFORMATION_CLASS2; +#endif // WINXP_SUPPORT NTOS_NTSTATUS ZwOpenThreadToken( IN HANDLE ThreadHandle, @@ -253,8 +254,13 @@ typedef void(*P_KeRevertToUserAffinityThreadEx)(KAFFINITY Affinity); #define PROCESS_QUERY_INFORMATION (0x0400) #define PROCESS_SUSPEND_RESUME (0x0800) #define PROCESS_QUERY_LIMITED_INFORMATION (0x1000) // vista +#if (NTDDI_VERSION >= NTDDI_VISTA) #define PROCESS_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | \ - 0xFFF) + 0xFFFF) +#else +#define PROCESS_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | \ + 0xFFF) +#endif extern POBJECT_TYPE *PsProcessType; @@ -304,8 +310,13 @@ NTOS_NTSTATUS ZwSetInformationProcess( #define THREAD_DIRECT_IMPERSONATION (0x0200) #define THREAD_SET_LIMITED_INFORMATION (0x0400) // vista #define THREAD_QUERY_LIMITED_INFORMATION (0x0800) // vista +#if (NTDDI_VERSION >= NTDDI_VISTA) #define THREAD_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | \ - 0x3FF) + 0xFFFF) +#else +#define THREAD_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | \ + 0x3FF) +#endif NTOS_NTSTATUS PsSetThreadHardErrorsAreDisabled( @@ -618,6 +629,7 @@ typedef ULONG OB_OPERATION; #define OB_OPERATION_HANDLE_CREATE 0x00000001 #define OB_OPERATION_HANDLE_DUPLICATE 0x00000002 +#if (NTDDI_VERSION < NTDDI_VISTASP1) NTOS_NTSTATUS ObRegisterCallbacks( __in POB_CALLBACK_REGISTRATION CallbackRegistration, __deref_out PVOID *RegistrationHandle); @@ -625,6 +637,7 @@ NTOS_NTSTATUS ObRegisterCallbacks( NTOS_NTSTATUS ObUnRegisterCallbacks( __in PVOID RegistrationHandle); +#endif // ------------------------------------------------------------------ diff --git a/Sandboxie/core/drv/process_api.c b/Sandboxie/core/drv/process_api.c index da7411ff..4241ad8d 100644 --- a/Sandboxie/core/drv/process_api.c +++ b/Sandboxie/core/drv/process_api.c @@ -53,8 +53,8 @@ _FX NTSTATUS Process_Api_Start(PROCESS *proc, ULONG64 *parms) { LONG_PTR user_box_parm; HANDLE user_pid_parm; - BOX *box; - PEPROCESS ProcessObject; + BOX *box = NULL; + PEPROCESS ProcessObject = NULL; NTSTATUS status; // diff --git a/Sandboxie/core/drv/process_force.c b/Sandboxie/core/drv/process_force.c index 26b51b4c..b4511318 100644 --- a/Sandboxie/core/drv/process_force.c +++ b/Sandboxie/core/drv/process_force.c @@ -133,9 +133,9 @@ _FX BOX *Process_GetForcedStartBox( NTSTATUS status; ULONG SessionId; UNICODE_STRING SidString; - WCHAR *ImagePath2; + WCHAR *ImagePath2 = L""; ULONG ImagePath2_len; - const WCHAR *ImageName; + const WCHAR *ImageName = L""; PEPROCESS ProcessObject; WCHAR *CurDir, *DocArg; diff --git a/Sandboxie/core/drv/process_util.c b/Sandboxie/core/drv/process_util.c index 9ed70617..9f86f3ef 100644 --- a/Sandboxie/core/drv/process_util.c +++ b/Sandboxie/core/drv/process_util.c @@ -914,7 +914,7 @@ _FX NTSTATUS Process_GetSidStringAndSessionId( UNICODE_STRING *SidString, ULONG *SessionId) { NTSTATUS status; - PEPROCESS ProcessObject; + PEPROCESS ProcessObject = NULL; PACCESS_TOKEN TokenObject; if (ProcessHandle == NtCurrentProcess()) { diff --git a/Sandboxie/core/drv/thread_token.c b/Sandboxie/core/drv/thread_token.c index 66e1b61a..6cc4065c 100644 --- a/Sandboxie/core/drv/thread_token.c +++ b/Sandboxie/core/drv/thread_token.c @@ -1171,7 +1171,7 @@ _FX NTSTATUS Thread_SetInformationThread_ImpersonationToken( void *ProcessObject; PROCESS *proc2; THREAD *thrd2; - HANDLE MyTokenHandle; + HANDLE MyTokenHandle = NULL; NTSTATUS status; SECURITY_IMPERSONATION_LEVEL ImpersonationLevel; BOOLEAN MustCreateThread; diff --git a/Sandboxie/core/drv/token.c b/Sandboxie/core/drv/token.c index 9cee269e..ef2b6f5d 100644 --- a/Sandboxie/core/drv/token.c +++ b/Sandboxie/core/drv/token.c @@ -500,7 +500,7 @@ _FX void *Token_FilterPrimary(PROCESS *proc, void *ProcessObject) _FX void *Token_Filter(void *TokenObject, ULONG DropRights, ULONG SessionId) { TOKEN_GROUPS *groups; - void *ReturnToken; + void *ReturnToken = NULL; NTSTATUS status; ULONG i, j; BOOLEAN ShouldFilterToken = FALSE; @@ -1014,7 +1014,7 @@ _FX BOOLEAN Token_IsSharedSid_W8(void *TokenObject) _FX void *Token_RestrictHelper1( void *TokenObject, ULONG *OutIntegrityLevel, PROCESS *proc) { - void *NewTokenObject; + void *NewTokenObject = NULL; SID_AND_ATTRIBUTES *SidAndAttrsInToken = NULL; ULONG RestrictedSidCount_offset = 0; ULONG RestrictedSids_offset = 0; @@ -1504,7 +1504,7 @@ _FX NTSTATUS Token_AssignPrimaryHandle( { NTSTATUS status; HANDLE ProcessHandle; - ULONG *PtrPrimaryTokenFrozen; + ULONG *PtrPrimaryTokenFrozen = NULL; ULONG SavePrimaryTokenFrozen; // diff --git a/Sandboxie/core/low/LowLevel.vcxproj b/Sandboxie/core/low/LowLevel.vcxproj index f41adf14..bc19ecd7 100644 --- a/Sandboxie/core/low/LowLevel.vcxproj +++ b/Sandboxie/core/low/LowLevel.vcxproj @@ -13,7 +13,7 @@ {255002EC-9FC7-422E-B497-BE2CC5012B2D} LowLevel - 8.1 + 10.0 @@ -21,14 +21,14 @@ false true MultiByte - v140 + v142 DynamicLibrary false true MultiByte - v140 + v142 diff --git a/Sandboxie/core/svc/SboxSvc.vcxproj b/Sandboxie/core/svc/SboxSvc.vcxproj index 9f0416bd..0b3d692c 100644 --- a/Sandboxie/core/svc/SboxSvc.vcxproj +++ b/Sandboxie/core/svc/SboxSvc.vcxproj @@ -21,7 +21,7 @@ Win32Proj {2D3DBCAE-883E-54A6-F8F6-11228D989033} - 8.1 + 10.0 @@ -32,7 +32,7 @@ Application true - v140 + v142 Application @@ -42,7 +42,7 @@ Application true - v140 + v142 Application @@ -52,7 +52,7 @@ Application false - v140 + v142 Application @@ -62,7 +62,7 @@ Application false - v140 + v142 diff --git a/Sandboxie/install/kmdutil/kmdutil.vcxproj b/Sandboxie/install/kmdutil/kmdutil.vcxproj index d5d70d9f..5cc33cc7 100644 --- a/Sandboxie/install/kmdutil/kmdutil.vcxproj +++ b/Sandboxie/install/kmdutil/kmdutil.vcxproj @@ -22,32 +22,32 @@ {0BF4988E-2325-4426-8CDC-BD221E4FB68C} Win32Proj KmdUtil - 8.1 + 10.0 Application true Unicode - v140 + v142 Application true Unicode - v140 + v142 Application false Unicode - v140 + v142 Application false Unicode - v140 + v142 diff --git a/Sandboxie/msgs/Parse.vcxproj b/Sandboxie/msgs/Parse.vcxproj index b66122cc..ea6dee3a 100644 --- a/Sandboxie/msgs/Parse.vcxproj +++ b/Sandboxie/msgs/Parse.vcxproj @@ -9,11 +9,11 @@ Win32Proj {7BA01954-12F1-4CEE-BA97-FAD3250D9776} - 8.1 + 10.0 - v140 + v142 diff --git a/Sandboxie/msgs/SboxMsg.vcxproj b/Sandboxie/msgs/SboxMsg.vcxproj index b756854a..c391de7e 100644 --- a/Sandboxie/msgs/SboxMsg.vcxproj +++ b/Sandboxie/msgs/SboxMsg.vcxproj @@ -13,18 +13,18 @@ Win32Proj {63B0DDD2-5E3B-EF38-F711-9652D2EB73B3} - 8.1 + 10.0 DynamicLibrary false - v140 + v142 DynamicLibrary false - v140 + v142