aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/csharp/Grpc.Core/Internal/CallCredentialsSafeHandle.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/csharp/Grpc.Core/Internal/CallCredentialsSafeHandle.cs')
-rw-r--r--src/csharp/Grpc.Core/Internal/CallCredentialsSafeHandle.cs12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/csharp/Grpc.Core/Internal/CallCredentialsSafeHandle.cs b/src/csharp/Grpc.Core/Internal/CallCredentialsSafeHandle.cs
index 3678c7dd86..0f36337f11 100644
--- a/src/csharp/Grpc.Core/Internal/CallCredentialsSafeHandle.cs
+++ b/src/csharp/Grpc.Core/Internal/CallCredentialsSafeHandle.cs
@@ -1,5 +1,5 @@
#region Copyright notice and license
-// Copyright 2015, Google Inc.
+// Copyright 2015-2016, Google Inc.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
@@ -40,11 +40,7 @@ namespace Grpc.Core.Internal
/// </summary>
internal class CallCredentialsSafeHandle : SafeHandleZeroIsInvalid
{
- [DllImport("grpc_csharp_ext.dll")]
- static extern CallCredentialsSafeHandle grpcsharp_composite_call_credentials_create(CallCredentialsSafeHandle creds1, CallCredentialsSafeHandle creds2);
-
- [DllImport("grpc_csharp_ext.dll")]
- static extern void grpcsharp_call_credentials_release(IntPtr credentials);
+ static readonly NativeMethods Native = NativeMethods.Get();
private CallCredentialsSafeHandle()
{
@@ -52,12 +48,12 @@ namespace Grpc.Core.Internal
public static CallCredentialsSafeHandle CreateComposite(CallCredentialsSafeHandle creds1, CallCredentialsSafeHandle creds2)
{
- return grpcsharp_composite_call_credentials_create(creds1, creds2);
+ return Native.grpcsharp_composite_call_credentials_create(creds1, creds2);
}
protected override bool ReleaseHandle()
{
- grpcsharp_call_credentials_release(handle);
+ Native.grpcsharp_call_credentials_release(handle);
return true;
}
}