|
// <auto-generated/>
internal static unsafe partial class Interop
{
internal static unsafe partial class Kernel32
{
[global::System.Runtime.InteropServices.DllImportAttribute("kernel32.dll", EntryPoint = "GetUserDefaultLCID", ExactSpelling = true)]
internal static extern partial int GetUserDefaultLCID();
}
}
internal static unsafe partial class Interop
{
internal static unsafe partial class Kernel32
{
[global::System.Runtime.InteropServices.DllImportAttribute("kernel32.dll", EntryPoint = "GetCurrentProcessId", ExactSpelling = true)]
internal static extern partial uint GetCurrentProcessId();
}
}
internal static unsafe partial class Interop
{
internal static unsafe partial class Kernel32
{
[global::System.Runtime.InteropServices.DllImportAttribute("kernel32.dll", EntryPoint = "LocalAlloc", ExactSpelling = true)]
private static extern partial nint LocalAlloc(uint uFlags, nuint uBytes);
}
}
internal static unsafe partial class Interop
{
internal static unsafe partial class Kernel32
{
[global::System.Runtime.InteropServices.DllImportAttribute("kernel32.dll", EntryPoint = "LocalFree", ExactSpelling = true)]
private static extern partial nint LocalFree(nint hMem);
}
}
internal static unsafe partial class Interop
{
internal static unsafe partial class Kernel32
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.26904")]
[global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
internal static partial global::Microsoft.Win32.SafeHandles.SafeWaitHandle OpenSemaphore(uint desiredAccess, bool inheritHandle, string name)
{
int __lastError;
bool __invokeSucceeded = default;
int __inheritHandle_native = default;
global::Microsoft.Win32.SafeHandles.SafeWaitHandle __retVal = default;
nint __retVal_native = default;
// Setup - Perform required setup.
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeWaitHandle>.ManagedToUnmanagedOut __retVal_native__marshaller = new();
try
{
// Marshal - Convert managed data to native data.
__inheritHandle_native = (int)(inheritHandle ? 1 : 0);
// Pin - Pin data in preparation for calling the P/Invoke.
fixed (void* __name_native = &global::System.Runtime.InteropServices.Marshalling.Utf16StringMarshaller.GetPinnableReference(name))
{
global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0);
__retVal_native = __PInvoke(desiredAccess, __inheritHandle_native, (ushort*)__name_native);
__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError();
}
__invokeSucceeded = true;
// UnmarshalCapture - Capture the native data into marshaller instances in case conversion to managed data throws an exception.
__retVal_native__marshaller.FromUnmanaged(__retVal_native);
// Unmarshal - Convert native data to managed data.
__retVal = __retVal_native__marshaller.ToManaged();
}
finally
{
if (__invokeSucceeded)
{
// CleanupCalleeAllocated - Perform cleanup of callee allocated resources.
__retVal_native__marshaller.Free();
}
}
global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
return __retVal;
// Local P/Invoke
[global::System.Runtime.InteropServices.DllImportAttribute("kernel32.dll", EntryPoint = "OpenSemaphoreW", ExactSpelling = true, CharSet = global::System.Runtime.InteropServices.CharSet.Unicode)]
static extern unsafe nint __PInvoke(uint __desiredAccess_native, int __inheritHandle_native, ushort* __name_native);
}
}
}
internal static unsafe partial class Interop
{
internal static unsafe partial class Kernel32
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.26904")]
[global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
internal static partial global::Microsoft.Win32.SafeHandles.SafeWaitHandle CreateSemaphoreEx(nint lpSecurityAttributes, int initialCount, int maximumCount, string name, uint flags, uint desiredAccess)
{
int __lastError;
bool __invokeSucceeded = default;
global::Microsoft.Win32.SafeHandles.SafeWaitHandle __retVal = default;
nint __retVal_native = default;
// Setup - Perform required setup.
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeWaitHandle>.ManagedToUnmanagedOut __retVal_native__marshaller = new();
try
{
// Pin - Pin data in preparation for calling the P/Invoke.
fixed (void* __name_native = &global::System.Runtime.InteropServices.Marshalling.Utf16StringMarshaller.GetPinnableReference(name))
{
global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0);
__retVal_native = __PInvoke(lpSecurityAttributes, initialCount, maximumCount, (ushort*)__name_native, flags, desiredAccess);
__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError();
}
__invokeSucceeded = true;
// UnmarshalCapture - Capture the native data into marshaller instances in case conversion to managed data throws an exception.
__retVal_native__marshaller.FromUnmanaged(__retVal_native);
// Unmarshal - Convert native data to managed data.
__retVal = __retVal_native__marshaller.ToManaged();
}
finally
{
if (__invokeSucceeded)
{
// CleanupCalleeAllocated - Perform cleanup of callee allocated resources.
__retVal_native__marshaller.Free();
}
}
global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
return __retVal;
// Local P/Invoke
[global::System.Runtime.InteropServices.DllImportAttribute("kernel32.dll", EntryPoint = "CreateSemaphoreExW", ExactSpelling = true, CharSet = global::System.Runtime.InteropServices.CharSet.Unicode)]
static extern unsafe nint __PInvoke(nint __lpSecurityAttributes_native, int __initialCount_native, int __maximumCount_native, ushort* __name_native, uint __flags_native, uint __desiredAccess_native);
}
}
}
internal static unsafe partial class Interop
{
internal static unsafe partial class Kernel32
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.26904")]
[global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
internal static partial bool ReleaseSemaphore(global::Microsoft.Win32.SafeHandles.SafeWaitHandle handle, int releaseCount, out int previousCount)
{
int __lastError;
previousCount = default;
nint __handle_native = default;
bool __retVal = default;
int __retVal_native = default;
// Setup - Perform required setup.
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeWaitHandle>.ManagedToUnmanagedIn __handle_native__marshaller = new();
try
{
// Marshal - Convert managed data to native data.
__handle_native__marshaller.FromManaged(handle);
// Pin - Pin data in preparation for calling the P/Invoke.
fixed (int* __previousCount_native = &previousCount)
{
// PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
__handle_native = __handle_native__marshaller.ToUnmanaged();
global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0);
__retVal_native = __PInvoke(__handle_native, releaseCount, __previousCount_native);
__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError();
}
// Unmarshal - Convert native data to managed data.
__retVal = __retVal_native != 0;
}
finally
{
// CleanupCallerAllocated - Perform cleanup of caller allocated resources.
__handle_native__marshaller.Free();
}
global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
return __retVal;
// Local P/Invoke
[global::System.Runtime.InteropServices.DllImportAttribute("kernel32.dll", EntryPoint = "ReleaseSemaphore", ExactSpelling = true)]
static extern unsafe int __PInvoke(nint __handle_native, int __releaseCount_native, int* __previousCount_native);
}
}
}
internal static unsafe partial class Interop
{
internal static unsafe partial class Kernel32
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.26904")]
[global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
internal static partial int WaitForSingleObject(global::Microsoft.Win32.SafeHandles.SafeWaitHandle handle, int timeout)
{
int __lastError;
nint __handle_native = default;
int __retVal = default;
// Setup - Perform required setup.
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeWaitHandle>.ManagedToUnmanagedIn __handle_native__marshaller = new();
try
{
// Marshal - Convert managed data to native data.
__handle_native__marshaller.FromManaged(handle);
{
// PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
__handle_native = __handle_native__marshaller.ToUnmanaged();
global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0);
__retVal = __PInvoke(__handle_native, timeout);
__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError();
}
}
finally
{
// CleanupCallerAllocated - Perform cleanup of caller allocated resources.
__handle_native__marshaller.Free();
}
global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
return __retVal;
// Local P/Invoke
[global::System.Runtime.InteropServices.DllImportAttribute("kernel32.dll", EntryPoint = "WaitForSingleObject", ExactSpelling = true)]
static extern unsafe int __PInvoke(nint __handle_native, int __timeout_native);
}
}
}
internal static unsafe partial class Interop
{
internal static unsafe partial class Kernel32
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.26904")]
[global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
internal static unsafe partial int WaitForMultipleObjects(uint nCount, nint* handles, bool waitAll, uint timeout)
{
int __lastError;
int __waitAll_native;
int __retVal;
// Marshal - Convert managed data to native data.
__waitAll_native = (int)(waitAll ? 1 : 0);
{
global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0);
__retVal = __PInvoke(nCount, handles, __waitAll_native, timeout);
__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError();
}
global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
return __retVal;
// Local P/Invoke
[global::System.Runtime.InteropServices.DllImportAttribute("kernel32.dll", EntryPoint = "WaitForMultipleObjects", ExactSpelling = true)]
static extern unsafe int __PInvoke(uint __nCount_native, nint* __handles_native, int __waitAll_native, uint __timeout_native);
}
}
}
internal static unsafe partial class Interop
{
internal static unsafe partial class OleAut32
{
[global::System.Runtime.InteropServices.DllImportAttribute("oleaut32.dll", EntryPoint = "SysAllocStringLen", ExactSpelling = true, CharSet = global::System.Runtime.InteropServices.CharSet.Unicode)]
internal static extern partial nint SysAllocStringLen(nint src, uint len);
}
}
internal static unsafe partial class Interop
{
internal static unsafe partial class OleAut32
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.26904")]
[global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
internal static partial nint SysAllocStringLen(string src, uint len)
{
nint __retVal;
// Pin - Pin data in preparation for calling the P/Invoke.
fixed (void* __src_native = &global::System.Runtime.InteropServices.Marshalling.Utf16StringMarshaller.GetPinnableReference(src))
{
__retVal = __PInvoke((ushort*)__src_native, len);
}
return __retVal;
// Local P/Invoke
[global::System.Runtime.InteropServices.DllImportAttribute("oleaut32.dll", EntryPoint = "SysAllocStringLen", ExactSpelling = true, CharSet = global::System.Runtime.InteropServices.CharSet.Unicode)]
static extern unsafe nint __PInvoke(ushort* __src_native, uint __len_native);
}
}
}
internal static unsafe partial class Interop
{
internal static unsafe partial class OleAut32
{
[global::System.Runtime.InteropServices.DllImportAttribute("oleaut32.dll", EntryPoint = "SetErrorInfo", ExactSpelling = true)]
internal static extern partial void SetErrorInfo(int dwReserved, nint pIErrorInfo);
}
}
internal static unsafe partial class Interop
{
internal static unsafe partial class OleAut32
{
[global::System.Runtime.InteropServices.DllImportAttribute("oleaut32.dll", EntryPoint = "SysFreeString", ExactSpelling = true)]
internal static extern partial void SysFreeString(nint bstr);
}
}
internal static unsafe partial class Interop
{
internal static unsafe partial class Ole32
{
[global::System.Runtime.InteropServices.DllImportAttribute("ole32.dll", EntryPoint = "CoTaskMemAlloc", ExactSpelling = true)]
internal static extern partial nint CoTaskMemAlloc(nuint cb);
}
}
internal static unsafe partial class Interop
{
internal static unsafe partial class Ole32
{
[global::System.Runtime.InteropServices.DllImportAttribute("ole32.dll", EntryPoint = "CoTaskMemRealloc", ExactSpelling = true)]
internal static extern partial nint CoTaskMemRealloc(nint pv, nuint cb);
}
}
internal static unsafe partial class Interop
{
internal static unsafe partial class Ole32
{
[global::System.Runtime.InteropServices.DllImportAttribute("ole32.dll", EntryPoint = "CoTaskMemFree", ExactSpelling = true)]
internal static extern partial void CoTaskMemFree(nint ptr);
}
}
internal static unsafe partial class Interop
{
internal static unsafe partial class Ole32
{
[global::System.Runtime.InteropServices.DllImportAttribute("ole32.dll", EntryPoint = "PropVariantClear", ExactSpelling = true)]
internal static extern partial void PropVariantClear(nint pObject);
}
}
namespace System.Data.Common
{
internal static unsafe partial class UnsafeNativeMethods
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.26904")]
[global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
internal static unsafe partial global::System.Data.OleDb.OleDbHResult GetErrorInfo(int dwReserved, out global::System.Data.Common.UnsafeNativeMethods.IErrorInfo ppIErrorInfo)
{
bool __invokeSucceeded = default;
ppIErrorInfo = default;
void* __ppIErrorInfo_native = default;
global::System.Data.OleDb.OleDbHResult __retVal = default;
try
{
{
__retVal = __PInvoke(dwReserved, &__ppIErrorInfo_native);
}
__invokeSucceeded = true;
// Unmarshal - Convert native data to managed data.
ppIErrorInfo = global::System.Runtime.InteropServices.Marshalling.UniqueComInterfaceMarshaller<global::System.Data.Common.UnsafeNativeMethods.IErrorInfo>.ConvertToManaged(__ppIErrorInfo_native);
}
finally
{
if (__invokeSucceeded)
{
// CleanupCalleeAllocated - Perform cleanup of callee allocated resources.
global::System.Runtime.InteropServices.Marshalling.UniqueComInterfaceMarshaller<global::System.Data.Common.UnsafeNativeMethods.IErrorInfo>.Free(__ppIErrorInfo_native);
}
}
return __retVal;
// Local P/Invoke
[global::System.Runtime.InteropServices.DllImportAttribute("oleaut32.dll", EntryPoint = "GetErrorInfo", ExactSpelling = true)]
static extern unsafe global::System.Data.OleDb.OleDbHResult __PInvoke(int __dwReserved_native, void** __ppIErrorInfo_native);
}
}
}
|