}
}
- private void EnsureNotDisposed()
- {
- if (_buffer == null)
- {
- throw new ObjectDisposedException(GetType().Name);
- }
- }
-
private void ClearCore()
{
_decryptedLength = 0;
_buffer.Write((ulong)(index * sizeof(char)), c);
}
- internal unsafe IntPtr MarshalToBSTR()
+ internal unsafe IntPtr MarshalToBSTRCore()
{
int length = _decryptedLength;
IntPtr ptr = IntPtr.Zero;
using System.Runtime;
using System.Runtime.InteropServices;
using System.Security.Cryptography;
-using Microsoft.Win32;
namespace System.Security
{
}
}
- internal unsafe IntPtr MarshalToBSTR()
+ internal unsafe IntPtr MarshalToBSTRCore()
{
int length = _decryptedLength;
IntPtr ptr = IntPtr.Zero;
return result;
}
- private void EnsureNotDisposed()
- {
- if (_buffer == null)
- {
- throw new ObjectDisposedException(GetType().Name);
- }
- }
-
// -----------------------------
// ---- PAL layer ends here ----
// -----------------------------
}
}
+ 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)