Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/corert.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/System.Private.CoreLib/shared/System/Security/SecureString.cs')
-rw-r--r--src/System.Private.CoreLib/shared/System/Security/SecureString.cs19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/System.Private.CoreLib/shared/System/Security/SecureString.cs b/src/System.Private.CoreLib/shared/System/Security/SecureString.cs
index 22f15acca..cdee9c907 100644
--- a/src/System.Private.CoreLib/shared/System/Security/SecureString.cs
+++ b/src/System.Private.CoreLib/shared/System/Security/SecureString.cs
@@ -139,7 +139,7 @@ namespace System.Security
{
throw new ArgumentOutOfRangeException(nameof(index), SR.ArgumentOutOfRange_IndexString);
}
- Debug.Assert(index <= Int32.MaxValue / sizeof(char));
+ Debug.Assert(index <= int.MaxValue / sizeof(char));
EnsureNotDisposed();
EnsureNotReadOnly();
@@ -156,6 +156,23 @@ namespace System.Security
}
}
+ private void EnsureNotDisposed()
+ {
+ if (_buffer == null)
+ {
+ throw new ObjectDisposedException(GetType().Name);
+ }
+ }
+
+ internal IntPtr MarshalToBSTR()
+ {
+ lock (_methodLock)
+ {
+ EnsureNotDisposed();
+ return MarshalToBSTRCore();
+ }
+ }
+
internal unsafe IntPtr MarshalToString(bool globalAlloc, bool unicode)
{
lock (_methodLock)