diff --git "a/drivers/filesystems/fastfat/create.c" "b/drivers/filesystems/fastfat/create.c" index cf2cf85e4c5..fb4555600df 100644 --- "a/drivers/filesystems/fastfat/create.c" +++ "b/drivers/filesystems/fastfat/create.c" @@ -6445,6 +6445,30 @@ Return Value: // is going to fail. // +#ifdef __REACTOS__ + /* This protects TAHOMA.TTF and TAHOMABD.TTF from overwrites in a similar + * way that Windows File Protection would if it were implemented. */ + WCHAR *tah = { 0 }; + if (wcslen(FileObject->FileName.Buffer) >= 16) + tah = FileObject->FileName.Buffer + + (wcslen(FileObject->FileName.Buffer) - 16); + WCHAR *tahbd = { 0 }; + if (wcslen(FileObject->FileName.Buffer) >= 18) + tahbd = FileObject->FileName.Buffer + + (wcslen(FileObject->FileName.Buffer) - 18); + + if (_wcsicmp(tah, L"FONTS\\TAHOMA.TTF") == 0) + { + KdPrint(("FAT32: HACK. Should be using Windows File Protection\n")); + try_return( Iosb.Status = STATUS_USER_MAPPED_FILE ); + } + if (_wcsicmp(tahbd, L"FONTS\\TAHOMABD.TTF") == 0) + { + KdPrint(("FAT32: HACK. Should be using Windows File Protection\n")); + try_return( Iosb.Status = STATUS_USER_MAPPED_FILE ); + } +#endif + if (!MmCanFileBeTruncated( &Fcb->NonPaged->SectionObjectPointers, &FatLargeZero )) {