memory: avoid redundant Windows view protection

This commit is contained in:
nmzik
2026-10-07 22:27:35 +04:00
parent 038d2257de
commit c30ac7c904
3 changed files with 49 additions and 1 deletions
+18
View File
@@ -60,6 +60,12 @@
#endif
#endif
#if KYTY_PLATFORM == KYTY_PLATFORM_WINDOWS
namespace Libs::LibKernel::Memory {
bool TestWindowsBackingViewModes();
}
#endif
namespace Libs::Fiber {
struct FiberObject;
struct FiberOptParam;
@@ -1355,6 +1361,15 @@ void TestPartialUnmapPreservesHostPermissions() {
}
#endif
#if KYTY_PLATFORM == KYTY_PLATFORM_WINDOWS
void TestWindowsBackingViewPermissions() {
const char* test = "WindowsBackingViewPermissions";
Check(test, Libs::LibKernel::Memory::TestWindowsBackingViewModes(),
"backing view permissions differ from the requested mode");
std::printf("[host] %-48s ok\n", test);
}
#endif
void TestDirectMapValidationBeforeOwnerMutation() {
const char* test = "DirectMapValidationBeforeOwnerMutation";
int64_t invalid = -1;
@@ -4248,6 +4263,9 @@ int main(int argc, char** argv) {
RunTest(TestDirectPartialProtectUnmapPreservesNeighbors);
#if defined(__linux__)
RunTest(TestPartialUnmapPreservesHostPermissions);
#endif
#if KYTY_PLATFORM == KYTY_PLATFORM_WINDOWS
RunTest(TestWindowsBackingViewPermissions);
#endif
RunTest(TestDirectMapValidationBeforeOwnerMutation);
RunTest(TestDirectReleaseRollbackRestoresOwnerMapping);