This commit is contained in:
DavidXanatos 2022-06-04 22:02:13 +02:00
parent 7fba701246
commit d9993510f9
3 changed files with 10 additions and 7 deletions

View File

@ -300,7 +300,7 @@ _FX BOOLEAN SbieDll_GetSettingsForName_bool(
//---------------------------------------------------------------------------
_FX BOOLEAN Config_InitPatternList(const WCHAR* boxname, const WCHAR* setting, LIST* list, ULONG flags)
_FX BOOLEAN Config_InitPatternList(const WCHAR* boxname, const WCHAR* setting, LIST* list, BOOLEAN dos)
{
WCHAR conf_buf[2048];
@ -310,11 +310,14 @@ _FX BOOLEAN Config_InitPatternList(const WCHAR* boxname, const WCHAR* setting, L
while (1) {
NTSTATUS status = SbieApi_QueryConf(
boxname, setting, index | flags, conf_buf, sizeof(conf_buf) - 16 * sizeof(WCHAR));
boxname, setting, index, conf_buf, sizeof(conf_buf) - 16 * sizeof(WCHAR));
if (!NT_SUCCESS(status))
break;
++index;
if (dos)
SbieDll_TranslateNtToDosPath(conf_buf);
ULONG level;
WCHAR* value = Config_MatchImageAndGetValue(conf_buf, Dll_ImageName, &level);
if (value)
@ -600,7 +603,7 @@ BOOLEAN SbieDll_CheckPatternInList(const WCHAR* string, ULONG length, const WCHA
List_Init(&Patterns);
Config_InitPatternList(boxname, setting, &Patterns, CONF_GET_NO_EXPAND);
Config_InitPatternList(boxname, setting, &Patterns, TRUE);
if (length == 0)
length = wcslen(string);

View File

@ -802,7 +802,7 @@ BOOLEAN Config_MatchImage(
WCHAR* Config_MatchImageAndGetValue(WCHAR* value, const WCHAR* ImageName, ULONG* pMode);
BOOLEAN Config_InitPatternList(const WCHAR* boxname, const WCHAR* setting, LIST* list, ULONG flags);
BOOLEAN Config_InitPatternList(const WCHAR* boxname, const WCHAR* setting, LIST* list, BOOLEAN dos);
VOID Config_FreePatternList(LIST* list);

View File

@ -68,9 +68,9 @@ _FX BOOLEAN File_InitFileMigration(void)
for(ULONG i=0; i < NUM_COPY_MODES; i++)
List_Init(&File_MigrationOptions[i]);
Config_InitPatternList(NULL, L"CopyEmpty", &File_MigrationOptions[FILE_COPY_EMPTY], 0);
Config_InitPatternList(NULL, L"CopyAlways", &File_MigrationOptions[FILE_COPY_CONTENT], 0);
Config_InitPatternList(NULL, L"DontCopy", &File_MigrationOptions[FILE_DONT_COPY], 0);
Config_InitPatternList(NULL, L"CopyEmpty", &File_MigrationOptions[FILE_COPY_EMPTY], FALSE);
Config_InitPatternList(NULL, L"CopyAlways", &File_MigrationOptions[FILE_COPY_CONTENT], FALSE);
Config_InitPatternList(NULL, L"DontCopy", &File_MigrationOptions[FILE_DONT_COPY], FALSE);
File_MigrationDenyWrite = Config_GetSettingsForImageName_bool(L"CopyBlockDenyWrite", FALSE);