audit: EterBase CRC32/FileBase/MappedFile mapped, with port.utils checks

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
shenlei
2026-09-30 12:46:43 +09:00
co-authored by Claude Opus 5.5
parent 290a331aef
commit f9b1044a4a
5 changed files with 308 additions and 62 deletions
+109 -35
View File
@@ -5,100 +5,174 @@
"contracts": [],
"functions": {
"CMappedFile::CMappedFile": {
"status": "PORTED",
"impl": [
"src/platform/EterBase/MappedFile.cpp:CMappedFile::CMappedFile"
],
"status": "ADAPTED",
"note": "platform CMappedFile: std::ifstream read into an owned buffer instead of CreateFileMapping/MapViewOfFile; same Create/Map/Link/BindLZObject contract",
"test": "tests/port/port_eterpack_test.cpp (103 packs, 54891 entries, first-registered wins, 4 SECURITY rejects)"
"test": [
"tests/port/port_utils_test.cpp"
],
"note": "Verbatim 40250."
},
"CMappedFile::~CMappedFile": {
"status": "PORTED",
"impl": [
"src/platform/EterBase/MappedFile.cpp:CMappedFile::~CMappedFile"
],
"status": "ADAPTED",
"note": "platform CMappedFile: std::ifstream read into an owned buffer instead of CreateFileMapping/MapViewOfFile; same Create/Map/Link/BindLZObject contract",
"test": "tests/port/port_eterpack_test.cpp (103 packs, 54891 entries, first-registered wins, 4 SECURITY rejects)"
"test": [
"tests/port/port_utils_test.cpp"
],
"note": "Verbatim 40250."
},
"CMappedFile::Create": {
"status": "PORTED",
"impl": [
"src/platform/EterBase/MappedFile.cpp:CMappedFile::Create"
],
"status": "ADAPTED",
"note": "platform CMappedFile: std::ifstream read into an owned buffer instead of CreateFileMapping/MapViewOfFile; same Create/Map/Link/BindLZObject contract",
"test": "tests/port/port_eterpack_test.cpp (103 packs, 54891 entries, first-registered wins, 4 SECURITY rejects)"
"test": [
"tests/port/port_utils_test.cpp"
],
"note": "Verbatim 40250."
},
"CMappedFile::Get": {
"status": "TODO"
"status": "PORTED",
"impl": [
"src/platform/EterBase/MappedFile.cpp:CMappedFile::Get"
],
"test": [
"tests/port/port_utils_test.cpp"
],
"note": "Verbatim 40250."
},
"CMappedFile::Link": {
"status": "PORTED",
"impl": [
"src/platform/EterBase/MappedFile.cpp:CMappedFile::Link"
],
"status": "ADAPTED",
"note": "platform CMappedFile: std::ifstream read into an owned buffer instead of CreateFileMapping/MapViewOfFile; same Create/Map/Link/BindLZObject contract",
"test": "tests/port/port_eterpack_test.cpp (103 packs, 54891 entries, first-registered wins, 4 SECURITY rejects)"
"test": [
"tests/port/port_utils_test.cpp"
],
"note": "Verbatim 40250."
},
"CMappedFile::BindLZObject": {
"status": "PORTED",
"impl": [
"src/platform/EterBase/MappedFile.cpp:CMappedFile::BindLZObject"
],
"status": "ADAPTED",
"note": "platform CMappedFile: std::ifstream read into an owned buffer instead of CreateFileMapping/MapViewOfFile; same Create/Map/Link/BindLZObject contract",
"test": "tests/port/port_eterpack_test.cpp (103 packs, 54891 entries, first-registered wins, 4 SECURITY rejects)"
"test": [
"tests/port/port_utils_test.cpp"
],
"note": "Verbatim 40250."
},
"CMappedFile::BindLZObjectWithBufferedSize": {
"status": "TODO"
"status": "PORTED",
"impl": [
"src/platform/EterBase/MappedFile.cpp:CMappedFile::BindLZObjectWithBufferedSize"
],
"test": [
"tests/port/port_utils_test.cpp"
],
"note": "Verbatim 40250."
},
"CMappedFile::AppendDataBlock": {
"status": "TODO"
"status": "PORTED",
"impl": [
"src/platform/EterBase/MappedFile.cpp:CMappedFile::AppendDataBlock"
],
"test": [
"tests/port/port_utils_test.cpp"
],
"note": "Verbatim 40250."
},
"CMappedFile::Destroy": {
"status": "PORTED",
"impl": [
"src/platform/EterBase/MappedFile.cpp:CMappedFile::Destroy"
],
"status": "ADAPTED",
"note": "platform CMappedFile: std::ifstream read into an owned buffer instead of CreateFileMapping/MapViewOfFile; same Create/Map/Link/BindLZObject contract",
"test": "tests/port/port_eterpack_test.cpp (103 packs, 54891 entries, first-registered wins, 4 SECURITY rejects)"
"test": [
"tests/port/port_utils_test.cpp"
],
"note": "Verbatim 40250."
},
"CMappedFile::Seek": {
"status": "TODO"
"status": "PORTED",
"impl": [
"src/platform/EterBase/MappedFile.cpp:CMappedFile::Seek"
],
"test": [
"tests/port/port_utils_test.cpp"
],
"note": "Verbatim 40250."
},
"CMappedFile::Map": {
"status": "ADAPTED",
"impl": [
"src/platform/EterBase/MappedFile.cpp:CMappedFile::Map"
],
"status": "ADAPTED",
"note": "platform CMappedFile: std::ifstream read into an owned buffer instead of CreateFileMapping/MapViewOfFile; same Create/Map/Link/BindLZObject contract",
"test": "tests/port/port_eterpack_test.cpp (103 packs, 54891 entries, first-registered wins, 4 SECURITY rejects)"
"test": [
"tests/port/port_utils_test.cpp"
],
"note": "CreateFileMapping/MapViewOfFile -> POSIX mmap of the CFileBase stream (Windows build keeps the Win32 calls), view start aligned down to the page size as 40250 aligns to the allocation granularity; a zero-length view maps 1 byte (mmap rejects 0). Invariant: *dest points at file offset `offset`, Size() == the mapped length, a view past the end returns 0."
},
"CMappedFile::GetCurrentSeekPoint": {
"status": "TODO"
"status": "PORTED",
"impl": [
"src/platform/EterBase/MappedFile.cpp:CMappedFile::GetCurrentSeekPoint"
],
"test": [
"tests/port/port_utils_test.cpp"
],
"note": "Verbatim 40250."
},
"CMappedFile::Size": {
"status": "PORTED",
"impl": [
"src/platform/EterBase/MappedFile.cpp:CMappedFile::Size"
],
"status": "ADAPTED",
"note": "platform CMappedFile: std::ifstream read into an owned buffer instead of CreateFileMapping/MapViewOfFile; same Create/Map/Link/BindLZObject contract",
"test": "tests/port/port_eterpack_test.cpp (103 packs, 54891 entries, first-registered wins, 4 SECURITY rejects)"
"test": [
"tests/port/port_utils_test.cpp"
],
"note": "Verbatim 40250."
},
"CMappedFile::GetPosition": {
"status": "TODO"
"status": "PORTED",
"impl": [
"src/platform/EterBase/MappedFile.cpp:CMappedFile::GetPosition"
],
"test": [
"tests/port/port_utils_test.cpp"
],
"note": "Verbatim 40250."
},
"CMappedFile::Read": {
"status": "TODO"
"status": "PORTED",
"impl": [
"src/platform/EterBase/MappedFile.cpp:CMappedFile::Read"
],
"test": [
"tests/port/port_utils_test.cpp"
],
"note": "Verbatim 40250."
},
"CMappedFile::GetSeekPosition": {
"status": "TODO"
"status": "PORTED",
"impl": [
"src/platform/EterBase/MappedFile.cpp:CMappedFile::GetSeekPosition"
],
"test": [
"tests/port/port_utils_test.cpp"
],
"note": "Verbatim 40250."
},
"CMappedFile::Unmap": {
"status": "ADAPTED",
"impl": [
"src/platform/EterBase/MappedFile.cpp:CMappedFile::Unmap"
],
"status": "ADAPTED",
"note": "platform CMappedFile: std::ifstream read into an owned buffer instead of CreateFileMapping/MapViewOfFile; same Create/Map/Link/BindLZObject contract",
"test": "tests/port/port_eterpack_test.cpp (103 packs, 54891 entries, first-registered wins, 4 SECURITY rejects)"
"test": [
"tests/port/port_utils_test.cpp"
],
"note": "CreateFileMapping/MapViewOfFile -> POSIX mmap of the CFileBase stream (Windows build keeps the Win32 calls), view start aligned down to the page size as 40250 aligns to the allocation granularity; a zero-length view maps 1 byte (mmap rejects 0). Invariant: *dest points at file offset `offset`, Size() == the mapped length, a view past the end returns 0."
}
}
}