diff options
author | Alexander Köplinger <alkpli@microsoft.com> | 2019-05-27 16:31:25 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-27 16:31:25 +0300 |
commit | 8aaa24604328e8b484d742fe7b6f05e99ea1ed93 (patch) | |
tree | 424e44f3a3c2e1530547b5d2adc4337098ce7ffc /src/System.IO.FileSystem/tests | |
parent | bd858f2629346f9d3a63df58b664408da07d54e2 (diff) |
Remove Windows-specific p/invokes from tests (#288)
They cause issues on iOS where all p/invokes need to be resolved.
Diffstat (limited to 'src/System.IO.FileSystem/tests')
-rw-r--r-- | src/System.IO.FileSystem/tests/PortedCommon/DllImports.cs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/System.IO.FileSystem/tests/PortedCommon/DllImports.cs b/src/System.IO.FileSystem/tests/PortedCommon/DllImports.cs index 1130df6d05..4b99ea9241 100644 --- a/src/System.IO.FileSystem/tests/PortedCommon/DllImports.cs +++ b/src/System.IO.FileSystem/tests/PortedCommon/DllImports.cs @@ -8,6 +8,15 @@ using System.Text; internal static class DllImports { +#if MONO && MOBILE + internal static int GetLogicalDrives() => throw new PlatformNotSupportedException(); + + internal static bool GetDiskFreeSpaceEx(String drive, out long freeBytesForUser, out long totalBytes, out long freeBytes) => throw new PlatformNotSupportedException(); + + internal static bool GetVolumeInformation(String drive, [Out]StringBuilder volumeName, int volumeNameBufLen, out int volSerialNumber, out int maxFileNameLen, out int fileSystemFlags, [Out]StringBuilder fileSystemName, int fileSystemNameBufLen) => throw new PlatformNotSupportedException(); + + internal static int GetDriveType(string drive) => throw new PlatformNotSupportedException(); +#else [DllImport("kernel32.dll", SetLastError = true)] internal static extern int GetLogicalDrives(); @@ -19,5 +28,6 @@ internal static class DllImports [DllImport("kernel32.dll", EntryPoint = "GetDriveTypeW", CharSet = CharSet.Unicode, SetLastError = true, BestFitMapping = false)] internal static extern int GetDriveType(string drive); +#endif } |