Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[wasm] Mark System.IO.MemoryMappedFiles APIs unsupported on browser #41971

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,23 @@ public partial class MemoryMappedFile : System.IDisposable
{
internal MemoryMappedFile() { }
public Microsoft.Win32.SafeHandles.SafeMemoryMappedFileHandle SafeMemoryMappedFileHandle { get { throw null; } }
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")]
public static System.IO.MemoryMappedFiles.MemoryMappedFile CreateFromFile(System.IO.FileStream fileStream, string? mapName, long capacity, System.IO.MemoryMappedFiles.MemoryMappedFileAccess access, System.IO.HandleInheritability inheritability, bool leaveOpen) { throw null; }
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")]
public static System.IO.MemoryMappedFiles.MemoryMappedFile CreateFromFile(string path) { throw null; }
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")]
public static System.IO.MemoryMappedFiles.MemoryMappedFile CreateFromFile(string path, System.IO.FileMode mode) { throw null; }
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")]
public static System.IO.MemoryMappedFiles.MemoryMappedFile CreateFromFile(string path, System.IO.FileMode mode, string? mapName) { throw null; }
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")]
public static System.IO.MemoryMappedFiles.MemoryMappedFile CreateFromFile(string path, System.IO.FileMode mode, string? mapName, long capacity) { throw null; }
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")]
public static System.IO.MemoryMappedFiles.MemoryMappedFile CreateFromFile(string path, System.IO.FileMode mode, string? mapName, long capacity, System.IO.MemoryMappedFiles.MemoryMappedFileAccess access) { throw null; }
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")]
public static System.IO.MemoryMappedFiles.MemoryMappedFile CreateNew(string? mapName, long capacity) { throw null; }
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")]
public static System.IO.MemoryMappedFiles.MemoryMappedFile CreateNew(string? mapName, long capacity, System.IO.MemoryMappedFiles.MemoryMappedFileAccess access) { throw null; }
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")]
public static System.IO.MemoryMappedFiles.MemoryMappedFile CreateNew(string? mapName, long capacity, System.IO.MemoryMappedFiles.MemoryMappedFileAccess access, System.IO.MemoryMappedFiles.MemoryMappedFileOptions options, System.IO.HandleInheritability inheritability) { throw null; }
[System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")]
public static System.IO.MemoryMappedFiles.MemoryMappedFile CreateOrOpen(string mapName, long capacity) { throw null; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,25 +92,30 @@ public static MemoryMappedFile OpenExisting(string mapName, MemoryMappedFileRigh
// page size. One can use FileStream.SetLength to bring the length back to a desirable size. By default,
// the MemoryMappedFile will close the FileStream object when it is disposed. This behavior can be
// changed by the leaveOpen boolean argument.
[UnsupportedOSPlatform("browser")]
public static MemoryMappedFile CreateFromFile(string path)
{
return CreateFromFile(path, FileMode.Open, null, DefaultSize, MemoryMappedFileAccess.ReadWrite);
}
[UnsupportedOSPlatform("browser")]
public static MemoryMappedFile CreateFromFile(string path, FileMode mode)
{
return CreateFromFile(path, mode, null, DefaultSize, MemoryMappedFileAccess.ReadWrite);
}

[UnsupportedOSPlatform("browser")]
public static MemoryMappedFile CreateFromFile(string path, FileMode mode, string? mapName)
{
return CreateFromFile(path, mode, mapName, DefaultSize, MemoryMappedFileAccess.ReadWrite);
}

[UnsupportedOSPlatform("browser")]
public static MemoryMappedFile CreateFromFile(string path, FileMode mode, string? mapName, long capacity)
{
return CreateFromFile(path, mode, mapName, capacity, MemoryMappedFileAccess.ReadWrite);
}

[UnsupportedOSPlatform("browser")]
public static MemoryMappedFile CreateFromFile(string path, FileMode mode, string? mapName, long capacity,
MemoryMappedFileAccess access)
{
Expand Down Expand Up @@ -179,6 +184,7 @@ public static MemoryMappedFile CreateFromFile(string path, FileMode mode, string
return new MemoryMappedFile(handle, fileStream, false);
}

[UnsupportedOSPlatform("browser")]
public static MemoryMappedFile CreateFromFile(FileStream fileStream, string? mapName, long capacity,
MemoryMappedFileAccess access,
HandleInheritability inheritability, bool leaveOpen)
Expand Down Expand Up @@ -235,18 +241,21 @@ public static MemoryMappedFile CreateFromFile(FileStream fileStream, string? map

// Factory Method Group #3: Creates a new empty memory mapped file. Such memory mapped files are ideal
// for IPC, when mapName != null.
[UnsupportedOSPlatform("browser")]
public static MemoryMappedFile CreateNew(string? mapName, long capacity)
{
return CreateNew(mapName, capacity, MemoryMappedFileAccess.ReadWrite, MemoryMappedFileOptions.None,
HandleInheritability.None);
}

[UnsupportedOSPlatform("browser")]
public static MemoryMappedFile CreateNew(string? mapName, long capacity, MemoryMappedFileAccess access)
{
return CreateNew(mapName, capacity, access, MemoryMappedFileOptions.None,
HandleInheritability.None);
}

[UnsupportedOSPlatform("browser")]
public static MemoryMappedFile CreateNew(string? mapName, long capacity, MemoryMappedFileAccess access,
MemoryMappedFileOptions options,
HandleInheritability inheritability)
Expand Down