27 references to SafeLibraryHandle
Microsoft.AspNetCore.Cryptography.Internal (27)
Cng\OSVersionUtil.cs (2)
24using var bcryptLibHandle = SafeLibraryHandle.Open(UnsafeNativeMethods.BCRYPT_LIB);
LibraryImports.g.cs (9)
10public static partial int FormatMessage(uint dwFlags, global::Microsoft.AspNetCore.Cryptography.SafeHandles.SafeLibraryHandle lpSource, uint dwMessageId, uint dwLanguageId, out global::Microsoft.AspNetCore.Cryptography.SafeHandles.LocalAllocHandle lpBuffer, uint nSize, nint Arguments) 20global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.AspNetCore.Cryptography.SafeHandles.SafeLibraryHandle>.ManagedToUnmanagedIn __lpSource_native__marshaller = new(); 94internal static partial bool GetModuleHandleEx(uint dwFlags, global::Microsoft.AspNetCore.Cryptography.SafeHandles.SafeLibraryHandle lpModuleName, out nint phModule) 102global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.AspNetCore.Cryptography.SafeHandles.SafeLibraryHandle>.ManagedToUnmanagedIn __lpModuleName_native__marshaller = new(); 143internal static partial nint GetProcAddress(global::Microsoft.AspNetCore.Cryptography.SafeHandles.SafeLibraryHandle hModule, string lpProcName) 151global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.AspNetCore.Cryptography.SafeHandles.SafeLibraryHandle>.ManagedToUnmanagedIn __hModule_native__marshaller = new(); 190internal static partial global::Microsoft.AspNetCore.Cryptography.SafeHandles.SafeLibraryHandle LoadLibraryEx(string lpFileName, nint hFile, uint dwFlags) 194global::Microsoft.AspNetCore.Cryptography.SafeHandles.SafeLibraryHandle __retVal = default; 197global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.AspNetCore.Cryptography.SafeHandles.SafeLibraryHandle>.ManagedToUnmanagedOut __retVal_native__marshaller = new();
SafeHandles\SafeLibraryHandle.cs (6)
109public static SafeLibraryHandle Open(string filename) 113SafeLibraryHandle handle = UnsafeNativeMethods.LoadLibraryEx(filename, IntPtr.Zero, LOAD_LIBRARY_SEARCH_SYSTEM32); 139SafeLibraryHandle lpSource, 171SafeLibraryHandle lpModuleName, // can point to a location within the module if GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS is set 182SafeLibraryHandle hModule, 188internal static partial SafeLibraryHandle LoadLibraryEx(
UnsafeNativeMethods.cs (10)
21private static SafeLibraryHandle? _lazyBCryptLibHandle; 24private static SafeLibraryHandle? _lazyCrypt32LibHandle; 27private static SafeLibraryHandle? _lazyNCryptLibHandle; 440private static SafeLibraryHandle GetLibHandle(string libraryName, ref SafeLibraryHandle? safeLibraryHandle) 444var newHandle = SafeLibraryHandle.Open(libraryName); 455private static SafeLibraryHandle GetBCryptLibHandle() => GetLibHandle(BCRYPT_LIB, ref _lazyBCryptLibHandle); 456private static SafeLibraryHandle GetCrypt32LibHandle() => GetLibHandle(CRYPT32_LIB, ref _lazyCrypt32LibHandle); 457private static SafeLibraryHandle GetNCryptLibHandle() => GetLibHandle(NCRYPT_LIB, ref _lazyNCryptLibHandle);