This commit is contained in:
DavidXanatos 2023-04-20 09:51:23 +02:00
parent 41363e8159
commit 7609b99951
5 changed files with 38 additions and 15 deletions

View File

@ -21,8 +21,8 @@
#ifndef _MY_VERSION_H
#define _MY_VERSION_H
#define MY_VERSION_BINARY 5,64,0
#define MY_VERSION_STRING "5.64.0"
#define MY_VERSION_BINARY 5,64,1
#define MY_VERSION_STRING "5.64.1"
#define MY_ABI_VERSION 0x56000
// These #defines are used by either Resource Compiler or NSIS installer

View File

@ -185,7 +185,7 @@ _FX int Debug_Init(void)
NtRaiseHardError = (P_NtRaiseHardError)
GetProcAddress(Dll_Ntdll, "NtRaiseHardError");
SBIEDLL_HOOK(Debug_,NtRaiseHardError);
//SBIEDLL_HOOK(Debug_,NtRaiseHardError);
RtlSetLastWin32Error = (P_RtlSetLastWin32Error)

View File

@ -908,12 +908,15 @@ _FX NTSTATUS File_OpenForMerge(
// true directory we parse the rule list and construct a cached dummy directory
//
if (use_rule_specificity && File_MergeDummy(TruePath, merge->true_ptr, &merge->file_mask) == STATUS_SUCCESS) {
if (use_rule_specificity) {
if (File_MergeDummy(TruePath, merge->true_ptr, &merge->file_mask) == STATUS_SUCCESS) {
merge->true_ptr->handle = NULL;
status = STATUS_SUCCESS;
}
}
}
if (!NT_SUCCESS(status)) {
@ -1415,10 +1418,11 @@ _FX NTSTATUS File_MergeDummy(
WCHAR* FakePath = Dll_AllocTemp(TruePathLen * sizeof(WCHAR) + 1 + name_len * sizeof(WCHAR) + 10);
wmemcpy(FakePath, TruePath, TruePathLen * sizeof(WCHAR));
wcscat(FakePath, L"\\");
end = wcschr(FakePath, L'\0');
wmemcpy(end, ptr, name_len * sizeof(WCHAR));
wmemcpy(FakePath, TruePath, TruePathLen);
FakePath[TruePathLen++] = L'\\';
FakePath[TruePathLen++] = L'\0';
end = &FakePath[TruePathLen];
wmemcpy(end, ptr, name_len);
end[name_len] = L'\0';
FILE_NETWORK_OPEN_INFORMATION info;
@ -1436,6 +1440,7 @@ _FX NTSTATUS File_MergeDummy(
memcpy(info_ptr->FileName, ptr, info_ptr->FileNameLength);
info_ptr->FileName[info_ptr->FileNameLength] = L'\0';
info_ptr->CreationTime = info.CreationTime;
info_ptr->LastAccessTime = info.LastAccessTime;
info_ptr->LastWriteTime = info.LastWriteTime;
info_ptr->ChangeTime = info.ChangeTime;
@ -1443,6 +1448,17 @@ _FX NTSTATUS File_MergeDummy(
info_ptr->EndOfFile = info.EndOfFile;
info_ptr->FileAttributes = info.FileAttributes;
//ULONG NextEntryOffset;
//ULONG FileIndex;
//ULONG EaInformationLength;
//CCHAR ShortNameLength;
//WCHAR ShortName[12];
//LARGE_INTEGER FileId;
info_ptr->FileId.QuadPart = -1;
PrevEntry = &info_ptr->NextEntryOffset;
info_ptr->NextEntryOffset = sizeof(FILE_ID_BOTH_DIR_INFORMATION) + info_ptr->FileNameLength + sizeof(WCHAR) + 16; // +16 some buffer space
@ -1706,6 +1722,12 @@ _FX NTSTATUS File_GetMergedInformation(
break;
}
//if (ptr_info->FileId.QuadPart == -1) {
// WCHAR msg[1024];
// Sbie_snwprintf(msg, 1024, L"File_MergeDummy simulate %s", ptr_info->FileName);
// SbieApi_MonitorPutMsg(MONITOR_OTHER | MONITOR_TRACE, msg);
//}
if (File_Delete_v2) {
if ((merge->true_ptr && ptr_info == merge->true_ptr->info) // is in true path

View File

@ -755,10 +755,11 @@ _FX NTSTATUS Key_MergeCacheDummys(KEY_MERGE *merge, const WCHAR *TruePath)
WCHAR* FakePath = Dll_AllocTemp(TruePathLen * sizeof(WCHAR) + 1 + name_len * sizeof(WCHAR) + 10);
wmemcpy(FakePath, TruePath, TruePathLen * sizeof(WCHAR));
wcscat(FakePath, L"\\");
end = wcschr(FakePath, L'\0');
wmemcpy(end, ptr, name_len * sizeof(WCHAR));
wmemcpy(FakePath, TruePath, TruePathLen);
FakePath[TruePathLen++] = L'\\';
FakePath[TruePathLen++] = L'\0';
end = &FakePath[TruePathLen];
wmemcpy(end, ptr, name_len);
end[name_len] = L'\0';
HANDLE KeyHandle;

View File

@ -2,7 +2,7 @@
#define VERSION_MJR 1
#define VERSION_MIN 9
#define VERSION_REV 0
#define VERSION_REV 1
#define VERSION_UPD 0
#ifndef STR