-
Notifications
You must be signed in to change notification settings - Fork 124
/
Copy pathSecurity.Cryptography.cs
25 lines (22 loc) · 1.58 KB
/
Security.Cryptography.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
using System;
using System.Runtime.InteropServices;
using Windows.Win32.Foundation.Metadata;
namespace Windows.Win32.Security.Cryptography
{
// Manually defined due to missing unsafe modifier during codegen pass
// https://github.com/microsoft/win32metadata/issues/1914
[UnmanagedFunctionPointer(CallingConvention.Winapi)]
[return:NativeTypeName("SECURITY_STATUS")]
public unsafe delegate HRESULT SslGetCipherSuitePRFHashAlgorithmFn([NativeTypeName("NCRYPT_PROV_HANDLE")][In]UIntPtr hSslProvider, [NativeTypeName("DWORD")][In]uint dwProtocol, [NativeTypeName("DWORD")][In]uint dwCipherSuite, [NativeTypeName("DWORD")][In]uint dwKeyType, [NativeTypeName("WCHAR[64]")][NativeArrayInfo(CountConst = 64),Out]ushort* szPRFHash, [NativeTypeName("DWORD")][In]uint dwFlags);
public static unsafe partial class Apis
{
// Manually defined due to missing header definitions
// https://github.com/microsoft/win32metadata/issues/1605
[DllImport("BCryptPrimitives.dll", CallingConvention = CallingConvention.StdCall, ExactSpelling = true)]
[return: NativeTypeName("BOOL")]
public static extern int SystemPrng([NativeTypeName("PUCHAR")][MemorySize(BytesParamIndex=1)][Out] byte* pbRandomData, [NativeTypeName("SIZE_T")] nuint cbRandomData);
[DllImport("BCryptPrimitives.dll", CallingConvention = CallingConvention.StdCall, ExactSpelling = true)]
[return: NativeTypeName("BOOL")]
public static extern int ProcessPrng([NativeTypeName("PBYTE")][MemorySize(BytesParamIndex=1)][Out] byte* pbData, [NativeTypeName("SIZE_T")] nuint cbData);
}
}