When defining the P/Invoke signatures and structs, we follow the guidelines in the [interop best practices documentation](https://docs.microsoft.com/en-us/dotnet/standard/native-interop/best-practices).
-The runtime repo makes use of [source-generated p/invokes](../design/features/source-generator-pinvokes.md) whenever possible (see [the compatibility doc](../design/libraries/LibraryImportGenerator/Compatibility.md) for unsupported scenarios). Methods should be marked `GeneratedDllImport` and be `static` and `partial`.
+The runtime repo makes use of [source-generated p/invokes](../design/features/source-generator-pinvokes.md) whenever possible (see [the compatibility doc](../design/libraries/LibraryImportGenerator/Compatibility.md) for unsupported scenarios). Methods should be marked `LibraryImport` and be `static` and `partial`.
If implicit framework references are disabled (as is the case for most libraries projects), explicit references to the below are required for marshalling arrays:
- `System.Memory`
### Checkpoint 5: .NET 6-compatible output
-A very important component of source generators is determining how to trigger them. For the DllImportGenerator, we trigger on a new attribute type, `GeneratedDllImportAttribute`, that is applied in place of the previous `DllImportAttribute`. For the JSON source generator, the team decided to have developers define an empty `JsonSerializerContext`-derived class and add `JsonSerializableAttribute` attribute on that context type that each point to a type that the generated serialization context should support. Below are the potential API designs we considered. All options below would support the `GuidAttribute` attribute to specify an IID, the `InterfaceTypeAttribute` attribute with the `InterfaceIsIUnknown` member (and `InterfaceIsIDispatch` if Checkpoint 4 is achieved), and the `DispIdAttribute` for `IDispatch` scenarios. We selected Option 5 as it gives us the most flexibility to express the switches we want to express to the user without tying us down to legacy requirements or requiring additional metadata in basic scenarios.
+A very important component of source generators is determining how to trigger them. For the DllImportGenerator, we trigger on a new attribute type, `LibraryImportAttribute`, that is applied in place of the previous `DllImportAttribute`. For the JSON source generator, the team decided to have developers define an empty `JsonSerializerContext`-derived class and add `JsonSerializableAttribute` attribute on that context type that each point to a type that the generated serialization context should support. Below are the potential API designs we considered. All options below would support the `GuidAttribute` attribute to specify an IID, the `InterfaceTypeAttribute` attribute with the `InterfaceIsIUnknown` member (and `InterfaceIsIDispatch` if Checkpoint 4 is achieved), and the `DispIdAttribute` for `IDispatch` scenarios. We selected Option 5 as it gives us the most flexibility to express the switches we want to express to the user without tying us down to legacy requirements or requiring additional metadata in basic scenarios.
#### Option 1: Annotated ComWrappers stub
Pros:
-- Similar experience to the `GeneratedDllImportAttribute`, where it basically replaces its built-in equivalent as a drop-in.
+- Similar experience to the `LibraryImportAttribute`, where it basically replaces its built-in equivalent as a drop-in.
- Very easy to automatically hook up generated marshalling and to provide an easy process for other source generators to duplicate to support side-by-side as the policy is very simple.
- Since we only generate a single `ComWrappers`-derived type, we could also decide to make the `ComObject` type public for .NET 7+ scenarios and make it private for .NET 6 scenarios as we know there will only ever be one.
- The `GeneratedComImportAttribute` and `GeneratedComVisibleAttribute` attributes mirror the existing `ComImportAttribute` and `ComVisibleAttribute`, which will help provide a more intuitive view of the types and how to hook in tools that process C# -> TLB or TLB -> C# into the generator's flow.
Pros:
-- Similar experience to the `GeneratedDllImportAttribute`, where it basically replaces its built-in equivalent as a drop-in.
+- Similar experience to the `LibraryImportAttribute`, where it basically replaces its built-in equivalent as a drop-in.
- The `GeneratedComImportAttribute` and `GeneratedComVisibleAttribute` attributes mirror the existing `ComImportAttribute` and `ComVisibleAttribute`, which will help provide a more intuitive view of the types and how to hook in tools that process C# -> TLB or TLB -> C# into the generator's flow.
Cons:
`Program.cs` (User written code)
``` CSharp
-/* A */ [GeneratedDllImportAttribute("Kernel32.dll")]
+/* A */ [LibraryImportAttribute("Kernel32.dll")]
/* B */ partial static bool QueryPerformanceCounter(out long lpPerformanceCount);
...
long count;
Observe point (A), the new attribute. This attribute provides an indication to a Source Generator that the following declaration represents a native export that will be called via a generated stub.
-During the source generation process the metadata in the `GeneratedDllImportAttribute` (A) would be used to generate a stub and invoke the desired native export. Also note that the method declaration is marked `partial`. The Source Generator would then generate the source for this partial method. The invocation (C) remains unchanged to that of usage involving `DllImportAttribute`.
+During the source generation process the metadata in the `LibraryImportAttribute` (A) would be used to generate a stub and invoke the desired native export. Also note that the method declaration is marked `partial`. The Source Generator would then generate the source for this partial method. The invocation (C) remains unchanged to that of usage involving `DllImportAttribute`.
`Stubs.g.cs` (Source Generator code)
In the current Source Generator design modification of any user written code is not permitted. This includes modification of any non-functional metadata (e.g. Attributes). The above design therefore introduces a new attribute and signature for consumption of a native export. In order to consume Source Generators, users would need to update their source and adoption could be stunted by this requirement.
-As a mitigation it would be possible to create a [Roslyn Analyzer and Code fix](https://github.com/dotnet/roslyn/blob/master/docs/wiki/Getting-Started-Writing-a-Custom-Analyzer-&-Code-Fix.md) to aid the developer in converting `DllImportAttribute` marked functions to use `GeneratedDllImportAttribute`. Additionally, the function signature would need to be updated to remove the `extern` keyword and add the `partial` keyword to the function and potentially the enclosing class.
+As a mitigation it would be possible to create a [Roslyn Analyzer and Code fix](https://github.com/dotnet/roslyn/blob/master/docs/wiki/Getting-Started-Writing-a-Custom-Analyzer-&-Code-Fix.md) to aid the developer in converting `DllImportAttribute` marked functions to use `LibraryImportAttribute`. Additionally, the function signature would need to be updated to remove the `extern` keyword and add the `partial` keyword to the function and potentially the enclosing class.
## Proposed API
-Given the Source Generator restrictions and potential confusion about overloaded attribute usage, the new `GeneratedDllImportAttribute` attribute mirrors the existing `DllImportAttribute`.
+Given the Source Generator restrictions and potential confusion about overloaded attribute usage, the new `LibraryImportAttribute` attribute mirrors the existing `DllImportAttribute`.
``` CSharp
namespace System.Runtime.InteropServices
/// arguments instead of relying on the CLR to generate an IL Stub at runtime.
/// </summary>
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
- public sealed class GeneratedDllImportAttribute : Attribute
+ public sealed class LibraryImportAttribute : Attribute
{
/// <summary>
/// Enables or disables best-fit mapping behavior when converting Unicode characters
### Fallback mechanism
-In the event a marshaller would generate code that has a specific target framework or version requirement that is not satisfied, the generator will instead produce a normal `DllImportAttribute` declaration. This fallback mechanism enables the use of `GeneratedDllImportAttribute` in most circumstances and permits the conversion from `DllImportAttribute` to `GeneratedDllImportAttribute` to be across most code bases. There are instances where the generator will not be able to handle signatures or configuration. For example, uses of `StringBuilder` are not supported in any form and consumers should retain uses of `DllImportAttribute`. Additionally, `GeneratedDllImportAttribute` cannot represent all settings available on `DllImportAttribute`—see below for details.
+In the event a marshaller would generate code that has a specific target framework or version requirement that is not satisfied, the generator will instead produce a normal `DllImportAttribute` declaration. This fallback mechanism enables the use of `LibraryImportAttribute` in most circumstances and permits the conversion from `DllImportAttribute` to `LibraryImportAttribute` to be across most code bases. There are instances where the generator will not be able to handle signatures or configuration. For example, uses of `StringBuilder` are not supported in any form and consumers should retain uses of `DllImportAttribute`. Additionally, `LibraryImportAttribute` cannot represent all settings available on `DllImportAttribute`—see below for details.
### Semantic changes compared to `DllImportAttribute`
[`CharSet`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.dllimportattribute.charset) has been replaced with a new `StringMarshalling` enumeration. `Ansi` and `Auto` are no longer supported as first-class options and `Utf8` has been added.
-With `DllImportAttribute`, the default value of [`CharSet`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.dllimportattribute.charset) is runtime/language-defined. In the built-in system, the default value of the `CharSet` property is `CharSet.Ansi`. The P/Invoke source generator makes no assumptions about `StringMarshalling` if it is not explicitly set on `GeneratedDllImportAttribute`. Marshalling of `char` or `string` requires explicitly specifying marshalling information.
+With `DllImportAttribute`, the default value of [`CharSet`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.dllimportattribute.charset) is runtime/language-defined. In the built-in system, the default value of the `CharSet` property is `CharSet.Ansi`. The P/Invoke source generator makes no assumptions about `StringMarshalling` if it is not explicitly set on `LibraryImportAttribute`. Marshalling of `char` or `string` requires explicitly specifying marshalling information.
-[`BestFitMapping`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.dllimportattribute.bestfitmapping) and [`ThrowOnUnmappableChar`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.dllimportattribute.throwonunmappablechar) will not be supported for `GeneratedDllImportAttribute`. These values only have meaning on Windows when marshalling string data (`char`, `string`, `StringBuilder`) as [ANSI](https://docs.microsoft.com/windows/win32/intl/code-pages). As the general recommendation - including from Windows - is to move away from ANSI, the P/Invoke source generator will not support these fields.
+[`BestFitMapping`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.dllimportattribute.bestfitmapping) and [`ThrowOnUnmappableChar`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.dllimportattribute.throwonunmappablechar) will not be supported for `LibraryImportAttribute`. These values only have meaning on Windows when marshalling string data (`char`, `string`, `StringBuilder`) as [ANSI](https://docs.microsoft.com/windows/win32/intl/code-pages). As the general recommendation - including from Windows - is to move away from ANSI, the P/Invoke source generator will not support these fields.
-[`CallingConvention`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.dllimportattribute.callingconvention) will not be supported for `GeneratedDllImportAttribute`. Users will be required to use the new `UnmanagedCallConvAttribute` attribute instead. This attribute provides support for extensible calling conventions and provides parity with the `UnmanagedCallersOnlyAttribute` attribute and C# function pointer syntax. We will enable our conversion code-fix to automatically convert explicit and known calling convention usage to use the `UnmanagedCallConvAttribute`.
+[`CallingConvention`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.dllimportattribute.callingconvention) will not be supported for `LibraryImportAttribute`. Users will be required to use the new `UnmanagedCallConvAttribute` attribute instead. This attribute provides support for extensible calling conventions and provides parity with the `UnmanagedCallersOnlyAttribute` attribute and C# function pointer syntax. We will enable our conversion code-fix to automatically convert explicit and known calling convention usage to use the `UnmanagedCallConvAttribute`.
-[`ExactSpelling`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.dllimportattribute.exactspelling) will not be supported for `GeneratedDllImportAttribute`. If `ExactSpelling` is used on an existing `DllImport`, the offered code-fix will provide users with additional options for using `A` or `W` suffixed variants depending on the provided `CharSet` so they can explicitly choose which spelling is correct for their scenario.
+[`ExactSpelling`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.dllimportattribute.exactspelling) will not be supported for `LibraryImportAttribute`. If `ExactSpelling` is used on an existing `DllImport`, the offered code-fix will provide users with additional options for using `A` or `W` suffixed variants depending on the provided `CharSet` so they can explicitly choose which spelling is correct for their scenario.
### Required references
Marshalling of `char` will only be supported with `StringMarshalling.Utf16` or as `UnmanagedType.U2` or `UnmanagedType.I2`. It will not be supported when configured with any of the following:
- [`UnmanagedType.U1` or `UnmanagedType.I1`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.unmanagedtype)
- `StringMarshalling.Utf8` will not be supported.
- - No explicit marshalling information - either `GeneratedDllImportAttribute.StringMarshalling` or [`MarshalAsAttribute`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.marshalasattribute)
+ - No explicit marshalling information - either `LibraryImportAttribute.StringMarshalling` or [`MarshalAsAttribute`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.marshalasattribute)
In the built-in system, marshalling with `CharSet.Ansi` and `CharSet.None` used the [system default Windows ANSI code page](https://docs.microsoft.com/windows/win32/api/stringapiset/nf-stringapiset-widechartomultibyte) when on Windows and took the first byte of the UTF-8 encoding on non-Windows platforms. The above reasoning also applies to marshalling of a `char` as `UnmanagedType.U1` and `UnmanagedType.I1`. All approaches are fundamentally flawed and therefore not supported. If a single-byte character is expected to be marshalled it is left to the caller to convert a .NET `char` into a single `byte` prior to calling the native function.
Marshalling of `string` will not be supported when configured with any of the following:
- [`UnmanagedType.VBByRefStr`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.unmanagedtype)
- - No explicit marshalling information - either `GeneratedDllImportAttribute.StringMarshalling` or [`MarshalAsAttribute`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.marshalasattribute)
+ - No explicit marshalling information - either `LibraryImportAttribute.StringMarshalling` or [`MarshalAsAttribute`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.marshalasattribute)
When converting from native to managed, the built-in system would throw a [`MarshalDirectiveException`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.marshaldirectiveexception) if the string's length is over 0x7ffffff0. The generated marshalling code will no longer perform this check.
### `LCIDConversion` support
-[`LCIDConversionAttribute`](`https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.lcidconversionattribute`) will not be supported for methods marked with `GeneratedDllImportAttribute`.
+[`LCIDConversionAttribute`](`https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.lcidconversionattribute`) will not be supported for methods marked with `LibraryImportAttribute`.
### `[In, Out]` Attributes
# P/Invoke Generation Pipeline
-The P/Invoke source generator is responsible for finding all methods marked with `GeneratedDllImportAttribute` and generating code for their implementations (stubs) and corresponding P/Invokes that will be called by the stubs. For every method, the steps are:
+The P/Invoke source generator is responsible for finding all methods marked with `LibraryImportAttribute` and generating code for their implementations (stubs) and corresponding P/Invokes that will be called by the stubs. For every method, the steps are:
1. [Process the symbols and metadata](#symbols-and-metadata-processing) for the method, its parameters, and its return type.
1. [Determine the marshalling generators](#marshalling-generators) that will be responsible for generating the stub code for each parameter and return
## Symbol and metadata processing
-The generator processes the method's `GeneratedDllImportAttribute` data, the method's parameter and return types, and the metadata on them (e.g. [`LCIDConversionAttribute`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.lcidconversionattribute), [`MarshalAsAttribute`][MarshalAsAttribute], [struct marshalling attributes](StructMarshalling.md)). This information is used to determine the corresponding native type for each managed parameter/return type and how they will be marshalled.
+The generator processes the method's `LibraryImportAttribute` data, the method's parameter and return types, and the metadata on them (e.g. [`LCIDConversionAttribute`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.lcidconversionattribute), [`MarshalAsAttribute`][MarshalAsAttribute], [struct marshalling attributes](StructMarshalling.md)). This information is used to determine the corresponding native type for each managed parameter/return type and how they will be marshalled.
A [`TypePositionInfo`][src-TypePositionInfo] is created for each type that needs to be marshalled. For each parameter and return type, this captures the managed type, managed and native positions (return or index in parameter list), and marshalling information.
The below signature indicates that the native function returns an HRESULT, but has no other return value (out parameter).
```C#
-[GeneratedDllImport("Lib", PreserveSig = false)]
+[LibraryImport("Lib", PreserveSig = false)]
static partial void Method();
```
Processing the above signature would create a `TypePositionInfo` for the HRESULT return type for native call, with properties indicating that it is in the native return position and has no managed position. The actual P/Invoke would be:
The below signature indicates that the native function returns an HRESULT and also has an out parameter to be used as the managed return value.
```C#
-[GeneratedDllImport("Lib", PreserveSig = false)]
+[LibraryImport("Lib", PreserveSig = false)]
[return: MarshalAs(UnmanagedType.U1)]
static partial bool MethodWithReturn();
```
The P/Invoke called by the stub is created based on the user's original declaration of the stub. The signature is generated using the syntax returned by `AsNativeType` and `AsParameter` of the marshalling generators for the return and parameters. Any marshalling attributes on the return and parameters of the managed method - [`MarshalAsAttribute`][MarshalAsAttribute], [`InAttribute`][InAttribute], [`OutAttribute`][OutAttribute] - are dropped.
-The fields of the [`DllImportAttribute`][DllImportAttribute] are set based on the fields of `GeneratedDllImportAttribute` as follows:
+The fields of the [`DllImportAttribute`][DllImportAttribute] are set based on the fields of `LibraryImportAttribute` as follows:
| Field | Behaviour |
| ------------------------------------------------- | --------- |
```C#
// Original declaration
-[GeneratedDllImport("Lib")]
+[LibraryImport("Lib")]
static partial void Method(out int i);
// Generated P/Invoke
```C#
// Original declaration
-[GeneratedDllImport("Lib", EntryPoint = "EntryPoint", CharSet = CharSet.Unicode)]
+[LibraryImport("Lib", EntryPoint = "EntryPoint", CharSet = CharSet.Unicode)]
static partial int Method(string s);
// Generated P/Invoke
```C#
// Original declaration
-[GeneratedDllImport("Lib", SetLastError = true)]
+[LibraryImport("Lib", SetLastError = true)]
[return: [MarshalAs(UnmanagedType.U1)]
static partial bool Method([In][MarshasAs(UnmanagedType.LPWStr)] string s);
```csharp
namespace System.Runtime.InteropServices
-{
+{
[AttributeUsage(AttributeTargets.Struct | AttributeTargets.Class)]
public sealed class GenericContiguousCollectionMarshallerAttribute : Attribute
{
// these constructors are required if marshalling from managed to native is supported.
public GenericContiguousCollectionMarshallerImpl(GenericCollection<T, U, V, ...> collection, int nativeSizeOfElement);
public GenericContiguousCollectionMarshallerImpl(GenericCollection<T, U, V, ...> collection, Span<byte> stackSpace, int nativeSizeOfElement); // optional
-
+
public const int StackBufferSize = /* */; // required if the span-based constructor is supplied.
/// <summary>
public int ToManaged() => value;
}
-[GeneratedDllImport("Native")]
+[LibraryImport("Native")]
[return:MarshalUsing(CountElementName = nameof(length))]
public static partial Span<int> DuplicateValues([MarshalUsing(typeof(WrappedInt), ElementIndirectionLevel = 1)] Span<int> values, int length);
// these constructors are required if marshalling from managed to native is supported.
public GenericContiguousCollectionMarshallerImpl(GenericCollection<T, U, V, ...> collection, int nativeSizeOfElements);
public GenericContiguousCollectionMarshallerImpl(GenericCollection<T, U, V, ...> collection, Span<byte> stackSpace, int nativeSizeOfElements); // optional
-
+
public const int StackBufferSize = /* */; // required if the span-based constructor is supplied.
- public Span<TCollectionElement> ManagedValues { get; }
<ItemGroup Condition="'@(EnabledGenerators)' != ''
and @(EnabledGenerators->AnyHaveMetadataValue('Identity', 'LibraryImportGenerator'))
and '$(IncludeLibraryImportGeneratorSources)' == 'true'">
- <Compile Include="$(LibrariesProjectRoot)Common\src\System\Runtime\InteropServices\GeneratedDllImportAttribute.cs" />
+ <Compile Include="$(LibrariesProjectRoot)Common\src\System\Runtime\InteropServices\LibraryImportAttribute.cs" />
<Compile Include="$(LibrariesProjectRoot)Common\src\System\Runtime\InteropServices\StringMarshalling.cs" />
<!-- Only add the following files if we are on the latest TFM (that is, net7). -->
}
}
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "Buffer_Clear")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "Buffer_Clear")]
private static unsafe partial void __ZeroMemory(void* b, nuint byteLength);
// The maximum block size to for __BulkMoveWithWriteBarrier FCall. This is required to avoid GC starvation.
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern void __BulkMoveWithWriteBarrier(ref byte destination, ref byte source, nuint byteCount);
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "Buffer_MemMove")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "Buffer_MemMove")]
private static unsafe partial void __Memmove(byte* dest, byte* src, nuint len);
// Used by ilmarshalers.cpp
return GetConfigBoolValue(switchName, out exist);
}
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ClrConfig_GetConfigBoolValue", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ClrConfig_GetConfigBoolValue", StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
private static partial bool GetConfigBoolValue(string configSwitchName, [MarshalAs(UnmanagedType.Bool)] out bool exist);
}
}
}
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "DebugDebugger_Launch")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "DebugDebugger_Launch")]
[return: MarshalAs(UnmanagedType.Bool)]
private static partial bool LaunchInternal();
// report the message depending on its settings.
public static void Log(int level, string? category, string? message) => LogInternal(level, category, message);
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "DebugDebugger_Log", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "DebugDebugger_Log", StringMarshalling = StringMarshalling.Utf16)]
private static partial void LogInternal(int level, string? category, string? message);
// Checks to see if an attached debugger has logging enabled
//
// These PInvokes are used by the configuration APIs to interact with EventPipe.
//
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "EventPipeInternal_Enable")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "EventPipeInternal_Enable")]
private static unsafe partial ulong Enable(
char* outputFile,
EventPipeSerializationFormat format,
EventPipeProviderConfigurationNative* providers,
uint numProviders);
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "EventPipeInternal_Disable")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "EventPipeInternal_Disable")]
internal static partial void Disable(ulong sessionID);
//
// These PInvokes are used by EventSource to interact with the EventPipe.
//
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "EventPipeInternal_CreateProvider", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "EventPipeInternal_CreateProvider", StringMarshalling = StringMarshalling.Utf16)]
internal static partial IntPtr CreateProvider(string providerName, Interop.Advapi32.EtwEnableCallback callbackFunc);
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "EventPipeInternal_DefineEvent")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "EventPipeInternal_DefineEvent")]
internal static unsafe partial IntPtr DefineEvent(IntPtr provHandle, uint eventID, long keywords, uint eventVersion, uint level, void *pMetadata, uint metadataLength);
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "EventPipeInternal_GetProvider", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "EventPipeInternal_GetProvider", StringMarshalling = StringMarshalling.Utf16)]
internal static partial IntPtr GetProvider(string providerName);
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "EventPipeInternal_DeleteProvider")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "EventPipeInternal_DeleteProvider")]
internal static partial void DeleteProvider(IntPtr provHandle);
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "EventPipeInternal_EventActivityIdControl")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "EventPipeInternal_EventActivityIdControl")]
internal static partial int EventActivityIdControl(uint controlCode, ref Guid activityId);
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "EventPipeInternal_WriteEventData")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "EventPipeInternal_WriteEventData")]
internal static unsafe partial void WriteEventData(IntPtr eventHandle, EventProvider.EventData* pEventData, uint dataCount, Guid* activityId, Guid* relatedActivityId);
//
// These PInvokes are used as part of the EventPipeEventDispatcher.
//
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "EventPipeInternal_GetSessionInfo")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "EventPipeInternal_GetSessionInfo")]
[return: MarshalAs(UnmanagedType.Bool)]
internal static unsafe partial bool GetSessionInfo(ulong sessionID, EventPipeSessionInfo* pSessionInfo);
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "EventPipeInternal_GetNextEvent")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "EventPipeInternal_GetNextEvent")]
[return: MarshalAs(UnmanagedType.Bool)]
internal static unsafe partial bool GetNextEvent(ulong sessionID, EventPipeEventInstanceData* pInstance);
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "EventPipeInternal_GetWaitHandle")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "EventPipeInternal_GetWaitHandle")]
internal static unsafe partial IntPtr GetWaitHandle(ulong sessionID);
}
}
internal sealed partial class NativeRuntimeEventSource : EventSource
{
[NonEvent]
- [GeneratedDllImport(RuntimeHelpers.QCall)]
+ [LibraryImport(RuntimeHelpers.QCall)]
internal static partial void LogThreadPoolWorkerThreadStart(uint ActiveWorkerThreadCount, uint RetiredWorkerThreadCount, ushort ClrInstanceID);
[NonEvent]
- [GeneratedDllImport(RuntimeHelpers.QCall)]
+ [LibraryImport(RuntimeHelpers.QCall)]
internal static partial void LogThreadPoolWorkerThreadStop(uint ActiveWorkerThreadCount, uint RetiredWorkerThreadCount, ushort ClrInstanceID);
[NonEvent]
- [GeneratedDllImport(RuntimeHelpers.QCall)]
+ [LibraryImport(RuntimeHelpers.QCall)]
internal static partial void LogThreadPoolWorkerThreadWait(uint ActiveWorkerThreadCount, uint RetiredWorkerThreadCount, ushort ClrInstanceID);
[NonEvent]
- [GeneratedDllImport(RuntimeHelpers.QCall)]
+ [LibraryImport(RuntimeHelpers.QCall)]
internal static partial void LogThreadPoolWorkerThreadAdjustmentSample(double Throughput, ushort ClrInstanceID);
[NonEvent]
- [GeneratedDllImport(RuntimeHelpers.QCall)]
+ [LibraryImport(RuntimeHelpers.QCall)]
internal static partial void LogThreadPoolWorkerThreadAdjustmentAdjustment(double AverageThroughput, uint NewWorkerThreadCount, NativeRuntimeEventSource.ThreadAdjustmentReasonMap Reason, ushort ClrInstanceID);
[NonEvent]
- [GeneratedDllImport(RuntimeHelpers.QCall)]
+ [LibraryImport(RuntimeHelpers.QCall)]
internal static partial void LogThreadPoolWorkerThreadAdjustmentStats(
double Duration,
double Throughput,
ushort ClrInstanceID);
[NonEvent]
- [GeneratedDllImport(RuntimeHelpers.QCall)]
+ [LibraryImport(RuntimeHelpers.QCall)]
internal static partial void LogThreadPoolIOEnqueue(
IntPtr NativeOverlapped,
IntPtr Overlapped,
ushort ClrInstanceID);
[NonEvent]
- [GeneratedDllImport(RuntimeHelpers.QCall)]
+ [LibraryImport(RuntimeHelpers.QCall)]
internal static partial void LogThreadPoolIODequeue(
IntPtr NativeOverlapped,
IntPtr Overlapped,
ushort ClrInstanceID);
[NonEvent]
- [GeneratedDllImport(RuntimeHelpers.QCall)]
+ [LibraryImport(RuntimeHelpers.QCall)]
internal static partial void LogThreadPoolWorkingThreadCount(
uint Count,
ushort ClrInstanceID
private static bool AppendStackFrameWithoutMethodBase(StringBuilder sb) => false;
#pragma warning restore IDE0060
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "StackFrame_GetMethodDescFromNativeIP")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "StackFrame_GetMethodDescFromNativeIP")]
private static partial RuntimeMethodHandleInternal GetMethodDescFromNativeIP(IntPtr ip);
/// <summary>
{
public abstract partial class Enum
{
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "Enum_GetValuesAndNames")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "Enum_GetValuesAndNames")]
private static partial void GetEnumValuesAndNames(QCallTypeHandle enumType, ObjectHandleOnStack values, ObjectHandleOnStack names, Interop.BOOL getNames);
[MethodImpl(MethodImplOptions.InternalCall)]
}
// Terminates this process with the given exit code.
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "Environment_Exit")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "Environment_Exit")]
[DoesNotReturn]
private static partial void _Exit(int exitCode);
GetCommandLineArgsNative();
}
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "Environment_GetProcessorCount")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "Environment_GetProcessorCount")]
private static partial int GetProcessorCount();
// Used by VM
return retMesg!;
}
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ExceptionNative_GetMessageFromNativeResources")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ExceptionNative_GetMessageFromNativeResources")]
private static partial void GetMessageFromNativeResources(ExceptionMessageKind kind, StringHandleOnStack retMesg);
internal readonly struct DispatchState
return new GCMemoryInfo(data);
}
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "GCInterface_StartNoGCRegion")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "GCInterface_StartNoGCRegion")]
internal static partial int _StartNoGCRegion(long totalSize, [MarshalAs(UnmanagedType.Bool)] bool lohSizeKnown, long lohSize, [MarshalAs(UnmanagedType.Bool)] bool disallowFullBlockingGC);
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "GCInterface_EndNoGCRegion")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "GCInterface_EndNoGCRegion")]
internal static partial int _EndNoGCRegion();
// keep in sync with GC_ALLOC_FLAGS in gcinterface.h
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern int GetGenerationWR(IntPtr handle);
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "GCInterface_GetTotalMemory")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "GCInterface_GetTotalMemory")]
private static partial long GetTotalMemory();
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "GCInterface_Collect")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "GCInterface_Collect")]
private static partial void _Collect(int generation, int mode);
[MethodImpl(MethodImplOptions.InternalCall)]
[MethodImpl(MethodImplOptions.InternalCall)]
internal static extern ulong GetGenerationSize(int gen);
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "GCInterface_AddMemoryPressure")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "GCInterface_AddMemoryPressure")]
private static partial void _AddMemoryPressure(ulong bytesAllocated);
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "GCInterface_RemoveMemoryPressure")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "GCInterface_RemoveMemoryPressure")]
private static partial void _RemoveMemoryPressure(ulong bytesAllocated);
public static void AddMemoryPressure(long bytesAllocated)
//
public static int MaxGeneration => GetMaxGeneration();
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "GCInterface_WaitForPendingFinalizers")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "GCInterface_WaitForPendingFinalizers")]
private static partial void _WaitForPendingFinalizers();
public static void WaitForPendingFinalizers()
return newSize;
}
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "GCInterface_RegisterFrozenSegment")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "GCInterface_RegisterFrozenSegment")]
private static partial IntPtr _RegisterFrozenSegment(IntPtr sectionAddress, nint sectionSize);
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "GCInterface_UnregisterFrozenSegment")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "GCInterface_UnregisterFrozenSegment")]
private static partial void _UnregisterFrozenSegment(IntPtr segmentHandle);
[MethodImpl(MethodImplOptions.InternalCall)]
return string.Format(format!, fileName, message);
}
- [GeneratedDllImport(RuntimeHelpers.QCall)]
+ [LibraryImport(RuntimeHelpers.QCall)]
private static partial void GetFileLoadExceptionMessage(int hResult, StringHandleOnStack retString);
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "FileLoadException_GetMessageForHR")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "FileLoadException_GetMessageForHR")]
private static partial void GetMessageForHR(int hresult, StringHandleOnStack retString);
}
}
return RuntimeAssembly.InternalLoad(assemblyRef, ref stackMark, AssemblyLoadContext.CurrentContextualReflectionContext);
}
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetExecutingAssembly")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetExecutingAssembly")]
private static partial void GetExecutingAssemblyNative(StackCrawlMarkHandle stackMark, ObjectHandleOnStack retAssembly);
internal static RuntimeAssembly GetExecutingAssembly(ref StackCrawlMark stackMark)
return GetExecutingAssembly(ref stackMark);
}
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetEntryAssembly")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetEntryAssembly")]
private static partial void GetEntryAssemblyNative(ObjectHandleOnStack retAssembly);
private static Assembly? GetEntryAssemblyInternal()
return entryAssembly;
}
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetAssemblyCount")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetAssemblyCount")]
[SuppressGCTransition]
internal static partial uint GetAssemblyCount();
}
assemblyAttributes);
}
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AppDomain_CreateDynamicAssembly")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AppDomain_CreateDynamicAssembly")]
private static partial void CreateDynamicAssembly(ObjectHandleOnStack name,
int access,
ObjectHandleOnStack assemblyLoadContext,
return SymbolType.FormCompoundType(strFormat, baseType, 0);
}
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ModuleBuilder_GetTypeRef", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ModuleBuilder_GetTypeRef", StringMarshalling = StringMarshalling.Utf16)]
private static partial int GetTypeRef(QCallModule module, string strFullName, QCallModule refedModule, string? strRefedModuleFileName, int tkResolution);
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ModuleBuilder_GetMemberRef")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ModuleBuilder_GetMemberRef")]
private static partial int GetMemberRef(QCallModule module, QCallModule refedModule, int tr, int defToken);
private int GetMemberRef(Module? refedModule, int tr, int defToken)
return GetMemberRef(new QCallModule(ref thisModule), new QCallModule(ref refedRuntimeModule), tr, defToken);
}
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ModuleBuilder_GetMemberRefFromSignature", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ModuleBuilder_GetMemberRefFromSignature", StringMarshalling = StringMarshalling.Utf16)]
private static partial int GetMemberRefFromSignature(QCallModule module, int tr, string methodName, byte[] signature, int length);
private int GetMemberRefFromSignature(int tr, string methodName, byte[] signature, int length)
return GetMemberRefFromSignature(new QCallModule(ref thisModule), tr, methodName, signature, length);
}
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ModuleBuilder_GetMemberRefOfMethodInfo")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ModuleBuilder_GetMemberRefOfMethodInfo")]
private static partial int GetMemberRefOfMethodInfo(QCallModule module, int tr, RuntimeMethodHandleInternal method);
private int GetMemberRefOfMethodInfo(int tr, RuntimeMethodInfo method)
return result;
}
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ModuleBuilder_GetMemberRefOfFieldInfo")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ModuleBuilder_GetMemberRefOfFieldInfo")]
private static partial int GetMemberRefOfFieldInfo(QCallModule module, int tkType, QCallTypeHandle declaringType, int tkField);
private int GetMemberRefOfFieldInfo(int tkType, RuntimeTypeHandle declaringType, RuntimeFieldInfo runtimeField)
return GetMemberRefOfFieldInfo(new QCallModule(ref thisModule), tkType, new QCallTypeHandle(ref declaringType), runtimeField.MetadataToken);
}
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ModuleBuilder_GetTokenFromTypeSpec")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ModuleBuilder_GetTokenFromTypeSpec")]
private static partial int GetTokenFromTypeSpec(QCallModule pModule, byte[] signature, int length);
private int GetTokenFromTypeSpec(byte[] signature, int length)
return GetTokenFromTypeSpec(new QCallModule(ref thisModule), signature, length);
}
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ModuleBuilder_GetArrayMethodToken", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ModuleBuilder_GetArrayMethodToken", StringMarshalling = StringMarshalling.Utf16)]
private static partial int GetArrayMethodToken(QCallModule module, int tkTypeSpec, string methodName, byte[] signature, int sigLength);
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ModuleBuilder_GetStringConstant", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ModuleBuilder_GetStringConstant", StringMarshalling = StringMarshalling.Utf16)]
private static partial int GetStringConstant(QCallModule module, string str, int length);
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ModuleBuilder_SetFieldRVAContent")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ModuleBuilder_SetFieldRVAContent")]
internal static partial void SetFieldRVAContent(QCallModule module, int fdToken, byte[]? data, int length);
#endregion
#endregion
#region Private Static FCalls
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_SetParentType")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_SetParentType")]
private static partial void SetParentType(QCallModule module, int tdTypeDef, int tkParent);
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_AddInterfaceImpl")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_AddInterfaceImpl")]
private static partial void AddInterfaceImpl(QCallModule module, int tdTypeDef, int tkInterface);
#endregion
#region Internal Static FCalls
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_DefineMethod", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_DefineMethod", StringMarshalling = StringMarshalling.Utf16)]
internal static partial int DefineMethod(QCallModule module, int tkParent, string name, byte[] signature, int sigLength,
MethodAttributes attributes);
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_DefineMethodSpec")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_DefineMethodSpec")]
internal static partial int DefineMethodSpec(QCallModule module, int tkParent, byte[] signature, int sigLength);
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_DefineField", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_DefineField", StringMarshalling = StringMarshalling.Utf16)]
internal static partial int DefineField(QCallModule module, int tkParent, string name, byte[] signature, int sigLength,
FieldAttributes attributes);
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_SetMethodIL")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_SetMethodIL")]
private static partial void SetMethodIL(QCallModule module, int tk, [MarshalAs(UnmanagedType.Bool)] bool isInitLocals,
byte[]? body, int bodyLength,
byte[] LocalSig, int sigLength,
ExceptionHandler[]? exceptions, int numExceptions,
int[]? tokenFixups, int numTokenFixups);
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_DefineCustomAttribute")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_DefineCustomAttribute")]
private static partial void DefineCustomAttribute(QCallModule module, int tkAssociate, int tkConstructor,
byte[]? attr, int attrLength);
localAttr, (localAttr != null) ? localAttr.Length : 0);
}
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_DefineProperty", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_DefineProperty", StringMarshalling = StringMarshalling.Utf16)]
internal static partial int DefineProperty(QCallModule module, int tkParent, string name, PropertyAttributes attributes,
byte[] signature, int sigLength);
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_DefineEvent", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_DefineEvent", StringMarshalling = StringMarshalling.Utf16)]
internal static partial int DefineEvent(QCallModule module, int tkParent, string name, EventAttributes attributes, int tkEventType);
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_DefineMethodSemantics")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_DefineMethodSemantics")]
internal static partial void DefineMethodSemantics(QCallModule module, int tkAssociation,
MethodSemanticsAttributes semantics, int tkMethod);
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_DefineMethodImpl")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_DefineMethodImpl")]
internal static partial void DefineMethodImpl(QCallModule module, int tkType, int tkBody, int tkDecl);
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_SetMethodImpl")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_SetMethodImpl")]
internal static partial void SetMethodImpl(QCallModule module, int tkMethod, MethodImplAttributes MethodImplAttributes);
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_SetParamInfo", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_SetParamInfo", StringMarshalling = StringMarshalling.Utf16)]
internal static partial int SetParamInfo(QCallModule module, int tkMethod, int iSequence,
ParameterAttributes iParamAttributes, string? strParamName);
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_GetTokenFromSig")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_GetTokenFromSig")]
internal static partial int GetTokenFromSig(QCallModule module, byte[] signature, int sigLength);
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_SetFieldLayoutOffset")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_SetFieldLayoutOffset")]
internal static partial void SetFieldLayoutOffset(QCallModule module, int fdToken, int iOffset);
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_SetClassLayout")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_SetClassLayout")]
internal static partial void SetClassLayout(QCallModule module, int tk, PackingSize iPackingSize, int iTypeSize);
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_SetConstantValue")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_SetConstantValue")]
private static unsafe partial void SetConstantValue(QCallModule module, int tk, int corType, void* pValue);
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_SetPInvokeData", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_SetPInvokeData", StringMarshalling = StringMarshalling.Utf16)]
private static partial void SetPInvokeData(QCallModule module, string DllName, string name, int token, int linkFlags);
#endregion
#endregion
#region FCalls
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_DefineType", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_DefineType", StringMarshalling = StringMarshalling.Utf16)]
private static partial int DefineType(QCallModule module,
string fullname, int tkParent, TypeAttributes attributes, int tkEnclosingType, int[] interfaceTokens);
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_DefineGenericParam", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_DefineGenericParam", StringMarshalling = StringMarshalling.Utf16)]
private static partial int DefineGenericParam(QCallModule module,
string name, int tkParent, GenericParameterAttributes attributes, int position, int[] constraints);
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_TermCreateClass")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_TermCreateClass")]
private static partial void TermCreateClass(QCallModule module, int tk, ObjectHandleOnStack type);
#endregion
// This field is set by the VM to atomically transfer the ownership to the managed loader allocator
internal IntPtr m_nativeLoaderAllocator;
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "LoaderAllocator_Destroy")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "LoaderAllocator_Destroy")]
[return: MarshalAs(UnmanagedType.Bool)]
private static partial bool Destroy(IntPtr nativeLoaderAllocator);
{
public static partial class AssemblyExtensions
{
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_InternalTryGetRawMetadata")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_InternalTryGetRawMetadata")]
[return: MarshalAs(UnmanagedType.Bool)]
private static unsafe partial bool InternalTryGetRawMetadata(QCallAssembly assembly, ref byte* blob, ref int length);
{
public static partial class MetadataUpdater
{
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_ApplyUpdate")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_ApplyUpdate")]
private static unsafe partial void ApplyUpdate(QCallAssembly assembly, byte* metadataDelta, int metadataDeltaLength, byte* ilDelta, int ilDeltaLength, byte* pdbDelta, int pdbDeltaLength);
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_IsApplyUpdateSupported")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_IsApplyUpdateSupported")]
[return: MarshalAs(UnmanagedType.Bool)]
private static unsafe partial bool IsApplyUpdateSupported();
}
}
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetCodeBase")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetCodeBase")]
[return: MarshalAs(UnmanagedType.Bool)]
private static partial bool GetCodeBase(QCallAssembly assembly,
StringHandleOnStack retString);
return an;
}
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetFullName")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetFullName")]
private static partial void GetFullName(QCallAssembly assembly, StringHandleOnStack retString);
public override string? FullName
}
}
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetEntryPoint")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetEntryPoint")]
private static partial void GetEntryPoint(QCallAssembly assembly, ObjectHandleOnStack retMethod);
public override MethodInfo? EntryPoint
}
}
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetType", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetType", StringMarshalling = StringMarshalling.Utf16)]
private static partial void GetType(QCallAssembly assembly,
string name,
[MarshalAs(UnmanagedType.Bool)] bool throwOnError,
return type;
}
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetExportedTypes")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetExportedTypes")]
private static partial void GetExportedTypes(QCallAssembly assembly, ObjectHandleOnStack retTypes);
[RequiresUnreferencedCode("Types might be removed")]
}
}
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetIsCollectible")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetIsCollectible")]
internal static partial Interop.BOOL GetIsCollectible(QCallAssembly assembly);
public override bool IsCollectible
}
// GetResource will return a pointer to the resources in memory.
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetResource", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetResource", StringMarshalling = StringMarshalling.Utf16)]
private static unsafe partial byte* GetResource(QCallAssembly assembly,
string resourceName,
out uint length);
return retAssembly!;
}
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_InternalLoad")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_InternalLoad")]
private static partial void InternalLoad(ObjectHandleOnStack assemblyName,
ObjectHandleOnStack requestingAssembly,
StackCrawlMarkHandle stackMark,
// Returns the module in this assembly with name 'name'
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetModule", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetModule", StringMarshalling = StringMarshalling.Utf16)]
private static partial void GetModule(QCallAssembly assembly, string name, ObjectHandleOnStack retModule);
public override Module? GetModule(string name)
return GetReferencedAssemblies(GetNativeHandle());
}
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetManifestResourceInfo", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetManifestResourceInfo", StringMarshalling = StringMarshalling.Utf16)]
private static partial int GetManifestResourceInfo(QCallAssembly assembly,
string resourceName,
ObjectHandleOnStack assemblyRef,
(ResourceLocation)location);
}
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetLocation")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetLocation")]
private static partial void GetLocation(QCallAssembly assembly, StringHandleOnStack retString);
public override string Location
}
}
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetImageRuntimeVersion")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetImageRuntimeVersion")]
private static partial void GetImageRuntimeVersion(QCallAssembly assembly, StringHandleOnStack retString);
public override string ImageRuntimeVersion
public override long HostContext => 0;
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetVersion")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetVersion")]
private static partial void GetVersion(QCallAssembly assembly,
out int majVer,
out int minVer,
return new Version(majorVer, minorVer, build, revision);
}
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetLocale")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetLocale")]
private static partial void GetLocale(QCallAssembly assembly, StringHandleOnStack retString);
internal CultureInfo GetLocale()
public override bool IsDynamic => FCallIsDynamic(GetNativeHandle());
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetSimpleName")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetSimpleName")]
private static partial void GetSimpleName(QCallAssembly assembly, StringHandleOnStack retSimpleName);
internal string? GetSimpleName()
return name;
}
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetHashAlgorithm")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetHashAlgorithm")]
private static partial AssemblyHashAlgorithm GetHashAlgorithm(QCallAssembly assembly);
private AssemblyHashAlgorithm GetHashAlgorithm()
return GetHashAlgorithm(new QCallAssembly(ref runtimeAssembly));
}
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetFlags")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetFlags")]
private static partial AssemblyNameFlags GetFlags(QCallAssembly assembly);
private AssemblyNameFlags GetFlags()
return GetFlags(new QCallAssembly(ref runtimeAssembly));
}
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetPublicKey")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetPublicKey")]
private static partial void GetPublicKey(QCallAssembly assembly, ObjectHandleOnStack retPublicKey);
internal byte[]? GetPublicKey()
return retAssembly;
}
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetModules")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetModules")]
private static partial void GetModules(QCallAssembly assembly,
[MarshalAs(UnmanagedType.Bool)] bool loadIfNotFound,
[MarshalAs(UnmanagedType.Bool)] bool getResourceModules,
}
}
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetForwardedType")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetForwardedType")]
private static partial void GetForwardedType(QCallAssembly assembly, MetadataToken mdtExternalType, ObjectHandleOnStack type);
}
}
internal RuntimeModule() { throw new NotSupportedException(); }
#region FCalls
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeModule_GetType", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeModule_GetType", StringMarshalling = StringMarshalling.Utf16)]
private static partial void GetType(QCallModule module, string className, [MarshalAs(UnmanagedType.Bool)] bool throwOnError, [MarshalAs(UnmanagedType.Bool)] bool ignoreCase, ObjectHandleOnStack type, ObjectHandleOnStack keepAlive);
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeModule_GetScopeName")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeModule_GetScopeName")]
private static partial void GetScopeName(QCallModule module, StringHandleOnStack retString);
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeModule_GetFullyQualifiedName")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeModule_GetFullyQualifiedName")]
private static partial void GetFullyQualifiedName(QCallModule module, StringHandleOnStack retString);
[MethodImpl(MethodImplOptions.InternalCall)]
// This call will generate an exception if the specified class constructor threw an
// exception when it ran.
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ReflectionInvocation_RunClassConstructor")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ReflectionInvocation_RunClassConstructor")]
private static partial void RunClassConstructor(QCallTypeHandle type);
[RequiresUnreferencedCode("Trimmer can't guarantee existence of class constructor")]
// This call will generate an exception if the specified module constructor threw an
// exception when it ran.
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ReflectionInvocation_RunModuleConstructor")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ReflectionInvocation_RunModuleConstructor")]
private static partial void RunModuleConstructor(QCallModule module);
public static void RunModuleConstructor(ModuleHandle module)
RunModuleConstructor(new QCallModule(ref rm));
}
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ReflectionInvocation_CompileMethod")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ReflectionInvocation_CompileMethod")]
internal static partial void CompileMethod(RuntimeMethodHandleInternal method);
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ReflectionInvocation_PrepareMethod")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ReflectionInvocation_PrepareMethod")]
private static unsafe partial void PrepareMethod(RuntimeMethodHandleInternal method, IntPtr* pInstantiation, int cInstantiation);
public static void PrepareMethod(RuntimeMethodHandle method) => PrepareMethod(method, null);
return obj!;
}
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ReflectionSerialization_GetUninitializedObject")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ReflectionSerialization_GetUninitializedObject")]
private static partial void GetUninitializedObject(QCallTypeHandle type, ObjectHandleOnStack retObject);
[MethodImpl(MethodImplOptions.InternalCall)]
return AllocateTypeAssociatedMemory(new QCallTypeHandle(ref rt), (uint)size);
}
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_AllocateTypeAssociatedMemory")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_AllocateTypeAssociatedMemory")]
private static partial IntPtr AllocateTypeAssociatedMemory(QCallTypeHandle type, uint size);
[MethodImpl(MethodImplOptions.InternalCall)]
return TryGetOrCreateComInterfaceForObjectInternal(ObjectHandleOnStack.Create(ref impl), impl.id, ObjectHandleOnStack.Create(ref instance), flags, out retValue);
}
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ComWrappers_TryGetOrCreateComInterfaceForObject")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ComWrappers_TryGetOrCreateComInterfaceForObject")]
[return: MarshalAs(UnmanagedType.Bool)]
private static partial bool TryGetOrCreateComInterfaceForObjectInternal(ObjectHandleOnStack comWrappersImpl, long wrapperId, ObjectHandleOnStack instance, CreateComInterfaceFlags flags, out IntPtr retValue);
return TryGetOrCreateObjectForComInstanceInternal(ObjectHandleOnStack.Create(ref impl), impl.id, externalComObject, innerMaybe, flags, ObjectHandleOnStack.Create(ref wrapperMaybeLocal), ObjectHandleOnStack.Create(ref retValue));
}
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ComWrappers_TryGetOrCreateObjectForComInstance")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ComWrappers_TryGetOrCreateObjectForComInstance")]
[return: MarshalAs(UnmanagedType.Bool)]
private static partial bool TryGetOrCreateObjectForComInstanceInternal(ObjectHandleOnStack comWrappersImpl, long wrapperId, IntPtr externalComObject, IntPtr innerMaybe, CreateObjectFlags flags, ObjectHandleOnStack wrapper, ObjectHandleOnStack retValue);
}
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ComWrappers_SetGlobalInstanceRegisteredForTrackerSupport")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ComWrappers_SetGlobalInstanceRegisteredForTrackerSupport")]
[SuppressGCTransition]
private static partial void SetGlobalInstanceRegisteredForTrackerSupport(long id);
SetGlobalInstanceRegisteredForMarshalling(instance.id);
}
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ComWrappers_SetGlobalInstanceRegisteredForMarshalling")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ComWrappers_SetGlobalInstanceRegisteredForMarshalling")]
[SuppressGCTransition]
private static partial void SetGlobalInstanceRegisteredForMarshalling(long id);
protected static void GetIUnknownImpl(out IntPtr fpQueryInterface, out IntPtr fpAddRef, out IntPtr fpRelease)
=> GetIUnknownImplInternal(out fpQueryInterface, out fpAddRef, out fpRelease);
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ComWrappers_GetIUnknownImpl")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ComWrappers_GetIUnknownImpl")]
private static partial void GetIUnknownImplInternal(out IntPtr fpQueryInterface, out IntPtr fpAddRef, out IntPtr fpRelease);
internal static int CallICustomQueryInterface(object customQueryInterfaceMaybe, ref Guid iid, out IntPtr ppObject)
GC.KeepAlive(rmi);
}
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "MarshalNative_Prelink")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "MarshalNative_Prelink")]
private static partial void InternalPrelink(RuntimeMethodHandleInternal m);
[MethodImpl(MethodImplOptions.InternalCall)]
#if TARGET_WINDOWS
internal static bool IsBuiltInComSupported { get; } = IsBuiltInComSupportedInternal();
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "MarshalNative_IsBuiltInComSupported")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "MarshalNative_IsBuiltInComSupported")]
[return: MarshalAs(UnmanagedType.Bool)]
private static partial bool IsBuiltInComSupportedInternal();
return (IntPtr)(-1);
}
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "MarshalNative_GetHINSTANCE")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "MarshalNative_GetHINSTANCE")]
private static partial IntPtr GetHINSTANCE(QCallModule m);
#endif // TARGET_WINDOWS
return type;
}
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "MarshalNative_GetTypeFromCLSID", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "MarshalNative_GetTypeFromCLSID", StringMarshalling = StringMarshalling.Utf16)]
private static partial void GetTypeFromCLSID(in Guid clsid, string? server, ObjectHandleOnStack retType);
/// <summary>
// Revist after https://github.com/mono/linker/issues/1989 is fixed
[UnconditionalSuppressMessage("ReflectionAnalysis", "IL2050:UnrecognizedReflectionPattern",
Justification = "The calling method is annotated with RequiresUnreferencedCode")]
- [GeneratedDllImport(Interop.Libraries.Ole32)]
+ [LibraryImport(Interop.Libraries.Ole32)]
private static partial int CreateBindCtx(uint reserved, out IntPtr ppbc);
[UnconditionalSuppressMessage("ReflectionAnalysis", "IL2050:UnrecognizedReflectionPattern",
Justification = "The calling method is annotated with RequiresUnreferencedCode")]
- [GeneratedDllImport(Interop.Libraries.Ole32)]
+ [LibraryImport(Interop.Libraries.Ole32)]
private static partial int MkParseDisplayName(IntPtr pbc, [MarshalAs(UnmanagedType.LPWStr)] string szUserName, out uint pchEaten, out IntPtr ppmk);
[UnconditionalSuppressMessage("ReflectionAnalysis", "IL2050:UnrecognizedReflectionPattern",
Justification = "The calling method is annotated with RequiresUnreferencedCode")]
- [GeneratedDllImport(Interop.Libraries.Ole32)]
+ [LibraryImport(Interop.Libraries.Ole32)]
private static partial int BindMoniker(IntPtr pmk, uint grfOpt, ref Guid iidResult, out IntPtr ppvResult);
[SupportedOSPlatform("windows")]
internal static extern IntPtr GetFunctionPointerForDelegateInternal(Delegate d);
#if DEBUG // Used for testing in Checked or Debug
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "MarshalNative_GetIsInCooperativeGCModeFunctionPointer")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "MarshalNative_GetIsInCooperativeGCModeFunctionPointer")]
internal static unsafe partial delegate* unmanaged<int> GetIsInCooperativeGCModeFunctionPointer();
#endif
}
/// External functions that implement the NativeLibrary interface
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "NativeLibrary_LoadFromPath", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "NativeLibrary_LoadFromPath", StringMarshalling = StringMarshalling.Utf16)]
internal static partial IntPtr LoadFromPath(string libraryName, [MarshalAs(UnmanagedType.Bool)] bool throwOnError);
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "NativeLibrary_LoadByName", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "NativeLibrary_LoadByName", StringMarshalling = StringMarshalling.Utf16)]
internal static partial IntPtr LoadByName(string libraryName, QCallAssembly callingAssembly,
[MarshalAs(UnmanagedType.Bool)] bool hasDllImportSearchPathFlag, uint dllImportSearchPathFlag,
[MarshalAs(UnmanagedType.Bool)] bool throwOnError);
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "NativeLibrary_FreeLib")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "NativeLibrary_FreeLib")]
internal static partial void FreeLib(IntPtr handle);
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "NativeLibrary_GetSymbol", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "NativeLibrary_GetSymbol", StringMarshalling = StringMarshalling.Utf16)]
internal static partial IntPtr GetSymbol(IntPtr handle, string symbolName, [MarshalAs(UnmanagedType.Bool)] bool throwOnError);
}
}
System.StubHelpers.StubHelpers.SetPendingExceptionObject(exception);
}
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ObjCMarshal_TrySetGlobalMessageSendCallback")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ObjCMarshal_TrySetGlobalMessageSendCallback")]
[return:MarshalAs(UnmanagedType.Bool)]
private static partial bool TrySetGlobalMessageSendCallback(
MessageSendFunction msgSendFunction,
IntPtr func);
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ObjCMarshal_TryInitializeReferenceTracker")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ObjCMarshal_TryInitializeReferenceTracker")]
[return: MarshalAs(UnmanagedType.Bool)]
private static unsafe partial bool TryInitializeReferenceTracker(
delegate* unmanaged<void> beginEndCallback,
delegate* unmanaged<IntPtr, int> isReferencedCallback,
delegate* unmanaged<IntPtr, void> trackedObjectEnteredFinalization);
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ObjCMarshal_CreateReferenceTrackingHandle")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ObjCMarshal_CreateReferenceTrackingHandle")]
private static partial IntPtr CreateReferenceTrackingHandleInternal(
ObjectHandleOnStack obj,
out int memInSizeT,
{
public abstract partial class X86Base
{
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "X86BaseCpuId")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "X86BaseCpuId")]
private static unsafe partial void __cpuidex(int* cpuInfo, int functionId, int subFunctionId);
}
}
{
public partial class AssemblyLoadContext
{
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_InitializeAssemblyLoadContext")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_InitializeAssemblyLoadContext")]
private static partial IntPtr InitializeAssemblyLoadContext(IntPtr ptrAssemblyLoadContext, [MarshalAs(UnmanagedType.Bool)] bool fRepresentsTPALoadContext, [MarshalAs(UnmanagedType.Bool)] bool isCollectible);
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_PrepareForAssemblyLoadContextRelease")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_PrepareForAssemblyLoadContextRelease")]
private static partial void PrepareForAssemblyLoadContextRelease(IntPtr ptrNativeAssemblyBinder, IntPtr ptrAssemblyLoadContextStrong);
[RequiresUnreferencedCode("Types and members the loaded assembly depends on might be removed")]
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_LoadFromStream")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_LoadFromStream")]
private static partial void LoadFromStream(IntPtr ptrNativeAssemblyBinder, IntPtr ptrAssemblyArray, int iAssemblyArrayLen, IntPtr ptrSymbols, int iSymbolArrayLen, ObjectHandleOnStack retAssembly);
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "MultiCoreJIT_InternalSetProfileRoot", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "MultiCoreJIT_InternalSetProfileRoot", StringMarshalling = StringMarshalling.Utf16)]
internal static partial void InternalSetProfileRoot(string directoryPath);
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "MultiCoreJIT_InternalStartProfile", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "MultiCoreJIT_InternalStartProfile", StringMarshalling = StringMarshalling.Utf16)]
internal static partial void InternalStartProfile(string? profile, IntPtr ptrNativeAssemblyBinder);
[RequiresUnreferencedCode("Types and members the loaded assembly depends on might be removed")]
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_LoadFromPath", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_LoadFromPath", StringMarshalling = StringMarshalling.Utf16)]
private static partial void LoadFromPath(IntPtr ptrNativeAssemblyBinder, string? ilPath, string? niPath, ObjectHandleOnStack retAssembly);
[MethodImpl(MethodImplOptions.InternalCall)]
[MethodImpl(MethodImplOptions.InternalCall)]
internal static extern bool IsTracingEnabled();
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_TraceResolvingHandlerInvoked", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_TraceResolvingHandlerInvoked", StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool TraceResolvingHandlerInvoked(string assemblyName, string handlerName, string? alcName, string? resultAssemblyName, string? resultAssemblyPath);
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_TraceAssemblyResolveHandlerInvoked", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_TraceAssemblyResolveHandlerInvoked", StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool TraceAssemblyResolveHandlerInvoked(string assemblyName, string handlerName, string? resultAssemblyName, string? resultAssemblyPath);
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_TraceAssemblyLoadFromResolveHandlerInvoked", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_TraceAssemblyLoadFromResolveHandlerInvoked", StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool TraceAssemblyLoadFromResolveHandlerInvoked(string assemblyName, [MarshalAs(UnmanagedType.Bool)] bool isTrackedAssembly, string requestingAssemblyPath, string? requestedAssemblyPath);
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_TraceSatelliteSubdirectoryPathProbed", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_TraceSatelliteSubdirectoryPathProbed", StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool TraceSatelliteSubdirectoryPathProbed(string filePath, int hResult);
}
#if TARGET_WINDOWS
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_LoadFromInMemoryModule")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_LoadFromInMemoryModule")]
private static partial IntPtr LoadFromInMemoryModuleInternal(IntPtr ptrNativeAssemblyBinder, IntPtr hModule, ObjectHandleOnStack retAssembly);
return context.ResolveUsingEvent(assemblyName);
}
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetLoadContextForAssembly")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetLoadContextForAssembly")]
private static partial IntPtr GetLoadContextForAssembly(QCallAssembly assembly);
// Returns the load context in which the specified assembly has been loaded
return instantiatedObject!;
}
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_CreateInstanceForAnotherGenericParameter")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_CreateInstanceForAnotherGenericParameter")]
private static partial void CreateInstanceForAnotherGenericParameter(
QCallTypeHandle baseType,
IntPtr* pTypeHandles,
ctorIsPublic = fCtorIsPublicTemp != Interop.BOOL.FALSE;
}
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_GetActivationInfo")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_GetActivationInfo")]
private static partial void GetActivationInfo(
ObjectHandleOnStack pRuntimeType,
delegate*<void*, object>* ppfnAllocator,
[MethodImpl(MethodImplOptions.InternalCall)]
internal static extern Type[]? GetInterfaces(RuntimeType type);
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_GetConstraints")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_GetConstraints")]
private static partial void GetConstraints(QCallTypeHandle handle, ObjectHandleOnStack types);
internal Type[] GetConstraints()
return types!;
}
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "QCall_GetGCHandleForTypeHandle")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "QCall_GetGCHandleForTypeHandle")]
private static partial IntPtr GetGCHandle(QCallTypeHandle handle, GCHandleType type);
internal IntPtr GetGCHandle(GCHandleType type)
return GetGCHandle(new QCallTypeHandle(ref nativeHandle), type);
}
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "QCall_FreeGCHandleForTypeHandle")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "QCall_FreeGCHandleForTypeHandle")]
private static partial IntPtr FreeGCHandle(QCallTypeHandle typeHandle, IntPtr objHandle);
internal IntPtr FreeGCHandle(IntPtr objHandle)
[MethodImpl(MethodImplOptions.InternalCall)]
internal static extern int GetNumVirtualsAndStaticVirtuals(RuntimeType type);
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_VerifyInterfaceIsImplemented")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_VerifyInterfaceIsImplemented")]
private static partial void VerifyInterfaceIsImplemented(QCallTypeHandle handle, QCallTypeHandle interfaceHandle);
internal void VerifyInterfaceIsImplemented(RuntimeTypeHandle interfaceHandle)
VerifyInterfaceIsImplemented(new QCallTypeHandle(ref nativeHandle), new QCallTypeHandle(ref nativeInterfaceHandle));
}
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_GetInterfaceMethodImplementation")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_GetInterfaceMethodImplementation")]
private static partial RuntimeMethodHandleInternal GetInterfaceMethodImplementation(QCallTypeHandle handle, QCallTypeHandle interfaceHandle, RuntimeMethodHandleInternal interfaceMethodHandle);
internal RuntimeMethodHandleInternal GetInterfaceMethodImplementation(RuntimeTypeHandle interfaceHandle, RuntimeMethodHandleInternal interfaceMethodHandle)
[MethodImpl(MethodImplOptions.InternalCall)]
internal static extern bool IsByRefLike(RuntimeType type);
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_IsVisible")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_IsVisible")]
[return: MarshalAs(UnmanagedType.Bool)]
private static partial bool _IsVisible(QCallTypeHandle typeHandle);
[MethodImpl(MethodImplOptions.InternalCall)]
internal static extern bool IsValueType(RuntimeType type);
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_ConstructName")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_ConstructName")]
private static partial void ConstructName(QCallTypeHandle handle, TypeNameFormatFlags formatFlags, StringHandleOnStack retString);
internal string ConstructName(TypeNameFormatFlags formatFlags)
[MethodImpl(MethodImplOptions.InternalCall)]
internal static extern IRuntimeMethodInfo GetDeclaringMethod(RuntimeType type);
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_GetTypeByName", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_GetTypeByName", StringMarshalling = StringMarshalling.Utf16)]
private static partial void GetTypeByName(string name, [MarshalAs(UnmanagedType.Bool)] bool throwOnError, [MarshalAs(UnmanagedType.Bool)] bool ignoreCase, StackCrawlMarkHandle stackMark,
ObjectHandleOnStack assemblyLoadContext,
ObjectHandleOnStack type, ObjectHandleOnStack keepalive);
return type;
}
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_GetTypeByNameUsingCARules", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_GetTypeByNameUsingCARules", StringMarshalling = StringMarshalling.Utf16)]
private static partial void GetTypeByNameUsingCARules(string name, QCallModule scope, ObjectHandleOnStack type);
internal static RuntimeType GetTypeByNameUsingCARules(string name, RuntimeModule scope)
return type!;
}
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_GetInstantiation")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_GetInstantiation")]
internal static partial void GetInstantiation(QCallTypeHandle type, ObjectHandleOnStack types, Interop.BOOL fAsRuntimeTypeArray);
internal RuntimeType[] GetInstantiationInternal()
return types!;
}
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_Instantiate")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_Instantiate")]
private static partial void Instantiate(QCallTypeHandle handle, IntPtr* pInst, int numGenericArgs, ObjectHandleOnStack type);
internal RuntimeType Instantiate(RuntimeType inst)
}
}
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_MakeArray")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_MakeArray")]
private static partial void MakeArray(QCallTypeHandle handle, int rank, ObjectHandleOnStack type);
internal RuntimeType MakeArray(int rank)
return type!;
}
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_MakeSZArray")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_MakeSZArray")]
private static partial void MakeSZArray(QCallTypeHandle handle, ObjectHandleOnStack type);
internal RuntimeType MakeSZArray()
return type!;
}
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_MakeByRef")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_MakeByRef")]
private static partial void MakeByRef(QCallTypeHandle handle, ObjectHandleOnStack type);
internal RuntimeType MakeByRef()
return type!;
}
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_MakePointer")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_MakePointer")]
private static partial void MakePointer(QCallTypeHandle handle, ObjectHandleOnStack type);
internal RuntimeType MakePointer()
return type!;
}
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_IsCollectible")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_IsCollectible")]
internal static partial Interop.BOOL IsCollectible(QCallTypeHandle handle);
[MethodImpl(MethodImplOptions.InternalCall)]
internal static extern bool HasInstantiation(RuntimeType type);
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_GetGenericTypeDefinition")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_GetGenericTypeDefinition")]
private static partial void GetGenericTypeDefinition(QCallTypeHandle type, ObjectHandleOnStack retType);
internal static RuntimeType GetGenericTypeDefinition(RuntimeType type)
return m_value == null;
}
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeMethodHandle_GetFunctionPointer")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeMethodHandle_GetFunctionPointer")]
internal static partial IntPtr GetFunctionPointer(RuntimeMethodHandleInternal handle);
public IntPtr GetFunctionPointer()
return ptr;
}
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeMethodHandle_GetIsCollectible")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeMethodHandle_GetIsCollectible")]
internal static partial Interop.BOOL GetIsCollectible(RuntimeMethodHandleInternal handle);
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeMethodHandle_IsCAVisibleFromDecoratedType")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeMethodHandle_IsCAVisibleFromDecoratedType")]
internal static partial Interop.BOOL IsCAVisibleFromDecoratedType(
QCallTypeHandle attrTypeHandle,
RuntimeMethodHandleInternal attrCtor,
[MethodImpl(MethodImplOptions.InternalCall)]
internal static extern MethodImplAttributes GetImplAttributes(IRuntimeMethodInfo method);
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeMethodHandle_ConstructInstantiation")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeMethodHandle_ConstructInstantiation")]
private static partial void ConstructInstantiation(RuntimeMethodHandleInternal method, TypeNameFormatFlags format, StringHandleOnStack retString);
internal static string ConstructInstantiation(IRuntimeMethodInfo method, TypeNameFormatFlags format)
[MethodImpl(MethodImplOptions.InternalCall)]
internal static extern object? InvokeMethod(object? target, in Span<object?> arguments, Signature sig, bool constructor, bool wrapExceptions);
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeMethodHandle_GetMethodInstantiation")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeMethodHandle_GetMethodInstantiation")]
private static partial void GetMethodInstantiation(RuntimeMethodHandleInternal method, ObjectHandleOnStack types, Interop.BOOL fAsRuntimeTypeArray);
internal static RuntimeType[] GetMethodInstantiationInternal(IRuntimeMethodInfo method)
[MethodImpl(MethodImplOptions.InternalCall)]
internal static extern bool IsTypicalMethodDefinition(IRuntimeMethodInfo method);
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeMethodHandle_GetTypicalMethodDefinition")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeMethodHandle_GetTypicalMethodDefinition")]
private static partial void GetTypicalMethodDefinition(RuntimeMethodHandleInternal method, ObjectHandleOnStack outMethod);
internal static IRuntimeMethodInfo GetTypicalMethodDefinition(IRuntimeMethodInfo method)
internal static int GetGenericParameterCount(IRuntimeMethodInfo method) => GetGenericParameterCount(method.Value);
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeMethodHandle_StripMethodInstantiation")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeMethodHandle_StripMethodInstantiation")]
private static partial void StripMethodInstantiation(RuntimeMethodHandleInternal method, ObjectHandleOnStack outMethod);
internal static IRuntimeMethodInfo StripMethodInstantiation(IRuntimeMethodInfo method)
[MethodImpl(MethodImplOptions.InternalCall)]
internal static extern bool IsDynamicMethod(RuntimeMethodHandleInternal method);
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeMethodHandle_Destroy")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeMethodHandle_Destroy")]
internal static partial void Destroy(RuntimeMethodHandleInternal method);
[MethodImpl(MethodImplOptions.InternalCall)]
}
}
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ModuleHandle_ResolveType")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ModuleHandle_ResolveType")]
private static partial void ResolveType(QCallModule module,
int typeToken,
IntPtr* typeInstArgs,
}
}
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ModuleHandle_ResolveMethod")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ModuleHandle_ResolveMethod")]
private static partial RuntimeMethodHandleInternal ResolveMethod(QCallModule module,
int methodToken,
IntPtr* typeInstArgs,
}
}
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ModuleHandle_ResolveField")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ModuleHandle_ResolveField")]
private static partial void ResolveField(QCallModule module,
int fieldToken,
IntPtr* typeInstArgs,
int methodInstCount,
ObjectHandleOnStack retField);
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ModuleHandle_GetModuleType")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ModuleHandle_GetModuleType")]
internal static partial void GetModuleType(QCallModule handle, ObjectHandleOnStack type);
internal static RuntimeType GetModuleType(RuntimeModule module)
return type!;
}
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ModuleHandle_GetPEKind")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ModuleHandle_GetPEKind")]
private static partial void GetPEKind(QCallModule handle, int* peKind, int* machine);
// making this internal, used by Module.GetPEKind
#region Library
internal readonly unsafe partial struct MdUtf8String
{
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "MdUtf8String_EqualsCaseInsensitive")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "MdUtf8String_EqualsCaseInsensitive")]
[return: MarshalAs(UnmanagedType.Bool)]
private static partial bool EqualsCaseInsensitive(void* szLhs, void* szRhs, int cSz);
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "MdUtf8String_HashCaseInsensitive")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "MdUtf8String_HashCaseInsensitive")]
private static partial uint HashCaseInsensitive(void* sz, int cSz);
private readonly byte* m_pStringHeap; // This is the raw UTF8 string.
[MethodImpl(MethodImplOptions.InternalCall)]
internal static extern object ConvertToManaged(ref IntPtr ppUnk, IntPtr itfMT, IntPtr classMT, int flags);
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "InterfaceMarshaler__ClearNative")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "InterfaceMarshaler__ClearNative")]
internal static partial void ClearNative(IntPtr pUnk);
} // class InterfaceMarshaler
#endif // FEATURE_COMINTEROP
[MethodImpl(MethodImplOptions.InternalCall)]
internal static extern void ReadMemoryBarrier();
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "Interlocked_MemoryBarrierProcessWide")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "Interlocked_MemoryBarrierProcessWide")]
private static partial void _MemoryBarrierProcessWide();
/// <summary>Provides a process-wide memory barrier that ensures that reads and writes from any CPU cannot move across the barrier.</summary>
return waitResult == WaitHandle.WaitSuccess;
}
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "WaitHandle_CorWaitOnePrioritizedNative")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "WaitHandle_CorWaitOnePrioritizedNative")]
private static partial int WaitNative(SafeWaitHandle handle, int timeoutMs);
public void ReleaseCore(int count)
/// </summary>
public static long LockContentionCount => GetLockContentionCount();
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ObjectNative_GetMonitorLockContentionCount")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ObjectNative_GetMonitorLockContentionCount")]
private static partial long GetLockContentionCount();
}
}
}
}
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ThreadNative_Start")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ThreadNative_Start")]
private static unsafe partial void StartInternal(ThreadHandle t, int stackSize, int priority, char* pThreadName);
// Called from the runtime
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern void SleepInternal(int millisecondsTimeout);
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ThreadNative_UninterruptibleSleep0")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ThreadNative_UninterruptibleSleep0")]
internal static partial void UninterruptibleSleep0();
/// <summary>
public static void SpinWait(int iterations) => SpinWaitInternal(iterations);
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ThreadNative_YieldThread")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ThreadNative_YieldThread")]
private static partial Interop.BOOL YieldInternal();
public static bool Yield() => YieldInternal() != Interop.BOOL.FALSE;
InformThreadNameChange(GetNativeHandle(), value, value?.Length ?? 0);
}
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ThreadNative_InformThreadNameChange", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ThreadNative_InformThreadNameChange", StringMarshalling = StringMarshalling.Utf16)]
private static partial void InformThreadNameChange(ThreadHandle t, string? name, int len);
/// <summary>Returns true if the thread has been started and is not dead.</summary>
[MethodImpl(MethodImplOptions.InternalCall)]
private extern void SetPriorityNative(int priority);
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ThreadNative_GetCurrentOSThreadId")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ThreadNative_GetCurrentOSThreadId")]
private static partial ulong GetCurrentOSThreadId();
/// <summary>
}
}
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ThreadPool_GetCompletedWorkItemCount")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ThreadPool_GetCompletedWorkItemCount")]
private static partial long GetCompletedWorkItemCount();
private static long PendingUnmanagedWorkItemCount => UsePortableThreadPool ? 0 : GetPendingUnmanagedWorkItemCount();
RequestWorkerThreadNative();
}
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ThreadPool_RequestWorkerThread")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ThreadPool_RequestWorkerThread")]
private static partial Interop.BOOL RequestWorkerThreadNative();
// Entry point from unmanaged code
return PerformRuntimeSpecificGateActivitiesNative(cpuUtilization) != Interop.BOOL.FALSE;
}
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ThreadPool_PerformGateActivities")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ThreadPool_PerformGateActivities")]
private static partial Interop.BOOL PerformRuntimeSpecificGateActivitiesNative(int cpuUtilization);
// Entry point from unmanaged code
Instances[id].FireNextTimers();
}
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AppDomainTimer_Create")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AppDomainTimer_Create")]
private static partial AppDomainTimerSafeHandle CreateAppDomainTimer(uint dueTime, int id);
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AppDomainTimer_Change")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AppDomainTimer_Change")]
[return: MarshalAs(UnmanagedType.Bool)]
private static partial bool ChangeAppDomainTimer(AppDomainTimerSafeHandle handle, uint dueTime);
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AppDomainTimer_Delete")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AppDomainTimer_Delete")]
[return: MarshalAs(UnmanagedType.Bool)]
private static partial bool DeleteAppDomainTimer(IntPtr handle);
}
}
- [GeneratedDllImport(RuntimeHelpers.QCall)]
+ [LibraryImport(RuntimeHelpers.QCall)]
private static partial void GetTypeLoadExceptionMessage(int resourceId, StringHandleOnStack retString);
}
}
internal sealed partial class SafeTypeNameParserHandle : SafeHandleZeroOrMinusOneIsInvalid
{
#region QCalls
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "TypeName_ReleaseTypeNameParser")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "TypeName_ReleaseTypeNameParser")]
private static partial void Release(IntPtr pTypeNameParser);
#endregion
internal sealed partial class TypeNameParser : IDisposable
{
#region QCalls
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "TypeName_CreateTypeNameParser", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "TypeName_CreateTypeNameParser", StringMarshalling = StringMarshalling.Utf16)]
private static partial void _CreateTypeNameParser(string typeName, ObjectHandleOnStack retHandle, [MarshalAs(UnmanagedType.Bool)] bool throwOnError);
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "TypeName_GetNames")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "TypeName_GetNames")]
private static partial void _GetNames(SafeTypeNameParserHandle pTypeNameParser, ObjectHandleOnStack retArray);
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "TypeName_GetTypeArguments")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "TypeName_GetTypeArguments")]
private static partial void _GetTypeArguments(SafeTypeNameParserHandle pTypeNameParser, ObjectHandleOnStack retArray);
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "TypeName_GetModifiers")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "TypeName_GetModifiers")]
private static partial void _GetModifiers(SafeTypeNameParserHandle pTypeNameParser, ObjectHandleOnStack retArray);
- [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "TypeName_GetAssemblyName")]
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "TypeName_GetAssemblyName")]
private static partial void _GetAssemblyName(SafeTypeNameParserHandle pTypeNameParser, StringHandleOnStack retString);
#endregion
RhpCollect(generation, mode);
}
- [GeneratedDllImport(Redhawk.BaseName)]
+ [LibraryImport(Redhawk.BaseName)]
[UnmanagedCallConv(CallConvs = new Type[] { typeof(CallConvCdecl) })]
private static partial void RhpCollect(int generation, InternalGCCollectionMode mode);
return RhpGetGcTotalMemory();
}
- [GeneratedDllImport(Redhawk.BaseName)]
+ [LibraryImport(Redhawk.BaseName)]
[UnmanagedCallConv(CallConvs = new Type[] { typeof(CallConvCdecl) })]
private static partial long RhpGetGcTotalMemory();
// Block the current thread until at least one object needs to be finalized (returns true) or
// memory is low (returns false and the finalizer thread should initiate a garbage collection).
- [GeneratedDllImport(Redhawk.BaseName)]
+ [LibraryImport(Redhawk.BaseName)]
[UnmanagedCallConv(CallConvs = new Type[] { typeof(CallConvCdecl) })]
internal static partial uint RhpWaitForFinalizerRequest();
// Indicate that the current round of finalizations is complete.
- [GeneratedDllImport(Redhawk.BaseName)]
+ [LibraryImport(Redhawk.BaseName)]
[UnmanagedCallConv(CallConvs = new Type[] { typeof(CallConvCdecl) })]
internal static partial void RhpSignalFinalizationComplete();
- [GeneratedDllImport(Redhawk.BaseName)]
+ [LibraryImport(Redhawk.BaseName)]
[UnmanagedCallConv(CallConvs = new Type[] { typeof(CallConvCdecl) })]
internal static partial void RhpAcquireCastCacheLock();
- [GeneratedDllImport(Redhawk.BaseName)]
+ [LibraryImport(Redhawk.BaseName)]
[UnmanagedCallConv(CallConvs = new Type[] { typeof(CallConvCdecl) })]
internal static partial void RhpReleaseCastCacheLock();
- [GeneratedDllImport(Redhawk.BaseName)]
+ [LibraryImport(Redhawk.BaseName)]
[UnmanagedCallConv(CallConvs = new Type[] { typeof(CallConvCdecl) })]
internal static partial ulong RhpGetTickCount64();
- [GeneratedDllImport(Redhawk.BaseName)]
+ [LibraryImport(Redhawk.BaseName)]
[UnmanagedCallConv(CallConvs = new Type[] { typeof(CallConvCdecl) })]
internal static partial void RhpAcquireThunkPoolLock();
- [GeneratedDllImport(Redhawk.BaseName)]
+ [LibraryImport(Redhawk.BaseName)]
[UnmanagedCallConv(CallConvs = new Type[] { typeof(CallConvCdecl) })]
internal static partial void RhpReleaseThunkPoolLock();
- [GeneratedDllImport(Redhawk.BaseName)]
+ [LibraryImport(Redhawk.BaseName)]
[UnmanagedCallConv(CallConvs = new Type[] { typeof(CallConvCdecl) })]
internal static partial IntPtr RhAllocateThunksMapping();
// Enters a no GC region, possibly doing a blocking GC if there is not enough
// memory available to satisfy the caller's request.
- [GeneratedDllImport(Redhawk.BaseName)]
+ [LibraryImport(Redhawk.BaseName)]
[UnmanagedCallConv(CallConvs = new Type[] { typeof(CallConvCdecl) })]
internal static partial int RhpStartNoGCRegion(long totalSize, [MarshalAs(UnmanagedType.Bool)] bool hasLohSize, long lohSize, [MarshalAs(UnmanagedType.Bool)] bool disallowFullBlockingGC);
// Exits a no GC region, possibly doing a GC to clean up the garbage that
// the caller allocated.
- [GeneratedDllImport(Redhawk.BaseName)]
+ [LibraryImport(Redhawk.BaseName)]
[UnmanagedCallConv(CallConvs = new Type[] { typeof(CallConvCdecl) })]
internal static partial int RhpEndNoGCRegion();
}
return RhpGetCurrentThreadStackTrace(pOutputBuffer, (uint)((outputBuffer != null) ? outputBuffer.Length : 0), new UIntPtr(&pOutputBuffer));
}
- [GeneratedDllImport(Redhawk.BaseName)]
+ [LibraryImport(Redhawk.BaseName)]
[UnmanagedCallConv(CallConvs = new Type[] { typeof(CallConvCdecl) })]
private static unsafe partial int RhpGetCurrentThreadStackTrace(IntPtr* pOutputBuffer, uint outputBufferLength, UIntPtr addressInCurrentFrame);
{
private const string RuntimeLibrary = "*";
- [GeneratedDllImport(RuntimeLibrary)]
+ [LibraryImport(RuntimeLibrary)]
[SuppressGCTransition]
[UnmanagedCallConv(CallConvs = new Type[] { typeof(CallConvCdecl) })]
internal static partial ulong RhpGetTickCount64();
- [GeneratedDllImport(RuntimeLibrary)]
+ [LibraryImport(RuntimeLibrary)]
[UnmanagedCallConv(CallConvs = new Type[] { typeof(CallConvCdecl) })]
internal static partial IntPtr RhpGetCurrentThread();
private static extern bool _RhReRegisterForFinalize(object obj);
// Wait for all pending finalizers. This must be a p/invoke to avoid starving the GC.
- [GeneratedDllImport(RuntimeLibrary)]
+ [LibraryImport(RuntimeLibrary)]
private static partial void RhWaitForPendingFinalizers(int allowReentrantWait);
// Temporary workaround to unblock shareable assembly bring-up - without shared interop,
RhWaitForPendingFinalizers(allowReentrantWait ? 1 : 0);
}
- [GeneratedDllImport(RuntimeLibrary)]
+ [LibraryImport(RuntimeLibrary)]
internal static partial void RhInitializeFinalizerThread();
// Get maximum GC generation number.
[RuntimeImport(RuntimeLibrary, "RhGetTotalAllocatedBytes")]
internal static extern long RhGetTotalAllocatedBytes();
- [GeneratedDllImport(RuntimeLibrary)]
+ [LibraryImport(RuntimeLibrary)]
[UnmanagedCallConv(CallConvs = new Type[] { typeof(CallConvCdecl) })]
internal static partial long RhGetTotalAllocatedBytesPrecise();
[RuntimeImport(RuntimeLibrary, "RhGetMemoryInfo")]
internal static extern void RhGetMemoryInfo(ref byte info, GCKind kind);
- [GeneratedDllImport(RuntimeLibrary)]
+ [LibraryImport(RuntimeLibrary)]
internal static unsafe partial void RhAllocateNewArray(IntPtr pArrayEEType, uint numElements, uint flags, void* pResult);
- [GeneratedDllImport(RuntimeLibrary)]
+ [LibraryImport(RuntimeLibrary)]
internal static unsafe partial void RhAllocateNewObject(IntPtr pEEType, uint flags, void* pResult);
[MethodImpl(MethodImplOptions.InternalCall)]
internal static extern object RhMemberwiseClone(object obj);
// Busy spin for the given number of iterations.
- [GeneratedDllImport(RuntimeLibrary, EntryPoint = "RhSpinWait")]
+ [LibraryImport(RuntimeLibrary, EntryPoint = "RhSpinWait")]
[SuppressGCTransition]
[UnmanagedCallConv(CallConvs = new Type[] { typeof(CallConvCdecl) })]
internal static partial void RhSpinWait(int iterations);
// Yield the cpu to another thread ready to process, if one is available.
- [GeneratedDllImport(RuntimeLibrary, EntryPoint = "RhYield")]
+ [LibraryImport(RuntimeLibrary, EntryPoint = "RhYield")]
[UnmanagedCallConv(CallConvs = new Type[] { typeof(CallConvCdecl) })]
private static partial int _RhYield();
internal static bool RhYield() { return (_RhYield() != 0); }
- [GeneratedDllImport(RuntimeLibrary, EntryPoint = "RhFlushProcessWriteBuffers")]
+ [LibraryImport(RuntimeLibrary, EntryPoint = "RhFlushProcessWriteBuffers")]
[UnmanagedCallConv(CallConvs = new Type[] { typeof(CallConvCdecl) })]
internal static partial void RhFlushProcessWriteBuffers();
#if !TARGET_UNIX
// Wait for any object to be signalled, in a way that's compatible with the CLR's behavior in an STA.
// ExactSpelling = 'true' to force MCG to resolve it to default
- [GeneratedDllImport(RuntimeLibrary)]
+ [LibraryImport(RuntimeLibrary)]
private static unsafe partial int RhCompatibleReentrantWaitAny(int alertable, int timeout, int count, IntPtr* handles);
// Temporary workaround to unblock shareable assembly bring-up - without shared interop,
internal static extern void RhCallDescrWorker(IntPtr callDescr);
// For Managed to Native calls
- [GeneratedDllImport(RuntimeLibrary, EntryPoint = "RhCallDescrWorker")]
+ [LibraryImport(RuntimeLibrary, EntryPoint = "RhCallDescrWorker")]
internal static partial void RhCallDescrWorkerNative(IntPtr callDescr);
// Moves memory from smem to dmem. Size must be a positive value.
[RuntimeImport(RuntimeLibrary, "modff")]
internal static extern unsafe float modff(float x, float* intptr);
- [GeneratedDllImport(RuntimeImports.RuntimeLibrary)]
+ [LibraryImport(RuntimeImports.RuntimeLibrary)]
internal static unsafe partial void* memmove(byte* dmem, byte* smem, nuint size);
- [GeneratedDllImport(RuntimeImports.RuntimeLibrary)]
+ [LibraryImport(RuntimeImports.RuntimeLibrary)]
internal static unsafe partial void* memset(byte* mem, int value, nuint size);
#if TARGET_X86 || TARGET_AMD64
- [GeneratedDllImport(RuntimeLibrary)]
+ [LibraryImport(RuntimeLibrary)]
[UnmanagedCallConv(CallConvs = new Type[] { typeof(CallConvCdecl) })]
internal static unsafe partial void RhCpuIdEx(int* cpuInfo, int functionId, int subFunctionId);
#endif
internal static unsafe Array RhNewArray(EETypePtr pEEType, int length)
=> RhNewArray(pEEType.ToPointer(), length);
- [GeneratedDllImport(RuntimeLibrary)]
+ [LibraryImport(RuntimeLibrary)]
internal static unsafe partial void RhAllocateNewObject(IntPtr pEEType, uint flags, void* pResult);
[MethodImpl(MethodImplOptions.InternalCall)]
{
internal static partial class JObjectLifetime
{
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_NewGlobalReference")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_NewGlobalReference")]
internal static partial IntPtr NewGlobalReference(IntPtr obj);
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DeleteGlobalReference")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DeleteGlobalReference")]
internal static partial void DeleteGlobalReference(IntPtr obj);
internal class SafeJObjectHandle : SafeHandle
{
internal static partial class Logcat
{
- [GeneratedDllImport(Libraries.Liblog, StringMarshalling = StringMarshalling.Utf8)]
+ [LibraryImport(Libraries.Liblog, StringMarshalling = StringMarshalling.Utf8)]
private static partial void __android_log_print(LogLevel level, string? tag, string format, string args, IntPtr ptr);
internal static void AndroidLogPrint(LogLevel level, string? tag, string message) =>
// TODO: [AndroidCrypto] Rename class to AndroidCrypto once all consumers are split in Android vs. Unix
internal static partial class Crypto
{
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_BigNumToBinary")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_BigNumToBinary")]
private static unsafe partial int BigNumToBinary(SafeBignumHandle a, byte* to);
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_GetBigNumBytes")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_GetBigNumBytes")]
private static partial int GetBigNumBytes(SafeBignumHandle a);
internal static unsafe byte[]? ExtractBignum(SafeBignumHandle? bignum, int targetSize)
{
internal static partial class Crypto
{
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_CipherCreate")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_CipherCreate")]
internal static partial SafeEvpCipherCtxHandle EvpCipherCreate(
IntPtr cipher,
ref byte key,
ref byte iv,
int enc);
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_CipherCreatePartial")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_CipherCreatePartial")]
internal static partial SafeEvpCipherCtxHandle EvpCipherCreatePartial(
IntPtr cipher);
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_CipherSetKeyAndIV")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_CipherSetKeyAndIV")]
[return: MarshalAs(UnmanagedType.Bool)]
private static partial bool EvpCipherSetKeyAndIV(
SafeEvpCipherCtxHandle ctx,
}
}
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_CipherSetNonceLength")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_CipherSetNonceLength")]
[return: MarshalAs(UnmanagedType.Bool)]
private static partial bool AndroidCryptoNative_CipherSetNonceLength(
SafeEvpCipherCtxHandle ctx, int nonceLength);
}
}
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_CipherDestroy")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_CipherDestroy")]
internal static partial void EvpCipherDestroy(IntPtr ctx);
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_CipherReset")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_CipherReset")]
[return: MarshalAs(UnmanagedType.Bool)]
private static unsafe partial bool EvpCipherReset(SafeEvpCipherCtxHandle ctx, byte* pIv, int cIv);
}
}
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_CipherCtxSetPadding")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_CipherCtxSetPadding")]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool EvpCipherCtxSetPadding(SafeEvpCipherCtxHandle x, int padding);
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_CipherUpdate")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_CipherUpdate")]
[return: MarshalAs(UnmanagedType.Bool)]
private static partial bool EvpCipherUpdate(
SafeEvpCipherCtxHandle ctx,
input.Length);
}
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_CipherUpdateAAD")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_CipherUpdateAAD")]
[return: MarshalAs(UnmanagedType.Bool)]
private static partial bool CipherUpdateAAD(
SafeEvpCipherCtxHandle ctx,
}
}
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_CipherFinalEx")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_CipherFinalEx")]
[return: MarshalAs(UnmanagedType.Bool)]
private static partial bool EvpCipherFinalEx(
SafeEvpCipherCtxHandle ctx,
return EvpCipherFinalEx(ctx, ref MemoryMarshal.GetReference(output), out bytesWritten);
}
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_CipherSetTagLength")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_CipherSetTagLength")]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool CipherSetTagLength(
SafeEvpCipherCtxHandle ctx,
int tagLength);
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_CipherIsSupported")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_CipherIsSupported")]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool CipherIsSupported(IntPtr cipher);
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes128Ecb")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes128Ecb")]
internal static partial IntPtr EvpAes128Ecb();
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes128Cbc")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes128Cbc")]
internal static partial IntPtr EvpAes128Cbc();
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes128Gcm")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes128Gcm")]
internal static partial IntPtr EvpAes128Gcm();
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes128Cfb8")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes128Cfb8")]
internal static partial IntPtr EvpAes128Cfb8();
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes128Cfb128")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes128Cfb128")]
internal static partial IntPtr EvpAes128Cfb128();
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes128Ccm")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes128Ccm")]
internal static partial IntPtr EvpAes128Ccm();
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes192Ecb")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes192Ecb")]
internal static partial IntPtr EvpAes192Ecb();
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes192Cbc")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes192Cbc")]
internal static partial IntPtr EvpAes192Cbc();
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes192Gcm")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes192Gcm")]
internal static partial IntPtr EvpAes192Gcm();
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes192Cfb8")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes192Cfb8")]
internal static partial IntPtr EvpAes192Cfb8();
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes192Cfb128")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes192Cfb128")]
internal static partial IntPtr EvpAes192Cfb128();
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes192Ccm")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes192Ccm")]
internal static partial IntPtr EvpAes192Ccm();
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes256Ecb")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes256Ecb")]
internal static partial IntPtr EvpAes256Ecb();
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes256Cbc")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes256Cbc")]
internal static partial IntPtr EvpAes256Cbc();
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes256Gcm")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes256Gcm")]
internal static partial IntPtr EvpAes256Gcm();
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes256Cfb128")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes256Cfb128")]
internal static partial IntPtr EvpAes256Cfb128();
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes256Cfb8")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes256Cfb8")]
internal static partial IntPtr EvpAes256Cfb8();
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes256Ccm")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes256Ccm")]
internal static partial IntPtr EvpAes256Ccm();
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DesCbc")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DesCbc")]
internal static partial IntPtr EvpDesCbc();
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DesEcb")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DesEcb")]
internal static partial IntPtr EvpDesEcb();
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DesCfb8")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DesCfb8")]
internal static partial IntPtr EvpDesCfb8();
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Des3Cbc")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Des3Cbc")]
internal static partial IntPtr EvpDes3Cbc();
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Des3Ecb")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Des3Ecb")]
internal static partial IntPtr EvpDes3Ecb();
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Des3Cfb8")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Des3Cfb8")]
internal static partial IntPtr EvpDes3Cfb8();
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Des3Cfb64")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Des3Cfb64")]
internal static partial IntPtr EvpDes3Cfb64();
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_RC2Cbc")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_RC2Cbc")]
internal static partial IntPtr EvpRC2Cbc();
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_RC2Ecb")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_RC2Ecb")]
internal static partial IntPtr EvpRC2Ecb();
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_ChaCha20Poly1305")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_ChaCha20Poly1305")]
internal static partial IntPtr EvpChaCha20Poly1305();
internal enum EvpCipherDirection : int
{
internal static partial class AndroidCrypto
{
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DsaGenerateKey")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DsaGenerateKey")]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool DsaGenerateKey(out SafeDsaHandle dsa, int bits);
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DsaSizeSignature")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DsaSizeSignature")]
private static partial int DsaSizeSignature(SafeDsaHandle dsa);
/// <summary>
return size;
}
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DsaSignatureFieldSize")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DsaSignatureFieldSize")]
private static partial int AndroidCryptoNative_DsaSignatureFieldSize(SafeDsaHandle dsa);
/// <summary>
return size;
}
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DsaSizeP")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DsaSizeP")]
private static partial int DsaSizeP(SafeDsaHandle dsa);
/// <summary>
internal static bool DsaSign(SafeDsaHandle dsa, ReadOnlySpan<byte> hash, Span<byte> refSignature, out int outSignatureLength) =>
DsaSign(dsa, ref MemoryMarshal.GetReference(hash), hash.Length, ref MemoryMarshal.GetReference(refSignature), out outSignatureLength);
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DsaSign")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DsaSign")]
[return: MarshalAs(UnmanagedType.Bool)]
private static partial bool DsaSign(SafeDsaHandle dsa, ref byte hash, int hashLength, ref byte refSignature, out int outSignatureLength);
return ret == 1;
}
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DsaVerify")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DsaVerify")]
private static partial int DsaVerify(SafeDsaHandle dsa, ref byte hash, int hashLength, ref byte signature, int signatureLength);
internal static DSAParameters ExportDsaParameters(SafeDsaHandle key, bool includePrivateParameters)
}
}
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_GetDsaParameters")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_GetDsaParameters")]
[return: MarshalAs(UnmanagedType.Bool)]
private static partial bool GetDsaParameters(
SafeDsaHandle key,
out SafeBignumHandle y, out int y_cb,
out SafeBignumHandle x, out int x_cb);
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DsaKeyCreateByExplicitParameters")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DsaKeyCreateByExplicitParameters")]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool DsaKeyCreateByExplicitParameters(
out SafeDsaHandle dsa,
{
internal static partial class AndroidCrypto
{
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_EcKeyCreateByKeyParameters", StringMarshalling = StringMarshalling.Utf8)]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_EcKeyCreateByKeyParameters", StringMarshalling = StringMarshalling.Utf8)]
private static partial int EcKeyCreateByKeyParameters(
out SafeEcKeyHandle key,
string oid,
return key;
}
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_EcKeyCreateByExplicitParameters")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_EcKeyCreateByExplicitParameters")]
internal static partial SafeEcKeyHandle EcKeyCreateByExplicitParameters(
ECCurve.ECCurveType curveType,
byte[]? qx, int qxLength,
}
- [GeneratedDllImport(Libraries.AndroidCryptoNative)]
+ [LibraryImport(Libraries.AndroidCryptoNative)]
private static partial int AndroidCryptoNative_GetECKeyParameters(
SafeEcKeyHandle key,
[MarshalAs(UnmanagedType.Bool)] bool includePrivate,
return parameters;
}
- [GeneratedDllImport(Libraries.AndroidCryptoNative)]
+ [LibraryImport(Libraries.AndroidCryptoNative)]
private static partial int AndroidCryptoNative_GetECCurveParameters(
SafeEcKeyHandle key,
[MarshalAs(UnmanagedType.Bool)] bool includePrivate,
internal static bool EcDsaSign(ReadOnlySpan<byte> dgst, Span<byte> sig, out int siglen, SafeEcKeyHandle ecKey) =>
EcDsaSign(ref MemoryMarshal.GetReference(dgst), dgst.Length, ref MemoryMarshal.GetReference(sig), out siglen, ecKey);
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_EcDsaSign")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_EcDsaSign")]
[return: MarshalAs(UnmanagedType.Bool)]
private static partial bool EcDsaSign(ref byte dgst, int dlen, ref byte sig, out int siglen, SafeEcKeyHandle ecKey);
* 0: incorrect signature
* -1: error
*/
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_EcDsaVerify")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_EcDsaVerify")]
private static partial int EcDsaVerify(ref byte dgst, int dgst_len, ref byte sigbuf, int sig_len, SafeEcKeyHandle ecKey);
// returns the maximum length of a DER encoded ECDSA signature created with this key.
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_EcDsaSize")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_EcDsaSize")]
private static partial int AndroidCryptoNative_EcDsaSize(SafeEcKeyHandle ecKey);
internal static int EcDsaSize(SafeEcKeyHandle ecKey)
{
internal static partial class AndroidCrypto
{
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_EcKeyCreateByOid", StringMarshalling = StringMarshalling.Utf8)]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_EcKeyCreateByOid", StringMarshalling = StringMarshalling.Utf8)]
private static partial SafeEcKeyHandle AndroidCryptoNative_EcKeyCreateByOid(string oid);
internal static SafeEcKeyHandle? EcKeyCreateByOid(string oid)
{
return handle;
}
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_EcKeyDestroy")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_EcKeyDestroy")]
internal static partial void EcKeyDestroy(IntPtr a);
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_EcKeyUpRef")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_EcKeyUpRef")]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool EcKeyUpRef(IntPtr r);
- [GeneratedDllImport(Libraries.AndroidCryptoNative)]
+ [LibraryImport(Libraries.AndroidCryptoNative)]
private static partial int AndroidCryptoNative_EcKeyGetSize(SafeEcKeyHandle ecKey, out int keySize);
internal static int EcKeyGetSize(SafeEcKeyHandle key)
{
throw new CryptographicException();
}
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_EcKeyGetCurveName")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_EcKeyGetCurveName")]
private static partial int AndroidCryptoNative_EcKeyGetCurveName(SafeEcKeyHandle ecKey, out IntPtr curveName);
internal static string? EcKeyGetCurveName(SafeEcKeyHandle key)
internal static bool EcdhDeriveKey(SafeEcKeyHandle ourKey, SafeEcKeyHandle peerKey, Span<byte> buffer, out int usedBuffer) =>
EcdhDeriveKey(ourKey, peerKey, ref MemoryMarshal.GetReference(buffer), buffer.Length, out usedBuffer);
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_EcdhDeriveKey")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_EcdhDeriveKey")]
[return: MarshalAs(UnmanagedType.Bool)]
private static partial bool EcdhDeriveKey(SafeEcKeyHandle ourKey, SafeEcKeyHandle peerKey, ref byte buffer, int bufferLength, out int usedBuffer);
}
{
internal static partial class Crypto
{
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_ErrClearError")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_ErrClearError")]
internal static partial ulong ErrClearError();
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_ErrGetErrorAlloc")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_ErrGetErrorAlloc")]
private static partial ulong ErrGetErrorAlloc([MarshalAs(UnmanagedType.Bool)] out bool isAllocFailure);
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_ErrPeekError")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_ErrPeekError")]
internal static partial ulong ErrPeekError();
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_ErrPeekLastError")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_ErrPeekLastError")]
internal static partial ulong ErrPeekLastError();
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_ErrReasonErrorString")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_ErrReasonErrorString")]
internal static partial IntPtr ErrReasonErrorString(ulong error);
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_ErrErrorStringN")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_ErrErrorStringN")]
private static unsafe partial void ErrErrorStringN(ulong e, byte* buf, int len);
private static unsafe string ErrErrorStringN(ulong error)
private static volatile IntPtr s_evpSha384;
private static volatile IntPtr s_evpSha512;
- [GeneratedDllImport(Libraries.AndroidCryptoNative)]
+ [LibraryImport(Libraries.AndroidCryptoNative)]
private static partial IntPtr CryptoNative_EvpMd5();
internal static IntPtr EvpMd5() =>
s_evpMd5 != IntPtr.Zero ? s_evpMd5 : (s_evpMd5 = CryptoNative_EvpMd5());
- [GeneratedDllImport(Libraries.AndroidCryptoNative)]
+ [LibraryImport(Libraries.AndroidCryptoNative)]
internal static partial IntPtr CryptoNative_EvpSha1();
internal static IntPtr EvpSha1() =>
s_evpSha1 != IntPtr.Zero ? s_evpSha1 : (s_evpSha1 = CryptoNative_EvpSha1());
- [GeneratedDllImport(Libraries.AndroidCryptoNative)]
+ [LibraryImport(Libraries.AndroidCryptoNative)]
internal static partial IntPtr CryptoNative_EvpSha256();
internal static IntPtr EvpSha256() =>
s_evpSha256 != IntPtr.Zero ? s_evpSha256 : (s_evpSha256 = CryptoNative_EvpSha256());
- [GeneratedDllImport(Libraries.AndroidCryptoNative)]
+ [LibraryImport(Libraries.AndroidCryptoNative)]
internal static partial IntPtr CryptoNative_EvpSha384();
internal static IntPtr EvpSha384() =>
s_evpSha384 != IntPtr.Zero ? s_evpSha384 : (s_evpSha384 = CryptoNative_EvpSha384());
- [GeneratedDllImport(Libraries.AndroidCryptoNative)]
+ [LibraryImport(Libraries.AndroidCryptoNative)]
internal static partial IntPtr CryptoNative_EvpSha512();
internal static IntPtr EvpSha512() =>
{
internal static partial class Crypto
{
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_EvpMdCtxCreate")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_EvpMdCtxCreate")]
internal static partial SafeEvpMdCtxHandle EvpMdCtxCreate(IntPtr type);
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_EvpMdCtxDestroy")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_EvpMdCtxDestroy")]
internal static partial void EvpMdCtxDestroy(IntPtr ctx);
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_EvpDigestReset")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_EvpDigestReset")]
internal static partial int EvpDigestReset(SafeEvpMdCtxHandle ctx, IntPtr type);
internal static int EvpDigestUpdate(SafeEvpMdCtxHandle ctx, ReadOnlySpan<byte> d, int cnt) =>
EvpDigestUpdate(ctx, ref MemoryMarshal.GetReference(d), cnt);
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_EvpDigestUpdate")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_EvpDigestUpdate")]
private static partial int EvpDigestUpdate(SafeEvpMdCtxHandle ctx, ref byte d, int cnt);
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_EvpDigestFinalEx")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_EvpDigestFinalEx")]
internal static partial int EvpDigestFinalEx(SafeEvpMdCtxHandle ctx, ref byte md, ref uint s);
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_EvpDigestCurrent")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_EvpDigestCurrent")]
internal static partial int EvpDigestCurrent(SafeEvpMdCtxHandle ctx, ref byte md, ref uint s);
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_EvpDigestOneShot")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_EvpDigestOneShot")]
internal static unsafe partial int EvpDigestOneShot(IntPtr type, byte* source, int sourceSize, byte* md, uint* mdSize);
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_EvpMdSize")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_EvpMdSize")]
internal static partial int EvpMdSize(IntPtr md);
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_GetMaxMdSize")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_GetMaxMdSize")]
private static partial int GetMaxMdSize();
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_Pbkdf2")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_Pbkdf2")]
private static unsafe partial int Pbkdf2(
byte* pPassword,
int passwordLength,
{
internal static partial class Crypto
{
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_HmacCreate")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_HmacCreate")]
internal static partial SafeHmacCtxHandle HmacCreate(ref byte key, int keyLen, IntPtr md);
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_HmacDestroy")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_HmacDestroy")]
internal static partial void HmacDestroy(IntPtr ctx);
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_HmacReset")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_HmacReset")]
internal static partial int HmacReset(SafeHmacCtxHandle ctx);
internal static int HmacUpdate(SafeHmacCtxHandle ctx, ReadOnlySpan<byte> data, int len) =>
HmacUpdate(ctx, ref MemoryMarshal.GetReference(data), len);
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_HmacUpdate")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_HmacUpdate")]
private static partial int HmacUpdate(SafeHmacCtxHandle ctx, ref byte data, int len);
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_HmacFinal")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_HmacFinal")]
internal static partial int HmacFinal(SafeHmacCtxHandle ctx, ref byte data, ref int len);
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_HmacCurrent")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_HmacCurrent")]
internal static partial int HmacCurrent(SafeHmacCtxHandle ctx, ref byte data, ref int len);
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_HmacOneShot")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_HmacOneShot")]
private static unsafe partial int HmacOneShot(IntPtr type, byte* key, int keySize, byte* source, int sourceSize, byte* md, ref int mdSize);
internal static unsafe int HmacOneShot(IntPtr type, ReadOnlySpan<byte> key, ReadOnlySpan<byte> source, Span<byte> destination)
// No-op that exists to provide a hook for other static constructors.
}
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_EnsureOpenSslInitialized")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_EnsureOpenSslInitialized")]
private static partial int EnsureOpenSslInitialized();
}
}
return CryptoNative_GetRandomBytes(pbBuffer, count);
}
- [GeneratedDllImport(Libraries.AndroidCryptoNative)]
+ [LibraryImport(Libraries.AndroidCryptoNative)]
[return: MarshalAs(UnmanagedType.Bool)]
private static unsafe partial bool CryptoNative_GetRandomBytes(byte* buf, int num);
}
{
internal static partial class AndroidCrypto
{
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_RsaCreate")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_RsaCreate")]
internal static partial SafeRsaHandle RsaCreate();
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_RsaUpRef")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_RsaUpRef")]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool RsaUpRef(IntPtr rsa);
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_RsaDestroy")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_RsaDestroy")]
internal static partial void RsaDestroy(IntPtr rsa);
internal static SafeRsaHandle DecodeRsaSubjectPublicKeyInfo(ReadOnlySpan<byte> buf) =>
DecodeRsaSubjectPublicKeyInfo(ref MemoryMarshal.GetReference(buf), buf.Length);
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DecodeRsaSubjectPublicKeyInfo")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DecodeRsaSubjectPublicKeyInfo")]
private static partial SafeRsaHandle DecodeRsaSubjectPublicKeyInfo(ref byte buf, int len);
internal static int RsaPublicEncrypt(
RsaPadding padding) =>
RsaPublicEncrypt(flen, ref MemoryMarshal.GetReference(from), ref MemoryMarshal.GetReference(to), rsa, padding);
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_RsaPublicEncrypt")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_RsaPublicEncrypt")]
private static partial int RsaPublicEncrypt(
int flen,
ref byte from,
RsaPadding padding) =>
RsaPrivateDecrypt(flen, ref MemoryMarshal.GetReference(from), ref MemoryMarshal.GetReference(to), rsa, padding);
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_RsaPrivateDecrypt")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_RsaPrivateDecrypt")]
private static partial int RsaPrivateDecrypt(
int flen,
ref byte from,
SafeRsaHandle rsa) =>
RsaSignPrimitive(from.Length, ref MemoryMarshal.GetReference(from), ref MemoryMarshal.GetReference(to), rsa);
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_RsaSignPrimitive")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_RsaSignPrimitive")]
private static partial int RsaSignPrimitive(
int flen,
ref byte from,
SafeRsaHandle rsa) =>
RsaVerificationPrimitive(from.Length, ref MemoryMarshal.GetReference(from), ref MemoryMarshal.GetReference(to), rsa);
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_RsaVerificationPrimitive")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_RsaVerificationPrimitive")]
private static partial int RsaVerificationPrimitive(
int flen,
ref byte from,
ref byte to,
SafeRsaHandle rsa);
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_RsaSize")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_RsaSize")]
internal static partial int RsaSize(SafeRsaHandle rsa);
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_RsaGenerateKeyEx")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_RsaGenerateKeyEx")]
internal static partial int RsaGenerateKeyEx(SafeRsaHandle rsa, int bits);
internal static RSAParameters ExportRsaParameters(SafeRsaHandle key, bool includePrivateParameters)
}
}
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_GetRsaParameters")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_GetRsaParameters")]
[return: MarshalAs(UnmanagedType.Bool)]
private static partial bool GetRsaParameters(
SafeRsaHandle key,
out SafeBignumHandle dmq1,
out SafeBignumHandle iqmp);
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SetRsaParameters")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SetRsaParameters")]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool SetRsaParameters(
SafeRsaHandle key,
{
internal static partial class AndroidCrypto
{
- [GeneratedDllImport(Interop.Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLGetSupportedProtocols")]
+ [LibraryImport(Interop.Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLGetSupportedProtocols")]
internal static partial SslProtocols SSLGetSupportedProtocols();
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLSupportsApplicationProtocolsConfiguration")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLSupportsApplicationProtocolsConfiguration")]
[return:MarshalAs(UnmanagedType.U1)]
internal static partial bool SSLSupportsApplicationProtocolsConfiguration();
}
Closed = 4,
};
- [GeneratedDllImport(Interop.Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamCreate")]
+ [LibraryImport(Interop.Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamCreate")]
internal static partial SafeSslHandle SSLStreamCreate();
- [GeneratedDllImport(Interop.Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamCreateWithCertificates")]
+ [LibraryImport(Interop.Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamCreateWithCertificates")]
private static partial SafeSslHandle SSLStreamCreateWithCertificates(
ref byte pkcs8PrivateKey,
int pkcs8PrivateKeyLen,
certificates.Length);
}
- [GeneratedDllImport(Interop.Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamInitialize")]
+ [LibraryImport(Interop.Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamInitialize")]
private static partial int SSLStreamInitializeImpl(
SafeSslHandle sslHandle,
[MarshalAs(UnmanagedType.U1)] bool isServer,
throw new SslException();
}
- [GeneratedDllImport(Interop.Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamSetTargetHost")]
+ [LibraryImport(Interop.Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamSetTargetHost")]
private static partial int SSLStreamSetTargetHostImpl(
SafeSslHandle sslHandle,
[MarshalAs(UnmanagedType.LPUTF8Str)] string targetHost);
throw new SslException();
}
- [GeneratedDllImport(Interop.Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamRequestClientAuthentication")]
+ [LibraryImport(Interop.Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamRequestClientAuthentication")]
internal static partial void SSLStreamRequestClientAuthentication(SafeSslHandle sslHandle);
[StructLayout(LayoutKind.Sequential)]
public int Length;
}
- [GeneratedDllImport(Interop.Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamSetApplicationProtocols")]
+ [LibraryImport(Interop.Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamSetApplicationProtocols")]
private static unsafe partial int SSLStreamSetApplicationProtocols(SafeSslHandle sslHandle, ApplicationProtocolData[] protocolData, int count);
internal static unsafe void SSLStreamSetApplicationProtocols(SafeSslHandle sslHandle, List<SslApplicationProtocol> protocols)
{
}
}
- [GeneratedDllImport(Interop.Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamSetEnabledProtocols")]
+ [LibraryImport(Interop.Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamSetEnabledProtocols")]
private static partial int SSLStreamSetEnabledProtocols(SafeSslHandle sslHandle, ref SslProtocols protocols, int length);
internal static void SSLStreamSetEnabledProtocols(SafeSslHandle sslHandle, ReadOnlySpan<SslProtocols> protocols)
{
throw new SslException();
}
- [GeneratedDllImport(Interop.Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamHandshake")]
+ [LibraryImport(Interop.Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamHandshake")]
internal static partial PAL_SSLStreamStatus SSLStreamHandshake(SafeSslHandle sslHandle);
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamGetApplicationProtocol")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamGetApplicationProtocol")]
private static partial int SSLStreamGetApplicationProtocol(SafeSslHandle ssl, byte[]? buf, ref int len);
internal static byte[]? SSLStreamGetApplicationProtocol(SafeSslHandle ssl)
{
return bytes;
}
- [GeneratedDllImport(Interop.Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamRead")]
+ [LibraryImport(Interop.Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamRead")]
private static unsafe partial PAL_SSLStreamStatus SSLStreamRead(
SafeSslHandle sslHandle,
byte* buffer,
}
}
- [GeneratedDllImport(Interop.Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamWrite")]
+ [LibraryImport(Interop.Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamWrite")]
private static unsafe partial PAL_SSLStreamStatus SSLStreamWrite(
SafeSslHandle sslHandle,
byte* buffer,
}
}
- [GeneratedDllImport(Interop.Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamRelease")]
+ [LibraryImport(Interop.Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamRelease")]
internal static partial void SSLStreamRelease(IntPtr ptr);
internal sealed class SslException : Exception
}
}
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamGetProtocol")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamGetProtocol")]
private static partial int SSLStreamGetProtocol(SafeSslHandle ssl, out IntPtr protocol);
internal static string SSLStreamGetProtocol(SafeSslHandle ssl)
{
return protocol;
}
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamGetPeerCertificate")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamGetPeerCertificate")]
internal static partial SafeX509Handle SSLStreamGetPeerCertificate(SafeSslHandle ssl);
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamGetPeerCertificates")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamGetPeerCertificates")]
private static partial void SSLStreamGetPeerCertificates(
SafeSslHandle ssl,
[MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 2)] out IntPtr[] certs,
return ptrs;
}
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamGetCipherSuite")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamGetCipherSuite")]
private static partial int SSLStreamGetCipherSuite(SafeSslHandle ssl, out IntPtr cipherSuite);
internal static string SSLStreamGetCipherSuite(SafeSslHandle ssl)
{
return cipherSuite;
}
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamShutdown")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamShutdown")]
[return: MarshalAs(UnmanagedType.U1)]
internal static partial bool SSLStreamShutdown(SafeSslHandle ssl);
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamVerifyHostname")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamVerifyHostname")]
[return: MarshalAs(UnmanagedType.U1)]
internal static partial bool SSLStreamVerifyHostname(
SafeSslHandle ssl,
private const int INSUFFICIENT_BUFFER = -1;
private const int SUCCESS = 1;
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509Decode")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509Decode")]
internal static partial SafeX509Handle X509Decode(ref byte buf, int len);
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509Encode")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509Encode")]
private static partial int X509Encode(SafeX509Handle x, byte[]? buf, ref int len);
internal static byte[] X509Encode(SafeX509Handle x)
{
return encoded;
}
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509DecodeCollection")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509DecodeCollection")]
private static partial int X509DecodeCollection(ref byte buf, int bufLen, IntPtr[]? ptrs, ref int handlesLen);
internal static SafeX509Handle[] X509DecodeCollection(ReadOnlySpan<byte> data)
{
return handles;
}
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509ExportPkcs7")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509ExportPkcs7")]
private static partial int X509ExportPkcs7(IntPtr[] certs, int certsLen, byte[]? buf, ref int len);
internal static byte[] X509ExportPkcs7(IntPtr[] certHandles)
{
return encoded;
}
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509GetContentType")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509GetContentType")]
private static partial X509ContentType X509GetContentType(ref byte buf, int len);
internal static X509ContentType X509GetContentType(ReadOnlySpan<byte> data)
{
UnknownAlgorithm = -1,
}
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509PublicKey")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509PublicKey")]
internal static partial IntPtr X509GetPublicKey(SafeX509Handle x, PAL_KeyAlgorithm algorithm);
}
}
{
internal static partial class AndroidCrypto
{
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509ChainCreateContext")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509ChainCreateContext")]
internal static partial SafeX509ChainContextHandle X509ChainCreateContext(
SafeX509Handle cert,
IntPtr[] extraStore,
int extraStoreLen);
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509ChainDestroyContext")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509ChainDestroyContext")]
internal static partial void X509ChainDestroyContext(IntPtr ctx);
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509ChainBuild")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509ChainBuild")]
[return: MarshalAs(UnmanagedType.U1)]
internal static partial bool X509ChainBuild(
SafeX509ChainContextHandle ctx,
long timeInMsFromUnixEpoch);
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509ChainGetCertificateCount")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509ChainGetCertificateCount")]
private static partial int X509ChainGetCertificateCount(SafeX509ChainContextHandle ctx);
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509ChainGetCertificates")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509ChainGetCertificates")]
private static partial int X509ChainGetCertificates(
SafeX509ChainContextHandle ctx,
IntPtr[] certs,
public int Status;
}
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509ChainGetErrorCount")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509ChainGetErrorCount")]
private static partial int X509ChainGetErrorCount(SafeX509ChainContextHandle ctx);
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509ChainGetErrors")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509ChainGetErrors")]
private static unsafe partial int X509ChainGetErrors(
SafeX509ChainContextHandle ctx,
ValidationError[] errors,
return errors;
}
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509ChainSetCustomTrustStore")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509ChainSetCustomTrustStore")]
internal static partial int X509ChainSetCustomTrustStore(
SafeX509ChainContextHandle ctx,
IntPtr[] customTrustStore,
int customTrustStoreLen);
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509ChainSupportsRevocationOptions")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509ChainSupportsRevocationOptions")]
[return:MarshalAs(UnmanagedType.U1)]
internal static partial bool X509ChainSupportsRevocationOptions();
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509ChainValidate")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509ChainValidate")]
internal static partial int X509ChainValidate(
SafeX509ChainContextHandle ctx,
X509RevocationMode revocationMode,
{
internal static partial class AndroidCrypto
{
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509StoreAddCertificate", StringMarshalling = StringMarshalling.Utf8)]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509StoreAddCertificate", StringMarshalling = StringMarshalling.Utf8)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static unsafe partial bool X509StoreAddCertificate(
SafeX509StoreHandle store,
SafeX509Handle cert,
string hashString);
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509StoreAddCertificateWithPrivateKey", StringMarshalling = StringMarshalling.Utf8)]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509StoreAddCertificateWithPrivateKey", StringMarshalling = StringMarshalling.Utf8)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static unsafe partial bool X509StoreAddCertificateWithPrivateKey(
SafeX509StoreHandle store,
PAL_KeyAlgorithm algorithm,
string hashString);
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509StoreContainsCertificate", StringMarshalling = StringMarshalling.Utf8)]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509StoreContainsCertificate", StringMarshalling = StringMarshalling.Utf8)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static unsafe partial bool X509StoreContainsCertificate(
SafeX509StoreHandle store,
SafeX509Handle cert,
string hashString);
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509StoreEnumerateCertificates")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509StoreEnumerateCertificates")]
[return: MarshalAs(UnmanagedType.Bool)]
internal static unsafe partial bool X509StoreEnumerateCertificates(
SafeX509StoreHandle storeHandle,
delegate* unmanaged<void*, void*, Interop.AndroidCrypto.PAL_KeyAlgorithm, void*, void> callback,
void *callbackContext);
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509StoreEnumerateTrustedCertificates")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509StoreEnumerateTrustedCertificates")]
[return: MarshalAs(UnmanagedType.Bool)]
internal static unsafe partial bool X509StoreEnumerateTrustedCertificates(
byte systemOnly,
delegate* unmanaged<void*, void*, void> callback,
void *callbackContext);
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509StoreOpenDefault")]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509StoreOpenDefault")]
internal static unsafe partial SafeX509StoreHandle X509StoreOpenDefault();
- [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509StoreRemoveCertificate", StringMarshalling = StringMarshalling.Utf8)]
+ [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509StoreRemoveCertificate", StringMarshalling = StringMarshalling.Utf8)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static unsafe partial bool X509StoreRemoveCertificate(
SafeX509StoreHandle store,
private readonly int __padding;
}
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetTcpGlobalStatistics")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetTcpGlobalStatistics")]
public static unsafe partial int GetTcpGlobalStatistics(TcpGlobalStatistics* statistics);
[StructLayoutAttribute(LayoutKind.Sequential)]
public readonly int Forwarding;
}
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetIPv4GlobalStatistics")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetIPv4GlobalStatistics")]
public static unsafe partial int GetIPv4GlobalStatistics(IPv4GlobalStatistics* statistics);
[StructLayoutAttribute(LayoutKind.Sequential)]
public readonly ulong UdpListeners;
}
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetUdpGlobalStatistics")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetUdpGlobalStatistics")]
public static unsafe partial int GetUdpGlobalStatistics(UdpGlobalStatistics* statistics);
[StructLayoutAttribute(LayoutKind.Sequential)]
public readonly ulong TimestampRequestsSent;
}
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetIcmpv4GlobalStatistics")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetIcmpv4GlobalStatistics")]
public static unsafe partial int GetIcmpv4GlobalStatistics(Icmpv4GlobalStatistics* statistics);
[StructLayoutAttribute(LayoutKind.Sequential)]
public readonly ulong TimeExceededMessagesSent;
}
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetIcmpv6GlobalStatistics")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetIcmpv6GlobalStatistics")]
public static unsafe partial int GetIcmpv6GlobalStatistics(Icmpv6GlobalStatistics* statistics);
public readonly struct NativeIPInterfaceStatistics
public readonly ulong Flags;
}
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetNativeIPInterfaceStatistics", StringMarshalling = StringMarshalling.Utf8)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetNativeIPInterfaceStatistics", StringMarshalling = StringMarshalling.Utf8)]
public static partial int GetNativeIPInterfaceStatistics(string name, out NativeIPInterfaceStatistics stats);
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetNumRoutes")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetNumRoutes")]
public static partial int GetNumRoutes();
}
}
{
internal static partial class Sys
{
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Sysctl", SetLastError = true)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_Sysctl", SetLastError = true)]
private static unsafe partial int Sysctl(int* name, int namelen, void* value, size_t* len);
// This is 'raw' sysctl call, only wrapped to allocate memory if needed
public TcpState State;
}
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetEstimatedTcpConnectionCount")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetEstimatedTcpConnectionCount")]
public static partial int GetEstimatedTcpConnectionCount();
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetActiveTcpConnectionInfos")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetActiveTcpConnectionInfos")]
public static unsafe partial int GetActiveTcpConnectionInfos(NativeTcpConnectionInformation* infos, int* infoCount);
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetEstimatedUdpListenerCount")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetEstimatedUdpListenerCount")]
public static partial int GetEstimatedUdpListenerCount();
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetActiveUdpListeners")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetActiveUdpListeners")]
public static unsafe partial int GetActiveUdpListeners(IPEndPointInfo* infos, int* infoCount);
}
}
{
internal static partial class Brotli
{
- [GeneratedDllImport(Libraries.CompressionNative)]
+ [LibraryImport(Libraries.CompressionNative)]
internal static partial SafeBrotliDecoderHandle BrotliDecoderCreateInstance(IntPtr allocFunc, IntPtr freeFunc, IntPtr opaque);
- [GeneratedDllImport(Libraries.CompressionNative)]
+ [LibraryImport(Libraries.CompressionNative)]
internal static unsafe partial int BrotliDecoderDecompressStream(
SafeBrotliDecoderHandle state, ref nuint availableIn, byte** nextIn,
ref nuint availableOut, byte** nextOut, out nuint totalOut);
- [GeneratedDllImport(Libraries.CompressionNative)]
+ [LibraryImport(Libraries.CompressionNative)]
internal static unsafe partial BOOL BrotliDecoderDecompress(nuint availableInput, byte* inBytes, nuint* availableOutput, byte* outBytes);
- [GeneratedDllImport(Libraries.CompressionNative)]
+ [LibraryImport(Libraries.CompressionNative)]
internal static partial void BrotliDecoderDestroyInstance(IntPtr state);
- [GeneratedDllImport(Libraries.CompressionNative)]
+ [LibraryImport(Libraries.CompressionNative)]
internal static partial BOOL BrotliDecoderIsFinished(SafeBrotliDecoderHandle state);
- [GeneratedDllImport(Libraries.CompressionNative)]
+ [LibraryImport(Libraries.CompressionNative)]
internal static partial SafeBrotliEncoderHandle BrotliEncoderCreateInstance(IntPtr allocFunc, IntPtr freeFunc, IntPtr opaque);
- [GeneratedDllImport(Libraries.CompressionNative)]
+ [LibraryImport(Libraries.CompressionNative)]
internal static partial BOOL BrotliEncoderSetParameter(SafeBrotliEncoderHandle state, BrotliEncoderParameter parameter, uint value);
- [GeneratedDllImport(Libraries.CompressionNative)]
+ [LibraryImport(Libraries.CompressionNative)]
internal static unsafe partial BOOL BrotliEncoderCompressStream(
SafeBrotliEncoderHandle state, BrotliEncoderOperation op, ref nuint availableIn,
byte** nextIn, ref nuint availableOut, byte** nextOut, out nuint totalOut);
- [GeneratedDllImport(Libraries.CompressionNative)]
+ [LibraryImport(Libraries.CompressionNative)]
internal static partial BOOL BrotliEncoderHasMoreOutput(SafeBrotliEncoderHandle state);
- [GeneratedDllImport(Libraries.CompressionNative)]
+ [LibraryImport(Libraries.CompressionNative)]
internal static partial void BrotliEncoderDestroyInstance(IntPtr state);
- [GeneratedDllImport(Libraries.CompressionNative)]
+ [LibraryImport(Libraries.CompressionNative)]
internal static unsafe partial BOOL BrotliEncoderCompress(int quality, int window, int v, nuint availableInput, byte* inBytes, nuint* availableOutput, byte* outBytes);
}
}
{
internal static partial class Globalization
{
- [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetCalendars", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetCalendars", StringMarshalling = StringMarshalling.Utf16)]
internal static partial int GetCalendars(string localeName, CalendarId[] calendars, int calendarsCapacity);
- [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetCalendarInfo", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetCalendarInfo", StringMarshalling = StringMarshalling.Utf16)]
internal static unsafe partial ResultCode GetCalendarInfo(string localeName, CalendarId calendarId, CalendarDataType calendarDataType, char* result, int resultCapacity);
internal static unsafe bool EnumCalendarInfo(delegate* unmanaged<char*, IntPtr, void> callback, string localeName, CalendarId calendarId, CalendarDataType calendarDataType, IntPtr context)
return EnumCalendarInfo((IntPtr)callback, localeName, calendarId, calendarDataType, context);
}
- [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_EnumCalendarInfo", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_EnumCalendarInfo", StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
// We skip the following DllImport because of 'Parsing function pointer types in signatures is not supported.' for some targeted
// platforms (for example, WASM build).
private static unsafe partial bool EnumCalendarInfo(IntPtr callback, string localeName, CalendarId calendarId, CalendarDataType calendarDataType, IntPtr context);
- [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetLatestJapaneseEra")]
+ [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetLatestJapaneseEra")]
internal static partial int GetLatestJapaneseEra();
- [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetJapaneseEraStartDate")]
+ [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetJapaneseEraStartDate")]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool GetJapaneseEraStartDate(int era, out int startYear, out int startMonth, out int startDay);
}
{
internal static partial class Globalization
{
- [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_ChangeCase", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_ChangeCase", StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static unsafe partial void ChangeCase(char* src, int srcLen, char* dstBuffer, int dstBufferCapacity, [MarshalAs(UnmanagedType.Bool)] bool bToUpper);
- [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_ChangeCaseInvariant", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_ChangeCaseInvariant", StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static unsafe partial void ChangeCaseInvariant(char* src, int srcLen, char* dstBuffer, int dstBufferCapacity, [MarshalAs(UnmanagedType.Bool)] bool bToUpper);
- [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_ChangeCaseTurkish", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_ChangeCaseTurkish", StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static unsafe partial void ChangeCaseTurkish(char* src, int srcLen, char* dstBuffer, int dstBufferCapacity, [MarshalAs(UnmanagedType.Bool)] bool bToUpper);
- [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_InitOrdinalCasingPage", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_InitOrdinalCasingPage", StringMarshalling = StringMarshalling.Utf16)]
internal static unsafe partial void InitOrdinalCasingPage(int pageNumber, char* pTarget);
}
}
{
internal static partial class Globalization
{
- [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetSortHandle", StringMarshalling = StringMarshalling.Utf8)]
+ [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetSortHandle", StringMarshalling = StringMarshalling.Utf8)]
internal static unsafe partial ResultCode GetSortHandle(string localeName, out IntPtr sortHandle);
- [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_CloseSortHandle")]
+ [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_CloseSortHandle")]
internal static partial void CloseSortHandle(IntPtr handle);
- [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_CompareString", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_CompareString", StringMarshalling = StringMarshalling.Utf16)]
internal static unsafe partial int CompareString(IntPtr sortHandle, char* lpStr1, int cwStr1Len, char* lpStr2, int cwStr2Len, CompareOptions options);
- [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_IndexOf", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_IndexOf", StringMarshalling = StringMarshalling.Utf16)]
internal static unsafe partial int IndexOf(IntPtr sortHandle, char* target, int cwTargetLength, char* pSource, int cwSourceLength, CompareOptions options, int* matchLengthPtr);
- [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_LastIndexOf", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_LastIndexOf", StringMarshalling = StringMarshalling.Utf16)]
internal static unsafe partial int LastIndexOf(IntPtr sortHandle, char* target, int cwTargetLength, char* pSource, int cwSourceLength, CompareOptions options, int* matchLengthPtr);
- [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_StartsWith", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_StartsWith", StringMarshalling = StringMarshalling.Utf16)]
[MethodImpl(MethodImplOptions.NoInlining)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static unsafe partial bool StartsWith(IntPtr sortHandle, char* target, int cwTargetLength, char* source, int cwSourceLength, CompareOptions options, int* matchedLength);
- [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_EndsWith", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_EndsWith", StringMarshalling = StringMarshalling.Utf16)]
[MethodImpl(MethodImplOptions.NoInlining)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static unsafe partial bool EndsWith(IntPtr sortHandle, char* target, int cwTargetLength, char* source, int cwSourceLength, CompareOptions options, int* matchedLength);
- [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_StartsWith", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_StartsWith", StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool StartsWith(IntPtr sortHandle, string target, int cwTargetLength, string source, int cwSourceLength, CompareOptions options);
- [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_EndsWith", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_EndsWith", StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool EndsWith(IntPtr sortHandle, string target, int cwTargetLength, string source, int cwSourceLength, CompareOptions options);
- [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetSortKey", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetSortKey", StringMarshalling = StringMarshalling.Utf16)]
internal static unsafe partial int GetSortKey(IntPtr sortHandle, char* str, int strLength, byte* sortKey, int sortKeyLength, CompareOptions options);
- [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetSortVersion")]
+ [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetSortVersion")]
internal static partial int GetSortVersion(IntPtr sortHandle);
}
}
#pragma warning disable CS3016 // Arrays as attribute arguments is not CLS-compliant
#if TARGET_WINDOWS
- [GeneratedDllImport(Libraries.HostPolicy, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.HostPolicy, StringMarshalling = StringMarshalling.Utf16)]
#else
- [GeneratedDllImport(Libraries.HostPolicy, StringMarshalling = StringMarshalling.Utf8)]
+ [LibraryImport(Libraries.HostPolicy, StringMarshalling = StringMarshalling.Utf8)]
#endif
[UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
internal static partial int corehost_resolve_component_dependencies(string componentMainAssemblyPath,
corehost_resolve_component_dependencies_result_fn result);
- [GeneratedDllImport(Libraries.HostPolicy)]
+ [LibraryImport(Libraries.HostPolicy)]
[UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
internal static partial IntPtr corehost_set_error_writer(IntPtr errorWriter);
#pragma warning restore CS3016 // Arrays as attribute arguments is not CLS-compliant
{
internal static partial class Globalization
{
- [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_LoadICU")]
+ [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_LoadICU")]
internal static partial int LoadICU();
internal static void InitICUFunctions(IntPtr icuuc, IntPtr icuin, ReadOnlySpan<char> version, ReadOnlySpan<char> suffix)
InitICUFunctions(icuuc, icuin, version.ToString(), suffix.Length > 0 ? suffix.ToString() : null);
}
- [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_InitICUFunctions", StringMarshalling = StringMarshalling.Utf8)]
+ [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_InitICUFunctions", StringMarshalling = StringMarshalling.Utf8)]
internal static partial void InitICUFunctions(IntPtr icuuc, IntPtr icuin, string version, string? suffix);
- [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetICUVersion")]
+ [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetICUVersion")]
internal static partial int GetICUVersion();
}
}
{
internal static partial class Globalization
{
- [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_LoadICUData", StringMarshalling = StringMarshalling.Utf8)]
+ [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_LoadICUData", StringMarshalling = StringMarshalling.Utf8)]
internal static partial int LoadICUData(string path);
}
}
internal const int AllowUnassigned = 0x1;
internal const int UseStd3AsciiRules = 0x2;
- [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_ToAscii", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_ToAscii", StringMarshalling = StringMarshalling.Utf16)]
internal static unsafe partial int ToAscii(uint flags, char* src, int srcLen, char* dstBuffer, int dstBufferCapacity);
- [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_ToUnicode", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_ToUnicode", StringMarshalling = StringMarshalling.Utf16)]
internal static unsafe partial int ToUnicode(uint flags, char* src, int srcLen, char* dstBuffer, int dstBufferCapacity);
}
}
{
internal static partial class Globalization
{
- [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetLocaleName", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetLocaleName", StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static unsafe partial bool GetLocaleName(string localeName, char* value, int valueLength);
- [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetLocaleInfoString", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetLocaleInfoString", StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static unsafe partial bool GetLocaleInfoString(string localeName, uint localeStringData, char* value, int valueLength, string? uiLocaleName = null);
- [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetDefaultLocaleName", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetDefaultLocaleName", StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static unsafe partial bool GetDefaultLocaleName(char* value, int valueLength);
- [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_IsPredefinedLocale", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_IsPredefinedLocale", StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool IsPredefinedLocale(string localeName);
- [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetLocaleTimeFormat", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetLocaleTimeFormat", StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static unsafe partial bool GetLocaleTimeFormat(string localeName, [MarshalAs(UnmanagedType.Bool)] bool shortFormat, char* value, int valueLength);
- [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetLocaleInfoInt", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetLocaleInfoInt", StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool GetLocaleInfoInt(string localeName, uint localeNumberData, ref int value);
- [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetLocaleInfoGroupingSizes", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetLocaleInfoGroupingSizes", StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool GetLocaleInfoGroupingSizes(string localeName, uint localeGroupingData, ref int primaryGroupSize, ref int secondaryGroupSize);
- [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetLocales", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetLocales", StringMarshalling = StringMarshalling.Utf16)]
internal static partial int GetLocales([Out] char[]? value, int valueLength);
}
}
{
internal static partial class Globalization
{
- [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_IsNormalized", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_IsNormalized", StringMarshalling = StringMarshalling.Utf16)]
internal static unsafe partial int IsNormalized(NormalizationForm normalizationForm, char* src, int srcLen);
- [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_NormalizeString", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_NormalizeString", StringMarshalling = StringMarshalling.Utf16)]
internal static unsafe partial int NormalizeString(NormalizationForm normalizationForm, char* src, int srcLen, char* dstBuffer, int dstBufferCapacity);
}
}
//
// ODBC32
//
- [GeneratedDllImport(Interop.Libraries.Odbc32)]
+ [LibraryImport(Interop.Libraries.Odbc32)]
internal static partial ODBC32.SQLRETURN SQLAllocHandle(
/*SQLSMALLINT*/ODBC32.SQL_HANDLE HandleType,
/*SQLHANDLE*/IntPtr InputHandle,
/*SQLHANDLE* */out IntPtr OutputHandle);
- [GeneratedDllImport(Interop.Libraries.Odbc32)]
+ [LibraryImport(Interop.Libraries.Odbc32)]
internal static partial ODBC32.SQLRETURN SQLAllocHandle(
/*SQLSMALLINT*/ODBC32.SQL_HANDLE HandleType,
/*SQLHANDLE*/OdbcHandle InputHandle,
/*SQLHANDLE* */out IntPtr OutputHandle);
- [GeneratedDllImport(Interop.Libraries.Odbc32)]
+ [LibraryImport(Interop.Libraries.Odbc32)]
internal static partial /*SQLRETURN*/ODBC32.SQLRETURN SQLBindCol(
/*SQLHSTMT*/OdbcStatementHandle StatementHandle,
/*SQLUSMALLINT*/ushort ColumnNumber,
/*SQLLEN*/IntPtr BufferLength,
/*SQLLEN* */IntPtr StrLen_or_Ind);
- [GeneratedDllImport(Interop.Libraries.Odbc32)]
+ [LibraryImport(Interop.Libraries.Odbc32)]
internal static partial ODBC32.SQLRETURN SQLBindCol(
/*SQLHSTMT*/OdbcStatementHandle StatementHandle,
/*SQLUSMALLINT*/ushort ColumnNumber,
/*SQLLEN*/IntPtr BufferLength,
/*SQLLEN* */IntPtr StrLen_or_Ind);
- [GeneratedDllImport(Interop.Libraries.Odbc32)]
+ [LibraryImport(Interop.Libraries.Odbc32)]
internal static partial /*SQLRETURN*/ODBC32.SQLRETURN SQLBindParameter(
/*SQLHSTMT*/OdbcStatementHandle StatementHandle,
/*SQLUSMALLINT*/ushort ParameterNumber,
#endif
HandleRef StrLen_or_Ind);
- [GeneratedDllImport(Interop.Libraries.Odbc32)]
+ [LibraryImport(Interop.Libraries.Odbc32)]
internal static partial ODBC32.SQLRETURN SQLCancel(
/*SQLHSTMT*/OdbcStatementHandle StatementHandle);
- [GeneratedDllImport(Interop.Libraries.Odbc32)]
+ [LibraryImport(Interop.Libraries.Odbc32)]
internal static partial ODBC32.SQLRETURN SQLCloseCursor(
/*SQLHSTMT*/OdbcStatementHandle StatementHandle);
- [GeneratedDllImport(Interop.Libraries.Odbc32)]
+ [LibraryImport(Interop.Libraries.Odbc32)]
internal static partial ODBC32.SQLRETURN SQLColAttributeW(
/*SQLHSTMT*/OdbcStatementHandle StatementHandle,
/*SQLUSMALLINT*/short ColumnNumber,
// SQLSMALLINT *StringLength, SQLPOINTER NumericAttribute);
// #endif
- [GeneratedDllImport(Interop.Libraries.Odbc32, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Interop.Libraries.Odbc32, StringMarshalling = StringMarshalling.Utf16)]
internal static partial ODBC32.SQLRETURN SQLColumnsW(
/*SQLHSTMT*/OdbcStatementHandle StatementHandle,
/*SQLCHAR* */string CatalogName,
/*SQLCHAR* */string ColumnName,
/*SQLSMALLINT*/short NameLen4);
- [GeneratedDllImport(Interop.Libraries.Odbc32)]
+ [LibraryImport(Interop.Libraries.Odbc32)]
internal static partial ODBC32.SQLRETURN SQLDisconnect(
/*SQLHDBC*/IntPtr ConnectionHandle);
- [GeneratedDllImport(Interop.Libraries.Odbc32, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Interop.Libraries.Odbc32, StringMarshalling = StringMarshalling.Utf16)]
internal static partial ODBC32.SQLRETURN SQLDriverConnectW(
/*SQLHDBC*/OdbcConnectionHandle hdbc,
/*SQLHWND*/IntPtr hwnd,
/*SQLSMALLINT* */out short cbConnectionstringout,
/*SQLUSMALLINT*/short fDriverCompletion);
- [GeneratedDllImport(Interop.Libraries.Odbc32)]
+ [LibraryImport(Interop.Libraries.Odbc32)]
internal static partial ODBC32.SQLRETURN SQLEndTran(
/*SQLSMALLINT*/ODBC32.SQL_HANDLE HandleType,
/*SQLHANDLE*/IntPtr Handle,
/*SQLSMALLINT*/short CompletionType);
- [GeneratedDllImport(Interop.Libraries.Odbc32, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Interop.Libraries.Odbc32, StringMarshalling = StringMarshalling.Utf16)]
internal static partial ODBC32.SQLRETURN SQLExecDirectW(
/*SQLHSTMT*/OdbcStatementHandle StatementHandle,
/*SQLCHAR* */string StatementText,
/*SQLINTEGER*/int TextLength);
- [GeneratedDllImport(Interop.Libraries.Odbc32)]
+ [LibraryImport(Interop.Libraries.Odbc32)]
internal static partial ODBC32.SQLRETURN SQLExecute(
/*SQLHSTMT*/OdbcStatementHandle StatementHandle);
- [GeneratedDllImport(Interop.Libraries.Odbc32)]
+ [LibraryImport(Interop.Libraries.Odbc32)]
internal static partial ODBC32.SQLRETURN SQLFetch(
/*SQLHSTMT*/OdbcStatementHandle StatementHandle);
- [GeneratedDllImport(Interop.Libraries.Odbc32)]
+ [LibraryImport(Interop.Libraries.Odbc32)]
internal static partial ODBC32.SQLRETURN SQLFreeHandle(
/*SQLSMALLINT*/ODBC32.SQL_HANDLE HandleType,
/*SQLHSTMT*/IntPtr StatementHandle);
- [GeneratedDllImport(Interop.Libraries.Odbc32)]
+ [LibraryImport(Interop.Libraries.Odbc32)]
internal static partial ODBC32.SQLRETURN SQLFreeStmt(
/*SQLHSTMT*/OdbcStatementHandle StatementHandle,
/*SQLUSMALLINT*/ODBC32.STMT Option);
- [GeneratedDllImport(Interop.Libraries.Odbc32)]
+ [LibraryImport(Interop.Libraries.Odbc32)]
internal static partial ODBC32.SQLRETURN SQLGetConnectAttrW(
/*SQLHBDC*/OdbcConnectionHandle ConnectionHandle,
/*SQLINTEGER*/ODBC32.SQL_ATTR Attribute,
/*SQLINTEGER*/int BufferLength,
/*SQLINTEGER* */out int StringLength);
- [GeneratedDllImport(Interop.Libraries.Odbc32)]
+ [LibraryImport(Interop.Libraries.Odbc32)]
internal static partial ODBC32.SQLRETURN SQLGetData(
/*SQLHSTMT*/OdbcStatementHandle StatementHandle,
/*SQLUSMALLINT*/ushort ColumnNumber,
/*SQLLEN*/IntPtr BufferLength, // sql.h differs from MSDN
/*SQLLEN* */out IntPtr StrLen_or_Ind);
- [GeneratedDllImport(Interop.Libraries.Odbc32)]
+ [LibraryImport(Interop.Libraries.Odbc32)]
internal static partial ODBC32.SQLRETURN SQLGetDescFieldW(
/*SQLHSTMT*/OdbcDescriptorHandle StatementHandle,
/*SQLUSMALLINT*/short RecNumber,
/*SQLINTEGER*/int BufferLength,
/*SQLINTEGER* */out int StringLength);
- [GeneratedDllImport(Interop.Libraries.Odbc32, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Interop.Libraries.Odbc32, StringMarshalling = StringMarshalling.Utf16)]
internal static partial ODBC32.SQLRETURN SQLGetDiagRecW(
/*SQLSMALLINT*/ODBC32.SQL_HANDLE HandleType,
/*SQLHANDLE*/OdbcHandle Handle,
/*SQLSMALLINT*/short BufferLength,
/*SQLSMALLINT* */out short TextLength);
- [GeneratedDllImport(Interop.Libraries.Odbc32, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Interop.Libraries.Odbc32, StringMarshalling = StringMarshalling.Utf16)]
internal static partial ODBC32.SQLRETURN SQLGetDiagFieldW(
/*SQLSMALLINT*/ ODBC32.SQL_HANDLE HandleType,
/*SQLHANDLE*/ OdbcHandle Handle,
/*SQLSMALLINT*/ short BufferLength,
/*SQLSMALLINT* */ out short StringLength);
- [GeneratedDllImport(Interop.Libraries.Odbc32)]
+ [LibraryImport(Interop.Libraries.Odbc32)]
internal static partial ODBC32.SQLRETURN SQLGetFunctions(
/*SQLHBDC*/OdbcConnectionHandle hdbc,
/*SQLUSMALLINT*/ODBC32.SQL_API fFunction,
/*SQLUSMALLINT* */out short pfExists);
- [GeneratedDllImport(Interop.Libraries.Odbc32)]
+ [LibraryImport(Interop.Libraries.Odbc32)]
internal static partial ODBC32.SQLRETURN SQLGetInfoW(
/*SQLHBDC*/OdbcConnectionHandle hdbc,
/*SQLUSMALLINT*/ODBC32.SQL_INFO fInfoType,
/*SQLSMALLINT*/short cbInfoValueMax,
/*SQLSMALLINT* */out short pcbInfoValue);
- [GeneratedDllImport(Interop.Libraries.Odbc32)]
+ [LibraryImport(Interop.Libraries.Odbc32)]
internal static partial ODBC32.SQLRETURN SQLGetInfoW(
/*SQLHBDC*/OdbcConnectionHandle hdbc,
/*SQLUSMALLINT*/ODBC32.SQL_INFO fInfoType,
/*SQLSMALLINT*/short cbInfoValueMax,
/*SQLSMALLINT* */IntPtr pcbInfoValue);
- [GeneratedDllImport(Interop.Libraries.Odbc32)]
+ [LibraryImport(Interop.Libraries.Odbc32)]
internal static partial ODBC32.SQLRETURN SQLGetStmtAttrW(
/*SQLHSTMT*/OdbcStatementHandle StatementHandle,
/*SQLINTEGER*/ODBC32.SQL_ATTR Attribute,
/*SQLINTEGER*/int BufferLength,
/*SQLINTEGER*/out int StringLength);
- [GeneratedDllImport(Interop.Libraries.Odbc32)]
+ [LibraryImport(Interop.Libraries.Odbc32)]
internal static partial ODBC32.SQLRETURN SQLGetTypeInfo(
/*SQLHSTMT*/OdbcStatementHandle StatementHandle,
/*SQLSMALLINT*/short fSqlType);
- [GeneratedDllImport(Interop.Libraries.Odbc32)]
+ [LibraryImport(Interop.Libraries.Odbc32)]
internal static partial ODBC32.SQLRETURN SQLMoreResults(
/*SQLHSTMT*/OdbcStatementHandle StatementHandle);
- [GeneratedDllImport(Interop.Libraries.Odbc32)]
+ [LibraryImport(Interop.Libraries.Odbc32)]
internal static partial ODBC32.SQLRETURN SQLNumResultCols(
/*SQLHSTMT*/OdbcStatementHandle StatementHandle,
/*SQLSMALLINT* */out short ColumnCount);
- [GeneratedDllImport(Interop.Libraries.Odbc32, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Interop.Libraries.Odbc32, StringMarshalling = StringMarshalling.Utf16)]
internal static partial ODBC32.SQLRETURN SQLPrepareW(
/*SQLHSTMT*/OdbcStatementHandle StatementHandle,
/*SQLCHAR* */string StatementText,
/*SQLINTEGER*/int TextLength);
- [GeneratedDllImport(Interop.Libraries.Odbc32, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Interop.Libraries.Odbc32, StringMarshalling = StringMarshalling.Utf16)]
internal static partial ODBC32.SQLRETURN SQLPrimaryKeysW(
/*SQLHSTMT*/OdbcStatementHandle StatementHandle,
/*SQLCHAR* */string? CatalogName,
/*SQLCHAR* */string TableName,
/*SQLSMALLINT*/short NameLen3);
- [GeneratedDllImport(Interop.Libraries.Odbc32, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Interop.Libraries.Odbc32, StringMarshalling = StringMarshalling.Utf16)]
internal static partial ODBC32.SQLRETURN SQLProcedureColumnsW(
/*SQLHSTMT*/OdbcStatementHandle StatementHandle,
/*SQLCHAR* */ string? CatalogName,
/*SQLCHAR* */ string? ColumnName,
/*SQLSMALLINT*/short NameLen4);
- [GeneratedDllImport(Interop.Libraries.Odbc32, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Interop.Libraries.Odbc32, StringMarshalling = StringMarshalling.Utf16)]
internal static partial ODBC32.SQLRETURN SQLProceduresW(
/*SQLHSTMT*/OdbcStatementHandle StatementHandle,
/*SQLCHAR* */ string CatalogName,
/*SQLCHAR* */ string ProcName,
/*SQLSMALLINT*/short NameLen3);
- [GeneratedDllImport(Interop.Libraries.Odbc32)]
+ [LibraryImport(Interop.Libraries.Odbc32)]
internal static partial ODBC32.SQLRETURN SQLRowCount(
/*SQLHSTMT*/OdbcStatementHandle StatementHandle,
/*SQLLEN* */out IntPtr RowCount);
- [GeneratedDllImport(Interop.Libraries.Odbc32, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Interop.Libraries.Odbc32, StringMarshalling = StringMarshalling.Utf16)]
internal static partial ODBC32.SQLRETURN SQLSetConnectAttrW(
/*SQLHBDC*/OdbcConnectionHandle ConnectionHandle,
/*SQLINTEGER*/ODBC32.SQL_ATTR Attribute,
/*SQLPOINTER*/string Value,
/*SQLINTEGER*/int StringLength);
- [GeneratedDllImport(Interop.Libraries.Odbc32)]
+ [LibraryImport(Interop.Libraries.Odbc32)]
internal static partial ODBC32.SQLRETURN SQLSetConnectAttrW(
/*SQLHBDC*/OdbcConnectionHandle ConnectionHandle,
/*SQLINTEGER*/ODBC32.SQL_ATTR Attribute,
/*SQLPOINTER*/IntPtr Value,
/*SQLINTEGER*/int StringLength);
- [GeneratedDllImport(Interop.Libraries.Odbc32)]
+ [LibraryImport(Interop.Libraries.Odbc32)]
internal static partial ODBC32.SQLRETURN SQLSetConnectAttrW( // used only for AutoCommitOn
/*SQLHBDC*/IntPtr ConnectionHandle,
/*SQLINTEGER*/ODBC32.SQL_ATTR Attribute,
/*SQLPOINTER*/IntPtr Value,
/*SQLINTEGER*/int StringLength);
- [GeneratedDllImport(Interop.Libraries.Odbc32)]
+ [LibraryImport(Interop.Libraries.Odbc32)]
internal static partial /*SQLRETURN*/ODBC32.SQLRETURN SQLSetDescFieldW(
/*SQLHSTMT*/OdbcDescriptorHandle StatementHandle,
/*SQLSMALLINT*/short ColumnNumber,
HandleRef CharacterAttribute,
/*SQLINTEGER*/int BufferLength);
- [GeneratedDllImport(Interop.Libraries.Odbc32)]
+ [LibraryImport(Interop.Libraries.Odbc32)]
internal static partial ODBC32.SQLRETURN SQLSetDescFieldW(
/*SQLHSTMT*/OdbcDescriptorHandle StatementHandle,
/*SQLSMALLINT*/short ColumnNumber,
/*SQLPOINTER*/IntPtr CharacterAttribute,
/*SQLINTEGER*/int BufferLength);
- [GeneratedDllImport(Interop.Libraries.Odbc32)]
+ [LibraryImport(Interop.Libraries.Odbc32)]
// user can set SQL_ATTR_CONNECTION_POOLING attribute with envHandle = null, this attribute is process-level attribute
internal static partial ODBC32.SQLRETURN SQLSetEnvAttr(
/*SQLHENV*/OdbcEnvironmentHandle EnvironmentHandle,
/*SQLPOINTER*/IntPtr Value,
/*SQLINTEGER*/ODBC32.SQL_IS StringLength);
- [GeneratedDllImport(Interop.Libraries.Odbc32)]
+ [LibraryImport(Interop.Libraries.Odbc32)]
internal static partial ODBC32.SQLRETURN SQLSetStmtAttrW(
/*SQLHSTMT*/OdbcStatementHandle StatementHandle,
/*SQLINTEGER*/int Attribute,
/*SQLPOINTER*/IntPtr Value,
/*SQLINTEGER*/int StringLength);
- [GeneratedDllImport(Interop.Libraries.Odbc32, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Interop.Libraries.Odbc32, StringMarshalling = StringMarshalling.Utf16)]
internal static partial ODBC32.SQLRETURN SQLSpecialColumnsW(
/*SQLHSTMT*/OdbcStatementHandle StatementHandle,
/*SQLUSMALLINT*/ODBC32.SQL_SPECIALCOLS IdentifierType,
/*SQLUSMALLINT*/ODBC32.SQL_SCOPE Scope,
/*SQLUSMALLINT*/ ODBC32.SQL_NULLABILITY Nullable);
- [GeneratedDllImport(Interop.Libraries.Odbc32, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Interop.Libraries.Odbc32, StringMarshalling = StringMarshalling.Utf16)]
internal static partial ODBC32.SQLRETURN SQLStatisticsW(
/*SQLHSTMT*/OdbcStatementHandle StatementHandle,
/*SQLCHAR* */string? CatalogName,
/*SQLUSMALLINT*/short Unique,
/*SQLUSMALLINT*/short Reserved);
- [GeneratedDllImport(Interop.Libraries.Odbc32, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Interop.Libraries.Odbc32, StringMarshalling = StringMarshalling.Utf16)]
internal static partial ODBC32.SQLRETURN SQLTablesW(
/*SQLHSTMT*/OdbcStatementHandle StatementHandle,
/*SQLCHAR* */string CatalogName,
{
internal static partial class Globalization
{
- [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetTimeZoneDisplayName", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetTimeZoneDisplayName", StringMarshalling = StringMarshalling.Utf16)]
internal static unsafe partial ResultCode GetTimeZoneDisplayName(
string localeName,
string timeZoneId,
char* result,
int resultLength);
- [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_WindowsIdToIanaId", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_WindowsIdToIanaId", StringMarshalling = StringMarshalling.Utf16)]
internal static unsafe partial int WindowsIdToIanaId(string windowsId, IntPtr region, char* ianaId, int ianaIdLength);
- [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_IanaIdToWindowsId", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_IanaIdToWindowsId", StringMarshalling = StringMarshalling.Utf16)]
internal static unsafe partial int IanaIdToWindowsId(string ianaId, char* windowsId, int windowsIdLength);
}
}
{
internal static partial class ZLib
{
- [GeneratedDllImport(Libraries.CompressionNative, EntryPoint = "CompressionNative_DeflateInit2_")]
+ [LibraryImport(Libraries.CompressionNative, EntryPoint = "CompressionNative_DeflateInit2_")]
internal static unsafe partial ZLibNative.ErrorCode DeflateInit2_(
ZLibNative.ZStream* stream,
ZLibNative.CompressionLevel level,
int memLevel,
ZLibNative.CompressionStrategy strategy);
- [GeneratedDllImport(Libraries.CompressionNative, EntryPoint = "CompressionNative_Deflate")]
+ [LibraryImport(Libraries.CompressionNative, EntryPoint = "CompressionNative_Deflate")]
internal static unsafe partial ZLibNative.ErrorCode Deflate(ZLibNative.ZStream* stream, ZLibNative.FlushCode flush);
- [GeneratedDllImport(Libraries.CompressionNative, EntryPoint = "CompressionNative_DeflateReset")]
+ [LibraryImport(Libraries.CompressionNative, EntryPoint = "CompressionNative_DeflateReset")]
internal static unsafe partial ZLibNative.ErrorCode DeflateReset(ZLibNative.ZStream* stream);
- [GeneratedDllImport(Libraries.CompressionNative, EntryPoint = "CompressionNative_DeflateEnd")]
+ [LibraryImport(Libraries.CompressionNative, EntryPoint = "CompressionNative_DeflateEnd")]
internal static unsafe partial ZLibNative.ErrorCode DeflateEnd(ZLibNative.ZStream* stream);
- [GeneratedDllImport(Libraries.CompressionNative, EntryPoint = "CompressionNative_InflateInit2_")]
+ [LibraryImport(Libraries.CompressionNative, EntryPoint = "CompressionNative_InflateInit2_")]
internal static unsafe partial ZLibNative.ErrorCode InflateInit2_(ZLibNative.ZStream* stream, int windowBits);
- [GeneratedDllImport(Libraries.CompressionNative, EntryPoint = "CompressionNative_Inflate")]
+ [LibraryImport(Libraries.CompressionNative, EntryPoint = "CompressionNative_Inflate")]
internal static unsafe partial ZLibNative.ErrorCode Inflate(ZLibNative.ZStream* stream, ZLibNative.FlushCode flush);
- [GeneratedDllImport(Libraries.CompressionNative, EntryPoint = "CompressionNative_InflateReset")]
+ [LibraryImport(Libraries.CompressionNative, EntryPoint = "CompressionNative_InflateReset")]
internal static unsafe partial ZLibNative.ErrorCode InflateReset(ZLibNative.ZStream* stream);
- [GeneratedDllImport(Libraries.CompressionNative, EntryPoint = "CompressionNative_InflateEnd")]
+ [LibraryImport(Libraries.CompressionNative, EntryPoint = "CompressionNative_InflateEnd")]
internal static unsafe partial ZLibNative.ErrorCode InflateEnd(ZLibNative.ZStream* stream);
- [GeneratedDllImport(Libraries.CompressionNative, EntryPoint = "CompressionNative_Crc32")]
+ [LibraryImport(Libraries.CompressionNative, EntryPoint = "CompressionNative_Crc32")]
internal static unsafe partial uint crc32(uint crc, byte* buffer, int len);
}
}
{
public const int ber_default_successful_return_code = 0;
- [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ber_alloc_t")]
+ [LibraryImport(Libraries.OpenLdap, EntryPoint = "ber_alloc_t")]
public static partial IntPtr ber_alloc(int option);
- [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ber_init")]
+ [LibraryImport(Libraries.OpenLdap, EntryPoint = "ber_init")]
public static partial IntPtr ber_init(BerVal value);
- [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ber_free")]
+ [LibraryImport(Libraries.OpenLdap, EntryPoint = "ber_free")]
public static partial IntPtr ber_free(IntPtr berelement, int option);
public static int ber_printf_emptyarg(SafeBerHandle berElement, string format, nuint tag)
}
}
- [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ber_start_seq")]
+ [LibraryImport(Libraries.OpenLdap, EntryPoint = "ber_start_seq")]
public static partial int ber_start_seq(SafeBerHandle berElement, nuint tag);
- [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ber_start_set")]
+ [LibraryImport(Libraries.OpenLdap, EntryPoint = "ber_start_set")]
public static partial int ber_start_set(SafeBerHandle berElement, nuint tag);
- [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ber_put_seq")]
+ [LibraryImport(Libraries.OpenLdap, EntryPoint = "ber_put_seq")]
public static partial int ber_put_seq(SafeBerHandle berElement, nuint tag);
- [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ber_put_set")]
+ [LibraryImport(Libraries.OpenLdap, EntryPoint = "ber_put_set")]
public static partial int ber_put_set(SafeBerHandle berElement, nuint tag);
- [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ber_put_null")]
+ [LibraryImport(Libraries.OpenLdap, EntryPoint = "ber_put_null")]
public static partial int ber_put_null(SafeBerHandle berElement, nuint tag);
public static int ber_printf_int(SafeBerHandle berElement, string format, int value, nuint tag)
}
}
- [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ber_put_int")]
+ [LibraryImport(Libraries.OpenLdap, EntryPoint = "ber_put_int")]
public static partial int ber_put_int(SafeBerHandle berElement, int value, nuint tag);
- [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ber_put_enum")]
+ [LibraryImport(Libraries.OpenLdap, EntryPoint = "ber_put_enum")]
public static partial int ber_put_enum(SafeBerHandle berElement, int value, nuint tag);
- [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ber_put_boolean")]
+ [LibraryImport(Libraries.OpenLdap, EntryPoint = "ber_put_boolean")]
public static partial int ber_put_boolean(SafeBerHandle berElement, int value, nuint tag);
public static int ber_printf_bytearray(SafeBerHandle berElement, string format, HGlobalMemHandle value, nuint length, nuint tag)
}
}
- [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ber_put_ostring")]
+ [LibraryImport(Libraries.OpenLdap, EntryPoint = "ber_put_ostring")]
private static partial int ber_put_ostring(SafeBerHandle berElement, HGlobalMemHandle value, nuint length, nuint tag);
- [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ber_put_string")]
+ [LibraryImport(Libraries.OpenLdap, EntryPoint = "ber_put_string")]
private static partial int ber_put_string(SafeBerHandle berElement, HGlobalMemHandle value, nuint tag);
- [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ber_put_bitstring")]
+ [LibraryImport(Libraries.OpenLdap, EntryPoint = "ber_put_bitstring")]
private static partial int ber_put_bitstring(SafeBerHandle berElement, HGlobalMemHandle value, nuint length, nuint tag);
- [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ber_flatten")]
+ [LibraryImport(Libraries.OpenLdap, EntryPoint = "ber_flatten")]
public static partial int ber_flatten(SafeBerHandle berElement, ref IntPtr value);
- [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ber_bvfree")]
+ [LibraryImport(Libraries.OpenLdap, EntryPoint = "ber_bvfree")]
public static partial int ber_bvfree(IntPtr value);
- [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ber_bvecfree")]
+ [LibraryImport(Libraries.OpenLdap, EntryPoint = "ber_bvecfree")]
public static partial int ber_bvecfree(IntPtr value);
public static int ber_scanf_emptyarg(SafeBerHandle berElement, string format)
}
}
- [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ber_skip_tag")]
+ [LibraryImport(Libraries.OpenLdap, EntryPoint = "ber_skip_tag")]
private static partial int ber_skip_tag(SafeBerHandle berElement, ref nuint len);
- [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ber_get_null")]
+ [LibraryImport(Libraries.OpenLdap, EntryPoint = "ber_get_null")]
private static partial int ber_get_null(SafeBerHandle berElement);
public static int ber_scanf_int(SafeBerHandle berElement, string format, ref int value)
}
}
- [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ber_get_int")]
+ [LibraryImport(Libraries.OpenLdap, EntryPoint = "ber_get_int")]
private static partial int ber_get_int(SafeBerHandle berElement, ref int value);
- [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ber_get_enum")]
+ [LibraryImport(Libraries.OpenLdap, EntryPoint = "ber_get_enum")]
private static partial int ber_get_enum(SafeBerHandle berElement, ref int value);
- [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ber_get_boolean")]
+ [LibraryImport(Libraries.OpenLdap, EntryPoint = "ber_get_boolean")]
private static partial int ber_get_boolean(SafeBerHandle berElement, ref int value);
public static int ber_scanf_bitstring(SafeBerHandle berElement, string format, ref IntPtr value, ref uint bitLength)
return res;
}
- [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ber_get_stringb")]
+ [LibraryImport(Libraries.OpenLdap, EntryPoint = "ber_get_stringb")]
private static partial int ber_get_stringb(SafeBerHandle berElement, ref IntPtr value, ref nuint bitLength);
public static int ber_scanf_ptr(SafeBerHandle berElement, string format, ref IntPtr value)
return ber_get_stringal(berElement, ref value);
}
- [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ber_get_stringal")]
+ [LibraryImport(Libraries.OpenLdap, EntryPoint = "ber_get_stringal")]
private static partial int ber_get_stringal(SafeBerHandle berElement, ref IntPtr value);
public static int ber_printf_berarray(SafeBerHandle berElement, string format, IntPtr value, nuint tag)
ldap_get_option_int(IntPtr.Zero, LdapOption.LDAP_OPT_DEBUG_LEVEL, ref unused);
}
- [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_initialize", SetLastError = true)]
+ [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_initialize", SetLastError = true)]
public static partial int ldap_initialize(out IntPtr ld, [MarshalAs(UnmanagedType.LPUTF8Str)] string uri);
- [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_unbind_ext_s")]
+ [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_unbind_ext_s")]
public static partial int ldap_unbind_ext_s(IntPtr ld, ref IntPtr serverctrls, ref IntPtr clientctrls);
- [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_get_dn")]
+ [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_get_dn")]
public static partial IntPtr ldap_get_dn(ConnectionHandle ldapHandle, IntPtr result);
- [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_get_option")]
+ [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_get_option")]
public static partial int ldap_get_option_bool(ConnectionHandle ldapHandle, LdapOption option, [MarshalAs(UnmanagedType.Bool)] ref bool outValue);
- [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_get_option")]
+ [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_get_option")]
public static unsafe partial int ldap_get_option_secInfo(ConnectionHandle ldapHandle, LdapOption option, void* outValue);
- [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_get_option")]
+ [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_get_option")]
public static partial int ldap_get_option_sechandle(ConnectionHandle ldapHandle, LdapOption option, ref SecurityHandle outValue);
- [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_get_option")]
+ [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_get_option")]
private static partial int ldap_get_option_int(IntPtr ldapHandle, LdapOption option, ref int outValue);
- [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_get_option")]
+ [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_get_option")]
public static partial int ldap_get_option_int(ConnectionHandle ldapHandle, LdapOption option, ref int outValue);
- [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_get_option")]
+ [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_get_option")]
public static partial int ldap_get_option_ptr(ConnectionHandle ldapHandle, LdapOption option, ref IntPtr outValue);
- [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_get_values_len")]
+ [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_get_values_len")]
public static partial IntPtr ldap_get_values_len(ConnectionHandle ldapHandle, IntPtr result, [MarshalAs(UnmanagedType.LPUTF8Str)] string name);
- [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_result", SetLastError = true)]
+ [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_result", SetLastError = true)]
public static partial int ldap_result(ConnectionHandle ldapHandle, int messageId, int all, in LDAP_TIMEVAL timeout, ref IntPtr Mesage);
- [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_result2error")]
+ [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_result2error")]
public static partial int ldap_result2error(ConnectionHandle ldapHandle, IntPtr result, int freeIt);
- [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_search_ext")]
+ [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_search_ext")]
public static partial int ldap_search(
ConnectionHandle ldapHandle,
[MarshalAs(UnmanagedType.LPUTF8Str)] string dn,
int sizelimit,
ref int messageNumber);
- [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_set_option", SetLastError = true)]
+ [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_set_option", SetLastError = true)]
public static partial int ldap_set_option_bool(ConnectionHandle ld, LdapOption option, [MarshalAs(UnmanagedType.Bool)] bool value);
- [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_set_option")]
+ [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_set_option")]
public static partial int ldap_set_option_clientcert(ConnectionHandle ldapHandle, LdapOption option, QUERYCLIENTCERT outValue);
- [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_set_option")]
+ [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_set_option")]
public static partial int ldap_set_option_servercert(ConnectionHandle ldapHandle, LdapOption option, VERIFYSERVERCERT outValue);
- [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_set_option", SetLastError = true)]
+ [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_set_option", SetLastError = true)]
public static partial int ldap_set_option_int(ConnectionHandle ld, LdapOption option, ref int inValue);
- [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_set_option")]
+ [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_set_option")]
public static partial int ldap_set_option_ptr(ConnectionHandle ldapHandle, LdapOption option, ref IntPtr inValue);
- [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_set_option")]
+ [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_set_option")]
public static partial int ldap_set_option_string(ConnectionHandle ldapHandle, LdapOption option, [MarshalAs(UnmanagedType.LPUTF8Str)] string inValue);
- [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_set_option")]
+ [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_set_option")]
public static partial int ldap_set_option_referral(ConnectionHandle ldapHandle, LdapOption option, ref LdapReferralCallback outValue);
// Note that ldap_start_tls_s has a different signature across Windows LDAP and OpenLDAP
- [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_start_tls_s")]
+ [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_start_tls_s")]
public static partial int ldap_start_tls(ConnectionHandle ldapHandle, IntPtr serverControls, IntPtr clientControls);
- [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_parse_result")]
+ [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_parse_result")]
public static partial int ldap_parse_result(ConnectionHandle ldapHandle, IntPtr result, ref int serverError, ref IntPtr dn, ref IntPtr message, ref IntPtr referral, ref IntPtr control, byte freeIt);
- [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_parse_result")]
+ [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_parse_result")]
public static partial int ldap_parse_result_referral(ConnectionHandle ldapHandle, IntPtr result, IntPtr serverError, IntPtr dn, IntPtr message, ref IntPtr referral, IntPtr control, byte freeIt);
- [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_parse_extended_result")]
+ [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_parse_extended_result")]
public static partial int ldap_parse_extended_result(ConnectionHandle ldapHandle, IntPtr result, ref IntPtr oid, ref IntPtr data, byte freeIt);
- [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_parse_reference")]
+ [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_parse_reference")]
public static partial int ldap_parse_reference(ConnectionHandle ldapHandle, IntPtr result, ref IntPtr referrals, IntPtr ServerControls, byte freeIt);
- [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_sasl_bind_s")]
+ [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_sasl_bind_s")]
internal static partial int ldap_sasl_bind(
ConnectionHandle ld,
[MarshalAs(UnmanagedType.LPUTF8Str)] string dn,
IntPtr clientctrls,
IntPtr servercredp);
- [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_sasl_interactive_bind_s")]
+ [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_sasl_interactive_bind_s")]
internal static partial int ldap_sasl_interactive_bind(
ConnectionHandle ld,
[MarshalAs(UnmanagedType.LPUTF8Str)] string dn,
LDAP_SASL_INTERACT_PROC proc,
IntPtr defaults);
- [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_err2string")]
+ [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_err2string")]
public static partial IntPtr ldap_err2string(int err);
- [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_extended_operation")]
+ [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_extended_operation")]
public static partial int ldap_extended_operation(ConnectionHandle ldapHandle, [MarshalAs(UnmanagedType.LPUTF8Str)] string oid, BerVal data, IntPtr servercontrol, IntPtr clientcontrol, ref int messageNumber);
- [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_first_attribute")]
+ [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_first_attribute")]
public static partial IntPtr ldap_first_attribute(ConnectionHandle ldapHandle, IntPtr result, ref IntPtr address);
- [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_first_entry")]
+ [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_first_entry")]
public static partial IntPtr ldap_first_entry(ConnectionHandle ldapHandle, IntPtr result);
- [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_first_reference")]
+ [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_first_reference")]
public static partial IntPtr ldap_first_reference(ConnectionHandle ldapHandle, IntPtr result);
- [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_create_sort_control")]
+ [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_create_sort_control")]
public static partial int ldap_create_sort_control(ConnectionHandle handle, IntPtr keys, byte critical, ref IntPtr control);
- [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_control_free")]
+ [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_control_free")]
public static partial int ldap_control_free(IntPtr control);
- [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_controls_free")]
+ [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_controls_free")]
public static partial int ldap_controls_free(IntPtr value);
- [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_value_free")]
+ [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_value_free")]
public static partial int ldap_value_free(IntPtr value);
- [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_value_free_len")]
+ [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_value_free_len")]
public static partial IntPtr ldap_value_free_len(IntPtr berelement);
- [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_memfree")]
+ [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_memfree")]
public static partial void ldap_memfree(IntPtr value);
- [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_msgfree")]
+ [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_msgfree")]
public static partial void ldap_msgfree(IntPtr value);
- [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_modify_ext")]
+ [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_modify_ext")]
public static partial int ldap_modify(ConnectionHandle ldapHandle, [MarshalAs(UnmanagedType.LPUTF8Str)] string dn, IntPtr attrs, IntPtr servercontrol, IntPtr clientcontrol, ref int messageNumber);
- [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_next_attribute")]
+ [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_next_attribute")]
public static partial IntPtr ldap_next_attribute(ConnectionHandle ldapHandle, IntPtr result, IntPtr address);
- [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_next_entry")]
+ [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_next_entry")]
public static partial IntPtr ldap_next_entry(ConnectionHandle ldapHandle, IntPtr result);
- [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_next_reference")]
+ [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_next_reference")]
public static partial IntPtr ldap_next_reference(ConnectionHandle ldapHandle, IntPtr result);
- [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_abandon")]
+ [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_abandon")]
public static partial int ldap_abandon(ConnectionHandle ldapHandle, int messagId);
- [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_add_ext")]
+ [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_add_ext")]
public static partial int ldap_add(ConnectionHandle ldapHandle, [MarshalAs(UnmanagedType.LPUTF8Str)] string dn, IntPtr attrs, IntPtr servercontrol, IntPtr clientcontrol, ref int messageNumber);
- [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_delete_ext")]
+ [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_delete_ext")]
public static partial int ldap_delete_ext(ConnectionHandle ldapHandle, [MarshalAs(UnmanagedType.LPUTF8Str)] string dn, IntPtr servercontrol, IntPtr clientcontrol, ref int messageNumber);
- [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_rename")]
+ [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_rename")]
public static partial int ldap_rename(
ConnectionHandle ldapHandle,
[MarshalAs(UnmanagedType.LPUTF8Str)] string dn,
IntPtr clientcontrol,
ref int messageNumber);
- [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_compare_ext")]
+ [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_compare_ext")]
public static partial int ldap_compare(
ConnectionHandle ldapHandle,
[MarshalAs(UnmanagedType.LPUTF8Str)] string dn,
{
internal static partial class Sys
{
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_INotifyInit", SetLastError = true)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_INotifyInit", SetLastError = true)]
internal static partial SafeFileHandle INotifyInit();
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_INotifyAddWatch", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_INotifyAddWatch", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
internal static partial int INotifyAddWatch(SafeFileHandle fd, string pathName, uint mask);
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_INotifyRemoveWatch", SetLastError = true)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_INotifyRemoveWatch", SetLastError = true)]
private static partial int INotifyRemoveWatch_private(SafeFileHandle fd, int wd);
internal static int INotifyRemoveWatch(SafeFileHandle fd, int wd)
{
internal static partial class CoreFoundation
{
- [GeneratedDllImport(Libraries.CoreFoundationLibrary, EntryPoint = "CFArrayGetCount")]
+ [LibraryImport(Libraries.CoreFoundationLibrary, EntryPoint = "CFArrayGetCount")]
private static partial CFIndex _CFArrayGetCount(SafeCFArrayHandle cfArray);
// Follows the "Get" version of the "Create" rule, so needs to return an IntPtr to
// prevent CFRelease from being called on the SafeHandle close.
- [GeneratedDllImport(Libraries.CoreFoundationLibrary, EntryPoint = "CFArrayGetValueAtIndex")]
+ [LibraryImport(Libraries.CoreFoundationLibrary, EntryPoint = "CFArrayGetValueAtIndex")]
private static partial IntPtr CFArrayGetValueAtIndex(SafeCFArrayHandle cfArray, CFIndex index);
internal static long CFArrayGetCount(SafeCFArrayHandle cfArray)
{
internal static partial class CoreFoundation
{
- [GeneratedDllImport(Libraries.CoreFoundationLibrary)]
+ [LibraryImport(Libraries.CoreFoundationLibrary)]
private static unsafe partial byte* CFDataGetBytePtr(SafeCFDataHandle cfData);
- [GeneratedDllImport(Libraries.CoreFoundationLibrary)]
+ [LibraryImport(Libraries.CoreFoundationLibrary)]
private static partial CFIndex CFDataGetLength(SafeCFDataHandle cfData);
internal static unsafe Span<byte> CFDataDangerousGetSpan(SafeCFDataHandle cfData)
// https://developer.apple.com/reference/corefoundation/cfabsolutetime
private static readonly DateTime s_cfDateEpoch = new DateTime(2001, 1, 1, 0, 0, 0, DateTimeKind.Utc);
- [GeneratedDllImport(Libraries.CoreFoundationLibrary)]
+ [LibraryImport(Libraries.CoreFoundationLibrary)]
private static partial SafeCFDateHandle CFDateCreate(IntPtr zero, CFAbsoluteTime at);
internal static SafeCFDateHandle CFDateCreate(DateTime date)
{
internal static partial class CoreFoundation
{
- [GeneratedDllImport(Libraries.CoreFoundationLibrary)]
+ [LibraryImport(Libraries.CoreFoundationLibrary)]
internal static partial IntPtr CFDictionaryGetValue(SafeCFDictionaryHandle handle, IntPtr key);
}
}
{
internal static partial class CoreFoundation
{
- [GeneratedDllImport(Libraries.CoreFoundationLibrary)]
+ [LibraryImport(Libraries.CoreFoundationLibrary)]
private static partial CFIndex CFErrorGetCode(SafeCFErrorHandle cfError);
- [GeneratedDllImport(Libraries.CoreFoundationLibrary)]
+ [LibraryImport(Libraries.CoreFoundationLibrary)]
private static partial SafeCFStringHandle CFErrorCopyDescription(SafeCFErrorHandle cfError);
internal static int GetErrorCode(SafeCFErrorHandle cfError)
kCFNumberIntType = 9,
}
- [GeneratedDllImport(Libraries.CoreFoundationLibrary)]
+ [LibraryImport(Libraries.CoreFoundationLibrary)]
private static unsafe partial int CFNumberGetValue(IntPtr handle, CFNumberType type, int* value);
}
}
{
internal static partial class CoreFoundation
{
- [GeneratedDllImport(Libraries.CFNetworkLibrary)]
+ [LibraryImport(Libraries.CFNetworkLibrary)]
internal static partial SafeCFDictionaryHandle CFNetworkCopySystemProxySettings();
- [GeneratedDllImport(Libraries.CFNetworkLibrary)]
+ [LibraryImport(Libraries.CFNetworkLibrary)]
internal static partial SafeCFArrayHandle CFNetworkCopyProxiesForURL(SafeCreateHandle url, SafeCFDictionaryHandle proxySettings);
internal delegate void CFProxyAutoConfigurationResultCallback(IntPtr client, IntPtr proxyList, IntPtr error);
- [GeneratedDllImport(Libraries.CFNetworkLibrary)]
+ [LibraryImport(Libraries.CFNetworkLibrary)]
internal static partial CFRunLoopSourceRef CFNetworkExecuteProxyAutoConfigurationURL(
IntPtr proxyAutoConfigURL,
SafeCreateHandle targetURL,
CFProxyAutoConfigurationResultCallback cb,
ref CFStreamClientContext clientContext);
- [GeneratedDllImport(Libraries.CFNetworkLibrary)]
+ [LibraryImport(Libraries.CFNetworkLibrary)]
internal static partial CFRunLoopSourceRef CFNetworkExecuteProxyAutoConfigurationScript(
IntPtr proxyAutoConfigurationScript,
SafeCreateHandle targetURL,
/// Returns the interior pointer of the cfString if it has the specified encoding.
/// If it has the wrong encoding, or if the interior pointer isn't being shared for some reason, returns NULL
/// </summary>
- [GeneratedDllImport(Libraries.CoreFoundationLibrary)]
+ [LibraryImport(Libraries.CoreFoundationLibrary)]
private static partial IntPtr CFStringGetCStringPtr(
SafeCFStringHandle cfString,
CFStringBuiltInEncodings encoding);
- [GeneratedDllImport(Libraries.CoreFoundationLibrary)]
+ [LibraryImport(Libraries.CoreFoundationLibrary)]
private static partial SafeCFDataHandle CFStringCreateExternalRepresentation(
IntPtr alloc,
SafeCFStringHandle theString,
{
internal static partial class CoreFoundation
{
- [GeneratedDllImport(Libraries.CoreFoundationLibrary)]
+ [LibraryImport(Libraries.CoreFoundationLibrary)]
private static partial SafeCreateHandle CFURLCreateWithString(
IntPtr allocator,
SafeCreateHandle str,
/// <param name="encoding">The encoding type.</param>
/// <param name="isExternalRepresentation">Whether or not a BOM is present.</param>
/// <returns>A CFStringRef on success, otherwise a SafeCreateHandle(IntPtr.Zero).</returns>
- [GeneratedDllImport(Interop.Libraries.CoreFoundationLibrary)]
+ [LibraryImport(Interop.Libraries.CoreFoundationLibrary)]
private static partial SafeCreateHandle CFStringCreateWithBytes(
IntPtr alloc,
IntPtr bytes,
/// <param name="encoding">The encoding of the str variable. This should be UTF 8 for OS X</param>
/// <returns>Returns a pointer to a CFString on success; otherwise, returns IntPtr.Zero</returns>
/// <remarks>For *nix systems, the CLR maps ANSI to UTF-8, so be explicit about that</remarks>
- [GeneratedDllImport(Interop.Libraries.CoreFoundationLibrary, StringMarshalling = StringMarshalling.Utf8)]
+ [LibraryImport(Interop.Libraries.CoreFoundationLibrary, StringMarshalling = StringMarshalling.Utf8)]
private static partial SafeCreateHandle CFStringCreateWithCString(
IntPtr allocator,
string str,
/// <param name="encoding">The encoding of the str variable. This should be UTF 8 for OS X</param>
/// <returns>Returns a pointer to a CFString on success; otherwise, returns IntPtr.Zero</returns>
/// <remarks>For *nix systems, the CLR maps ANSI to UTF-8, so be explicit about that</remarks>
- [GeneratedDllImport(Interop.Libraries.CoreFoundationLibrary, StringMarshalling = StringMarshalling.Utf8)]
+ [LibraryImport(Interop.Libraries.CoreFoundationLibrary, StringMarshalling = StringMarshalling.Utf8)]
private static partial SafeCreateHandle CFStringCreateWithCString(
IntPtr allocator,
IntPtr str,
/// <param name="numValues">The number of values in the array</param>
/// <param name="callbacks">Should be IntPtr.Zero</param>
/// <returns>Returns a pointer to a CFArray on success; otherwise, returns IntPtr.Zero</returns>
- [GeneratedDllImport(Interop.Libraries.CoreFoundationLibrary)]
+ [LibraryImport(Interop.Libraries.CoreFoundationLibrary)]
private static unsafe partial SafeCreateHandle CFArrayCreate(
IntPtr allocator,
IntPtr* values,
/// </summary>
/// <param name="ptr">The CFType object to retain. This value must not be NULL</param>
/// <returns>The input value</returns>
- [GeneratedDllImport(Interop.Libraries.CoreFoundationLibrary)]
+ [LibraryImport(Interop.Libraries.CoreFoundationLibrary)]
internal static partial IntPtr CFRetain(IntPtr ptr);
/// <summary>
/// Decrements the reference count on the specified object and, if the ref count hits 0, cleans up the object.
/// </summary>
/// <param name="ptr">The pointer on which to decrement the reference count.</param>
- [GeneratedDllImport(Interop.Libraries.CoreFoundationLibrary)]
+ [LibraryImport(Interop.Libraries.CoreFoundationLibrary)]
internal static partial void CFRelease(IntPtr ptr);
}
}
/// <param name="flags">Flags to say what kind of events should be sent through this stream.</param>
/// <returns>On success, returns a pointer to an FSEventStream object; otherwise, returns IntPtr.Zero</returns>
/// <remarks>For *nix systems, the CLR maps ANSI to UTF-8, so be explicit about that</remarks>
- [GeneratedDllImport(Interop.Libraries.CoreServicesLibrary, StringMarshalling = StringMarshalling.Utf8)]
+ [LibraryImport(Interop.Libraries.CoreServicesLibrary, StringMarshalling = StringMarshalling.Utf8)]
internal static unsafe partial SafeEventStreamHandle FSEventStreamCreate(
IntPtr allocator,
delegate* unmanaged<FSEventStreamRef, IntPtr, size_t, byte**, FSEventStreamEventFlags*, FSEventStreamEventId*, void> callback,
/// <param name="streamRef">The stream to attach to the RunLoop</param>
/// <param name="runLoop">The RunLoop to attach the stream to</param>
/// <param name="runLoopMode">The mode of the RunLoop; this should usually be kCFRunLoopDefaultMode. See the documentation for RunLoops for more info.</param>
- [GeneratedDllImport(Interop.Libraries.CoreServicesLibrary)]
+ [LibraryImport(Interop.Libraries.CoreServicesLibrary)]
internal static partial void FSEventStreamScheduleWithRunLoop(
SafeEventStreamHandle streamRef,
CFRunLoopRef runLoop,
/// </summary>
/// <param name="streamRef">The stream to receive events on.</param>
/// <returns>Returns true if the stream was started; otherwise, returns false and no events will be received.</returns>
- [GeneratedDllImport(Interop.Libraries.CoreServicesLibrary)]
+ [LibraryImport(Interop.Libraries.CoreServicesLibrary)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool FSEventStreamStart(SafeEventStreamHandle streamRef);
/// Stops receiving events on the specified stream. The stream can be restarted and not miss any events.
/// </summary>
/// <param name="streamRef">The stream to stop receiving events on.</param>
- [GeneratedDllImport(Interop.Libraries.CoreServicesLibrary)]
+ [LibraryImport(Interop.Libraries.CoreServicesLibrary)]
internal static partial void FSEventStreamStop(SafeEventStreamHandle streamRef);
/// <summary>
/// Stops receiving events on the specified stream. The stream can be restarted and not miss any events.
/// </summary>
/// <param name="streamRef">The stream to stop receiving events on.</param>
- [GeneratedDllImport(Interop.Libraries.CoreServicesLibrary)]
+ [LibraryImport(Interop.Libraries.CoreServicesLibrary)]
internal static partial void FSEventStreamStop(IntPtr streamRef);
/// <summary>
/// </summary>
/// <param name="streamRef">The FSEventStream to invalidate</param>
/// <remarks>This can only be called after FSEventStreamScheduleWithRunLoop has be called</remarks>
- [GeneratedDllImport(Interop.Libraries.CoreServicesLibrary)]
+ [LibraryImport(Interop.Libraries.CoreServicesLibrary)]
internal static partial void FSEventStreamInvalidate(IntPtr streamRef);
/// <summary>
/// <param name="streamRef">The stream to remove from the RunLoop</param>
/// <param name="runLoop">The RunLoop to remove the stream from.</param>
/// <param name="runLoopMode">The mode of the RunLoop; this should usually be kCFRunLoopDefaultMode. See the documentation for RunLoops for more info.</param>
- [GeneratedDllImport(Interop.Libraries.CoreServicesLibrary)]
+ [LibraryImport(Interop.Libraries.CoreServicesLibrary)]
internal static partial void FSEventStreamUnscheduleFromRunLoop(
SafeEventStreamHandle streamRef,
CFRunLoopRef runLoop,
/// Releases a reference count on the specified EventStream and, if necessary, cleans the stream up.
/// </summary>
/// <param name="streamRef">The stream on which to decrement the reference count.</param>
- [GeneratedDllImport(Interop.Libraries.CoreServicesLibrary)]
+ [LibraryImport(Interop.Libraries.CoreServicesLibrary)]
internal static partial void FSEventStreamRelease(IntPtr streamRef);
}
}
[MethodImplAttribute(MethodImplOptions.InternalCall)]
internal static extern void CFRunLoopRun();
#else
- [GeneratedDllImport(Interop.Libraries.CoreFoundationLibrary)]
+ [LibraryImport(Interop.Libraries.CoreFoundationLibrary)]
internal static partial void CFRunLoopRun();
#endif
/// <summary>
/// Runs the current thread's CFRunLoop object in a particular mode.
/// </summary>
- [GeneratedDllImport(Interop.Libraries.CoreFoundationLibrary)]
+ [LibraryImport(Interop.Libraries.CoreFoundationLibrary)]
internal static partial int CFRunLoopRunInMode(CFStringRef mode, double seconds, int returnAfterSourceHandled);
/// <summary>
/// Notifies a RunLoop to stop and return control to the execution context that called CFRunLoopRun
/// </summary>
/// <param name="rl">The RunLoop to notify to stop</param>
- [GeneratedDllImport(Interop.Libraries.CoreFoundationLibrary)]
+ [LibraryImport(Interop.Libraries.CoreFoundationLibrary)]
internal static partial void CFRunLoopStop(CFRunLoopRef rl);
/// <summary>
/// Follows the "Get Rule" where you do not own the object unless you CFRetain it; in which case, you must also CFRelease it as well.
/// </summary>
/// <returns>Returns a pointer to a CFRunLoop on success; otherwise, returns IntPtr.Zero</returns>
- [GeneratedDllImport(Interop.Libraries.CoreFoundationLibrary)]
+ [LibraryImport(Interop.Libraries.CoreFoundationLibrary)]
internal static partial CFRunLoopRef CFRunLoopGetCurrent();
/// <summary>
/// <param name="rl">The run loop to modify.</param>
/// <param name="source">The run loop source to add. The source is retained by the run loop.</param>
/// <param name="mode">The run loop mode to which to add source.</param>
- [GeneratedDllImport(Interop.Libraries.CoreFoundationLibrary)]
+ [LibraryImport(Interop.Libraries.CoreFoundationLibrary)]
internal static partial void CFRunLoopAddSource(CFRunLoopRef rl, CFRunLoopSourceRef source, CFStringRef mode);
/// <summary>
/// <param name="rl">The run loop to modify.</param>
/// <param name="source">The run loop source to remove.</param>
/// <param name="mode">The run loop mode of rl from which to remove source.</param>
- [GeneratedDllImport(Interop.Libraries.CoreFoundationLibrary)]
+ [LibraryImport(Interop.Libraries.CoreFoundationLibrary)]
internal static partial void CFRunLoopRemoveSource(CFRunLoopRef rl, CFRunLoopSourceRef source, CFStringRef mode);
/// <summary>
/// Invalidates a CFRunLoopSource object, stopping it from ever firing again.
/// </summary>
/// <param name="source">The run loop source to invalidate.</param>
- [GeneratedDllImport(Interop.Libraries.CoreFoundationLibrary)]
+ [LibraryImport(Interop.Libraries.CoreFoundationLibrary)]
internal static partial void CFRunLoopSourceInvalidate(CFRunLoopSourceRef source);
/// <summary>
/// waiting for a source or timer to become ready to fire;
/// false if rl either is not running or is currently processing
/// a source, timer, or observer.</returns>
- [GeneratedDllImport(Interop.Libraries.CoreFoundationLibrary)]
+ [LibraryImport(Interop.Libraries.CoreFoundationLibrary)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool CFRunLoopIsWaiting(CFRunLoopRef rl);
}
/// Pass null if no callouts are desired.</param>
/// <param name="context">The context associated with the callout.</param>
/// <returns>A reference to the new dynamic store session.</returns>
- [GeneratedDllImport(Libraries.SystemConfigurationLibrary)]
+ [LibraryImport(Libraries.SystemConfigurationLibrary)]
private static unsafe partial SafeCreateHandle SCDynamicStoreCreate(
IntPtr allocator,
CFStringRef name,
/// <param name="serviceID">The service ID or a regular expression pattern.</param>
/// <param name="entity">The specific global entity, such as IPv4 or DNS.</param>
/// <returns>A string containing the formatted key.</returns>
- [GeneratedDllImport(Libraries.SystemConfigurationLibrary)]
+ [LibraryImport(Libraries.SystemConfigurationLibrary)]
private static partial SafeCreateHandle SCDynamicStoreKeyCreateNetworkServiceEntity(
IntPtr allocator,
CFStringRef domain,
/// <param name="order">The order in which the sources that are ready to be processed are handled,
/// on platforms that support it and for source versions that support it.</param>
/// <returns>The new run loop source object.</returns>
- [GeneratedDllImport(Libraries.SystemConfigurationLibrary)]
+ [LibraryImport(Libraries.SystemConfigurationLibrary)]
private static partial SafeCreateHandle SCDynamicStoreCreateRunLoopSource(
IntPtr allocator,
SCDynamicStoreRef store,
/// <param name="patterns">An array of POSIX regex pattern strings used to match keys to be monitored,
/// or IntPtr.Zero if no key patterns are to be monitored.</param>
/// <returns>Non-zero if the set of notification keys and patterns was successfully updated; zero otherwise.</returns>
- [GeneratedDllImport(Libraries.SystemConfigurationLibrary)]
+ [LibraryImport(Libraries.SystemConfigurationLibrary)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool SCDynamicStoreSetNotificationKeys(SCDynamicStoreRef store, CFArrayRef keys, CFArrayRef patterns);
}
public const uint ATTR_CMN_CRTIME = 0x00000200;
}
- [GeneratedDllImport(Libraries.libc, EntryPoint = "setattrlist", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
+ [LibraryImport(Libraries.libc, EntryPoint = "setattrlist", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
internal static unsafe partial int setattrlist(string path, AttrList* attrList, void* attrBuf, nint attrBufSize, CULong options);
internal const uint FSOPT_NOFOLLOW = 0x00000001;
public nint patchVersion;
}
- [GeneratedDllImport(Libraries.libobjc, StringMarshalling = StringMarshalling.Utf8)]
+ [LibraryImport(Libraries.libobjc, StringMarshalling = StringMarshalling.Utf8)]
private static partial IntPtr objc_getClass(string className);
- [GeneratedDllImport(Libraries.libobjc, StringMarshalling = StringMarshalling.Utf8)]
+ [LibraryImport(Libraries.libobjc, StringMarshalling = StringMarshalling.Utf8)]
private static partial IntPtr sel_getUid(string selector);
- [GeneratedDllImport(Libraries.libobjc, EntryPoint = "objc_msgSend")]
+ [LibraryImport(Libraries.libobjc, EntryPoint = "objc_msgSend")]
private static partial IntPtr intptr_objc_msgSend(IntPtr basePtr, IntPtr selector);
internal static Version GetOperatingSystemVersion()
return new Version(major, minor, patch);
}
- [GeneratedDllImport(Libraries.libobjc, EntryPoint = "objc_msgSend")]
+ [LibraryImport(Libraries.libobjc, EntryPoint = "objc_msgSend")]
private static partial NSOperatingSystemVersion NSOperatingSystemVersion_objc_msgSend(IntPtr basePtr, IntPtr selector);
- [GeneratedDllImport(Libraries.libobjc, EntryPoint = "objc_msgSend_stret")]
+ [LibraryImport(Libraries.libobjc, EntryPoint = "objc_msgSend_stret")]
private static partial void NSOperatingSystemVersion_objc_msgSend_stret(out NSOperatingSystemVersion osVersion, IntPtr basePtr, IntPtr selector);
}
}
/// the data is valid. If the sizes do not match then the data is invalid, most likely due
/// to not having enough permissions to query for the data of that specific process
/// </returns>
- [GeneratedDllImport(Interop.Libraries.libproc, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.libproc, SetLastError = true)]
private static unsafe partial int proc_pidinfo(
int pid,
int flavor,
/// <param name="pBuffer">A pointer to the memory block where the PID array will start</param>
/// <param name="buffersize">The length of the block of memory allocated for the PID array</param>
/// <returns>Returns the number of elements (PIDs) in the buffer</returns>
- [GeneratedDllImport(Interop.Libraries.libproc, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.libproc, SetLastError = true)]
private static unsafe partial int proc_listallpids(
int* pBuffer,
int buffersize);
/// the data is valid. If the sizes do not match then the data is invalid, most likely due
/// to not having enough permissions to query for the data of that specific process
/// </returns>
- [GeneratedDllImport(Interop.Libraries.libproc, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.libproc, SetLastError = true)]
private static unsafe partial int proc_pidinfo(
int pid,
int flavor,
/// the data is valid. If the sizes do not match then the data is invalid, most likely due
/// to not having enough permissions to query for the data of that specific process
/// </returns>
- [GeneratedDllImport(Interop.Libraries.libproc, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.libproc, SetLastError = true)]
private static unsafe partial int proc_pidinfo(
int pid,
int flavor,
/// the data is valid. If the sizes do not match then the data is invalid, most likely due
/// to not having enough permissions to query for the data of that specific process
/// </returns>
- [GeneratedDllImport(Interop.Libraries.libproc, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.libproc, SetLastError = true)]
private static unsafe partial int proc_pidinfo(
int pid,
int flavor,
/// <param name="buffer">A pointer to an allocated block of memory that will be filled with the process path</param>
/// <param name="bufferSize">The size of the buffer, should be PROC_PIDPATHINFO_MAXSIZE</param>
/// <returns>Returns the length of the path returned on success</returns>
- [GeneratedDllImport(Interop.Libraries.libproc, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.libproc, SetLastError = true)]
private static unsafe partial int proc_pidpath(
int pid,
byte* buffer,
/// <param name="flavor">Specifies the type of struct that is passed in to <paramref>buffer</paramref>. Should be RUSAGE_INFO_V3 to specify a rusage_info_v3 struct.</param>
/// <param name="buffer">A buffer to be filled with rusage_info data</param>
/// <returns>Returns 0 on success; on fail, -1 and errno is set with the error code</returns>
- [GeneratedDllImport(Interop.Libraries.libproc, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.libproc, SetLastError = true)]
private static unsafe partial int proc_pid_rusage(
int pid,
int flavor,
{
internal static partial class Sys
{
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_CreateAutoreleasePool")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_CreateAutoreleasePool")]
internal static partial IntPtr CreateAutoreleasePool();
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_DrainAutoreleasePool")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_DrainAutoreleasePool")]
internal static partial void DrainAutoreleasePool(IntPtr ptr);
}
}
{
internal static partial class Sys
{
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SearchPath", StringMarshalling = StringMarshalling.Utf8)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_SearchPath", StringMarshalling = StringMarshalling.Utf8)]
internal static partial string? SearchPath(NSSearchPathDirectory folderId);
internal enum NSSearchPathDirectory
{
internal static partial class Sys
{
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SearchPath_TempDirectory", StringMarshalling = StringMarshalling.Utf8)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_SearchPath_TempDirectory", StringMarshalling = StringMarshalling.Utf8)]
internal static partial string SearchPathTempDirectory();
}
}
{
internal static partial class Sys
{
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_iOSSupportVersion", StringMarshalling = StringMarshalling.Utf8)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_iOSSupportVersion", StringMarshalling = StringMarshalling.Utf8)]
internal static partial string iOSSupportVersion();
}
}
{
internal static partial class AppleCrypto
{
- [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_DigestFree")]
+ [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_DigestFree")]
internal static partial void DigestFree(IntPtr handle);
- [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_DigestCreate")]
+ [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_DigestCreate")]
internal static partial SafeDigestCtxHandle DigestCreate(PAL_HashAlgorithm algorithm, out int cbDigest);
internal static int DigestUpdate(SafeDigestCtxHandle ctx, ReadOnlySpan<byte> data) =>
DigestUpdate(ctx, ref MemoryMarshal.GetReference(data), data.Length);
- [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_DigestUpdate")]
+ [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_DigestUpdate")]
private static partial int DigestUpdate(SafeDigestCtxHandle ctx, ref byte pbData, int cbData);
internal static int DigestFinal(SafeDigestCtxHandle ctx, Span<byte> output) =>
DigestFinal(ctx, ref MemoryMarshal.GetReference(output), output.Length);
- [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_DigestFinal")]
+ [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_DigestFinal")]
private static partial int DigestFinal(SafeDigestCtxHandle ctx, ref byte pbOutput, int cbOutput);
internal static int DigestCurrent(SafeDigestCtxHandle ctx, Span<byte> output) =>
DigestCurrent(ctx, ref MemoryMarshal.GetReference(output), output.Length);
- [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_DigestCurrent")]
+ [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_DigestCurrent")]
private static partial int DigestCurrent(SafeDigestCtxHandle ctx, ref byte pbOutput, int cbOutput);
- [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_DigestOneShot")]
+ [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_DigestOneShot")]
internal static unsafe partial int DigestOneShot(PAL_HashAlgorithm algorithm, byte* pbData, int cbData, byte* pbOutput, int cbOutput, int* cbDigest);
- [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_DigestReset")]
+ [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_DigestReset")]
internal static partial int DigestReset(SafeDigestCtxHandle ctx);
}
}
{
internal static partial class AppleCrypto
{
- [GeneratedDllImport(Libraries.AppleCryptoNative)]
+ [LibraryImport(Libraries.AppleCryptoNative)]
private static partial int AppleCryptoNative_EccGenerateKey(
int keySizeInBits,
out SafeSecKeyRefHandle pPublicKey,
out SafeSecKeyRefHandle pPrivateKey,
out SafeCFErrorHandle pErrorOut);
- [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_EccGetKeySizeInBits")]
+ [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_EccGetKeySizeInBits")]
internal static partial long EccGetKeySizeInBits(SafeSecKeyRefHandle publicKey);
internal static void EccGenerateKey(
{
internal static partial class AppleCrypto
{
- [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_HmacFree")]
+ [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_HmacFree")]
internal static partial void HmacFree(IntPtr handle);
- [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_HmacCreate")]
+ [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_HmacCreate")]
internal static partial SafeHmacHandle HmacCreate(PAL_HashAlgorithm algorithm, ref int cbDigest);
- [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_HmacInit")]
+ [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_HmacInit")]
private static unsafe partial int HmacInit(SafeHmacHandle ctx, byte* pbKey, int cbKey);
internal static unsafe int HmacInit(SafeHmacHandle ctx, ReadOnlySpan<byte> key)
internal static int HmacUpdate(SafeHmacHandle ctx, ReadOnlySpan<byte> data) =>
HmacUpdate(ctx, ref MemoryMarshal.GetReference(data), data.Length);
- [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_HmacUpdate")]
+ [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_HmacUpdate")]
private static partial int HmacUpdate(SafeHmacHandle ctx, ref byte pbData, int cbData);
internal static int HmacFinal(SafeHmacHandle ctx, ReadOnlySpan<byte> output) =>
HmacFinal(ctx, ref MemoryMarshal.GetReference(output), output.Length);
- [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_HmacFinal")]
+ [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_HmacFinal")]
private static partial int HmacFinal(SafeHmacHandle ctx, ref byte pbOutput, int cbOutput);
internal static int HmacCurrent(SafeHmacHandle ctx, ReadOnlySpan<byte> output) =>
HmacCurrent(ctx, ref MemoryMarshal.GetReference(output), output.Length);
- [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_HmacCurrent")]
+ [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_HmacCurrent")]
private static partial int HmacCurrent(SafeHmacHandle ctx, ref byte pbOutput, int cbOutput);
- [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_HmacOneShot")]
+ [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_HmacOneShot")]
internal static unsafe partial int HmacOneShot(
PAL_HashAlgorithm algorithm,
byte* pKey,
{
internal static partial class AppleCrypto
{
- [GeneratedDllImport(Libraries.AppleCryptoNative)]
+ [LibraryImport(Libraries.AppleCryptoNative)]
private static partial int AppleCryptoNative_EcdhKeyAgree(
SafeSecKeyRefHandle privateKey,
SafeSecKeyRefHandle publicKey,
{
internal static partial class AppleCrypto
{
- [GeneratedDllImport(Libraries.AppleCryptoNative)]
+ [LibraryImport(Libraries.AppleCryptoNative)]
private static partial int AppleCryptoNative_SecKeychainEnumerateCerts(
out SafeCFArrayHandle matches);
- [GeneratedDllImport(Libraries.AppleCryptoNative)]
+ [LibraryImport(Libraries.AppleCryptoNative)]
private static partial int AppleCryptoNative_SecKeychainEnumerateIdentities(
out SafeCFArrayHandle matches);
- [GeneratedDllImport(Libraries.AppleCryptoNative)]
+ [LibraryImport(Libraries.AppleCryptoNative)]
private static partial int AppleCryptoNative_X509StoreAddCertificate(
SafeHandle certOrIdentity);
- [GeneratedDllImport(Libraries.AppleCryptoNative)]
+ [LibraryImport(Libraries.AppleCryptoNative)]
private static partial int AppleCryptoNative_X509StoreRemoveCertificate(
SafeHandle certOrIdentity,
[MarshalAs(UnmanagedType.Bool)] bool isReadOnlyMode);
{
internal static partial class AppleCrypto
{
- [GeneratedDllImport(Libraries.AppleCryptoNative)]
+ [LibraryImport(Libraries.AppleCryptoNative)]
private static partial int AppleCryptoNative_SecKeychainItemCopyKeychain(
IntPtr item,
out SafeKeychainHandle keychain);
- [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_SecKeychainCreate", StringMarshalling = StringMarshalling.Utf8)]
+ [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_SecKeychainCreate", StringMarshalling = StringMarshalling.Utf8)]
private static unsafe partial int AppleCryptoNative_SecKeychainCreateTemporary(
string path,
int utf8PassphraseLength,
byte* utf8Passphrase,
out SafeTemporaryKeychainHandle keychain);
- [GeneratedDllImport(Libraries.AppleCryptoNative, StringMarshalling = StringMarshalling.Utf8)]
+ [LibraryImport(Libraries.AppleCryptoNative, StringMarshalling = StringMarshalling.Utf8)]
private static partial int AppleCryptoNative_SecKeychainCreate(
string path,
int utf8PassphraseLength,
byte[] utf8Passphrase,
out SafeKeychainHandle keychain);
- [GeneratedDllImport(Libraries.AppleCryptoNative)]
+ [LibraryImport(Libraries.AppleCryptoNative)]
private static partial int AppleCryptoNative_SecKeychainDelete(IntPtr keychain);
- [GeneratedDllImport(Libraries.AppleCryptoNative)]
+ [LibraryImport(Libraries.AppleCryptoNative)]
private static partial int AppleCryptoNative_SecKeychainCopyDefault(out SafeKeychainHandle keychain);
- [GeneratedDllImport(Libraries.AppleCryptoNative, StringMarshalling = StringMarshalling.Utf8)]
+ [LibraryImport(Libraries.AppleCryptoNative, StringMarshalling = StringMarshalling.Utf8)]
private static partial int AppleCryptoNative_SecKeychainOpen(
string keychainPath,
out SafeKeychainHandle keychain);
- [GeneratedDllImport(Libraries.AppleCryptoNative)]
+ [LibraryImport(Libraries.AppleCryptoNative)]
private static partial int AppleCryptoNative_SecKeychainUnlock(
SafeKeychainHandle keychain,
int utf8PassphraseLength,
byte[] utf8Passphrase);
- [GeneratedDllImport(Libraries.AppleCryptoNative)]
+ [LibraryImport(Libraries.AppleCryptoNative)]
private static partial int AppleCryptoNative_SetKeychainNeverLock(SafeKeychainHandle keychain);
- [GeneratedDllImport(Libraries.AppleCryptoNative)]
+ [LibraryImport(Libraries.AppleCryptoNative)]
private static partial int AppleCryptoNative_SecKeychainEnumerateCerts(
SafeKeychainHandle keychain,
out SafeCFArrayHandle matches,
out int pOSStatus);
- [GeneratedDllImport(Libraries.AppleCryptoNative)]
+ [LibraryImport(Libraries.AppleCryptoNative)]
private static partial int AppleCryptoNative_SecKeychainEnumerateIdentities(
SafeKeychainHandle keychain,
out SafeCFArrayHandle matches,
out int pOSStatus);
- [GeneratedDllImport(Libraries.AppleCryptoNative)]
+ [LibraryImport(Libraries.AppleCryptoNative)]
private static partial int AppleCryptoNative_X509StoreAddCertificate(
SafeKeychainItemHandle cert,
SafeKeychainHandle keychain,
out int pOSStatus);
- [GeneratedDllImport(Libraries.AppleCryptoNative)]
+ [LibraryImport(Libraries.AppleCryptoNative)]
private static partial int AppleCryptoNative_X509StoreRemoveCertificate(
SafeKeychainItemHandle cert,
SafeKeychainHandle keychain,
}
}
- [GeneratedDllImport(Libraries.AppleCryptoNative)]
+ [LibraryImport(Libraries.AppleCryptoNative)]
private static unsafe partial int AppleCryptoNative_Pbkdf2(
PAL_HashAlgorithm prfAlgorithm,
byte* password,
{
internal static partial class AppleCrypto
{
- [GeneratedDllImport(Libraries.AppleCryptoNative)]
+ [LibraryImport(Libraries.AppleCryptoNative)]
private static partial int AppleCryptoNative_RsaGenerateKey(
int keySizeInBits,
out SafeSecKeyRefHandle pPublicKey,
out SafeSecKeyRefHandle pPrivateKey,
out SafeCFErrorHandle pErrorOut);
- [GeneratedDllImport(Libraries.AppleCryptoNative)]
+ [LibraryImport(Libraries.AppleCryptoNative)]
private static partial int AppleCryptoNative_RsaSignaturePrimitive(
SafeSecKeyRefHandle privateKey,
ref byte pbData,
out SafeCFDataHandle pDataOut,
out SafeCFErrorHandle pErrorOut);
- [GeneratedDllImport(Libraries.AppleCryptoNative)]
+ [LibraryImport(Libraries.AppleCryptoNative)]
private static partial int AppleCryptoNative_RsaVerificationPrimitive(
SafeSecKeyRefHandle publicKey,
ref byte pbData,
out SafeCFDataHandle pDataOut,
out SafeCFErrorHandle pErrorOut);
- [GeneratedDllImport(Libraries.AppleCryptoNative)]
+ [LibraryImport(Libraries.AppleCryptoNative)]
private static partial int AppleCryptoNative_RsaEncryptionPrimitive(
SafeSecKeyRefHandle publicKey,
ref byte pbData,
out SafeCFErrorHandle pErrorOut) =>
RsaEncryptOaep(publicKey, ref MemoryMarshal.GetReference(pbData), cbData, mgfAlgorithm, out pEncryptedOut, out pErrorOut);
- [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_RsaEncryptOaep")]
+ [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_RsaEncryptOaep")]
private static partial int RsaEncryptOaep(
SafeSecKeyRefHandle publicKey,
ref byte pbData,
out SafeCFErrorHandle pErrorOut) =>
RsaEncryptPkcs(publicKey, ref MemoryMarshal.GetReference(pbData), cbData, out pEncryptedOut, out pErrorOut);
- [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_RsaEncryptPkcs")]
+ [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_RsaEncryptPkcs")]
private static partial int RsaEncryptPkcs(
SafeSecKeyRefHandle publicKey,
ref byte pbData,
out SafeCFErrorHandle pErrorOut) =>
RsaDecryptOaep(publicKey, ref MemoryMarshal.GetReference(pbData), cbData, mgfAlgorithm, out pEncryptedOut, out pErrorOut);
- [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_RsaDecryptOaep")]
+ [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_RsaDecryptOaep")]
private static partial int RsaDecryptOaep(
SafeSecKeyRefHandle publicKey,
ref byte pbData,
out SafeCFErrorHandle pErrorOut) =>
RsaDecryptPkcs(publicKey, ref MemoryMarshal.GetReference(pbData), cbData, out pEncryptedOut, out pErrorOut);
- [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_RsaDecryptPkcs")]
+ [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_RsaDecryptPkcs")]
private static partial int RsaDecryptPkcs(
SafeSecKeyRefHandle publicKey,
ref byte pbData,
}
}
- [GeneratedDllImport(Libraries.AppleCryptoNative)]
+ [LibraryImport(Libraries.AppleCryptoNative)]
private static unsafe partial int AppleCryptoNative_GetRandomBytes(byte* buf, int num, int* errorCode);
}
}
{
internal static partial class AppleCrypto
{
- [GeneratedDllImport(Libraries.AppleCryptoNative)]
+ [LibraryImport(Libraries.AppleCryptoNative)]
private static partial SafeCFStringHandle AppleCryptoNative_SecCopyErrorMessageString(int osStatus);
internal static string? GetSecErrorString(int osStatus)
RSA = 2,
}
- [GeneratedDllImport(Libraries.AppleCryptoNative)]
+ [LibraryImport(Libraries.AppleCryptoNative)]
private static partial ulong AppleCryptoNative_SecKeyGetSimpleKeySizeInBytes(SafeSecKeyRefHandle publicKey);
private delegate int SecKeyTransform(ReadOnlySpan<byte> source, out SafeCFDataHandle outputHandle, out SafeCFErrorHandle errorHandle);
}
}
- [GeneratedDllImport(Libraries.AppleCryptoNative)]
+ [LibraryImport(Libraries.AppleCryptoNative)]
private static unsafe partial int AppleCryptoNative_SecKeyCreateWithData(
byte* pKey,
int cbKey,
out SafeSecKeyRefHandle pDataKey,
out SafeCFErrorHandle pErrorOut);
- [GeneratedDllImport(Libraries.AppleCryptoNative)]
+ [LibraryImport(Libraries.AppleCryptoNative)]
private static unsafe partial int AppleCryptoNative_SecKeyCopyExternalRepresentation(
SafeSecKeyRefHandle key,
out SafeCFDataHandle pDataOut,
out SafeCFErrorHandle pErrorOut);
- [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_SecKeyCopyPublicKey")]
+ [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_SecKeyCopyPublicKey")]
internal static unsafe partial SafeSecKeyRefHandle CopyPublicKey(SafeSecKeyRefHandle privateKey);
}
}
out ppKeyOut,
out pOSStatus);
- [GeneratedDllImport(Libraries.AppleCryptoNative)]
+ [LibraryImport(Libraries.AppleCryptoNative)]
private static partial int AppleCryptoNative_SecKeyImportEphemeral(
ref byte pbKeyBlob,
int cbKeyBlob,
throw new CryptographicException();
}
- [GeneratedDllImport(Libraries.AppleCryptoNative)]
+ [LibraryImport(Libraries.AppleCryptoNative)]
private static partial int AppleCryptoNative_SecKeyExport(
SafeSecKeyRefHandle? key,
int exportPrivate,
}
}
- [GeneratedDllImport(Libraries.AppleCryptoNative)]
+ [LibraryImport(Libraries.AppleCryptoNative)]
private static unsafe partial int AppleCryptoNative_SecKeyVerifySignature(
SafeSecKeyRefHandle publicKey,
byte* pbDataHash,
}
}
- [GeneratedDllImport(Libraries.AppleCryptoNative)]
+ [LibraryImport(Libraries.AppleCryptoNative)]
private static unsafe partial int AppleCryptoNative_SecKeyCreateSignature(
SafeSecKeyRefHandle privateKey,
byte* pbDataHash,
Renegotiate,
}
- [GeneratedDllImport(Interop.Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_SslCreateContext")]
+ [LibraryImport(Interop.Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_SslCreateContext")]
internal static partial System.Net.SafeSslHandle SslCreateContext(int isServer);
- [GeneratedDllImport(Interop.Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_SslSetConnection")]
+ [LibraryImport(Interop.Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_SslSetConnection")]
internal static partial int SslSetConnection(
SafeSslHandle sslHandle,
IntPtr sslConnection);
- [GeneratedDllImport(Interop.Libraries.AppleCryptoNative)]
+ [LibraryImport(Interop.Libraries.AppleCryptoNative)]
private static partial int AppleCryptoNative_SslSetMinProtocolVersion(
SafeSslHandle sslHandle,
SslProtocols minProtocolId);
- [GeneratedDllImport(Interop.Libraries.AppleCryptoNative)]
+ [LibraryImport(Interop.Libraries.AppleCryptoNative)]
private static partial int AppleCryptoNative_SslSetMaxProtocolVersion(
SafeSslHandle sslHandle,
SslProtocols maxProtocolId);
- [GeneratedDllImport(Interop.Libraries.AppleCryptoNative)]
+ [LibraryImport(Interop.Libraries.AppleCryptoNative)]
private static partial int AppleCryptoNative_SslCopyCertChain(
SafeSslHandle sslHandle,
out SafeX509ChainHandle pTrustOut,
out int pOSStatus);
- [GeneratedDllImport(Interop.Libraries.AppleCryptoNative)]
+ [LibraryImport(Interop.Libraries.AppleCryptoNative)]
private static partial int AppleCryptoNative_SslCopyCADistinguishedNames(
SafeSslHandle sslHandle,
out SafeCFArrayHandle pArrayOut,
out int pOSStatus);
- [GeneratedDllImport(Interop.Libraries.AppleCryptoNative)]
+ [LibraryImport(Interop.Libraries.AppleCryptoNative)]
private static partial int AppleCryptoNative_SslSetBreakOnServerAuth(
SafeSslHandle sslHandle,
int setBreak,
out int pOSStatus);
- [GeneratedDllImport(Interop.Libraries.AppleCryptoNative)]
+ [LibraryImport(Interop.Libraries.AppleCryptoNative)]
private static partial int AppleCryptoNative_SslSetBreakOnClientAuth(
SafeSslHandle sslHandle,
int setBreak,
out int pOSStatus);
- [GeneratedDllImport(Interop.Libraries.AppleCryptoNative)]
+ [LibraryImport(Interop.Libraries.AppleCryptoNative)]
private static partial int AppleCryptoNative_SslSetBreakOnCertRequested(
SafeSslHandle sslHandle,
int setBreak,
out int pOSStatus);
- [GeneratedDllImport(Interop.Libraries.AppleCryptoNative)]
+ [LibraryImport(Interop.Libraries.AppleCryptoNative)]
private static partial int AppleCryptoNative_SslSetCertificate(
SafeSslHandle sslHandle,
SafeCreateHandle cfCertRefs);
- [GeneratedDllImport(Interop.Libraries.AppleCryptoNative, StringMarshalling = StringMarshalling.Utf8)]
+ [LibraryImport(Interop.Libraries.AppleCryptoNative, StringMarshalling = StringMarshalling.Utf8)]
private static partial int AppleCryptoNative_SslSetTargetName(
SafeSslHandle sslHandle,
string targetName,
int cbTargetName,
out int osStatus);
- [GeneratedDllImport(Interop.Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_SSLSetALPNProtocols")]
+ [LibraryImport(Interop.Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_SSLSetALPNProtocols")]
internal static partial int SSLSetALPNProtocols(SafeSslHandle ctx, SafeCreateHandle cfProtocolsRefs, out int osStatus);
- [GeneratedDllImport(Interop.Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_SslGetAlpnSelected")]
+ [LibraryImport(Interop.Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_SslGetAlpnSelected")]
internal static partial int SslGetAlpnSelected(SafeSslHandle ssl, out SafeCFDataHandle protocol);
- [GeneratedDllImport(Interop.Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_SslHandshake")]
+ [LibraryImport(Interop.Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_SslHandshake")]
internal static partial PAL_TlsHandshakeState SslHandshake(SafeSslHandle sslHandle);
- [GeneratedDllImport(Interop.Libraries.AppleCryptoNative)]
+ [LibraryImport(Interop.Libraries.AppleCryptoNative)]
private static partial int AppleCryptoNative_SslSetAcceptClientCert(SafeSslHandle sslHandle);
- [GeneratedDllImport(Interop.Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_SslSetIoCallbacks")]
+ [LibraryImport(Interop.Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_SslSetIoCallbacks")]
internal static unsafe partial int SslSetIoCallbacks(
SafeSslHandle sslHandle,
delegate* unmanaged<IntPtr, byte*, void**, int> readCallback,
delegate* unmanaged<IntPtr, byte*, void**, int> writeCallback);
- [GeneratedDllImport(Interop.Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_SslWrite")]
+ [LibraryImport(Interop.Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_SslWrite")]
internal static unsafe partial PAL_TlsIo SslWrite(SafeSslHandle sslHandle, byte* writeFrom, int count, out int bytesWritten);
- [GeneratedDllImport(Interop.Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_SslRead")]
+ [LibraryImport(Interop.Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_SslRead")]
internal static unsafe partial PAL_TlsIo SslRead(SafeSslHandle sslHandle, byte* writeFrom, int count, out int bytesWritten);
- [GeneratedDllImport(Interop.Libraries.AppleCryptoNative)]
+ [LibraryImport(Interop.Libraries.AppleCryptoNative)]
private static partial int AppleCryptoNative_SslIsHostnameMatch(
SafeSslHandle handle,
SafeCreateHandle cfHostname,
SafeCFDateHandle cfValidTime,
out int pOSStatus);
- [GeneratedDllImport(Interop.Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_SslShutdown")]
+ [LibraryImport(Interop.Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_SslShutdown")]
internal static partial int SslShutdown(SafeSslHandle sslHandle);
- [GeneratedDllImport(Interop.Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_SslGetCipherSuite")]
+ [LibraryImport(Interop.Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_SslGetCipherSuite")]
internal static partial int SslGetCipherSuite(SafeSslHandle sslHandle, out TlsCipherSuite cipherSuite);
- [GeneratedDllImport(Interop.Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_SslGetProtocolVersion")]
+ [LibraryImport(Interop.Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_SslGetProtocolVersion")]
internal static partial int SslGetProtocolVersion(SafeSslHandle sslHandle, out SslProtocols protocol);
- [GeneratedDllImport(Interop.Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_SslSetEnabledCipherSuites")]
+ [LibraryImport(Interop.Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_SslSetEnabledCipherSuites")]
internal static unsafe partial int SslSetEnabledCipherSuites(SafeSslHandle sslHandle, uint* cipherSuites, int numCipherSuites);
- [GeneratedDllImport(Interop.Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_SslSetCertificateAuthorities")]
+ [LibraryImport(Interop.Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_SslSetCertificateAuthorities")]
internal static partial int SslSetCertificateAuthorities(SafeSslHandle sslHandle, SafeCreateHandle certificateOrArray, int replaceExisting);
internal static unsafe void SslSetCertificateAuthorities(SafeSslHandle sslHandle, Span<IntPtr> certificates, bool replaceExisting)
None = 0,
}
- [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_CryptorFree")]
+ [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_CryptorFree")]
internal static partial void CryptorFree(IntPtr handle);
- [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_CryptorCreate")]
+ [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_CryptorCreate")]
internal static unsafe partial int CryptorCreate(
PAL_SymmetricOperation operation,
PAL_SymmetricAlgorithm algorithm,
out SafeAppleCryptorHandle cryptor,
out int ccStatus);
- [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_CryptorUpdate")]
+ [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_CryptorUpdate")]
internal static unsafe partial int CryptorUpdate(
SafeAppleCryptorHandle cryptor,
byte* pbData,
out int cbWritten,
out int ccStatus);
- [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_CryptorFinal")]
+ [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_CryptorFinal")]
internal static unsafe partial int CryptorFinal(
SafeAppleCryptorHandle cryptor,
byte* pbOutput,
out int cbWritten,
out int ccStatus);
- [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_CryptorReset")]
+ [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_CryptorReset")]
internal static unsafe partial int CryptorReset(SafeAppleCryptorHandle cryptor, byte* pbIv, out int ccStatus);
}
}
{
internal static partial class AppleCrypto
{
- [GeneratedDllImport(Libraries.AppleCryptoNative)]
+ [LibraryImport(Libraries.AppleCryptoNative)]
private static partial int AppleCryptoNative_StoreEnumerateUserRoot(
out SafeCFArrayHandle pCertsOut,
out int pOSStatusOut);
- [GeneratedDllImport(Libraries.AppleCryptoNative)]
+ [LibraryImport(Libraries.AppleCryptoNative)]
private static partial int AppleCryptoNative_StoreEnumerateMachineRoot(
out SafeCFArrayHandle pCertsOut,
out int pOSStatusOut);
- [GeneratedDllImport(Libraries.AppleCryptoNative)]
+ [LibraryImport(Libraries.AppleCryptoNative)]
private static partial int AppleCryptoNative_StoreEnumerateUserDisallowed(
out SafeCFArrayHandle pCertsOut,
out int pOSStatusOut);
- [GeneratedDllImport(Libraries.AppleCryptoNative)]
+ [LibraryImport(Libraries.AppleCryptoNative)]
private static partial int AppleCryptoNative_StoreEnumerateMachineDisallowed(
out SafeCFArrayHandle pCertsOut,
out int pOSStatusOut);
{
internal static partial class AppleCrypto
{
- [GeneratedDllImport(Libraries.AppleCryptoNative)]
+ [LibraryImport(Libraries.AppleCryptoNative)]
private static partial int AppleCryptoNative_X509GetRawData(
SafeSecCertificateHandle cert,
out SafeCFDataHandle cfDataOut,
out int pOSStatus);
- [GeneratedDllImport(Libraries.AppleCryptoNative)]
+ [LibraryImport(Libraries.AppleCryptoNative)]
private static partial int AppleCryptoNative_X509GetSubjectSummary(
SafeSecCertificateHandle cert,
out SafeCFStringHandle cfSubjectSummaryOut);
- [GeneratedDllImport(Libraries.AppleCryptoNative)]
+ [LibraryImport(Libraries.AppleCryptoNative)]
private static partial int AppleCryptoNative_X509GetPublicKey(SafeSecCertificateHandle cert, out SafeSecKeyRefHandle publicKey, out int pOSStatus);
internal static X509ContentType X509GetContentType(ReadOnlySpan<byte> data)
=> X509GetContentType(ref MemoryMarshal.GetReference(data), data.Length);
- [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_X509GetContentType")]
+ [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_X509GetContentType")]
private static partial X509ContentType X509GetContentType(ref byte pbData, int cbData);
- [GeneratedDllImport(Libraries.AppleCryptoNative)]
+ [LibraryImport(Libraries.AppleCryptoNative)]
private static partial int AppleCryptoNative_X509CopyCertFromIdentity(
SafeSecIdentityHandle identity,
out SafeSecCertificateHandle cert);
- [GeneratedDllImport(Libraries.AppleCryptoNative)]
+ [LibraryImport(Libraries.AppleCryptoNative)]
private static partial int AppleCryptoNative_X509CopyPrivateKeyFromIdentity(
SafeSecIdentityHandle identity,
out SafeSecKeyRefHandle key);
- [GeneratedDllImport(Libraries.AppleCryptoNative)]
+ [LibraryImport(Libraries.AppleCryptoNative)]
private static partial int AppleCryptoNative_X509DemuxAndRetainHandle(
IntPtr handle,
out SafeSecCertificateHandle certHandle,
out pPrivateKeyOut);
}
- [GeneratedDllImport(Libraries.AppleCryptoNative)]
+ [LibraryImport(Libraries.AppleCryptoNative)]
private static partial int AppleCryptoNative_X509ImportCertificate(
ref byte pbKeyBlob,
int cbKeyBlob,
out SafeSecCertificateHandle pCertOut,
out SafeSecIdentityHandle pPrivateKeyOut);
- [GeneratedDllImport(Libraries.AppleCryptoNative)]
+ [LibraryImport(Libraries.AppleCryptoNative)]
private static partial int AppleCryptoNative_X509ImportCollection(
ref byte pbKeyBlob,
int cbKeyBlob,
out pOSStatus);
}
- [GeneratedDllImport(Libraries.AppleCryptoNative)]
+ [LibraryImport(Libraries.AppleCryptoNative)]
private static partial int AppleCryptoNative_X509ImportCertificate(
ref byte pbKeyBlob,
int cbKeyBlob,
out SafeSecIdentityHandle pPrivateKeyOut,
out int pOSStatus);
- [GeneratedDllImport(Libraries.AppleCryptoNative)]
+ [LibraryImport(Libraries.AppleCryptoNative)]
private static partial int AppleCryptoNative_X509ImportCollection(
ref byte pbKeyBlob,
int cbKeyBlob,
out SafeCFArrayHandle pCollectionOut,
out int pOSStatus);
- [GeneratedDllImport(Libraries.AppleCryptoNative)]
+ [LibraryImport(Libraries.AppleCryptoNative)]
private static partial int AppleCryptoNative_X509ExportData(
SafeCreateHandle data,
X509ContentType type,
out SafeCFDataHandle pExportOut,
out int pOSStatus);
- [GeneratedDllImport(Libraries.AppleCryptoNative)]
+ [LibraryImport(Libraries.AppleCryptoNative)]
private static partial int AppleCryptoNative_X509CopyWithPrivateKey(
SafeSecCertificateHandle certHandle,
SafeSecKeyRefHandle privateKeyHandle,
out SafeSecIdentityHandle pIdentityHandleOut,
out int pOSStatus);
- [GeneratedDllImport(Libraries.AppleCryptoNative)]
+ [LibraryImport(Libraries.AppleCryptoNative)]
private static partial int AppleCryptoNative_X509MoveToKeychain(
SafeSecCertificateHandle certHandle,
SafeKeychainHandle targetKeychain,
{
internal static partial class AppleCrypto
{
- [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_X509ChainCreateDefaultPolicy")]
+ [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_X509ChainCreateDefaultPolicy")]
internal static partial SafeCreateHandle X509ChainCreateDefaultPolicy();
- [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_X509ChainCreateRevocationPolicy")]
+ [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_X509ChainCreateRevocationPolicy")]
internal static partial SafeCreateHandle X509ChainCreateRevocationPolicy();
- [GeneratedDllImport(Libraries.AppleCryptoNative)]
+ [LibraryImport(Libraries.AppleCryptoNative)]
internal static partial int AppleCryptoNative_X509ChainCreate(
SafeCreateHandle certs,
SafeCreateHandle policies,
out SafeX509ChainHandle pTrustOut,
out int pOSStatus);
- [GeneratedDllImport(Libraries.AppleCryptoNative)]
+ [LibraryImport(Libraries.AppleCryptoNative)]
internal static partial int AppleCryptoNative_X509ChainEvaluate(
SafeX509ChainHandle chain,
SafeCFDateHandle cfEvaluationTime,
[MarshalAs(UnmanagedType.Bool)] bool allowNetwork,
out int pOSStatus);
- [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_X509ChainGetChainSize")]
+ [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_X509ChainGetChainSize")]
internal static partial long X509ChainGetChainSize(SafeX509ChainHandle chain);
- [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_X509ChainGetCertificateAtIndex")]
+ [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_X509ChainGetCertificateAtIndex")]
internal static partial IntPtr X509ChainGetCertificateAtIndex(SafeX509ChainHandle chain, long index);
- [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_X509ChainGetTrustResults")]
+ [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_X509ChainGetTrustResults")]
internal static partial SafeCreateHandle X509ChainGetTrustResults(SafeX509ChainHandle chain);
- [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_X509ChainGetStatusAtIndex")]
+ [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_X509ChainGetStatusAtIndex")]
internal static partial int X509ChainGetStatusAtIndex(SafeCreateHandle trustResults, long index, out int pdwStatus);
- [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_GetOSStatusForChainStatus")]
+ [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_GetOSStatusForChainStatus")]
internal static partial int GetOSStatusForChainStatus(X509ChainStatusFlags flag);
- [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_X509ChainSetTrustAnchorCertificates")]
+ [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_X509ChainSetTrustAnchorCertificates")]
internal static partial int X509ChainSetTrustAnchorCertificates(SafeX509ChainHandle chain, SafeCreateHandle anchorCertificates);
}
}
/// <returns>
/// true if the process status was read; otherwise, false.
/// </returns>
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_ReadProcessStatusInfo", SetLastError = true)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_ReadProcessStatusInfo", SetLastError = true)]
private static unsafe partial bool TryReadProcessStatusInfo(int pid, ProcessStatusInfo* processStatus);
internal struct ProcessStatusInfo
}
#if SERIAL_PORTS
- [GeneratedDllImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_ConvertErrorPlatformToPal")]
+ [LibraryImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_ConvertErrorPlatformToPal")]
internal static partial Error ConvertErrorPlatformToPal(int platformErrno);
- [GeneratedDllImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_ConvertErrorPalToPlatform")]
+ [LibraryImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_ConvertErrorPalToPlatform")]
internal static partial int ConvertErrorPalToPlatform(Error error);
- [GeneratedDllImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_StrErrorR")]
+ [LibraryImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_StrErrorR")]
private static unsafe partial byte* StrErrorR(int platformErrno, byte* buffer, int bufferSize);
#else
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_ConvertErrorPlatformToPal")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_ConvertErrorPlatformToPal")]
[SuppressGCTransition]
internal static partial Error ConvertErrorPlatformToPal(int platformErrno);
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_ConvertErrorPalToPlatform")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_ConvertErrorPalToPlatform")]
[SuppressGCTransition]
internal static partial int ConvertErrorPalToPlatform(Error error);
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_StrErrorR")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_StrErrorR")]
private static unsafe partial byte* StrErrorR(int platformErrno, byte* buffer, int bufferSize);
#endif
}
{
internal static partial class Serial
{
- [GeneratedDllImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_SerialPortOpen", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
+ [LibraryImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_SerialPortOpen", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
internal static partial SafeSerialDeviceHandle SerialPortOpen(string name);
- [GeneratedDllImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_SerialPortClose", SetLastError = true)]
+ [LibraryImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_SerialPortClose", SetLastError = true)]
internal static partial int SerialPortClose(IntPtr handle);
- [GeneratedDllImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_Shutdown")]
+ [LibraryImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_Shutdown")]
internal static partial Error Shutdown(IntPtr socket, SocketShutdown how);
/// <summary>
/// Returns the number of bytes read on success; otherwise, -1 is returned
/// Note - on fail. the position of the stream may change depending on the platform; consult man 2 read for more info
/// </returns>
- [GeneratedDllImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_Read", SetLastError = true)]
+ [LibraryImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_Read", SetLastError = true)]
internal static unsafe partial int Read(SafeHandle fd, byte* buffer, int count);
/// <summary>
/// <returns>
/// Returns the number of bytes written on success; otherwise, returns -1 and sets errno
/// </returns>
- [GeneratedDllImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_Write", SetLastError = true)]
+ [LibraryImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_Write", SetLastError = true)]
internal static unsafe partial int Write(SafeHandle fd, byte* buffer, int bufferSize);
/// <summary>
/// <param name="timeout">The amount of time to wait; -1 for infinite, 0 for immediate return, and a positive number is the number of milliseconds</param>
/// <param name="triggered">The number of events triggered (i.e. the number of entries in pollEvents with a non-zero TriggeredEvents). May be zero in the event of a timeout.</param>
/// <returns>An error or Error.SUCCESS.</returns>
- [GeneratedDllImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_Poll")]
+ [LibraryImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_Poll")]
private static unsafe partial Error Poll(PollEvent* pollEvents, uint eventCount, int timeout, uint* triggered);
/// <summary>
SendQueue = 2,
}
- [GeneratedDllImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_TermiosReset", SetLastError = true)]
+ [LibraryImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_TermiosReset", SetLastError = true)]
internal static partial int TermiosReset(SafeSerialDeviceHandle handle, int speed, int data, StopBits stop, Parity parity, Handshake flow);
- [GeneratedDllImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_TermiosGetSignal", SetLastError = true)]
+ [LibraryImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_TermiosGetSignal", SetLastError = true)]
internal static partial int TermiosGetSignal(SafeSerialDeviceHandle handle, Signals signal);
- [GeneratedDllImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_TermiosSetSignal", SetLastError = true)]
+ [LibraryImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_TermiosSetSignal", SetLastError = true)]
internal static partial int TermiosGetSignal(SafeSerialDeviceHandle handle, Signals signal, int set);
- [GeneratedDllImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_TermiosGetAllSignals")]
+ [LibraryImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_TermiosGetAllSignals")]
internal static partial Signals TermiosGetAllSignals(SafeSerialDeviceHandle handle);
- [GeneratedDllImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_TermiosSetSpeed", SetLastError = true)]
+ [LibraryImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_TermiosSetSpeed", SetLastError = true)]
internal static partial int TermiosSetSpeed(SafeSerialDeviceHandle handle, int speed);
- [GeneratedDllImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_TermiosGetSpeed", SetLastError = true)]
+ [LibraryImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_TermiosGetSpeed", SetLastError = true)]
internal static partial int TermiosGetSpeed(SafeSerialDeviceHandle handle);
- [GeneratedDllImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_TermiosAvailableBytes", SetLastError = true)]
+ [LibraryImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_TermiosAvailableBytes", SetLastError = true)]
internal static partial int TermiosGetAvailableBytes(SafeSerialDeviceHandle handle, [MarshalAs(UnmanagedType.Bool)]bool fromReadBuffer);
- [GeneratedDllImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_TermiosDiscard", SetLastError = true)]
+ [LibraryImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_TermiosDiscard", SetLastError = true)]
internal static partial int TermiosDiscard(SafeSerialDeviceHandle handle, Queue input);
- [GeneratedDllImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_TermiosDrain", SetLastError = true)]
+ [LibraryImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_TermiosDrain", SetLastError = true)]
internal static partial int TermiosDrain(SafeSerialDeviceHandle handle);
- [GeneratedDllImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_TermiosSendBreak", SetLastError = true)]
+ [LibraryImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_TermiosSendBreak", SetLastError = true)]
internal static partial int TermiosSendBreak(SafeSerialDeviceHandle handle, int duration);
}
}
internal unsafe partial class Sys
{
[DoesNotReturn]
- [GeneratedDllImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_Abort")]
+ [LibraryImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_Abort")]
internal static partial void Abort();
}
}
{
internal static partial class Sys
{
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Accept")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_Accept")]
internal static unsafe partial Error Accept(SafeHandle socket, byte* socketAddress, int* socketAddressLen, IntPtr* acceptedFd);
}
}
R_OK = 4, /* Check for read */
}
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Access", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_Access", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
internal static partial int Access(string path, AccessMode mode);
}
}
{
internal static partial class Sys
{
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Bind")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_Bind")]
internal static unsafe partial Error Bind(SafeHandle socket, ProtocolType socketProtocolType, byte* socketAddress, int socketAddressLen);
}
}
{
internal static partial class Sys
{
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_ChDir", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_ChDir", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
internal static partial int ChDir(string path);
}
}
{
internal static partial class Sys
{
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_ChMod", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_ChMod", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
internal static partial int ChMod(string path, int mode);
}
}
{
internal static partial class Sys
{
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Close", SetLastError = true)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_Close", SetLastError = true)]
internal static partial int Close(IntPtr fd);
}
}
{
internal static partial class Sys
{
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_ConfigureTerminalForChildProcess")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_ConfigureTerminalForChildProcess")]
internal static partial void ConfigureTerminalForChildProcess([MarshalAs(UnmanagedType.Bool)] bool childUsesTerminal);
}
}
{
internal static partial class Sys
{
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Connect")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_Connect")]
internal static unsafe partial Error Connect(SafeHandle socket, byte* socketAddress, int socketAddressLen);
}
}
{
internal static partial class Sys
{
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_CopyFile", SetLastError = true)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_CopyFile", SetLastError = true)]
internal static partial int CopyFile(SafeFileHandle source, SafeFileHandle destination, long sourceLength);
}
}
{
internal static partial class Sys
{
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Disconnect")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_Disconnect")]
internal static partial Error Disconnect(IntPtr socket);
}
}
{
internal static partial class Sys
{
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Dup", SetLastError = true)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_Dup", SetLastError = true)]
internal static partial SafeFileHandle Dup(SafeFileHandle oldfd);
}
}
{
internal unsafe partial class Sys
{
- [GeneratedDllImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_LoadLibrary", StringMarshalling = StringMarshalling.Utf8)]
+ [LibraryImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_LoadLibrary", StringMarshalling = StringMarshalling.Utf8)]
internal static partial IntPtr LoadLibrary(string filename);
- [GeneratedDllImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_GetProcAddress")]
+ [LibraryImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_GetProcAddress")]
internal static partial IntPtr GetProcAddress(IntPtr handle, byte* symbol);
- [GeneratedDllImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_GetProcAddress", StringMarshalling = StringMarshalling.Utf8)]
+ [LibraryImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_GetProcAddress", StringMarshalling = StringMarshalling.Utf8)]
internal static partial IntPtr GetProcAddress(IntPtr handle, string symbol);
- [GeneratedDllImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_FreeLibrary")]
+ [LibraryImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_FreeLibrary")]
internal static partial void FreeLibrary(IntPtr handle);
}
}
private fixed byte __padding[3];
}
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_EnumerateInterfaceAddresses")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_EnumerateInterfaceAddresses")]
public static unsafe partial int EnumerateInterfaceAddresses(
void* context,
delegate* unmanaged<void*, byte*, IpAddressInfo*, void> ipv4Found,
delegate* unmanaged<void*, byte*, IpAddressInfo*, uint*, void> ipv6Found,
delegate* unmanaged<void*, byte*, LinkLayerAddressInfo*, void> linkLayerFound);
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_EnumerateGatewayAddressesForInterface")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_EnumerateGatewayAddressesForInterface")]
public static unsafe partial int EnumerateGatewayAddressesForInterface(void* context, uint interfaceIndex, delegate* unmanaged<void*, IpAddressInfo*, void> onGatewayFound);
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetNetworkInterfaces")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetNetworkInterfaces")]
public static unsafe partial int GetNetworkInterfaces(int* count, NetworkInterfaceInfo** addrs, int* addressCount, IpAddressInfo** aa);
}
{
internal unsafe partial class Sys
{
- [GeneratedDllImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_GetErrNo")]
+ [LibraryImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_GetErrNo")]
[SuppressGCTransition]
internal static partial int GetErrNo();
- [GeneratedDllImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_SetErrNo")]
+ [LibraryImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_SetErrNo")]
[SuppressGCTransition]
internal static partial void SetErrNo(int errorCode);
}
internal unsafe partial class Sys
{
[DoesNotReturn]
- [GeneratedDllImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_Exit")]
+ [LibraryImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_Exit")]
internal static partial void Exit(int exitCode);
}
}
/// <summary>
/// Returns -1 on error, 0 on success.
/// </summary>
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_FAllocate", SetLastError = true)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_FAllocate", SetLastError = true)]
internal static partial int FAllocate(SafeFileHandle fd, long offset, long length);
}
}
{
internal static partial class Sys
{
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_FChMod", SetLastError = true)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_FChMod", SetLastError = true)]
internal static partial int FChMod(SafeFileHandle fd, int mode);
}
}
LOCK_UN = 8, /* unlock */
}
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_FLock", SetLastError = true)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_FLock", SetLastError = true)]
internal static partial int FLock(SafeFileHandle fd, LockOperations operation);
/// <summary>
/// Exposing this for SafeFileHandle.ReleaseHandle() to call.
/// Normal callers should use FLock(SafeFileHandle fd).
/// </summary>
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_FLock", SetLastError = true)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_FLock", SetLastError = true)]
internal static partial int FLock(IntPtr fd, LockOperations operation);
}
}
{
internal static partial class Sys
{
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_FSync", SetLastError = true)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_FSync", SetLastError = true)]
internal static partial int FSync(SafeFileHandle fd);
}
}
{
internal static partial class Sys
{
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_FTruncate", SetLastError = true)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_FTruncate", SetLastError = true)]
internal static partial int FTruncate(SafeFileHandle fd, long length);
}
}
{
internal static readonly bool CanGetSetPipeSz = (FcntlCanGetSetPipeSz() != 0);
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_FcntlGetPipeSz", SetLastError=true)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_FcntlGetPipeSz", SetLastError=true)]
internal static partial int GetPipeSz(SafePipeHandle fd);
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_FcntlSetPipeSz", SetLastError=true)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_FcntlSetPipeSz", SetLastError=true)]
internal static partial int SetPipeSz(SafePipeHandle fd, int size);
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_FcntlCanGetSetPipeSz")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_FcntlCanGetSetPipeSz")]
[SuppressGCTransition]
private static partial int FcntlCanGetSetPipeSz();
}
{
internal static partial class Fcntl
{
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_FcntlSetIsNonBlocking", SetLastError = true)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_FcntlSetIsNonBlocking", SetLastError = true)]
internal static partial int DangerousSetIsNonBlocking(IntPtr fd, int isNonBlocking);
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_FcntlSetIsNonBlocking", SetLastError=true)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_FcntlSetIsNonBlocking", SetLastError=true)]
internal static partial int SetIsNonBlocking(SafeHandle fd, int isNonBlocking);
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_FcntlGetIsNonBlocking", SetLastError = true)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_FcntlGetIsNonBlocking", SetLastError = true)]
internal static partial int GetIsNonBlocking(SafeHandle fd, [MarshalAs(UnmanagedType.Bool)] out bool isNonBlocking);
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_FcntlSetFD", SetLastError=true)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_FcntlSetFD", SetLastError=true)]
internal static partial int SetFD(SafeHandle fd, int flags);
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_FcntlGetFD", SetLastError=true)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_FcntlGetFD", SetLastError=true)]
internal static partial int GetFD(SafeHandle fd);
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_FcntlGetFD", SetLastError=true)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_FcntlGetFD", SetLastError=true)]
internal static partial int GetFD(IntPtr fd);
}
}
}
}
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_ForkAndExecProcess", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_ForkAndExecProcess", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
private static unsafe partial int ForkAndExecProcess(
string filename, byte** argv, byte** envp, string? cwd,
int redirectStdin, int redirectStdout, int redirectStderr,
{
internal static partial class Sys
{
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetBytesAvailable")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetBytesAvailable")]
internal static unsafe partial Error GetBytesAvailable(SafeHandle socket, int* available);
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetAtOutOfBandMark")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetAtOutOfBandMark")]
internal static unsafe partial Error GetAtOutOfBandMark(SafeHandle socket, int* atMark);
}
}
{
internal static partial class Sys
{
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetControlCharacters")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetControlCharacters")]
internal static partial void GetControlCharacters(
ControlCharacterNames[] controlCharacterNames, byte[] controlCharacterValues, int controlCharacterLength,
out byte posixDisableValue);
internal ulong lastRecordedUserTime;
}
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetCpuUtilization")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetCpuUtilization")]
internal static partial int GetCpuUtilization(ref ProcessCpuInformation previousCpuInfo);
}
}
{
internal static partial class Sys
{
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetCwd", SetLastError = true)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetCwd", SetLastError = true)]
private static unsafe partial byte* GetCwd(byte* buffer, int bufferLength);
internal static unsafe string GetCwd()
{
internal static partial class Sys
{
- [GeneratedDllImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_GetDefaultTimeZone", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_GetDefaultTimeZone", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
internal static partial string? GetDefaultTimeZone();
}
}
{
internal static partial class Sys
{
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetDomainName")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetDomainName")]
private static unsafe partial int GetDomainName(byte* name, int len);
internal static unsafe string GetDomainName()
{
internal static partial class Sys
{
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetDomainSocketSizes")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetDomainSocketSizes")]
[SuppressGCTransition]
internal static unsafe partial void GetDomainSocketSizes(int* pathOffset, int* pathSize, int* addressSize);
}
{
internal static partial class Sys
{
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetEUid")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetEUid")]
internal static partial uint GetEUid();
}
}
{
internal unsafe partial class Sys
{
- [GeneratedDllImport(Interop.Libraries.SystemNative, StringMarshalling = StringMarshalling.Utf8, EntryPoint = "SystemNative_GetEnv")]
+ [LibraryImport(Interop.Libraries.SystemNative, StringMarshalling = StringMarshalling.Utf8, EntryPoint = "SystemNative_GetEnv")]
internal static unsafe partial IntPtr GetEnv(string name);
}
}
{
internal unsafe partial class Sys
{
- [GeneratedDllImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_GetEnviron")]
+ [LibraryImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_GetEnviron")]
internal static unsafe partial IntPtr GetEnviron();
- [GeneratedDllImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_FreeEnviron")]
+ [LibraryImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_FreeEnviron")]
internal static unsafe partial void FreeEnviron(IntPtr environ);
}
}
} while (true);
}
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetGroupList", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetGroupList", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
private static unsafe partial int GetGroupList(string name, uint group, uint* groups, int* ngroups);
}
}
{
internal static partial class Sys
{
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetHostName", SetLastError = true)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetHostName", SetLastError = true)]
private static unsafe partial int GetHostName(byte* name, int nameLength);
internal static unsafe string GetHostName()
{
internal static partial class Sys
{
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetMaximumAddressSize")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetMaximumAddressSize")]
[SuppressGCTransition]
internal static partial int GetMaximumAddressSize();
}
NI_NUMERICHOST = 0x2,
}
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetNameInfo")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetNameInfo")]
internal static unsafe partial int GetNameInfo(
byte* address,
uint addressLength,
internal static partial class Sys
{
[SuppressGCTransition]
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetOSArchitecture")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetOSArchitecture")]
internal static partial int GetOSArchitecture();
}
}
{
internal static partial class Sys
{
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetPeerID", SetLastError = true)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetPeerID", SetLastError = true)]
internal static partial int GetPeerID(SafeHandle socket, out uint euid);
}
}
{
internal static partial class Sys
{
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetPeerName")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetPeerName")]
internal static unsafe partial Error GetPeerName(SafeHandle socket, byte* socketAddress, int* socketAddressLen);
}
}
{
internal static partial class Sys
{
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetPeerUserName", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetPeerUserName", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
internal static partial string GetPeerUserName(SafeHandle socket);
}
}
{
internal static partial class Sys
{
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetPid")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetPid")]
internal static partial int GetPid();
}
}
/// <summary>
/// Returns the full path to the executable for the current process, resolving symbolic links.
/// </summary>
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetProcessPath", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetProcessPath", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
internal static partial string? GetProcessPath();
}
}
internal byte* Shell;
}
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetPwUidR", SetLastError = false)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetPwUidR", SetLastError = false)]
internal static unsafe partial int GetPwUidR(uint uid, out Passwd pwd, byte* buf, int bufLen);
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetPwNamR", StringMarshalling = StringMarshalling.Utf8, SetLastError = false)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetPwNamR", StringMarshalling = StringMarshalling.Utf8, SetLastError = false)]
internal static unsafe partial int GetPwNamR(string name, out Passwd pwd, byte* buf, int bufLen);
}
}
{
internal static partial class Sys
{
- [GeneratedDllImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_GetNonCryptographicallySecureRandomBytes")]
+ [LibraryImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_GetNonCryptographicallySecureRandomBytes")]
internal static unsafe partial void GetNonCryptographicallySecureRandomBytes(byte* buffer, int length);
- [GeneratedDllImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_GetCryptographicallySecureRandomBytes")]
+ [LibraryImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_GetCryptographicallySecureRandomBytes")]
internal static unsafe partial int GetCryptographicallySecureRandomBytes(byte* buffer, int length);
}
PRIO_USER = 2,
}
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetPriority", SetLastError = true)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetPriority", SetLastError = true)]
private static partial int GetPriority(PriorityWhich which, int who);
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetPriority", SetLastError = true)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetPriority", SetLastError = true)]
internal static partial int SetPriority(PriorityWhich which, int who, int nice);
/// <summary>
{
internal static partial class Sys
{
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetSid")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetSid")]
internal static partial int GetSid(int pid);
}
}
{
internal static partial class Sys
{
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetSockName")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetSockName")]
internal static unsafe partial Error GetSockName(SafeHandle socket, byte* socketAddress, int* socketAddressLen);
}
}
{
internal static partial class Sys
{
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetSockOpt")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetSockOpt")]
internal static unsafe partial Error GetSockOpt(SafeHandle socket, SocketOptionLevel optionLevel, SocketOptionName optionName, byte* optionValue, int* optionLen);
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetSockOpt")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetSockOpt")]
internal static unsafe partial Error GetSockOpt(IntPtr socket, SocketOptionLevel optionLevel, SocketOptionName optionName, byte* optionValue, int* optionLen);
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetRawSockOpt")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetRawSockOpt")]
internal static unsafe partial Error GetRawSockOpt(SafeHandle socket, int optionLevel, int optionName, byte* optionValue, int* optionLen);
}
}
{
internal static partial class Sys
{
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetSocketErrorOption")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetSocketErrorOption")]
internal static unsafe partial Error GetSocketErrorOption(SafeHandle socket, Error* socketError);
}
}
{
internal static partial class Sys
{
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetSocketType")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetSocketType")]
internal static partial Error GetSocketType(SafeSocketHandle socket, out AddressFamily addressFamily, out SocketType socketType, out ProtocolType protocolType, [MarshalAs(UnmanagedType.Bool)] out bool isListening);
}
}
{
internal static partial class Sys
{
- [GeneratedDllImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_GetSystemTimeAsTicks")]
+ [LibraryImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_GetSystemTimeAsTicks")]
[SuppressGCTransition]
internal static partial long GetSystemTimeAsTicks();
}
{
internal static partial class Sys
{
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetTimestamp")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetTimestamp")]
[SuppressGCTransition]
internal static partial ulong GetTimestamp();
}
{
internal static partial class Sys
{
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetUnixName")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetUnixName")]
private static partial IntPtr GetUnixNamePrivate();
internal static string GetUnixName()
{
internal static partial class Sys
{
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetUnixRelease", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetUnixRelease", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
public static partial string GetUnixRelease();
}
}
{
internal static partial class Sys
{
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetUnixVersion", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetUnixVersion", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
private static partial int GetUnixVersion(byte[] version, ref int capacity);
internal static string GetUnixVersion()
internal ushort YPixel;
};
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetWindowSize", SetLastError = true)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetWindowSize", SetLastError = true)]
internal static partial int GetWindowSize(out WinSize winSize);
}
}
internal int IPAddressCount; // Number of IP addresses in the list
}
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetHostEntryForName", StringMarshalling = StringMarshalling.Utf8)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetHostEntryForName", StringMarshalling = StringMarshalling.Utf8)]
internal static unsafe partial int GetHostEntryForName(string address, AddressFamily family, HostEntry* entry);
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_FreeHostEntry")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_FreeHostEntry")]
internal static unsafe partial void FreeHostEntry(HostEntry* entry);
}
}
private int _padding; // Pad out to 8-byte alignment
}
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetControlMessageBufferSize")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetControlMessageBufferSize")]
[SuppressGCTransition]
internal static partial int GetControlMessageBufferSize(int isIPv4, int isIPv6);
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_TryGetIPPacketInformation")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_TryGetIPPacketInformation")]
[return: MarshalAs(UnmanagedType.Bool)]
internal static unsafe partial bool TryGetIPPacketInformation(MessageHeader* messageHeader, [MarshalAs(UnmanagedType.Bool)] bool isIPv4, IPPacketInformation* packetInfo);
}
{
internal static partial class Sys
{
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_InitializeTerminalAndSignalHandling", SetLastError = true)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_InitializeTerminalAndSignalHandling", SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool InitializeTerminalAndSignalHandling();
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetKeypadXmit", StringMarshalling = StringMarshalling.Utf8)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetKeypadXmit", StringMarshalling = StringMarshalling.Utf8)]
internal static partial void SetKeypadXmit(string terminfoString);
}
}
{
internal static partial class Sys
{
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_InterfaceNameToIndex", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_InterfaceNameToIndex", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
public static partial uint InterfaceNameToIndex(string name);
}
}
{
internal static partial class Sys
{
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_IsATty", SetLastError = true)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_IsATty", SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool IsATty(SafeFileHandle fd);
}
while (true);
}
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetEGid")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetEGid")]
private static partial uint GetEGid();
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetGroups", SetLastError = true)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetGroups", SetLastError = true)]
private static unsafe partial int GetGroups(int ngroups, uint* groups);
}
}
SIGSTOP = 19
}
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Kill", SetLastError = true)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_Kill", SetLastError = true)]
internal static partial int Kill(int pid, Signals signal);
}
}
UF_HIDDEN = 0x8000
}
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_LChflags", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_LChflags", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
internal static partial int LChflags(string path, uint flags);
internal static readonly bool CanSetHiddenFlag = (LChflagsCanSetHiddenFlag() != 0);
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_LChflagsCanSetHiddenFlag")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_LChflagsCanSetHiddenFlag")]
[SuppressGCTransition]
private static partial int LChflagsCanSetHiddenFlag();
internal static readonly bool SupportsHiddenFlag = (CanGetHiddenFlag() != 0);
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_CanGetHiddenFlag")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_CanGetHiddenFlag")]
[SuppressGCTransition]
private static partial int CanGetHiddenFlag();
}
SEEK_END = 2
}
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_LSeek", SetLastError = true)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_LSeek", SetLastError = true)]
internal static partial long LSeek(SafeFileHandle fd, long offset, SeekWhence whence);
}
}
public int Seconds; // Number of seconds to linger for
}
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetLingerOption")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetLingerOption")]
internal static unsafe partial Error GetLingerOption(SafeHandle socket, LingerOption* option);
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetLingerOption")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetLingerOption")]
internal static unsafe partial Error SetLingerOption(SafeHandle socket, LingerOption* option);
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetLingerOption")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetLingerOption")]
internal static unsafe partial Error SetLingerOption(IntPtr socket, LingerOption* option);
}
}
{
internal static partial class Sys
{
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Link", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_Link", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
internal static partial int Link(string source, string link);
}
}
{
internal static partial class Sys
{
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Listen")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_Listen")]
internal static partial Error Listen(SafeHandle socket, int backlog);
}
}
F_UNLCK = 2 // unlock
}
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_LockFileRegion", SetLastError =true)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_LockFileRegion", SetLastError =true)]
internal static partial int LockFileRegion(SafeHandle fd, long offset, long length, LockType lockType);
}
}
{
internal static partial class Sys
{
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Log")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_Log")]
internal static unsafe partial void Log(byte* buffer, int count);
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_LogError")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_LogError")]
internal static unsafe partial void LogError(byte* buffer, int count);
}
}
{
internal static partial class Sys
{
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_LowLevelMonitor_Create")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_LowLevelMonitor_Create")]
internal static partial IntPtr LowLevelMonitor_Create();
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_LowLevelMonitor_Destroy")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_LowLevelMonitor_Destroy")]
internal static partial void LowLevelMonitor_Destroy(IntPtr monitor);
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_LowLevelMonitor_Acquire")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_LowLevelMonitor_Acquire")]
internal static partial void LowLevelMonitor_Acquire(IntPtr monitor);
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_LowLevelMonitor_Release")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_LowLevelMonitor_Release")]
internal static partial void LowLevelMonitor_Release(IntPtr monitor);
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_LowLevelMonitor_Wait")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_LowLevelMonitor_Wait")]
internal static partial void LowLevelMonitor_Wait(IntPtr monitor);
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_LowLevelMonitor_TimedWait")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_LowLevelMonitor_TimedWait")]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool LowLevelMonitor_TimedWait(IntPtr monitor, int timeoutMilliseconds);
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_LowLevelMonitor_Signal_Release")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_LowLevelMonitor_Signal_Release")]
internal static partial void LowLevelMonitor_Signal_Release(IntPtr monitor);
}
}
{
internal static partial class Sys
{
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_MAdvise", SetLastError = true)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_MAdvise", SetLastError = true)]
internal static partial int MAdvise(IntPtr addr, ulong length, MemoryAdvice advice);
internal enum MemoryAdvice
}
// NOTE: Shim returns null pointer on failure, not non-null MAP_FAILED sentinel.
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_MMap", SetLastError = true)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_MMap", SetLastError = true)]
internal static partial IntPtr MMap(
IntPtr addr, ulong len,
MemoryMappedProtections prot, MemoryMappedFlags flags,
MS_INVALIDATE = 0x10,
}
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_MSync", SetLastError = true)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_MSync", SetLastError = true)]
internal static partial int MSync(IntPtr addr, ulong len, MemoryMappedSyncFlags flags);
}
}
{
internal static partial class Sys
{
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_MUnmap", SetLastError = true)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_MUnmap", SetLastError = true)]
internal static partial int MUnmap(IntPtr addr, ulong len);
}
}
{
internal static partial class Sys
{
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_MapTcpState")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_MapTcpState")]
[SuppressGCTransition]
internal static partial TcpState MapTcpState(int nativeState);
}
{
internal static unsafe partial class Sys
{
- [GeneratedDllImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_AlignedAlloc")]
+ [LibraryImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_AlignedAlloc")]
internal static partial void* AlignedAlloc(nuint alignment, nuint size);
- [GeneratedDllImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_AlignedFree")]
+ [LibraryImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_AlignedFree")]
internal static partial void AlignedFree(void* ptr);
- [GeneratedDllImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_AlignedRealloc")]
+ [LibraryImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_AlignedRealloc")]
internal static partial void* AlignedRealloc(void* ptr, nuint alignment, nuint new_size);
- [GeneratedDllImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_Calloc")]
+ [LibraryImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_Calloc")]
internal static partial void* Calloc(nuint num, nuint size);
- [GeneratedDllImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_Free")]
+ [LibraryImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_Free")]
internal static partial void Free(void* ptr);
- [GeneratedDllImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_Malloc")]
+ [LibraryImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_Malloc")]
internal static partial void* Malloc(nuint size);
- [GeneratedDllImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_Realloc")]
+ [LibraryImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_Realloc")]
internal static partial void* Realloc(void* ptr, nuint new_size);
}
}
{
internal static partial class Sys
{
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_MemSet")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_MemSet")]
internal static extern unsafe void* MemSet(void *s, int c, UIntPtr n);
}
}
{
internal static partial class Sys
{
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_MkDir", SetLastError = true)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_MkDir", SetLastError = true)]
private static partial int MkDir(ref byte path, int mode);
internal static int MkDir(ReadOnlySpan<char> path, int mode)
{
internal static partial class Sys
{
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_MksTemps", SetLastError = true)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_MksTemps", SetLastError = true)]
internal static partial IntPtr MksTemps(
byte[] template,
int suffixlen);
internal ulong TotalSize;
}
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetSpaceInfoForMountPoint", SetLastError = true)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetSpaceInfoForMountPoint", SetLastError = true)]
internal static partial int GetSpaceInfoForMountPoint([MarshalAs(UnmanagedType.LPStr)]string name, out MountPointInformation mpi);
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetFormatInfoForMountPoint", SetLastError = true)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetFormatInfoForMountPoint", SetLastError = true)]
private static unsafe partial int GetFormatInfoForMountPoint(
[MarshalAs(UnmanagedType.LPStr)]string name,
byte* formatNameBuffer,
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
private unsafe delegate void MountPointFound(byte* name);
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetAllMountPoints", SetLastError = true)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetAllMountPoints", SetLastError = true)]
private static partial int GetAllMountPoints(MountPointFound mpf);
internal static string[] GetAllMountPoints()
private int _padding;
}
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetIPv4MulticastOption")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetIPv4MulticastOption")]
internal static unsafe partial Error GetIPv4MulticastOption(SafeHandle socket, MulticastOption multicastOption, IPv4MulticastOption* option);
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetIPv4MulticastOption")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetIPv4MulticastOption")]
internal static unsafe partial Error SetIPv4MulticastOption(SafeHandle socket, MulticastOption multicastOption, IPv4MulticastOption* option);
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetIPv6MulticastOption")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetIPv6MulticastOption")]
internal static unsafe partial Error GetIPv6MulticastOption(SafeHandle socket, MulticastOption multicastOption, IPv6MulticastOption* option);
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetIPv6MulticastOption")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetIPv6MulticastOption")]
internal static unsafe partial Error SetIPv6MulticastOption(SafeHandle socket, MulticastOption multicastOption, IPv6MulticastOption* option);
}
}
AvailabilityChanged = 2
}
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_CreateNetworkChangeListenerSocket")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_CreateNetworkChangeListenerSocket")]
public static unsafe partial Error CreateNetworkChangeListenerSocket(IntPtr* socket);
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_ReadEvents")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_ReadEvents")]
public static unsafe partial Error ReadEvents(SafeHandle socket, delegate* unmanaged<IntPtr, NetworkChangeKind, void> onNetworkChange);
}
}
{
internal static partial class Sys
{
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Open", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_Open", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
internal static partial SafeFileHandle Open(string filename, OpenFlags flags, int mode);
}
}
{
internal static partial class Sys
{
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_PRead", SetLastError = true)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_PRead", SetLastError = true)]
internal static unsafe partial int PRead(SafeHandle fd, byte* buffer, int bufferSize, long fileOffset);
}
}
{
internal static partial class Sys
{
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_PReadV", SetLastError = true)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_PReadV", SetLastError = true)]
internal static unsafe partial long PReadV(SafeHandle fd, IOVector* vectors, int vectorCount, long fileOffset);
}
}
{
internal static partial class Sys
{
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_PWrite", SetLastError = true)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_PWrite", SetLastError = true)]
internal static unsafe partial int PWrite(SafeHandle fd, byte* buffer, int bufferSize, long fileOffset);
}
}
{
internal static partial class Sys
{
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_PWriteV", SetLastError = true)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_PWriteV", SetLastError = true)]
internal static unsafe partial long PWriteV(SafeHandle fd, IOVector* vectors, int vectorCount, long fileOffset);
}
}
PC_VDISABLE = 9,
}
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_PathConf", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_PathConf", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
private static partial int PathConf(string path, PathConfName name);
}
}
/// </summary>
internal const int WriteEndOfPipe = 1;
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Pipe", SetLastError = true)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_Pipe", SetLastError = true)]
internal static unsafe partial int Pipe(int* pipefd, PipeFlags flags = 0); // pipefd is an array of two ints
}
}
{
internal static partial class Sys
{
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_PlatformSupportsDualModeIPv4PacketInfo")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_PlatformSupportsDualModeIPv4PacketInfo")]
[SuppressGCTransition]
internal static partial int PlatformSupportsDualModeIPv4PacketInfo();
}
/// <param name="timeout">The amount of time to wait; -1 for infinite, 0 for immediate return, and a positive number is the number of milliseconds</param>
/// <param name="triggered">The number of events triggered (i.e. the number of entries in pollEvents with a non-zero TriggeredEvents). May be zero in the event of a timeout.</param>
/// <returns>An error or Error.SUCCESS.</returns>
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Poll")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_Poll")]
internal static unsafe partial Error Poll(PollEvent* pollEvents, uint eventCount, int timeout, uint* triggered);
/// <summary>
/// <returns>
/// Returns 0 on success; otherwise, the error code is returned
/// </returns>
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_PosixFAdvise", SetLastError = false /* this is explicitly called out in the man page */)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_PosixFAdvise", SetLastError = false /* this is explicitly called out in the man page */)]
internal static partial int PosixFAdvise(SafeFileHandle fd, long offset, long length, FileAdvice advice);
}
}
{
internal static partial class Sys
{
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetPosixSignalHandler")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetPosixSignalHandler")]
[SuppressGCTransition]
internal static unsafe partial void SetPosixSignalHandler(delegate* unmanaged<int, PosixSignal, int> handler);
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_EnablePosixSignalHandling", SetLastError = true)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_EnablePosixSignalHandling", SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool EnablePosixSignalHandling(int signal);
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_DisablePosixSignalHandling")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_DisablePosixSignalHandling")]
internal static partial void DisablePosixSignalHandling(int signal);
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_HandleNonCanceledPosixSignal")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_HandleNonCanceledPosixSignal")]
internal static partial void HandleNonCanceledPosixSignal(int signal);
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetPlatformSignalNumber")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetPlatformSignalNumber")]
[SuppressGCTransition]
internal static partial int GetPlatformSignalNumber(PosixSignal signal);
}
/// Returns the number of bytes read on success; otherwise, -1 is returned
/// Note - on fail. the position of the stream may change depending on the platform; consult man 2 read for more info
/// </returns>
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Read", SetLastError = true)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_Read", SetLastError = true)]
internal static unsafe partial int Read(SafePipeHandle fd, byte* buffer, int count);
}
}
/// Returns the number of bytes read on success; otherwise, -1 is returned
/// Note - on fail. the position of the stream may change depending on the platform; consult man 2 read for more info
/// </returns>
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Read", SetLastError = true)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_Read", SetLastError = true)]
internal static unsafe partial int Read(SafeHandle fd, byte* buffer, int count);
}
}
}
}
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_OpenDir", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_OpenDir", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
internal static partial IntPtr OpenDir(string path);
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetReadDirRBufferSize", SetLastError = false)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetReadDirRBufferSize", SetLastError = false)]
[SuppressGCTransition]
internal static partial int GetReadDirRBufferSize();
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_ReadDirR")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_ReadDirR")]
internal static unsafe partial int ReadDirR(IntPtr dir, byte* buffer, int bufferSize, DirectoryEntry* outputEntry);
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_CloseDir", SetLastError = true)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_CloseDir", SetLastError = true)]
internal static partial int CloseDir(IntPtr dir);
}
}
/// <returns>
/// Returns the number of bytes placed into the buffer on success; bufferSize if the buffer is too small; and -1 on error.
/// </returns>
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_ReadLink", SetLastError = true)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_ReadLink", SetLastError = true)]
private static partial int ReadLink(ref byte path, byte[] buffer, int bufferSize);
/// <summary>
{
internal static partial class Sys
{
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_ReadStdin", SetLastError = true)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_ReadStdin", SetLastError = true)]
internal static unsafe partial int ReadStdin(byte* buffer, int bufferSize);
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_InitializeConsoleBeforeRead")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_InitializeConsoleBeforeRead")]
internal static partial void InitializeConsoleBeforeRead(byte minChars = 1, byte decisecondsTimeout = 0);
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_UninitializeConsoleAfterRead")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_UninitializeConsoleAfterRead")]
internal static partial void UninitializeConsoleAfterRead();
}
}
/// </summary>
/// <param name="path">The path to the file system object</param>
/// <returns>Returns the result string on success and null on failure</returns>
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_RealPath", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_RealPath", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
internal static partial string RealPath(string path);
}
}
{
internal static partial class Sys
{
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Receive")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_Receive")]
internal static unsafe partial Error Receive(SafeHandle socket, byte* buffer, int bufferLen, SocketFlags flags, int* received);
}
}
{
internal static partial class Sys
{
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_ReceiveMessage")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_ReceiveMessage")]
internal static unsafe partial Error ReceiveMessage(SafeHandle socket, MessageHeader* messageHeader, SocketFlags flags, long* received);
}
}
{
internal static partial class Sys
{
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_RegisterForSigChld")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_RegisterForSigChld")]
internal static unsafe partial void RegisterForSigChld(delegate* unmanaged<int, int, int> handler);
}
}
/// <returns>
/// Returns 0 on success; otherwise, returns -1
/// </returns>
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Rename", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_Rename", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
internal static partial int Rename(string oldPath, string newPath);
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Rename", SetLastError = true)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_Rename", SetLastError = true)]
internal static partial int Rename(ref byte oldPath, ref byte newPath);
internal static int Rename(ReadOnlySpan<char> oldPath, ReadOnlySpan<char> newPath)
internal ulong MaximumLimit;
}
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetRLimit", SetLastError = true)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetRLimit", SetLastError = true)]
internal static partial int GetRLimit(RlimitResources resourceType, out RLimit limits);
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetRLimit", SetLastError = true)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetRLimit", SetLastError = true)]
internal static partial int SetRLimit(RlimitResources resourceType, ref RLimit limits);
}
}
/// <returns>
/// Returns 0 on success; otherwise, returns -1
/// </returns>
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_RmDir", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_RmDir", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
internal static partial int RmDir(string path);
}
}
/// success; if the return value is equal to the size then the result may have been truncated.
/// On failure, returns a negative value.
/// </returns>
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SNPrintF", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_SNPrintF", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
internal static unsafe partial int SNPrintF(byte* str, int size, string format, string arg1);
/// <summary>
/// success; if the return value is equal to the size then the result may have been truncated.
/// On failure, returns a negative value.
/// </returns>
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SNPrintF", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_SNPrintF", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
internal static unsafe partial int SNPrintF(byte* str, int size, string format, int arg1);
}
}
{
internal unsafe partial class Sys
{
- [GeneratedDllImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_SchedGetCpu")]
+ [LibraryImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_SchedGetCpu")]
internal static partial int SchedGetCpu();
}
}
{
internal static partial class Sys
{
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SchedSetAffinity", SetLastError = true)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_SchedSetAffinity", SetLastError = true)]
internal static partial int SchedSetAffinity(int pid, ref IntPtr mask);
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SchedGetAffinity", SetLastError = true)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_SchedGetAffinity", SetLastError = true)]
internal static partial int SchedGetAffinity(int pid, out IntPtr mask);
}
}
{
internal static partial class Sys
{
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Send")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_Send")]
internal static unsafe partial Error Send(SafeHandle socket, byte* buffer, int bufferLen, SocketFlags flags, int* sent);
}
}
{
internal static partial class Sys
{
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SendFile", SetLastError = true)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_SendFile", SetLastError = true)]
internal static partial Error SendFile(SafeHandle out_fd, SafeHandle in_fd, long offset, long count, out long sent);
}
}
{
internal static partial class Sys
{
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SendMessage")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_SendMessage")]
internal static unsafe partial Error SendMessage(SafeHandle socket, MessageHeader* messageHeader, SocketFlags flags, long* sent);
}
}
{
internal static partial class Sys
{
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetDelayedSigChildConsoleConfigurationHandler")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetDelayedSigChildConsoleConfigurationHandler")]
[SuppressGCTransition]
internal static unsafe partial void SetDelayedSigChildConsoleConfigurationHandler(delegate* unmanaged<void> callback);
}
{
internal static partial class Sys
{
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetEUid")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetEUid")]
internal static partial int SetEUid(uint euid);
}
}
{
internal static partial class Sys
{
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetReceiveTimeout")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetReceiveTimeout")]
internal static partial Error SetReceiveTimeout(SafeHandle socket, int millisecondsTimeout);
}
}
{
internal static partial class Sys
{
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetSendTimeout")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetSendTimeout")]
internal static partial Error SetSendTimeout(SafeHandle socket, int millisecondsTimeout);
}
}
{
internal static partial class Sys
{
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetSignalForBreak")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetSignalForBreak")]
[SuppressGCTransition]
internal static partial int GetSignalForBreak();
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetSignalForBreak")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetSignalForBreak")]
internal static partial int SetSignalForBreak(int signalForBreak);
}
}
{
internal static partial class Sys
{
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetSockOpt")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetSockOpt")]
internal static unsafe partial Error SetSockOpt(SafeHandle socket, SocketOptionLevel optionLevel, SocketOptionName optionName, byte* optionValue, int optionLen);
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetSockOpt")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetSockOpt")]
internal static unsafe partial Error SetSockOpt(IntPtr socket, SocketOptionLevel optionLevel, SocketOptionName optionName, byte* optionValue, int optionLen);
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetRawSockOpt")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetRawSockOpt")]
internal static unsafe partial Error SetRawSockOpt(SafeHandle socket, int optionLevel, int optionName, byte* optionValue, int optionLen);
}
}
{
internal static partial class Sys
{
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetTerminalInvalidationHandler")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetTerminalInvalidationHandler")]
internal static unsafe partial void SetTerminalInvalidationHandler(delegate* unmanaged<void> handler);
}
}
{
internal static partial class Sys
{
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_ShmOpen", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_ShmOpen", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
internal static partial SafeFileHandle ShmOpen(string name, OpenFlags flags, int mode);
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_ShmUnlink", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_ShmUnlink", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
internal static partial int ShmUnlink(string name);
}
}
{
internal static partial class Sys
{
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Shutdown")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_Shutdown")]
internal static partial Error Shutdown(SafeHandle socket, SocketShutdown how);
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Shutdown")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_Shutdown")]
internal static partial Error Shutdown(IntPtr socket, SocketShutdown how);
}
}
{
internal static partial class Sys
{
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Socket")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_Socket")]
internal static unsafe partial Error Socket(AddressFamily addressFamily, SocketType socketType, ProtocolType protocolType, IntPtr* socket);
}
}
{
internal static partial class Sys
{
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetIPSocketAddressSizes")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetIPSocketAddressSizes")]
[SuppressGCTransition]
internal static unsafe partial Error GetIPSocketAddressSizes(int* ipv4SocketAddressSize, int* ipv6SocketAddressSize);
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetAddressFamily")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetAddressFamily")]
[SuppressGCTransition]
internal static unsafe partial Error GetAddressFamily(byte* socketAddress, int socketAddressLen, int* addressFamily);
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetAddressFamily")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetAddressFamily")]
[SuppressGCTransition]
internal static unsafe partial Error SetAddressFamily(byte* socketAddress, int socketAddressLen, int addressFamily);
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetPort")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetPort")]
[SuppressGCTransition]
internal static unsafe partial Error GetPort(byte* socketAddress, int socketAddressLen, ushort* port);
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetPort")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetPort")]
[SuppressGCTransition]
internal static unsafe partial Error SetPort(byte* socketAddress, int socketAddressLen, ushort port);
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetIPv4Address")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetIPv4Address")]
[SuppressGCTransition]
internal static unsafe partial Error GetIPv4Address(byte* socketAddress, int socketAddressLen, uint* address);
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetIPv4Address")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetIPv4Address")]
[SuppressGCTransition]
internal static unsafe partial Error SetIPv4Address(byte* socketAddress, int socketAddressLen, uint address);
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetIPv6Address")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetIPv6Address")]
internal static unsafe partial Error GetIPv6Address(byte* socketAddress, int socketAddressLen, byte* address, int addressLen, uint* scopeId);
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetIPv6Address")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetIPv6Address")]
internal static unsafe partial Error SetIPv6Address(byte* socketAddress, int socketAddressLen, byte* address, int addressLen, uint scopeId);
}
}
private int _padding;
}
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_CreateSocketEventPort")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_CreateSocketEventPort")]
internal static unsafe partial Error CreateSocketEventPort(IntPtr* port);
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_CloseSocketEventPort")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_CloseSocketEventPort")]
internal static partial Error CloseSocketEventPort(IntPtr port);
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_CreateSocketEventBuffer")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_CreateSocketEventBuffer")]
internal static unsafe partial Error CreateSocketEventBuffer(int count, SocketEvent** buffer);
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_FreeSocketEventBuffer")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_FreeSocketEventBuffer")]
internal static unsafe partial Error FreeSocketEventBuffer(SocketEvent* buffer);
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_TryChangeSocketEventRegistration")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_TryChangeSocketEventRegistration")]
internal static partial Error TryChangeSocketEventRegistration(IntPtr port, SafeHandle socket, SocketEvents currentEvents, SocketEvents newEvents, IntPtr data);
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_TryChangeSocketEventRegistration")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_TryChangeSocketEventRegistration")]
internal static partial Error TryChangeSocketEventRegistration(IntPtr port, IntPtr socket, SocketEvents currentEvents, SocketEvents newEvents, IntPtr data);
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_WaitForSocketEvents")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_WaitForSocketEvents")]
internal static unsafe partial Error WaitForSocketEvents(IntPtr port, SocketEvent* buffer, int* count);
}
}
{
internal static partial class Sys
{
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_FStat", SetLastError = true)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_FStat", SetLastError = true)]
internal static partial int FStat(SafePipeHandle fd, out FileStatus output);
}
}
{
internal static partial class Sys
{
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Stat", SetLastError = true)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_Stat", SetLastError = true)]
internal static partial int Stat(ref byte path, out FileStatus output);
internal static int Stat(ReadOnlySpan<char> path, out FileStatus output)
return result;
}
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_LStat", SetLastError = true)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_LStat", SetLastError = true)]
internal static partial int LStat(ref byte path, out FileStatus output);
internal static int LStat(ReadOnlySpan<char> path, out FileStatus output)
HasBirthTime = 1,
}
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_FStat", SetLastError = true)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_FStat", SetLastError = true)]
internal static partial int FStat(SafeHandle fd, out FileStatus output);
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Stat", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_Stat", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
internal static partial int Stat(string path, out FileStatus output);
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_LStat", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_LStat", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
internal static partial int LStat(string path, out FileStatus output);
}
}
{
internal static partial class Sys
{
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_StdinReady")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_StdinReady")]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool StdinReady();
}
{
internal static partial class Sys
{
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SymLink", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_SymLink", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
internal static partial int SymLink(string target, string linkPath);
}
}
/// <summary>
/// Forces a write of all modified I/O buffers to their storage mediums.
/// </summary>
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Sync")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_Sync")]
internal static partial void Sync();
}
}
_SC_PAGESIZE = 2
}
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SysConf", SetLastError = true)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_SysConf", SetLastError = true)]
internal static partial long SysConf(SysConfName name);
}
}
/// </param>
/// <param name="message">The message to put in the log entry</param>
/// <param name="arg1">Like printf, the argument is passed to the variadic part of the C++ function to wildcards in the message</param>
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SysLog", StringMarshalling = StringMarshalling.Utf8)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_SysLog", StringMarshalling = StringMarshalling.Utf8)]
internal static partial void SysLog(SysLogPriority priority, string message, string arg1);
}
}
{
internal unsafe partial class Sys
{
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_CreateThread")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_CreateThread")]
[return: MarshalAs(UnmanagedType.Bool)]
internal static unsafe partial bool CreateThread(IntPtr stackSize, delegate* unmanaged<IntPtr, IntPtr> startAddress, IntPtr parameter);
}
/// <returns>
/// Returns 0 on success; otherwise, returns -1
/// </returns>
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_UTimensat", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_UTimensat", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
internal static unsafe partial int UTimensat(string path, TimeSpec* times);
}
}
zfs = 0x2FC12FC1,
}
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetFileSystemType")]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetFileSystemType")]
private static partial long GetFileSystemType(SafeFileHandle fd);
internal static bool TryGetFileSystemType(SafeFileHandle fd, out UnixFileSystemTypes fileSystemType)
{
internal static partial class Sys
{
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Unlink", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_Unlink", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
internal static partial int Unlink(string pathname);
}
}
/// 2) if no children are terminated, 0 is returned
/// 3) on error, -1 is returned
/// </returns>
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_WaitIdAnyExitedNoHangNoWait", SetLastError = true)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_WaitIdAnyExitedNoHangNoWait", SetLastError = true)]
internal static partial int WaitIdAnyExitedNoHangNoWait();
}
}
/// 3) if the child has not yet terminated, 0 is returned
/// 4) on error, -1 is returned.
/// </returns>
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_WaitPidExitedNoHang", SetLastError = true)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_WaitPidExitedNoHang", SetLastError = true)]
internal static partial int WaitPidExitedNoHang(int pid, out int exitCode);
}
}
/// <returns>
/// Returns the number of bytes written on success; otherwise, returns -1 and sets errno
/// </returns>
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Write", SetLastError = true)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_Write", SetLastError = true)]
internal static unsafe partial int Write(SafePipeHandle fd, byte* buffer, int bufferSize);
}
}
/// <returns>
/// Returns the number of bytes written on success; otherwise, returns -1 and sets errno
/// </returns>
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Write", SetLastError = true)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_Write", SetLastError = true)]
internal static unsafe partial int Write(SafeHandle fd, byte* buffer, int bufferSize);
- [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Write", SetLastError = true)]
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_Write", SetLastError = true)]
internal static unsafe partial int Write(IntPtr fd, byte* buffer, int bufferSize);
}
}
{
internal static partial class NetSecurityNative
{
- [GeneratedDllImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_IsNtlmInstalled")]
+ [LibraryImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_IsNtlmInstalled")]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool IsNtlmInstalled();
- [GeneratedDllImport(Interop.Libraries.NetSecurityNative, EntryPoint = "NetSecurityNative_EnsureGssInitialized")]
+ [LibraryImport(Interop.Libraries.NetSecurityNative, EntryPoint = "NetSecurityNative_EnsureGssInitialized")]
private static partial int EnsureGssInitialized();
static NetSecurityNative()
{
internal static partial class NetSecurityNative
{
- [GeneratedDllImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_ReleaseGssBuffer")]
+ [LibraryImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_ReleaseGssBuffer")]
internal static partial void ReleaseGssBuffer(
IntPtr bufferPtr,
ulong length);
- [GeneratedDllImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_DisplayMinorStatus")]
+ [LibraryImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_DisplayMinorStatus")]
internal static partial Status DisplayMinorStatus(
out Status minorStatus,
Status statusValue,
ref GssBuffer buffer);
- [GeneratedDllImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_DisplayMajorStatus")]
+ [LibraryImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_DisplayMajorStatus")]
internal static partial Status DisplayMajorStatus(
out Status minorStatus,
Status statusValue,
ref GssBuffer buffer);
- [GeneratedDllImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_ImportUserName")]
+ [LibraryImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_ImportUserName")]
internal static partial Status ImportUserName(
out Status minorStatus,
[MarshalAs(UnmanagedType.LPUTF8Str)] string inputName,
int inputNameByteCount,
out SafeGssNameHandle outputName);
- [GeneratedDllImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_ImportPrincipalName")]
+ [LibraryImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_ImportPrincipalName")]
internal static partial Status ImportPrincipalName(
out Status minorStatus,
[MarshalAs(UnmanagedType.LPUTF8Str)] string inputName,
int inputNameByteCount,
out SafeGssNameHandle outputName);
- [GeneratedDllImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_ReleaseName")]
+ [LibraryImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_ReleaseName")]
internal static partial Status ReleaseName(
out Status minorStatus,
ref IntPtr inputName);
- [GeneratedDllImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_AcquireAcceptorCred")]
+ [LibraryImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_AcquireAcceptorCred")]
internal static partial Status AcquireAcceptorCred(
out Status minorStatus,
out SafeGssCredHandle outputCredHandle);
- [GeneratedDllImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_InitiateCredSpNego")]
+ [LibraryImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_InitiateCredSpNego")]
internal static partial Status InitiateCredSpNego(
out Status minorStatus,
SafeGssNameHandle desiredName,
out SafeGssCredHandle outputCredHandle);
- [GeneratedDllImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_InitiateCredWithPassword", StringMarshalling = StringMarshalling.Utf8)]
+ [LibraryImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_InitiateCredWithPassword", StringMarshalling = StringMarshalling.Utf8)]
internal static partial Status InitiateCredWithPassword(
out Status minorStatus,
[MarshalAs(UnmanagedType.Bool)] bool isNtlm,
int passwordLen,
out SafeGssCredHandle outputCredHandle);
- [GeneratedDllImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_ReleaseCred")]
+ [LibraryImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_ReleaseCred")]
internal static partial Status ReleaseCred(
out Status minorStatus,
ref IntPtr credHandle);
- [GeneratedDllImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_InitSecContext")]
+ [LibraryImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_InitSecContext")]
internal static partial Status InitSecContext(
out Status minorStatus,
SafeGssCredHandle initiatorCredHandle,
out uint retFlags,
[MarshalAs(UnmanagedType.Bool)] out bool isNtlmUsed);
- [GeneratedDllImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_InitSecContextEx")]
+ [LibraryImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_InitSecContextEx")]
internal static partial Status InitSecContext(
out Status minorStatus,
SafeGssCredHandle initiatorCredHandle,
out uint retFlags,
[MarshalAs(UnmanagedType.Bool)] out bool isNtlmUsed);
- [GeneratedDllImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_AcceptSecContext")]
+ [LibraryImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_AcceptSecContext")]
internal static partial Status AcceptSecContext(
out Status minorStatus,
SafeGssCredHandle acceptorCredHandle,
out uint retFlags,
[MarshalAs(UnmanagedType.Bool)] out bool isNtlmUsed);
- [GeneratedDllImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_DeleteSecContext")]
+ [LibraryImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_DeleteSecContext")]
internal static partial Status DeleteSecContext(
out Status minorStatus,
ref IntPtr contextHandle);
- [GeneratedDllImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_GetUser")]
+ [LibraryImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_GetUser")]
internal static partial Status GetUser(
out Status minorStatus,
SafeGssContextHandle? acceptContextHandle,
ref GssBuffer token);
- [GeneratedDllImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_Wrap")]
+ [LibraryImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_Wrap")]
private static unsafe partial Status Wrap(
out Status minorStatus,
SafeGssContextHandle? contextHandle,
int count,
ref GssBuffer outBuffer);
- [GeneratedDllImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_Unwrap")]
+ [LibraryImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_Unwrap")]
private static partial Status Unwrap(
out Status minorStatus,
SafeGssContextHandle? contextHandle,
{
internal static partial class Crypto
{
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetAsn1IntegerDerSize")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetAsn1IntegerDerSize")]
private static partial int GetAsn1IntegerDerSize(SafeSharedAsn1IntegerHandle i);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EncodeAsn1Integer")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EncodeAsn1Integer")]
private static partial int EncodeAsn1Integer(SafeSharedAsn1IntegerHandle i, byte[] buf);
internal static byte[] GetAsn1IntegerBytes(SafeSharedAsn1IntegerHandle asn1Integer)
internal const int NID_undef = 0;
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_ObjTxt2Nid", StringMarshalling = StringMarshalling.Utf8)]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_ObjTxt2Nid", StringMarshalling = StringMarshalling.Utf8)]
private static partial int ObjTxt2Nid(string oid);
internal static int ResolveRequiredNid(string oid)
{
internal static partial class Crypto
{
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_ObjTxt2Obj", StringMarshalling = StringMarshalling.Utf8)]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_ObjTxt2Obj", StringMarshalling = StringMarshalling.Utf8)]
internal static partial SafeAsn1ObjectHandle ObjTxt2Obj(string s);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_ObjObj2Txt")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_ObjObj2Txt")]
private static unsafe partial int ObjObj2Txt(byte* buf, int buf_len, IntPtr a);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetObjectDefinitionByName", StringMarshalling = StringMarshalling.Utf8)]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetObjectDefinitionByName", StringMarshalling = StringMarshalling.Utf8)]
private static partial IntPtr CryptoNative_GetObjectDefinitionByName(string friendlyName);
internal static IntPtr GetObjectDefinitionByName(string friendlyName)
{
}
// Returns shared pointers, should not be tracked as a SafeHandle.
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_ObjNid2Obj")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_ObjNid2Obj")]
internal static partial IntPtr ObjNid2Obj(int nid);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_Asn1ObjectFree")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_Asn1ObjectFree")]
internal static partial void Asn1ObjectFree(IntPtr o);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DecodeAsn1BitString")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DecodeAsn1BitString")]
internal static partial SafeAsn1BitStringHandle DecodeAsn1BitString(byte[] buf, int len);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_Asn1BitStringFree")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_Asn1BitStringFree")]
internal static partial void Asn1BitStringFree(IntPtr o);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_Asn1OctetStringNew")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_Asn1OctetStringNew")]
internal static partial SafeAsn1OctetStringHandle Asn1OctetStringNew();
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_Asn1OctetStringSet")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_Asn1OctetStringSet")]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool Asn1OctetStringSet(SafeAsn1OctetStringHandle o, byte[] d, int len);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_Asn1OctetStringFree")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_Asn1OctetStringFree")]
internal static partial void Asn1OctetStringFree(IntPtr o);
internal static unsafe string GetOidValue(IntPtr asn1ObjectPtr)
{
internal static partial class Crypto
{
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_CreateMemoryBio")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_CreateMemoryBio")]
internal static partial SafeBioHandle CreateMemoryBio();
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_BioNewFile", StringMarshalling = StringMarshalling.Utf8)]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_BioNewFile", StringMarshalling = StringMarshalling.Utf8)]
internal static partial SafeBioHandle BioNewFile(string filename, string mode);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_BioDestroy")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_BioDestroy")]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool BioDestroy(IntPtr a);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_BioGets")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_BioGets")]
internal static partial int BioGets(SafeBioHandle b, byte[] buf, int size);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_BioRead")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_BioRead")]
internal static partial int BioRead(SafeBioHandle b, byte[] data, int len);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_BioWrite")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_BioWrite")]
internal static partial int BioWrite(SafeBioHandle b, byte[] data, int len);
internal static int BioWrite(SafeBioHandle b, ReadOnlySpan<byte> data) =>
BioWrite(b, ref MemoryMarshal.GetReference(data), data.Length);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_BioWrite")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_BioWrite")]
private static partial int BioWrite(SafeBioHandle b, ref byte data, int len);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetMemoryBioSize")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetMemoryBioSize")]
internal static partial int GetMemoryBioSize(SafeBioHandle bio);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_BioCtrlPending")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_BioCtrlPending")]
internal static partial int BioCtrlPending(SafeBioHandle bio);
}
}
{
internal static partial class Crypto
{
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_BigNumDestroy")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_BigNumDestroy")]
internal static partial void BigNumDestroy(IntPtr a);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_BigNumFromBinary")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_BigNumFromBinary")]
private static unsafe partial IntPtr BigNumFromBinary(byte* s, int len);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_BigNumToBinary")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_BigNumToBinary")]
private static unsafe partial int BigNumToBinary(SafeBignumHandle a, byte* to);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetBigNumBytes")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetBigNumBytes")]
private static partial int GetBigNumBytes(SafeBignumHandle a);
private static unsafe IntPtr CreateBignumPtr(ReadOnlySpan<byte> bigEndianValue)
{
internal static partial class Crypto
{
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_CheckX509Hostname", StringMarshalling = StringMarshalling.Utf8)]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_CheckX509Hostname", StringMarshalling = StringMarshalling.Utf8)]
internal static partial int CheckX509Hostname(
IntPtr x509,
string hostname,
{
internal delegate int NegativeSizeReadMethod<in THandle>(THandle handle, byte[]? buf, int cBuf);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_BioTell")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_BioTell")]
internal static partial int CryptoNative_BioTell(SafeBioHandle bio);
internal static int BioTell(SafeBioHandle bio)
return ret;
}
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_BioSeek")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_BioSeek")]
internal static partial int BioSeek(SafeBioHandle bio, int pos);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509Thumbprint")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509Thumbprint")]
private static partial int GetX509Thumbprint(SafeX509Handle x509, byte[]? buf, int cBuf);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509NameRawBytes")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509NameRawBytes")]
private static partial int GetX509NameRawBytes(IntPtr x509Name, byte[]? buf, int cBuf);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_ReadX509AsDerFromBio")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_ReadX509AsDerFromBio")]
internal static partial SafeX509Handle ReadX509AsDerFromBio(SafeBioHandle bio);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509CrlNextUpdate")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509CrlNextUpdate")]
internal static partial IntPtr GetX509CrlNextUpdate(SafeX509CrlHandle crl);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509Version")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509Version")]
internal static partial int GetX509Version(SafeX509Handle x509);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509PublicKeyParameterBytes")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509PublicKeyParameterBytes")]
private static partial int GetX509PublicKeyParameterBytes(SafeX509Handle x509, byte[]? buf, int cBuf);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509EkuFieldCount")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509EkuFieldCount")]
internal static partial int GetX509EkuFieldCount(SafeEkuExtensionHandle eku);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509EkuField")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509EkuField")]
internal static partial IntPtr GetX509EkuField(SafeEkuExtensionHandle eku, int loc);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509NameInfo")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509NameInfo")]
internal static partial SafeBioHandle GetX509NameInfo(SafeX509Handle x509, int nameType, [MarshalAs(UnmanagedType.Bool)] bool forIssuer);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetAsn1StringBytes")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetAsn1StringBytes")]
private static partial int GetAsn1StringBytes(IntPtr asn1, byte[]? buf, int cBuf);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_PushX509StackField")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_PushX509StackField")]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool PushX509StackField(SafeX509StackHandle stack, SafeX509Handle x509);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_PushX509StackField")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_PushX509StackField")]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool PushX509StackField(SafeSharedX509StackHandle stack, SafeX509Handle x509);
return Marshal.PtrToStringAnsi(GetX509RootStoreFile_private(&unused));
}
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509RootStorePath")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509RootStorePath")]
private static unsafe partial IntPtr GetX509RootStorePath_private(byte* defaultPath);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509RootStoreFile")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509RootStoreFile")]
private static unsafe partial IntPtr GetX509RootStoreFile_private(byte* defaultPath);
- [GeneratedDllImport(Libraries.CryptoNative)]
+ [LibraryImport(Libraries.CryptoNative)]
private static partial int CryptoNative_X509StoreSetVerifyTime(
SafeX509StoreHandle ctx,
int year,
int second,
[MarshalAs(UnmanagedType.Bool)] bool isDst);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_CheckX509IpAddress", StringMarshalling = StringMarshalling.Utf8)]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_CheckX509IpAddress", StringMarshalling = StringMarshalling.Utf8)]
internal static partial int CheckX509IpAddress(SafeX509Handle x509, byte[] addressBytes, int addressLen, string hostname, int cchHostname);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_CheckX509Hostname", StringMarshalling = StringMarshalling.Utf8)]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_CheckX509Hostname", StringMarshalling = StringMarshalling.Utf8)]
internal static partial int CheckX509Hostname(SafeX509Handle x509, string hostname, int cchHostname);
internal static byte[] GetAsn1StringBytes(IntPtr asn1)
{
internal static partial class Crypto
{
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DsaUpRef")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DsaUpRef")]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool DsaUpRef(IntPtr dsa);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DsaDestroy")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DsaDestroy")]
internal static partial void DsaDestroy(IntPtr dsa);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DsaGenerateKey")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DsaGenerateKey")]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool DsaGenerateKey(out SafeDsaHandle dsa, int bits);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DsaSizeSignature")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DsaSizeSignature")]
private static partial int DsaSizeSignature(SafeDsaHandle dsa);
/// <summary>
return size;
}
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DsaSizeQ")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DsaSizeQ")]
private static partial int DsaSizeQ(SafeDsaHandle dsa);
/// <summary>
return size;
}
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DsaSizeP")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DsaSizeP")]
private static partial int DsaSizeP(SafeDsaHandle dsa);
/// <summary>
internal static bool DsaSign(SafeDsaHandle dsa, ReadOnlySpan<byte> hash, Span<byte> refSignature, out int outSignatureLength) =>
DsaSign(dsa, ref MemoryMarshal.GetReference(hash), hash.Length, ref MemoryMarshal.GetReference(refSignature), out outSignatureLength);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DsaSign")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DsaSign")]
[return: MarshalAs(UnmanagedType.Bool)]
private static partial bool DsaSign(SafeDsaHandle dsa, ref byte hash, int hashLength, ref byte refSignature, out int outSignatureLength);
return ret;
}
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DsaVerify")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DsaVerify")]
[return: MarshalAs(UnmanagedType.Bool)]
private static partial bool DsaVerify(SafeDsaHandle dsa, ref byte hash, int hashLength, ref byte signature, int signatureLength);
}
}
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetDsaParameters")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetDsaParameters")]
[return: MarshalAs(UnmanagedType.Bool)]
private static partial bool GetDsaParameters(
SafeDsaHandle key,
out IntPtr y, out int y_cb,
out IntPtr x, out int x_cb);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DsaKeyCreateByExplicitParameters")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DsaKeyCreateByExplicitParameters")]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool DsaKeyCreateByExplicitParameters(
out SafeDsaHandle dsa,
{
internal static partial class Crypto
{
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_ErrClearError")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_ErrClearError")]
internal static partial ulong ErrClearError();
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_ErrGetExceptionError")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_ErrGetExceptionError")]
private static partial ulong ErrGetExceptionError([MarshalAs(UnmanagedType.Bool)] out bool isAllocFailure);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_ErrPeekError")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_ErrPeekError")]
internal static partial ulong ErrPeekError();
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_ErrPeekLastError")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_ErrPeekLastError")]
internal static partial ulong ErrPeekLastError();
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_ErrReasonErrorString")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_ErrReasonErrorString")]
internal static partial IntPtr ErrReasonErrorString(ulong error);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_ErrErrorStringN")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_ErrErrorStringN")]
private static unsafe partial void ErrErrorStringN(ulong e, byte* buf, int len);
private static unsafe string ErrErrorStringN(ulong error)
{
internal static partial class Crypto
{
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherCreate2")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherCreate2")]
internal static partial SafeEvpCipherCtxHandle EvpCipherCreate(
IntPtr cipher,
ref byte key,
ref byte iv,
int enc);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherCreatePartial")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherCreatePartial")]
internal static partial SafeEvpCipherCtxHandle EvpCipherCreatePartial(
IntPtr cipher);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherSetKeyAndIV")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherSetKeyAndIV")]
[return: MarshalAs(UnmanagedType.Bool)]
private static partial bool EvpCipherSetKeyAndIV(
SafeEvpCipherCtxHandle ctx,
}
}
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherSetGcmNonceLength")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherSetGcmNonceLength")]
[return: MarshalAs(UnmanagedType.Bool)]
private static partial bool CryptoNative_EvpCipherSetGcmNonceLength(
SafeEvpCipherCtxHandle ctx, int nonceLength);
}
}
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherSetCcmNonceLength")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherSetCcmNonceLength")]
[return: MarshalAs(UnmanagedType.Bool)]
private static partial bool CryptoNative_EvpCipherSetCcmNonceLength(
SafeEvpCipherCtxHandle ctx, int nonceLength);
}
}
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherDestroy")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherDestroy")]
internal static partial void EvpCipherDestroy(IntPtr ctx);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherReset")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherReset")]
[return: MarshalAs(UnmanagedType.Bool)]
private static unsafe partial bool EvpCipherReset(SafeEvpCipherCtxHandle ctx, byte* pIv, int cIv);
}
}
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherCtxSetPadding")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherCtxSetPadding")]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool EvpCipherCtxSetPadding(SafeEvpCipherCtxHandle x, int padding);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherUpdate")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherUpdate")]
[return: MarshalAs(UnmanagedType.Bool)]
private static partial bool EvpCipherUpdate(
SafeEvpCipherCtxHandle ctx,
}
}
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherFinalEx")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherFinalEx")]
[return: MarshalAs(UnmanagedType.Bool)]
private static partial bool EvpCipherFinalEx(
SafeEvpCipherCtxHandle ctx,
return EvpCipherFinalEx(ctx, ref MemoryMarshal.GetReference(output), out bytesWritten);
}
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherGetGcmTag")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherGetGcmTag")]
[return: MarshalAs(UnmanagedType.Bool)]
private static partial bool EvpCipherGetGcmTag(
SafeEvpCipherCtxHandle ctx,
}
}
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherGetAeadTag")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherGetAeadTag")]
[return: MarshalAs(UnmanagedType.Bool)]
private static partial bool EvpCipherGetAeadTag(
SafeEvpCipherCtxHandle ctx,
}
}
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherSetGcmTag")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherSetGcmTag")]
[return: MarshalAs(UnmanagedType.Bool)]
private static partial bool EvpCipherSetGcmTag(
SafeEvpCipherCtxHandle ctx,
}
}
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherSetAeadTag")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherSetAeadTag")]
[return: MarshalAs(UnmanagedType.Bool)]
private static partial bool EvpCipherSetAeadTag(
SafeEvpCipherCtxHandle ctx,
}
}
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherGetCcmTag")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherGetCcmTag")]
[return: MarshalAs(UnmanagedType.Bool)]
private static partial bool EvpCipherGetCcmTag(
SafeEvpCipherCtxHandle ctx,
}
}
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherSetCcmTag")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherSetCcmTag")]
[return: MarshalAs(UnmanagedType.Bool)]
private static partial bool EvpCipherSetCcmTag(
SafeEvpCipherCtxHandle ctx,
}
}
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes128Ecb")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes128Ecb")]
internal static partial IntPtr EvpAes128Ecb();
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes128Cbc")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes128Cbc")]
internal static partial IntPtr EvpAes128Cbc();
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes128Gcm")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes128Gcm")]
internal static partial IntPtr EvpAes128Gcm();
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes128Cfb8")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes128Cfb8")]
internal static partial IntPtr EvpAes128Cfb8();
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes128Cfb128")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes128Cfb128")]
internal static partial IntPtr EvpAes128Cfb128();
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes128Ccm")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes128Ccm")]
internal static partial IntPtr EvpAes128Ccm();
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes192Ecb")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes192Ecb")]
internal static partial IntPtr EvpAes192Ecb();
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes192Cbc")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes192Cbc")]
internal static partial IntPtr EvpAes192Cbc();
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes192Gcm")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes192Gcm")]
internal static partial IntPtr EvpAes192Gcm();
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes192Cfb8")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes192Cfb8")]
internal static partial IntPtr EvpAes192Cfb8();
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes192Cfb128")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes192Cfb128")]
internal static partial IntPtr EvpAes192Cfb128();
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes192Ccm")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes192Ccm")]
internal static partial IntPtr EvpAes192Ccm();
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes256Ecb")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes256Ecb")]
internal static partial IntPtr EvpAes256Ecb();
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes256Cbc")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes256Cbc")]
internal static partial IntPtr EvpAes256Cbc();
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes256Gcm")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes256Gcm")]
internal static partial IntPtr EvpAes256Gcm();
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes256Cfb128")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes256Cfb128")]
internal static partial IntPtr EvpAes256Cfb128();
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes256Cfb8")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes256Cfb8")]
internal static partial IntPtr EvpAes256Cfb8();
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes256Ccm")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes256Ccm")]
internal static partial IntPtr EvpAes256Ccm();
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpDesCbc")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpDesCbc")]
internal static partial IntPtr EvpDesCbc();
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpDesEcb")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpDesEcb")]
internal static partial IntPtr EvpDesEcb();
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpDesCfb8")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpDesCfb8")]
internal static partial IntPtr EvpDesCfb8();
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpDes3Cbc")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpDes3Cbc")]
internal static partial IntPtr EvpDes3Cbc();
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpDes3Ecb")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpDes3Ecb")]
internal static partial IntPtr EvpDes3Ecb();
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpDes3Cfb8")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpDes3Cfb8")]
internal static partial IntPtr EvpDes3Cfb8();
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpDes3Cfb64")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpDes3Cfb64")]
internal static partial IntPtr EvpDes3Cfb64();
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpRC2Cbc")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpRC2Cbc")]
internal static partial IntPtr EvpRC2Cbc();
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpRC2Ecb")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpRC2Ecb")]
internal static partial IntPtr EvpRC2Ecb();
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpChaCha20Poly1305")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpChaCha20Poly1305")]
internal static partial IntPtr EvpChaCha20Poly1305();
internal enum EvpCipherDirection : int
private static volatile IntPtr s_evpSha384;
private static volatile IntPtr s_evpSha512;
- [GeneratedDllImport(Libraries.CryptoNative)]
+ [LibraryImport(Libraries.CryptoNative)]
private static partial IntPtr CryptoNative_EvpMd5();
internal static IntPtr EvpMd5() =>
s_evpMd5 != IntPtr.Zero ? s_evpMd5 : (s_evpMd5 = CryptoNative_EvpMd5());
- [GeneratedDllImport(Libraries.CryptoNative)]
+ [LibraryImport(Libraries.CryptoNative)]
internal static partial IntPtr CryptoNative_EvpSha1();
internal static IntPtr EvpSha1() =>
s_evpSha1 != IntPtr.Zero ? s_evpSha1 : (s_evpSha1 = CryptoNative_EvpSha1());
- [GeneratedDllImport(Libraries.CryptoNative)]
+ [LibraryImport(Libraries.CryptoNative)]
internal static partial IntPtr CryptoNative_EvpSha256();
internal static IntPtr EvpSha256() =>
s_evpSha256 != IntPtr.Zero ? s_evpSha256 : (s_evpSha256 = CryptoNative_EvpSha256());
- [GeneratedDllImport(Libraries.CryptoNative)]
+ [LibraryImport(Libraries.CryptoNative)]
internal static partial IntPtr CryptoNative_EvpSha384();
internal static IntPtr EvpSha384() =>
s_evpSha384 != IntPtr.Zero ? s_evpSha384 : (s_evpSha384 = CryptoNative_EvpSha384());
- [GeneratedDllImport(Libraries.CryptoNative)]
+ [LibraryImport(Libraries.CryptoNative)]
internal static partial IntPtr CryptoNative_EvpSha512();
internal static IntPtr EvpSha512() =>
{
internal static partial class Crypto
{
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpMdCtxCreate")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpMdCtxCreate")]
internal static partial SafeEvpMdCtxHandle EvpMdCtxCreate(IntPtr type);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpMdCtxDestroy")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpMdCtxDestroy")]
internal static partial void EvpMdCtxDestroy(IntPtr ctx);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpDigestReset")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpDigestReset")]
internal static partial int EvpDigestReset(SafeEvpMdCtxHandle ctx, IntPtr type);
internal static int EvpDigestUpdate(SafeEvpMdCtxHandle ctx, ReadOnlySpan<byte> d, int cnt) =>
EvpDigestUpdate(ctx, ref MemoryMarshal.GetReference(d), cnt);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpDigestUpdate")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpDigestUpdate")]
private static partial int EvpDigestUpdate(SafeEvpMdCtxHandle ctx, ref byte d, int cnt);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpDigestFinalEx")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpDigestFinalEx")]
internal static partial int EvpDigestFinalEx(SafeEvpMdCtxHandle ctx, ref byte md, ref uint s);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpDigestCurrent")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpDigestCurrent")]
internal static partial int EvpDigestCurrent(SafeEvpMdCtxHandle ctx, ref byte md, ref uint s);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpDigestOneShot")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpDigestOneShot")]
internal static unsafe partial int EvpDigestOneShot(IntPtr type, byte* source, int sourceSize, byte* md, uint* mdSize);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpMdSize")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpMdSize")]
internal static partial int EvpMdSize(IntPtr md);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetMaxMdSize")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetMaxMdSize")]
private static partial int GetMaxMdSize();
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_Pbkdf2")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_Pbkdf2")]
private static unsafe partial int Pbkdf2(
byte* pPassword,
int passwordLength,
{
internal static partial class Crypto
{
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EcKeyCreateByKeyParameters", StringMarshalling = StringMarshalling.Utf8)]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EcKeyCreateByKeyParameters", StringMarshalling = StringMarshalling.Utf8)]
private static partial int EcKeyCreateByKeyParameters(
out SafeEcKeyHandle key,
string oid,
return key;
}
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EcKeyCreateByExplicitParameters")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EcKeyCreateByExplicitParameters")]
internal static partial SafeEcKeyHandle EcKeyCreateByExplicitParameters(
ECCurve.ECCurveType curveType,
byte[]? qx, int qxLength,
}
- [GeneratedDllImport(Libraries.CryptoNative)]
+ [LibraryImport(Libraries.CryptoNative)]
private static partial int CryptoNative_GetECKeyParameters(
SafeEcKeyHandle key,
[MarshalAs(UnmanagedType.Bool)] bool includePrivate,
return parameters;
}
- [GeneratedDllImport(Libraries.CryptoNative)]
+ [LibraryImport(Libraries.CryptoNative)]
private static partial int CryptoNative_GetECCurveParameters(
SafeEcKeyHandle key,
[MarshalAs(UnmanagedType.Bool)] bool includePrivate,
internal static bool EcDsaSign(ReadOnlySpan<byte> dgst, Span<byte> sig, out int siglen, SafeEcKeyHandle ecKey) =>
EcDsaSign(ref MemoryMarshal.GetReference(dgst), dgst.Length, ref MemoryMarshal.GetReference(sig), out siglen, ecKey);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EcDsaSign")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EcDsaSign")]
[return: MarshalAs(UnmanagedType.Bool)]
private static partial bool EcDsaSign(ref byte dgst, int dlen, ref byte sig, out int siglen, SafeEcKeyHandle ecKey);
* 0: incorrect signature
* -1: error
*/
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EcDsaVerify")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EcDsaVerify")]
private static partial int EcDsaVerify(ref byte dgst, int dgst_len, ref byte sigbuf, int sig_len, SafeEcKeyHandle ecKey);
// returns the maximum length of a DER encoded ECDSA signature created with this key.
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EcDsaSize")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EcDsaSize")]
private static partial int CryptoNative_EcDsaSize(SafeEcKeyHandle ecKey);
internal static int EcDsaSize(SafeEcKeyHandle ecKey)
{
internal static partial class Crypto
{
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EcKeyCreateByOid", StringMarshalling = StringMarshalling.Utf8)]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EcKeyCreateByOid", StringMarshalling = StringMarshalling.Utf8)]
private static partial SafeEcKeyHandle CryptoNative_EcKeyCreateByOid(string oid);
internal static SafeEcKeyHandle? EcKeyCreateByOid(string oid)
{
return handle;
}
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EcKeyDestroy")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EcKeyDestroy")]
internal static partial void EcKeyDestroy(IntPtr a);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EcKeyGenerateKey")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EcKeyGenerateKey")]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool EcKeyGenerateKey(SafeEcKeyHandle eckey);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EcKeyUpRef")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EcKeyUpRef")]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool EcKeyUpRef(IntPtr r);
- [GeneratedDllImport(Libraries.CryptoNative)]
+ [LibraryImport(Libraries.CryptoNative)]
private static partial int CryptoNative_EcKeyGetSize(SafeEcKeyHandle ecKey, out int keySize);
internal static int EcKeyGetSize(SafeEcKeyHandle key)
{
throw Interop.Crypto.CreateOpenSslCryptographicException();
}
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EcKeyGetCurveName2")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EcKeyGetCurveName2")]
private static partial int CryptoNative_EcKeyGetCurveName(SafeEcKeyHandle ecKey, out int nid);
internal static string EcKeyGetCurveName(SafeEcKeyHandle key)
{
internal static partial class Crypto
{
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpPkeyGetDsa")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpPkeyGetDsa")]
internal static partial SafeDsaHandle EvpPkeyGetDsa(SafeEvpPKeyHandle pkey);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpPkeySetDsa")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpPkeySetDsa")]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool EvpPkeySetDsa(SafeEvpPKeyHandle pkey, SafeDsaHandle key);
}
{
internal static partial class Crypto
{
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpPkeyGetEcKey")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpPkeyGetEcKey")]
internal static partial SafeEcKeyHandle EvpPkeyGetEcKey(SafeEvpPKeyHandle pkey);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpPkeySetEcKey")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpPkeySetEcKey")]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool EvpPkeySetEcKey(SafeEvpPKeyHandle pkey, SafeEcKeyHandle key);
}
{
internal static partial class Crypto
{
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpPKeyCtxCreate")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpPKeyCtxCreate")]
internal static partial SafeEvpPKeyCtxHandle EvpPKeyCtxCreate(SafeEvpPKeyHandle pkey, SafeEvpPKeyHandle peerkey, out uint secretLength);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpPKeyDeriveSecretAgreement")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpPKeyDeriveSecretAgreement")]
private static partial int EvpPKeyDeriveSecretAgreement(
ref byte secret,
uint secretLength,
SafeEvpPKeyCtxHandle ctx);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpPKeyCtxDestroy")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpPKeyCtxDestroy")]
internal static partial void EvpPKeyCtxDestroy(IntPtr ctx);
internal static void EvpPKeyDeriveSecretAgreement(SafeEvpPKeyCtxHandle ctx, Span<byte> destination)
{
internal static partial class Crypto
{
- [GeneratedDllImport(Libraries.CryptoNative)]
+ [LibraryImport(Libraries.CryptoNative)]
private static partial SafeEvpPKeyHandle CryptoNative_EvpPKeyCreateRsa(IntPtr rsa);
internal static SafeEvpPKeyHandle EvpPKeyCreateRsa(IntPtr rsa)
return pkey;
}
- [GeneratedDllImport(Libraries.CryptoNative)]
+ [LibraryImport(Libraries.CryptoNative)]
private static partial SafeEvpPKeyHandle CryptoNative_RsaGenerateKey(int keySize);
internal static SafeEvpPKeyHandle RsaGenerateKey(int keySize)
return pkey;
}
- [GeneratedDllImport(Libraries.CryptoNative)]
+ [LibraryImport(Libraries.CryptoNative)]
private static partial int CryptoNative_RsaDecrypt(
SafeEvpPKeyHandle pkey,
ref byte source,
return written;
}
- [GeneratedDllImport(Libraries.CryptoNative)]
+ [LibraryImport(Libraries.CryptoNative)]
private static partial int CryptoNative_RsaEncrypt(
SafeEvpPKeyHandle pkey,
ref byte source,
return written;
}
- [GeneratedDllImport(Libraries.CryptoNative)]
+ [LibraryImport(Libraries.CryptoNative)]
private static partial int CryptoNative_RsaSignHash(
SafeEvpPKeyHandle pkey,
RSASignaturePaddingMode paddingMode,
return written;
}
- [GeneratedDllImport(Libraries.CryptoNative)]
+ [LibraryImport(Libraries.CryptoNative)]
private static partial int CryptoNative_RsaVerifyHash(
SafeEvpPKeyHandle pkey,
RSASignaturePaddingMode paddingMode,
{
internal static partial class Crypto
{
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpPkeyCreate")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpPkeyCreate")]
internal static partial SafeEvpPKeyHandle EvpPkeyCreate();
- [GeneratedDllImport(Libraries.CryptoNative)]
+ [LibraryImport(Libraries.CryptoNative)]
private static partial SafeEvpPKeyHandle CryptoNative_EvpPKeyDuplicate(
SafeEvpPKeyHandle currentKey,
EvpAlgorithmId algorithmId);
return pkey;
}
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpPkeyDestroy")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpPkeyDestroy")]
internal static partial void EvpPkeyDestroy(IntPtr pkey);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpPKeySize")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpPKeySize")]
internal static partial int EvpPKeySize(SafeEvpPKeyHandle pkey);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_UpRefEvpPkey")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_UpRefEvpPkey")]
internal static partial int UpRefEvpPkey(SafeEvpPKeyHandle handle);
- [GeneratedDllImport(Libraries.CryptoNative)]
+ [LibraryImport(Libraries.CryptoNative)]
private static unsafe partial SafeEvpPKeyHandle CryptoNative_DecodeSubjectPublicKeyInfo(
byte* buf,
int len,
int algId);
- [GeneratedDllImport(Libraries.CryptoNative)]
+ [LibraryImport(Libraries.CryptoNative)]
private static unsafe partial SafeEvpPKeyHandle CryptoNative_DecodePkcs8PrivateKey(
byte* buf,
int len,
return handle;
}
- [GeneratedDllImport(Libraries.CryptoNative)]
+ [LibraryImport(Libraries.CryptoNative)]
private static partial int CryptoNative_GetPkcs8PrivateKeySize(IntPtr pkey, out int p8size);
private static int GetPkcs8PrivateKeySize(IntPtr pkey)
}
}
- [GeneratedDllImport(Libraries.CryptoNative)]
+ [LibraryImport(Libraries.CryptoNative)]
private static unsafe partial int CryptoNative_EncodePkcs8PrivateKey(IntPtr pkey, byte* buf);
internal static ArraySegment<byte> RentEncodePkcs8PrivateKey(SafeEvpPKeyHandle pkey)
}
}
- [GeneratedDllImport(Libraries.CryptoNative)]
+ [LibraryImport(Libraries.CryptoNative)]
private static partial int CryptoNative_GetSubjectPublicKeyInfoSize(IntPtr pkey);
private static int GetSubjectPublicKeyInfoSize(IntPtr pkey)
return ret;
}
- [GeneratedDllImport(Libraries.CryptoNative)]
+ [LibraryImport(Libraries.CryptoNative)]
private static unsafe partial int CryptoNative_EncodeSubjectPublicKeyInfo(IntPtr pkey, byte* buf);
internal static ArraySegment<byte> RentEncodeSubjectPublicKeyInfo(SafeEvpPKeyHandle pkey)
{
internal static partial class Crypto
{
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_HmacCreate")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_HmacCreate")]
internal static partial SafeHmacCtxHandle HmacCreate(ref byte key, int keyLen, IntPtr md);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_HmacDestroy")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_HmacDestroy")]
internal static partial void HmacDestroy(IntPtr ctx);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_HmacReset")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_HmacReset")]
internal static partial int HmacReset(SafeHmacCtxHandle ctx);
internal static int HmacUpdate(SafeHmacCtxHandle ctx, ReadOnlySpan<byte> data, int len) =>
HmacUpdate(ctx, ref MemoryMarshal.GetReference(data), len);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_HmacUpdate")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_HmacUpdate")]
private static partial int HmacUpdate(SafeHmacCtxHandle ctx, ref byte data, int len);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_HmacFinal")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_HmacFinal")]
internal static partial int HmacFinal(SafeHmacCtxHandle ctx, ref byte data, ref int len);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_HmacCurrent")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_HmacCurrent")]
internal static partial int HmacCurrent(SafeHmacCtxHandle ctx, ref byte data, ref int len);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_HmacOneShot")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_HmacOneShot")]
private static unsafe partial int HmacOneShot(IntPtr type, byte* key, int keySize, byte* source, int sourceSize, byte* md, int* mdSize);
internal static unsafe int HmacOneShot(IntPtr type, ReadOnlySpan<byte> key, ReadOnlySpan<byte> source, Span<byte> destination)
// No-op that exists to provide a hook for other static constructors.
}
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EnsureOpenSslInitialized")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EnsureOpenSslInitialized")]
private static partial int EnsureOpenSslInitialized();
}
}
private static volatile bool s_loadedLegacy;
private static readonly object s_legacyLoadLock = new object();
- [GeneratedDllImport(Libraries.CryptoNative)]
+ [LibraryImport(Libraries.CryptoNative)]
private static partial void CryptoNative_RegisterLegacyAlgorithms();
internal static void EnsureLegacyAlgorithmsRegistered()
{
internal static partial class Crypto
{
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_LookupFriendlyNameByOid", StringMarshalling = StringMarshalling.Utf8)]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_LookupFriendlyNameByOid", StringMarshalling = StringMarshalling.Utf8)]
internal static partial int LookupFriendlyNameByOid(string oidValue, ref IntPtr friendlyNamePtr);
}
}
{
internal static partial class Crypto
{
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_OcspRequestDestroy")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_OcspRequestDestroy")]
internal static partial void OcspRequestDestroy(IntPtr ocspReq);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetOcspRequestDerSize")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetOcspRequestDerSize")]
internal static partial int GetOcspRequestDerSize(SafeOcspRequestHandle req);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EncodeOcspRequest")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EncodeOcspRequest")]
internal static partial int EncodeOcspRequest(SafeOcspRequestHandle req, byte[] buf);
- [GeneratedDllImport(Libraries.CryptoNative)]
+ [LibraryImport(Libraries.CryptoNative)]
private static partial SafeOcspResponseHandle CryptoNative_DecodeOcspResponse(ref byte buf, int len);
internal static SafeOcspResponseHandle DecodeOcspResponse(ReadOnlySpan<byte> buf)
buf.Length);
}
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_OcspResponseDestroy")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_OcspResponseDestroy")]
internal static partial void OcspResponseDestroy(IntPtr ocspReq);
- [GeneratedDllImport(Libraries.CryptoNative, StringMarshalling = StringMarshalling.Utf8)]
+ [LibraryImport(Libraries.CryptoNative, StringMarshalling = StringMarshalling.Utf8)]
private static partial int CryptoNative_X509ChainGetCachedOcspStatus(
SafeX509StoreCtxHandle ctx,
string cachePath,
return response;
}
- [GeneratedDllImport(Libraries.CryptoNative, StringMarshalling = StringMarshalling.Utf8)]
+ [LibraryImport(Libraries.CryptoNative, StringMarshalling = StringMarshalling.Utf8)]
private static partial int CryptoNative_X509ChainVerifyOcsp(
SafeX509StoreCtxHandle ctx,
SafeOcspRequestHandle req,
return response;
}
- [GeneratedDllImport(Libraries.CryptoNative)]
+ [LibraryImport(Libraries.CryptoNative)]
private static partial SafeOcspRequestHandle CryptoNative_X509ChainBuildOcspRequest(
SafeX509StoreCtxHandle storeCtx,
int chainDepth);
{
internal static partial class OpenSslNoInit
{
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_OpenSslAvailable")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_OpenSslAvailable")]
private static partial int OpenSslAvailable();
private static readonly Lazy<bool> s_openSslAvailable =
{
internal static partial class OpenSsl
{
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_OpenSslGetProtocolSupport")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_OpenSslGetProtocolSupport")]
internal static partial int OpenSslGetProtocolSupport(int protocol);
}
}
{
internal static partial class OpenSsl
{
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_OpenSslVersionNumber")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_OpenSslVersionNumber")]
internal static partial long OpenSslVersionNumber();
}
}
{
internal static partial class Crypto
{
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_PemReadBioPkcs7")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_PemReadBioPkcs7")]
internal static partial SafePkcs7Handle PemReadBioPkcs7(SafeBioHandle bp);
internal static SafePkcs7Handle DecodePkcs7(ReadOnlySpan<byte> buf) =>
DecodePkcs7(ref MemoryMarshal.GetReference(buf), buf.Length);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DecodePkcs7")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DecodePkcs7")]
private static partial SafePkcs7Handle DecodePkcs7(ref byte buf, int len);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_D2IPkcs7Bio")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_D2IPkcs7Bio")]
internal static partial SafePkcs7Handle D2IPkcs7Bio(SafeBioHandle bp);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_Pkcs7CreateCertificateCollection")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_Pkcs7CreateCertificateCollection")]
internal static partial SafePkcs7Handle Pkcs7CreateCertificateCollection(SafeX509StackHandle certs);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_Pkcs7Destroy")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_Pkcs7Destroy")]
internal static partial void Pkcs7Destroy(IntPtr p7);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetPkcs7Certificates")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetPkcs7Certificates")]
private static partial int GetPkcs7Certificates(SafePkcs7Handle p7, out SafeSharedX509StackHandle certs);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetPkcs7DerSize")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetPkcs7DerSize")]
internal static partial int GetPkcs7DerSize(SafePkcs7Handle p7);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EncodePkcs7")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EncodePkcs7")]
internal static partial int EncodePkcs7(SafePkcs7Handle p7, byte[] buf);
internal static SafeSharedX509StackHandle GetPkcs7Certificates(SafePkcs7Handle p7)
return CryptoNative_GetRandomBytes(pbBuffer, count) != 0;
}
- [GeneratedDllImport(Libraries.CryptoNative)]
+ [LibraryImport(Libraries.CryptoNative)]
private static unsafe partial int CryptoNative_GetRandomBytes(byte* buf, int num);
}
}
{
internal static partial class Ssl
{
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslCtxSetProtocolOptions")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslCtxSetProtocolOptions")]
internal static partial void SslCtxSetProtocolOptions(IntPtr ctx, SslProtocols protocols);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslCtxSetProtocolOptions")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslCtxSetProtocolOptions")]
internal static partial void SslCtxSetProtocolOptions(SafeSslContextHandle ctx, SslProtocols protocols);
}
}
internal const int SSL_TLSEXT_ERR_ALERT_FATAL = 2;
internal const int SSL_TLSEXT_ERR_NOACK = 3;
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EnsureLibSslInitialized")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EnsureLibSslInitialized")]
internal static partial void EnsureLibSslInitialized();
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslV2_3Method")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslV2_3Method")]
internal static partial IntPtr SslV2_3Method();
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslCreate")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslCreate")]
internal static partial SafeSslHandle SslCreate(SafeSslContextHandle ctx);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslGetError")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslGetError")]
internal static partial SslErrorCode SslGetError(SafeSslHandle ssl, int ret);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslGetError")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslGetError")]
internal static partial SslErrorCode SslGetError(IntPtr ssl, int ret);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslSetQuietShutdown")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslSetQuietShutdown")]
internal static partial void SslSetQuietShutdown(SafeSslHandle ssl, int mode);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslDestroy")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslDestroy")]
internal static partial void SslDestroy(IntPtr ssl);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslSetConnectState")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslSetConnectState")]
internal static partial void SslSetConnectState(SafeSslHandle ssl);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslSetAcceptState")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslSetAcceptState")]
internal static partial void SslSetAcceptState(SafeSslHandle ssl);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslSetAlpnProtos")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslSetAlpnProtos")]
internal static unsafe partial int SslSetAlpnProtos(SafeSslHandle ssl, byte* protos, int len);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslGetVersion")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslGetVersion")]
internal static partial IntPtr SslGetVersion(SafeSslHandle ssl);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslSetTlsExtHostName", StringMarshalling = StringMarshalling.Utf8)]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslSetTlsExtHostName", StringMarshalling = StringMarshalling.Utf8)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool SslSetTlsExtHostName(SafeSslHandle ssl, string host);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslGet0AlpnSelected")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslGet0AlpnSelected")]
internal static partial void SslGetAlpnSelected(SafeSslHandle ssl, out IntPtr protocol, out int len);
internal static byte[]? SslGetAlpnSelected(SafeSslHandle ssl)
return result;
}
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslWrite", SetLastError = true)]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslWrite", SetLastError = true)]
internal static partial int SslWrite(SafeSslHandle ssl, ref byte buf, int num, out SslErrorCode error);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslRead", SetLastError = true)]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslRead", SetLastError = true)]
internal static partial int SslRead(SafeSslHandle ssl, ref byte buf, int num, out SslErrorCode error);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslRenegotiate")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslRenegotiate")]
internal static partial int SslRenegotiate(SafeSslHandle ssl, out SslErrorCode error);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_IsSslRenegotiatePending")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_IsSslRenegotiatePending")]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool IsSslRenegotiatePending(SafeSslHandle ssl);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslShutdown")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslShutdown")]
internal static partial int SslShutdown(IntPtr ssl);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslShutdown")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslShutdown")]
internal static partial int SslShutdown(SafeSslHandle ssl);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslSetBio")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslSetBio")]
internal static partial void SslSetBio(SafeSslHandle ssl, SafeBioHandle rbio, SafeBioHandle wbio);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslDoHandshake", SetLastError = true)]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslDoHandshake", SetLastError = true)]
internal static partial int SslDoHandshake(SafeSslHandle ssl, out SslErrorCode error);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_IsSslStateOK")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_IsSslStateOK")]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool IsSslStateOK(SafeSslHandle ssl);
// NOTE: this is just an (unsafe) overload to the BioWrite method from Interop.Bio.cs.
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_BioWrite")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_BioWrite")]
internal static unsafe partial int BioWrite(SafeBioHandle b, byte* data, int len);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_BioWrite")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_BioWrite")]
internal static partial int BioWrite(SafeBioHandle b, ref byte data, int len);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslGetPeerCertificate")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslGetPeerCertificate")]
internal static partial SafeX509Handle SslGetPeerCertificate(SafeSslHandle ssl);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslGetPeerCertChain")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslGetPeerCertChain")]
internal static partial SafeSharedX509StackHandle SslGetPeerCertChain(SafeSslHandle ssl);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslGetPeerFinished")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslGetPeerFinished")]
internal static partial int SslGetPeerFinished(SafeSslHandle ssl, IntPtr buf, int count);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslGetFinished")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslGetFinished")]
internal static partial int SslGetFinished(SafeSslHandle ssl, IntPtr buf, int count);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslSessionReused")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslSessionReused")]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool SslSessionReused(SafeSslHandle ssl);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslGetClientCAList")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslGetClientCAList")]
private static partial SafeSharedX509NameStackHandle SslGetClientCAList_private(SafeSslHandle ssl);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslGetCurrentCipherId")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslGetCurrentCipherId")]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool SslGetCurrentCipherId(SafeSslHandle ssl, out int cipherId);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetOpenSslCipherSuiteName")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetOpenSslCipherSuiteName")]
private static partial IntPtr GetOpenSslCipherSuiteName(SafeSslHandle ssl, int cipherSuite, out int isTls12OrLower);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SetCiphers")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SetCiphers")]
[return: MarshalAs(UnmanagedType.Bool)]
internal static unsafe partial bool SslSetCiphers(SafeSslHandle ssl, byte* cipherList, byte* cipherSuites);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslSetVerifyPeer")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslSetVerifyPeer")]
internal static partial void SslSetVerifyPeer(SafeSslHandle ssl);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslGetData")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslGetData")]
internal static partial IntPtr SslGetData(IntPtr ssl);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslSetData")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslSetData")]
internal static partial int SslSetData(SafeSslHandle ssl, IntPtr data);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslSetData")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslSetData")]
internal static partial int SslSetData(IntPtr ssl, IntPtr data);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslUseCertificate")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslUseCertificate")]
internal static partial int SslUseCertificate(SafeSslHandle ssl, SafeX509Handle certPtr);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslUsePrivateKey")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslUsePrivateKey")]
internal static partial int SslUsePrivateKey(SafeSslHandle ssl, SafeEvpPKeyHandle keyPtr);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslSetClientCertCallback")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslSetClientCertCallback")]
internal static unsafe partial void SslSetClientCertCallback(SafeSslHandle ssl, int set);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslSetPostHandshakeAuth")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslSetPostHandshakeAuth")]
internal static partial void SslSetPostHandshakeAuth(SafeSslHandle ssl, int value);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_Tls13Supported")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_Tls13Supported")]
private static partial int Tls13SupportedImpl();
internal static class Capabilities
}
}
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslAddExtraChainCert")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslAddExtraChainCert")]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool SslAddExtraChainCert(SafeSslHandle ssl, SafeX509Handle x509);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslAddClientCAs")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslAddClientCAs")]
[return: MarshalAs(UnmanagedType.Bool)]
private static unsafe partial bool SslAddClientCAs(SafeSslHandle ssl, IntPtr* x509s, int count);
{
internal static partial class Ssl
{
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslCtxCreate")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslCtxCreate")]
internal static partial SafeSslContextHandle SslCtxCreate(IntPtr method);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslCtxDestroy")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslCtxDestroy")]
internal static partial void SslCtxDestroy(IntPtr ctx);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslCtxSetAlpnSelectCb")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslCtxSetAlpnSelectCb")]
internal static unsafe partial void SslCtxSetAlpnSelectCb(SafeSslContextHandle ctx, delegate* unmanaged<IntPtr, byte**, byte*, byte*, uint, IntPtr, int> callback, IntPtr arg);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslCtxSetCaching")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslCtxSetCaching")]
internal static unsafe partial void SslCtxSetCaching(SafeSslContextHandle ctx, int mode);
internal static bool AddExtraChainCertificates(SafeSslContextHandle ctx, X509Certificate2[] chain)
{
internal static partial class Ssl
{
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslCtxAddExtraChainCert")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslCtxAddExtraChainCert")]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool SslCtxAddExtraChainCert(SafeSslContextHandle ctx, SafeX509Handle x509);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslCtxUseCertificate")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslCtxUseCertificate")]
internal static partial int SslCtxUseCertificate(SafeSslContextHandle ctx, SafeX509Handle certPtr);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslCtxUsePrivateKey")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslCtxUsePrivateKey")]
internal static partial int SslCtxUsePrivateKey(SafeSslContextHandle ctx, SafeEvpPKeyHandle keyPtr);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslCtxCheckPrivateKey")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslCtxCheckPrivateKey")]
internal static partial int SslCtxCheckPrivateKey(SafeSslContextHandle ctx);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslCtxSetQuietShutdown")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslCtxSetQuietShutdown")]
internal static partial void SslCtxSetQuietShutdown(SafeSslContextHandle ctx);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslCtxSetCiphers")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslCtxSetCiphers")]
[return: MarshalAs(UnmanagedType.Bool)]
internal static unsafe partial bool SslCtxSetCiphers(SafeSslContextHandle ctx, byte* cipherList, byte* cipherSuites);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslCtxSetEncryptionPolicy")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslCtxSetEncryptionPolicy")]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool SetEncryptionPolicy(SafeSslContextHandle ctx, EncryptionPolicy policy);
}
{
internal delegate int X509StoreVerifyCallback(int ok, IntPtr ctx);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509NotBefore")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509NotBefore")]
internal static partial IntPtr GetX509NotBefore(SafeX509Handle x509);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509NotAfter")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509NotAfter")]
internal static partial IntPtr GetX509NotAfter(SafeX509Handle x509);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509SignatureAlgorithm")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509SignatureAlgorithm")]
internal static partial IntPtr GetX509SignatureAlgorithm(SafeX509Handle x509);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509PublicKeyAlgorithm")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509PublicKeyAlgorithm")]
internal static partial IntPtr GetX509PublicKeyAlgorithm(SafeX509Handle x509);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509PublicKeyBytes")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509PublicKeyBytes")]
internal static partial IntPtr GetX509PublicKeyBytes(SafeX509Handle x509);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509EvpPublicKey")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509EvpPublicKey")]
internal static partial SafeEvpPKeyHandle GetX509EvpPublicKey(SafeX509Handle x509);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DecodeX509Crl")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DecodeX509Crl")]
internal static partial SafeX509CrlHandle DecodeX509Crl(byte[] buf, int len);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DecodeX509")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DecodeX509")]
internal static partial SafeX509Handle DecodeX509(ref byte buf, int len);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DecodeX509")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DecodeX509")]
internal static partial SafeX509Handle DecodeX509(IntPtr buf, int len);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509DerSize")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509DerSize")]
internal static partial int GetX509DerSize(SafeX509Handle x);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EncodeX509")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EncodeX509")]
internal static partial int EncodeX509(SafeX509Handle x, byte[] buf);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509Destroy")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509Destroy")]
internal static partial void X509Destroy(IntPtr a);
/// <summary>
/// Clone the input certificate into a new object.
/// </summary>
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509Duplicate")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509Duplicate")]
internal static partial SafeX509Handle X509Duplicate(IntPtr handle);
/// <summary>
/// Clone the input certificate into a new object.
/// </summary>
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509Duplicate")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509Duplicate")]
internal static partial SafeX509Handle X509Duplicate(SafeX509Handle handle);
/// <summary>
/// Increment the native reference count of the certificate to protect against
/// a free from another pointer-holder.
/// </summary>
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509UpRef")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509UpRef")]
internal static partial SafeX509Handle X509UpRef(IntPtr handle);
/// <summary>
/// Increment the native reference count of the certificate to protect against
/// a free from another pointer-holder.
/// </summary>
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509UpRef")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509UpRef")]
internal static partial SafeX509Handle X509UpRef(SafeX509Handle handle);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_PemReadX509FromBio")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_PemReadX509FromBio")]
internal static partial SafeX509Handle PemReadX509FromBio(SafeBioHandle bio);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_PemReadX509FromBioAux")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_PemReadX509FromBioAux")]
internal static partial SafeX509Handle PemReadX509FromBioAux(SafeBioHandle bio);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509GetSerialNumber")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509GetSerialNumber")]
private static partial SafeSharedAsn1IntegerHandle X509GetSerialNumber_private(SafeX509Handle x);
internal static SafeSharedAsn1IntegerHandle X509GetSerialNumber(SafeX509Handle x)
x);
}
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509GetIssuerName")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509GetIssuerName")]
internal static partial IntPtr X509GetIssuerName(SafeX509Handle x);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509GetSubjectName")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509GetSubjectName")]
internal static partial IntPtr X509GetSubjectName(SafeX509Handle x);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509CheckPurpose")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509CheckPurpose")]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool X509CheckPurpose(SafeX509Handle x, int id, int ca);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509IssuerNameHash")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509IssuerNameHash")]
internal static partial ulong X509IssuerNameHash(SafeX509Handle x);
- [GeneratedDllImport(Libraries.CryptoNative)]
+ [LibraryImport(Libraries.CryptoNative)]
private static partial SafeSharedAsn1OctetStringHandle CryptoNative_X509FindExtensionData(
SafeX509Handle x,
int extensionNid);
extensionNid);
}
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509GetExtCount")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509GetExtCount")]
internal static partial int X509GetExtCount(SafeX509Handle x);
// Returns a pointer already being tracked by the SafeX509Handle, shouldn't be SafeHandle tracked/freed.
// Bounds checking is in place for "loc", IntPtr.Zero is returned on violations.
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509GetExt")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509GetExt")]
internal static partial IntPtr X509GetExt(SafeX509Handle x, int loc);
// Returns a pointer already being tracked by a SafeX509Handle, shouldn't be SafeHandle tracked/freed.
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509ExtensionGetOid")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509ExtensionGetOid")]
internal static partial IntPtr X509ExtensionGetOid(IntPtr ex);
// Returns a pointer already being tracked by a SafeX509Handle, shouldn't be SafeHandle tracked/freed.
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509ExtensionGetData")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509ExtensionGetData")]
internal static partial IntPtr X509ExtensionGetData(IntPtr ex);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509ExtensionGetCritical")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509ExtensionGetCritical")]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool X509ExtensionGetCritical(IntPtr ex);
- [GeneratedDllImport(Libraries.CryptoNative)]
+ [LibraryImport(Libraries.CryptoNative)]
private static partial SafeX509StoreHandle CryptoNative_X509ChainNew(SafeX509StackHandle systemTrust, SafeX509StackHandle userTrust);
internal static SafeX509StoreHandle X509ChainNew(SafeX509StackHandle systemTrust, SafeX509StackHandle userTrust)
return store;
}
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509StoreDestory")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509StoreDestory")]
internal static partial void X509StoreDestory(IntPtr v);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509StoreAddCrl")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509StoreAddCrl")]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool X509StoreAddCrl(SafeX509StoreHandle ctx, SafeX509CrlHandle x);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509StoreSetRevocationFlag")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509StoreSetRevocationFlag")]
[return: MarshalAs(UnmanagedType.Bool)]
private static partial bool CryptoNative_X509StoreSetRevocationFlag(SafeX509StoreHandle ctx, X509RevocationFlag revocationFlag);
}
}
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509StoreCtxInit")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509StoreCtxInit")]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool X509StoreCtxInit(
SafeX509StoreCtxHandle ctx,
SafeX509Handle x509,
SafeX509StackHandle extraCerts);
- [GeneratedDllImport(Libraries.CryptoNative)]
+ [LibraryImport(Libraries.CryptoNative)]
private static partial int CryptoNative_X509VerifyCert(SafeX509StoreCtxHandle ctx);
internal static bool X509VerifyCert(SafeX509StoreCtxHandle ctx)
return result != 0;
}
- [GeneratedDllImport(Libraries.CryptoNative)]
+ [LibraryImport(Libraries.CryptoNative)]
internal static partial int CryptoNative_X509StoreCtxGetError(SafeX509StoreCtxHandle ctx);
internal static X509VerifyStatusCode X509StoreCtxGetError(SafeX509StoreCtxHandle ctx)
return (X509VerifyStatusCode)CryptoNative_X509StoreCtxGetError(ctx);
}
- [GeneratedDllImport(Libraries.CryptoNative)]
+ [LibraryImport(Libraries.CryptoNative)]
private static partial int CryptoNative_X509StoreCtxReset(SafeX509StoreCtxHandle ctx);
internal static void X509StoreCtxReset(SafeX509StoreCtxHandle ctx)
}
}
- [GeneratedDllImport(Libraries.CryptoNative)]
+ [LibraryImport(Libraries.CryptoNative)]
private static partial int CryptoNative_X509StoreCtxRebuildChain(SafeX509StoreCtxHandle ctx);
internal static bool X509StoreCtxRebuildChain(SafeX509StoreCtxHandle ctx)
return result != 0;
}
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509StoreCtxGetErrorDepth")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509StoreCtxGetErrorDepth")]
internal static partial int X509StoreCtxGetErrorDepth(SafeX509StoreCtxHandle ctx);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509StoreCtxSetVerifyCallback")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509StoreCtxSetVerifyCallback")]
internal static partial void X509StoreCtxSetVerifyCallback(SafeX509StoreCtxHandle ctx, X509StoreVerifyCallback callback);
internal static string GetX509VerifyCertErrorString(int n)
return Marshal.PtrToStringAnsi(X509VerifyCertErrorString(n))!;
}
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509VerifyCertErrorString")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509VerifyCertErrorString")]
private static partial IntPtr X509VerifyCertErrorString(int n);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509CrlDestroy")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509CrlDestroy")]
internal static partial void X509CrlDestroy(IntPtr a);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_PemWriteBioX509Crl")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_PemWriteBioX509Crl")]
internal static partial int PemWriteBioX509Crl(SafeBioHandle bio, SafeX509CrlHandle crl);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_PemReadBioX509Crl")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_PemReadBioX509Crl")]
internal static partial SafeX509CrlHandle PemReadBioX509Crl(SafeBioHandle bio);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509SubjectPublicKeyInfoDerSize")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509SubjectPublicKeyInfoDerSize")]
internal static partial int GetX509SubjectPublicKeyInfoDerSize(SafeX509Handle x509);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EncodeX509SubjectPublicKeyInfo")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EncodeX509SubjectPublicKeyInfo")]
internal static partial int EncodeX509SubjectPublicKeyInfo(SafeX509Handle x509, byte[] buf);
internal enum X509VerifyStatusCodeUniversal
{
internal static partial class Crypto
{
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509ExtensionCreateByObj")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509ExtensionCreateByObj")]
internal static partial SafeX509ExtensionHandle X509ExtensionCreateByObj(
SafeAsn1ObjectHandle oid,
[MarshalAs(UnmanagedType.Bool)] bool isCritical,
SafeAsn1OctetStringHandle data);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509ExtensionDestroy")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509ExtensionDestroy")]
internal static partial int X509ExtensionDestroy(IntPtr x);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509V3ExtPrint")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509V3ExtPrint")]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool X509V3ExtPrint(SafeBioHandle buf, SafeX509ExtensionHandle ext);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DecodeX509BasicConstraints2Extension")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DecodeX509BasicConstraints2Extension")]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool DecodeX509BasicConstraints2Extension(
byte[] encoded,
[MarshalAs(UnmanagedType.Bool)] out bool hasPathLengthConstraint,
out int pathLengthConstraint);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DecodeExtendedKeyUsage")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DecodeExtendedKeyUsage")]
internal static partial SafeEkuExtensionHandle DecodeExtendedKeyUsage(byte[] buf, int len);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_ExtendedKeyUsageDestory")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_ExtendedKeyUsageDestory")]
internal static partial void ExtendedKeyUsageDestory(IntPtr a);
}
}
{
internal static partial class Crypto
{
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509NameStackFieldCount")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509NameStackFieldCount")]
internal static partial int GetX509NameStackFieldCount(SafeSharedX509NameStackHandle sk);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509NameStackField")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509NameStackField")]
private static partial SafeSharedX509NameHandle GetX509NameStackField_private(SafeSharedX509NameStackHandle sk,
int loc);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509NameRawBytes")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509NameRawBytes")]
private static partial int GetX509NameRawBytes(SafeSharedX509NameHandle x509Name, byte[]? buf, int cBuf);
internal static X500DistinguishedName LoadX500Name(SafeSharedX509NameHandle namePtr)
{
internal static partial class Crypto
{
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_NewX509Stack")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_NewX509Stack")]
internal static partial SafeX509StackHandle NewX509Stack();
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_RecursiveFreeX509Stack")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_RecursiveFreeX509Stack")]
internal static partial void RecursiveFreeX509Stack(IntPtr stack);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509StackFieldCount")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509StackFieldCount")]
internal static partial int GetX509StackFieldCount(SafeX509StackHandle stack);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509StackFieldCount")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509StackFieldCount")]
internal static partial int GetX509StackFieldCount(SafeSharedX509StackHandle stack);
/// <summary>
/// Gets a pointer to a certificate within a STACK_OF(X509). This pointer will later
/// be freed, so it should be cloned via new X509Certificate2(IntPtr)
/// </summary>
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509StackField")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509StackField")]
internal static partial IntPtr GetX509StackField(SafeX509StackHandle stack, int loc);
/// <summary>
/// Gets a pointer to a certificate within a STACK_OF(X509). This pointer will later
/// be freed, so it should be cloned via new X509Certificate2(IntPtr)
/// </summary>
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509StackField")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509StackField")]
internal static partial IntPtr GetX509StackField(SafeSharedX509StackHandle stack, int loc);
- [GeneratedDllImport(Libraries.CryptoNative, StringMarshalling = StringMarshalling.Utf8)]
+ [LibraryImport(Libraries.CryptoNative, StringMarshalling = StringMarshalling.Utf8)]
private static partial int CryptoNative_X509StackAddDirectoryStore(SafeX509StackHandle stack, string storePath);
internal static void X509StackAddDirectoryStore(SafeX509StackHandle stack, string storePath)
}
}
- [GeneratedDllImport(Libraries.CryptoNative)]
+ [LibraryImport(Libraries.CryptoNative)]
private static partial int CryptoNative_X509StackAddMultiple(SafeX509StackHandle dest, SafeX509StackHandle src);
internal static void X509StackAddMultiple(SafeX509StackHandle dest, SafeX509StackHandle src)
{
internal static partial class Crypto
{
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509StoreCtxCreate")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509StoreCtxCreate")]
internal static partial SafeX509StoreCtxHandle X509StoreCtxCreate();
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509StoreCtxDestroy")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509StoreCtxDestroy")]
internal static partial void X509StoreCtxDestroy(IntPtr v);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509StoreCtxGetChain")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509StoreCtxGetChain")]
internal static partial SafeX509StackHandle X509StoreCtxGetChain(SafeX509StoreCtxHandle ctx);
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509StoreCtxGetCurrentCert")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509StoreCtxGetCurrentCert")]
internal static partial SafeX509Handle X509StoreCtxGetCurrentCert(SafeX509StoreCtxHandle ctx);
- [GeneratedDllImport(Libraries.CryptoNative)]
+ [LibraryImport(Libraries.CryptoNative)]
private static partial int CryptoNative_X509StoreCtxCommitToChain(SafeX509StoreCtxHandle ctx);
internal static void X509StoreCtxCommitToChain(SafeX509StoreCtxHandle ctx)
}
}
- [GeneratedDllImport(Libraries.CryptoNative)]
+ [LibraryImport(Libraries.CryptoNative)]
private static partial int CryptoNative_X509StoreCtxResetForSignatureError(
SafeX509StoreCtxHandle ctx,
out SafeX509StoreHandle newStore);
}
}
- [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509StoreCtxGetSharedUntrusted")]
+ [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509StoreCtxGetSharedUntrusted")]
private static partial SafeSharedX509StackHandle X509StoreCtxGetSharedUntrusted_private(SafeX509StoreCtxHandle ctx);
internal static SafeSharedX509StackHandle X509StoreCtxGetSharedUntrusted(SafeX509StoreCtxHandle ctx)
{
internal static partial class @libc
{
- [GeneratedDllImport(Libraries.libc, EntryPoint = "getppid")]
+ [LibraryImport(Libraries.libc, EntryPoint = "getppid")]
internal static partial int GetParentPid();
}
}
{
internal static partial class Activeds
{
- [GeneratedDllImport(Interop.Libraries.Activeds, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Interop.Libraries.Activeds, StringMarshalling = StringMarshalling.Utf16)]
internal static partial int ADsOpenObject(string path, string? userName, string? password, int flags, ref Guid iid, out IntPtr ppObject);
}
}
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)]
+ [LibraryImport(Libraries.Advapi32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static unsafe partial bool AdjustTokenPrivileges(
SafeTokenHandle TokenHandle,
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Libraries.Advapi32)]
+ [LibraryImport(Libraries.Advapi32)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static unsafe partial bool AllocateLocallyUniqueId(LUID* Luid);
}
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "ChangeServiceConfig2W", SetLastError = true)]
+ [LibraryImport(Libraries.Advapi32, EntryPoint = "ChangeServiceConfig2W", SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool ChangeServiceConfig2(SafeServiceHandle serviceHandle, uint infoLevel, ref SERVICE_DESCRIPTION serviceDesc);
}
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Interop.Libraries.Advapi32, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Advapi32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool CheckTokenMembership(
SafeAccessTokenHandle TokenHandle,
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "ClearEventLogW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Advapi32, EntryPoint = "ClearEventLogW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool ClearEventLog(SafeEventLogReadHandle hEventLog, string lpBackupFileName);
}
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)]
+ [LibraryImport(Libraries.Advapi32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool CloseEventLog(IntPtr hEventLog);
}
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)]
+ [LibraryImport(Libraries.Advapi32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool CloseServiceHandle(IntPtr handle);
}
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)]
+ [LibraryImport(Libraries.Advapi32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static unsafe partial bool ControlService(SafeServiceHandle serviceHandle, int control, SERVICE_STATUS* pStatus);
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Interop.Libraries.Advapi32, EntryPoint = "ConvertSecurityDescriptorToStringSecurityDescriptorW",
+ [LibraryImport(Interop.Libraries.Advapi32, EntryPoint = "ConvertSecurityDescriptorToStringSecurityDescriptorW",
SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool ConvertSdToStringSd(
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "ConvertSidToStringSidW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Advapi32, EntryPoint = "ConvertSidToStringSidW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
internal static partial BOOL ConvertSidToStringSid(IntPtr sid, out string stringSid);
}
}
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Interop.Libraries.Advapi32, EntryPoint = "ConvertStringSecurityDescriptorToSecurityDescriptorW",
+ [LibraryImport(Interop.Libraries.Advapi32, EntryPoint = "ConvertStringSecurityDescriptorToSecurityDescriptorW",
SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool ConvertStringSdToSd(
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Interop.Libraries.Advapi32, EntryPoint = "ConvertStringSecurityDescriptorToSecurityDescriptorW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Interop.Libraries.Advapi32, EntryPoint = "ConvertStringSecurityDescriptorToSecurityDescriptorW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool ConvertStringSecurityDescriptorToSecurityDescriptor(
string StringSecurityDescriptor,
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Interop.Libraries.Advapi32, EntryPoint = "ConvertStringSidToSidW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Interop.Libraries.Advapi32, EntryPoint = "ConvertStringSidToSidW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
internal static partial BOOL ConvertStringSidToSid(
string stringSid,
out IntPtr ByteArray);
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Interop.Libraries.Advapi32, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Advapi32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool CopySid(int destinationLength, IntPtr pSidDestination, IntPtr pSidSource);
}
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "CreateProcessWithLogonW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Advapi32, EntryPoint = "CreateProcessWithLogonW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static unsafe partial bool CreateProcessWithLogonW(
string userName,
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "CreateServiceW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Advapi32, EntryPoint = "CreateServiceW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
public static partial IntPtr CreateService(SafeServiceHandle databaseHandle, string serviceName, string displayName, int access, int serviceType,
int startType, int errorControl, string binaryPath, string loadOrderGroup, IntPtr pTagId, string dependencies,
string servicesStartName, string password);
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Interop.Libraries.Advapi32, EntryPoint = "CreateWellKnownSid", SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Advapi32, EntryPoint = "CreateWellKnownSid", SetLastError = true)]
internal static partial int CreateWellKnownSid(
int sidType,
byte[]? domainSid,
CRYPT_VERIFYCONTEXT = 0xF0000000 // CRYPT_VERIFYCONTEXT
}
- [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "CryptAcquireContextW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Advapi32, EntryPoint = "CryptAcquireContextW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool CryptAcquireContext(
out SafeProvHandle phProv,
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "CryptAcquireContextW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Advapi32, EntryPoint = "CryptAcquireContextW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static unsafe partial bool CryptAcquireContext(
out IntPtr psafeProvHandle,
None = 0,
}
- [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)]
+ [LibraryImport(Libraries.Advapi32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool CryptCreateHash(
SafeProvHandle hProv,
CRYPT_DECRYPT_RSA_NO_PADDING_CHECK = 0x00000020
}
- [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)]
+ [LibraryImport(Libraries.Advapi32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool CryptDecrypt(
SafeCapiKeyHandle hKey,
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)]
+ [LibraryImport(Libraries.Advapi32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool CryptDeriveKey(
SafeProvHandle hProv,
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)]
+ [LibraryImport(Libraries.Advapi32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool CryptDestroyHash(IntPtr hHash);
}
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)]
+ [LibraryImport(Libraries.Advapi32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool CryptDestroyKey(IntPtr hKey);
}
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)]
+ [LibraryImport(Libraries.Advapi32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool CryptEncrypt(
SafeCapiKeyHandle hKey,
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)]
+ [LibraryImport(Libraries.Advapi32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool CryptExportKey(
SafeCapiKeyHandle hKey,
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)]
+ [LibraryImport(Libraries.Advapi32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool CryptGenKey(SafeProvHandle hProv, int Algid, int dwFlags, out SafeCapiKeyHandle phKey);
}
CRYPT_USER_DEFAULT = 0x00000002
}
- [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "CryptGetDefaultProviderW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Advapi32, EntryPoint = "CryptGetDefaultProviderW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool CryptGetDefaultProvider(
int dwProvType,
HP_TLS1PRF_SEED = 0x0007, // seed for TLS1 PRF
}
- [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)]
+ [LibraryImport(Libraries.Advapi32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool CryptGetHashParam(
SafeHashHandle hHash,
ref int pdwDataLen,
int dwFlags);
- [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)]
+ [LibraryImport(Libraries.Advapi32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool CryptSetHashParam(SafeHashHandle hHash, CryptHashProperty dwParam, byte[] buffer, int dwFlags);
}
KP_KEYLEN = 9
}
- [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)]
+ [LibraryImport(Libraries.Advapi32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool CryptGetKeyParam(
SafeCapiKeyHandle hKey,
PP_UNIQUE_CONTAINER = 36
}
- [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)]
+ [LibraryImport(Libraries.Advapi32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool CryptSetProvParam(
SafeHandle safeProvHandle,
IntPtr pbData,
int dwFlags);
- [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)]
+ [LibraryImport(Libraries.Advapi32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool CryptSetProvParam(
SafeProvHandle hProv,
ref IntPtr pbData,
int dwFlags);
- [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)]
+ [LibraryImport(Libraries.Advapi32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool CryptGetProvParam(
SafeHandle safeProvHandle,
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)]
+ [LibraryImport(Libraries.Advapi32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool CryptGetUserKey(SafeProvHandle hProv, int dwKeySpec, out SafeCapiKeyHandle phUserKey);
}
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)]
+ [LibraryImport(Libraries.Advapi32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool CryptHashData(SafeHashHandle hHash, byte[] pbData, int dwDataLen, int dwFlags);
}
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)]
+ [LibraryImport(Libraries.Advapi32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static unsafe partial bool CryptImportKey(
SafeProvHandle hProv,
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)]
+ [LibraryImport(Libraries.Advapi32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool CryptReleaseContext(
IntPtr hProv,
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)]
+ [LibraryImport(Libraries.Advapi32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool CryptSetKeyParam(SafeCapiKeyHandle hKey, int dwParam, byte[] pbData, int dwFlags);
- [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)]
+ [LibraryImport(Libraries.Advapi32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool CryptSetKeyParam(SafeCapiKeyHandle safeKeyHandle, int dwParam, ref int pdw, int dwFlags);
}
CRYPT_X931_FORMAT = 0x00000004, // Not supported
}
- [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "CryptSignHashW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Advapi32, EntryPoint = "CryptSignHashW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool CryptSignHash(
SafeHashHandle hHash,
byte[]? pbSignature,
ref int pdwSigLen);
- [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "CryptVerifySignatureW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Advapi32, EntryPoint = "CryptVerifySignatureW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool CryptVerifySignature(
SafeHashHandle hHash,
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)]
+ [LibraryImport(Libraries.Advapi32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool DeleteService(SafeServiceHandle serviceHandle);
}
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)]
+ [LibraryImport(Libraries.Advapi32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool DeregisterEventSource(IntPtr hEventLog);
}
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Interop.Libraries.Advapi32, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Advapi32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool DuplicateTokenEx(
SafeAccessTokenHandle hExistingToken,
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Interop.Libraries.Advapi32, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Advapi32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool DuplicateTokenEx(
SafeTokenHandle ExistingTokenHandle,
/// <summary>
/// WARNING: This method does not implicitly handle long paths. Use EncryptFile.
/// </summary>
- [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "EncryptFileW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Advapi32, EntryPoint = "EncryptFileW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
private static partial bool EncryptFilePrivate(string lpFileName);
/// <summary>
/// WARNING: This method does not implicitly handle long paths. Use DecryptFile.
/// </summary>
- [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "DecryptFileW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Advapi32, EntryPoint = "DecryptFileW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
private static partial bool DecryptFileFilePrivate(
string lpFileName,
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "EnumDependentServicesW", SetLastError = true)]
+ [LibraryImport(Libraries.Advapi32, EntryPoint = "EnumDependentServicesW", SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool EnumDependentServices(
SafeServiceHandle serviceHandle,
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "EnumServicesStatusExW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Advapi32, EntryPoint = "EnumServicesStatusExW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool EnumServicesStatusEx(
SafeServiceHandle databaseHandle,
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Interop.Libraries.Advapi32)]
+ [LibraryImport(Interop.Libraries.Advapi32)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool EqualDomainSid(IntPtr pSid1, IntPtr pSid2, [MarshalAs(UnmanagedType.Bool)] ref bool equal);
}
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Libraries.Advapi32)]
+ [LibraryImport(Libraries.Advapi32)]
internal static partial int EventActivityIdControl(ActivityControl ControlCode, ref Guid ActivityId);
}
}
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Libraries.Advapi32)]
+ [LibraryImport(Libraries.Advapi32)]
internal static unsafe partial uint EventRegister(
in Guid providerId,
EtwEnableCallback enableCallback,
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Libraries.Advapi32)]
+ [LibraryImport(Libraries.Advapi32)]
internal static unsafe partial int EventSetInformation(
long registrationHandle,
EVENT_INFO_CLASS informationClass,
public long MatchAllKeyword;
}
- [GeneratedDllImport(Interop.Libraries.Advapi32)]
+ [LibraryImport(Interop.Libraries.Advapi32)]
internal static unsafe partial int EnumerateTraceGuidsEx(
TRACE_QUERY_INFO_CLASS TraceQueryInfoClass,
void* InBuffer,
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Libraries.Advapi32)]
+ [LibraryImport(Libraries.Advapi32)]
internal static partial uint EventUnregister(long registrationHandle);
}
}
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Libraries.Advapi32)]
+ [LibraryImport(Libraries.Advapi32)]
internal static partial int EventWriteString(
long registrationHandle,
byte level,
return HResult;
}
- [GeneratedDllImport(Interop.Libraries.Advapi32, EntryPoint = "EventWriteTransfer")]
+ [LibraryImport(Interop.Libraries.Advapi32, EntryPoint = "EventWriteTransfer")]
private static unsafe partial int EventWriteTransfer_PInvoke(
long registrationHandle,
in EventDescriptor eventDescriptor,
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Interop.Libraries.Advapi32)]
+ [LibraryImport(Interop.Libraries.Advapi32)]
internal static partial int GetLengthSid(IntPtr sid);
}
}
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)]
+ [LibraryImport(Libraries.Advapi32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool GetNumberOfEventLogRecords(SafeEventLogReadHandle hEventLog, out int NumberOfRecords);
}
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)]
+ [LibraryImport(Libraries.Advapi32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool GetOldestEventLogRecord(SafeEventLogReadHandle hEventLog, out int OldestRecord);
}
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Libraries.Advapi32)]
+ [LibraryImport(Libraries.Advapi32)]
internal static partial uint GetSecurityDescriptorLength(IntPtr byteArray);
}
}
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Interop.Libraries.Advapi32, EntryPoint = "GetSecurityInfo")]
+ [LibraryImport(Interop.Libraries.Advapi32, EntryPoint = "GetSecurityInfo")]
internal static unsafe partial uint GetSecurityInfoByHandle(
SafeHandle handle,
/*DWORD*/ uint objectType,
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Interop.Libraries.Advapi32, EntryPoint = "GetNamedSecurityInfoW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Interop.Libraries.Advapi32, EntryPoint = "GetNamedSecurityInfoW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
internal static partial uint GetSecurityInfoByName(
string name,
/*DWORD*/ uint objectType,
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "GetServiceDisplayNameW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Advapi32, EntryPoint = "GetServiceDisplayNameW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static unsafe partial bool GetServiceDisplayName(SafeServiceHandle? SCMHandle, string serviceName, char* displayName, ref int displayNameLength);
}
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "GetServiceKeyNameW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Advapi32, EntryPoint = "GetServiceKeyNameW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static unsafe partial bool GetServiceKeyName(SafeServiceHandle? SCMHandle, string displayName, char* KeyName, ref int KeyNameLength);
}
public byte b6;
}
- [GeneratedDllImport(Libraries.Advapi32)]
+ [LibraryImport(Libraries.Advapi32)]
internal static partial IntPtr GetSidIdentifierAuthority(IntPtr sid);
- [GeneratedDllImport(Interop.Libraries.Advapi32)]
+ [LibraryImport(Interop.Libraries.Advapi32)]
internal static partial IntPtr GetSidSubAuthority(IntPtr sid, int index);
- [GeneratedDllImport(Interop.Libraries.Advapi32)]
+ [LibraryImport(Interop.Libraries.Advapi32)]
internal static partial IntPtr GetSidSubAuthorityCount(IntPtr sid);
}
}
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Interop.Libraries.Advapi32, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Advapi32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool GetTokenInformation(
IntPtr TokenHandle,
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Interop.Libraries.Advapi32, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Advapi32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool GetTokenInformation(
SafeAccessTokenHandle TokenHandle,
uint TokenInformationLength,
out uint ReturnLength);
- [GeneratedDllImport(Interop.Libraries.Advapi32, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Advapi32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool GetTokenInformation(
IntPtr TokenHandle,
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Interop.Libraries.Advapi32, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Advapi32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static unsafe partial bool GetTokenInformation(
SafeAccessTokenHandle TokenHandle,
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Interop.Libraries.Advapi32, EntryPoint = "GetWindowsAccountDomainSid", SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Advapi32, EntryPoint = "GetWindowsAccountDomainSid", SetLastError = true)]
internal static partial int GetWindowsAccountDomainSid(
byte[] sid,
byte[] resultSid,
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Interop.Libraries.Advapi32, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Advapi32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool ImpersonateLoggedOnUser(SafeAccessTokenHandle userToken);
}
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)]
+ [LibraryImport(Libraries.Advapi32, SetLastError = true)]
internal static partial int ImpersonateLoggedOnUser(IntPtr userToken);
}
}
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Interop.Libraries.Advapi32, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Advapi32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool ImpersonateNamedPipeClient(SafePipeHandle hNamedPipe);
}
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Interop.Libraries.Advapi32, EntryPoint = "EqualDomainSid", SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Advapi32, EntryPoint = "EqualDomainSid", SetLastError = true)]
internal static partial int IsEqualDomainSid(
byte[] sid1,
byte[] sid2,
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)]
+ [LibraryImport(Libraries.Advapi32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool IsValidSid(IntPtr sid);
}
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Interop.Libraries.Advapi32, EntryPoint = "IsWellKnownSid", SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Advapi32, EntryPoint = "IsWellKnownSid", SetLastError = true)]
internal static partial int IsWellKnownSid(
byte[] sid,
int type);
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "LogonUserW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Advapi32, EntryPoint = "LogonUserW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
internal static partial int LogonUser(
string username,
string? domain,
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Libraries.Advapi32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Advapi32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool LookupAccountNameW(
string? lpSystemName,
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Interop.Libraries.Advapi32, EntryPoint = "LookupAccountSidW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Interop.Libraries.Advapi32, EntryPoint = "LookupAccountSidW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
public static unsafe partial int LookupAccountSid(
string lpSystemName,
byte[] Sid,
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "LookupPrivilegeValueW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Advapi32, EntryPoint = "LookupPrivilegeValueW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool LookupPrivilegeValue(
[MarshalAs(UnmanagedType.LPTStr)] string? lpSystemName, [MarshalAs(UnmanagedType.LPTStr)] string lpName, out LUID lpLuid);
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Interop.Libraries.Advapi32, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Advapi32, SetLastError = true)]
internal static partial int LsaClose(IntPtr handle);
}
}
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Interop.Libraries.Advapi32, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Advapi32, SetLastError = true)]
internal static partial int LsaFreeMemory(IntPtr handle);
}
}
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Interop.Libraries.Advapi32, EntryPoint = "LsaLookupNames2", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Interop.Libraries.Advapi32, EntryPoint = "LsaLookupNames2", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
internal static partial uint LsaLookupNames2(
SafeLsaPolicyHandle handle,
int flags,
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Interop.Libraries.Advapi32, EntryPoint = "LsaLookupSids", SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Advapi32, EntryPoint = "LsaLookupSids", SetLastError = true)]
internal static partial uint LsaLookupSids(
SafeLsaPolicyHandle handle,
int count,
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Interop.Libraries.Advapi32, SetLastError = false)]
+ [LibraryImport(Interop.Libraries.Advapi32, SetLastError = false)]
internal static partial uint LsaNtStatusToWinError(uint status);
}
}
POLICY_NOTIFICATION = 0x00001000,
}
- [GeneratedDllImport(Interop.Libraries.Advapi32, EntryPoint = "LsaOpenPolicy", SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Advapi32, EntryPoint = "LsaOpenPolicy", SetLastError = true)]
private static partial uint LsaOpenPolicy(
ref UNICODE_STRING SystemName,
ref OBJECT_ATTRIBUTES ObjectAttributes,
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Libraries.Advapi32)]
+ [LibraryImport(Libraries.Advapi32)]
internal static partial uint LsaQueryInformationPolicy(
IntPtr policyHandle,
int policyInformationClass,
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)]
+ [LibraryImport(Libraries.Advapi32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool NotifyChangeEventLog(SafeEventLogReadHandle hEventLog, SafeWaitHandle hEvent);
}
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "OpenEventLogW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Advapi32, EntryPoint = "OpenEventLogW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
internal static partial SafeEventLogReadHandle OpenEventLog(string lpUNCServerName, string lpSourceName);
}
}
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Libraries.Advapi32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Advapi32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool OpenProcessToken(IntPtr ProcessHandle, int DesiredAccess, out SafeTokenHandle TokenHandle);
}
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)]
+ [LibraryImport(Libraries.Advapi32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool OpenProcessToken(
IntPtr ProcessToken,
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Interop.Libraries.Advapi32, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Advapi32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool OpenProcessToken(
IntPtr ProcessToken,
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "OpenSCManagerW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Advapi32, EntryPoint = "OpenSCManagerW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
internal static partial IntPtr OpenSCManager(string? machineName, string? databaseName, int access);
}
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "OpenServiceW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Advapi32, EntryPoint = "OpenServiceW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
internal static partial IntPtr OpenService(SafeServiceHandle? databaseHandle, string serviceName, int access);
}
}
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Interop.Libraries.Advapi32, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Advapi32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
private static partial bool OpenThreadToken(
IntPtr ThreadHandle,
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Interop.Libraries.Advapi32, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Advapi32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool OpenThreadToken(
IntPtr ThreadHandle,
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "QueryServiceConfigW", SetLastError = true)]
+ [LibraryImport(Libraries.Advapi32, EntryPoint = "QueryServiceConfigW", SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool QueryServiceConfig(SafeServiceHandle serviceHandle, IntPtr queryServiceConfigPtr, int bufferSize, out int bytesNeeded);
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)]
+ [LibraryImport(Libraries.Advapi32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static unsafe partial bool QueryServiceStatus(SafeServiceHandle serviceHandle, SERVICE_STATUS* pStatus);
}
internal const int FORWARDS_READ = 0x4;
internal const int BACKWARDS_READ = 0x8;
- [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "ReadEventLogW", SetLastError = true)]
+ [LibraryImport(Libraries.Advapi32, EntryPoint = "ReadEventLogW", SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool ReadEventLog(
SafeEventLogReadHandle hEventLog,
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Libraries.Advapi32)]
+ [LibraryImport(Libraries.Advapi32)]
internal static partial int RegCloseKey(IntPtr hKey);
}
}
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegConnectRegistryW", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Advapi32, EntryPoint = "RegConnectRegistryW", StringMarshalling = StringMarshalling.Utf16)]
internal static partial int RegConnectRegistry(
string machineName,
SafeRegistryHandle key,
{
// Note: RegCreateKeyEx won't set the last error on failure - it returns
// an error code if it fails.
- [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegCreateKeyExW", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Advapi32, EntryPoint = "RegCreateKeyExW", StringMarshalling = StringMarshalling.Utf16)]
internal static partial int RegCreateKeyEx(
SafeRegistryHandle hKey,
string lpSubKey,
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegDeleteKeyExW", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Advapi32, EntryPoint = "RegDeleteKeyExW", StringMarshalling = StringMarshalling.Utf16)]
internal static partial int RegDeleteKeyEx(
SafeRegistryHandle hKey,
string lpSubKey,
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegDeleteValueW", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Advapi32, EntryPoint = "RegDeleteValueW", StringMarshalling = StringMarshalling.Utf16)]
internal static partial int RegDeleteValue(
SafeRegistryHandle hKey,
string? lpValueName);
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegEnumKeyExW", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Advapi32, EntryPoint = "RegEnumKeyExW", StringMarshalling = StringMarshalling.Utf16)]
internal static partial int RegEnumKeyEx(
SafeRegistryHandle hKey,
int dwIndex,
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegEnumValueW", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Advapi32, EntryPoint = "RegEnumValueW", StringMarshalling = StringMarshalling.Utf16)]
internal static partial int RegEnumValue(
SafeRegistryHandle hKey,
int dwIndex,
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Libraries.Advapi32)]
+ [LibraryImport(Libraries.Advapi32)]
internal static partial int RegFlushKey(SafeRegistryHandle hKey);
}
}
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegOpenKeyExW", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Advapi32, EntryPoint = "RegOpenKeyExW", StringMarshalling = StringMarshalling.Utf16)]
internal static partial int RegOpenKeyEx(
SafeRegistryHandle hKey,
string? lpSubKey,
int samDesired,
out SafeRegistryHandle hkResult);
- [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegOpenKeyExW", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Advapi32, EntryPoint = "RegOpenKeyExW", StringMarshalling = StringMarshalling.Utf16)]
internal static partial int RegOpenKeyEx(
IntPtr hKey,
string? lpSubKey,
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegQueryInfoKeyW", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Advapi32, EntryPoint = "RegQueryInfoKeyW", StringMarshalling = StringMarshalling.Utf16)]
internal static partial int RegQueryInfoKey(
SafeRegistryHandle hKey,
[Out] char[]? lpClass,
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegQueryValueExW", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Advapi32, EntryPoint = "RegQueryValueExW", StringMarshalling = StringMarshalling.Utf16)]
internal static partial int RegQueryValueEx(
SafeRegistryHandle hKey,
string? lpValueName,
byte[]? lpData,
ref int lpcbData);
- [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegQueryValueExW", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Advapi32, EntryPoint = "RegQueryValueExW", StringMarshalling = StringMarshalling.Utf16)]
internal static partial int RegQueryValueEx(
SafeRegistryHandle hKey,
string? lpValueName,
ref int lpData,
ref int lpcbData);
- [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegQueryValueExW", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Advapi32, EntryPoint = "RegQueryValueExW", StringMarshalling = StringMarshalling.Utf16)]
internal static partial int RegQueryValueEx(
SafeRegistryHandle hKey,
string? lpValueName,
ref long lpData,
ref int lpcbData);
- [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegQueryValueExW", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Advapi32, EntryPoint = "RegQueryValueExW", StringMarshalling = StringMarshalling.Utf16)]
internal static partial int RegQueryValueEx(
SafeRegistryHandle hKey,
string? lpValueName,
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegSetValueExW", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Advapi32, EntryPoint = "RegSetValueExW", StringMarshalling = StringMarshalling.Utf16)]
internal static partial int RegSetValueEx(
SafeRegistryHandle hKey,
string? lpValueName,
byte[]? lpData,
int cbData);
- [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegSetValueExW", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Advapi32, EntryPoint = "RegSetValueExW", StringMarshalling = StringMarshalling.Utf16)]
internal static partial int RegSetValueEx(
SafeRegistryHandle hKey,
string? lpValueName,
char[]? lpData,
int cbData);
- [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegSetValueExW", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Advapi32, EntryPoint = "RegSetValueExW", StringMarshalling = StringMarshalling.Utf16)]
internal static partial int RegSetValueEx(
SafeRegistryHandle hKey,
string? lpValueName,
ref int lpData,
int cbData);
- [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegSetValueExW", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Advapi32, EntryPoint = "RegSetValueExW", StringMarshalling = StringMarshalling.Utf16)]
internal static partial int RegSetValueEx(
SafeRegistryHandle hKey,
string? lpValueName,
ref long lpData,
int cbData);
- [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegSetValueExW", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Advapi32, EntryPoint = "RegSetValueExW", StringMarshalling = StringMarshalling.Utf16)]
internal static partial int RegSetValueEx(
SafeRegistryHandle hKey,
string? lpValueName,
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegisterEventSourceW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Advapi32, EntryPoint = "RegisterEventSourceW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
internal static partial SafeEventLogWriteHandle RegisterEventSource(string lpUNCServerName, string lpSourceName);
}
}
{
public delegate int ServiceControlCallbackEx(int control, int eventType, IntPtr eventData, IntPtr eventContext);
- [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegisterServiceCtrlHandlerExW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Advapi32, EntryPoint = "RegisterServiceCtrlHandlerExW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
public static partial IntPtr RegisterServiceCtrlHandlerEx(string? serviceName, ServiceControlCallbackEx? callback, IntPtr userData);
}
}
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "ReportEventW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Advapi32, EntryPoint = "ReportEventW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool ReportEvent(
SafeEventLogWriteHandle hEventLog,
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Interop.Libraries.Advapi32, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Advapi32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool RevertToSelf();
}
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Interop.Libraries.Advapi32, EntryPoint = "SetSecurityInfo", SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Advapi32, EntryPoint = "SetSecurityInfo", SetLastError = true)]
internal static partial uint SetSecurityInfoByHandle(
SafeHandle handle,
/*DWORD*/ uint objectType,
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Interop.Libraries.Advapi32, EntryPoint = "SetNamedSecurityInfoW",
+ [LibraryImport(Interop.Libraries.Advapi32, EntryPoint = "SetNamedSecurityInfoW",
SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
internal static partial uint SetSecurityInfoByName(
string name,
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)]
+ [LibraryImport(Libraries.Advapi32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
public static unsafe partial bool SetServiceStatus(IntPtr serviceStatusHandle, SERVICE_STATUS* status);
}
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)]
+ [LibraryImport(Libraries.Advapi32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool SetThreadToken(
IntPtr ThreadHandle,
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "StartServiceW", SetLastError = true)]
+ [LibraryImport(Libraries.Advapi32, EntryPoint = "StartServiceW", SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool StartService(SafeServiceHandle serviceHandle, int argNum, IntPtr argPtrs);
}
{
internal static partial class Advapi32
{
- [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "StartServiceCtrlDispatcherW", SetLastError = true)]
+ [LibraryImport(Libraries.Advapi32, EntryPoint = "StartServiceCtrlDispatcherW", SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool StartServiceCtrlDispatcher(IntPtr entry);
}
{
internal static partial class Authz
{
- [GeneratedDllImport(Libraries.Authz, SetLastError = true)]
+ [LibraryImport(Libraries.Authz, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool AuthzGetInformationFromContext(
IntPtr hAuthzClientContext,
internal const int AUTHZ_RM_FLAG_INITIALIZE_UNDER_IMPERSONATION = 0x2;
internal const int AUTHZ_VALID_RM_INIT_FLAGS = (AUTHZ_RM_FLAG_NO_AUDIT | AUTHZ_RM_FLAG_INITIALIZE_UNDER_IMPERSONATION);
- [GeneratedDllImport(Interop.Libraries.Authz, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Authz, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool AuthzInitializeContextFromSid(
int Flags,
IntPtr DynamicGroupArgs,
out IntPtr pAuthzClientContext);
- [GeneratedDllImport(Interop.Libraries.Authz)]
+ [LibraryImport(Interop.Libraries.Authz)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool AuthzFreeContext(IntPtr AuthzClientContext);
}
{
internal static partial class Authz
{
- [GeneratedDllImport(Libraries.Authz, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Authz, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool AuthzInitializeResourceManager(
int flags,
string name,
out IntPtr rm);
- [GeneratedDllImport(Libraries.Authz)]
+ [LibraryImport(Libraries.Authz)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool AuthzFreeResourceManager(IntPtr rm);
}
{
internal static partial class Interop
{
- [GeneratedDllImport(Libraries.BCrypt, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.BCrypt, StringMarshalling = StringMarshalling.Utf16)]
public static partial NTSTATUS BCryptOpenAlgorithmProvider(out SafeAlgorithmHandle phAlgorithm, string pszAlgId, string? pszImplementation, int dwFlags);
- [GeneratedDllImport(Libraries.BCrypt, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.BCrypt, StringMarshalling = StringMarshalling.Utf16)]
public static partial NTSTATUS BCryptSetProperty(SafeAlgorithmHandle hObject, string pszProperty, string pbInput, int cbInput, int dwFlags);
- [GeneratedDllImport(Libraries.BCrypt, EntryPoint = "BCryptSetProperty", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.BCrypt, EntryPoint = "BCryptSetProperty", StringMarshalling = StringMarshalling.Utf16)]
private static partial NTSTATUS BCryptSetIntPropertyPrivate(SafeBCryptHandle hObject, string pszProperty, ref int pdwInput, int cbInput, int dwFlags);
public static unsafe NTSTATUS BCryptSetIntProperty(SafeBCryptHandle hObject, string pszProperty, ref int pdwInput, int dwFlags)
return ntStatus == 0;
}
- [GeneratedDllImport(Libraries.BCrypt)]
+ [LibraryImport(Libraries.BCrypt)]
private static partial uint BCryptCloseAlgorithmProvider(IntPtr hAlgorithm, int dwFlags);
}
return ntStatus == 0;
}
- [GeneratedDllImport(Libraries.BCrypt)]
+ [LibraryImport(Libraries.BCrypt)]
private static partial uint BCryptDestroyKey(IntPtr hKey);
}
}
{
internal static partial class BCrypt
{
- [GeneratedDllImport(Libraries.BCrypt)]
+ [LibraryImport(Libraries.BCrypt)]
internal static partial NTSTATUS BCryptCloseAlgorithmProvider(IntPtr hAlgorithm, int dwFlags);
}
}
return BCryptCreateHash(hAlgorithm, out phHash, pbHashObject, cbHashObject, ref MemoryMarshal.GetReference(secret), cbSecret, dwFlags);
}
- [GeneratedDllImport(Libraries.BCrypt, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.BCrypt, StringMarshalling = StringMarshalling.Utf16)]
private static partial NTSTATUS BCryptCreateHash(SafeBCryptAlgorithmHandle hAlgorithm, out SafeBCryptHashHandle phHash, IntPtr pbHashObject, int cbHashObject, ref byte pbSecret, int cbSecret, BCryptCreateHashFlags dwFlags);
[Flags]
{
internal static partial class BCrypt
{
- [GeneratedDllImport(Libraries.BCrypt, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.BCrypt, StringMarshalling = StringMarshalling.Utf16)]
internal static unsafe partial NTSTATUS BCryptDeriveKeyPBKDF2(
SafeBCryptAlgorithmHandle hPrf,
byte* pbPassword,
{
internal static partial class BCrypt
{
- [GeneratedDllImport(Libraries.BCrypt)]
+ [LibraryImport(Libraries.BCrypt)]
internal static partial NTSTATUS BCryptDestroyHash(IntPtr hHash);
}
}
{
internal static partial class BCrypt
{
- [GeneratedDllImport(Libraries.BCrypt)]
+ [LibraryImport(Libraries.BCrypt)]
internal static partial NTSTATUS BCryptDestroyKey(IntPtr hKey);
}
}
return newHash;
}
- [GeneratedDllImport(Libraries.BCrypt)]
+ [LibraryImport(Libraries.BCrypt)]
private static partial NTSTATUS BCryptDuplicateHash(
SafeBCryptHashHandle hHash,
out SafeBCryptHashHandle phNewHash,
}
}
- [GeneratedDllImport(Libraries.BCrypt)]
+ [LibraryImport(Libraries.BCrypt)]
public static unsafe partial NTSTATUS BCryptEncrypt(SafeKeyHandle hKey, byte* pbInput, int cbInput, IntPtr paddingInfo, byte[]? pbIV, int cbIV, byte* pbOutput, int cbOutput, out int cbResult, int dwFlags);
- [GeneratedDllImport(Libraries.BCrypt)]
+ [LibraryImport(Libraries.BCrypt)]
public static unsafe partial NTSTATUS BCryptDecrypt(SafeKeyHandle hKey, byte* pbInput, int cbInput, IntPtr paddingInfo, byte[]? pbIV, int cbIV, byte* pbOutput, int cbOutput, out int cbResult, int dwFlags);
}
}
{
internal static partial class BCrypt
{
- [GeneratedDllImport(Libraries.BCrypt, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.BCrypt, StringMarshalling = StringMarshalling.Utf16)]
internal static partial NTSTATUS BCryptExportKey(SafeBCryptKeyHandle hKey, IntPtr hExportKey, string pszBlobType, byte[]? pbOutput, int cbOutput, out int pcbResult, int dwFlags);
}
}
internal static NTSTATUS BCryptFinishHash(SafeBCryptHashHandle hHash, Span<byte> pbOutput, int cbOutput, int dwFlags) =>
BCryptFinishHash(hHash, ref MemoryMarshal.GetReference(pbOutput), cbOutput, dwFlags);
- [GeneratedDllImport(Libraries.BCrypt)]
+ [LibraryImport(Libraries.BCrypt)]
private static partial NTSTATUS BCryptFinishHash(SafeBCryptHashHandle hHash, ref byte pbOutput, int cbOutput, int dwFlags);
}
}
{
internal const int BCRYPT_USE_SYSTEM_PREFERRED_RNG = 0x00000002;
- [GeneratedDllImport(Libraries.BCrypt)]
+ [LibraryImport(Libraries.BCrypt)]
internal static unsafe partial NTSTATUS BCryptGenRandom(IntPtr hAlgorithm, byte* pbBuffer, int cbBuffer, int dwFlags);
}
}
{
internal static partial class BCrypt
{
- [GeneratedDllImport(Libraries.BCrypt)]
+ [LibraryImport(Libraries.BCrypt)]
internal static unsafe partial NTSTATUS BCryptGenerateSymmetricKey(
SafeBCryptAlgorithmHandle hAlgorithm,
out SafeBCryptKeyHandle phKey,
int cbSecret,
uint dwFlags);
- [GeneratedDllImport(Libraries.BCrypt)]
+ [LibraryImport(Libraries.BCrypt)]
internal static unsafe partial NTSTATUS BCryptGenerateSymmetricKey(
nuint hAlgorithm,
out SafeBCryptKeyHandle phKey,
{
internal static partial class BCrypt
{
- [GeneratedDllImport(Libraries.BCrypt, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.BCrypt, StringMarshalling = StringMarshalling.Utf16)]
internal static unsafe partial NTSTATUS BCryptGetProperty(SafeBCryptHandle hObject, string pszProperty, void* pbOutput, int cbOutput, out int pcbResult, int dwFlags);
}
}
{
internal static partial class BCrypt
{
- [GeneratedDllImport(Libraries.BCrypt, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.BCrypt, StringMarshalling = StringMarshalling.Utf16)]
internal static unsafe partial NTSTATUS BCryptHash(nuint hAlgorithm, byte* pbSecret, int cbSecret, byte* pbInput, int cbInput, byte* pbOutput, int cbOutput);
}
}
internal static NTSTATUS BCryptHashData(SafeBCryptHashHandle hHash, ReadOnlySpan<byte> pbInput, int cbInput, int dwFlags) =>
BCryptHashData(hHash, ref MemoryMarshal.GetReference(pbInput), cbInput, dwFlags);
- [GeneratedDllImport(Libraries.BCrypt, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.BCrypt, StringMarshalling = StringMarshalling.Utf16)]
private static partial NTSTATUS BCryptHashData(SafeBCryptHashHandle hHash, ref byte pbInput, int cbInput, int dwFlags);
}
}
public const uint BCRYPT_KEY_DATA_BLOB_VERSION1 = 0x1;
}
- [GeneratedDllImport(Libraries.BCrypt, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.BCrypt, StringMarshalling = StringMarshalling.Utf16)]
private static unsafe partial NTSTATUS BCryptImportKey(SafeAlgorithmHandle hAlgorithm, IntPtr hImportKey, string pszBlobType, out SafeKeyHandle hKey, IntPtr pbKeyObject, int cbKeyObject, byte* pbInput, int cbInput, int dwFlags);
}
}
{
internal static partial class BCrypt
{
- [GeneratedDllImport(Libraries.BCrypt)]
+ [LibraryImport(Libraries.BCrypt)]
internal static unsafe partial NTSTATUS BCryptKeyDerivation(
SafeBCryptKeyHandle hKey,
BCryptBufferDesc* pParameterList,
{
internal static partial class BCrypt
{
- [GeneratedDllImport(Libraries.BCrypt, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.BCrypt, StringMarshalling = StringMarshalling.Utf16)]
internal static partial NTSTATUS BCryptOpenAlgorithmProvider(out SafeBCryptAlgorithmHandle phAlgorithm, string pszAlgId, string? pszImplementation, BCryptOpenAlgorithmProviderFlags dwFlags);
[Flags]
internal const int CRED_MAX_USERNAME_LENGTH = 514;
internal const int CRED_MAX_DOMAIN_TARGET_LENGTH = 338;
- [GeneratedDllImport(Libraries.Credui, EntryPoint = "CredUIParseUserNameW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Credui, EntryPoint = "CredUIParseUserNameW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
internal static unsafe partial int CredUIParseUserName(
string pszUserName,
char* pszUser,
{
internal static partial class Crypt32
{
- [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+ [LibraryImport(Libraries.Crypt32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool CertAddCertificateContextToStore(SafeCertStoreHandle hCertStore, SafeCertContextHandle pCertContext, CertStoreAddDisposition dwAddDisposition, IntPtr ppStoreContext);
}
{
internal const uint CERT_STORE_ADD_ALWAYS = 4;
- [GeneratedDllImport(Interop.Libraries.Crypt32, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Crypt32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool CertAddCertificateLinkToStore(SafeCertStoreHandle hCertStore, SafeCertContextHandle pCertContext, uint dwAddDisposition, SafeCertContextHandle ppStoreContext);
}
{
internal static partial class Crypt32
{
- [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+ [LibraryImport(Libraries.Crypt32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool CertAddCertificateLinkToStore(SafeCertStoreHandle hCertStore, SafeCertContextHandle pCertContext, CertStoreAddDisposition dwAddDisposition, IntPtr ppStoreContext);
}
{
internal static partial class Crypt32
{
- [GeneratedDllImport(Interop.Libraries.Crypt32, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Crypt32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool CertCloseStore(IntPtr hCertStore, uint dwFlags);
}
{
internal static partial class Crypt32
{
- [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+ [LibraryImport(Libraries.Crypt32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool CertControlStore(SafeCertStoreHandle hCertStore, CertControlStoreFlags dwFlags, CertControlStoreType dwControlType, IntPtr pvCtrlPara);
}
{
internal static partial class Crypt32
{
- [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+ [LibraryImport(Libraries.Crypt32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool CertCreateCertificateChainEngine(ref CERT_CHAIN_ENGINE_CONFIG pConfig, out SafeChainEngineHandle hChainEngineHandle);
}
{
internal static partial class Crypt32
{
- [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+ [LibraryImport(Libraries.Crypt32, SetLastError = true)]
internal static unsafe partial SafeCertContextHandle CertCreateCertificateContext(
MsgEncodingType dwCertEncodingType,
void* pbCertEncoded,
internal static partial class Crypt32
{
// Note: CertDeleteCertificateFromStore always calls CertFreeCertificateContext on pCertContext, even if an error is encountered.
- [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+ [LibraryImport(Libraries.Crypt32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static unsafe partial bool CertDeleteCertificateFromStore(CERT_CONTEXT* pCertContext);
}
{
internal static partial class Crypt32
{
- [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+ [LibraryImport(Libraries.Crypt32, SetLastError = true)]
internal static partial SafeX509ChainHandle CertDuplicateCertificateChain(IntPtr pChainContext);
}
}
{
internal static partial class Crypt32
{
- [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+ [LibraryImport(Libraries.Crypt32, SetLastError = true)]
internal static partial SafeCertContextHandle CertDuplicateCertificateContext(IntPtr pCertContext);
}
}
{
internal static partial class Crypt32
{
- [GeneratedDllImport(Libraries.Crypt32, EntryPoint = "CertDuplicateCertificateContext", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Crypt32, EntryPoint = "CertDuplicateCertificateContext", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
internal static partial SafeCertContextHandleWithKeyContainerDeletion CertDuplicateCertificateContextWithKeyContainerDeletion(IntPtr pCertContext);
}
}
{
internal static partial class Crypt32
{
- [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+ [LibraryImport(Libraries.Crypt32, SetLastError = true)]
internal static partial IntPtr CertDuplicateCertificateContext(IntPtr pCertContext);
}
}
{
internal static partial class Crypt32
{
- [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+ [LibraryImport(Libraries.Crypt32, SetLastError = true)]
internal static partial SafeCertStoreHandle CertDuplicateStore(IntPtr hCertStore);
}
}
{
internal static partial class Crypt32
{
- [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+ [LibraryImport(Libraries.Crypt32, SetLastError = true)]
public static unsafe partial CERT_CONTEXT* CertEnumCertificatesInStore(
IntPtr hCertStore,
CERT_CONTEXT* pPrevCertContext);
{
internal static partial class Crypt32
{
- [GeneratedDllImport(Interop.Libraries.Crypt32, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Crypt32, SetLastError = true)]
internal static partial IntPtr CertEnumCertificatesInStore(SafeCertStoreHandle hCertStore, IntPtr pPrevCertContext);
}
}
{
internal static partial class Crypt32
{
- [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+ [LibraryImport(Libraries.Crypt32, SetLastError = true)]
internal static unsafe partial CERT_CONTEXT* CertEnumCertificatesInStore(SafeCertStoreHandle hCertStore, CERT_CONTEXT* pPrevCertContext);
}
}
{
internal static partial class Crypt32
{
- [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+ [LibraryImport(Libraries.Crypt32, SetLastError = true)]
internal static unsafe partial SafeCertContextHandle CertFindCertificateInStore(
SafeCertStoreHandle hCertStore,
CertEncodingType dwCertEncodingType,
{
internal static partial class Crypt32
{
- [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+ [LibraryImport(Libraries.Crypt32, SetLastError = true)]
internal static unsafe partial CERT_EXTENSION* CertFindExtension([MarshalAs(UnmanagedType.LPStr)] string pszObjId, int cExtensions, IntPtr rgExtensions);
}
}
{
internal static partial class Crypt32
{
- [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+ [LibraryImport(Libraries.Crypt32, SetLastError = true)]
internal static partial void CertFreeCertificateChain(IntPtr pChainContext);
}
}
{
internal static partial class Crypt32
{
- [GeneratedDllImport(Libraries.Crypt32)]
+ [LibraryImport(Libraries.Crypt32)]
internal static partial void CertFreeCertificateChainEngine(IntPtr hChainEngine);
}
}
internal static partial class Crypt32
{
// Note: This api always return TRUE, regardless of success.
- [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+ [LibraryImport(Libraries.Crypt32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool CertFreeCertificateContext(IntPtr pCertContext);
}
{
internal static partial class Crypt32
{
- [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+ [LibraryImport(Libraries.Crypt32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static unsafe partial bool CertGetCertificateChain(
IntPtr hChainEngine,
{
internal static partial class Crypt32
{
- [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+ [LibraryImport(Libraries.Crypt32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool CertGetCertificateContextProperty(
SafeCertContextHandle pCertContext,
byte[]? pvData,
ref int pcbData);
- [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+ [LibraryImport(Libraries.Crypt32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool CertGetCertificateContextProperty(
SafeCertContextHandle pCertContext,
out IntPtr pvData,
ref int pcbData);
- [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+ [LibraryImport(Libraries.Crypt32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool CertGetCertificateContextProperty(
SafeCertContextHandle pCertContext,
{
internal static partial class Crypt32
{
- [GeneratedDllImport(Libraries.Crypt32, EntryPoint = "CertGetCertificateContextProperty", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Crypt32, EntryPoint = "CertGetCertificateContextProperty", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static unsafe partial bool CertGetCertificateContextPropertyString(SafeCertContextHandle pCertContext, CertContextPropId dwPropId, byte* pvData, ref uint pcbData);
}
{
internal static partial class Crypt32
{
- [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+ [LibraryImport(Libraries.Crypt32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool CertGetCertificateContextProperty(
SafeCertContextHandle pCertContext,
{
// Note: It's somewhat unusual to use an API enum as a parameter type to a P/Invoke but in this case, X509KeyUsageFlags was intentionally designed as bit-wise
// identical to the wincrypt CERT_*_USAGE values.
- [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+ [LibraryImport(Libraries.Crypt32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static unsafe partial bool CertGetIntendedKeyUsage(
CertEncodingType dwCertEncodingType,
{
internal static partial class Crypt32
{
- [GeneratedDllImport(Libraries.Crypt32, EntryPoint = "CertGetNameStringW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Crypt32, EntryPoint = "CertGetNameStringW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
internal static unsafe partial int CertGetNameString(SafeCertContextHandle pCertContext, CertNameType dwType, CertNameFlags dwFlags, in CertNameStringType pvTypePara, char* pszNameString, int cchNameString);
}
}
{
internal static partial class Crypt32
{
- [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+ [LibraryImport(Libraries.Crypt32, SetLastError = true)]
internal static partial int CertGetPublicKeyLength(MsgEncodingType dwCertEncodingType, ref CERT_PUBLIC_KEY_INFO pPublicKey);
}
}
{
internal static partial class Crypt32
{
- [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+ [LibraryImport(Libraries.Crypt32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static unsafe partial bool CertGetValidUsages(int cCerts, ref SafeCertContextHandle rghCerts, out int cNumOIDs, void* rghOIDs, ref int pcbOIDs);
}
{
internal static partial class Crypt32
{
- [GeneratedDllImport(Libraries.Crypt32, EntryPoint = "CertNameToStrW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Crypt32, EntryPoint = "CertNameToStrW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
internal static unsafe partial int CertNameToStr(
int dwCertEncodingType,
void* pName,
internal const uint X509_ASN_ENCODING = 0x00000001;
internal const uint CERT_STORE_PROV_MEMORY = 2;
- [GeneratedDllImport(Interop.Libraries.Crypt32, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Crypt32, SetLastError = true)]
internal static partial SafeCertStoreHandle CertOpenStore(IntPtr lpszStoreProvider, uint dwMsgAndCertEncodingType, IntPtr hCryptProv, uint dwFlags, IntPtr pvPara);
}
}
{
internal static partial class Crypt32
{
- [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+ [LibraryImport(Libraries.Crypt32, SetLastError = true)]
internal static partial SafeCertStoreHandle CertOpenStore(IntPtr lpszStoreProvider, CertEncodingType dwMsgAndCertEncodingType, IntPtr hCryptProv, CertStoreFlags dwFlags, [MarshalAs(UnmanagedType.LPWStr)] string? pvPara);
}
}
{
internal static partial class Crypt32
{
- [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+ [LibraryImport(Libraries.Crypt32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool CertSaveStore(
SafeCertStoreHandle hCertStore,
{
internal static partial class Crypt32
{
- [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+ [LibraryImport(Libraries.Crypt32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool CertSerializeCertificateStoreElement(SafeCertContextHandle pCertContext, int dwFlags, byte[]? pbElement, ref int pcbElement);
}
{
internal static partial class Crypt32
{
- [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+ [LibraryImport(Libraries.Crypt32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static unsafe partial bool CertSetCertificateContextProperty(SafeCertContextHandle pCertContext, CertContextPropId dwPropId, CertSetPropertyFlags dwFlags, CRYPT_KEY_PROV_INFO* pvData);
}
{
internal static partial class Crypt32
{
- [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+ [LibraryImport(Libraries.Crypt32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static unsafe partial bool CertSetCertificateContextProperty(SafeCertContextHandle pCertContext, CertContextPropId dwPropId, CertSetPropertyFlags dwFlags, DATA_BLOB* pvData);
}
{
internal static partial class Crypt32
{
- [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+ [LibraryImport(Libraries.Crypt32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static unsafe partial bool CertSetCertificateContextProperty(SafeCertContextHandle pCertContext, CertContextPropId dwPropId, CertSetPropertyFlags dwFlags, SafeNCryptKeyHandle keyHandle);
}
{
internal static partial class Crypt32
{
- [GeneratedDllImport(Libraries.Crypt32, EntryPoint = "CertStrToNameW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Crypt32, EntryPoint = "CertStrToNameW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool CertStrToName(CertEncodingType dwCertEncodingType, string pszX500, CertNameStrTypeAndFlags dwStrType, IntPtr pvReserved, byte[]? pbEncoded, ref int pcbEncoded, IntPtr ppszError);
}
{
internal static partial class Crypt32
{
- [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+ [LibraryImport(Libraries.Crypt32, SetLastError = true)]
internal static unsafe partial int CertVerifyTimeValidity(ref FILETIME pTimeToVerify, CERT_INFO* pCertInfo);
}
}
{
internal static partial class Crypt32
{
- [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+ [LibraryImport(Libraries.Crypt32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool CryptAcquireCertificatePrivateKey(
SafeCertContextHandle pCert,
{
internal static partial class Crypt32
{
- [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+ [LibraryImport(Libraries.Crypt32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool CryptAcquireCertificatePrivateKey(
SafeCertContextHandle pCert,
return CryptDecodeObject(MsgEncodingType.All, (IntPtr)lpszStructType, pbEncoded, cbEncoded, 0, pvStructInfo, ref pcbStructInfo);
}
- [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+ [LibraryImport(Libraries.Crypt32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
private static unsafe partial bool CryptDecodeObject(
MsgEncodingType dwCertEncodingType,
{
internal static partial class Crypt32
{
- [GeneratedDllImport(Libraries.Crypt32, EntryPoint = "CryptDecodeObject", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Crypt32, EntryPoint = "CryptDecodeObject", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static unsafe partial bool CryptDecodeObjectPointer(
CertEncodingType dwCertEncodingType,
{
internal static partial class Crypt32
{
- [GeneratedDllImport(Libraries.Crypt32, EntryPoint = "CryptDecodeObject", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Crypt32, EntryPoint = "CryptDecodeObject", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static unsafe partial bool CryptDecodeObjectPointer(
CertEncodingType dwCertEncodingType,
{
internal static partial class Crypt32
{
- [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+ [LibraryImport(Libraries.Crypt32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool CryptDecodeObject(CertEncodingType dwCertEncodingType, IntPtr lpszStructType, byte[] pbEncoded, int cbEncoded, CryptDecodeObjectFlags dwFlags, byte[]? pvStructInfo, ref int pcbStructInfo);
}
return CryptEncodeObject(dwCertEncodingType, (nint)lpszStructType, pvStructInfo, pbEncoded, ref pcbEncoded);
}
- [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+ [LibraryImport(Libraries.Crypt32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
private static unsafe partial bool CryptEncodeObject(
MsgEncodingType dwCertEncodingType,
{
internal static partial class Crypt32
{
- [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+ [LibraryImport(Libraries.Crypt32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static unsafe partial bool CryptEncodeObject(CertEncodingType dwCertEncodingType, IntPtr lpszStructType, void* pvStructInfo, byte[]? pbEncoded, ref int pcbEncoded);
- [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+ [LibraryImport(Libraries.Crypt32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static unsafe partial bool CryptEncodeObject(CertEncodingType dwCertEncodingType, [MarshalAs(UnmanagedType.LPStr)] string lpszStructType, void* pvStructInfo, byte[]? pbEncoded, ref int pcbEncoded);
}
internal const int CRYPT_FORMAT_STR_MULTI_LINE = 0x00000001;
internal const int CRYPT_FORMAT_STR_NO_HEX = 0x00000010;
- [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+ [LibraryImport(Libraries.Crypt32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static unsafe partial bool CryptFormatObject(
int dwCertEncodingType, // only valid value is X509_ASN_ENCODING
{
internal static partial class Crypt32
{
- [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+ [LibraryImport(Libraries.Crypt32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool CryptHashPublicKeyInfo(
IntPtr hCryptProv,
{
internal static partial class Crypt32
{
- [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+ [LibraryImport(Libraries.Crypt32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static unsafe partial bool CryptImportPublicKeyInfoEx2(
CertEncodingType dwCertEncodingType,
{
internal static partial class Crypt32
{
- [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+ [LibraryImport(Libraries.Crypt32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool CryptMsgClose(IntPtr hCryptMsg);
}
{
internal static partial class Crypt32
{
- [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+ [LibraryImport(Libraries.Crypt32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool CryptMsgControl(
SafeCryptMsgHandle hCryptMsg,
MsgControlType dwCtrlType,
ref CMSG_CTRL_DECRYPT_PARA pvCtrlPara);
- [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+ [LibraryImport(Libraries.Crypt32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool CryptMsgControl(
SafeCryptMsgHandle hCryptMsg,
{
internal static partial class Crypt32
{
- [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+ [LibraryImport(Libraries.Crypt32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool CryptMsgGetParam(
SafeCryptMsgHandle hCryptMsg,
out int pvData,
ref int pcbData);
- [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+ [LibraryImport(Libraries.Crypt32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static unsafe partial bool CryptMsgGetParam(
SafeCryptMsgHandle hCryptMsg,
byte* pvData,
ref int pcbData);
- [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+ [LibraryImport(Libraries.Crypt32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool CryptMsgGetParam(
SafeCryptMsgHandle hCryptMsg,
out CryptMsgType pvData,
ref int pcbData);
- [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+ [LibraryImport(Libraries.Crypt32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool CryptMsgGetParam(
SafeCryptMsgHandle hCryptMsg,
{
internal static partial class Crypt32
{
- [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+ [LibraryImport(Libraries.Crypt32, SetLastError = true)]
internal static partial SafeCryptMsgHandle CryptMsgOpenToDecode(
MsgEncodingType dwMsgEncodingType,
int dwFlags,
{
internal static partial class Crypt32
{
- [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+ [LibraryImport(Libraries.Crypt32, SetLastError = true)]
internal static unsafe partial SafeCryptMsgHandle CryptMsgOpenToEncode(
MsgEncodingType dwMsgEncodingType,
int dwFlags,
{
internal static partial class Crypt32
{
- [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+ [LibraryImport(Libraries.Crypt32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool CryptMsgUpdate(SafeCryptMsgHandle hCryptMsg, byte[] pbData, int cbData, [MarshalAs(UnmanagedType.Bool)] bool fFinal);
- [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+ [LibraryImport(Libraries.Crypt32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool CryptMsgUpdate(SafeCryptMsgHandle hCryptMsg, IntPtr pbData, int cbData, [MarshalAs(UnmanagedType.Bool)] bool fFinal);
- [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+ [LibraryImport(Libraries.Crypt32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool CryptMsgUpdate(SafeCryptMsgHandle hCryptMsg, ref byte pbData, int cbData, [MarshalAs(UnmanagedType.Bool)] bool fFinal);
}
{
internal static partial class Crypt32
{
- [GeneratedDllImport(Libraries.Crypt32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Crypt32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool CryptProtectData(
in DATA_BLOB pDataIn,
internal const uint CRYPTPROTECTMEMORY_BLOCK_SIZE = 16;
internal const uint CRYPTPROTECTMEMORY_SAME_PROCESS = 0;
- [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+ [LibraryImport(Libraries.Crypt32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool CryptProtectMemory(SafeBuffer pData, uint cbData, uint dwFlags);
- [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+ [LibraryImport(Libraries.Crypt32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool CryptUnprotectMemory(SafeBuffer pData, uint cbData, uint dwFlags);
}
{
internal static partial class Crypt32
{
- [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+ [LibraryImport(Libraries.Crypt32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static unsafe partial bool CryptQueryObject(
CertQueryObjectType dwObjectType,
out SafeCertContextHandle ppvContext
);
- [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+ [LibraryImport(Libraries.Crypt32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static unsafe partial bool CryptQueryObject(
CertQueryObjectType dwObjectType,
IntPtr ppvContext
);
- [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+ [LibraryImport(Libraries.Crypt32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static unsafe partial bool CryptQueryObject(
CertQueryObjectType dwObjectType,
{
internal static partial class Crypt32
{
- [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+ [LibraryImport(Libraries.Crypt32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static unsafe partial bool CryptQueryObject(
CertQueryObjectType dwObjectType,
{
internal static partial class Crypt32
{
- [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+ [LibraryImport(Libraries.Crypt32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool CryptUnprotectData(
in DATA_BLOB pDataIn,
group == OidGroup.KeyDerivationFunction;
}
- [GeneratedDllImport(Interop.Libraries.Crypt32)]
+ [LibraryImport(Interop.Libraries.Crypt32)]
private static partial IntPtr CryptFindOIDInfo(CryptOidInfoKeyType dwKeyType, IntPtr pvKey, OidGroup group);
}
}
/// <summary>
/// Version used for a buffer containing a scalar integer (not an IntPtr)
/// </summary>
- [GeneratedDllImport(Libraries.Crypt32)]
+ [LibraryImport(Libraries.Crypt32)]
private static unsafe partial IntPtr CryptFindOIDInfo(CryptOidInfoKeyType dwKeyType, int* pvKey, OidGroup group);
public static CRYPT_OID_INFO FindAlgIdOidInfo(Interop.BCrypt.ECC_CURVE_ALG_ID_ENUM algId)
{
internal static partial class Crypt32
{
- [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+ [LibraryImport(Libraries.Crypt32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool PFXExportCertStore(SafeCertStoreHandle hStore, ref DATA_BLOB pPFX, SafePasswordHandle szPassword, PFXExportFlags dwFlags);
}
{
internal static partial class Crypt32
{
- [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+ [LibraryImport(Libraries.Crypt32, SetLastError = true)]
internal static partial SafeCertStoreHandle PFXImportCertStore(ref DATA_BLOB pPFX, SafePasswordHandle password, PfxCertStoreFlags dwFlags);
}
}
{
internal static partial class Crypt32
{
- [GeneratedDllImport(Interop.Libraries.Crypt32, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Crypt32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool CertFreeCertificateContext(IntPtr pCertContext);
- [GeneratedDllImport(Interop.Libraries.Crypt32, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Crypt32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool CertVerifyCertificateChainPolicy(
IntPtr pszPolicyOID,
#endif
}
- [GeneratedDllImport(Interop.Libraries.CryptUI, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.CryptUI, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool CryptUIDlgViewCertificateW(
in CRYPTUI_VIEWCERTIFICATE_STRUCTW ViewInfo, IntPtr pfPropertiesChanged);
- [GeneratedDllImport(Interop.Libraries.CryptUI, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.CryptUI, SetLastError = true)]
internal static partial SafeCertContextHandle CryptUIDlgSelectCertificateW(ref CRYPTUI_SELECTCERTIFICATE_STRUCTW csc);
}
}
{
internal static partial class Dsrole
{
- [GeneratedDllImport(Libraries.Dsrole)]
+ [LibraryImport(Libraries.Dsrole)]
public static partial int DsRoleFreeMemory(IntPtr buffer);
}
}
DsRolePrimaryDomainInfoBasicEx = 4
}
- [GeneratedDllImport(Libraries.Dsrole, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Dsrole, StringMarshalling = StringMarshalling.Utf16)]
internal static partial int DsRoleGetPrimaryDomainInformation(
[MarshalAs(UnmanagedType.LPTStr)] string lpServer,
DSROLE_PRIMARY_DOMAIN_INFO_LEVEL InfoLevel,
{
internal static partial class Gdi32
{
- [GeneratedDllImport(Libraries.Gdi32, SetLastError = true)]
+ [LibraryImport(Libraries.Gdi32, SetLastError = true)]
public static partial int BitBlt(IntPtr hdc, int x, int y, int cx, int cy,
IntPtr hdcSrc, int x1, int y1, RasterOp rop);
RGN_DIFF = 4,
}
- [GeneratedDllImport(Libraries.Gdi32, SetLastError = true)]
+ [LibraryImport(Libraries.Gdi32, SetLastError = true)]
public static partial RegionType CombineRgn(IntPtr hrgnDst, IntPtr hrgnSrc1, IntPtr hrgnSrc2, CombineMode iMode);
public static RegionType CombineRgn(HandleRef hrgnDst, HandleRef hrgnSrc1, HandleRef hrgnSrc2, CombineMode iMode)
{
internal static partial class Gdi32
{
- [GeneratedDllImport(Libraries.Gdi32)]
+ [LibraryImport(Libraries.Gdi32)]
public static partial IntPtr CreateCompatibleDC(IntPtr hdc);
}
}
{
internal static partial class Gdi32
{
- [GeneratedDllImport(Libraries.Gdi32, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Gdi32, StringMarshalling = StringMarshalling.Utf16)]
public static partial IntPtr CreateDCW(string pwszDriver, string pwszDevice, string? pszPort, IntPtr pdm);
}
}
{
internal static partial class Gdi32
{
- [GeneratedDllImport(Libraries.Gdi32)]
+ [LibraryImport(Libraries.Gdi32)]
public static partial IntPtr CreateFontIndirectW(ref User32.LOGFONT lplf);
}
}
{
internal static partial class Gdi32
{
- [GeneratedDllImport(Libraries.Gdi32, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Gdi32, StringMarshalling = StringMarshalling.Utf16)]
public static partial IntPtr CreateICW(string pszDriver, string pszDevice, string? pszPort, IntPtr pdm);
}
}
{
internal static partial class Gdi32
{
- [GeneratedDllImport(Libraries.Gdi32)]
+ [LibraryImport(Libraries.Gdi32)]
public static partial IntPtr CreateRectRgn(int x1, int y1, int x2, int y2);
}
}
{
internal static partial class Gdi32
{
- [GeneratedDllImport(Libraries.Gdi32)]
+ [LibraryImport(Libraries.Gdi32)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool DeleteDC(IntPtr hdc);
{
internal static partial class Gdi32
{
- [GeneratedDllImport(Libraries.Gdi32)]
+ [LibraryImport(Libraries.Gdi32)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool DeleteObject(IntPtr ho);
{
internal static partial class Gdi32
{
- [GeneratedDllImport(Libraries.Gdi32)]
+ [LibraryImport(Libraries.Gdi32)]
public static partial int GetClipRgn(IntPtr hdc, IntPtr hrgn);
public static int GetClipRgn(HandleRef hdc, IntPtr hrgn)
{
internal static partial class Gdi32
{
- [GeneratedDllImport(Libraries.Gdi32)]
+ [LibraryImport(Libraries.Gdi32)]
public static partial IntPtr GetCurrentObject(IntPtr hdc, ObjectType type);
public static IntPtr GetCurrentObject(HandleRef hdc, ObjectType type)
public const int DT_RASPRINTER = 2;
}
- [GeneratedDllImport(Libraries.Gdi32)]
+ [LibraryImport(Libraries.Gdi32)]
public static partial int GetDeviceCaps(IntPtr hdc, DeviceCapability index);
public static int GetDeviceCaps(HandleRef hdc, DeviceCapability index)
{
internal static partial class Gdi32
{
- [GeneratedDllImport(Libraries.Gdi32)]
+ [LibraryImport(Libraries.Gdi32)]
public static partial ObjectType GetObjectType(IntPtr h);
}
}
{
internal static partial class Gdi32
{
- [GeneratedDllImport(Libraries.Gdi32)]
+ [LibraryImport(Libraries.Gdi32)]
public static partial RegionType GetRgnBox(IntPtr hrgn, ref RECT lprc);
public static RegionType GetRgnBox(HandleRef hrgn, ref RECT lprc)
DEFAULT_GUI_FONT = 17
}
- [GeneratedDllImport(Libraries.Gdi32)]
+ [LibraryImport(Libraries.Gdi32)]
public static partial IntPtr GetStockObject(StockObject i);
}
}
{
internal static partial class Gdi32
{
- [GeneratedDllImport(Libraries.Gdi32)]
+ [LibraryImport(Libraries.Gdi32)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool OffsetViewportOrgEx(IntPtr hdc, int x, int y, ref Point lppt);
{
internal static partial class Gdi32
{
- [GeneratedDllImport(Libraries.Gdi32)]
+ [LibraryImport(Libraries.Gdi32)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool RestoreDC(IntPtr hdc, int nSavedDC);
{
internal static partial class Gdi32
{
- [GeneratedDllImport(Libraries.Gdi32)]
+ [LibraryImport(Libraries.Gdi32)]
public static partial int SaveDC(IntPtr hdc);
public static int SaveDC(HandleRef hdc)
{
internal static partial class Gdi32
{
- [GeneratedDllImport(Libraries.Gdi32, SetLastError = true)]
+ [LibraryImport(Libraries.Gdi32, SetLastError = true)]
public static partial RegionType SelectClipRgn(IntPtr hdc, IntPtr hrgn);
public static RegionType SelectClipRgn(HandleRef hdc, HandleRef hrgn)
}
- [GeneratedDllImport(Libraries.HttpApi, SetLastError = true)]
+ [LibraryImport(Libraries.HttpApi, SetLastError = true)]
internal static partial uint HttpInitialize(HTTPAPI_VERSION version, uint flags, IntPtr pReserved);
- [GeneratedDllImport(Libraries.HttpApi, SetLastError = true)]
+ [LibraryImport(Libraries.HttpApi, SetLastError = true)]
internal static partial uint HttpSetUrlGroupProperty(ulong urlGroupId, HTTP_SERVER_PROPERTY serverProperty, IntPtr pPropertyInfo, uint propertyInfoLength);
- [GeneratedDllImport(Libraries.HttpApi, SetLastError = true)]
+ [LibraryImport(Libraries.HttpApi, SetLastError = true)]
internal static unsafe partial uint HttpCreateServerSession(HTTPAPI_VERSION version, ulong* serverSessionId, uint reserved);
- [GeneratedDllImport(Libraries.HttpApi, SetLastError = true)]
+ [LibraryImport(Libraries.HttpApi, SetLastError = true)]
internal static unsafe partial uint HttpCreateUrlGroup(ulong serverSessionId, ulong* urlGroupId, uint reserved);
- [GeneratedDllImport(Libraries.HttpApi, SetLastError = true)]
+ [LibraryImport(Libraries.HttpApi, SetLastError = true)]
internal static partial uint HttpCloseUrlGroup(ulong urlGroupId);
- [GeneratedDllImport(Libraries.HttpApi, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.HttpApi, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
internal static unsafe partial uint HttpCreateRequestQueue(HTTPAPI_VERSION version, string pName,
Interop.Kernel32.SECURITY_ATTRIBUTES* pSecurityAttributes, uint flags, out HttpRequestQueueV2Handle pReqQueueHandle);
- [GeneratedDllImport(Libraries.HttpApi, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.HttpApi, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
internal static partial uint HttpAddUrlToUrlGroup(ulong urlGroupId, string pFullyQualifiedUrl, ulong context, uint pReserved);
- [GeneratedDllImport(Libraries.HttpApi, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.HttpApi, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
internal static partial uint HttpRemoveUrlFromUrlGroup(ulong urlGroupId, string pFullyQualifiedUrl, uint flags);
- [GeneratedDllImport(Libraries.HttpApi, SetLastError = true)]
+ [LibraryImport(Libraries.HttpApi, SetLastError = true)]
internal static unsafe partial uint HttpReceiveHttpRequest(SafeHandle requestQueueHandle, ulong requestId, uint flags, HTTP_REQUEST* pRequestBuffer, uint requestBufferLength, uint* pBytesReturned, NativeOverlapped* pOverlapped);
- [GeneratedDllImport(Libraries.HttpApi, SetLastError = true)]
+ [LibraryImport(Libraries.HttpApi, SetLastError = true)]
internal static unsafe partial uint HttpSendHttpResponse(SafeHandle requestQueueHandle, ulong requestId, uint flags, HTTP_RESPONSE* pHttpResponse, void* pCachePolicy, uint* pBytesSent, SafeLocalAllocHandle pRequestBuffer, uint requestBufferLength, NativeOverlapped* pOverlapped, void* pLogData);
- [GeneratedDllImport(Libraries.HttpApi, SetLastError = true)]
+ [LibraryImport(Libraries.HttpApi, SetLastError = true)]
internal static unsafe partial uint HttpWaitForDisconnect(SafeHandle requestQueueHandle, ulong connectionId, NativeOverlapped* pOverlapped);
- [GeneratedDllImport(Libraries.HttpApi, SetLastError = true)]
+ [LibraryImport(Libraries.HttpApi, SetLastError = true)]
internal static unsafe partial uint HttpReceiveRequestEntityBody(SafeHandle requestQueueHandle, ulong requestId, uint flags, void* pEntityBuffer, uint entityBufferLength, out uint bytesReturned, NativeOverlapped* pOverlapped);
- [GeneratedDllImport(Libraries.HttpApi, SetLastError = true)]
+ [LibraryImport(Libraries.HttpApi, SetLastError = true)]
internal static unsafe partial uint HttpSendResponseEntityBody(SafeHandle requestQueueHandle, ulong requestId, uint flags, ushort entityChunkCount, HTTP_DATA_CHUNK* pEntityChunks, uint* pBytesSent, SafeLocalAllocHandle pRequestBuffer, uint requestBufferLength, NativeOverlapped* pOverlapped, void* pLogData);
- [GeneratedDllImport(Libraries.HttpApi, SetLastError = true)]
+ [LibraryImport(Libraries.HttpApi, SetLastError = true)]
internal static partial uint HttpCloseRequestQueue(IntPtr pReqQueueHandle);
- [GeneratedDllImport(Libraries.HttpApi, SetLastError = true)]
+ [LibraryImport(Libraries.HttpApi, SetLastError = true)]
internal static partial uint HttpCancelHttpRequest(SafeHandle requestQueueHandle, ulong requestId, IntPtr pOverlapped);
- [GeneratedDllImport(Libraries.HttpApi, SetLastError = true)]
+ [LibraryImport(Libraries.HttpApi, SetLastError = true)]
internal static partial uint HttpCloseServerSession(ulong serverSessionId);
internal sealed class SafeLocalFreeChannelBinding : ChannelBinding
}
}
- [GeneratedDllImport(Libraries.HttpApi, SetLastError = true)]
+ [LibraryImport(Libraries.HttpApi, SetLastError = true)]
internal static unsafe partial uint HttpReceiveClientCertificate(SafeHandle requestQueueHandle, ulong connectionId, uint flags, HTTP_SSL_CLIENT_CERT_INFO* pSslClientCertInfo, uint sslClientCertInfoSize, uint* pBytesReceived, NativeOverlapped* pOverlapped);
- [GeneratedDllImport(Libraries.HttpApi, SetLastError = true)]
+ [LibraryImport(Libraries.HttpApi, SetLastError = true)]
internal static unsafe partial uint HttpReceiveClientCertificate(SafeHandle requestQueueHandle, ulong connectionId, uint flags, byte* pSslClientCertInfo, uint sslClientCertInfoSize, uint* pBytesReceived, NativeOverlapped* pOverlapped);
internal static readonly string?[] HttpVerbs = new string?[]
{
internal static partial class IpHlpApi
{
- [GeneratedDllImport(Interop.Libraries.IpHlpApi)]
+ [LibraryImport(Interop.Libraries.IpHlpApi)]
internal static unsafe partial uint GetNetworkParams(IntPtr pFixedInfo, uint* pOutBufLen);
}
}
}
}
- [GeneratedDllImport(Interop.Libraries.IpHlpApi, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.IpHlpApi, SetLastError = true)]
internal static partial SafeCloseIcmpHandle IcmpCreateFile();
- [GeneratedDllImport(Interop.Libraries.IpHlpApi, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.IpHlpApi, SetLastError = true)]
internal static partial SafeCloseIcmpHandle Icmp6CreateFile();
- [GeneratedDllImport(Interop.Libraries.IpHlpApi, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.IpHlpApi, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool IcmpCloseHandle(IntPtr handle);
- [GeneratedDllImport(Interop.Libraries.IpHlpApi, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.IpHlpApi, SetLastError = true)]
internal static partial uint IcmpSendEcho2(SafeCloseIcmpHandle icmpHandle, SafeWaitHandle Event, IntPtr apcRoutine, IntPtr apcContext,
uint ipAddress, SafeLocalAllocHandle data, ushort dataSize, ref IPOptions options, SafeLocalAllocHandle replyBuffer, uint replySize, uint timeout);
- [GeneratedDllImport(Interop.Libraries.IpHlpApi, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.IpHlpApi, SetLastError = true)]
internal static partial uint Icmp6SendEcho2(SafeCloseIcmpHandle icmpHandle, SafeWaitHandle Event, IntPtr apcRoutine, IntPtr apcContext,
byte[] sourceSocketAddress, byte[] destSocketAddress, SafeLocalAllocHandle data, ushort dataSize, ref IPOptions options, SafeLocalAllocHandle replyBuffer, uint replySize, uint timeout);
}
internal ReadOnlySpan<byte> localAddrAsSpan => MemoryMarshal.CreateSpan(ref localAddr[0], 16);
}
- [GeneratedDllImport(Interop.Libraries.IpHlpApi)]
+ [LibraryImport(Interop.Libraries.IpHlpApi)]
internal static unsafe partial uint GetAdaptersAddresses(
AddressFamily family,
uint flags,
IntPtr adapterAddresses,
uint* outBufLen);
- [GeneratedDllImport(Interop.Libraries.IpHlpApi)]
+ [LibraryImport(Interop.Libraries.IpHlpApi)]
internal static unsafe partial uint GetBestInterfaceEx(byte* ipAddress, int* index);
- [GeneratedDllImport(Interop.Libraries.IpHlpApi)]
+ [LibraryImport(Interop.Libraries.IpHlpApi)]
internal static partial uint GetIfEntry2(ref MibIfRow2 pIfRow);
- [GeneratedDllImport(Interop.Libraries.IpHlpApi)]
+ [LibraryImport(Interop.Libraries.IpHlpApi)]
internal static unsafe partial uint GetIpStatisticsEx(MibIpStats* statistics, AddressFamily family);
- [GeneratedDllImport(Interop.Libraries.IpHlpApi)]
+ [LibraryImport(Interop.Libraries.IpHlpApi)]
internal static unsafe partial uint GetTcpStatisticsEx(MibTcpStats* statistics, AddressFamily family);
- [GeneratedDllImport(Interop.Libraries.IpHlpApi)]
+ [LibraryImport(Interop.Libraries.IpHlpApi)]
internal static unsafe partial uint GetUdpStatisticsEx(MibUdpStats* statistics, AddressFamily family);
- [GeneratedDllImport(Interop.Libraries.IpHlpApi)]
+ [LibraryImport(Interop.Libraries.IpHlpApi)]
internal static unsafe partial uint GetIcmpStatistics(MibIcmpInfo* statistics);
- [GeneratedDllImport(Interop.Libraries.IpHlpApi)]
+ [LibraryImport(Interop.Libraries.IpHlpApi)]
internal static partial uint GetIcmpStatisticsEx(out MibIcmpInfoEx statistics, AddressFamily family);
- [GeneratedDllImport(Interop.Libraries.IpHlpApi)]
+ [LibraryImport(Interop.Libraries.IpHlpApi)]
internal static unsafe partial uint GetTcpTable(IntPtr pTcpTable, uint* dwOutBufLen, [MarshalAs(UnmanagedType.Bool)] bool order);
- [GeneratedDllImport(Interop.Libraries.IpHlpApi)]
+ [LibraryImport(Interop.Libraries.IpHlpApi)]
internal static unsafe partial uint GetExtendedTcpTable(IntPtr pTcpTable, uint* dwOutBufLen, [MarshalAs(UnmanagedType.Bool)] bool order,
uint IPVersion, TcpTableClass tableClass, uint reserved);
- [GeneratedDllImport(Interop.Libraries.IpHlpApi)]
+ [LibraryImport(Interop.Libraries.IpHlpApi)]
internal static unsafe partial uint GetUdpTable(IntPtr pUdpTable, uint* dwOutBufLen, [MarshalAs(UnmanagedType.Bool)] bool order);
- [GeneratedDllImport(Interop.Libraries.IpHlpApi)]
+ [LibraryImport(Interop.Libraries.IpHlpApi)]
internal static unsafe partial uint GetExtendedUdpTable(IntPtr pUdpTable, uint* dwOutBufLen, [MarshalAs(UnmanagedType.Bool)] bool order,
uint IPVersion, UdpTableClass tableClass, uint reserved);
- [GeneratedDllImport(Interop.Libraries.IpHlpApi)]
+ [LibraryImport(Interop.Libraries.IpHlpApi)]
internal static unsafe partial uint GetPerAdapterInfo(uint IfIndex, IntPtr pPerAdapterInfo, uint* pOutBufLen);
- [GeneratedDllImport(Interop.Libraries.IpHlpApi)]
+ [LibraryImport(Interop.Libraries.IpHlpApi)]
internal static partial void FreeMibTable(IntPtr handle);
- [GeneratedDllImport(Interop.Libraries.IpHlpApi)]
+ [LibraryImport(Interop.Libraries.IpHlpApi)]
internal static partial uint CancelMibChangeNotify2(IntPtr notificationHandle);
- [GeneratedDllImport(Interop.Libraries.IpHlpApi)]
+ [LibraryImport(Interop.Libraries.IpHlpApi)]
internal static unsafe partial uint NotifyStableUnicastIpAddressTable(
AddressFamily addressFamily,
out SafeFreeMibTable table,
{
internal static partial class IpHlpApi
{
- [GeneratedDllImport(Interop.Libraries.IpHlpApi, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.IpHlpApi, SetLastError = true)]
internal static partial uint if_nametoindex([MarshalAs(UnmanagedType.LPStr)] string name);
}
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool Beep(int frequency, int duration);
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static unsafe partial bool CancelIoEx(SafeHandle handle, NativeOverlapped* lpOverlapped);
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static unsafe partial bool CancelIoEx(IntPtr handle, NativeOverlapped* lpOverlapped);
}
{
internal const uint CTMF_INCLUDE_APPCONTAINER = 0x00000001;
- [GeneratedDllImport(Interop.Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Kernel32, SetLastError = true)]
internal static partial bool CheckTokenMembershipEx(SafeAccessTokenHandle TokenHandle, byte[] SidToCheck, uint Flags, ref bool IsMember);
}
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool ClearCommBreak(
SafeFileHandle hFile);
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool ClearCommError(
SafeFileHandle hFile,
ref int lpErrors,
ref COMSTAT lpStat);
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool ClearCommError(
SafeFileHandle hFile,
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool CloseHandle(IntPtr handle);
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
internal static partial IntPtr CreateIoCompletionPort(IntPtr FileHandle, IntPtr ExistingCompletionPort, UIntPtr CompletionKey, int NumberOfConcurrentThreads);
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool PostQueuedCompletionStatus(IntPtr CompletionPort, uint dwNumberOfBytesTransferred, UIntPtr CompletionKey, IntPtr lpOverlapped);
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool GetQueuedCompletionStatus(IntPtr CompletionPort, out uint lpNumberOfBytesTransferred, out UIntPtr CompletionKey, out IntPtr lpOverlapped, int dwMilliseconds);
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static unsafe partial bool GetQueuedCompletionStatusEx(
IntPtr CompletionPort,
private IntPtr Ptr;
}
- [GeneratedDllImport(Libraries.Kernel32)]
+ [LibraryImport(Libraries.Kernel32)]
internal static unsafe partial void InitializeConditionVariable(CONDITION_VARIABLE* ConditionVariable);
- [GeneratedDllImport(Libraries.Kernel32)]
+ [LibraryImport(Libraries.Kernel32)]
internal static unsafe partial void WakeConditionVariable(CONDITION_VARIABLE* ConditionVariable);
- [GeneratedDllImport(Libraries.Kernel32)]
+ [LibraryImport(Libraries.Kernel32)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static unsafe partial bool SleepConditionVariableCS(CONDITION_VARIABLE* ConditionVariable, CRITICAL_SECTION* CriticalSection, int dwMilliseconds);
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static unsafe partial bool ConnectNamedPipe(SafePipeHandle handle, NativeOverlapped* overlapped);
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool ConnectNamedPipe(SafePipeHandle handle, IntPtr overlapped);
}
internal BOOL bVisible;
}
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool GetConsoleCursorInfo(IntPtr hConsoleOutput, out CONSOLE_CURSOR_INFO cci);
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool SetConsoleCursorInfo(IntPtr hConsoleOutput, ref CONSOLE_CURSOR_INFO cci);
}
/// <summary>
/// WARNING: This method does not implicitly handle long paths. Use CopyFileEx.
/// </summary>
- [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "CopyFileExW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Kernel32, EntryPoint = "CopyFileExW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
private static partial bool CopyFileExPrivate(
string src,
/// <summary>
/// WARNING: This method does not implicitly handle long paths. Use CreateDirectory.
/// </summary>
- [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "CreateDirectoryW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Kernel32, EntryPoint = "CreateDirectoryW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
private static partial bool CreateDirectoryPrivate(
string path,
/// <summary>
/// WARNING: This method does not implicitly handle long paths. Use CreateFile.
/// </summary>
- [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "CreateFileW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Kernel32, EntryPoint = "CreateFileW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
private static unsafe partial SafeFileHandle CreateFilePrivate(
string lpFileName,
int dwDesiredAccess,
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "CreateFileMappingW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Kernel32, EntryPoint = "CreateFileMappingW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
internal static partial SafeMemoryMappedFileHandle CreateFileMapping(
SafeFileHandle hFile,
ref SECURITY_ATTRIBUTES lpFileMappingAttributes,
int dwMaximumSizeLow,
string? lpName);
- [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "CreateFileMappingW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Kernel32, EntryPoint = "CreateFileMappingW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
internal static partial SafeMemoryMappedFileHandle CreateFileMapping(
IntPtr hFile,
ref SECURITY_ATTRIBUTES lpFileMappingAttributes,
/// <summary>
/// WARNING: This method does not implicitly handle long paths. Use CreateFile.
/// </summary>
- [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "CreateFileW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Kernel32, EntryPoint = "CreateFileW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
private static unsafe partial IntPtr CreateFilePrivate_IntPtr(
string lpFileName,
int dwDesiredAccess,
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "CreateNamedPipeW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Kernel32, EntryPoint = "CreateNamedPipeW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
internal static partial SafePipeHandle CreateNamedPipe(
string pipeName,
int openMode,
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "CreateFileW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Kernel32, EntryPoint = "CreateFileW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
internal static partial SafePipeHandle CreateNamedPipeClient(
string? lpFileName,
int dwDesiredAccess,
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool CreatePipe(out SafeFileHandle hReadPipe, out SafeFileHandle hWritePipe, ref SECURITY_ATTRIBUTES lpPipeAttributes, int nSize);
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool CreatePipe(out SafePipeHandle hReadPipe, out SafePipeHandle hWritePipe, ref SECURITY_ATTRIBUTES lpPipeAttributes, int nSize);
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "CreateProcessW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Kernel32, EntryPoint = "CreateProcessW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static unsafe partial bool CreateProcess(
string? lpApplicationName,
/// </summary>
internal const int SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE = 0x2;
- [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "CreateSymbolicLinkW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Kernel32, EntryPoint = "CreateSymbolicLinkW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
private static partial bool CreateSymbolicLinkPrivate(string lpSymlinkFileName, string lpTargetFileName, int dwFlags);
}
// https://docs.microsoft.com/windows/desktop/api/tlhelp32/nf-tlhelp32-createtoolhelp32snapshot
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
internal static partial IntPtr CreateToolhelp32Snapshot(SnapshotFlags dwFlags, uint th32ProcessID);
// https://docs.microsoft.com/windows/desktop/api/tlhelp32/nf-tlhelp32-process32first
- [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "Process32FirstW", SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, EntryPoint = "Process32FirstW", SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool Process32First(IntPtr hSnapshot, ref PROCESSENTRY32 lppe);
// https://docs.microsoft.com/windows/desktop/api/tlhelp32/nf-tlhelp32-process32next
- [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "Process32NextW", SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, EntryPoint = "Process32NextW", SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool Process32Next(IntPtr hSnapshot, ref PROCESSENTRY32 lppe);
}
private UIntPtr SpinCount;
}
- [GeneratedDllImport(Libraries.Kernel32)]
+ [LibraryImport(Libraries.Kernel32)]
internal static unsafe partial void InitializeCriticalSection(CRITICAL_SECTION* lpCriticalSection);
- [GeneratedDllImport(Libraries.Kernel32)]
+ [LibraryImport(Libraries.Kernel32)]
internal static unsafe partial void EnterCriticalSection(CRITICAL_SECTION* lpCriticalSection);
- [GeneratedDllImport(Libraries.Kernel32)]
+ [LibraryImport(Libraries.Kernel32)]
internal static unsafe partial void LeaveCriticalSection(CRITICAL_SECTION* lpCriticalSection);
- [GeneratedDllImport(Libraries.Kernel32)]
+ [LibraryImport(Libraries.Kernel32)]
internal static unsafe partial void DeleteCriticalSection(CRITICAL_SECTION* lpCriticalSection);
}
}
/// <summary>
/// WARNING: This method does not implicitly handle long paths. Use DeleteFile.
/// </summary>
- [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "DeleteFileW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Kernel32, EntryPoint = "DeleteFileW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
private static partial bool DeleteFilePrivate(string path);
/// <summary>
/// WARNING: This method does not implicitly handle long paths. Use DeleteVolumeMountPoint.
/// </summary>
- [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "DeleteVolumeMountPointW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Kernel32, EntryPoint = "DeleteVolumeMountPointW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool DeleteVolumeMountPointPrivate(string mountPoint);
// https://docs.microsoft.com/windows/win32/api/winioctl/ni-winioctl-fsctl_get_reparse_point
internal const int FSCTL_GET_REPARSE_POINT = 0x000900a8;
- [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "DeviceIoControl", SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, EntryPoint = "DeviceIoControl", SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool DeviceIoControl(
SafeHandle hDevice,
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool DisconnectNamedPipe(SafePipeHandle hNamedPipe);
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool DuplicateHandle(
IntPtr hSourceProcessHandle,
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool DuplicateHandle(
IntPtr hSourceProcessHandle,
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool DuplicateHandle(
IntPtr hSourceProcessHandle,
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool DuplicateHandle(
IntPtr hSourceProcessHandle,
{
internal static unsafe partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32)]
+ [LibraryImport(Libraries.Kernel32)]
internal static partial IntPtr GetProcAddress(IntPtr hModule, byte* lpProcName);
}
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "K32EnumProcessModules", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Kernel32, EntryPoint = "K32EnumProcessModules", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool EnumProcessModules(SafeProcessHandle handle, IntPtr[]? modules, int size, out int needed);
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "K32EnumProcesses", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Kernel32, EntryPoint = "K32EnumProcesses", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool EnumProcesses(int[] processIds, int size, out int needed);
}
internal const int CLRDTR = 6;
}
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool EscapeCommFunction(
SafeFileHandle hFile,
internal const uint CREATE_EVENT_INITIAL_SET = 0x2;
internal const uint CREATE_EVENT_MANUAL_RESET = 0x1;
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool SetEvent(SafeWaitHandle handle);
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool ResetEvent(SafeWaitHandle handle);
- [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "CreateEventExW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Kernel32, EntryPoint = "CreateEventExW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
internal static partial SafeWaitHandle CreateEventEx(IntPtr lpSecurityAttributes, string? name, uint flags, uint desiredAccess);
- [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "OpenEventW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Kernel32, EntryPoint = "OpenEventW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
internal static partial SafeWaitHandle OpenEvent(uint desiredAccess, [MarshalAs(UnmanagedType.Bool)] bool inheritHandle, string name);
}
}
internal static unsafe partial class Kernel32
{
[DoesNotReturn]
- [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "ExitProcess")]
+ [LibraryImport(Libraries.Kernel32, EntryPoint = "ExitProcess")]
internal static partial void ExitProcess(int exitCode);
}
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "ExpandEnvironmentStringsW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Kernel32, EntryPoint = "ExpandEnvironmentStringsW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
internal static partial uint ExpandEnvironmentStrings(string lpSrc, ref char lpDst, uint nSize);
}
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
internal static unsafe partial int ReadFileScatter(
SafeHandle hFile,
long* aSegmentArray,
IntPtr lpReserved,
NativeOverlapped* lpOverlapped);
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
internal static unsafe partial int WriteFileGather(
SafeHandle hFile,
long* aSegmentArray,
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32)]
+ [LibraryImport(Libraries.Kernel32)]
[SuppressGCTransition]
internal static unsafe partial Interop.BOOL FileTimeToSystemTime(ulong* lpFileTime, Interop.Kernel32.SYSTEMTIME* lpSystemTime);
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool FillConsoleOutputAttribute(IntPtr hConsoleOutput, short wColorAttribute, int numCells, COORD startCoord, out int pNumBytesWritten);
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "FillConsoleOutputCharacterW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Kernel32, EntryPoint = "FillConsoleOutputCharacterW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool FillConsoleOutputCharacter(IntPtr hConsoleOutput, char character, int nLength, COORD dwWriteCoord, out int pNumCharsWritten);
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool FindClose(IntPtr hFindFile);
}
/// <summary>
/// WARNING: This method does not implicitly handle long paths. Use FindFirstFile.
/// </summary>
- [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "FindFirstFileExW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Kernel32, EntryPoint = "FindFirstFileExW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
private static partial SafeFindHandle FindFirstFileExPrivate(string lpFileName, FINDEX_INFO_LEVELS fInfoLevelId, ref WIN32_FIND_DATA lpFindFileData, FINDEX_SEARCH_OPS fSearchOp, IntPtr lpSearchFilter, int dwAdditionalFlags);
internal static SafeFindHandle FindFirstFile(string fileName, ref WIN32_FIND_DATA data)
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "FindNextFileW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Kernel32, EntryPoint = "FindNextFileW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool FindNextFile(SafeFindHandle hndFindFile, ref WIN32_FIND_DATA lpFindFileData);
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool FlushFileBuffers(SafeHandle hHandle);
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool FlushViewOfFile(IntPtr lpBaseAddress, UIntPtr dwNumberOfBytesToFlush);
}
private const int FORMAT_MESSAGE_ALLOCATE_BUFFER = 0x00000100;
private const int ERROR_INSUFFICIENT_BUFFER = 0x7A;
- [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "FormatMessageW", SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, EntryPoint = "FormatMessageW", SetLastError = true)]
private static unsafe partial int FormatMessage(
int dwFlags,
IntPtr lpSource,
public const int FORMAT_MESSAGE_FROM_HMODULE = 0x00000800;
public const int FORMAT_MESSAGE_ARGUMENT_ARRAY = 0x00002000;
- [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "FormatMessageW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Kernel32, EntryPoint = "FormatMessageW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
public static partial int FormatMessage(
int dwFlags,
SafeLibraryHandle lpSource,
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32)]
+ [LibraryImport(Libraries.Kernel32)]
internal static unsafe partial BOOL FreeEnvironmentStringsW(char* lpszEnvironmentBlock);
}
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool FreeLibrary(IntPtr hModule);
}
internal fixed byte LeadByte[12 /* MAX_LEADBYTES */];
}
- [GeneratedDllImport(Libraries.Kernel32)]
+ [LibraryImport(Libraries.Kernel32)]
internal static unsafe partial Interop.BOOL GetCPInfo(uint codePage, CPINFO* lpCpInfo);
}
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "GetCPInfoExW", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Kernel32, EntryPoint = "GetCPInfoExW", StringMarshalling = StringMarshalling.Utf16)]
private static unsafe partial Interop.BOOL GetCPInfoExW(uint CodePage, uint dwFlags, CPINFOEXW* lpCPInfoEx);
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
internal const int MS_RLSD_ON = 0x80;
}
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool GetCommModemStatus(
SafeFileHandle hFile,
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool GetCommProperties(
SafeFileHandle hFile,
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool GetCommState(
SafeFileHandle hFile,
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "GetComputerNameW")]
+ [LibraryImport(Libraries.Kernel32, EntryPoint = "GetComputerNameW")]
private static unsafe partial int GetComputerName(char* lpBuffer, uint* nSize);
// maximum length of the NETBIOS name (not including NULL)
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32)]
+ [LibraryImport(Libraries.Kernel32)]
internal static partial uint GetConsoleCP();
}
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool GetConsoleMode(IntPtr handle, out int mode);
return GetConsoleMode(handle, out _);
}
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool SetConsoleMode(IntPtr handle, int mode);
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32)]
+ [LibraryImport(Libraries.Kernel32)]
internal static partial uint GetConsoleOutputCP();
}
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool GetConsoleScreenBufferInfo(IntPtr hConsoleOutput, out CONSOLE_SCREEN_BUFFER_INFO lpConsoleScreenBufferInfo);
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
internal static unsafe partial uint GetConsoleTitleW(char* title, uint nSize);
}
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "GetCurrentDirectoryW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Kernel32, EntryPoint = "GetCurrentDirectoryW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
internal static partial uint GetCurrentDirectory(uint nBufferLength, ref char lpBuffer);
}
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32)]
+ [LibraryImport(Libraries.Kernel32)]
internal static partial IntPtr GetCurrentProcess();
}
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32)]
+ [LibraryImport(Libraries.Kernel32)]
internal static partial uint GetCurrentProcessId();
}
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32)]
+ [LibraryImport(Libraries.Kernel32)]
internal static partial uint GetCurrentProcessorNumber();
}
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Interop.Libraries.Kernel32)]
+ [LibraryImport(Interop.Libraries.Kernel32)]
internal static partial IntPtr GetCurrentThread();
}
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32)]
+ [LibraryImport(Libraries.Kernel32)]
[SuppressGCTransition]
public static partial int GetCurrentThreadId();
}
{
// NOTE: The out parameters are PULARGE_INTEGERs and may require
// some byte munging magic.
- [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "GetDiskFreeSpaceExW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Kernel32, EntryPoint = "GetDiskFreeSpaceExW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool GetDiskFreeSpaceEx(string drive, out long freeBytesForUser, out long totalBytes, out long freeBytes);
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "GetDriveTypeW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Kernel32, EntryPoint = "GetDriveTypeW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
internal static partial int GetDriveType(string drive);
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32)]
+ [LibraryImport(Libraries.Kernel32)]
internal static unsafe partial char* GetEnvironmentStringsW();
}
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "GetEnvironmentVariableW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Kernel32, EntryPoint = "GetEnvironmentVariableW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
internal static partial uint GetEnvironmentVariable(string lpName, ref char lpBuffer, uint nSize);
}
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool GetExitCodeProcess(SafeProcessHandle processHandle, out int exitCode);
}
/// <summary>
/// WARNING: This method does not implicitly handle long paths. Use GetFileAttributesEx.
/// </summary>
- [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "GetFileAttributesExW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Kernel32, EntryPoint = "GetFileAttributesExW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
private static partial bool GetFileAttributesExPrivate(
string? name,
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static unsafe partial bool GetFileInformationByHandleEx(SafeFileHandle hFile, int FileInformationClass, void* lpFileInformation, uint dwBufferSize);
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
internal static partial uint GetFileType(IntPtr hFile);
}
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
internal static partial int GetFileType(SafeHandle hFile);
}
}
internal const uint FILE_NAME_NORMALIZED = 0x0;
// https://docs.microsoft.com/windows/desktop/api/fileapi/nf-fileapi-getfinalpathnamebyhandlew (kernel32)
- [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "GetFinalPathNameByHandleW", SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, EntryPoint = "GetFinalPathNameByHandleW", SetLastError = true)]
internal static unsafe partial uint GetFinalPathNameByHandle(
SafeFileHandle hFile,
char* lpszFilePath,
/// <summary>
/// WARNING: This method does not implicitly handle long paths. Use GetFullPathName or PathHelper.
/// </summary>
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
internal static partial uint GetFullPathNameW(
ref char lpFileName,
uint nBufferLength,
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
internal static partial Interop.Kernel32.COORD GetLargestConsoleWindowSize(IntPtr hConsoleOutput);
}
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32)]
+ [LibraryImport(Libraries.Kernel32)]
[SuppressGCTransition]
internal static partial int GetLastError();
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
internal static partial int GetLogicalDrives();
}
}
/// <summary>
/// WARNING: This method does not implicitly handle long paths. Use GetFullPath/PathHelper.
/// </summary>
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
internal static partial uint GetLongPathNameW(
ref char lpszShortPath,
ref char lpszLongPath,
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "K32GetModuleBaseNameW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Kernel32, EntryPoint = "K32GetModuleBaseNameW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
internal static partial int GetModuleBaseName(SafeProcessHandle processHandle, IntPtr moduleHandle, [Out] char[] baseName, int size);
}
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "GetModuleFileNameW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Kernel32, EntryPoint = "GetModuleFileNameW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
internal static partial uint GetModuleFileName(IntPtr hModule, ref char lpFilename, uint nSize);
}
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "K32GetModuleFileNameExW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Kernel32, EntryPoint = "K32GetModuleFileNameExW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
internal static partial int GetModuleFileNameEx(SafeProcessHandle processHandle, IntPtr moduleHandle, [Out] char[] baseName, int size);
}
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "GetModuleHandleW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Kernel32, EntryPoint = "GetModuleHandleW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
internal static partial IntPtr GetModuleHandle(string? moduleName);
}
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "K32GetModuleInformation", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Kernel32, EntryPoint = "K32GetModuleInformation", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
private static partial bool GetModuleInformation(SafeProcessHandle processHandle, IntPtr moduleHandle, out NtModuleInfo ntModuleInfo, int size);
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static unsafe partial bool GetNamedPipeHandleStateW(
SafePipeHandle hNamedPipe,
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static unsafe partial bool GetNamedPipeInfo(
SafePipeHandle hNamedPipe,
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32)]
+ [LibraryImport(Libraries.Kernel32)]
internal static unsafe partial void GetNativeSystemInfo(SYSTEM_INFO* lpSystemInfo);
}
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static unsafe partial bool GetOverlappedResult(
SafeFileHandle hFile,
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
internal static partial int GetPriorityClass(SafeProcessHandle handle);
}
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32)]
+ [LibraryImport(Libraries.Kernel32)]
public static partial IntPtr GetProcAddress(SafeLibraryHandle hModule, [MarshalAs(UnmanagedType.LPStr)] string lpProcName);
- [GeneratedDllImport(Libraries.Kernel32)]
+ [LibraryImport(Libraries.Kernel32)]
public static partial IntPtr GetProcAddress(IntPtr hModule, [MarshalAs(UnmanagedType.LPStr)] string lpProcName);
}
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool GetProcessAffinityMask(SafeProcessHandle handle, out IntPtr processMask, out IntPtr systemMask);
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32)]
+ [LibraryImport(Libraries.Kernel32)]
public static partial int GetProcessId(SafeProcessHandle nativeHandle);
}
}
public UIntPtr PeakPagefileUsage;
}
- [GeneratedDllImport(Libraries.Kernel32, EntryPoint ="K32GetProcessMemoryInfo")]
+ [LibraryImport(Libraries.Kernel32, EntryPoint ="K32GetProcessMemoryInfo")]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool GetProcessMemoryInfo(IntPtr Process, ref PROCESS_MEMORY_COUNTERS ppsmemCounters, uint cb);
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "QueryFullProcessImageNameW", SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, EntryPoint = "QueryFullProcessImageNameW", SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
private static unsafe partial bool QueryFullProcessImageName(
SafeHandle hProcess,
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool GetProcessPriorityBoost(SafeProcessHandle handle, [MarshalAs(UnmanagedType.Bool)] out bool disabled);
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool GetProcessTimes(
SafeProcessHandle handle, out long creation, out long exit, out long kernel, out long user);
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool GetProcessTimes(IntPtr handleProcess, out long creation, out long exit, out long kernel, out long user);
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool GetProcessWorkingSetSizeEx(SafeProcessHandle handle, out IntPtr min, out IntPtr max, out int flags);
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32)]
+ [LibraryImport(Libraries.Kernel32)]
#if !NO_SUPPRESS_GC_TRANSITION
[SuppressGCTransition]
#endif
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
internal static partial uint GetSystemDirectoryW(ref char lpBuffer, uint uSize);
}
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32)]
+ [LibraryImport(Libraries.Kernel32)]
internal static unsafe partial void GetSystemInfo(SYSTEM_INFO* lpSystemInfo);
}
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32)]
+ [LibraryImport(Libraries.Kernel32)]
[SuppressGCTransition]
internal static unsafe partial void GetSystemTime(Interop.Kernel32.SYSTEMTIME* lpSystemTime);
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool GetSystemTimes(out long idle, out long kernel, out long user);
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
internal static partial uint GetTempFileNameW(ref char lpPathName, string lpPrefixString, uint uUnique, ref char lpTempFileName);
}
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Kernel32, StringMarshalling = StringMarshalling.Utf16)]
internal static partial uint GetTempPathW(int bufferLen, ref char buffer);
}
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
internal static partial int GetThreadPriority(SafeThreadHandle handle);
}
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool GetThreadPriorityBoost(SafeThreadHandle handle, [MarshalAs(UnmanagedType.Bool)] out bool disabled);
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool GetThreadTimes(SafeThreadHandle handle, out long creation, out long exit, out long kernel, out long user);
}
{
internal static unsafe partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32)]
+ [LibraryImport(Libraries.Kernel32)]
[SuppressGCTransition]
internal static partial ulong GetTickCount64();
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Interop.Libraries.Kernel32)]
+ [LibraryImport(Interop.Libraries.Kernel32)]
internal static partial int GetUserDefaultLCID();
}
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "GetVolumeInformationW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Kernel32, EntryPoint = "GetVolumeInformationW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static unsafe partial bool GetVolumeInformation(
string drive,
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
public static partial IntPtr GlobalFree(IntPtr handle);
public static IntPtr GlobalFree(HandleRef handle)
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
public static partial IntPtr GlobalLock(IntPtr hMem);
public static IntPtr GlobalLock(HandleRef hMem)
return result;
}
- [GeneratedDllImport(Libraries.Kernel32)]
+ [LibraryImport(Libraries.Kernel32)]
public static partial IntPtr GlobalUnlock(IntPtr hMem);
public static IntPtr GlobalUnlock(HandleRef hMem)
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32)]
+ [LibraryImport(Libraries.Kernel32)]
internal static unsafe partial BOOL GlobalMemoryStatusEx(MEMORYSTATUSEX* lpBuffer);
}
}
internal const string LOCALE_NAME_USER_DEFAULT = null;
internal const string LOCALE_NAME_SYSTEM_DEFAULT = "!x-sys-default-locale";
- [GeneratedDllImport("kernel32.dll", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport("kernel32.dll", StringMarshalling = StringMarshalling.Utf16)]
internal static unsafe partial int LCIDToLocaleName(int locale, char* pLocaleName, int cchName, uint dwFlags);
- [GeneratedDllImport("kernel32.dll", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport("kernel32.dll", StringMarshalling = StringMarshalling.Utf16)]
internal static partial int LocaleNameToLCID(string lpName, uint dwFlags);
- [GeneratedDllImport("kernel32.dll", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport("kernel32.dll", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
internal static unsafe partial int LCMapStringEx(
string? lpLocaleName,
uint dwMapFlags,
void* lpReserved,
IntPtr sortHandle);
- [GeneratedDllImport("kernel32.dll", EntryPoint = "FindNLSStringEx", SetLastError = SetLastErrorForDebug)]
+ [LibraryImport("kernel32.dll", EntryPoint = "FindNLSStringEx", SetLastError = SetLastErrorForDebug)]
internal static unsafe partial int FindNLSStringEx(
char* lpLocaleName,
uint dwFindNLSStringFlags,
void* lpReserved,
IntPtr sortHandle);
- [GeneratedDllImport("kernel32.dll", EntryPoint = "CompareStringEx")]
+ [LibraryImport("kernel32.dll", EntryPoint = "CompareStringEx")]
internal static unsafe partial int CompareStringEx(
char* lpLocaleName,
uint dwCmpFlags,
void* lpReserved,
IntPtr lParam);
- [GeneratedDllImport("kernel32.dll", EntryPoint = "CompareStringOrdinal")]
+ [LibraryImport("kernel32.dll", EntryPoint = "CompareStringOrdinal")]
internal static unsafe partial int CompareStringOrdinal(
char* lpString1,
int cchCount1,
int cchCount2,
[MarshalAs(UnmanagedType.Bool)] bool bIgnoreCase);
- [GeneratedDllImport("kernel32.dll", EntryPoint = "FindStringOrdinal", SetLastError = SetLastErrorForDebug)]
+ [LibraryImport("kernel32.dll", EntryPoint = "FindStringOrdinal", SetLastError = SetLastErrorForDebug)]
internal static unsafe partial int FindStringOrdinal(
uint dwFindStringOrdinalFlags,
char* lpStringSource,
int cchValue,
BOOL bIgnoreCase);
- [GeneratedDllImport("kernel32.dll", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport("kernel32.dll", StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static unsafe partial bool IsNLSDefinedString(
int Function,
char* lpString,
int cchStr);
- [GeneratedDllImport("kernel32.dll")]
+ [LibraryImport("kernel32.dll")]
internal static unsafe partial Interop.BOOL GetUserPreferredUILanguages(uint dwFlags, uint* pulNumLanguages, char* pwszLanguagesBuffer, uint* pcchLanguagesBuffer);
- [GeneratedDllImport("kernel32.dll", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport("kernel32.dll", StringMarshalling = StringMarshalling.Utf16)]
internal static unsafe partial int GetLocaleInfoEx(string lpLocaleName, uint LCType, void* lpLCData, int cchData);
- [GeneratedDllImport("kernel32.dll", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport("kernel32.dll", StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static unsafe partial bool EnumSystemLocalesEx(delegate* unmanaged<char*, uint, void*, BOOL> lpLocaleEnumProcEx, uint dwFlags, void* lParam, IntPtr reserved);
- [GeneratedDllImport("kernel32.dll", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport("kernel32.dll", StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static unsafe partial bool EnumTimeFormatsEx(delegate* unmanaged<char*, void*, BOOL> lpTimeFmtEnumProcEx, string lpLocaleName, uint dwFlags, void* lParam);
- [GeneratedDllImport("kernel32.dll", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport("kernel32.dll", StringMarshalling = StringMarshalling.Utf16)]
internal static partial int GetCalendarInfoEx(string? lpLocaleName, uint Calendar, IntPtr lpReserved, uint CalType, IntPtr lpCalData, int cchData, out int lpValue);
- [GeneratedDllImport("kernel32.dll", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport("kernel32.dll", StringMarshalling = StringMarshalling.Utf16)]
internal static partial int GetCalendarInfoEx(string? lpLocaleName, uint Calendar, IntPtr lpReserved, uint CalType, IntPtr lpCalData, int cchData, IntPtr lpValue);
- [GeneratedDllImport("kernel32.dll")]
+ [LibraryImport("kernel32.dll")]
internal static partial int GetUserGeoID(int geoClass);
- [GeneratedDllImport("kernel32.dll", EntryPoint = "GetGeoInfoW")]
+ [LibraryImport("kernel32.dll", EntryPoint = "GetGeoInfoW")]
internal static unsafe partial int GetGeoInfo(int location, int geoType, char* lpGeoData, int cchData, int LangId);
- [GeneratedDllImport("kernel32.dll", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport("kernel32.dll", StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static unsafe partial bool EnumCalendarInfoExEx(delegate* unmanaged<char*, uint, IntPtr, void*, BOOL> pCalInfoEnumProcExEx, string lpLocaleName, uint Calendar, string? lpReserved, uint CalType, void* lParam);
internal Guid guidCustomVersion;
}
- [GeneratedDllImport("kernel32.dll", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport("kernel32.dll", StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static unsafe partial bool GetNLSVersionEx(int function, string localeName, NlsVersionInfoEx* lpVersionInformation);
}
HANDLE_FLAG_PROTECT_FROM_CLOSE = 2
}
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool SetHandleInformation(SafeHandle hObject, HandleFlags dwMask, HandleFlags dwFlags);
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32)]
+ [LibraryImport(Libraries.Kernel32)]
internal static partial IntPtr GetProcessHeap();
[Flags]
HEAP_GENERATE_EXCEPTIONS = 0x00000004,
}
- [GeneratedDllImport(Libraries.Kernel32)]
+ [LibraryImport(Libraries.Kernel32)]
internal static partial SafeHeapAllocHandle HeapAlloc(IntPtr hHeap, HeapAllocFlags dwFlags, nint dwBytes);
- [GeneratedDllImport(Libraries.Kernel32)]
+ [LibraryImport(Libraries.Kernel32)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool HeapFree(IntPtr hHeap, HeapAllocFlags dwFlags, IntPtr lpMem);
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32)]
+ [LibraryImport(Libraries.Kernel32)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool IsDebuggerPresent();
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool IsWow64Process(IntPtr hProcess, [MarshalAs(UnmanagedType.Bool)] out bool Wow64Process);
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool IsWow64Process(SafeProcessHandle hProcess, [MarshalAs(UnmanagedType.Bool)] out bool Wow64Process);
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "LoadLibraryW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Kernel32, EntryPoint = "LoadLibraryW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
public static partial IntPtr LoadLibrary(string libFilename);
}
}
public const int LOAD_LIBRARY_AS_DATAFILE = 0x00000002;
public const int LOAD_LIBRARY_SEARCH_SYSTEM32 = 0x00000800;
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
public static partial SafeLibraryHandle LoadLibraryExW(string lpwLibFileName, IntPtr hFile, uint dwFlags);
}
}
internal const int LOAD_LIBRARY_AS_DATAFILE = 0x00000002;
internal const int LOAD_LIBRARY_SEARCH_SYSTEM32 = 0x00000800;
- [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "LoadLibraryExW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Kernel32, EntryPoint = "LoadLibraryExW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
internal static partial IntPtr LoadLibraryEx(string libFilename, IntPtr reserved, int flags);
}
}
internal const uint LMEM_MOVEABLE = 0x0002;
internal const uint LMEM_ZEROINIT = 0x0040;
- [GeneratedDllImport(Libraries.Kernel32)]
+ [LibraryImport(Libraries.Kernel32)]
internal static partial IntPtr LocalAlloc(uint uFlags, nuint uBytes);
- [GeneratedDllImport(Libraries.Kernel32)]
+ [LibraryImport(Libraries.Kernel32)]
internal static partial IntPtr LocalReAlloc(IntPtr hMem, nuint uBytes, uint uFlags);
- [GeneratedDllImport(Libraries.Kernel32)]
+ [LibraryImport(Libraries.Kernel32)]
internal static partial IntPtr LocalFree(IntPtr hMem);
}
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool LockFile(SafeFileHandle handle, int offsetLow, int offsetHigh, int countLow, int countHigh);
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool UnlockFile(SafeFileHandle handle, int offsetLow, int offsetHigh, int countLow, int countHigh);
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "MapViewOfFile", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Kernel32, EntryPoint = "MapViewOfFile", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
internal static partial SafeMemoryMappedViewHandle MapViewOfFile(
SafeMemoryMappedFileHandle hFileMappingObject,
int dwDesiredAccess,
/// <summary>
/// WARNING: This method does not implicitly handle long paths. Use MoveFile.
/// </summary>
- [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "MoveFileExW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Kernel32, EntryPoint = "MoveFileExW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
private static partial bool MoveFileExPrivate(
string src, string dst, uint flags);
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32)]
+ [LibraryImport(Libraries.Kernel32)]
internal static unsafe partial int MultiByteToWideChar(
uint CodePage, uint dwFlags,
byte* lpMultiByteStr, int cbMultiByte,
{
internal const uint CREATE_MUTEX_INITIAL_OWNER = 0x1;
- [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "OpenMutexW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Kernel32, EntryPoint = "OpenMutexW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
internal static partial SafeWaitHandle OpenMutex(uint desiredAccess, [MarshalAs(UnmanagedType.Bool)] bool inheritHandle, string name);
- [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "CreateMutexExW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Kernel32, EntryPoint = "CreateMutexExW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
internal static partial SafeWaitHandle CreateMutexEx(IntPtr lpMutexAttributes, string? name, uint flags, uint desiredAccess);
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
[return:MarshalAs(UnmanagedType.Bool)]
internal static partial bool ReleaseMutex(SafeWaitHandle handle);
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "OpenFileMappingW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Kernel32, EntryPoint = "OpenFileMappingW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
internal static partial SafeMemoryMappedFileHandle OpenFileMapping(
int dwDesiredAccess,
[MarshalAs(UnmanagedType.Bool)] bool bInheritHandle,
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
internal static partial SafeProcessHandle OpenProcess(
int access, [MarshalAs(UnmanagedType.Bool)] bool inherit, int processId);
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
internal static partial SafeThreadHandle OpenThread(int access, [MarshalAs(UnmanagedType.Bool)] bool inherit, int threadId);
}
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Interop.Libraries.Kernel32, EntryPoint = "OutputDebugStringW", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Interop.Libraries.Kernel32, EntryPoint = "OutputDebugStringW", StringMarshalling = StringMarshalling.Utf16)]
internal static partial void OutputDebugString(string message);
}
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "PeekConsoleInputW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Kernel32, EntryPoint = "PeekConsoleInputW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool PeekConsoleInput(IntPtr hConsoleInput, out InputRecord buffer, int numInputRecords_UseOne, out int numEventsRead);
}
internal const uint PURGE_RXCLEAR = 0x0008; // Kill the typeahead buffer if there.
}
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool PurgeComm(
SafeFileHandle hFile,
// We take a long* (rather than a out long) to avoid the pinning overhead.
// We don't set last error since we don't need the extended error info.
- [GeneratedDllImport(Libraries.Kernel32)]
+ [LibraryImport(Libraries.Kernel32)]
[SuppressGCTransition]
internal static unsafe partial BOOL QueryPerformanceCounter(long* lpPerformanceCount);
}
// We take a long* (rather than a out long) to avoid the pinning overhead.
// We don't set last error since we don't need the extended error info.
- [GeneratedDllImport(Libraries.Kernel32)]
+ [LibraryImport(Libraries.Kernel32)]
internal static unsafe partial BOOL QueryPerformanceFrequency(long* lpFrequency);
}
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32)]
+ [LibraryImport(Libraries.Kernel32)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool QueryUnbiasedInterruptTime(out ulong UnbiasedTime);
}
pExAddress == IntPtr.Zero ? FAIL_FAST_GENERATE_EXCEPTION_ADDRESS : 0);
}
- [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "RaiseFailFastException")]
+ [LibraryImport(Libraries.Kernel32, EntryPoint = "RaiseFailFastException")]
[DoesNotReturn]
private static unsafe partial void RaiseFailFastException(
EXCEPTION_RECORD* pExceptionRecord,
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "ReadConsoleW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Kernel32, EntryPoint = "ReadConsoleW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static unsafe partial bool ReadConsole(
IntPtr hConsoleInput,
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "ReadConsoleInputW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Kernel32, EntryPoint = "ReadConsoleInputW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool ReadConsoleInput(IntPtr hConsoleInput, out InputRecord buffer, int numInputRecords_UseOne, out int numEventsRead);
}
private short attributes;
}
- [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "ReadConsoleOutputW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Kernel32, EntryPoint = "ReadConsoleOutputW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static unsafe partial bool ReadConsoleOutput(IntPtr hConsoleOutput, CHAR_INFO* pBuffer, COORD bufferSize, COORD bufferCoord, ref SMALL_RECT readRegion);
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "ReadDirectoryChangesW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Kernel32, EntryPoint = "ReadDirectoryChangesW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static unsafe partial bool ReadDirectoryChangesW(
SafeFileHandle hDirectory,
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
internal static unsafe partial int ReadFile(
IntPtr handle,
byte* bytes,
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
internal static unsafe partial int ReadFile(
SafeHandle handle,
byte* bytes,
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
internal static unsafe partial int ReadFile(
SafeHandle handle,
byte* bytes,
IntPtr numBytesRead_mustBeZero,
NativeOverlapped* overlapped);
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
internal static unsafe partial int ReadFile(
SafeHandle handle,
byte* bytes,
/// <summary>
/// WARNING: This method does not implicitly handle long paths. Use RemoveDirectory.
/// </summary>
- [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "RemoveDirectoryW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Kernel32, EntryPoint = "RemoveDirectoryW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
private static partial bool RemoveDirectoryPrivate(string path);
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "ReplaceFileW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Kernel32, EntryPoint = "ReplaceFileW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
private static partial bool ReplaceFilePrivate(
string replacedFileName, string replacementFileName, string? backupFileName,
{
internal const int LOCALE_NAME_MAX_LENGTH = 85;
- [GeneratedDllImport("kernel32.dll", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport("kernel32.dll", StringMarshalling = StringMarshalling.Utf16)]
internal static partial int ResolveLocaleName(string lpNameToResolve, char* lpLocaleName, int cchLocaleName);
}
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "OpenSemaphoreW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Kernel32, EntryPoint = "OpenSemaphoreW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
internal static partial SafeWaitHandle OpenSemaphore(uint desiredAccess, [MarshalAs(UnmanagedType.Bool)] bool inheritHandle, string name);
- [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "CreateSemaphoreExW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Kernel32, EntryPoint = "CreateSemaphoreExW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
internal static partial SafeWaitHandle CreateSemaphoreEx(IntPtr lpSecurityAttributes, int initialCount, int maximumCount, string? name, uint flags, uint desiredAccess);
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool ReleaseSemaphore(SafeWaitHandle handle, int releaseCount, out int previousCount);
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool SetCommBreak(
SafeFileHandle hFile);
internal const int ALL_EVENTS = 0x1fb;
}
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool SetCommMask(
SafeFileHandle hFile,
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool SetCommState(
SafeFileHandle hFile,
{
internal const int MAXDWORD = -1; // This is 0xfffffff, or UInt32.MaxValue, here used as an int
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool SetCommTimeouts(
SafeFileHandle hFile,
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool SetConsoleCP(int codePage);
}
{
internal delegate bool ConsoleCtrlHandlerRoutine(int controlType);
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool SetConsoleCtrlHandler(ConsoleCtrlHandlerRoutine handler, [MarshalAs(UnmanagedType.Bool)] bool addOrRemove);
}
internal const int CTRL_LOGOFF_EVENT = 5;
internal const int CTRL_SHUTDOWN_EVENT = 6;
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static unsafe partial bool SetConsoleCtrlHandler(delegate* unmanaged<int, BOOL> handler, [MarshalAs(UnmanagedType.Bool)] bool Add);
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool SetConsoleCursorPosition(IntPtr hConsoleOutput, COORD cursorPosition);
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool SetConsoleOutputCP(int codePage);
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool SetConsoleScreenBufferSize(IntPtr hConsoleOutput, Interop.Kernel32.COORD size);
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
internal static partial int SetConsoleTextAttribute(IntPtr hConsoleOutput, short wAttributes);
}
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "SetConsoleTitleW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Kernel32, EntryPoint = "SetConsoleTitleW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool SetConsoleTitle(string title);
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static unsafe partial bool SetConsoleWindowInfo(IntPtr hConsoleOutput, [MarshalAs(UnmanagedType.Bool)] bool absolute, SMALL_RECT* consoleWindow);
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "SetCurrentDirectoryW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Kernel32, EntryPoint = "SetCurrentDirectoryW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool SetCurrentDirectory(string path);
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "SetEnvironmentVariableW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Kernel32, EntryPoint = "SetEnvironmentVariableW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool SetEnvironmentVariable(string lpName, string? lpValue);
}
/// <summary>
/// WARNING: This method does not implicitly handle long paths. Use SetFileAttributes.
/// </summary>
- [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "SetFileAttributesW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Kernel32, EntryPoint = "SetFileAttributesW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
private static partial bool SetFileAttributesPrivate(
string name,
SkipSetEventOnHandle = 2
}
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool SetFileCompletionNotificationModes(SafeHandle handle, FileCompletionNotificationModes flags);
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static unsafe partial bool SetFileInformationByHandle(
SafeFileHandle hFile,
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool SetFilePointerEx(SafeFileHandle hFile, long liDistanceToMove, out long lpNewFilePointer, uint dwMoveMethod);
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32)]
+ [LibraryImport(Libraries.Kernel32)]
[SuppressGCTransition]
internal static partial void SetLastError(int errorCode);
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static unsafe partial bool SetNamedPipeHandleState(
SafePipeHandle hNamedPipe,
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool SetPriorityClass(SafeProcessHandle handle, int priorityClass);
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool SetProcessAffinityMask(SafeProcessHandle handle, IntPtr mask);
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool SetProcessPriorityBoost(SafeProcessHandle handle, [MarshalAs(UnmanagedType.Bool)] bool disabled);
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool SetProcessWorkingSetSizeEx(SafeProcessHandle handle, IntPtr min, IntPtr max, int flags);
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
internal static partial IntPtr SetThreadAffinityMask(SafeThreadHandle handle, IntPtr mask);
}
}
internal static partial class Kernel32
{
[SuppressGCTransition]
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool SetThreadErrorMode(
uint dwNewMode,
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
internal static partial int SetThreadIdealProcessor(SafeThreadHandle handle, int processor);
}
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool SetThreadPriority(SafeThreadHandle handle, int priority);
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool SetThreadPriorityBoost(SafeThreadHandle handle, [MarshalAs(UnmanagedType.Bool)] bool disabled);
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "SetVolumeLabelW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Kernel32, EntryPoint = "SetVolumeLabelW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool SetVolumeLabel(string driveLetter, string? volumeName);
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool SetupComm(
SafeFileHandle hFile,
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32)]
+ [LibraryImport(Libraries.Kernel32)]
[SuppressGCTransition]
internal static unsafe partial Interop.BOOL SystemTimeToFileTime(Interop.Kernel32.SYSTEMTIME* lpSystemTime, ulong* lpFileTime);
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool TerminateProcess(SafeProcessHandle processHandle, int exitCode);
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32)]
+ [LibraryImport(Libraries.Kernel32)]
internal static unsafe partial IntPtr CreateThreadpoolWork(delegate* unmanaged<IntPtr, IntPtr, IntPtr, void> pfnwk, IntPtr pv, IntPtr pcbe);
- [GeneratedDllImport(Libraries.Kernel32)]
+ [LibraryImport(Libraries.Kernel32)]
internal static partial void SubmitThreadpoolWork(IntPtr pwk);
- [GeneratedDllImport(Libraries.Kernel32)]
+ [LibraryImport(Libraries.Kernel32)]
internal static partial void CloseThreadpoolWork(IntPtr pwk);
- [GeneratedDllImport(Libraries.Kernel32)]
+ [LibraryImport(Libraries.Kernel32)]
internal static unsafe partial IntPtr CreateThreadpoolWait(delegate* unmanaged<IntPtr, IntPtr, IntPtr, uint, void> pfnwa, IntPtr pv, IntPtr pcbe);
- [GeneratedDllImport(Libraries.Kernel32)]
+ [LibraryImport(Libraries.Kernel32)]
internal static partial void SetThreadpoolWait(IntPtr pwa, IntPtr h, IntPtr pftTimeout);
- [GeneratedDllImport(Libraries.Kernel32)]
+ [LibraryImport(Libraries.Kernel32)]
internal static partial void WaitForThreadpoolWaitCallbacks(IntPtr pwa, [MarshalAs(UnmanagedType.Bool)] bool fCancelPendingCallbacks);
- [GeneratedDllImport(Libraries.Kernel32)]
+ [LibraryImport(Libraries.Kernel32)]
internal static partial void CloseThreadpoolWait(IntPtr pwa);
}
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
internal static unsafe partial SafeThreadPoolIOHandle CreateThreadpoolIo(SafeHandle fl, delegate* unmanaged<IntPtr, IntPtr, IntPtr, uint, UIntPtr, IntPtr, void> pfnio, IntPtr context, IntPtr pcbe);
- [GeneratedDllImport(Libraries.Kernel32)]
+ [LibraryImport(Libraries.Kernel32)]
internal static unsafe partial void CloseThreadpoolIo(IntPtr pio);
- [GeneratedDllImport(Libraries.Kernel32)]
+ [LibraryImport(Libraries.Kernel32)]
internal static unsafe partial void StartThreadpoolIo(SafeThreadPoolIOHandle pio);
- [GeneratedDllImport(Libraries.Kernel32)]
+ [LibraryImport(Libraries.Kernel32)]
internal static unsafe partial void CancelThreadpoolIo(SafeThreadPoolIOHandle pio);
}
}
{
internal const int WAIT_FAILED = unchecked((int)0xFFFFFFFF);
- [GeneratedDllImport(Libraries.Kernel32)]
+ [LibraryImport(Libraries.Kernel32)]
internal static partial uint WaitForMultipleObjectsEx(uint nCount, IntPtr lpHandles, BOOL bWaitAll, uint dwMilliseconds, BOOL bAlertable);
- [GeneratedDllImport(Libraries.Kernel32)]
+ [LibraryImport(Libraries.Kernel32)]
internal static partial uint WaitForSingleObject(IntPtr hHandle, uint dwMilliseconds);
- [GeneratedDllImport(Libraries.Kernel32)]
+ [LibraryImport(Libraries.Kernel32)]
internal static partial uint SignalObjectAndWait(IntPtr hObjectToSignal, IntPtr hObjectToWaitOn, uint dwMilliseconds, BOOL bAlertable);
- [GeneratedDllImport(Libraries.Kernel32)]
+ [LibraryImport(Libraries.Kernel32)]
internal static partial void Sleep(uint milliseconds);
internal const uint CREATE_SUSPENDED = 0x00000004;
internal const uint STACK_SIZE_PARAM_IS_A_RESERVATION = 0x00010000;
- [GeneratedDllImport(Libraries.Kernel32)]
+ [LibraryImport(Libraries.Kernel32)]
internal static unsafe partial SafeWaitHandle CreateThread(
IntPtr lpThreadAttributes,
IntPtr dwStackSize,
uint dwCreationFlags,
out uint lpThreadId);
- [GeneratedDllImport(Libraries.Kernel32)]
+ [LibraryImport(Libraries.Kernel32)]
internal static partial uint ResumeThread(SafeWaitHandle hThread);
- [GeneratedDllImport(Libraries.Kernel32)]
+ [LibraryImport(Libraries.Kernel32)]
internal static partial IntPtr GetCurrentThread();
internal const int DUPLICATE_SAME_ACCESS = 2;
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
[return:MarshalAs(UnmanagedType.Bool)]
internal static partial bool DuplicateHandle(
IntPtr hSourceProcessHandle,
ErrorReturn = 0x7FFFFFFF
}
- [GeneratedDllImport(Libraries.Kernel32)]
+ [LibraryImport(Libraries.Kernel32)]
internal static partial ThreadPriority GetThreadPriority(SafeWaitHandle hThread);
- [GeneratedDllImport(Libraries.Kernel32)]
+ [LibraryImport(Libraries.Kernel32)]
[return:MarshalAs(UnmanagedType.Bool)]
internal static partial bool SetThreadPriority(SafeWaitHandle hThread, int nPriority);
}
internal const uint TIME_ZONE_ID_INVALID = unchecked((uint)-1);
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
internal static partial uint GetDynamicTimeZoneInformation(out TIME_DYNAMIC_ZONE_INFORMATION pTimeZoneInformation);
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
internal static partial uint GetTimeZoneInformation(out TIME_ZONE_INFORMATION lpTimeZoneInformation);
}
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32)]
+ [LibraryImport(Libraries.Kernel32)]
internal static unsafe partial IntPtr CreateThreadpoolTimer(delegate* unmanaged<IntPtr, IntPtr, IntPtr, void> pfnti, IntPtr pv, IntPtr pcbe);
- [GeneratedDllImport(Libraries.Kernel32)]
+ [LibraryImport(Libraries.Kernel32)]
internal static unsafe partial IntPtr SetThreadpoolTimer(IntPtr pti, long* pftDueTime, uint msPeriod, uint msWindowLength);
}
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32)]
+ [LibraryImport(Libraries.Kernel32)]
internal static unsafe partial Interop.BOOL TzSpecificLocalTimeToSystemTime(
IntPtr lpTimeZoneInformation,
Interop.Kernel32.SYSTEMTIME* lpLocalTime,
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool UnmapViewOfFile(IntPtr lpBaseAddress);
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "VerLanguageNameW")]
+ [LibraryImport(Libraries.Kernel32, EntryPoint = "VerLanguageNameW")]
internal static unsafe partial int VerLanguageName(uint wLang, char* szLang, uint cchLang);
}
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32)]
+ [LibraryImport(Libraries.Kernel32)]
internal static partial ulong VerSetConditionMask(ulong ConditionMask, uint TypeMask, byte Condition);
}
}
internal const uint VER_SERVICEPACKMAJOR = 0x0000020;
internal const uint VER_SERVICEPACKMINOR = 0x0000010;
- [GeneratedDllImport(Libraries.Kernel32)]
+ [LibraryImport(Libraries.Kernel32)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool VerifyVersionInfoW(ref OSVERSIONINFOEX lpVersionInfo, uint dwTypeMask, ulong dwlConditionMask);
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
internal static partial IntPtr VirtualAlloc(SafeHandle lpAddress, UIntPtr dwSize, int flAllocationType, int flProtect);
}
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32)]
+ [LibraryImport(Libraries.Kernel32)]
internal static unsafe partial void* VirtualAlloc(void* lpAddress, UIntPtr dwSize, int flAllocationType, int flProtect);
}
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32)]
+ [LibraryImport(Libraries.Kernel32)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static unsafe partial bool VirtualFree(void* lpAddress, UIntPtr dwSize, int dwFreeType);
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
internal static partial UIntPtr VirtualQuery(
SafeHandle lpAddress,
ref MEMORY_BASIC_INFORMATION lpBuffer,
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
internal static unsafe partial UIntPtr VirtualQuery(void* lpAddress, ref MEMORY_BASIC_INFORMATION lpBuffer, UIntPtr dwLength);
}
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static unsafe partial bool WaitCommEvent(
SafeFileHandle hFile,
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
internal static partial int WaitForSingleObject(SafeWaitHandle handle, int timeout);
}
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "WaitNamedPipeW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Kernel32, EntryPoint = "WaitNamedPipeW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool WaitNamedPipe(string? name, int timeout);
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32)]
+ [LibraryImport(Libraries.Kernel32)]
internal static unsafe partial int WideCharToMultiByte(
uint CodePage, uint dwFlags,
char* lpWideCharStr, int cchWideChar,
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "WriteConsoleW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Kernel32, EntryPoint = "WriteConsoleW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static unsafe partial bool WriteConsole(
IntPtr hConsoleOutput,
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "WriteConsoleOutputW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Kernel32, EntryPoint = "WriteConsoleOutputW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static unsafe partial bool WriteConsoleOutput(IntPtr hConsoleOutput, CHAR_INFO* buffer, COORD bufferSize, COORD bufferCoord, ref SMALL_RECT writeRegion);
}
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
internal static unsafe partial int WriteFile(
IntPtr handle,
byte* bytes,
// struct in a callback (or an EndWrite method called by that callback),
// and pass in an address for the numBytesRead parameter.
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
internal static unsafe partial int WriteFile(
SafeHandle handle,
byte* bytes,
// simultaneously: overlapped IO, free the memory for the overlapped
// struct in a callback (or an EndWrite method called by that callback),
// and pass in an address for the numBytesRead parameter.
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
internal static unsafe partial int WriteFile(
SafeHandle handle,
byte* bytes,
IntPtr numBytesWritten_mustBeZero,
NativeOverlapped* lpOverlapped);
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
internal static unsafe partial int WriteFile(
SafeHandle handle,
byte* bytes,
{
internal static partial class Logoncli
{
- [GeneratedDllImport(Libraries.Logoncli, EntryPoint = "DsGetDcNameW", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Logoncli, EntryPoint = "DsGetDcNameW", StringMarshalling = StringMarshalling.Utf16)]
internal static partial int DsGetDcName(
string computerName,
string domainName,
internal static unsafe ErrorCode NCryptEncrypt(SafeNCryptKeyHandle hKey, ReadOnlySpan<byte> pbInput, int cbInput, void* pPaddingInfo, Span<byte> pbOutput, int cbOutput, out int pcbResult, AsymmetricPaddingMode dwFlags) =>
NCryptEncrypt(hKey, ref MemoryMarshal.GetReference(pbInput), cbInput, pPaddingInfo, ref MemoryMarshal.GetReference(pbOutput), cbOutput, out pcbResult, dwFlags);
- [GeneratedDllImport(Interop.Libraries.NCrypt)]
+ [LibraryImport(Interop.Libraries.NCrypt)]
private static unsafe partial ErrorCode NCryptEncrypt(SafeNCryptKeyHandle hKey, ref byte pbInput, int cbInput, void* pPaddingInfo, ref byte pbOutput, int cbOutput, out int pcbResult, AsymmetricPaddingMode dwFlags);
internal static unsafe ErrorCode NCryptDecrypt(SafeNCryptKeyHandle hKey, ReadOnlySpan<byte> pbInput, int cbInput, void* pPaddingInfo, Span<byte> pbOutput, int cbOutput, out int pcbResult, AsymmetricPaddingMode dwFlags) =>
NCryptDecrypt(hKey, ref MemoryMarshal.GetReference(pbInput), cbInput, pPaddingInfo, ref MemoryMarshal.GetReference(pbOutput), cbOutput, out pcbResult, dwFlags);
- [GeneratedDllImport(Interop.Libraries.NCrypt)]
+ [LibraryImport(Interop.Libraries.NCrypt)]
private static unsafe partial ErrorCode NCryptDecrypt(SafeNCryptKeyHandle hKey, ref byte pbInput, int cbInput, void* pPaddingInfo, ref byte pbOutput, int cbOutput, out int pcbResult, AsymmetricPaddingMode dwFlags);
}
}
internal const int NCRYPT_CIPHER_KEY_BLOB_MAGIC = 0x52485043; //'CPHR'
- [GeneratedDllImport(Interop.Libraries.NCrypt, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Interop.Libraries.NCrypt, StringMarshalling = StringMarshalling.Utf16)]
internal static partial ErrorCode NCryptOpenKey(SafeNCryptProviderHandle hProvider, out SafeNCryptKeyHandle phKey, string pszKeyName, int dwLegacyKeySpec, CngKeyOpenOptions dwFlags);
- [GeneratedDllImport(Interop.Libraries.NCrypt, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Interop.Libraries.NCrypt, StringMarshalling = StringMarshalling.Utf16)]
internal static partial ErrorCode NCryptImportKey(SafeNCryptProviderHandle hProvider, IntPtr hImportKey, string pszBlobType, IntPtr pParameterList, out SafeNCryptKeyHandle phKey, ref byte pbData, int cbData, int dwFlags);
- [GeneratedDllImport(Interop.Libraries.NCrypt, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Interop.Libraries.NCrypt, StringMarshalling = StringMarshalling.Utf16)]
internal static partial ErrorCode NCryptImportKey(SafeNCryptProviderHandle hProvider, IntPtr hImportKey, string pszBlobType, ref NCryptBufferDesc pParameterList, out SafeNCryptKeyHandle phKey, ref byte pbData, int cbData, int dwFlags);
- [GeneratedDllImport(Interop.Libraries.NCrypt, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Interop.Libraries.NCrypt, StringMarshalling = StringMarshalling.Utf16)]
internal static partial ErrorCode NCryptExportKey(SafeNCryptKeyHandle hKey, IntPtr hExportKey, string pszBlobType, IntPtr pParameterList, byte[]? pbOutput, int cbOutput, out int pcbResult, int dwFlags);
- [GeneratedDllImport(Interop.Libraries.NCrypt, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Interop.Libraries.NCrypt, StringMarshalling = StringMarshalling.Utf16)]
internal static partial ErrorCode NCryptExportKey(SafeNCryptKeyHandle hKey, IntPtr hExportKey, string pszBlobType, IntPtr pParameterList, ref byte pbOutput, int cbOutput, out int pcbResult, int dwFlags);
- [GeneratedDllImport(Interop.Libraries.NCrypt, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Interop.Libraries.NCrypt, StringMarshalling = StringMarshalling.Utf16)]
internal static partial ErrorCode NCryptExportKey(SafeNCryptKeyHandle hKey, IntPtr hExportKey, string pszBlobType, ref NCryptBufferDesc pParameterList, ref byte pbOutput, int cbOutput, out int pcbResult, int dwFlags);
- [GeneratedDllImport(Interop.Libraries.NCrypt, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Interop.Libraries.NCrypt, StringMarshalling = StringMarshalling.Utf16)]
internal static partial ErrorCode NCryptDeleteKey(SafeNCryptKeyHandle hKey, int dwFlags);
- [GeneratedDllImport(Interop.Libraries.NCrypt, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Interop.Libraries.NCrypt, StringMarshalling = StringMarshalling.Utf16)]
internal static partial ErrorCode NCryptCreatePersistedKey(SafeNCryptProviderHandle hProvider, out SafeNCryptKeyHandle phKey, string pszAlgId, string? pszKeyName, int dwLegacyKeySpec, CngKeyCreationOptions dwFlags);
- [GeneratedDllImport(Interop.Libraries.NCrypt, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Interop.Libraries.NCrypt, StringMarshalling = StringMarshalling.Utf16)]
internal static partial ErrorCode NCryptFinalizeKey(SafeNCryptKeyHandle hKey, int dwFlags);
[StructLayout(LayoutKind.Sequential)]
/// <summary>
/// Generate a key from a secret agreement
/// </summary>
- [GeneratedDllImport(Interop.Libraries.NCrypt, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Interop.Libraries.NCrypt, StringMarshalling = StringMarshalling.Utf16)]
private static partial ErrorCode NCryptDeriveKey(
SafeNCryptSecretHandle hSharedSecret,
string pwszKDF,
/// <summary>
/// Generate a secret agreement for generating shared key material
/// </summary>
- [GeneratedDllImport(Interop.Libraries.NCrypt)]
+ [LibraryImport(Interop.Libraries.NCrypt)]
private static partial ErrorCode NCryptSecretAgreement(
SafeNCryptKeyHandle hPrivKey,
SafeNCryptKeyHandle hPubKey,
{
internal static partial class NCrypt
{
- [GeneratedDllImport(Interop.Libraries.NCrypt)]
+ [LibraryImport(Interop.Libraries.NCrypt)]
internal static partial ErrorCode NCryptFreeObject(IntPtr hObject);
}
}
{
internal static partial class NCrypt
{
- [GeneratedDllImport(Interop.Libraries.NCrypt, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Interop.Libraries.NCrypt, StringMarshalling = StringMarshalling.Utf16)]
internal static partial ErrorCode NCryptOpenStorageProvider(out SafeNCryptProviderHandle phProvider, string pszProviderName, int dwFlags);
}
}
{
internal static partial class NCrypt
{
- [GeneratedDllImport(Interop.Libraries.NCrypt, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Interop.Libraries.NCrypt, StringMarshalling = StringMarshalling.Utf16)]
internal static unsafe partial ErrorCode NCryptGetProperty(
SafeNCryptHandle hObject,
string pszProperty,
out int pcbResult,
CngPropertyOptions dwFlags);
- [GeneratedDllImport(Interop.Libraries.NCrypt, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Interop.Libraries.NCrypt, StringMarshalling = StringMarshalling.Utf16)]
internal static unsafe partial ErrorCode NCryptSetProperty(
SafeNCryptHandle hObject,
string pszProperty,
internal static unsafe ErrorCode NCryptSignHash(SafeNCryptKeyHandle hKey, void* pPaddingInfo, ReadOnlySpan<byte> pbHashValue, int cbHashValue, Span<byte> pbSignature, int cbSignature, out int pcbResult, AsymmetricPaddingMode dwFlags) =>
NCryptSignHash(hKey, pPaddingInfo, ref MemoryMarshal.GetReference(pbHashValue), cbHashValue, ref MemoryMarshal.GetReference(pbSignature), cbSignature, out pcbResult, dwFlags);
- [GeneratedDllImport(Libraries.NCrypt, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.NCrypt, StringMarshalling = StringMarshalling.Utf16)]
private static unsafe partial ErrorCode NCryptSignHash(SafeNCryptKeyHandle hKey, void* pPaddingInfo, ref byte pbHashValue, int cbHashValue, ref byte pbSignature, int cbSignature, out int pcbResult, AsymmetricPaddingMode dwFlags);
internal static unsafe ErrorCode NCryptVerifySignature(SafeNCryptKeyHandle hKey, void* pPaddingInfo, ReadOnlySpan<byte> pbHashValue, int cbHashValue, ReadOnlySpan<byte> pbSignature, int cbSignature, AsymmetricPaddingMode dwFlags) =>
NCryptVerifySignature(hKey, pPaddingInfo, ref MemoryMarshal.GetReference(pbHashValue), cbHashValue, ref MemoryMarshal.GetReference(pbSignature), cbSignature, dwFlags);
- [GeneratedDllImport(Libraries.NCrypt, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.NCrypt, StringMarshalling = StringMarshalling.Utf16)]
private static unsafe partial ErrorCode NCryptVerifySignature(SafeNCryptKeyHandle hKey, void* pPaddingInfo, ref byte pbHashValue, int cbHashValue, ref byte pbSignature, int cbSignature, AsymmetricPaddingMode dwFlags);
}
}
{
internal static partial class Netutils
{
- [GeneratedDllImport(Libraries.Netutils)]
+ [LibraryImport(Libraries.Netutils)]
internal static partial int NetApiBufferFree(IntPtr buffer);
}
}
// Idn APIs
//
- [GeneratedDllImport("Normaliz.dll", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport("Normaliz.dll", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
internal static unsafe partial int IdnToAscii(
uint dwFlags,
char* lpUnicodeCharStr,
char* lpASCIICharStr,
int cchASCIIChar);
- [GeneratedDllImport("Normaliz.dll", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport("Normaliz.dll", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
internal static unsafe partial int IdnToUnicode(
uint dwFlags,
char* lpASCIICharStr,
{
internal static partial class Normaliz
{
- [GeneratedDllImport("Normaliz.dll", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport("Normaliz.dll", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
internal static unsafe partial BOOL IsNormalizedString(NormalizationForm normForm, char* source, int length);
- [GeneratedDllImport("Normaliz.dll", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport("Normaliz.dll", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
internal static unsafe partial int NormalizeString(
NormalizationForm normForm,
char* source,
{
// https://msdn.microsoft.com/en-us/library/bb432380.aspx
// https://msdn.microsoft.com/en-us/library/windows/hardware/ff566424.aspx
- [GeneratedDllImport(Libraries.NtDll)]
+ [LibraryImport(Libraries.NtDll)]
private static unsafe partial uint NtCreateFile(
IntPtr* FileHandle,
DesiredAccess DesiredAccess,
{
// https://msdn.microsoft.com/en-us/library/windows/hardware/ff556633.aspx
// https://msdn.microsoft.com/en-us/library/windows/hardware/ff567047.aspx
- [GeneratedDllImport(Libraries.NtDll)]
+ [LibraryImport(Libraries.NtDll)]
public static unsafe partial int NtQueryDirectoryFile(
IntPtr FileHandle,
IntPtr Event,
{
internal static partial class NtDll
{
- [GeneratedDllImport(Libraries.NtDll)]
+ [LibraryImport(Libraries.NtDll)]
internal static unsafe partial int NtQueryInformationFile(
SafeFileHandle FileHandle,
out IO_STATUS_BLOCK IoStatusBlock,
{
internal static partial class NtDll
{
- [GeneratedDllImport(Libraries.NtDll)]
+ [LibraryImport(Libraries.NtDll)]
internal static unsafe partial uint NtQueryInformationProcess(SafeProcessHandle ProcessHandle, int ProcessInformationClass, void* ProcessInformation, uint ProcessInformationLength, out uint ReturnLength);
}
}
{
internal static partial class NtDll
{
- [GeneratedDllImport(Libraries.NtDll)]
+ [LibraryImport(Libraries.NtDll)]
internal static unsafe partial uint NtQuerySystemInformation(int SystemInformationClass, void* SystemInformation, uint SystemInformationLength, uint* ReturnLength);
internal const uint STATUS_INFO_LENGTH_MISMATCH = 0xC0000004;
{
internal static partial class NtDll
{
- [GeneratedDllImport(Libraries.NtDll)]
+ [LibraryImport(Libraries.NtDll)]
private static partial int RtlGetVersion(ref RTL_OSVERSIONINFOEX lpVersionInformation);
internal static unsafe int RtlGetVersionEx(out RTL_OSVERSIONINFOEX osvi)
internal static partial class NtDll
{
// https://msdn.microsoft.com/en-us/library/windows/desktop/ms680600(v=vs.85).aspx
- [GeneratedDllImport(Libraries.NtDll)]
+ [LibraryImport(Libraries.NtDll)]
public static partial uint RtlNtStatusToDosError(int Status);
}
}
{
internal static partial class Ole32
{
- [GeneratedDllImport(Interop.Libraries.Ole32, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Interop.Libraries.Ole32, StringMarshalling = StringMarshalling.Utf16)]
internal static partial int CLSIDFromProgID(string lpszProgID, out Guid lpclsid);
}
}
{
internal static partial class Ole32
{
- [GeneratedDllImport(Interop.Libraries.Ole32)]
+ [LibraryImport(Interop.Libraries.Ole32)]
internal static partial int CoCreateGuid(out Guid guid);
}
}
internal static partial class Ole32
{
- [GeneratedDllImport(Interop.Libraries.Ole32)]
+ [LibraryImport(Interop.Libraries.Ole32)]
internal static partial int CoGetApartmentType(out APTTYPE pAptType, out APTTYPEQUALIFIER pAptQualifier);
}
}
}
}
- [GeneratedDllImport(Libraries.Ole32)]
+ [LibraryImport(Libraries.Ole32)]
internal static unsafe partial int CoGetObjectContext(Guid* riid, IntPtr* ppv);
}
}
{
internal static partial class Ole32
{
- [GeneratedDllImport(Interop.Libraries.Ole32)]
+ [LibraryImport(Interop.Libraries.Ole32)]
internal static partial int CoGetStandardMarshal(ref Guid riid, IntPtr pv, int dwDestContext, IntPtr pvDestContext, int mshlflags, out IntPtr ppMarshal);
}
}
internal const uint COINIT_APARTMENTTHREADED = 2;
internal const uint COINIT_MULTITHREADED = 0;
- [GeneratedDllImport(Interop.Libraries.Ole32)]
+ [LibraryImport(Interop.Libraries.Ole32)]
internal static partial int CoInitializeEx(IntPtr reserved, uint dwCoInit);
}
}
{
internal static partial class Ole32
{
- [GeneratedDllImport(Libraries.Ole32)]
+ [LibraryImport(Libraries.Ole32)]
internal static partial IntPtr CoTaskMemAlloc(nuint cb);
- [GeneratedDllImport(Libraries.Ole32)]
+ [LibraryImport(Libraries.Ole32)]
internal static partial IntPtr CoTaskMemRealloc(IntPtr pv, nuint cb);
- [GeneratedDllImport(Libraries.Ole32)]
+ [LibraryImport(Libraries.Ole32)]
internal static partial void CoTaskMemFree(IntPtr ptr);
}
}
{
internal static partial class Ole32
{
- [GeneratedDllImport(Interop.Libraries.Ole32)]
+ [LibraryImport(Interop.Libraries.Ole32)]
internal static partial int CoUninitialize();
}
}
{
internal static partial class Ole32
{
- [GeneratedDllImport(Interop.Libraries.Ole32)]
+ [LibraryImport(Interop.Libraries.Ole32)]
internal static partial void PropVariantClear(IntPtr pObject);
}
}
internal static partial class OleAut32
{
// only using this to clear existing error info with null
- [GeneratedDllImport(Interop.Libraries.OleAut32)]
+ [LibraryImport(Interop.Libraries.OleAut32)]
// TLS values are preserved between threads, need to check that we use this API to clear the error state only.
internal static partial void SetErrorInfo(int dwReserved, IntPtr pIErrorInfo);
}
{
internal static partial class OleAut32
{
- [GeneratedDllImport(Libraries.OleAut32)]
+ [LibraryImport(Libraries.OleAut32)]
internal static partial IntPtr SysAllocStringByteLen(byte[]? str, uint len);
}
}
{
internal static partial class OleAut32
{
- [GeneratedDllImport(Libraries.OleAut32, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.OleAut32, StringMarshalling = StringMarshalling.Utf16)]
internal static partial IntPtr SysAllocStringLen(IntPtr src, uint len);
- [GeneratedDllImport(Libraries.OleAut32, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.OleAut32, StringMarshalling = StringMarshalling.Utf16)]
internal static partial IntPtr SysAllocStringLen(string src, uint len);
}
}
{
internal static partial class OleAut32
{
- [GeneratedDllImport(Libraries.OleAut32)]
+ [LibraryImport(Libraries.OleAut32)]
internal static partial void SysFreeString(IntPtr bstr);
}
}
{
internal static partial class OleAut32
{
- [GeneratedDllImport(Libraries.OleAut32)]
+ [LibraryImport(Libraries.OleAut32)]
internal static partial void VariantClear(IntPtr variant);
}
}
{
internal static partial class Pdh
{
- [GeneratedDllImport(Libraries.Pdh)]
+ [LibraryImport(Libraries.Pdh)]
public static partial int PdhFormatFromRawValue(
uint dwCounterType,
uint dwFormat,
{
internal static partial class PerfCounter
{
- [GeneratedDllImport(Libraries.Advapi32)]
+ [LibraryImport(Libraries.Advapi32)]
internal static partial uint PerfStopProvider(
IntPtr hProvider
);
internal uint InstanceNameSize;
}
- [GeneratedDllImport(Libraries.Advapi32)]
+ [LibraryImport(Libraries.Advapi32)]
internal static partial uint PerfStartProvider(
ref Guid ProviderGuid,
PERFLIBREQUEST ControlCallback,
out SafePerfProviderHandle phProvider
);
- [GeneratedDllImport(Libraries.Advapi32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Advapi32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
internal static unsafe partial PerfCounterSetInstanceStruct* PerfCreateInstance(
SafePerfProviderHandle hProvider,
ref Guid CounterSetGuid,
uint dwInstance
);
- [GeneratedDllImport(Libraries.Advapi32)]
+ [LibraryImport(Libraries.Advapi32)]
internal static unsafe partial uint PerfSetCounterSetInfo(
SafePerfProviderHandle hProvider,
PerfCounterSetInfoStruct* pTemplate,
uint dwTemplateSize
);
- [GeneratedDllImport(Libraries.Advapi32)]
+ [LibraryImport(Libraries.Advapi32)]
internal static unsafe partial uint PerfDeleteInstance(
SafePerfProviderHandle hProvider,
PerfCounterSetInstanceStruct* InstanceBlock
);
- [GeneratedDllImport(Libraries.Advapi32)]
+ [LibraryImport(Libraries.Advapi32)]
internal static unsafe partial uint PerfSetCounterRefValue(
SafePerfProviderHandle hProvider,
PerfCounterSetInstanceStruct* pInstance,
{
internal static partial class Secur32
{
- [GeneratedDllImport(Libraries.Secur32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Secur32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
internal static partial BOOLEAN GetUserNameExW(int NameFormat, ref char lpNameBuffer, ref uint lpnSize);
internal const int NameSamCompatible = 2;
internal const int COR_E_PLATFORMNOTSUPPORTED = unchecked((int)0x80131539);
// https://msdn.microsoft.com/en-us/library/windows/desktop/bb762188.aspx
- [GeneratedDllImport(Libraries.Shell32, SetLastError = false, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Shell32, SetLastError = false, StringMarshalling = StringMarshalling.Utf16)]
internal static partial int SHGetKnownFolderPath(
in Guid rfid,
uint dwFlags,
internal const uint SEE_MASK_NOCLOSEPROCESS = 0x00000040;
internal const uint SEE_MASK_FLAG_NO_UI = 0x00000400;
- [GeneratedDllImport(Libraries.Shell32, SetLastError = true)]
+ [LibraryImport(Libraries.Shell32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static unsafe partial bool ShellExecuteExW(
SHELLEXECUTEINFO* pExecInfo);
{
internal static partial class SspiCli
{
- [GeneratedDllImport(Interop.Libraries.SspiCli)]
+ [LibraryImport(Interop.Libraries.SspiCli)]
internal static partial int LsaConnectUntrusted(out SafeLsaHandle LsaHandle);
}
}
{
internal static partial class SspiCli
{
- [GeneratedDllImport(Interop.Libraries.SspiCli)]
+ [LibraryImport(Interop.Libraries.SspiCli)]
internal static partial int LsaDeregisterLogonProcess(IntPtr LsaHandle);
}
}
{
internal static partial class SspiCli
{
- [GeneratedDllImport(Interop.Libraries.SspiCli, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.SspiCli, SetLastError = true)]
internal static partial int LsaFreeReturnBuffer(IntPtr handle);
}
}
{
internal static partial class SspiCli
{
- [GeneratedDllImport(Interop.Libraries.SspiCli, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.SspiCli, SetLastError = true)]
internal static partial int LsaGetLogonSessionData(
ref LUID LogonId,
out SafeLsaReturnBufferHandle ppLogonSessionData);
{
internal static partial class SspiCli
{
- [GeneratedDllImport(Libraries.SspiCli)]
+ [LibraryImport(Libraries.SspiCli)]
internal static partial int LsaLogonUser(
SafeLsaHandle LsaHandle,
in Advapi32.LSA_STRING OriginName,
{
internal static partial class SspiCli
{
- [GeneratedDllImport(Libraries.SspiCli)]
+ [LibraryImport(Libraries.SspiCli)]
internal static partial int LsaLookupAuthenticationPackage(
SafeLsaHandle LsaHandle,
ref Advapi32.LSA_STRING PackageName,
public char* pwszSslCtlIdentifier;
}
- [GeneratedDllImport(Interop.Libraries.SspiCli, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.SspiCli, SetLastError = true)]
internal static partial int EncryptMessage(
ref CredHandle contextHandle,
uint qualityOfProtection,
ref SecBufferDesc inputOutput,
uint sequenceNumber);
- [GeneratedDllImport(Interop.Libraries.SspiCli, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.SspiCli, SetLastError = true)]
internal static unsafe partial int DecryptMessage(
ref CredHandle contextHandle,
ref SecBufferDesc inputOutput,
uint sequenceNumber,
uint* qualityOfProtection);
- [GeneratedDllImport(Interop.Libraries.SspiCli, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.SspiCli, SetLastError = true)]
internal static partial int QuerySecurityContextToken(
ref CredHandle phContext,
out SecurityContextTokenHandle handle);
- [GeneratedDllImport(Interop.Libraries.SspiCli, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.SspiCli, SetLastError = true)]
internal static partial int FreeContextBuffer(
IntPtr contextBuffer);
- [GeneratedDllImport(Interop.Libraries.SspiCli, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.SspiCli, SetLastError = true)]
internal static partial int FreeCredentialsHandle(
ref CredHandle handlePtr);
- [GeneratedDllImport(Interop.Libraries.SspiCli, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.SspiCli, SetLastError = true)]
internal static partial int DeleteSecurityContext(
ref CredHandle handlePtr);
- [GeneratedDllImport(Interop.Libraries.SspiCli, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.SspiCli, SetLastError = true)]
internal static unsafe partial int AcceptSecurityContext(
ref CredHandle credentialHandle,
void* inContextPtr,
ref ContextFlags attributes,
out long timeStamp);
- [GeneratedDllImport(Interop.Libraries.SspiCli, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.SspiCli, SetLastError = true)]
internal static unsafe partial int QueryContextAttributesW(
ref CredHandle contextHandle,
ContextAttribute attribute,
void* buffer);
- [GeneratedDllImport(Interop.Libraries.SspiCli, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.SspiCli, SetLastError = true)]
internal static partial int SetContextAttributesW(
ref CredHandle contextHandle,
ContextAttribute attribute,
byte[] buffer,
int bufferSize);
- [GeneratedDllImport(Interop.Libraries.SspiCli, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.SspiCli, SetLastError = true)]
internal static partial int EnumerateSecurityPackagesW(
out int pkgnum,
out SafeFreeContextBuffer_SECURITY handle);
- [GeneratedDllImport(Interop.Libraries.SspiCli, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Interop.Libraries.SspiCli, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
internal static unsafe partial int AcquireCredentialsHandleW(
string? principal,
string moduleName,
ref CredHandle handlePtr,
out long timeStamp);
- [GeneratedDllImport(Interop.Libraries.SspiCli, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Interop.Libraries.SspiCli, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
internal static unsafe partial int AcquireCredentialsHandleW(
string? principal,
string moduleName,
ref CredHandle handlePtr,
out long timeStamp);
- [GeneratedDllImport(Interop.Libraries.SspiCli, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Interop.Libraries.SspiCli, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
internal static unsafe partial int AcquireCredentialsHandleW(
string? principal,
string moduleName,
ref CredHandle handlePtr,
out long timeStamp);
- [GeneratedDllImport(Interop.Libraries.SspiCli, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Interop.Libraries.SspiCli, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
internal static unsafe partial int AcquireCredentialsHandleW(
string? principal,
string moduleName,
ref CredHandle handlePtr,
out long timeStamp);
- [GeneratedDllImport(Interop.Libraries.SspiCli, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.SspiCli, SetLastError = true)]
internal static unsafe partial int InitializeSecurityContextW(
ref CredHandle credentialHandle,
void* inContextPtr,
ref ContextFlags attributes,
out long timeStamp);
- [GeneratedDllImport(Interop.Libraries.SspiCli, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.SspiCli, SetLastError = true)]
internal static unsafe partial int CompleteAuthToken(
void* inContextPtr,
ref SecBufferDesc inputBuffers);
- [GeneratedDllImport(Interop.Libraries.SspiCli, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.SspiCli, SetLastError = true)]
internal static unsafe partial int ApplyControlToken(
void* inContextPtr,
ref SecBufferDesc inputBuffers);
- [GeneratedDllImport(Interop.Libraries.SspiCli, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.SspiCli, SetLastError = true)]
internal static partial SECURITY_STATUS SspiFreeAuthIdentity(
IntPtr authData);
- [GeneratedDllImport(Interop.Libraries.SspiCli, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Interop.Libraries.SspiCli, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
internal static partial SECURITY_STATUS SspiEncodeStringsAsAuthIdentity(
string userName,
string domainName,
string password,
out SafeSspiAuthDataHandle authData);
- [GeneratedDllImport(Interop.Libraries.SspiCli, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.SspiCli, SetLastError = true)]
internal static partial SECURITY_STATUS SetCredentialsAttributesW(
in CredHandle handlePtr,
long ulAttribute,
internal static unsafe partial class Ucrtbase
{
#pragma warning disable CS3016 // Arrays as attribute arguments is not CLS-compliant
- [GeneratedDllImport(Libraries.Ucrtbase)]
+ [LibraryImport(Libraries.Ucrtbase)]
[UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
internal static partial void* _aligned_malloc(nuint size, nuint alignment);
- [GeneratedDllImport(Libraries.Ucrtbase)]
+ [LibraryImport(Libraries.Ucrtbase)]
[UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
internal static partial void _aligned_free(void* ptr);
- [GeneratedDllImport(Libraries.Ucrtbase)]
+ [LibraryImport(Libraries.Ucrtbase)]
[UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
internal static partial void* _aligned_realloc(void* ptr, nuint size, nuint alignment);
- [GeneratedDllImport(Libraries.Ucrtbase)]
+ [LibraryImport(Libraries.Ucrtbase)]
[UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
internal static partial void* calloc(nuint num, nuint size);
- [GeneratedDllImport(Libraries.Ucrtbase)]
+ [LibraryImport(Libraries.Ucrtbase)]
[UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
internal static partial void free(void* ptr);
- [GeneratedDllImport(Libraries.Ucrtbase)]
+ [LibraryImport(Libraries.Ucrtbase)]
[UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
internal static partial void* malloc(nuint size);
- [GeneratedDllImport(Libraries.Ucrtbase)]
+ [LibraryImport(Libraries.Ucrtbase)]
[UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
internal static partial void* realloc(void* ptr, nuint new_size);
#pragma warning restore CS3016 // Arrays as attribute arguments is not CLS-compliant
{
internal static partial class User32
{
- [GeneratedDllImport(Libraries.User32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.User32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
public static partial IntPtr CreateWindowExW(
int exStyle,
string lpszClassName,
{
internal static partial class User32
{
- [GeneratedDllImport(Libraries.User32)]
+ [LibraryImport(Libraries.User32)]
public static partial IntPtr DefWindowProcW(IntPtr hWnd, int msg, IntPtr wParam, IntPtr lParam);
}
}
{
internal static partial class User32
{
- [GeneratedDllImport(Libraries.User32)]
+ [LibraryImport(Libraries.User32)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool DestroyWindow(IntPtr hWnd);
}
{
internal static partial class User32
{
- [GeneratedDllImport(Libraries.User32)]
+ [LibraryImport(Libraries.User32)]
public static partial int DispatchMessageW(ref MSG msg);
}
}
{
internal static partial class User32
{
- [GeneratedDllImport(Libraries.User32)]
+ [LibraryImport(Libraries.User32)]
public static unsafe partial Interop.BOOL EnumWindows(delegate* unmanaged<IntPtr, IntPtr, Interop.BOOL> callback, IntPtr extraData);
}
}
{
internal static partial class User32
{
- [GeneratedDllImport(Libraries.User32, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.User32, StringMarshalling = StringMarshalling.Utf16)]
public static partial IntPtr FindWindowW(string lpClassName, string lpWindowName);
}
}
{
internal static partial class User32
{
- [GeneratedDllImport(Libraries.User32, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.User32, StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool GetClassInfoW(IntPtr hInst, string lpszClass, ref WNDCLASS wc);
}
{
internal static partial class User32
{
- [GeneratedDllImport(Libraries.User32)]
+ [LibraryImport(Libraries.User32)]
public static partial IntPtr GetDC(IntPtr hWnd);
public static IntPtr GetDC(HandleRef hWnd)
{
internal static partial class User32
{
- [GeneratedDllImport(Libraries.User32)]
+ [LibraryImport(Libraries.User32)]
internal static partial short GetKeyState(int virtualKeyCode);
}
}
{
internal static partial class User32
{
- [GeneratedDllImport(Libraries.User32)]
+ [LibraryImport(Libraries.User32)]
public static partial int GetMessageW(ref MSG msg, IntPtr hwnd, int msgMin, int msgMax);
}
}
{
internal static partial class User32
{
- [GeneratedDllImport(Libraries.User32)]
+ [LibraryImport(Libraries.User32)]
internal static partial IntPtr GetProcessWindowStation();
}
}
// index that doesn't exist.
[SuppressGCTransition]
- [GeneratedDllImport(Libraries.User32)]
+ [LibraryImport(Libraries.User32)]
internal static partial uint GetSysColor(int nIndex);
}
}
{
internal static partial class User32
{
- [GeneratedDllImport(Libraries.User32, SetLastError = true)]
+ [LibraryImport(Libraries.User32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
public static unsafe partial bool GetUserObjectInformationW(IntPtr hObj, int nIndex, void* pvBuffer, uint nLength, ref uint lpnLengthNeeded);
}
{
internal static partial class User32
{
- [GeneratedDllImport(Libraries.User32)]
+ [LibraryImport(Libraries.User32)]
public static partial IntPtr GetWindow(IntPtr hWnd, int uCmd);
}
}
{
internal static partial class User32
{
- [GeneratedDllImport(Libraries.User32, EntryPoint = "GetWindowLongW")]
+ [LibraryImport(Libraries.User32, EntryPoint = "GetWindowLongW")]
public static partial int GetWindowLong(IntPtr hWnd, int uCmd);
}
}
{
internal static partial class User32
{
- [GeneratedDllImport(Libraries.User32, SetLastError = true)]
+ [LibraryImport(Libraries.User32, SetLastError = true)]
public static partial int GetWindowTextLengthW(IntPtr hWnd);
}
}
{
internal static partial class User32
{
- [GeneratedDllImport(Libraries.User32, SetLastError = true)]
+ [LibraryImport(Libraries.User32, SetLastError = true)]
public static unsafe partial int GetWindowTextW(IntPtr hWnd, char* lpString, int nMaxCount);
}
}
{
internal static partial class User32
{
- [GeneratedDllImport(Libraries.User32)]
+ [LibraryImport(Libraries.User32)]
public static unsafe partial int GetWindowThreadProcessId(IntPtr handle, int* processId);
}
}
{
internal static partial class User32
{
- [GeneratedDllImport(Libraries.User32)]
+ [LibraryImport(Libraries.User32)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool IsWindow(IntPtr hWnd);
}
{
internal static partial class User32
{
- [GeneratedDllImport(Libraries.User32)]
+ [LibraryImport(Libraries.User32)]
public static partial BOOL IsWindowVisible(IntPtr hWnd);
}
}
{
internal static partial class User32
{
- [GeneratedDllImport(Libraries.User32)]
+ [LibraryImport(Libraries.User32)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool KillTimer(IntPtr hwnd, IntPtr idEvent);
}
{
internal static partial class User32
{
- [GeneratedDllImport(Libraries.User32, EntryPoint = "LoadStringW", SetLastError = true)]
+ [LibraryImport(Libraries.User32, EntryPoint = "LoadStringW", SetLastError = true)]
internal static unsafe partial int LoadString(IntPtr hInstance, uint uID, char* lpBuffer, int cchBufferMax);
}
}
internal const int MB_ICONEXCLAMATION = 0x30;
internal const int MB_ICONASTERISK = 0x40;
- [GeneratedDllImport(Libraries.User32)]
+ [LibraryImport(Libraries.User32)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool MessageBeep(int type);
}
{
internal static partial class User32
{
- [GeneratedDllImport(Libraries.User32)]
+ [LibraryImport(Libraries.User32)]
public static partial int MsgWaitForMultipleObjectsEx(int nCount, IntPtr pHandles, int dwMilliseconds, int dwWakeMask, int dwFlags);
}
}
{
internal static partial class User32
{
- [GeneratedDllImport(Libraries.User32)]
+ [LibraryImport(Libraries.User32)]
public static partial int PostMessageW(IntPtr hwnd, int msg, IntPtr wparam, IntPtr lparam);
}
}
{
internal static partial class User32
{
- [GeneratedDllImport(Libraries.User32)]
+ [LibraryImport(Libraries.User32)]
public static partial void PostQuitMessage(int exitCode);
}
}
{
internal static partial class User32
{
- [GeneratedDllImport(Libraries.User32, SetLastError = true)]
+ [LibraryImport(Libraries.User32, SetLastError = true)]
public static partial short RegisterClassW(ref WNDCLASS wc);
}
}
{
internal static partial class User32
{
- [GeneratedDllImport(Libraries.User32, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.User32, StringMarshalling = StringMarshalling.Utf16)]
public static partial int RegisterWindowMessageW(string msg);
}
}
{
internal static partial class User32
{
- [GeneratedDllImport(Libraries.User32)]
+ [LibraryImport(Libraries.User32)]
public static partial int ReleaseDC(IntPtr hWnd, IntPtr hDC);
public static int ReleaseDC(HandleRef hWnd, IntPtr hDC)
{
internal static partial class User32
{
- [GeneratedDllImport(Libraries.User32)]
+ [LibraryImport(Libraries.User32)]
public static partial IntPtr SendMessageW(IntPtr hWnd, int msg, IntPtr wParam, IntPtr lParam);
}
}
{
internal static partial class User32
{
- [GeneratedDllImport(Libraries.User32, EntryPoint = "SendMessageTimeoutW")]
+ [LibraryImport(Libraries.User32, EntryPoint = "SendMessageTimeoutW")]
public static unsafe partial IntPtr SendMessageTimeout(IntPtr hWnd, int msg, IntPtr wParam, IntPtr lParam, int flags, int timeout, IntPtr* pdwResult);
}
}
{
internal static partial class User32
{
- [GeneratedDllImport(Libraries.User32)]
+ [LibraryImport(Libraries.User32)]
public static partial IntPtr SetClassLongW(IntPtr hwnd, int nIndex, IntPtr dwNewLong);
}
}
{
internal static partial class User32
{
- [GeneratedDllImport(Libraries.User32)]
+ [LibraryImport(Libraries.User32)]
public static partial IntPtr SetClassLongPtrW(IntPtr hwnd, int nIndex, IntPtr dwNewLong);
}
}
{
internal static partial class User32
{
- [GeneratedDllImport(Libraries.User32)]
+ [LibraryImport(Libraries.User32)]
public static partial IntPtr SetTimer(IntPtr hWnd, IntPtr nIDEvent, int uElapse, IntPtr lpTimerProc);
}
}
{
internal static partial class User32
{
- [GeneratedDllImport(Libraries.User32)]
+ [LibraryImport(Libraries.User32)]
public static partial IntPtr SetWindowLongW(IntPtr hWnd, int nIndex, IntPtr dwNewLong);
}
}
{
internal static partial class User32
{
- [GeneratedDllImport(Libraries.User32)]
+ [LibraryImport(Libraries.User32)]
public static partial IntPtr SetWindowLongPtrW(IntPtr hWnd, int nIndex, IntPtr dwNewLong);
}
}
SPI_GETNONCLIENTMETRICS = 0x29
}
- [GeneratedDllImport(Libraries.User32)]
+ [LibraryImport(Libraries.User32)]
[return: MarshalAs(UnmanagedType.Bool)]
public static unsafe partial bool SystemParametersInfoW(SystemParametersAction uiAction, uint uiParam, void* pvParam, uint fWinIni);
}
{
internal static partial class User32
{
- [GeneratedDllImport(Libraries.User32)]
+ [LibraryImport(Libraries.User32)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool TranslateMessage(ref MSG msg);
}
{
internal static partial class User32
{
- [GeneratedDllImport(Libraries.User32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.User32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
public static partial short UnregisterClassW(string lpClassName, IntPtr hInstance);
}
}
{
internal static partial class User32
{
- [GeneratedDllImport(Libraries.User32)]
+ [LibraryImport(Libraries.User32)]
public static partial int WaitForInputIdle(SafeProcessHandle handle, int milliseconds);
}
}
{
internal static partial class User32
{
- [GeneratedDllImport(Libraries.User32)]
+ [LibraryImport(Libraries.User32)]
public static partial IntPtr WindowFromDC(IntPtr hDC);
public static IntPtr WindowFromDC(HandleRef hDC)
{
internal static partial class Version
{
- [GeneratedDllImport(Libraries.Version, EntryPoint = "GetFileVersionInfoExW", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Version, EntryPoint = "GetFileVersionInfoExW", StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool GetFileVersionInfoEx(
uint dwFlags,
{
internal static partial class Version
{
- [GeneratedDllImport(Libraries.Version, EntryPoint = "GetFileVersionInfoSizeExW", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Version, EntryPoint = "GetFileVersionInfoSizeExW", StringMarshalling = StringMarshalling.Utf16)]
internal static partial uint GetFileVersionInfoSizeEx(uint dwFlags, string lpwstrFilename, out uint lpdwHandle);
}
}
{
internal static partial class Version
{
- [GeneratedDllImport(Libraries.Version, EntryPoint = "VerQueryValueW", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Version, EntryPoint = "VerQueryValueW", StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool VerQueryValue(IntPtr pBlock, string lpSubBlock, out IntPtr lplpBuffer, out uint puLen);
}
{
internal static partial class WebSocket
{
- [GeneratedDllImport(Libraries.WebSocket)]
+ [LibraryImport(Libraries.WebSocket)]
internal static partial void WebSocketAbortHandle(SafeHandle webSocketHandle);
}
}
{
internal static partial class WebSocket
{
- [GeneratedDllImport(Libraries.WebSocket)]
+ [LibraryImport(Libraries.WebSocket)]
internal static partial int WebSocketBeginClientHandshake(
SafeHandle webSocketHandle,
IntPtr subProtocols,
{
internal static partial class WebSocket
{
- [GeneratedDllImport(Libraries.WebSocket)]
+ [LibraryImport(Libraries.WebSocket)]
internal static partial int WebSocketBeginServerHandshake(
SafeHandle webSocketHandle,
IntPtr subProtocol,
{
internal static partial class WebSocket
{
- [GeneratedDllImport(Libraries.WebSocket)]
+ [LibraryImport(Libraries.WebSocket)]
internal static partial void WebSocketCompleteAction(
SafeHandle webSocketHandle,
IntPtr actionContext,
{
internal static partial class WebSocket
{
- [GeneratedDllImport(Libraries.WebSocket)]
+ [LibraryImport(Libraries.WebSocket)]
internal static partial int WebSocketCreateClientHandle(
Property[] properties,
uint propertyCount,
{
internal static partial class WebSocket
{
- [GeneratedDllImport(Libraries.WebSocket)]
+ [LibraryImport(Libraries.WebSocket)]
internal static partial int WebSocketCreateServerHandle(
Property[] properties,
uint propertyCount,
{
internal static partial class WebSocket
{
- [GeneratedDllImport(Libraries.WebSocket)]
+ [LibraryImport(Libraries.WebSocket)]
internal static partial void WebSocketDeleteHandle(
IntPtr webSocketHandle);
}
{
internal static partial class WebSocket
{
- [GeneratedDllImport(Libraries.WebSocket)]
+ [LibraryImport(Libraries.WebSocket)]
internal static partial int WebSocketEndServerHandshake(SafeHandle webSocketHandle);
}
}
{
internal static partial class WebSocket
{
- [GeneratedDllImport(Libraries.WebSocket)]
+ [LibraryImport(Libraries.WebSocket)]
internal static partial int WebSocketGetAction(
SafeHandle webSocketHandle,
ActionQueue actionQueue,
{
internal static partial class WebSocket
{
- [GeneratedDllImport(Libraries.WebSocket)]
+ [LibraryImport(Libraries.WebSocket)]
internal static partial int WebSocketReceive(
SafeHandle webSocketHandle,
IntPtr buffers,
{
internal static partial class WebSocket
{
- [GeneratedDllImport(Libraries.WebSocket, EntryPoint = "WebSocketSend")]
+ [LibraryImport(Libraries.WebSocket, EntryPoint = "WebSocketSend")]
internal static partial int WebSocketSend_Raw(
SafeHandle webSocketHandle,
BufferType bufferType,
ref Buffer buffer,
IntPtr applicationContext);
- [GeneratedDllImport(Libraries.WebSocket, EntryPoint = "WebSocketSend")]
+ [LibraryImport(Libraries.WebSocket, EntryPoint = "WebSocketSend")]
internal static partial int WebSocketSendWithoutBody_Raw(
SafeHandle webSocketHandle,
BufferType bufferType,
{
internal static partial class WinHttp
{
- [GeneratedDllImport(Interop.Libraries.WinHttp, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Interop.Libraries.WinHttp, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
public static partial SafeWinHttpHandle WinHttpOpen(
IntPtr userAgent,
uint accessType,
string? proxyName,
string? proxyBypass, int flags);
- [GeneratedDllImport(Interop.Libraries.WinHttp, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Interop.Libraries.WinHttp, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool WinHttpCloseHandle(
IntPtr handle);
- [GeneratedDllImport(Interop.Libraries.WinHttp, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Interop.Libraries.WinHttp, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
public static partial SafeWinHttpHandle WinHttpConnect(
SafeWinHttpHandle sessionHandle,
string serverName,
ushort serverPort,
uint reserved);
- [GeneratedDllImport(Interop.Libraries.WinHttp, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Interop.Libraries.WinHttp, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
public static partial SafeWinHttpHandle WinHttpOpenRequest(
SafeWinHttpHandle connectHandle,
string verb,
string acceptTypes,
uint flags);
- [GeneratedDllImport(Interop.Libraries.WinHttp, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Interop.Libraries.WinHttp, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool WinHttpAddRequestHeaders(
SafeWinHttpHandle requestHandle,
}
#endif
- [GeneratedDllImport(Interop.Libraries.WinHttp, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Interop.Libraries.WinHttp, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool WinHttpAddRequestHeaders(
SafeWinHttpHandle requestHandle,
uint headersLength,
uint modifiers);
- [GeneratedDllImport(Interop.Libraries.WinHttp, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Interop.Libraries.WinHttp, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool WinHttpSendRequest(
SafeWinHttpHandle requestHandle,
uint totalLength,
IntPtr context);
- [GeneratedDllImport(Interop.Libraries.WinHttp, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Interop.Libraries.WinHttp, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool WinHttpReceiveResponse(
SafeWinHttpHandle requestHandle,
IntPtr reserved);
- [GeneratedDllImport(Interop.Libraries.WinHttp, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Interop.Libraries.WinHttp, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool WinHttpQueryDataAvailable(
SafeWinHttpHandle requestHandle,
IntPtr parameterIgnoredAndShouldBeNullForAsync);
- [GeneratedDllImport(Interop.Libraries.WinHttp, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Interop.Libraries.WinHttp, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool WinHttpReadData(
SafeWinHttpHandle requestHandle,
uint bufferSize,
IntPtr parameterIgnoredAndShouldBeNullForAsync);
- [GeneratedDllImport(Interop.Libraries.WinHttp, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Interop.Libraries.WinHttp, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool WinHttpQueryHeaders(
SafeWinHttpHandle requestHandle,
ref uint bufferLength,
ref uint index);
- [GeneratedDllImport(Interop.Libraries.WinHttp, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Interop.Libraries.WinHttp, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool WinHttpQueryHeaders(
SafeWinHttpHandle requestHandle,
ref uint bufferLength,
IntPtr index);
- [GeneratedDllImport(Interop.Libraries.WinHttp, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Interop.Libraries.WinHttp, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool WinHttpQueryOption(
SafeWinHttpHandle handle,
ref IntPtr buffer,
ref uint bufferSize);
- [GeneratedDllImport(Interop.Libraries.WinHttp, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Interop.Libraries.WinHttp, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool WinHttpQueryOption(
SafeWinHttpHandle handle,
IntPtr buffer,
ref uint bufferSize);
- [GeneratedDllImport(Interop.Libraries.WinHttp, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Interop.Libraries.WinHttp, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool WinHttpQueryOption(
SafeWinHttpHandle handle,
ref uint buffer,
ref uint bufferSize);
- [GeneratedDllImport(Interop.Libraries.WinHttp, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Interop.Libraries.WinHttp, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool WinHttpWriteData(
SafeWinHttpHandle requestHandle,
uint bufferSize,
IntPtr parameterIgnoredAndShouldBeNullForAsync);
- [GeneratedDllImport(Interop.Libraries.WinHttp, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Interop.Libraries.WinHttp, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool WinHttpSetOption(
SafeWinHttpHandle handle,
ref uint optionData,
uint optionLength = sizeof(uint));
- [GeneratedDllImport(Interop.Libraries.WinHttp, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Interop.Libraries.WinHttp, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool WinHttpSetOption(
SafeWinHttpHandle handle,
IntPtr optionData,
uint optionLength);
- [GeneratedDllImport(Interop.Libraries.WinHttp, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Interop.Libraries.WinHttp, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool WinHttpSetCredentials(
SafeWinHttpHandle requestHandle,
string? password,
IntPtr reserved);
- [GeneratedDllImport(Interop.Libraries.WinHttp, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Interop.Libraries.WinHttp, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool WinHttpQueryAuthSchemes(
SafeWinHttpHandle requestHandle,
out uint firstScheme,
out uint authTarget);
- [GeneratedDllImport(Interop.Libraries.WinHttp, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Interop.Libraries.WinHttp, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool WinHttpSetTimeouts(
SafeWinHttpHandle handle,
int sendTimeout,
int receiveTimeout);
- [GeneratedDllImport(Interop.Libraries.WinHttp, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Interop.Libraries.WinHttp, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool WinHttpGetIEProxyConfigForCurrentUser(
out WINHTTP_CURRENT_USER_IE_PROXY_CONFIG proxyConfig);
- [GeneratedDllImport(Interop.Libraries.WinHttp, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Interop.Libraries.WinHttp, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]public static partial bool WinHttpGetProxyForUrl(
SafeWinHttpHandle? sessionHandle,
string url,
ref WINHTTP_AUTOPROXY_OPTIONS autoProxyOptions,
out WINHTTP_PROXY_INFO proxyInfo);
- [GeneratedDllImport(Interop.Libraries.WinHttp, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Interop.Libraries.WinHttp, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
public static partial IntPtr WinHttpSetStatusCallback(
SafeWinHttpHandle handle,
WINHTTP_STATUS_CALLBACK callback,
internal const int SND_FILENAME = 0x20000;
internal const int SND_NOSTOP = 0x10;
- [GeneratedDllImport(Libraries.WinMM, EntryPoint = "PlaySoundW", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.WinMM, EntryPoint = "PlaySoundW", StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool PlaySound(string soundName, IntPtr hmod, int soundFlags);
- [GeneratedDllImport(Libraries.WinMM, EntryPoint = "PlaySoundW")]
+ [LibraryImport(Libraries.WinMM, EntryPoint = "PlaySoundW")]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool PlaySound(byte[]? soundName, IntPtr hmod, int soundFlags);
}
{
internal static partial class WinMM
{
- [GeneratedDllImport(Libraries.WinMM)]
+ [LibraryImport(Libraries.WinMM)]
internal static unsafe partial int mmioAscend(IntPtr hMIO, MMCKINFO* lpck, int flags);
}
}
{
internal static partial class WinMM
{
- [GeneratedDllImport(Interop.Libraries.WinMM)]
+ [LibraryImport(Interop.Libraries.WinMM)]
internal static partial int mmioClose(IntPtr hMIO, int flags);
}
}
{
internal const int MMIO_FINDRIFF = 0x00000020;
- [GeneratedDllImport(Libraries.WinMM)]
+ [LibraryImport(Libraries.WinMM)]
internal static unsafe partial int mmioDescend(
IntPtr hMIO,
MMCKINFO* lpck,
internal const int MMIO_READ = 0x00000000;
internal const int MMIO_ALLOCBUF = 0x00010000;
- [GeneratedDllImport(Libraries.WinMM, EntryPoint = "mmioOpenW", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.WinMM, EntryPoint = "mmioOpenW", StringMarshalling = StringMarshalling.Utf16)]
internal static partial IntPtr mmioOpen(string fileName, IntPtr not_used, int flags);
}
}
internal const int WAVE_FORMAT_ADPCM = 0x0002;
internal const int WAVE_FORMAT_IEEE_FLOAT = 0x0003;
- [GeneratedDllImport(Libraries.WinMM)]
+ [LibraryImport(Libraries.WinMM)]
internal static partial int mmioRead(IntPtr hMIO, [MarshalAs(UnmanagedType.LPArray)] byte[] wf, int cch);
}
}
/// <param name="hwo">Handle to the waveform-audio output device. If the function
/// succeeds, the handle is no longer valid after this call.</param>
/// <returns>MMSYSERR</returns>
- [GeneratedDllImport(Libraries.WinMM)]
+ [LibraryImport(Libraries.WinMM)]
internal static partial MMSYSERR waveOutClose(IntPtr hwo);
}
}
/// information about the capabilities of the device.</param>
/// <param name="cbwoc">Size, in bytes, of the WAVEOUTCAPS structure.</param>
/// <returns>MMSYSERR</returns>
-#pragma warning disable DLLIMPORTGENANALYZER015 // Use 'GeneratedDllImportAttribute' instead of 'DllImportAttribute' to generate P/Invoke marshalling code at compile time
+#pragma warning disable DLLIMPORTGENANALYZER015 // Use 'LibraryImportAttribute' instead of 'DllImportAttribute' to generate P/Invoke marshalling code at compile time
// TODO: [DllImportGenerator] Switch to use GeneratedDllImport once we support non-blittable types.
[DllImport(Libraries.WinMM)]
internal static extern MMSYSERR waveOutGetDevCaps(IntPtr uDeviceID, ref WAVEOUTCAPS caps, int cbwoc);
/// </summary>
/// <returns>The number of devices indicates success. Zero indicates that
/// no devices are present or that an error occurred.</returns>
- [GeneratedDllImport(Libraries.WinMM)]
+ [LibraryImport(Libraries.WinMM)]
internal static partial int waveOutGetNumDevs();
}
}
/// mechanism.</param>
/// <param name="fdwOpen">Flags for opening the device.</param>
/// <returns>MMSYSERR</returns>
- [GeneratedDllImport(Libraries.WinMM)]
+ [LibraryImport(Libraries.WinMM)]
internal static partial MMSYSERR waveOutOpen(ref IntPtr phwo, int uDeviceID, byte[] pwfx, WaveOutProc dwCallback, IntPtr dwInstance, uint fdwOpen);
}
}
/// </summary>
/// <param name="hwo">Handle to the waveform-audio output device.</param>
/// <returns>MMSYSERR</returns>
- [GeneratedDllImport(Libraries.WinMM)]
+ [LibraryImport(Libraries.WinMM)]
internal static partial MMSYSERR waveOutPause(IntPtr hwo);
}
}
/// respect to the sample size.</param>
/// <param name="cbwh">Size, in bytes, of the WaveHeader structure.</param>
/// <returns>MMSYSERR</returns>
- [GeneratedDllImport(Libraries.WinMM)]
+ [LibraryImport(Libraries.WinMM)]
internal static partial MMSYSERR waveOutPrepareHeader(IntPtr hwo, IntPtr pwh, int cbwh);
/// <summary>
/// to be cleaned up.</param>
/// <param name="cbwh">Size, in bytes, of the WaveHeader structure.</param>
/// <returns>MMSYSERR</returns>
- [GeneratedDllImport(Libraries.WinMM)]
+ [LibraryImport(Libraries.WinMM)]
internal static partial MMSYSERR waveOutUnprepareHeader(IntPtr hwo, IntPtr pwh, int cbwh);
}
}
/// </summary>
/// <param name="hwo">Handle to the waveform-audio output device.</param>
/// <returns>MMSYSERR</returns>
- [GeneratedDllImport(Libraries.WinMM)]
+ [LibraryImport(Libraries.WinMM)]
internal static partial MMSYSERR waveOutReset(IntPtr hwo);
}
}
/// </summary>
/// <param name="hwo">Handle to the waveform-audio output device.</param>
/// <returns>MMSYSERR</returns>
- [GeneratedDllImport(Libraries.WinMM)]
+ [LibraryImport(Libraries.WinMM)]
internal static partial MMSYSERR waveOutRestart(IntPtr hwo);
}
}
/// about the data block.</param>
/// <param name="cbwh">Size, in bytes, of the WaveHeader structure.</param>
/// <returns>MMSYSERR</returns>
- [GeneratedDllImport(Libraries.WinMM)]
+ [LibraryImport(Libraries.WinMM)]
internal static partial MMSYSERR waveOutWrite(IntPtr hwo, IntPtr pwh, int cbwh);
}
}
internal const int NS_ALL = 0;
- [GeneratedDllImport(Libraries.Ws2_32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Ws2_32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
internal static unsafe partial int GetAddrInfoExW(
string pName,
string? pServiceName,
delegate* unmanaged<int, int, NativeOverlapped*, void> lpCompletionRoutine,
IntPtr* lpNameHandle);
- [GeneratedDllImport(Libraries.Ws2_32)]
+ [LibraryImport(Libraries.Ws2_32)]
internal static unsafe partial int GetAddrInfoExCancel(IntPtr* lpHandle);
- [GeneratedDllImport(Libraries.Ws2_32)]
+ [LibraryImport(Libraries.Ws2_32)]
internal static unsafe partial void FreeAddrInfoExW(AddressInfoEx* pAddrInfo);
[StructLayout(LayoutKind.Sequential)]
{
internal static partial class Winsock
{
- [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
internal static unsafe partial int GetAddrInfoW(
string pNameName,
string? pServiceName,
AddressInfo* pHints,
AddressInfo** ppResult);
- [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)]
internal static unsafe partial void FreeAddrInfoW(AddressInfo* info);
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
NI_DGRAM = 0x10, /* Service is a datagram service */
}
- [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
internal static unsafe partial SocketError GetNameInfoW(
byte* pSockaddr,
int SockaddrLength,
{
internal static partial class Mswsock
{
- [GeneratedDllImport(Interop.Libraries.Mswsock, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Mswsock, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static unsafe partial bool TransmitFile(
SafeHandle socket,
{
internal static partial class Winsock
{
- [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)]
internal static partial SocketError WSAConnect(
SafeSocketHandle socketHandle,
byte[] socketAddress,
{
internal static partial class Winsock
{
- [GeneratedDllImport(Interop.Libraries.Ws2_32, EntryPoint = "WSADuplicateSocketW", SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Ws2_32, EntryPoint = "WSADuplicateSocketW", SetLastError = true)]
internal static unsafe partial int WSADuplicateSocket(
SafeSocketHandle s,
uint dwProcessId,
{
internal static partial class Winsock
{
- [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)]
internal static partial SocketError WSAEventSelect(
SafeSocketHandle socketHandle,
SafeHandle Event,
{
internal static partial class Winsock
{
- [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static unsafe partial bool WSAGetOverlappedResult(
SafeSocketHandle socketHandle,
internal static partial class Winsock
{
// Used with SIOGETEXTENSIONFUNCTIONPOINTER - we're assuming that will never block.
- [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)]
internal static partial SocketError WSAIoctl(
SafeSocketHandle socketHandle,
int ioControlCode,
IntPtr shouldBeNull,
IntPtr shouldBeNull2);
- [GeneratedDllImport(Interop.Libraries.Ws2_32, EntryPoint = "WSAIoctl", SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Ws2_32, EntryPoint = "WSAIoctl", SetLastError = true)]
internal static partial SocketError WSAIoctl_Blocking(
SafeSocketHandle socketHandle,
int ioControlCode,
{
internal static partial class Winsock
{
- [GeneratedDllImport(Libraries.Ws2_32, SetLastError = true)]
+ [LibraryImport(Libraries.Ws2_32, SetLastError = true)]
internal static unsafe partial SocketError WSARecv(
SafeHandle socketHandle,
WSABuffer* buffer,
{
internal static partial class Winsock
{
- [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)]
private static unsafe partial SocketError WSARecvFrom(
SafeHandle socketHandle,
WSABuffer* buffers,
{
internal static partial class Winsock
{
- [GeneratedDllImport(Libraries.Ws2_32, SetLastError = true)]
+ [LibraryImport(Libraries.Ws2_32, SetLastError = true)]
internal static unsafe partial SocketError WSASend(
SafeHandle socketHandle,
WSABuffer* buffers,
{
internal static partial class Winsock
{
- [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)]
private static unsafe partial SocketError WSASendTo(
SafeHandle socketHandle,
WSABuffer* buffers,
{
internal static partial class Winsock
{
- [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
internal static partial IntPtr WSASocketW(
AddressFamily addressFamily,
SocketType socketType,
{
internal static partial class Winsock
{
- [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
internal static partial IntPtr WSASocketW(
AddressFamily addressFamily,
SocketType socketType,
}
}
- [GeneratedDllImport(Libraries.Ws2_32)]
+ [LibraryImport(Libraries.Ws2_32)]
private static unsafe partial SocketError WSAStartup(short wVersionRequested, WSAData* lpWSAData);
- [GeneratedDllImport(Libraries.Ws2_32)]
+ [LibraryImport(Libraries.Ws2_32)]
private static partial SocketError WSACleanup();
[StructLayout(LayoutKind.Sequential, Size = 408)]
{
internal static partial class Winsock
{
- [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)]
internal static partial IntPtr accept(
SafeSocketHandle socketHandle,
byte[] socketAddress,
{
internal static partial class Winsock
{
- [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)]
internal static partial SocketError bind(
SafeSocketHandle socketHandle,
byte[] socketAddress,
{
internal static partial class Winsock
{
- [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)]
internal static partial SocketError closesocket(IntPtr socketHandle);
}
}
{
internal static partial class Winsock
{
- [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)]
internal static unsafe partial SocketError gethostname(byte* name, int namelen);
}
}
{
internal static partial class Winsock
{
- [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)]
internal static unsafe partial SocketError getpeername(
SafeSocketHandle socketHandle,
byte* socketAddress,
{
internal static partial class Winsock
{
- [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)]
internal static unsafe partial SocketError getsockname(
SafeSocketHandle socketHandle,
byte* socketAddress,
{
internal static partial class Winsock
{
- [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)]
internal static unsafe partial SocketError getsockopt(
SafeSocketHandle socketHandle,
SocketOptionLevel optionLevel,
byte* optionValue,
ref int optionLength);
- [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)]
internal static partial SocketError getsockopt(
SafeSocketHandle socketHandle,
SocketOptionLevel optionLevel,
out Linger optionValue,
ref int optionLength);
- [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)]
internal static partial SocketError getsockopt(
SafeSocketHandle socketHandle,
SocketOptionLevel optionLevel,
out IPMulticastRequest optionValue,
ref int optionLength);
- [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)]
internal static partial SocketError getsockopt(
SafeSocketHandle socketHandle,
SocketOptionLevel optionLevel,
{
internal static partial class Winsock
{
- [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)]
internal static partial SocketError ioctlsocket(
IntPtr handle,
int cmd,
ref int argp);
- [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)]
internal static partial SocketError ioctlsocket(
SafeSocketHandle socketHandle,
int cmd,
{
internal static partial class Winsock
{
- [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)]
internal static partial SocketError listen(
SafeSocketHandle socketHandle,
int backlog);
{
internal static partial class Winsock
{
- [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)]
internal static unsafe partial int recv(
SafeSocketHandle socketHandle,
byte* pinnedBuffer,
internal static partial class Winsock
{
// This method is always blocking, so it uses an IntPtr.
- [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)]
internal static unsafe partial int recvfrom(
SafeSocketHandle socketHandle,
byte* pinnedBuffer,
{
internal static partial class Winsock
{
- [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)]
internal static unsafe partial int select(
int ignoredParameter,
IntPtr* readfds,
IntPtr* exceptfds,
ref TimeValue timeout);
- [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)]
internal static unsafe partial int select(
int ignoredParameter,
IntPtr* readfds,
{
internal static partial class Winsock
{
- [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)]
internal static unsafe partial int send(
SafeSocketHandle socketHandle,
byte* pinnedBuffer,
{
internal static partial class Winsock
{
- [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)]
internal static unsafe partial int sendto(
SafeSocketHandle socketHandle,
byte* pinnedBuffer,
{
internal static partial class Winsock
{
- [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)]
internal static partial SocketError setsockopt(
IntPtr handle,
SocketOptionLevel optionLevel,
ref Linger linger,
int optionLength);
- [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)]
internal static partial SocketError setsockopt(
SafeSocketHandle socketHandle,
SocketOptionLevel optionLevel,
ref int optionValue,
int optionLength);
- [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)]
internal static unsafe partial SocketError setsockopt(
SafeSocketHandle socketHandle,
SocketOptionLevel optionLevel,
byte* optionValue,
int optionLength);
- [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)]
internal static partial SocketError setsockopt(
SafeSocketHandle socketHandle,
SocketOptionLevel optionLevel,
ref IntPtr pointer,
int optionLength);
- [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)]
internal static partial SocketError setsockopt(
SafeSocketHandle socketHandle,
SocketOptionLevel optionLevel,
ref Linger linger,
int optionLength);
- [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)]
internal static partial SocketError setsockopt(
SafeSocketHandle socketHandle,
SocketOptionLevel optionLevel,
ref IPMulticastRequest mreq,
int optionLength);
- [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)]
internal static partial SocketError setsockopt(
SafeSocketHandle socketHandle,
SocketOptionLevel optionLevel,
{
internal static partial class Winsock
{
- [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)]
internal static partial SocketError shutdown(
SafeSocketHandle socketHandle,
int how);
{
internal static partial class Wkscli
{
- [GeneratedDllImport(Libraries.Wkscli, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Wkscli, StringMarshalling = StringMarshalling.Utf16)]
internal static partial int NetWkstaGetInfo(string server, int level, ref IntPtr buffer);
}
}
{
internal static partial class Ldap
{
- [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ber_free", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Wldap32, EntryPoint = "ber_free", StringMarshalling = StringMarshalling.Utf16)]
[UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
public static partial IntPtr ber_free(IntPtr berelement, int option);
- [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ber_alloc_t", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Wldap32, EntryPoint = "ber_alloc_t", StringMarshalling = StringMarshalling.Utf16)]
[UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
public static partial IntPtr ber_alloc(int option);
- [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ber_printf", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Wldap32, EntryPoint = "ber_printf", StringMarshalling = StringMarshalling.Utf16)]
[UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
public static partial int ber_printf(SafeBerHandle berElement, string format, IntPtr value);
- [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ber_printf", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Wldap32, EntryPoint = "ber_printf", StringMarshalling = StringMarshalling.Utf16)]
[UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
public static partial int ber_printf(SafeBerHandle berElement, string format, HGlobalMemHandle value, uint length);
- [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ber_printf", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Wldap32, EntryPoint = "ber_printf", StringMarshalling = StringMarshalling.Utf16)]
[UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
public static partial int ber_printf(SafeBerHandle berElement, string format);
- [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ber_printf", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Wldap32, EntryPoint = "ber_printf", StringMarshalling = StringMarshalling.Utf16)]
[UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
public static partial int ber_printf(SafeBerHandle berElement, string format, int value);
- [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ber_printf", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Wldap32, EntryPoint = "ber_printf", StringMarshalling = StringMarshalling.Utf16)]
[UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
public static partial int ber_printf(SafeBerHandle berElement, string format, uint tag);
- [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ber_flatten", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Wldap32, EntryPoint = "ber_flatten", StringMarshalling = StringMarshalling.Utf16)]
[UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
public static partial int ber_flatten(SafeBerHandle berElement, ref IntPtr value);
- [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ber_init", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Wldap32, EntryPoint = "ber_init", StringMarshalling = StringMarshalling.Utf16)]
[UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
public static partial IntPtr ber_init(BerVal value);
- [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ber_scanf", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Wldap32, EntryPoint = "ber_scanf", StringMarshalling = StringMarshalling.Utf16)]
[UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
public static partial int ber_scanf(SafeBerHandle berElement, string format);
- [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ber_scanf", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Wldap32, EntryPoint = "ber_scanf", StringMarshalling = StringMarshalling.Utf16)]
[UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
public static partial int ber_scanf(SafeBerHandle berElement, string format, ref IntPtr ptrResult, ref uint bitLength);
- [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ber_scanf", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Wldap32, EntryPoint = "ber_scanf", StringMarshalling = StringMarshalling.Utf16)]
[UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
public static partial int ber_scanf(SafeBerHandle berElement, string format, ref int result);
- [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ber_scanf", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Wldap32, EntryPoint = "ber_scanf", StringMarshalling = StringMarshalling.Utf16)]
[UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
public static partial int ber_scanf(SafeBerHandle berElement, string format, ref IntPtr value);
- [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ber_bvfree", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Wldap32, EntryPoint = "ber_bvfree", StringMarshalling = StringMarshalling.Utf16)]
[UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
public static partial int ber_bvfree(IntPtr value);
- [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ber_bvecfree", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Wldap32, EntryPoint = "ber_bvecfree", StringMarshalling = StringMarshalling.Utf16)]
[UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
public static partial int ber_bvecfree(IntPtr value);
}
{
internal static partial class Ldap
{
- [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_bind_sW", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_bind_sW", StringMarshalling = StringMarshalling.Utf16)]
[UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
public static partial int ldap_bind_s(ConnectionHandle ldapHandle, string dn, in SEC_WINNT_AUTH_IDENTITY_EX credentials, BindMethod method);
- [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_initW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_initW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
[UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
public static partial IntPtr ldap_init(string hostName, int portNumber);
- [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_connect")]
+ [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_connect")]
[UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
public static partial int ldap_connect(ConnectionHandle ldapHandle, in LDAP_TIMEVAL timeout);
- [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_unbind")]
+ [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_unbind")]
[UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
public static partial int ldap_unbind(IntPtr ldapHandle);
- [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_get_optionW")]
+ [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_get_optionW")]
[UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
public static partial int ldap_get_option_int(ConnectionHandle ldapHandle, LdapOption option, ref int outValue);
- [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_set_optionW")]
+ [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_set_optionW")]
[UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
public static partial int ldap_set_option_int(ConnectionHandle ldapHandle, LdapOption option, ref int inValue);
- [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_get_optionW")]
+ [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_get_optionW")]
[UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
public static partial int ldap_get_option_ptr(ConnectionHandle ldapHandle, LdapOption option, ref IntPtr outValue);
- [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_set_optionW")]
+ [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_set_optionW")]
[UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
public static partial int ldap_set_option_ptr(ConnectionHandle ldapHandle, LdapOption option, ref IntPtr inValue);
- [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_get_optionW")]
+ [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_get_optionW")]
[UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
public static partial int ldap_get_option_sechandle(ConnectionHandle ldapHandle, LdapOption option, ref SecurityHandle outValue);
- [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_get_optionW")]
+ [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_get_optionW")]
[UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
public static unsafe partial int ldap_get_option_secInfo(ConnectionHandle ldapHandle, LdapOption option, void* outValue);
- [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_set_optionW")]
+ [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_set_optionW")]
[UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
public static partial int ldap_set_option_referral(ConnectionHandle ldapHandle, LdapOption option, ref LdapReferralCallback outValue);
- [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_set_optionW")]
+ [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_set_optionW")]
[UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
public static partial int ldap_set_option_clientcert(ConnectionHandle ldapHandle, LdapOption option, QUERYCLIENTCERT outValue);
- [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_set_optionW")]
+ [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_set_optionW")]
[UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
public static partial int ldap_set_option_servercert(ConnectionHandle ldapHandle, LdapOption option, VERIFYSERVERCERT outValue);
- [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "LdapGetLastError")]
+ [LibraryImport(Libraries.Wldap32, EntryPoint = "LdapGetLastError")]
[UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
public static partial int LdapGetLastError();
- [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "cldap_openW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Wldap32, EntryPoint = "cldap_openW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
[UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
public static partial IntPtr cldap_open(string hostName, int portNumber);
- [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_simple_bind_sW", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_simple_bind_sW", StringMarshalling = StringMarshalling.Utf16)]
[UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
public static partial int ldap_simple_bind_s(ConnectionHandle ldapHandle, string distinguishedName, string password);
- [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_delete_extW", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_delete_extW", StringMarshalling = StringMarshalling.Utf16)]
[UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
public static partial int ldap_delete_ext(ConnectionHandle ldapHandle, string dn, IntPtr servercontrol, IntPtr clientcontrol, ref int messageNumber);
- [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_result", SetLastError = true)]
+ [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_result", SetLastError = true)]
[UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
public static partial int ldap_result(ConnectionHandle ldapHandle, int messageId, int all, in LDAP_TIMEVAL timeout, ref IntPtr Mesage);
- [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_parse_resultW")]
+ [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_parse_resultW")]
[UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
public static partial int ldap_parse_result(ConnectionHandle ldapHandle, IntPtr result, ref int serverError, ref IntPtr dn, ref IntPtr message, ref IntPtr referral, ref IntPtr control, byte freeIt);
- [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_parse_resultW")]
+ [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_parse_resultW")]
[UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
public static partial int ldap_parse_result_referral(ConnectionHandle ldapHandle, IntPtr result, IntPtr serverError, IntPtr dn, IntPtr message, ref IntPtr referral, IntPtr control, byte freeIt);
- [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_memfreeW")]
+ [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_memfreeW")]
[UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
public static partial void ldap_memfree(IntPtr value);
- [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_value_freeW")]
+ [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_value_freeW")]
[UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
public static partial int ldap_value_free(IntPtr value);
- [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_controls_freeW")]
+ [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_controls_freeW")]
[UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
public static partial int ldap_controls_free(IntPtr value);
- [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_abandon")]
+ [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_abandon")]
[UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
public static partial int ldap_abandon(ConnectionHandle ldapHandle, int messagId);
- [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_start_tls_sW")]
+ [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_start_tls_sW")]
[UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
public static partial int ldap_start_tls(ConnectionHandle ldapHandle, ref int ServerReturnValue, ref IntPtr Message, IntPtr ServerControls, IntPtr ClientControls);
- [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_stop_tls_s")]
+ [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_stop_tls_s")]
[UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
public static partial byte ldap_stop_tls(ConnectionHandle ldapHandle);
- [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_rename_extW", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_rename_extW", StringMarshalling = StringMarshalling.Utf16)]
[UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
public static partial int ldap_rename(ConnectionHandle ldapHandle, string dn, string newRdn, string newParentDn, int deleteOldRdn, IntPtr servercontrol, IntPtr clientcontrol, ref int messageNumber);
- [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_compare_extW", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_compare_extW", StringMarshalling = StringMarshalling.Utf16)]
[UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
public static partial int ldap_compare(ConnectionHandle ldapHandle, string dn, string attributeName, string strValue, BerVal binaryValue, IntPtr servercontrol, IntPtr clientcontrol, ref int messageNumber);
- [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_add_extW", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_add_extW", StringMarshalling = StringMarshalling.Utf16)]
[UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
public static partial int ldap_add(ConnectionHandle ldapHandle, string dn, IntPtr attrs, IntPtr servercontrol, IntPtr clientcontrol, ref int messageNumber);
- [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_modify_extW", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_modify_extW", StringMarshalling = StringMarshalling.Utf16)]
[UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
public static partial int ldap_modify(ConnectionHandle ldapHandle, string dn, IntPtr attrs, IntPtr servercontrol, IntPtr clientcontrol, ref int messageNumber);
- [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_extended_operationW", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_extended_operationW", StringMarshalling = StringMarshalling.Utf16)]
[UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
public static partial int ldap_extended_operation(ConnectionHandle ldapHandle, string oid, BerVal data, IntPtr servercontrol, IntPtr clientcontrol, ref int messageNumber);
- [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_parse_extended_resultW")]
+ [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_parse_extended_resultW")]
[UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
public static partial int ldap_parse_extended_result(ConnectionHandle ldapHandle, IntPtr result, ref IntPtr oid, ref IntPtr data, byte freeIt);
- [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_msgfree")]
+ [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_msgfree")]
[UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
public static partial int ldap_msgfree(IntPtr result);
- [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_search_extW", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_search_extW", StringMarshalling = StringMarshalling.Utf16)]
[UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
public static partial int ldap_search(ConnectionHandle ldapHandle, string dn, int scope, string filter, IntPtr attributes, [MarshalAs(UnmanagedType.Bool)] bool attributeOnly, IntPtr servercontrol, IntPtr clientcontrol, int timelimit, int sizelimit, ref int messageNumber);
- [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_first_entry")]
+ [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_first_entry")]
[UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
public static partial IntPtr ldap_first_entry(ConnectionHandle ldapHandle, IntPtr result);
- [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_next_entry")]
+ [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_next_entry")]
[UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
public static partial IntPtr ldap_next_entry(ConnectionHandle ldapHandle, IntPtr result);
- [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_first_reference")]
+ [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_first_reference")]
[UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
public static partial IntPtr ldap_first_reference(ConnectionHandle ldapHandle, IntPtr result);
- [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_next_reference")]
+ [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_next_reference")]
[UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
public static partial IntPtr ldap_next_reference(ConnectionHandle ldapHandle, IntPtr result);
- [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_get_dnW")]
+ [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_get_dnW")]
[UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
public static partial IntPtr ldap_get_dn(ConnectionHandle ldapHandle, IntPtr result);
- [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_first_attributeW")]
+ [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_first_attributeW")]
[UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
public static partial IntPtr ldap_first_attribute(ConnectionHandle ldapHandle, IntPtr result, ref IntPtr address);
- [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_next_attributeW")]
+ [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_next_attributeW")]
[UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
public static partial IntPtr ldap_next_attribute(ConnectionHandle ldapHandle, IntPtr result, IntPtr address);
- [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_get_values_lenW", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_get_values_lenW", StringMarshalling = StringMarshalling.Utf16)]
[UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
public static partial IntPtr ldap_get_values_len(ConnectionHandle ldapHandle, IntPtr result, string name);
- [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_value_free_len")]
+ [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_value_free_len")]
[UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
public static partial IntPtr ldap_value_free_len(IntPtr berelement);
- [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_parse_referenceW")]
+ [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_parse_referenceW")]
[UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
public static partial int ldap_parse_reference(ConnectionHandle ldapHandle, IntPtr result, ref IntPtr referrals);
- [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_create_sort_controlW")]
+ [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_create_sort_controlW")]
[UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
public static partial int ldap_create_sort_control(ConnectionHandle handle, IntPtr keys, byte critical, ref IntPtr control);
- [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_control_freeW")]
+ [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_control_freeW")]
[UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
public static partial int ldap_control_free(IntPtr control);
- [GeneratedDllImport("Crypt32.dll", EntryPoint = "CertFreeCRLContext")]
+ [LibraryImport("Crypt32.dll", EntryPoint = "CertFreeCRLContext")]
public static partial int CertFreeCRLContext(IntPtr certContext);
- [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_result2error")]
+ [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_result2error")]
[UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
public static partial int ldap_result2error(ConnectionHandle ldapHandle, IntPtr result, int freeIt);
}
{
internal static partial class Wtsapi32
{
- [GeneratedDllImport(Libraries.Wtsapi32)]
+ [LibraryImport(Libraries.Wtsapi32)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool WTSRegisterSessionNotification(IntPtr hWnd, int dwFlags);
}
{
internal static partial class Wtsapi32
{
- [GeneratedDllImport(Libraries.Wtsapi32)]
+ [LibraryImport(Libraries.Wtsapi32)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool WTSUnRegisterSessionNotification(IntPtr hWnd);
}
#else
internal
#endif
- sealed class GeneratedDllImportAttribute : Attribute
+ sealed class LibraryImportAttribute : Attribute
{
public string? EntryPoint { get; set; }
public bool SetLastError { get; set; }
public StringMarshalling StringMarshalling { get; set; }
public Type? StringMarshallingCustomType { get; set; }
- public GeneratedDllImportAttribute(string dllName)
+ public LibraryImportAttribute(string dllName)
{
LibraryName = dllName;
}
private const string KERNEL32_LIB = "kernel32.dll";
// https://msdn.microsoft.com/en-us/library/windows/desktop/aa366887(v=vs.85).aspx
- [GeneratedDllImport(KERNEL32_LIB, SetLastError = true)]
+ [LibraryImport(KERNEL32_LIB, SetLastError = true)]
public static partial VirtualAllocHandle VirtualAlloc(
IntPtr lpAddress,
IntPtr dwSize,
VirtualAllocProtection flProtect);
// https://msdn.microsoft.com/en-us/library/windows/desktop/aa366892(v=vs.85).aspx
- [GeneratedDllImport(KERNEL32_LIB, SetLastError = true)]
+ [LibraryImport(KERNEL32_LIB, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool VirtualFree(
IntPtr lpAddress,
VirtualAllocAllocationType dwFreeType);
// https://msdn.microsoft.com/en-us/library/windows/desktop/aa366898(v=vs.85).aspx
- [GeneratedDllImport(KERNEL32_LIB, SetLastError = true)]
+ [LibraryImport(KERNEL32_LIB, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool VirtualProtect(
IntPtr lpAddress,
out VirtualAllocProtection lpflOldProtect);
// https://msdn.microsoft.com/en-us/library/windows/desktop/aa366902(v=vs.85).aspx
- [GeneratedDllImport(KERNEL32_LIB, SetLastError = true)]
+ [LibraryImport(KERNEL32_LIB, SetLastError = true)]
public static partial IntPtr VirtualQuery(
IntPtr lpAddress,
out MEMORY_BASIC_INFORMATION lpBuffer,
private static partial class @libc
{
- [GeneratedDllImport("libc", SetLastError = true)]
+ [LibraryImport("libc", SetLastError = true)]
public static unsafe partial uint geteuid();
- [GeneratedDllImport("libc")]
+ [LibraryImport("libc")]
public static partial IntPtr gnu_get_libc_release();
- [GeneratedDllImport("libc")]
+ [LibraryImport("libc")]
public static partial IntPtr gnu_get_libc_version();
}
}
private const int PRODUCT_HOME_PREMIUM = 0x00000003;
private const int PRODUCT_HOME_PREMIUM_N = 0x0000001A;
- [GeneratedDllImport("kernel32.dll", SetLastError = false)]
+ [LibraryImport("kernel32.dll", SetLastError = false)]
[return: MarshalAs(UnmanagedType.Bool)]
private static partial bool GetProductInfo(
int dwOSMajorVersion,
out int pdwReturnedProductType
);
- [GeneratedDllImport("kernel32.dll")]
+ [LibraryImport("kernel32.dll")]
private static partial int GetCurrentApplicationUserModelId(ref uint applicationUserModelIdLength, byte[] applicationUserModelId);
private static volatile Version s_windowsVersionObject;
}
}
- [GeneratedDllImport("advapi32.dll", EntryPoint = "LogonUserW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport("advapi32.dll", EntryPoint = "LogonUserW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
private static partial bool LogonUser(string userName, string domain, string password, int logonType, int logonProvider, out SafeAccessTokenHandle safeAccessTokenHandle);
-#pragma warning disable DLLIMPORTGENANALYZER015 // Use 'GeneratedDllImportAttribute' instead of 'DllImportAttribute' to generate P/Invoke marshalling code at compile time
- // TODO: [DllImportGenerator] Switch to use GeneratedDllImport once we add support for non-blittable struct marshalling.
+#pragma warning disable DLLIMPORTGENANALYZER015 // Use 'LibraryImportAttribute' instead of 'DllImportAttribute' to generate P/Invoke marshalling code at compile time
+ // TODO: [DllImportGenerator] Switch to use LibraryImport once we add support for non-blittable struct marshalling.
[DllImport("netapi32.dll", CharSet = CharSet.Unicode, SetLastError = true)]
internal static extern uint NetUserAdd([MarshalAs(UnmanagedType.LPWStr)]string servername, uint level, ref USER_INFO_1 buf, out uint parm_err);
-#pragma warning restore DLLIMPORTGENANALYZER015 // Use 'GeneratedDllImportAttribute' instead of 'DllImportAttribute' to generate P/Invoke marshalling code at compile time
+#pragma warning restore DLLIMPORTGENANALYZER015 // Use 'LibraryImportAttribute' instead of 'DllImportAttribute' to generate P/Invoke marshalling code at compile time
- [GeneratedDllImport("netapi32.dll")]
+ [LibraryImport("netapi32.dll")]
internal static partial uint NetUserDel([MarshalAs(UnmanagedType.LPWStr)]string servername, [MarshalAs(UnmanagedType.LPWStr)]string username);
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
[SuppressUnmanagedCodeSecurityAttribute]
internal static partial class Kernel32
{
- [GeneratedDllImport(nameof(Kernel32))]
+ [LibraryImport(nameof(Kernel32))]
internal static partial int GetCurrentThreadId();
- [GeneratedDllImport(nameof(Kernel32))]
+ [LibraryImport(nameof(Kernel32))]
internal static partial uint GetCurrentProcessId();
}
}
{
internal static partial class Helpers
{
- [GeneratedDllImport(Interop.Libraries.Advapi32, EntryPoint = "RegSetValueW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Interop.Libraries.Advapi32, EntryPoint = "RegSetValueW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
private static partial int RegSetValue(SafeRegistryHandle handle, string value, int regType, string sb, int sizeIgnored);
internal static bool SetDefaultValue(this RegistryKey key, string value)
return RegSetValue(key.Handle, null, REG_SZ, value, 0) == 0;
}
- [GeneratedDllImport(Interop.Libraries.Advapi32, EntryPoint = "RegQueryValueExW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Interop.Libraries.Advapi32, EntryPoint = "RegQueryValueExW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
private static partial int RegQueryValueEx(SafeRegistryHandle handle, string valueName, int[] reserved, IntPtr regType, byte[] value, ref int size);
internal static bool IsDefaultValueSet(this RegistryKey key)
return RegQueryValueEx(key.Handle, null, null, IntPtr.Zero, b, ref size) != ERROR_FILE_NOT_FOUND;
}
- [GeneratedDllImport(Interop.Libraries.Kernel32, EntryPoint = "SetEnvironmentVariableW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Interop.Libraries.Kernel32, EntryPoint = "SetEnvironmentVariableW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool SetEnvironmentVariable(string lpName, string lpValue);
}
}
}
- [GeneratedDllImport("libc", SetLastError = true)]
+ [LibraryImport("libc", SetLastError = true)]
private static partial int kill(int pid, int sig);
- [GeneratedDllImport("libc", SetLastError = true)]
+ [LibraryImport("libc", SetLastError = true)]
private static unsafe partial int sigaction(int signum, struct_sigaction* act, struct_sigaction* oldact);
private const int SIGINT = 2;
}).Dispose();
}
- [GeneratedDllImport("kernel32.dll")]
+ [LibraryImport("kernel32.dll")]
public static partial uint GetConsoleCP();
- [GeneratedDllImport("kernel32.dll")]
+ [LibraryImport("kernel32.dll")]
public static partial uint GetConsoleOutputCP();
}
return actualPtr;
}
- [GeneratedDllImport(Interop.Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Kernel32, SetLastError = true)]
internal static partial int ReleaseSemaphore(IntPtr handle, int releaseCount, IntPtr previousCount);
- [GeneratedDllImport(Interop.Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Kernel32, SetLastError = true)]
internal static partial int WaitForMultipleObjectsEx(uint nCount, IntPtr lpHandles, [MarshalAs(UnmanagedType.Bool)] bool bWaitAll, uint dwMilliseconds, [MarshalAs(UnmanagedType.Bool)] bool bAlertable);
- [GeneratedDllImport(Interop.Libraries.Kernel32/*, SetLastError=true*/)]
+ [LibraryImport(Interop.Libraries.Kernel32/*, SetLastError=true*/)]
internal static partial int WaitForSingleObjectEx(IntPtr lpHandles, uint dwMilliseconds, [MarshalAs(UnmanagedType.Bool)] bool bAlertable);
internal sealed class Wrapper
// Oleaut32
//
- [GeneratedDllImport(Interop.Libraries.OleAut32)]
+ [LibraryImport(Interop.Libraries.OleAut32)]
internal static unsafe partial OleDbHResult GetErrorInfo(
int dwReserved,
System.IntPtr* ppIErrorInfo);
EvtSeekStrict = 0x10000
}
- [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Wevtapi, SetLastError = true)]
internal static partial EventLogHandle EvtQuery(
EventLogHandle session,
[MarshalAs(UnmanagedType.LPWStr)] string path,
int flags);
// SEEK
- [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Wevtapi, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool EvtSeek(
EventLogHandle resultSet,
int timeout,
EvtSeekFlags flags);
- [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Wevtapi, SetLastError = true)]
internal static partial EventLogHandle EvtSubscribe(
EventLogHandle session,
SafeWaitHandle signalEvent,
IntPtr callback,
int flags);
- [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Wevtapi, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool EvtNext(
EventLogHandle queryHandle,
int flags,
ref int returned);
- [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Wevtapi, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool EvtCancel(EventLogHandle handle);
- [GeneratedDllImport(Interop.Libraries.Wevtapi)]
+ [LibraryImport(Interop.Libraries.Wevtapi)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool EvtClose(IntPtr handle);
- [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Wevtapi, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool EvtGetEventInfo(
EventLogHandle eventHandle,
IntPtr bufferPtr,
out int bufferUsed);
- [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Wevtapi, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool EvtGetQueryInfo(
EventLogHandle queryHandle,
ref int bufferRequired);
// PUBLISHER METADATA
- [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Wevtapi, SetLastError = true)]
internal static partial EventLogHandle EvtOpenPublisherMetadata(
EventLogHandle session,
[MarshalAs(UnmanagedType.LPWStr)] string publisherId,
int locale,
int flags);
- [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Wevtapi, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool EvtGetPublisherMetadataProperty(
EventLogHandle publisherMetadataHandle,
// NEW
- [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Wevtapi, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool EvtGetObjectArraySize(
EventLogHandle objectArray,
out int objectArraySize);
- [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Wevtapi, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool EvtGetObjectArrayProperty(
EventLogHandle objectArray,
out int propertyValueBufferUsed);
// NEW 2
- [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Wevtapi, SetLastError = true)]
internal static partial EventLogHandle EvtOpenEventMetadataEnum(
EventLogHandle publisherMetadata,
int flags);
- [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Wevtapi, SetLastError = true)]
internal static partial EventLogHandle EvtNextEventMetadata(
EventLogHandle eventMetadataEnum,
int flags);
- [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Wevtapi, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool EvtGetEventMetadataProperty(
EventLogHandle eventMetadata,
// Channel Configuration Native Api
- [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Wevtapi, SetLastError = true)]
internal static partial EventLogHandle EvtOpenChannelEnum(
EventLogHandle session,
int flags);
- [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Interop.Libraries.Wevtapi, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool EvtNextChannelPath(
EventLogHandle channelEnum,
[Out] char[]? channelPathBuffer,
out int channelPathBufferUsed);
- [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Wevtapi, SetLastError = true)]
internal static partial EventLogHandle EvtOpenPublisherEnum(
EventLogHandle session,
int flags);
- [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Interop.Libraries.Wevtapi, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool EvtNextPublisherId(
EventLogHandle publisherEnum,
[Out] char[]? publisherIdBuffer,
out int publisherIdBufferUsed);
- [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Wevtapi, SetLastError = true)]
internal static partial EventLogHandle EvtOpenChannelConfig(
EventLogHandle session,
[MarshalAs(UnmanagedType.LPWStr)] string channelPath,
int flags);
- [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Wevtapi, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool EvtSaveChannelConfig(
EventLogHandle channelConfig,
int flags);
- [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Wevtapi, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool EvtSetChannelConfigProperty(
EventLogHandle channelConfig,
int flags,
ref EvtVariant propertyValue);
- [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Wevtapi, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool EvtGetChannelConfigProperty(
EventLogHandle channelConfig,
// Log Information Native Api
- [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Wevtapi, SetLastError = true)]
internal static partial EventLogHandle EvtOpenLog(
EventLogHandle session,
[MarshalAs(UnmanagedType.LPWStr)] string path,
PathType flags);
- [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Wevtapi, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool EvtGetLogInfo(
EventLogHandle log,
// LOG MANIPULATION
- [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Wevtapi, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool EvtExportLog(
EventLogHandle session,
[MarshalAs(UnmanagedType.LPWStr)] string targetFilePath,
int flags);
- [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Wevtapi, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool EvtArchiveExportedLog(
EventLogHandle session,
int locale,
int flags);
- [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Wevtapi, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool EvtClearLog(
EventLogHandle session,
int flags);
// RENDERING
- [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Wevtapi, SetLastError = true)]
internal static partial EventLogHandle EvtCreateRenderContext(
int valuePathsCount,
[MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.LPWStr)]
string[] valuePaths,
EvtRenderContextFlags flags);
- [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Interop.Libraries.Wevtapi, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool EvtRender(
EventLogHandle context,
out int buffUsed,
out int propCount);
- [GeneratedDllImport(Interop.Libraries.Wevtapi, EntryPoint = "EvtRender", SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Wevtapi, EntryPoint = "EvtRender", SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool EvtRender(
EventLogHandle context,
#endif
};
- [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Interop.Libraries.Wevtapi, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool EvtFormatMessage(
EventLogHandle publisherMetadataHandle,
[Out] char[]? buffer,
out int bufferUsed);
- [GeneratedDllImport(Interop.Libraries.Wevtapi, EntryPoint = "EvtFormatMessage", SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Wevtapi, EntryPoint = "EvtFormatMessage", SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool EvtFormatMessageBuffer(
EventLogHandle publisherMetadataHandle,
out int bufferUsed);
// SESSION
- [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Wevtapi, SetLastError = true)]
internal static partial EventLogHandle EvtOpenSession(
EvtLoginClass loginClass,
ref EvtRpcLogin login,
int flags);
// BOOKMARK
- [GeneratedDllImport(Interop.Libraries.Wevtapi, EntryPoint = "EvtCreateBookmark", SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Wevtapi, EntryPoint = "EvtCreateBookmark", SetLastError = true)]
internal static partial EventLogHandle EvtCreateBookmark(
[MarshalAs(UnmanagedType.LPWStr)] string bookmarkXml);
- [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)]
+ [LibraryImport(Interop.Libraries.Wevtapi, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool EvtUpdateBookmark(
EventLogHandle bookmark,
{
internal static partial class SafeNativeMethods
{
- [GeneratedDllImport(global::Interop.Libraries.OleAut32)]
+ [LibraryImport(global::Interop.Libraries.OleAut32)]
public static partial void VariantInit(IntPtr pObject);
- [GeneratedDllImport(global::Interop.Libraries.Activeds)]
+ [LibraryImport(global::Interop.Libraries.Activeds)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool FreeADsMem(IntPtr pVoid);
ERROR_MORE_DATA = 234,
ERROR_SUCCESS = 0;
- [GeneratedDllImport(global::Interop.Libraries.Activeds, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(global::Interop.Libraries.Activeds, StringMarshalling = StringMarshalling.Utf16)]
public static unsafe partial int ADsGetLastError(out int error, char* errorBuffer, int errorBufferLength, char* nameBuffer, int nameBufferLength);
- [GeneratedDllImport(global::Interop.Libraries.Activeds, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(global::Interop.Libraries.Activeds, StringMarshalling = StringMarshalling.Utf16)]
public static partial int ADsSetLastError(int error, string? errorString, string? provider);
public class EnumVariant
ULONG Flags,
PDOMAIN_CONTROLLER_INFO* DomainControllerInfo
);*/
- [GeneratedDllImport(global::Interop.Libraries.Netapi32, EntryPoint = "DsGetDcNameW", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(global::Interop.Libraries.Netapi32, EntryPoint = "DsGetDcNameW", StringMarshalling = StringMarshalling.Utf16)]
internal static partial int DsGetDcName(
string? computerName,
string? domainName,
ULONG DcFlags,
PHANDLE RetGetDcContext
);*/
- [GeneratedDllImport(global::Interop.Libraries.Netapi32, EntryPoint = "DsGetDcOpenW", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(global::Interop.Libraries.Netapi32, EntryPoint = "DsGetDcOpenW", StringMarshalling = StringMarshalling.Utf16)]
internal static partial int DsGetDcOpen(
string? dnsName,
int optionFlags,
LPSOCKET_ADDRESS* SockAddresses,
LPTSTR* DnsHostName
);*/
- [GeneratedDllImport(global::Interop.Libraries.Netapi32, EntryPoint = "DsGetDcNextW", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(global::Interop.Libraries.Netapi32, EntryPoint = "DsGetDcNextW", StringMarshalling = StringMarshalling.Utf16)]
internal static partial int DsGetDcNext(
IntPtr getDcContextHandle,
ref IntPtr sockAddressCount,
/*void WINAPI DsGetDcClose(
HANDLE GetDcContextHandle
);*/
- [GeneratedDllImport(global::Interop.Libraries.Netapi32, EntryPoint = "DsGetDcCloseW", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(global::Interop.Libraries.Netapi32, EntryPoint = "DsGetDcCloseW", StringMarshalling = StringMarshalling.Utf16)]
internal static partial void DsGetDcClose(
IntPtr getDcContextHandle);
/*NET_API_STATUS NetApiBufferFree(
LPVOID Buffer
);*/
- [GeneratedDllImport(global::Interop.Libraries.Netapi32)]
+ [LibraryImport(global::Interop.Libraries.Netapi32)]
internal static partial int NetApiBufferFree(
IntPtr buffer);
PDNS_RECORD *ppQueryResultsSet,
PVOID *pReserved
);*/
- [GeneratedDllImport(global::Interop.Libraries.Dnsapi, EntryPoint = "DnsQuery_W", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(global::Interop.Libraries.Dnsapi, EntryPoint = "DnsQuery_W", StringMarshalling = StringMarshalling.Utf16)]
internal static partial int DnsQuery(
string recordName,
short recordType,
PDNS_RECORD pRecordList,
DNS_FREE_TYPE FreeType
);*/
- [GeneratedDllImport(global::Interop.Libraries.Dnsapi)]
+ [LibraryImport(global::Interop.Libraries.Dnsapi)]
internal static partial void DnsRecordListFree(
IntPtr dnsResultList,
[MarshalAs(UnmanagedType.Bool)] bool dnsFreeType);
/*NTSTATUS LsaConnectUntrusted(
PHANDLE LsaHandle
);*/
- [GeneratedDllImport(global::Interop.Libraries.Secur32)]
+ [LibraryImport(global::Interop.Libraries.Secur32)]
internal static partial uint LsaConnectUntrusted(
out LsaLogonProcessSafeHandle lsaHandle);
PULONG ReturnBufferLength,
PNTSTATUS ProtocolStatus
);*/
- [GeneratedDllImport(global::Interop.Libraries.Secur32)]
+ [LibraryImport(global::Interop.Libraries.Secur32)]
internal static partial uint LsaCallAuthenticationPackage(
LsaLogonProcessSafeHandle lsaHandle,
int authenticationPackage,
/*NTSTATUS LsaFreeReturnBuffer(
PVOID Buffer
);*/
- [GeneratedDllImport(global::Interop.Libraries.Secur32)]
+ [LibraryImport(global::Interop.Libraries.Secur32)]
internal static partial uint LsaFreeReturnBuffer(
IntPtr buffer);
/*NTSTATUS LsaDeregisterLogonProcess(
HANDLE LsaHandle
);*/
- [GeneratedDllImport(global::Interop.Libraries.Secur32)]
+ [LibraryImport(global::Interop.Libraries.Secur32)]
internal static partial int LsaDeregisterLogonProcess(
IntPtr lsaHandle);
DWORD lpString2,
DWORD cchCount2
);*/
- [GeneratedDllImport(global::Interop.Libraries.Kernel32, EntryPoint = "CompareStringW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(global::Interop.Libraries.Kernel32, EntryPoint = "CompareStringW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
internal static partial int CompareString(
uint locale,
uint dwCmpFlags,
internal static partial class UnsafeNativeMethods
{
- [GeneratedDllImport(global::Interop.Libraries.Activeds, EntryPoint = "ADsEncodeBinaryData", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(global::Interop.Libraries.Activeds, EntryPoint = "ADsEncodeBinaryData", StringMarshalling = StringMarshalling.Utf16)]
public static partial int ADsEncodeBinaryData(byte[] data, int length, ref IntPtr result);
- [GeneratedDllImport(global::Interop.Libraries.Activeds, EntryPoint = "FreeADsMem")]
+ [LibraryImport(global::Interop.Libraries.Activeds, EntryPoint = "FreeADsMem")]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool FreeADsMem(IntPtr pVoid);
- [GeneratedDllImport(global::Interop.Libraries.Netapi32, EntryPoint = "DsGetSiteNameW", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(global::Interop.Libraries.Netapi32, EntryPoint = "DsGetSiteNameW", StringMarshalling = StringMarshalling.Utf16)]
public static partial int DsGetSiteName(string? dcName, ref IntPtr ptr);
- [GeneratedDllImport(global::Interop.Libraries.Netapi32, EntryPoint = "DsEnumerateDomainTrustsW", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(global::Interop.Libraries.Netapi32, EntryPoint = "DsEnumerateDomainTrustsW", StringMarshalling = StringMarshalling.Utf16)]
public static partial int DsEnumerateDomainTrustsW(string serverName, int flags, out IntPtr domains, out int count);
- [GeneratedDllImport(global::Interop.Libraries.Netapi32, EntryPoint = "NetApiBufferFree")]
+ [LibraryImport(global::Interop.Libraries.Netapi32, EntryPoint = "NetApiBufferFree")]
public static partial int NetApiBufferFree(IntPtr buffer);
- [GeneratedDllImport(global::Interop.Libraries.Advapi32, EntryPoint = "LsaSetForestTrustInformation")]
+ [LibraryImport(global::Interop.Libraries.Advapi32, EntryPoint = "LsaSetForestTrustInformation")]
public static partial uint LsaSetForestTrustInformation(SafeLsaPolicyHandle handle, in global::Interop.UNICODE_STRING target, IntPtr forestTrustInfo, int checkOnly, out IntPtr collisionInfo);
- [GeneratedDllImport(global::Interop.Libraries.Advapi32, EntryPoint = "LsaQueryForestTrustInformation")]
+ [LibraryImport(global::Interop.Libraries.Advapi32, EntryPoint = "LsaQueryForestTrustInformation")]
public static partial uint LsaQueryForestTrustInformation(SafeLsaPolicyHandle handle, in global::Interop.UNICODE_STRING target, ref IntPtr ForestTrustInfo);
- [GeneratedDllImport(global::Interop.Libraries.Advapi32, EntryPoint = "LsaQueryTrustedDomainInfoByName")]
+ [LibraryImport(global::Interop.Libraries.Advapi32, EntryPoint = "LsaQueryTrustedDomainInfoByName")]
public static partial uint LsaQueryTrustedDomainInfoByName(SafeLsaPolicyHandle handle, in global::Interop.UNICODE_STRING trustedDomain, TRUSTED_INFORMATION_CLASS infoClass, ref IntPtr buffer);
- [GeneratedDllImport(global::Interop.Libraries.Advapi32, EntryPoint = "LsaSetTrustedDomainInfoByName")]
+ [LibraryImport(global::Interop.Libraries.Advapi32, EntryPoint = "LsaSetTrustedDomainInfoByName")]
public static partial uint LsaSetTrustedDomainInfoByName(SafeLsaPolicyHandle handle, in global::Interop.UNICODE_STRING trustedDomain, TRUSTED_INFORMATION_CLASS infoClass, IntPtr buffer);
- [GeneratedDllImport(global::Interop.Libraries.Advapi32, EntryPoint = "LsaDeleteTrustedDomain")]
+ [LibraryImport(global::Interop.Libraries.Advapi32, EntryPoint = "LsaDeleteTrustedDomain")]
public static partial uint LsaDeleteTrustedDomain(SafeLsaPolicyHandle handle, IntPtr pSid);
- [GeneratedDllImport(global::Interop.Libraries.Netapi32, EntryPoint = "I_NetLogonControl2", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(global::Interop.Libraries.Netapi32, EntryPoint = "I_NetLogonControl2", StringMarshalling = StringMarshalling.Utf16)]
public static partial int I_NetLogonControl2(string serverName, int FunctionCode, int QueryLevel, IntPtr data, out IntPtr buffer);
- [GeneratedDllImport(global::Interop.Libraries.Kernel32, EntryPoint = "GetSystemTimeAsFileTime")]
+ [LibraryImport(global::Interop.Libraries.Kernel32, EntryPoint = "GetSystemTimeAsFileTime")]
public static partial void GetSystemTimeAsFileTime(IntPtr fileTime);
- [GeneratedDllImport(global::Interop.Libraries.Advapi32, EntryPoint = "LsaCreateTrustedDomainEx")]
+ [LibraryImport(global::Interop.Libraries.Advapi32, EntryPoint = "LsaCreateTrustedDomainEx")]
public static partial uint LsaCreateTrustedDomainEx(SafeLsaPolicyHandle handle, in TRUSTED_DOMAIN_INFORMATION_EX domainEx, in TRUSTED_DOMAIN_AUTH_INFORMATION authInfo, int classInfo, out IntPtr domainHandle);
- [GeneratedDllImport(global::Interop.Libraries.Kernel32, EntryPoint = "OpenThread", SetLastError = true)]
+ [LibraryImport(global::Interop.Libraries.Kernel32, EntryPoint = "OpenThread", SetLastError = true)]
public static partial IntPtr OpenThread(uint desiredAccess, [MarshalAs(UnmanagedType.Bool)] bool inheirted, int threadID);
- [GeneratedDllImport(global::Interop.Libraries.Advapi32, EntryPoint = "ImpersonateAnonymousToken", SetLastError = true)]
+ [LibraryImport(global::Interop.Libraries.Advapi32, EntryPoint = "ImpersonateAnonymousToken", SetLastError = true)]
public static partial int ImpersonateAnonymousToken(IntPtr token);
- [GeneratedDllImport(global::Interop.Libraries.NtDll, EntryPoint = "RtlInitUnicodeString")]
+ [LibraryImport(global::Interop.Libraries.NtDll, EntryPoint = "RtlInitUnicodeString")]
public static partial int RtlInitUnicodeString(out global::Interop.UNICODE_STRING result, IntPtr s);
/*
PBYTE* Buffer
); */
- [GeneratedDllImport(global::Interop.Libraries.Netapi32, EntryPoint = "DsRoleGetPrimaryDomainInformation", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(global::Interop.Libraries.Netapi32, EntryPoint = "DsRoleGetPrimaryDomainInformation", StringMarshalling = StringMarshalling.Utf16)]
public static partial int DsRoleGetPrimaryDomainInformation(
[MarshalAs(UnmanagedType.LPTStr)] string lpServer,
DSROLE_PRIMARY_DOMAIN_INFO_LEVEL InfoLevel,
out IntPtr Buffer);
- [GeneratedDllImport(global::Interop.Libraries.Netapi32, EntryPoint = "DsRoleGetPrimaryDomainInformation", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(global::Interop.Libraries.Netapi32, EntryPoint = "DsRoleGetPrimaryDomainInformation", StringMarshalling = StringMarshalling.Utf16)]
public static partial int DsRoleGetPrimaryDomainInformation(
IntPtr lpServer,
DSROLE_PRIMARY_DOMAIN_INFO_LEVEL InfoLevel,
PVOID Buffer
);
*/
- [GeneratedDllImport(global::Interop.Libraries.Netapi32)]
+ [LibraryImport(global::Interop.Libraries.Netapi32)]
public static partial int DsRoleFreeMemory(
IntPtr buffer);
}
{
internal static partial class Comdlg32
{
- [GeneratedDllImport(Libraries.Comdlg32, EntryPoint="PrintDlgW", SetLastError = true)]
+ [LibraryImport(Libraries.Comdlg32, EntryPoint="PrintDlgW", SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool PrintDlg(ref PRINTDLG lppd);
- [GeneratedDllImport(Libraries.Comdlg32, EntryPoint="PrintDlgW", SetLastError = true)]
+ [LibraryImport(Libraries.Comdlg32, EntryPoint="PrintDlgW", SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool PrintDlg(ref PRINTDLGX86 lppd);
internal const int CHECKJPEGFORMAT = 4119;
internal const int CHECKPNGFORMAT = 4120;
- [GeneratedDllImport(Libraries.Gdi32, SetLastError = true)]
+ [LibraryImport(Libraries.Gdi32, SetLastError = true)]
internal static partial IntPtr CreateCompatibleBitmap(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef hDC, int width, int height);
- [GeneratedDllImport(Libraries.Gdi32)]
+ [LibraryImport(Libraries.Gdi32)]
internal static partial int GetDIBits(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef hbm, int arg1, int arg2, IntPtr arg3, ref BITMAPINFO_FLAT bmi, int arg5);
- [GeneratedDllImport(Libraries.Gdi32)]
+ [LibraryImport(Libraries.Gdi32)]
internal static partial uint GetPaletteEntries(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef hpal, int iStartIndex, int nEntries, byte[] lppe);
- [GeneratedDllImport(Libraries.Gdi32, SetLastError = true)]
+ [LibraryImport(Libraries.Gdi32, SetLastError = true)]
internal static partial IntPtr CreateDIBSection(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef hdc, ref BITMAPINFO_FLAT bmi, int iUsage, ref IntPtr ppvBits, IntPtr hSection, int dwOffset);
- [GeneratedDllImport(Libraries.Gdi32, EntryPoint = "StartDocW", SetLastError = true)]
+ [LibraryImport(Libraries.Gdi32, EntryPoint = "StartDocW", SetLastError = true)]
internal static partial int StartDoc(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef hDC, DOCINFO lpDocInfo);
- [GeneratedDllImport(Libraries.Gdi32, SetLastError = true)]
+ [LibraryImport(Libraries.Gdi32, SetLastError = true)]
internal static partial int StartPage(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef hDC);
- [GeneratedDllImport(Libraries.Gdi32, SetLastError = true)]
+ [LibraryImport(Libraries.Gdi32, SetLastError = true)]
internal static partial int EndPage(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef hDC);
- [GeneratedDllImport(Libraries.Gdi32, SetLastError = true)]
+ [LibraryImport(Libraries.Gdi32, SetLastError = true)]
internal static partial int AbortDoc(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef hDC);
- [GeneratedDllImport(Libraries.Gdi32, SetLastError = true)]
+ [LibraryImport(Libraries.Gdi32, SetLastError = true)]
internal static partial int EndDoc(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef hDC);
- [GeneratedDllImport(Libraries.Gdi32, EntryPoint = "ResetDCW", SetLastError = true)]
+ [LibraryImport(Libraries.Gdi32, EntryPoint = "ResetDCW", SetLastError = true)]
internal static partial IntPtr /*HDC*/ ResetDC(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef /*DEVMODE*/ lpDevMode);
- [GeneratedDllImport(Libraries.Gdi32, EntryPoint = "AddFontResourceExW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Gdi32, EntryPoint = "AddFontResourceExW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
internal static partial int AddFontResourceEx(string lpszFilename, int fl, IntPtr pdv);
internal static int AddFontFile(string fileName)
return AddFontResourceEx(fileName, /*FR_PRIVATE*/ 0x10, IntPtr.Zero);
}
- [GeneratedDllImport(Libraries.Gdi32, SetLastError = true)]
+ [LibraryImport(Libraries.Gdi32, SetLastError = true)]
internal static partial int ExtEscape(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef hDC, int nEscape, int cbInput, ref int inData, int cbOutput, out int outData);
- [GeneratedDllImport(Libraries.Gdi32, SetLastError = true)]
+ [LibraryImport(Libraries.Gdi32, SetLastError = true)]
internal static partial int ExtEscape(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef hDC, int nEscape, int cbInput, byte[] inData, int cbOutput, out int outData);
- [GeneratedDllImport(Libraries.Gdi32, SetLastError = true)]
+ [LibraryImport(Libraries.Gdi32, SetLastError = true)]
internal static partial int IntersectClipRect(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef hDC, int x1, int y1, int x2, int y2);
- [GeneratedDllImport(Libraries.Gdi32, EntryPoint = "GetObjectW", SetLastError = true)]
+ [LibraryImport(Libraries.Gdi32, EntryPoint = "GetObjectW", SetLastError = true)]
internal static partial int GetObject(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef hObject, int nSize, ref BITMAP bm);
- [GeneratedDllImport(Libraries.Gdi32, EntryPoint = "GetObjectW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Gdi32, EntryPoint = "GetObjectW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
internal static partial int GetObject(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
{
internal static partial class Kernel32
{
- [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, SetLastError = true)]
public static partial int GetSystemDefaultLCID();
- [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "GlobalAlloc", SetLastError = true)]
+ [LibraryImport(Libraries.Kernel32, EntryPoint = "GlobalAlloc", SetLastError = true)]
internal static partial IntPtr IntGlobalAlloc(int uFlags, UIntPtr dwBytes); // size should be 32/64bits compatible
internal static IntPtr GlobalAlloc(int uFlags, uint dwBytes)
return IntGlobalAlloc(uFlags, new UIntPtr(dwBytes));
}
- [GeneratedDllImport(Libraries.Gdi32, SetLastError = true)]
+ [LibraryImport(Libraries.Gdi32, SetLastError = true)]
internal static partial IntPtr SelectObject(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
{
internal static partial class Shell32
{
- [GeneratedDllImport(Libraries.Shell32, EntryPoint = "ExtractAssociatedIconW")]
+ [LibraryImport(Libraries.Shell32, EntryPoint = "ExtractAssociatedIconW")]
internal static unsafe partial IntPtr ExtractAssociatedIcon(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
{
internal static partial class User32
{
- [GeneratedDllImport(Libraries.User32, EntryPoint = "LoadIconW", SetLastError = true)]
+ [LibraryImport(Libraries.User32, EntryPoint = "LoadIconW", SetLastError = true)]
internal static partial IntPtr LoadIcon(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef hInst, IntPtr iconId);
- [GeneratedDllImport(Libraries.User32, SetLastError = true)]
+ [LibraryImport(Libraries.User32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool DestroyIcon(
#if NET7_0_OR_GREATER
#endif
HandleRef hIcon);
- [GeneratedDllImport(Libraries.User32, SetLastError = true)]
+ [LibraryImport(Libraries.User32, SetLastError = true)]
internal static partial IntPtr CopyImage(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef hImage, int uType, int cxDesired, int cyDesired, int fuFlags);
- [GeneratedDllImport(Libraries.User32, SetLastError = true)]
+ [LibraryImport(Libraries.User32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool GetIconInfo(
#if NET7_0_OR_GREATER
#endif
HandleRef hIcon, ref ICONINFO info);
- [GeneratedDllImport(Libraries.User32, SetLastError = true)]
+ [LibraryImport(Libraries.User32, SetLastError = true)]
public static partial int GetSystemMetrics(int nIndex);
- [GeneratedDllImport(Libraries.User32, SetLastError = true)]
+ [LibraryImport(Libraries.User32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool DrawIconEx(
#if NET7_0_OR_GREATER
#endif
HandleRef hBrushFlickerFree, int diFlags);
- [GeneratedDllImport(Libraries.User32, SetLastError = true)]
+ [LibraryImport(Libraries.User32, SetLastError = true)]
internal static unsafe partial IntPtr CreateIconFromResourceEx(byte* pbIconBits, uint cbIconBits, [MarshalAs(UnmanagedType.Bool)] bool fIcon, int dwVersion, int csDesired, int cyDesired, int flags);
[StructLayout(LayoutKind.Sequential)]
{
internal static partial class Winspool
{
- [GeneratedDllImport(Libraries.Winspool, EntryPoint = "DeviceCapabilitiesW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Winspool, EntryPoint = "DeviceCapabilitiesW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
internal static partial int DeviceCapabilities(string pDevice, string pPort, short fwCapabilities, IntPtr pOutput, IntPtr /*DEVMODE*/ pDevMode);
- [GeneratedDllImport(Libraries.Winspool, EntryPoint = "DocumentPropertiesW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Winspool, EntryPoint = "DocumentPropertiesW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
internal static partial int DocumentProperties(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef /*DEVMODE*/ pDevModeInput, int fMode);
- [GeneratedDllImport(Libraries.Winspool, EntryPoint = "DocumentPropertiesW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Winspool, EntryPoint = "DocumentPropertiesW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
internal static partial int DocumentProperties(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef hPrinter, string pDeviceName, IntPtr /*DEVMODE*/ pDevModeOutput, IntPtr /*DEVMODE*/ pDevModeInput, int fMode);
- [GeneratedDllImport(Libraries.Winspool, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Winspool, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
internal static partial int EnumPrinters(int flags, string? name, int level, IntPtr pPrinterEnum/*buffer*/, int cbBuf, out int pcbNeeded, out int pcReturned);
}
}
}
// Imported functions
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdiplusStartup(out IntPtr token, in StartupInputEx input, out StartupOutput output);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial void GdiplusShutdown(ref ulong token);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial IntPtr GdipAlloc(int size);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial void GdipFree(IntPtr ptr);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipDeleteBrush(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef brush);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetBrushType(IntPtr brush, out BrushType type);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipDeleteGraphics(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef graphics);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipRestoreGraphics(IntPtr graphics, uint graphicsState);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipReleaseDC(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef hdc);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipFillPath(IntPtr graphics, IntPtr brush, IntPtr path);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetNearestColor(IntPtr graphics, out int argb);
- [GeneratedDllImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
internal static partial int GdipAddPathString(IntPtr path, string s, int lenght, IntPtr family, int style, float emSize, ref RectangleF layoutRect, IntPtr format);
- [GeneratedDllImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
internal static partial int GdipAddPathStringI(IntPtr path, string s, int lenght, IntPtr family, int style, float emSize, ref Rectangle layoutRect, IntPtr format);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipCreateFromHWND(IntPtr hwnd, out IntPtr graphics);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipCloneImage(IntPtr image, out IntPtr imageclone);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetImagePaletteSize(IntPtr image, out int size);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetImagePalette(IntPtr image, IntPtr palette, int size);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipSetImagePalette(IntPtr image, IntPtr palette);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetImageBounds(IntPtr image, out RectangleF source, ref GraphicsUnit unit);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetImageThumbnail(IntPtr image, uint width, uint height, out IntPtr thumbImage, IntPtr callback, IntPtr callBackData);
- [GeneratedDllImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
internal static partial int GdipSaveImageToFile(IntPtr image, string filename, ref Guid encoderClsID, IntPtr encoderParameters);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipSaveAdd(IntPtr image, IntPtr encoderParameters);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipSaveAddImage(IntPtr image, IntPtr imagenew, IntPtr encoderParameters);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetImageGraphicsContext(IntPtr image, out IntPtr graphics);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipCreatePath(FillMode brushMode, out IntPtr path);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipCreatePath2(PointF[] points, byte[] types, int count, FillMode brushMode, out IntPtr path);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipCreatePath2I(Point[] points, byte[] types, int count, FillMode brushMode, out IntPtr path);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipClonePath(IntPtr path, out IntPtr clonePath);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipDeletePath(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef path);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipResetPath(IntPtr path);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetPointCount(IntPtr path, out int count);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetPathTypes(IntPtr path, byte[] types, int count);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetPathPoints(IntPtr path, PointF[] points, int count);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetPathPointsI(IntPtr path, Point[] points, int count);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetPathFillMode(IntPtr path, out FillMode fillMode);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipSetPathFillMode(IntPtr path, FillMode fillMode);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipStartPathFigure(IntPtr path);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipClosePathFigure(IntPtr path);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipClosePathFigures(IntPtr path);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipSetPathMarker(IntPtr path);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipClearPathMarkers(IntPtr path);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipReversePath(IntPtr path);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetPathLastPoint(IntPtr path, out PointF lastPoint);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipAddPathLine(IntPtr path, float x1, float y1, float x2, float y2);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipAddPathLine2(IntPtr path, PointF[] points, int count);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipAddPathLine2I(IntPtr path, Point[] points, int count);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipAddPathArc(IntPtr path, float x, float y, float width, float height, float startAngle, float sweepAngle);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipAddPathBezier(IntPtr path, float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipAddPathBeziers(IntPtr path, PointF[] points, int count);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipAddPathCurve(IntPtr path, PointF[] points, int count);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipAddPathCurveI(IntPtr path, Point[] points, int count);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipAddPathCurve2(IntPtr path, PointF[] points, int count, float tension);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipAddPathCurve2I(IntPtr path, Point[] points, int count, float tension);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipAddPathCurve3(IntPtr path, PointF[] points, int count, int offset, int numberOfSegments, float tension);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipAddPathCurve3I(IntPtr path, Point[] points, int count, int offset, int numberOfSegments, float tension);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipAddPathClosedCurve(IntPtr path, PointF[] points, int count);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipAddPathClosedCurveI(IntPtr path, Point[] points, int count);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipAddPathClosedCurve2(IntPtr path, PointF[] points, int count, float tension);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipAddPathClosedCurve2I(IntPtr path, Point[] points, int count, float tension);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipAddPathRectangle(IntPtr path, float x, float y, float width, float height);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipAddPathRectangles(IntPtr path, RectangleF[] rects, int count);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipAddPathEllipse(IntPtr path, float x, float y, float width, float height);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipAddPathEllipseI(IntPtr path, int x, int y, int width, int height);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipAddPathPie(IntPtr path, float x, float y, float width, float height, float startAngle, float sweepAngle);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipAddPathPieI(IntPtr path, int x, int y, int width, int height, float startAngle, float sweepAngle);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipAddPathPolygon(IntPtr path, PointF[] points, int count);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipAddPathPath(IntPtr path, IntPtr addingPath, [MarshalAs(UnmanagedType.Bool)] bool connect);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipAddPathLineI(IntPtr path, int x1, int y1, int x2, int y2);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipAddPathArcI(IntPtr path, int x, int y, int width, int height, float startAngle, float sweepAngle);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipAddPathBezierI(IntPtr path, int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipAddPathBeziersI(IntPtr path, Point[] points, int count);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipAddPathPolygonI(IntPtr path, Point[] points, int count);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipAddPathRectangleI(IntPtr path, int x, int y, int width, int height);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipAddPathRectanglesI(IntPtr path, Rectangle[] rects, int count);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipFlattenPath(IntPtr path, IntPtr matrix, float floatness);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipTransformPath(IntPtr path, IntPtr matrix);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipWarpPath(IntPtr path, IntPtr matrix, PointF[] points, int count, float srcx, float srcy, float srcwidth, float srcheight, WarpMode mode, float flatness);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipWidenPath(IntPtr path, IntPtr pen, IntPtr matrix, float flatness);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetPathWorldBounds(IntPtr path, out RectangleF bounds, IntPtr matrix, IntPtr pen);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetPathWorldBoundsI(IntPtr path, out Rectangle bounds, IntPtr matrix, IntPtr pen);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipIsVisiblePathPoint(IntPtr path, float x, float y, IntPtr graphics, [MarshalAs(UnmanagedType.Bool)] out bool result);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipIsVisiblePathPointI(IntPtr path, int x, int y, IntPtr graphics, [MarshalAs(UnmanagedType.Bool)] out bool result);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipIsOutlineVisiblePathPoint(IntPtr path, float x, float y, IntPtr pen, IntPtr graphics, [MarshalAs(UnmanagedType.Bool)] out bool result);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipIsOutlineVisiblePathPointI(IntPtr path, int x, int y, IntPtr pen, IntPtr graphics, [MarshalAs(UnmanagedType.Bool)] out bool result);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipCreateFontFromLogfont(IntPtr hdc, ref Interop.User32.LOGFONT lf, out IntPtr ptr);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipCreateFontFromHfont(IntPtr hdc, out IntPtr font, ref Interop.User32.LOGFONT lf);
- [GeneratedDllImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
internal static partial int GdipGetMetafileHeaderFromFile(string filename, IntPtr header);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetMetafileHeaderFromMetafile(IntPtr metafile, IntPtr header);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetMetafileHeaderFromEmf(IntPtr hEmf, IntPtr header);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetMetafileHeaderFromWmf(IntPtr hWmf, IntPtr wmfPlaceableFileHeader, IntPtr header);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetHemfFromMetafile(IntPtr metafile, out IntPtr hEmf);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetMetafileDownLevelRasterizationLimit(IntPtr metafile, ref uint metafileRasterizationLimitDpi);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipSetMetafileDownLevelRasterizationLimit(IntPtr metafile, uint metafileRasterizationLimitDpi);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipCreateFromContext_macosx(IntPtr cgref, int width, int height, out IntPtr graphics);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipSetVisibleClip_linux(IntPtr graphics, ref Rectangle rect);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipCreateFromXDrawable_linux(IntPtr drawable, IntPtr display, out IntPtr graphics);
// Stream functions for non-Win32 (libgdiplus specific)
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipLoadImageFromDelegate_linux(StreamGetHeaderDelegate getHeader,
StreamGetBytesDelegate getBytes, StreamPutBytesDelegate putBytes, StreamSeekDelegate doSeek,
StreamCloseDelegate close, StreamSizeDelegate size, out IntPtr image);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipSaveImageToDelegate_linux(IntPtr image, StreamGetBytesDelegate getBytes,
StreamPutBytesDelegate putBytes, StreamSeekDelegate doSeek, StreamCloseDelegate close,
StreamSizeDelegate size, ref Guid encoderClsID, IntPtr encoderParameters);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipCreateMetafileFromDelegate_linux(StreamGetHeaderDelegate getHeader,
StreamGetBytesDelegate getBytes, StreamPutBytesDelegate putBytes, StreamSeekDelegate doSeek,
StreamCloseDelegate close, StreamSizeDelegate size, out IntPtr metafile);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetMetafileHeaderFromDelegate_linux(StreamGetHeaderDelegate getHeader,
StreamGetBytesDelegate getBytes, StreamPutBytesDelegate putBytes, StreamSeekDelegate doSeek,
StreamCloseDelegate close, StreamSizeDelegate size, IntPtr header);
- [GeneratedDllImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
internal static partial int GdipRecordMetafileFromDelegate_linux(StreamGetHeaderDelegate getHeader,
StreamGetBytesDelegate getBytes, StreamPutBytesDelegate putBytes, StreamSeekDelegate doSeek,
StreamCloseDelegate close, StreamSizeDelegate size, IntPtr hdc, EmfType type, ref RectangleF frameRect,
MetafileFrameUnit frameUnit, string? description, out IntPtr metafile);
- [GeneratedDllImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
internal static partial int GdipRecordMetafileFromDelegateI_linux(StreamGetHeaderDelegate getHeader,
StreamGetBytesDelegate getBytes, StreamPutBytesDelegate putBytes, StreamSeekDelegate doSeek,
StreamCloseDelegate close, StreamSizeDelegate size, IntPtr hdc, EmfType type, ref Rectangle frameRect,
MetafileFrameUnit frameUnit, string? description, out IntPtr metafile);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetPostScriptGraphicsContext(
[MarshalAs(UnmanagedType.LPStr)] string filename,
int width, int height, double dpix, double dpiy, ref IntPtr graphics);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetPostScriptSavePage(IntPtr graphics);
}
}
}
// Imported functions
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
private static partial int GdiplusStartup(out IntPtr token, in StartupInputEx input, out StartupOutput output);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipCreatePath(int brushMode, out IntPtr path);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipCreatePath2(PointF* points, byte* types, int count, int brushMode, out IntPtr path);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipCreatePath2I(Point* points, byte* types, int count, int brushMode, out IntPtr path);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipClonePath(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef path, out IntPtr clonepath);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipDeletePath(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef path);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipResetPath(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef path);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetPointCount(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef path, out int count);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetPathTypes(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef path, byte[] types, int count);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetPathPoints(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef path, PointF* points, int count);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetPathFillMode(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef path, out FillMode fillmode);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipSetPathFillMode(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef path, FillMode fillmode);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetPathData(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef path, GpPathData* pathData);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipStartPathFigure(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef path);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipClosePathFigure(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef path);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipClosePathFigures(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef path);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipSetPathMarker(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef path);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipClearPathMarkers(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef path);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipReversePath(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef path);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetPathLastPoint(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef path, out PointF lastPoint);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipAddPathLine(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef path, float x1, float y1, float x2, float y2);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipAddPathLine2(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef path, PointF* points, int count);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipAddPathArc(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef path, float x, float y, float width, float height, float startAngle, float sweepAngle);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipAddPathBezier(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef path, float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipAddPathBeziers(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef path, PointF* points, int count);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipAddPathCurve(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef path, PointF* points, int count);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipAddPathCurve2(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef path, PointF* points, int count, float tension);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipAddPathCurve3(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef path, PointF* points, int count, int offset, int numberOfSegments, float tension);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipAddPathClosedCurve(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef path, PointF* points, int count);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipAddPathClosedCurve2(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef path, PointF* points, int count, float tension);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipAddPathRectangle(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef path, float x, float y, float width, float height);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipAddPathRectangles(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef path, RectangleF* rects, int count);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipAddPathEllipse(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef path, float x, float y, float width, float height);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipAddPathPie(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef path, float x, float y, float width, float height, float startAngle, float sweepAngle);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipAddPathPolygon(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef path, PointF* points, int count);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipAddPathPath(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef addingPath, [MarshalAs(UnmanagedType.Bool)] bool connect);
- [GeneratedDllImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
internal static partial int GdipAddPathString(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef format);
- [GeneratedDllImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
internal static partial int GdipAddPathStringI(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef format);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipAddPathLineI(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef path, int x1, int y1, int x2, int y2);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipAddPathLine2I(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef path, Point* points, int count);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipAddPathArcI(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef path, int x, int y, int width, int height, float startAngle, float sweepAngle);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipAddPathBezierI(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef path, int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipAddPathBeziersI(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef path, Point* points, int count);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipAddPathCurveI(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef path, Point* points, int count);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipAddPathCurve2I(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef path, Point* points, int count, float tension);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipAddPathCurve3I(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef path, Point* points, int count, int offset, int numberOfSegments, float tension);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipAddPathClosedCurveI(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef path, Point* points, int count);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipAddPathClosedCurve2I(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef path, Point* points, int count, float tension);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipAddPathRectangleI(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef path, int x, int y, int width, int height);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipAddPathRectanglesI(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef path, Rectangle* rects, int count);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipAddPathEllipseI(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef path, int x, int y, int width, int height);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipAddPathPieI(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef path, int x, int y, int width, int height, float startAngle, float sweepAngle);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipAddPathPolygonI(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef path, Point* points, int count);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipFlattenPath(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef matrixfloat, float flatness);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipWidenPath(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef matrix, float flatness);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipWarpPath(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef matrix, PointF* points, int count, float srcX, float srcY, float srcWidth, float srcHeight, WarpMode warpMode, float flatness);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipTransformPath(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef matrix);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetPathWorldBounds(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef pen);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipIsVisiblePathPoint(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef graphics, [MarshalAs(UnmanagedType.Bool)] out bool result);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipIsVisiblePathPointI(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef graphics, [MarshalAs(UnmanagedType.Bool)] out bool result);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipIsOutlineVisiblePathPoint(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef graphics, [MarshalAs(UnmanagedType.Bool)] out bool result);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipIsOutlineVisiblePathPointI(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef graphics, [MarshalAs(UnmanagedType.Bool)] out bool result);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipDeleteBrush(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef brush);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipLoadImageFromStream(IntPtr stream, IntPtr* image);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipLoadImageFromStreamICM(IntPtr stream, IntPtr* image);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipCloneImage(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef image, out IntPtr cloneimage);
- [GeneratedDllImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
internal static partial int GdipSaveImageToFile(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef encoderParams);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipSaveImageToStream(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef encoderParams);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipSaveAdd(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef encoderParams);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipSaveAddImage(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef encoderParams);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetImageGraphicsContext(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef image, out IntPtr graphics);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetImageBounds(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef image, out RectangleF gprectf, out GraphicsUnit unit);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetImageThumbnail(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef image, int thumbWidth, int thumbHeight, out IntPtr thumbImage, Image.GetThumbnailImageAbort? callback, IntPtr callbackdata);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetImagePalette(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef image, IntPtr palette, int size);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipSetImagePalette(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef image, IntPtr palette);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetImagePaletteSize(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef image, out int size);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipImageForceValidation(IntPtr image);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipCreateFromHDC2(IntPtr hdc, IntPtr hdevice, out IntPtr graphics);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipCreateFromHWND(IntPtr hwnd, out IntPtr graphics);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipDeleteGraphics(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef graphics);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipReleaseDC(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef graphics, IntPtr hdc);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetNearestColor(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef graphics, ref int color);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial IntPtr GdipCreateHalftonePalette();
- [GeneratedDllImport(LibraryName, SetLastError = true)]
+ [LibraryImport(LibraryName, SetLastError = true)]
internal static partial int GdipDrawBeziers(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef pen, PointF* points, int count);
- [GeneratedDllImport(LibraryName, SetLastError = true)]
+ [LibraryImport(LibraryName, SetLastError = true)]
internal static partial int GdipDrawBeziersI(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef pen, Point* points, int count);
- [GeneratedDllImport(LibraryName, SetLastError = true)]
+ [LibraryImport(LibraryName, SetLastError = true)]
internal static partial int GdipFillPath(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef path);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipEnumerateMetafileDestPoint(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef imageattributes);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipEnumerateMetafileDestPointI(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef imageattributes);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipEnumerateMetafileDestRect(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef imageattributes);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipEnumerateMetafileDestRectI(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef imageattributes);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipEnumerateMetafileDestPoints(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef imageattributes);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipEnumerateMetafileDestPointsI(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef imageattributes);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipEnumerateMetafileSrcRectDestPoint(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef imageattributes);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipEnumerateMetafileSrcRectDestPointI(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef imageattributes);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipEnumerateMetafileSrcRectDestRect(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef imageattributes);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipEnumerateMetafileSrcRectDestRectI(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef imageattributes);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipEnumerateMetafileSrcRectDestPoints(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef imageattributes);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipEnumerateMetafileSrcRectDestPointsI(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef imageattributes);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipRestoreGraphics(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef graphics, int state);
- [GeneratedDllImport(LibraryName, EntryPoint = "GdipGetMetafileHeaderFromWmf")]
+ [LibraryImport(LibraryName, EntryPoint = "GdipGetMetafileHeaderFromWmf")]
private static partial int GdipGetMetafileHeaderFromWmf_Internal(IntPtr hMetafile,
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(WmfPlaceableFileHeader.PinningMarshaller))]
);
}
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetMetafileHeaderFromEmf(IntPtr hEnhMetafile, MetafileHeaderEmf metafileHeaderEmf);
- [GeneratedDllImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
internal static partial int GdipGetMetafileHeaderFromFile(string filename, IntPtr header);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetMetafileHeaderFromStream(IntPtr stream, IntPtr header);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetMetafileHeaderFromMetafile(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef metafile, IntPtr header);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetHemfFromMetafile(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef metafile, out IntPtr hEnhMetafile);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipCreateMetafileFromStream(IntPtr stream, IntPtr* metafile);
- [GeneratedDllImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
internal static partial int GdipRecordMetafileStream(IntPtr stream, IntPtr referenceHdc, EmfType emfType, RectangleF* frameRect, MetafileFrameUnit frameUnit, string? description, IntPtr* metafile);
- [GeneratedDllImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
internal static partial int GdipRecordMetafileStream(IntPtr stream, IntPtr referenceHdc, EmfType emfType, IntPtr pframeRect, MetafileFrameUnit frameUnit, string? description, IntPtr* metafile);
- [GeneratedDllImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
internal static partial int GdipRecordMetafileStreamI(IntPtr stream, IntPtr referenceHdc, EmfType emfType, Rectangle* frameRect, MetafileFrameUnit frameUnit, string? description, IntPtr* metafile);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipComment(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef graphics, int sizeData, byte[] data);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipCreateFontFromLogfontW(IntPtr hdc, ref Interop.User32.LOGFONT lf, out IntPtr font);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipCreateBitmapFromStream(IntPtr stream, IntPtr* bitmap);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipCreateBitmapFromStreamICM(IntPtr stream, IntPtr* bitmap);
}
}
internal static unsafe partial class Gdip
{
// Shared function imports (all platforms)
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipBeginContainer(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef graphics, ref RectangleF dstRect, ref RectangleF srcRect, GraphicsUnit unit, out int state);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipBeginContainer2(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef graphics, out int state);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipBeginContainerI(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef graphics, ref Rectangle dstRect, ref Rectangle srcRect, GraphicsUnit unit, out int state);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipEndContainer(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef graphics, int state);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipCreateAdjustableArrowCap(float height, float width, [MarshalAs(UnmanagedType.Bool)] bool isFilled, out IntPtr adjustableArrowCap);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetAdjustableArrowCapHeight(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef adjustableArrowCap, out float height);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipSetAdjustableArrowCapHeight(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef adjustableArrowCap, float height);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipSetAdjustableArrowCapWidth(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef adjustableArrowCap, float width);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetAdjustableArrowCapWidth(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef adjustableArrowCap, out float width);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipSetAdjustableArrowCapMiddleInset(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef adjustableArrowCap, float middleInset);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetAdjustableArrowCapMiddleInset(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef adjustableArrowCap, out float middleInset);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipSetAdjustableArrowCapFillState(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef adjustableArrowCap, [MarshalAs(UnmanagedType.Bool)] bool fillState);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetAdjustableArrowCapFillState(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef adjustableArrowCap, [MarshalAs(UnmanagedType.Bool)] out bool fillState);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetCustomLineCapType(IntPtr customCap, out CustomLineCapType capType);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipCreateCustomLineCap(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef strokepath, LineCap baseCap, float baseInset, out IntPtr customCap);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipDeleteCustomLineCap(IntPtr customCap);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipDeleteCustomLineCap(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef customCap);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipCloneCustomLineCap(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef customCap, out IntPtr clonedCap);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipSetCustomLineCapStrokeCaps(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef customCap, LineCap startCap, LineCap endCap);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetCustomLineCapStrokeCaps(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef customCap, out LineCap startCap, out LineCap endCap);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipSetCustomLineCapStrokeJoin(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef customCap, LineJoin lineJoin);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetCustomLineCapStrokeJoin(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef customCap, out LineJoin lineJoin);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipSetCustomLineCapBaseCap(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef customCap, LineCap baseCap);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetCustomLineCapBaseCap(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef customCap, out LineCap baseCap);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipSetCustomLineCapBaseInset(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef customCap, float inset);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetCustomLineCapBaseInset(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef customCap, out float inset);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipSetCustomLineCapWidthScale(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef customCap, float widthScale);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetCustomLineCapWidthScale(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef customCap, out float widthScale);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipCreatePathIter(out IntPtr pathIter,
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef path);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipDeletePathIter(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef pathIter);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipPathIterNextSubpath(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef pathIter, out int resultCount, out int startIndex, out int endIndex, [MarshalAs(UnmanagedType.Bool)] out bool isClosed);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipPathIterNextSubpathPath(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef path, [MarshalAs(UnmanagedType.Bool)] out bool isClosed);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipPathIterNextPathType(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef pathIter, out int resultCount, out byte pathType, out int startIndex, out int endIndex);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipPathIterNextMarker(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef pathIter, out int resultCount, out int startIndex, out int endIndex);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipPathIterNextMarkerPath(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef path);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipPathIterGetCount(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef pathIter, out int count);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipPathIterGetSubpathCount(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef pathIter, out int count);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipPathIterHasCurve(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef pathIter, [MarshalAs(UnmanagedType.Bool)] out bool hasCurve);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipPathIterRewind(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef pathIter);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipPathIterEnumerate(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef pathIter, out int resultCount, PointF* points, byte* types, int count);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipPathIterCopyData(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef pathIter, out int resultCount, PointF* points, byte* types, int startIndex, int endIndex);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipCreateHatchBrush(int hatchstyle, int forecol, int backcol, out IntPtr brush);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetHatchStyle(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef brush, out int hatchstyle);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetHatchForegroundColor(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef brush, out int forecol);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetHatchBackgroundColor(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef brush, out int backcol);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipCloneBrush(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef brush, out IntPtr clonebrush);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipCreateLineBrush(ref PointF point1, ref PointF point2, int color1, int color2, WrapMode wrapMode, out IntPtr lineGradient);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipCreateLineBrushI(ref Point point1, ref Point point2, int color1, int color2, WrapMode wrapMode, out IntPtr lineGradient);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipCreateLineBrushFromRect(ref RectangleF rect, int color1, int color2, LinearGradientMode lineGradientMode, WrapMode wrapMode, out IntPtr lineGradient);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipCreateLineBrushFromRectI(ref Rectangle rect, int color1, int color2, LinearGradientMode lineGradientMode, WrapMode wrapMode, out IntPtr lineGradient);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipCreateLineBrushFromRectWithAngle(ref RectangleF rect, int color1, int color2, float angle, [MarshalAs(UnmanagedType.Bool)] bool isAngleScaleable, WrapMode wrapMode, out IntPtr lineGradient);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipCreateLineBrushFromRectWithAngleI(ref Rectangle rect, int color1, int color2, float angle, [MarshalAs(UnmanagedType.Bool)] bool isAngleScaleable, WrapMode wrapMode, out IntPtr lineGradient);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipSetLineColors(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef brush, int color1, int color2);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetLineColors(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef brush, int[] colors);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetLineRect(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef brush, out RectangleF gprectf);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetLineGammaCorrection(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef brush, [MarshalAs(UnmanagedType.Bool)] out bool useGammaCorrection);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipSetLineGammaCorrection(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef brush, [MarshalAs(UnmanagedType.Bool)] bool useGammaCorrection);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipSetLineSigmaBlend(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef brush, float focus, float scale);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipSetLineLinearBlend(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef brush, float focus, float scale);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetLineBlendCount(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef brush, out int count);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetLineBlend(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef brush, IntPtr blend, IntPtr positions, int count);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipSetLineBlend(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef brush, IntPtr blend, IntPtr positions, int count);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetLinePresetBlendCount(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef brush, out int count);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetLinePresetBlend(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef brush, IntPtr blend, IntPtr positions, int count);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipSetLinePresetBlend(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef brush, IntPtr blend, IntPtr positions, int count);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipSetLineWrapMode(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef brush, int wrapMode);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetLineWrapMode(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef brush, out int wrapMode);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipResetLineTransform(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef brush);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipMultiplyLineTransform(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef matrix, MatrixOrder order);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetLineTransform(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef matrix);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipSetLineTransform(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef matrix);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipTranslateLineTransform(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef brush, float dx, float dy, MatrixOrder order);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipScaleLineTransform(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef brush, float sx, float sy, MatrixOrder order);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipRotateLineTransform(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef brush, float angle, MatrixOrder order);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipCreatePathGradient(PointF* points, int count, WrapMode wrapMode, out IntPtr brush);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipCreatePathGradientI(Point* points, int count, WrapMode wrapMode, out IntPtr brush);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipCreatePathGradientFromPath(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef path, out IntPtr brush);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetPathGradientCenterColor(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef brush, out int color);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipSetPathGradientCenterColor(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef brush, int color);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetPathGradientSurroundColorsWithCount(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef brush, int[] color, ref int count);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipSetPathGradientSurroundColorsWithCount(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef brush, int[] argb, ref int count);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetPathGradientCenterPoint(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef brush, out PointF point);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipSetPathGradientCenterPoint(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef brush, ref PointF point);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetPathGradientRect(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef brush, out RectangleF gprectf);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetPathGradientPointCount(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef brush, out int count);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetPathGradientSurroundColorCount(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef brush, out int count);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetPathGradientBlendCount(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef brush, out int count);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetPathGradientBlend(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef brush, float[] blend, float[] positions, int count);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipSetPathGradientBlend(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef brush, IntPtr blend, IntPtr positions, int count);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetPathGradientPresetBlendCount(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef brush, out int count);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetPathGradientPresetBlend(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef brush, int[] blend, float[] positions, int count);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipSetPathGradientPresetBlend(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef brush, int[] blend, float[] positions, int count);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipSetPathGradientSigmaBlend(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef brush, float focus, float scale);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipSetPathGradientLinearBlend(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef brush, float focus, float scale);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipSetPathGradientWrapMode(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef brush, int wrapmode);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetPathGradientWrapMode(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef brush, out int wrapmode);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipSetPathGradientTransform(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef matrix);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetPathGradientTransform(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef matrix);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipResetPathGradientTransform(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef brush);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipMultiplyPathGradientTransform(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef matrix, MatrixOrder order);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipTranslatePathGradientTransform(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef brush, float dx, float dy, MatrixOrder order);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipScalePathGradientTransform(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef brush, float sx, float sy, MatrixOrder order);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipRotatePathGradientTransform(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef brush, float angle, MatrixOrder order);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetPathGradientFocusScales(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef brush, float[] xScale, float[] yScale);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipSetPathGradientFocusScales(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef brush, float xScale, float yScale);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipCreateImageAttributes(out IntPtr imageattr);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipCloneImageAttributes(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef imageattr, out IntPtr cloneImageattr);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipDisposeImageAttributes(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef imageattr);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipSetImageAttributesColorMatrix(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
ColorMatrix? grayMatrix, ColorMatrixFlag flags);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipSetImageAttributesThreshold(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef imageattr, ColorAdjustType type, [MarshalAs(UnmanagedType.Bool)] bool enableFlag, float threshold);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipSetImageAttributesGamma(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef imageattr, ColorAdjustType type, [MarshalAs(UnmanagedType.Bool)] bool enableFlag, float gamma);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipSetImageAttributesNoOp(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef imageattr, ColorAdjustType type, [MarshalAs(UnmanagedType.Bool)] bool enableFlag);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipSetImageAttributesColorKeys(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef imageattr, ColorAdjustType type, [MarshalAs(UnmanagedType.Bool)] bool enableFlag, int colorLow, int colorHigh);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipSetImageAttributesOutputChannel(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef imageattr, ColorAdjustType type, [MarshalAs(UnmanagedType.Bool)] bool enableFlag, ColorChannelFlag flags);
- [GeneratedDllImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
internal static partial int GdipSetImageAttributesOutputChannelColorProfile(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef imageattr, ColorAdjustType type, [MarshalAs(UnmanagedType.Bool)] bool enableFlag, string colorProfileFilename);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipSetImageAttributesRemapTable(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef imageattr, ColorAdjustType type, [MarshalAs(UnmanagedType.Bool)] bool enableFlag, int mapSize, IntPtr map);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipSetImageAttributesWrapMode(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef imageattr, int wrapmode, int argb, [MarshalAs(UnmanagedType.Bool)] bool clamp);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetImageAttributesAdjustedPalette(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef imageattr, IntPtr palette, ColorAdjustType type);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetImageDecodersSize(out int numDecoders, out int size);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetImageDecoders(int numDecoders, int size, IntPtr decoders);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetImageEncodersSize(out int numEncoders, out int size);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetImageEncoders(int numEncoders, int size, IntPtr encoders);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipCreateSolidFill(int color, out IntPtr brush);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipSetSolidFillColor(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef brush, int color);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetSolidFillColor(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
HandleRef brush, out int color);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipCreateTexture(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef bitmap, int wrapmode, out IntPtr texture);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipCreateTexture2(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef bitmap, int wrapmode, float x, float y, float width, float height, out IntPtr texture);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipCreateTextureIA(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef imageAttrib, float x, float y, float width, float height, out IntPtr texture);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipCreateTexture2I(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef bitmap, int wrapmode, int x, int y, int width, int height, out IntPtr texture);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipCreateTextureIAI(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef imageAttrib, int x, int y, int width, int height, out IntPtr texture);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipSetTextureTransform(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef matrix);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetTextureTransform(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef matrix);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipResetTextureTransform(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef brush);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipMultiplyTextureTransform(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef matrix, MatrixOrder order);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipTranslateTextureTransform(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef brush, float dx, float dy, MatrixOrder order);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipScaleTextureTransform(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef brush, float sx, float sy, MatrixOrder order);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipRotateTextureTransform(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef brush, float angle, MatrixOrder order);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipSetTextureWrapMode(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef brush, int wrapMode);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetTextureWrapMode(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef brush, out int wrapMode);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetTextureImage(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef brush, out IntPtr image);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetFontCollectionFamilyCount(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef fontCollection, out int numFound);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetFontCollectionFamilyList(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef fontCollection, int numSought, IntPtr[] gpfamilies, out int numFound);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipCloneFontFamily(IntPtr fontfamily, out IntPtr clonefontfamily);
- [GeneratedDllImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
internal static partial int GdipCreateFontFamilyFromName(string name,
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef fontCollection, out IntPtr FontFamily);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetGenericFontFamilySansSerif(out IntPtr fontfamily);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetGenericFontFamilySerif(out IntPtr fontfamily);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetGenericFontFamilyMonospace(out IntPtr fontfamily);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipDeleteFontFamily(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef fontFamily);
- [GeneratedDllImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
internal static partial int GdipGetFamilyName(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef family, char* name, int language);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipIsStyleAvailable(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef family, FontStyle style, out int isStyleAvailable);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetEmHeight(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef family, FontStyle style, out int EmHeight);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetCellAscent(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef family, FontStyle style, out int CellAscent);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetCellDescent(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef family, FontStyle style, out int CellDescent);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetLineSpacing(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef family, FontStyle style, out int LineSpaceing);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipNewInstalledFontCollection(out IntPtr fontCollection);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipNewPrivateFontCollection(out IntPtr fontCollection);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipDeletePrivateFontCollection(ref IntPtr fontCollection);
- [GeneratedDllImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
internal static partial int GdipPrivateAddFontFile(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef fontCollection, string filename);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipPrivateAddMemoryFont(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef fontCollection, IntPtr memory, int length);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipCreateFont(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef fontFamily, float emSize, FontStyle style, GraphicsUnit unit, out IntPtr font);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipCreateFontFromDC(IntPtr hdc, ref IntPtr font);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipCloneFont(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef font, out IntPtr cloneFont);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipDeleteFont(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef font);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetFamily(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef font, out IntPtr family);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetFontStyle(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef font, out FontStyle style);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetFontSize(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef font, out float size);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetFontHeight(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef graphics, out float size);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetFontHeightGivenDPI(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef font, float dpi, out float size);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetFontUnit(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef font, out GraphicsUnit unit);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetLogFontW(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef graphics, ref Interop.User32.LOGFONT lf);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipCreatePen1(int argb, float width, int unit, out IntPtr pen);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipCreatePen2(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef brush, float width, int unit, out IntPtr pen);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipClonePen(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef pen, out IntPtr clonepen);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipDeletePen(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef Pen);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipSetPenMode(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef pen, PenAlignment penAlign);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetPenMode(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef pen, out PenAlignment penAlign);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipSetPenWidth(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef pen, float width);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetPenWidth(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef pen, float[] width);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipSetPenLineCap197819(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef pen, int startCap, int endCap, int dashCap);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipSetPenStartCap(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef pen, int startCap);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipSetPenEndCap(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef pen, int endCap);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetPenStartCap(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef pen, out int startCap);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetPenEndCap(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef pen, out int endCap);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetPenDashCap197819(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef pen, out int dashCap);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipSetPenDashCap197819(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef pen, int dashCap);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipSetPenLineJoin(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef pen, int lineJoin);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetPenLineJoin(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef pen, out int lineJoin);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipSetPenCustomStartCap(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef customCap);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetPenCustomStartCap(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef pen, out IntPtr customCap);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipSetPenCustomEndCap(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef customCap);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetPenCustomEndCap(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef pen, out IntPtr customCap);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipSetPenMiterLimit(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef pen, float miterLimit);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetPenMiterLimit(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef pen, float[] miterLimit);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipSetPenTransform(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef matrix);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetPenTransform(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef matrix);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipResetPenTransform(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef brush);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipMultiplyPenTransform(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef matrix, MatrixOrder order);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipTranslatePenTransform(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef brush, float dx, float dy, MatrixOrder order);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipScalePenTransform(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef brush, float sx, float sy, MatrixOrder order);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipRotatePenTransform(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef brush, float angle, MatrixOrder order);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipSetPenColor(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef pen, int argb);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetPenColor(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef pen, out int argb);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipSetPenBrushFill(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef brush);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetPenBrushFill(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef pen, out IntPtr brush);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetPenFillType(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef pen, out int pentype);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetPenDashStyle(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef pen, out int dashstyle);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipSetPenDashStyle(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef pen, int dashstyle);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipSetPenDashArray(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef memorydash, int count);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetPenDashOffset(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef pen, float[] dashoffset);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipSetPenDashOffset(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef pen, float dashoffset);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetPenDashCount(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef pen, out int dashcount);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetPenDashArray(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef pen, float[] memorydash, int count);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetPenCompoundCount(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef pen, out int count);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipSetPenCompoundArray(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef pen, float[] array, int count);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetPenCompoundArray(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef pen, float[] array, int count);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipSetWorldTransform(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef matrix);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipResetWorldTransform(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef graphics);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipMultiplyWorldTransform(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef matrix, MatrixOrder order);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipTranslateWorldTransform(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef graphics, float dx, float dy, MatrixOrder order);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipScaleWorldTransform(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef graphics, float sx, float sy, MatrixOrder order);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipRotateWorldTransform(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef graphics, float angle, MatrixOrder order);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetWorldTransform(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef matrix);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipSetCompositingMode(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef graphics, CompositingMode compositingMode);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipSetTextRenderingHint(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef graphics, TextRenderingHint textRenderingHint);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipSetTextContrast(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef graphics, int textContrast);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipSetInterpolationMode(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef graphics, InterpolationMode interpolationMode);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetCompositingMode(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef graphics, out CompositingMode compositingMode);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipSetRenderingOrigin(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef graphics, int x, int y);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetRenderingOrigin(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef graphics, out int x, out int y);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipSetCompositingQuality(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef graphics, CompositingQuality quality);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetCompositingQuality(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef graphics, out CompositingQuality quality);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipSetSmoothingMode(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef graphics, SmoothingMode smoothingMode);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetSmoothingMode(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef graphics, out SmoothingMode smoothingMode);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipSetPixelOffsetMode(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef graphics, PixelOffsetMode pixelOffsetMode);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetPixelOffsetMode(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef graphics, out PixelOffsetMode pixelOffsetMode);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetTextRenderingHint(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef graphics, out TextRenderingHint textRenderingHint);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetTextContrast(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef graphics, out int textContrast);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetInterpolationMode(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef graphics, out InterpolationMode interpolationMode);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetPageUnit(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef graphics, out GraphicsUnit unit);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetPageScale(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef graphics, out float scale);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipSetPageUnit(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef graphics, GraphicsUnit unit);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipSetPageScale(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef graphics, float scale);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetDpiX(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef graphics, out float dpi);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetDpiY(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef graphics, out float dpi);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipCreateMatrix(out IntPtr matrix);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipCreateMatrix2(float m11, float m12, float m21, float m22, float dx, float dy, out IntPtr matrix);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipCreateMatrix3(ref RectangleF rect, PointF* dstplg, out IntPtr matrix);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipCreateMatrix3I(ref Rectangle rect, Point* dstplg, out IntPtr matrix);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipCloneMatrix(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef matrix, out IntPtr cloneMatrix);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipDeleteMatrix(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef matrix);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipSetMatrixElements(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef matrix, float m11, float m12, float m21, float m22, float dx, float dy);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipMultiplyMatrix(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef matrix2, MatrixOrder order);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipTranslateMatrix(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef matrix, float offsetX, float offsetY, MatrixOrder order);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipScaleMatrix(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef matrix, float scaleX, float scaleY, MatrixOrder order);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipRotateMatrix(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef matrix, float angle, MatrixOrder order);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipShearMatrix(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef matrix, float shearX, float shearY, MatrixOrder order);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipInvertMatrix(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef matrix);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipTransformMatrixPoints(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef matrix, PointF* pts, int count);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipTransformMatrixPointsI(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef matrix, Point* pts, int count);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipVectorTransformMatrixPoints(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef matrix, PointF* pts, int count);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipVectorTransformMatrixPointsI(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef matrix, Point* pts, int count);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static unsafe partial int GdipGetMatrixElements(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef matrix, float* m);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipIsMatrixInvertible(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef matrix, out int boolean);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipIsMatrixIdentity(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef matrix, out int boolean);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipIsMatrixEqual(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef matrix2, out int boolean);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipCreateRegion(out IntPtr region);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipCreateRegionRect(ref RectangleF gprectf, out IntPtr region);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipCreateRegionRectI(ref Rectangle gprect, out IntPtr region);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipCreateRegionPath(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef path, out IntPtr region);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipCreateRegionRgnData(byte[] rgndata, int size, out IntPtr region);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipCreateRegionHrgn(IntPtr hRgn, out IntPtr region);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipCloneRegion(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef region, out IntPtr cloneregion);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipDeleteRegion(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef region);
- [GeneratedDllImport(LibraryName, SetLastError = true)]
+ [LibraryImport(LibraryName, SetLastError = true)]
internal static partial int GdipFillRegion(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef region);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipSetInfinite(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef region);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipSetEmpty(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef region);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipCombineRegionRect(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef region, ref RectangleF gprectf, CombineMode mode);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipCombineRegionRectI(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef region, ref Rectangle gprect, CombineMode mode);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipCombineRegionPath(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef path, CombineMode mode);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipCombineRegionRegion(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef region2, CombineMode mode);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipTranslateRegion(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef region, float dx, float dy);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipTranslateRegionI(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef region, int dx, int dy);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipTransformRegion(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef matrix);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetRegionBounds(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef graphics, out RectangleF gprectf);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetRegionHRgn(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef graphics, out IntPtr hrgn);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipIsEmptyRegion(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef graphics, out int boolean);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipIsInfiniteRegion(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef graphics, out int boolean);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipIsEqualRegion(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef graphics, out int boolean);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetRegionDataSize(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef region, out int bufferSize);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetRegionData(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef region, byte[] regionData, int bufferSize, out int sizeFilled);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipIsVisibleRegionPoint(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef graphics, out int boolean);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipIsVisibleRegionPointI(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef graphics, out int boolean);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipIsVisibleRegionRect(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef graphics, out int boolean);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipIsVisibleRegionRectI(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef graphics, out int boolean);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetRegionScansCount(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef matrix);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetRegionScans(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef matrix);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipCreateFromHDC(IntPtr hdc, out IntPtr graphics);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipSetClipGraphics(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef srcgraphics, CombineMode mode);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipSetClipRect(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef graphics, float x, float y, float width, float height, CombineMode mode);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipSetClipRectI(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef graphics, int x, int y, int width, int height, CombineMode mode);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipSetClipPath(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef path, CombineMode mode);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipSetClipRegion(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef region, CombineMode mode);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipResetClip(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef graphics);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipTranslateClip(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef graphics, float dx, float dy);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetClip(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef region);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetClipBounds(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef graphics, out RectangleF rect);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipIsClipEmpty(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef graphics, [MarshalAs(UnmanagedType.Bool)] out bool result);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetVisibleClipBounds(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef graphics, out RectangleF rect);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipIsVisibleClipEmpty(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef graphics, [MarshalAs(UnmanagedType.Bool)] out bool result);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipIsVisiblePoint(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef graphics, float x, float y, [MarshalAs(UnmanagedType.Bool)] out bool result);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipIsVisiblePointI(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef graphics, int x, int y, [MarshalAs(UnmanagedType.Bool)] out bool result);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipIsVisibleRect(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef graphics, float x, float y, float width, float height, [MarshalAs(UnmanagedType.Bool)] out bool result);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipIsVisibleRectI(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef graphics, int x, int y, int width, int height, [MarshalAs(UnmanagedType.Bool)] out bool result);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipFlush(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef graphics, FlushIntention intention);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetDC(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef graphics, out IntPtr hdc);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipSetStringFormatMeasurableCharacterRanges(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef format, int rangeCount, CharacterRange[] range);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipCreateStringFormat(StringFormatFlags options, int language, out IntPtr format);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipStringFormatGetGenericDefault(out IntPtr format);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipStringFormatGetGenericTypographic(out IntPtr format);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipDeleteStringFormat(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef format);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipCloneStringFormat(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef format, out IntPtr newFormat);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipSetStringFormatFlags(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef format, StringFormatFlags options);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetStringFormatFlags(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef format, out StringFormatFlags result);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipSetStringFormatAlign(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef format, StringAlignment align);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetStringFormatAlign(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef format, out StringAlignment align);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipSetStringFormatLineAlign(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef format, StringAlignment align);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetStringFormatLineAlign(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef format, out StringAlignment align);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipSetStringFormatHotkeyPrefix(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef format, HotkeyPrefix hotkeyPrefix);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetStringFormatHotkeyPrefix(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef format, out HotkeyPrefix hotkeyPrefix);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipSetStringFormatTabStops(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef format, float firstTabOffset, int count, float[] tabStops);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetStringFormatTabStops(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef format, int count, out float firstTabOffset, float[] tabStops);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetStringFormatTabStopCount(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef format, out int count);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetStringFormatMeasurableCharacterRangeCount(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef format, out int count);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipSetStringFormatTrimming(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef format, StringTrimming trimming);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetStringFormatTrimming(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef format, out StringTrimming trimming);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipSetStringFormatDigitSubstitution(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef format, int langID, StringDigitSubstitute sds);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetStringFormatDigitSubstitution(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef format, out int langID, out StringDigitSubstitute sds);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetImageDimension(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef image, out float width, out float height);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetImageWidth(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef image, out int width);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetImageHeight(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef image, out int height);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetImageHorizontalResolution(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef image, out float horzRes);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetImageVerticalResolution(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef image, out float vertRes);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetImageFlags(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef image, out int flags);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetImageRawFormat(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef image, ref Guid format);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetImagePixelFormat(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef image, out PixelFormat format);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipImageGetFrameCount(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef image, ref Guid dimensionID, out int count);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipImageSelectActiveFrame(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef image, ref Guid dimensionID, int frameIndex);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipImageRotateFlip(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef image, int rotateFlipType);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetAllPropertyItems(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef image, uint totalBufferSize, uint numProperties, PropertyItemInternal* allItems);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetPropertyCount(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef image, out uint numOfProperty);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetPropertyIdList(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef image, uint numOfProperty, int* list);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetPropertyItem(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef image, int propid, uint propSize, PropertyItemInternal* buffer);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetPropertyItemSize(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef image, int propid, out uint size);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetPropertySize(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef image, out uint totalBufferSize, out uint numProperties);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipRemovePropertyItem(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef image, int propid);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipSetPropertyItem(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef image, PropertyItemInternal* item);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetImageType(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef image, out int type);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetImageType(IntPtr image, out int type);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipDisposeImage(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef image);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipDisposeImage(IntPtr image);
- [GeneratedDllImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
internal static partial int GdipCreateBitmapFromFile(string filename, out IntPtr bitmap);
- [GeneratedDllImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
internal static partial int GdipCreateBitmapFromFileICM(string filename, out IntPtr bitmap);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipCreateBitmapFromScan0(int width, int height, int stride, int format, IntPtr scan0, out IntPtr bitmap);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipCreateBitmapFromGraphics(int width, int height,
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef graphics, out IntPtr bitmap);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipCreateBitmapFromHBITMAP(IntPtr hbitmap, IntPtr hpalette, out IntPtr bitmap);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipCreateBitmapFromHICON(IntPtr hicon, out IntPtr bitmap);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipCreateBitmapFromResource(IntPtr hresource, IntPtr name, out IntPtr bitmap);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipCreateHBITMAPFromBitmap(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef nativeBitmap, out IntPtr hbitmap, int argbBackground);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipCreateHICONFromBitmap(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef nativeBitmap, out IntPtr hicon);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipCloneBitmapArea(float x, float y, float width, float height, int format,
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef srcbitmap, out IntPtr dstbitmap);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipCloneBitmapAreaI(int x, int y, int width, int height, int format,
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef srcbitmap, out IntPtr dstbitmap);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipBitmapLockBits(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
BitmapData lockedBitmapData);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipBitmapUnlockBits(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
BitmapData lockedBitmapData);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipBitmapGetPixel(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef bitmap, int x, int y, out int argb);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipBitmapSetPixel(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef bitmap, int x, int y, int argb);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipBitmapSetResolution(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef bitmap, float dpix, float dpiy);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipImageGetFrameDimensionsCount(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef image, out int count);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipImageGetFrameDimensionsList(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef image, Guid* dimensionIDs, int count);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipCreateMetafileFromEmf(IntPtr hEnhMetafile, [MarshalAs(UnmanagedType.Bool)] bool deleteEmf, out IntPtr metafile);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipCreateMetafileFromWmf(IntPtr hMetafile, [MarshalAs(UnmanagedType.Bool)] bool deleteWmf,
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(WmfPlaceableFileHeader.PinningMarshaller))]
#endif
WmfPlaceableFileHeader wmfplacealbeHeader, out IntPtr metafile);
- [GeneratedDllImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
internal static partial int GdipCreateMetafileFromFile(string file, out IntPtr metafile);
- [GeneratedDllImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
internal static partial int GdipRecordMetafile(IntPtr referenceHdc, EmfType emfType, IntPtr pframeRect, MetafileFrameUnit frameUnit, string? description, out IntPtr metafile);
- [GeneratedDllImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
internal static partial int GdipRecordMetafile(IntPtr referenceHdc, EmfType emfType, ref RectangleF frameRect, MetafileFrameUnit frameUnit, string? description, out IntPtr metafile);
- [GeneratedDllImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
internal static partial int GdipRecordMetafileI(IntPtr referenceHdc, EmfType emfType, ref Rectangle frameRect, MetafileFrameUnit frameUnit, string? description, out IntPtr metafile);
- [GeneratedDllImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
internal static partial int GdipRecordMetafileFileName(string fileName, IntPtr referenceHdc, EmfType emfType, ref RectangleF frameRect, MetafileFrameUnit frameUnit, string? description, out IntPtr metafile);
- [GeneratedDllImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
internal static partial int GdipRecordMetafileFileName(string fileName, IntPtr referenceHdc, EmfType emfType, IntPtr pframeRect, MetafileFrameUnit frameUnit, string? description, out IntPtr metafile);
- [GeneratedDllImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
internal static partial int GdipRecordMetafileFileNameI(string fileName, IntPtr referenceHdc, EmfType emfType, ref Rectangle frameRect, MetafileFrameUnit frameUnit, string? description, out IntPtr metafile);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipPlayMetafileRecord(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef metafile, EmfPlusRecordType recordType, int flags, int dataSize, byte[] data);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipSaveGraphics(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef graphics, out int state);
- [GeneratedDllImport(LibraryName, SetLastError = true)]
+ [LibraryImport(LibraryName, SetLastError = true)]
internal static partial int GdipDrawArc(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef pen, float x, float y, float width, float height, float startAngle, float sweepAngle);
- [GeneratedDllImport(LibraryName, SetLastError = true)]
+ [LibraryImport(LibraryName, SetLastError = true)]
internal static partial int GdipDrawArcI(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef pen, int x, int y, int width, int height, float startAngle, float sweepAngle);
- [GeneratedDllImport(LibraryName, SetLastError = true)]
+ [LibraryImport(LibraryName, SetLastError = true)]
internal static partial int GdipDrawLinesI(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef pen, Point* points, int count);
- [GeneratedDllImport(LibraryName, SetLastError = true)]
+ [LibraryImport(LibraryName, SetLastError = true)]
internal static partial int GdipDrawBezier(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef pen, float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4);
- [GeneratedDllImport(LibraryName, SetLastError = true)]
+ [LibraryImport(LibraryName, SetLastError = true)]
internal static partial int GdipDrawEllipse(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef pen, float x, float y, float width, float height);
- [GeneratedDllImport(LibraryName, SetLastError = true)]
+ [LibraryImport(LibraryName, SetLastError = true)]
internal static partial int GdipDrawEllipseI(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef pen, int x, int y, int width, int height);
- [GeneratedDllImport(LibraryName, SetLastError = true)]
+ [LibraryImport(LibraryName, SetLastError = true)]
internal static partial int GdipDrawLine(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef pen, float x1, float y1, float x2, float y2);
- [GeneratedDllImport(LibraryName, SetLastError = true)]
+ [LibraryImport(LibraryName, SetLastError = true)]
internal static partial int GdipDrawLineI(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef pen, int x1, int y1, int x2, int y2);
- [GeneratedDllImport(LibraryName, SetLastError = true)]
+ [LibraryImport(LibraryName, SetLastError = true)]
internal static partial int GdipDrawLines(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef pen, PointF* points, int count);
- [GeneratedDllImport(LibraryName, SetLastError = true)]
+ [LibraryImport(LibraryName, SetLastError = true)]
internal static partial int GdipDrawPath(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef path);
- [GeneratedDllImport(LibraryName, SetLastError = true)]
+ [LibraryImport(LibraryName, SetLastError = true)]
internal static partial int GdipDrawPie(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef pen, float x, float y, float width, float height, float startAngle, float sweepAngle);
- [GeneratedDllImport(LibraryName, SetLastError = true)]
+ [LibraryImport(LibraryName, SetLastError = true)]
internal static partial int GdipDrawPieI(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef pen, int x, int y, int width, int height, float startAngle, float sweepAngle);
- [GeneratedDllImport(LibraryName, SetLastError = true)]
+ [LibraryImport(LibraryName, SetLastError = true)]
internal static partial int GdipDrawPolygon(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef pen, PointF* points, int count);
- [GeneratedDllImport(LibraryName, SetLastError = true)]
+ [LibraryImport(LibraryName, SetLastError = true)]
internal static partial int GdipDrawPolygonI(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef pen, Point* points, int count);
- [GeneratedDllImport(LibraryName, SetLastError = true)]
+ [LibraryImport(LibraryName, SetLastError = true)]
internal static partial int GdipFillEllipse(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef brush, float x, float y, float width, float height);
- [GeneratedDllImport(LibraryName, SetLastError = true)]
+ [LibraryImport(LibraryName, SetLastError = true)]
internal static partial int GdipFillEllipseI(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef brush, int x, int y, int width, int height);
- [GeneratedDllImport(LibraryName, SetLastError = true)]
+ [LibraryImport(LibraryName, SetLastError = true)]
internal static partial int GdipFillPolygon(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef brush, PointF* points, int count, FillMode brushMode);
- [GeneratedDllImport(LibraryName, SetLastError = true)]
+ [LibraryImport(LibraryName, SetLastError = true)]
internal static partial int GdipFillPolygonI(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef brush, Point* points, int count, FillMode brushMode);
- [GeneratedDllImport(LibraryName, SetLastError = true)]
+ [LibraryImport(LibraryName, SetLastError = true)]
internal static partial int GdipFillRectangle(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef brush, float x, float y, float width, float height);
- [GeneratedDllImport(LibraryName, SetLastError = true)]
+ [LibraryImport(LibraryName, SetLastError = true)]
internal static partial int GdipFillRectangleI(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef brush, int x, int y, int width, int height);
- [GeneratedDllImport(LibraryName, SetLastError = true)]
+ [LibraryImport(LibraryName, SetLastError = true)]
internal static partial int GdipFillRectangles(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef brush, RectangleF* rects, int count);
- [GeneratedDllImport(LibraryName, SetLastError = true)]
+ [LibraryImport(LibraryName, SetLastError = true)]
internal static partial int GdipFillRectanglesI(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef brush, Rectangle* rects, int count);
- [GeneratedDllImport(LibraryName, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(LibraryName, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
internal static partial int GdipDrawString(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef brush);
- [GeneratedDllImport(LibraryName, SetLastError = true)]
+ [LibraryImport(LibraryName, SetLastError = true)]
internal static partial int GdipDrawImageRectI(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef image, int x, int y, int width, int height);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGraphicsClear(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef graphics, int argb);
- [GeneratedDllImport(LibraryName, SetLastError = true)]
+ [LibraryImport(LibraryName, SetLastError = true)]
internal static partial int GdipDrawClosedCurve(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef pen, PointF* points, int count);
- [GeneratedDllImport(LibraryName, SetLastError = true)]
+ [LibraryImport(LibraryName, SetLastError = true)]
internal static partial int GdipDrawClosedCurveI(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef pen, Point* points, int count);
- [GeneratedDllImport(LibraryName, SetLastError = true)]
+ [LibraryImport(LibraryName, SetLastError = true)]
internal static partial int GdipDrawClosedCurve2(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef pen, PointF* points, int count, float tension);
- [GeneratedDllImport(LibraryName, SetLastError = true)]
+ [LibraryImport(LibraryName, SetLastError = true)]
internal static partial int GdipDrawClosedCurve2I(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef pen, Point* points, int count, float tension);
- [GeneratedDllImport(LibraryName, SetLastError = true)]
+ [LibraryImport(LibraryName, SetLastError = true)]
internal static partial int GdipDrawCurve(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef pen, PointF* points, int count);
- [GeneratedDllImport(LibraryName, SetLastError = true)]
+ [LibraryImport(LibraryName, SetLastError = true)]
internal static partial int GdipDrawCurveI(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef pen, Point* points, int count);
- [GeneratedDllImport(LibraryName, SetLastError = true)]
+ [LibraryImport(LibraryName, SetLastError = true)]
internal static partial int GdipDrawCurve2(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef pen, PointF* points, int count, float tension);
- [GeneratedDllImport(LibraryName, SetLastError = true)]
+ [LibraryImport(LibraryName, SetLastError = true)]
internal static partial int GdipDrawCurve2I(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef pen, Point* points, int count, float tension);
- [GeneratedDllImport(LibraryName, SetLastError = true)]
+ [LibraryImport(LibraryName, SetLastError = true)]
internal static partial int GdipDrawCurve3(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef pen, PointF* points, int count, int offset, int numberOfSegments, float tension);
- [GeneratedDllImport(LibraryName, SetLastError = true)]
+ [LibraryImport(LibraryName, SetLastError = true)]
internal static partial int GdipDrawCurve3I(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef pen, Point* points, int count, int offset, int numberOfSegments, float tension);
- [GeneratedDllImport(LibraryName, SetLastError = true)]
+ [LibraryImport(LibraryName, SetLastError = true)]
internal static partial int GdipFillClosedCurve(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef brush, PointF* points, int count);
- [GeneratedDllImport(LibraryName, SetLastError = true)]
+ [LibraryImport(LibraryName, SetLastError = true)]
internal static partial int GdipFillClosedCurveI(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef brush, Point* points, int count);
- [GeneratedDllImport(LibraryName, SetLastError = true)]
+ [LibraryImport(LibraryName, SetLastError = true)]
internal static partial int GdipFillClosedCurve2(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef brush, PointF* points, int count, float tension, FillMode mode);
- [GeneratedDllImport(LibraryName, SetLastError = true)]
+ [LibraryImport(LibraryName, SetLastError = true)]
internal static partial int GdipFillClosedCurve2I(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef brush, Point* points, int count, float tension, FillMode mode);
- [GeneratedDllImport(LibraryName, SetLastError = true)]
+ [LibraryImport(LibraryName, SetLastError = true)]
internal static partial int GdipFillPie(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef brush, float x, float y, float width, float height, float startAngle, float sweepAngle);
- [GeneratedDllImport(LibraryName, SetLastError = true)]
+ [LibraryImport(LibraryName, SetLastError = true)]
internal static partial int GdipFillPieI(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef brush, int x, int y, int width, int height, float startAngle, float sweepAngle);
- [GeneratedDllImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
internal static partial int GdipMeasureString(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef stringFormat, ref RectangleF boundingBox, out int codepointsFitted, out int linesFilled);
- [GeneratedDllImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
internal static partial int GdipMeasureCharacterRanges(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef stringFormat, int characterCount, IntPtr[] region);
- [GeneratedDllImport(LibraryName, SetLastError = true)]
+ [LibraryImport(LibraryName, SetLastError = true)]
internal static partial int GdipDrawImageI(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef image, int x, int y);
- [GeneratedDllImport(LibraryName, SetLastError = true)]
+ [LibraryImport(LibraryName, SetLastError = true)]
internal static partial int GdipDrawImage(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef image, float x, float y);
- [GeneratedDllImport(LibraryName, SetLastError = true)]
+ [LibraryImport(LibraryName, SetLastError = true)]
internal static partial int GdipDrawImagePoints(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef image, PointF* points, int count);
- [GeneratedDllImport(LibraryName, SetLastError = true)]
+ [LibraryImport(LibraryName, SetLastError = true)]
internal static partial int GdipDrawImagePointsI(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef image, Point* points, int count);
- [GeneratedDllImport(LibraryName, SetLastError = true)]
+ [LibraryImport(LibraryName, SetLastError = true)]
internal static partial int GdipDrawImageRectRectI(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef callbackdata);
- [GeneratedDllImport(LibraryName, SetLastError = true)]
+ [LibraryImport(LibraryName, SetLastError = true)]
internal static partial int GdipDrawImagePointsRect(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef callbackdata);
- [GeneratedDllImport(LibraryName, SetLastError = true)]
+ [LibraryImport(LibraryName, SetLastError = true)]
internal static partial int GdipDrawImageRectRect(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef callbackdata);
- [GeneratedDllImport(LibraryName, SetLastError = true)]
+ [LibraryImport(LibraryName, SetLastError = true)]
internal static partial int GdipDrawImagePointsRectI(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef callbackdata);
- [GeneratedDllImport(LibraryName, SetLastError = true)]
+ [LibraryImport(LibraryName, SetLastError = true)]
internal static partial int GdipDrawImageRect(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef image, float x, float y, float width, float height);
- [GeneratedDllImport(LibraryName, SetLastError = true)]
+ [LibraryImport(LibraryName, SetLastError = true)]
internal static partial int GdipDrawImagePointRect(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef image, float x, float y, float srcx, float srcy, float srcwidth, float srcheight, int srcunit);
- [GeneratedDllImport(LibraryName, SetLastError = true)]
+ [LibraryImport(LibraryName, SetLastError = true)]
internal static partial int GdipDrawImagePointRectI(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef image, int x, int y, int srcx, int srcy, int srcwidth, int srcheight, int srcunit);
- [GeneratedDllImport(LibraryName, SetLastError = true)]
+ [LibraryImport(LibraryName, SetLastError = true)]
internal static partial int GdipDrawRectangle(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef pen, float x, float y, float width, float height);
- [GeneratedDllImport(LibraryName, SetLastError = true)]
+ [LibraryImport(LibraryName, SetLastError = true)]
internal static partial int GdipDrawRectangleI(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef pen, int x, int y, int width, int height);
- [GeneratedDllImport(LibraryName, SetLastError = true)]
+ [LibraryImport(LibraryName, SetLastError = true)]
internal static partial int GdipDrawRectangles(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef pen, RectangleF* rects, int count);
- [GeneratedDllImport(LibraryName, SetLastError = true)]
+ [LibraryImport(LibraryName, SetLastError = true)]
internal static partial int GdipDrawRectanglesI(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef pen, Rectangle* rects, int count);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipTransformPoints(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef graphics, int destSpace, int srcSpace, PointF* points, int count);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipTransformPointsI(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef graphics, int destSpace, int srcSpace, Point* points, int count);
- [GeneratedDllImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
internal static partial int GdipLoadImageFromFileICM(string filename, out IntPtr image);
- [GeneratedDllImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
internal static partial int GdipLoadImageFromFile(string filename, out IntPtr image);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetEncoderParameterListSize(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
#endif
HandleRef image, ref Guid encoder, out int size);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int GdipGetEncoderParameterList(
#if NET7_0_OR_GREATER
[MarshalUsing(typeof(HandleRefMarshaller))]
}
}
- [GeneratedDllImport(Interop.Libraries.Oleaut32)]
+ [LibraryImport(Interop.Libraries.Oleaut32)]
private static unsafe partial int OleCreatePictureIndirect(PICTDESC* pictdesc, Guid* refiid, int fOwn, IntPtr* lplpvObj);
[StructLayout(LayoutKind.Sequential)]
}
}
- [GeneratedDllImport(Interop.Libraries.Oleaut32, PreserveSig = false)]
+ [LibraryImport(Interop.Libraries.Oleaut32, PreserveSig = false)]
internal static partial IntPtr OleCreatePictureIndirect(in PICTDESC pictdesc, in Guid refiid, bool fOwn);
[ComImport]
internal static partial class LibX11Functions
{
// Some special X11 stuff
- [GeneratedDllImport("libX11", EntryPoint = "XOpenDisplay")]
+ [LibraryImport("libX11", EntryPoint = "XOpenDisplay")]
internal static partial IntPtr XOpenDisplay(IntPtr display);
- [GeneratedDllImport("libX11", EntryPoint = "XCloseDisplay")]
+ [LibraryImport("libX11", EntryPoint = "XCloseDisplay")]
internal static partial int XCloseDisplay(IntPtr display);
- [GeneratedDllImport("libX11", EntryPoint = "XRootWindow")]
+ [LibraryImport("libX11", EntryPoint = "XRootWindow")]
internal static partial IntPtr XRootWindow(IntPtr display, int screen);
- [GeneratedDllImport("libX11", EntryPoint = "XDefaultScreen")]
+ [LibraryImport("libX11", EntryPoint = "XDefaultScreen")]
internal static partial int XDefaultScreen(IntPtr display);
- [GeneratedDllImport("libX11", EntryPoint = "XDefaultDepth")]
+ [LibraryImport("libX11", EntryPoint = "XDefaultDepth")]
internal static partial uint XDefaultDepth(IntPtr display, int screen);
- [GeneratedDllImport("libX11", EntryPoint = "XGetImage")]
+ [LibraryImport("libX11", EntryPoint = "XGetImage")]
internal static partial IntPtr XGetImage(IntPtr display, IntPtr drawable, int src_x, int src_y, int width, int height, int pane, int format);
- [GeneratedDllImport("libX11", EntryPoint = "XGetPixel")]
+ [LibraryImport("libX11", EntryPoint = "XGetPixel")]
internal static partial int XGetPixel(IntPtr image, int x, int y);
- [GeneratedDllImport("libX11", EntryPoint = "XDestroyImage")]
+ [LibraryImport("libX11", EntryPoint = "XDestroyImage")]
internal static partial int XDestroyImage(IntPtr image);
- [GeneratedDllImport("libX11", EntryPoint = "XDefaultVisual")]
+ [LibraryImport("libX11", EntryPoint = "XDefaultVisual")]
internal static partial IntPtr XDefaultVisual(IntPtr display, int screen);
- [GeneratedDllImport("libX11", EntryPoint = "XGetVisualInfo")]
+ [LibraryImport("libX11", EntryPoint = "XGetVisualInfo")]
internal static partial IntPtr XGetVisualInfo(IntPtr display, int vinfo_mask, ref XVisualInfo vinfo_template, ref int nitems);
- [GeneratedDllImport("libX11", EntryPoint = "XVisualIDFromVisual")]
+ [LibraryImport("libX11", EntryPoint = "XVisualIDFromVisual")]
internal static partial IntPtr XVisualIDFromVisual(IntPtr visual);
- [GeneratedDllImport("libX11", EntryPoint = "XFree")]
+ [LibraryImport("libX11", EntryPoint = "XFree")]
internal static partial void XFree(IntPtr data);
}
return lib;
}
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int cupsGetDests(ref IntPtr dests);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial void cupsFreeDests(int num_dests, IntPtr dests);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial IntPtr cupsTempFd(sbyte[] sb, int len);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial IntPtr cupsGetDefault();
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int cupsPrintFile(
[MarshalAs(UnmanagedType.LPUTF8Str)] string printer,
[MarshalAs(UnmanagedType.LPUTF8Str)] string filename,
int num_options,
IntPtr options);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial IntPtr cupsGetPPD([MarshalAs(UnmanagedType.LPUTF8Str)] string printer);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial IntPtr ppdOpenFile([MarshalAs(UnmanagedType.LPUTF8Str)] string filename);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial IntPtr ppdFindOption(IntPtr ppd_file, [MarshalAs(UnmanagedType.LPUTF8Str)] string keyword);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial void ppdClose(IntPtr ppd);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial int cupsParseOptions([MarshalAs(UnmanagedType.LPUTF8Str)] string arg, int number_of_options, ref IntPtr options);
- [GeneratedDllImport(LibraryName)]
+ [LibraryImport(LibraryName)]
internal static partial void cupsFreeOptions(int number_options, IntPtr options);
}
}
}
#region Cocoa Methods
- [GeneratedDllImport("libobjc.dylib", StringMarshalling = StringMarshalling.Utf8)]
+ [LibraryImport("libobjc.dylib", StringMarshalling = StringMarshalling.Utf8)]
public static partial IntPtr objc_getClass(string className);
- [GeneratedDllImport("libobjc.dylib", EntryPoint = "objc_msgSend")]
+ [LibraryImport("libobjc.dylib", EntryPoint = "objc_msgSend")]
public static partial IntPtr intptr_objc_msgSend(IntPtr basePtr, IntPtr selector);
- [GeneratedDllImport("libobjc.dylib", EntryPoint = "objc_msgSend_stret")]
+ [LibraryImport("libobjc.dylib", EntryPoint = "objc_msgSend_stret")]
public static partial void Rect_objc_msgSend_stret(out Rect arect, IntPtr basePtr, IntPtr selector);
- [GeneratedDllImport("libobjc.dylib", EntryPoint = "objc_msgSend")]
+ [LibraryImport("libobjc.dylib", EntryPoint = "objc_msgSend")]
[return:MarshalAs(UnmanagedType.U1)]
public static partial bool bool_objc_msgSend(IntPtr handle, IntPtr selector);
- [GeneratedDllImport("libobjc.dylib", StringMarshalling = StringMarshalling.Utf8)]
+ [LibraryImport("libobjc.dylib", StringMarshalling = StringMarshalling.Utf8)]
public static partial IntPtr sel_registerName(string selectorName);
#endregion
- [GeneratedDllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
+ [LibraryImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
internal static partial IntPtr CGMainDisplayID();
- [GeneratedDllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
+ [LibraryImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
internal static partial Rect CGDisplayBounds(IntPtr display);
- [GeneratedDllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
+ [LibraryImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
internal static partial int HIViewGetBounds(IntPtr vHnd, ref Rect r);
- [GeneratedDllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
+ [LibraryImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
internal static partial int HIViewConvertRect(ref Rect r, IntPtr a, IntPtr b);
- [GeneratedDllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
+ [LibraryImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
internal static partial IntPtr GetControlOwner(IntPtr aView);
- [GeneratedDllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
+ [LibraryImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
internal static partial int GetWindowBounds(IntPtr wHnd, uint reg, ref QDRect rect);
- [GeneratedDllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
+ [LibraryImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
internal static partial IntPtr GetWindowPort(IntPtr hWnd);
- [GeneratedDllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
+ [LibraryImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
internal static partial IntPtr GetQDGlobalsThePort();
- [GeneratedDllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
+ [LibraryImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
internal static partial void CreateCGContextForPort(IntPtr port, ref IntPtr context);
- [GeneratedDllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
+ [LibraryImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
internal static partial void CFRelease(IntPtr context);
- [GeneratedDllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
+ [LibraryImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
internal static partial void QDBeginCGContext(IntPtr port, ref IntPtr context);
- [GeneratedDllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
+ [LibraryImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
internal static partial void QDEndCGContext(IntPtr port, ref IntPtr context);
- [GeneratedDllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
+ [LibraryImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
internal static partial int CGContextClipToRect(IntPtr context, Rect clip);
- [GeneratedDllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
+ [LibraryImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
internal static partial int CGContextClipToRects(IntPtr context, Rect[] clip_rects, int count);
- [GeneratedDllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
+ [LibraryImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
internal static partial void CGContextTranslateCTM(IntPtr context, float tx, float ty);
- [GeneratedDllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
+ [LibraryImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
internal static partial void CGContextScaleCTM(IntPtr context, float x, float y);
- [GeneratedDllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
+ [LibraryImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
internal static partial void CGContextFlush(IntPtr context);
- [GeneratedDllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
+ [LibraryImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
internal static partial void CGContextSynchronize(IntPtr context);
- [GeneratedDllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
+ [LibraryImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
internal static partial IntPtr CGPathCreateMutable();
- [GeneratedDllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
+ [LibraryImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
internal static partial void CGPathAddRects(IntPtr path, IntPtr _void, Rect[] rects, int count);
- [GeneratedDllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
+ [LibraryImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
internal static partial void CGPathAddRect(IntPtr path, IntPtr _void, Rect rect);
- [GeneratedDllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
+ [LibraryImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
internal static partial void CGContextAddRects(IntPtr context, Rect[] rects, int count);
- [GeneratedDllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
+ [LibraryImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
internal static partial void CGContextAddRect(IntPtr context, Rect rect);
- [GeneratedDllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
+ [LibraryImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
internal static partial void CGContextBeginPath(IntPtr context);
- [GeneratedDllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
+ [LibraryImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
internal static partial void CGContextClosePath(IntPtr context);
- [GeneratedDllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
+ [LibraryImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
internal static partial void CGContextAddPath(IntPtr context, IntPtr path);
- [GeneratedDllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
+ [LibraryImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
internal static partial void CGContextClip(IntPtr context);
- [GeneratedDllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
+ [LibraryImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
internal static partial void CGContextEOClip(IntPtr context);
- [GeneratedDllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
+ [LibraryImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
internal static partial void CGContextEOFillPath(IntPtr context);
- [GeneratedDllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
+ [LibraryImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
internal static partial void CGContextSaveGState(IntPtr context);
- [GeneratedDllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
+ [LibraryImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
internal static partial void CGContextRestoreGState(IntPtr context);
}
return expectedPermissions;
}
- [GeneratedDllImport("libc", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
+ [LibraryImport("libc", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
private static partial int mkfifo(string path, int mode);
}
}
[ActiveIssue("https://github.com/dotnet/runtime/issues/34583", TestPlatforms.Windows, TargetFrameworkMonikers.Netcoreapp, TestRuntimes.Mono)]
public partial class Directory_NotifyFilter_Tests : FileSystemWatcherTest
{
- [GeneratedDllImport("advapi32.dll", EntryPoint = "SetNamedSecurityInfoW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport("advapi32.dll", EntryPoint = "SetNamedSecurityInfoW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
private static partial uint SetSecurityInfoByHandle( string name, uint objectType, uint securityInformation,
IntPtr owner, IntPtr group, IntPtr dacl, IntPtr sacl);
[ActiveIssue("https://github.com/dotnet/runtime/issues/34583", TestPlatforms.Windows, TargetFrameworkMonikers.Netcoreapp, TestRuntimes.Mono)]
public partial class File_NotifyFilter_Tests : FileSystemWatcherTest
{
- [GeneratedDllImport("advapi32.dll", EntryPoint = "SetNamedSecurityInfoW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport("advapi32.dll", EntryPoint = "SetNamedSecurityInfoW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
private static partial uint SetSecurityInfoByHandle(string name, uint objectType, uint securityInformation,
IntPtr owner, IntPtr group, IntPtr dacl, IntPtr sacl);
{
public abstract partial class FileSystemTest
{
- [GeneratedDllImport("libc", SetLastError = true)]
+ [LibraryImport("libc", SetLastError = true)]
protected static partial int geteuid();
- [GeneratedDllImport("libc", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
+ [LibraryImport("libc", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
protected static partial int mkfifo(string path, int mode);
}
}
return pageSize;
});
- [GeneratedDllImport("libc", SetLastError = true)]
+ [LibraryImport("libc", SetLastError = true)]
private static partial int sysconf(int name);
- [GeneratedDllImport("libc", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
+ [LibraryImport("libc", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
protected static partial int mkfifo(string path, int mode);
/// <summary>Asserts that the handle's inheritability matches the specified value.</summary>
return pageSize;
});
- [GeneratedDllImport("kernel32.dll")]
+ [LibraryImport("kernel32.dll")]
[return: MarshalAs(UnmanagedType.Bool)]
private static partial bool GetHandleInformation(IntPtr hObject, out uint lpdwFlags);
private const uint HANDLE_FLAG_INHERIT = 0x00000001;
- [GeneratedDllImport("kernel32.dll")]
+ [LibraryImport("kernel32.dll")]
private static partial void GetSystemInfo(out SYSTEM_INFO input);
[StructLayout(LayoutKind.Sequential)]
Assert.NotNull(handle);
}
- [GeneratedDllImport("libc")]
+ [LibraryImport("libc")]
private static unsafe partial SafeMemoryMappedViewHandle mmap(IntPtr addr, nint lengthint, int prot, int flags, int fd, nuint offset);
}
}
<!--
Note that removing this attribute can change runtime behavior. For example,
System.Xml.Serialization will behave differently if a ctor is Obsolete.
- This is low enough risk on when 'System.AggressiveAttributeTrimming' is enabled to justify
+ This is low enough risk on when 'System.AggressiveAttributeTrimming' is enabled to justify
removing the attribute for size savings. The app developer can override this setting
to keep all ObsoleteAttributes.
-->
<type fullname="System.Diagnostics.CodeAnalysis.MemberNotNullWhenAttribute">
<attribute internal="RemoveAttributeInstances" />
</type>
- <type fullname="System.Runtime.InteropServices.GeneratedDllImportAttribute">
+ <type fullname="System.Runtime.InteropServices.LibraryImportAttribute">
<attribute internal="RemoveAttributeInstances" />
</type>
<type fullname="System.CodeDom.Compiler.GeneratedCodeAttribute">
return null;
}
- [GeneratedDllImport(RuntimeHelpers.QCall)]
+ [LibraryImport(RuntimeHelpers.QCall)]
[return: MarshalAs(UnmanagedType.Bool)]
private static partial bool IsEventSourceLoggingEnabled();
- [GeneratedDllImport(RuntimeHelpers.QCall, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(RuntimeHelpers.QCall, StringMarshalling = StringMarshalling.Utf16)]
private static partial void LogEventSource(int eventID, string? eventName, string eventSourceName, string payload);
private static readonly List<char> escape_seq = new List<char> { '\b', '\f', '\n', '\r', '\t', '\"', '\\' };
context.RegisterCompilationStartAction(
compilationContext =>
{
- // Nothing to do if the GeneratedDllImportAttribute is not in the compilation
- INamedTypeSymbol? generatedDllImportAttrType = compilationContext.Compilation.GetTypeByMetadataName(TypeNames.GeneratedDllImportAttribute);
- if (generatedDllImportAttrType == null)
+ // Nothing to do if the LibraryImportAttribute is not in the compilation
+ INamedTypeSymbol? libraryImportAttrType = compilationContext.Compilation.GetTypeByMetadataName(TypeNames.LibraryImportAttribute);
+ if (libraryImportAttrType == null)
return;
INamedTypeSymbol? marshalAsAttrType = compilationContext.Compilation.GetTypeByMetadataName(TypeNames.System_Runtime_InteropServices_MarshalAsAttribute);
if (dllImportData == null)
return;
- // Ignore methods already marked GeneratedDllImport
+ // Ignore methods already marked LibraryImport
// This can be the case when the generator creates an extern partial function for blittable signatures.
foreach (AttributeData attr in method.GetAttributes())
{
- if (attr.AttributeClass?.ToDisplayString() == TypeNames.GeneratedDllImportAttribute)
+ if (attr.AttributeClass?.ToDisplayString() == TypeNames.LibraryImportAttribute)
{
return;
}
return methodSyntax;
// We wouldn't have offered this code fix if the LibraryImport type isn't available, so we can be sure it isn't null here.
- INamedTypeSymbol generatedDllImportAttrType = editor.SemanticModel.Compilation.GetTypeByMetadataName(TypeNames.GeneratedDllImportAttribute)!;
+ INamedTypeSymbol libraryImportAttrType = editor.SemanticModel.Compilation.GetTypeByMetadataName(TypeNames.LibraryImportAttribute)!;
// Make sure the method has the DllImportAttribute
if (!TryGetAttribute(methodSymbol, dllImportAttrType, out AttributeData? dllImportAttr))
generator,
dllImportSyntax,
methodSymbol,
- generatedDllImportAttrType,
+ libraryImportAttrType,
entryPointSuffix,
out SyntaxNode? unmanagedCallConvAttributeMaybe);
SyntaxGenerator generator,
AttributeSyntax dllImportSyntax,
IMethodSymbol methodSymbol,
- INamedTypeSymbol generatedDllImportAttrType,
+ INamedTypeSymbol libraryImportAttrType,
char? entryPointSuffix,
out SyntaxNode? unmanagedCallConvAttributeMaybe)
{
// Create LibraryImport based on the DllImport attribute
SyntaxNode libraryImportSyntax = generator.ReplaceNode(dllImportSyntax,
dllImportSyntax.Name,
- generator.TypeExpression(generatedDllImportAttrType));
+ generator.TypeExpression(libraryImportAttrType));
// Update attribute arguments for LibraryImport
bool hasEntryPointAttributeArgument = false;
{
MethodDeclarationSyntax syntax = (MethodDeclarationSyntax)context.Node;
if (context.SemanticModel.GetDeclaredSymbol(syntax, ct) is IMethodSymbol methodSymbol
- && methodSymbol.GetAttributes().Any(static attribute => attribute.AttributeClass?.ToDisplayString() == TypeNames.GeneratedDllImportAttribute))
+ && methodSymbol.GetAttributes().Any(static attribute => attribute.AttributeClass?.ToDisplayString() == TypeNames.LibraryImportAttribute))
{
return new { Syntax = syntax, Symbol = methodSymbol };
}
};
}
- private static LibraryImportData? ProcessGeneratedDllImportAttribute(AttributeData attrData)
+ private static LibraryImportData? ProcessLibraryImportAttribute(AttributeData attrData)
{
- // Found the GeneratedDllImport, but it has an error so report the error.
+ // Found the LibraryImport, but it has an error so report the error.
// This is most likely an issue with targeting an incorrect TFM.
if (attrData.AttributeClass?.TypeKind is null or TypeKind.Error)
{
foreach (AttributeData attr in symbol.GetAttributes())
{
if (attr.AttributeClass is not null
- && attr.AttributeClass.ToDisplayString() == TypeNames.GeneratedDllImportAttribute)
+ && attr.AttributeClass.ToDisplayString() == TypeNames.LibraryImportAttribute)
{
generatedDllImportAttr = attr;
}
var generatorDiagnostics = new GeneratorDiagnostics();
- // Process the GeneratedDllImport attribute
- LibraryImportData? libraryImportData = ProcessGeneratedDllImportAttribute(generatedDllImportAttr!);
+ // Process the LibraryImport attribute
+ LibraryImportData? libraryImportData = ProcessLibraryImportAttribute(generatedDllImportAttr!);
if (libraryImportData is null)
{
if (lcidConversionAttr is not null)
{
- // Using LCIDConversion with GeneratedDllImport is not supported
+ // Using LCIDConversion with LibraryImport is not supported
generatorDiagnostics.ReportConfigurationNotSupported(lcidConversionAttr, nameof(TypeNames.LCIDConversionAttribute));
}
{
diagnostics.ReportCannotForwardToDllImport(
userDeclaredMethod,
- $"{nameof(TypeNames.GeneratedDllImportAttribute)}{Type.Delimiter}{nameof(StringMarshalling)}",
+ $"{nameof(TypeNames.LibraryImportAttribute)}{Type.Delimiter}{nameof(StringMarshalling)}",
$"{nameof(StringMarshalling)}{Type.Delimiter}{pinvokeData.StringMarshalling}");
pinvokeData = pinvokeData with { IsUserDefined = pinvokeData.IsUserDefined & ~LibraryImportMember.StringMarshalling };
{
diagnostics.ReportCannotForwardToDllImport(
userDeclaredMethod,
- $"{nameof(TypeNames.GeneratedDllImportAttribute)}{Type.Delimiter}{nameof(LibraryImportMember.StringMarshallingCustomType)}");
+ $"{nameof(TypeNames.LibraryImportAttribute)}{Type.Delimiter}{nameof(LibraryImportMember.StringMarshallingCustomType)}");
pinvokeData = pinvokeData with { IsUserDefined = pinvokeData.IsUserDefined & ~LibraryImportMember.StringMarshallingCustomType };
}
/// This type enables multiple code generators for P/Invoke-style marshalling
/// to reuse the same basic method body, but with different designs of how to emit the target native method.
/// This enables users to write code generators that work with slightly different semantics.
- /// For example, the source generator for [GeneratedDllImport] emits the target P/Invoke as
+ /// For example, the source generator for [LibraryImport] emits the target P/Invoke as
/// a local function inside the generated stub body.
/// However, other managed-to-native code generators using a P/Invoke style might want to define
/// the target DllImport outside of the stub as a static non-local function or as a function pointer field.
// for our lengths.
// Here's an example signature where the dependency shows up:
//
- // [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "transpose_matrix")]
+ // [LibraryImport(NativeExportsNE_Binary, EntryPoint = "transpose_matrix")]
// [return: MarshalUsing(CountElementName = "numColumns")]
// [return: MarshalUsing(CountElementName = "numRows", ElementIndirectionLevel = 1)]
// public static partial int[][] TransposeMatrix(
namespace Microsoft.Interop {
using System;
-
-
+
+
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
-
+
private static global::System.Resources.ResourceManager resourceMan;
-
+
private static global::System.Globalization.CultureInfo resourceCulture;
-
+
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
-
+
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
return resourceMan;
}
}
-
+
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
resourceCulture = value;
}
}
-
+
/// <summary>
/// Looks up a localized string similar to A type marked with 'BlittableTypeAttribute' must be blittable..
/// </summary>
return ResourceManager.GetString("BlittableTypeMustBeBlittableDescription", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to Type '{0}' is marked with 'BlittableTypeAttribute' but is not blittable.
/// </summary>
return ResourceManager.GetString("BlittableTypeMustBeBlittableMessage", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to When a constructor taking a Span<byte> is specified on the native type, the type must also have a public integer constant named BufferSize to provide the size of the caller-allocated buffer..
/// </summary>
return ResourceManager.GetString("CallerAllocConstructorMustHaveBufferSizeConstantDescription", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to The native type '{0}' must have a 'public const int BufferSize' field that specifies the size of the stack buffer because it has a constructor that takes a caller-allocated Span<byte>.
/// </summary>
return ResourceManager.GetString("CallerAllocConstructorMustHaveBufferSizeConstantMessage", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to A type that supports marshalling from managed to native using a caller-allocated buffer should also support marshalling from managed to native where using a caller-allocated buffer is impossible..
/// </summary>
return ResourceManager.GetString("CallerAllocMarshallingShouldSupportAllocatingMarshallingFallbackDescription", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to Native type '{0}' has a constructor taking a caller-allocated buffer, but does not support marshalling in scenarios where using a caller-allocated buffer is impossible.
/// </summary>
return ResourceManager.GetString("CallerAllocMarshallingShouldSupportAllocatingMarshallingFallbackMessage", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to The generated 'DllImportAttribute' will not have a value corresponding to '{0}'..
/// </summary>
return ResourceManager.GetString("CannotForwardToDllImportDescription", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to '{0}' has no equivalent in 'DllImportAtttribute' and will not be forwarded.
/// </summary>
return ResourceManager.GetString("CannotForwardToDllImportMessage", resourceCulture);
}
}
-
+
/// <summary>
- /// Looks up a localized string similar to Specified 'GeneratedDllImportAttribute' arguments cannot be forwarded to 'DllImportAttribute'.
+ /// Looks up a localized string similar to Specified 'LibraryImportAttribute' arguments cannot be forwarded to 'DllImportAttribute'.
/// </summary>
internal static string CannotForwardToDllImportTitle {
get {
return ResourceManager.GetString("CannotForwardToDllImportTitle", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to The 'BlittableTypeAttribute' and 'NativeMarshallingAttribute' attributes are mutually exclusive..
/// </summary>
return ResourceManager.GetString("CannotHaveMultipleMarshallingAttributesDescription", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to Type '{0}' is marked with 'BlittableTypeAttribute' and 'NativeMarshallingAttribute'. A type can only have one of these two attributes..
/// </summary>
return ResourceManager.GetString("CannotHaveMultipleMarshallingAttributesMessage", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to A native type with the 'GenericContiguousCollectionMarshallerAttribute' must have at least one of the two marshalling methods as well as a 'ManagedValues' property of type 'Span<T>' for some 'T' and a 'NativeValueStorage' property of type 'Span<byte>' to enable marshalling the managed type..
/// </summary>
return ResourceManager.GetString("CollectionNativeTypeMustHaveRequiredShapeDescription", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to The native type '{0}' must be a value type and have a constructor that takes two parameters, one of type '{1}' and an 'int', or have a parameterless instance method named 'ToManaged' that returns '{1}' as well as a 'ManagedValues' property of type 'Span<T>' for some 'T' and a 'NativeValueStorage' property of type 'Span<byte>'.
/// </summary>
return ResourceManager.GetString("CollectionNativeTypeMustHaveRequiredShapeMessage", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to Source-generated P/Invokes will ignore any configuration that is not supported..
/// </summary>
return ResourceManager.GetString("ConfigurationNotSupportedDescription", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to The '{0}' configuration is not supported by source-generated P/Invokes. If the specified configuration is required, use a regular `DllImport` instead..
/// </summary>
return ResourceManager.GetString("ConfigurationNotSupportedMessage", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to The specified marshalling configuration is not supported by source-generated P/Invokes. {0}..
/// </summary>
return ResourceManager.GetString("ConfigurationNotSupportedMessageMarshallingInfo", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to The specified '{0}' configuration for parameter '{1}' is not supported by source-generated P/Invokes. If the specified configuration is required, use a regular `DllImport` instead..
/// </summary>
return ResourceManager.GetString("ConfigurationNotSupportedMessageParameter", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to The specified '{0}' configuration for the return value of method '{1}' is not supported by source-generated P/Invokes. If the specified configuration is required, use a regular `DllImport` instead..
/// </summary>
return ResourceManager.GetString("ConfigurationNotSupportedMessageReturn", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to The specified value '{0}' for '{1}' is not supported by source-generated P/Invokes. If the specified configuration is required, use a regular `DllImport` instead..
/// </summary>
return ResourceManager.GetString("ConfigurationNotSupportedMessageValue", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to Specified configuration is not supported by source-generated P/Invokes..
/// </summary>
return ResourceManager.GetString("ConfigurationNotSupportedTitle", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to Only one of 'ConstantElementCount' or 'ElementCountInfo' may be used in a 'MarshalUsingAttribute' for a given 'ElementIndirectionLevel'.
/// </summary>
return ResourceManager.GetString("ConstantAndElementCountInfoDisallowed", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to Automatically converting a P/Invoke with 'PreserveSig' set to 'false' to a source-generated P/Invoke may produce invalid code.
/// </summary>
return ResourceManager.GetString("ConvertNoPreserveSigDllImportToGeneratedMayProduceInvalidCode", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to Convert to 'LibraryImport'.
/// </summary>
return ResourceManager.GetString("ConvertToLibraryImport", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to Use 'LibraryImportAttribute' instead of 'DllImportAttribute' to generate P/Invoke marshalling code at compile time.
/// </summary>
return ResourceManager.GetString("ConvertToLibraryImportDescription", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to Mark the method '{0}' with 'LibraryImportAttribute' instead of 'DllImportAttribute' to generate P/Invoke marshalling code at compile time.
/// </summary>
return ResourceManager.GetString("ConvertToLibraryImportMessage", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to Use 'LibraryImportAttribute' instead of 'DllImportAttribute' to generate P/Invoke marshalling code at compile time.
/// </summary>
return ResourceManager.GetString("ConvertToLibraryImportTitle", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to Conversion to 'LibraryImport' may change behavior and compatibility. See {0} for more information..
/// </summary>
return ResourceManager.GetString("ConvertToLibraryImportWarning", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to Convert to 'LibraryImport' with '{0}' suffix.
/// </summary>
return ResourceManager.GetString("ConvertToLibraryImportWithSuffix", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to The specified parameter needs to be marshalled from managed to native, but the native type '{0}' does not support it..
/// </summary>
return ResourceManager.GetString("CustomTypeMarshallingManagedToNativeUnsupported", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to The specified parameter needs to be marshalled from native to managed, but the native type '{0}' does not support it..
/// </summary>
return ResourceManager.GetString("CustomTypeMarshallingNativeToManagedUnsupported", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to The return type of 'GetPinnableReference' (after accounting for 'ref') must be blittable..
/// </summary>
return ResourceManager.GetString("GetPinnableReferenceReturnTypeBlittableDescription", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to The dereferenced type of the return type of the 'GetPinnableReference' method must be blittable.
/// </summary>
return ResourceManager.GetString("GetPinnableReferenceReturnTypeBlittableMessage", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to A type that supports marshalling from managed to native by pinning should also support marshalling from managed to native where pinning is impossible..
/// </summary>
return ResourceManager.GetString("GetPinnableReferenceShouldSupportAllocatingMarshallingFallbackDescription", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to Type '{0}' has a 'GetPinnableReference' method but its native type does not support marshalling in scenarios where pinning is impossible.
/// </summary>
return ResourceManager.GetString("GetPinnableReferenceShouldSupportAllocatingMarshallingFallbackMessage", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to Method '{0}' is contained in a type '{1}' that is not marked 'partial'. P/Invoke source generation will ignore method '{0}'..
/// </summary>
return ResourceManager.GetString("InvalidAttributedMethodContainingTypeMissingModifiersMessage", resourceCulture);
}
}
-
+
/// <summary>
- /// Looks up a localized string similar to Methods marked with 'GeneratedDllImportAttribute' should be 'static', 'partial', and non-generic. P/Invoke source generation will ignore methods that are non-'static', non-'partial', or generic..
+ /// Looks up a localized string similar to Methods marked with 'LibraryImportAttribute' should be 'static', 'partial', and non-generic. P/Invoke source generation will ignore methods that are non-'static', non-'partial', or generic..
/// </summary>
internal static string InvalidAttributedMethodDescription {
get {
return ResourceManager.GetString("InvalidAttributedMethodDescription", resourceCulture);
}
}
-
+
/// <summary>
- /// Looks up a localized string similar to Method '{0}' should be 'static', 'partial', and non-generic when marked with 'GeneratedDllImportAttribute'. P/Invoke source generation will ignore method '{0}'..
+ /// Looks up a localized string similar to Method '{0}' should be 'static', 'partial', and non-generic when marked with 'LibraryImportAttribute'. P/Invoke source generation will ignore method '{0}'..
/// </summary>
internal static string InvalidAttributedMethodSignatureMessage {
get {
return ResourceManager.GetString("InvalidAttributedMethodSignatureMessage", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to Invalid 'LibraryImportAttribute' usage.
/// </summary>
return ResourceManager.GetString("InvalidLibraryImportAttributeUsageTitle", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to The configuration of 'StringMarshalling' and 'StringMarshallingCustomType' is invalid..
/// </summary>
return ResourceManager.GetString("InvalidStringMarshallingConfigurationDescription", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to The configuration of 'StringMarshalling' and 'StringMarshallingCustomType' on method '{0}' is invalid. {1}.
/// </summary>
return ResourceManager.GetString("InvalidStringMarshallingConfigurationMessage", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to 'StringMarshallingCustomType' must be specified when 'StringMarshalling' is set to 'StringMarshalling.Custom'..
/// </summary>
return ResourceManager.GetString("InvalidStringMarshallingConfigurationMissingCustomType", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to 'StringMarshalling' should be set to 'StringMarshalling.Custom' when 'StringMarshallingCustomType' is specified..
/// </summary>
return ResourceManager.GetString("InvalidStringMarshallingConfigurationNotCustom", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to The use cases for 'GetPinnableReference' are not applicable in any scenarios where a 'Value' property is not also required..
/// </summary>
return ResourceManager.GetString("MarshallerGetPinnableReferenceRequiresValuePropertyDescription", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to The 'GetPinnableReference' method cannot be provided on the native type '{0}' unless a 'Value' property is also provided.
/// </summary>
return ResourceManager.GetString("MarshallerGetPinnableReferenceRequiresValuePropertyMessage", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to The native type '{0}' must be a closed generic so the emitted code can use a specific instantiation..
/// </summary>
return ResourceManager.GetString("NativeGenericTypeMustBeClosedDescription", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to The native type '{0}' must be a closed generic or have the same number of generic parameters as the managed type so the emitted code can use a specific instantiation..
/// </summary>
return ResourceManager.GetString("NativeGenericTypeMustBeClosedOrMatchArityDescription", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to The native type '{0}' for managed type '{1}' must be a closed generic type or have the same arity as the managed type..
/// </summary>
return ResourceManager.GetString("NativeGenericTypeMustBeClosedOrMatchArityMessage", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to A native type for a given type must be blittable..
/// </summary>
return ResourceManager.GetString("NativeTypeMustBeBlittableDescription", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to The native type '{0}' for the type '{1}' is not blittable.
/// </summary>
return ResourceManager.GetString("NativeTypeMustBeBlittableMessage", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to A native type for a given type must be non-null..
/// </summary>
return ResourceManager.GetString("NativeTypeMustBeNonNullDescription", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to The native type for the type '{0}' is null.
/// </summary>
return ResourceManager.GetString("NativeTypeMustBeNonNullMessage", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to The native type must be pointer sized so the pinned result of 'GetPinnableReference' can be cast to the native type..
/// </summary>
return ResourceManager.GetString("NativeTypeMustBePointerSizedDescription", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to The native type '{0}' must be pointer sized because the managed type '{1}' has a 'GetPinnableReference' method.
/// </summary>
return ResourceManager.GetString("NativeTypeMustBePointerSizedMessage", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to The native type must have at least one of the two marshalling methods to enable marshalling the managed type..
/// </summary>
return ResourceManager.GetString("NativeTypeMustHaveRequiredShapeDescription", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to The native type '{0}' must be a value type and have a constructor that takes one parameter of type '{1}' or a parameterless instance method named 'ToManaged' that returns '{1}'.
/// </summary>
return ResourceManager.GetString("NativeTypeMustHaveRequiredShapeMessage", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to The 'Value' property must not be a 'ref' or 'readonly ref' property..
/// </summary>
return ResourceManager.GetString("RefValuePropertyUnsupportedDescription", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to The 'Value' property on the native type '{0}' must not be a 'ref' or 'readonly ref' property..
/// </summary>
return ResourceManager.GetString("RefValuePropertyUnsupportedMessage", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to .
/// </summary>
return ResourceManager.GetString("RuntimeMarshallingMustBeDisabled", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to An abstract type derived from 'SafeHandle' cannot be marshalled by reference. The provided type must be concrete..
/// </summary>
return ResourceManager.GetString("SafeHandleByRefMustBeConcrete", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to P/Invoke source generation is not supported on unknown target framework v{0}. The generated source will not be compatible with other frameworks..
/// </summary>
return ResourceManager.GetString("TargetFrameworkNotSupportedDescription", resourceCulture);
}
}
-
+
/// <summary>
- /// Looks up a localized string similar to 'GeneratedDllImportAttribute' cannot be used for source-generated P/Invokes on an unknown target framework v{0}..
+ /// Looks up a localized string similar to 'LibraryImportAttribute' cannot be used for source-generated P/Invokes on an unknown target framework v{0}..
/// </summary>
internal static string TargetFrameworkNotSupportedMessage {
get {
return ResourceManager.GetString("TargetFrameworkNotSupportedMessage", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to Current target framework is not supported by source-generated P/Invokes.
/// </summary>
return ResourceManager.GetString("TargetFrameworkNotSupportedTitle", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to For types that are not supported by source-generated P/Invokes, the resulting P/Invoke will rely on the underlying runtime to marshal the specified type..
/// </summary>
return ResourceManager.GetString("TypeNotSupportedDescription", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to The type '{0}' is not supported by source-generated P/Invokes. The generated source will not handle marshalling of parameter '{1}'..
/// </summary>
return ResourceManager.GetString("TypeNotSupportedMessageParameter", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to {0} The generated source will not handle marshalling of parameter '{1}'..
/// </summary>
return ResourceManager.GetString("TypeNotSupportedMessageParameterWithDetails", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to The type '{0}' is not supported by source-generated P/Invokes. The generated source will not handle marshalling of the return value of method '{1}'..
/// </summary>
return ResourceManager.GetString("TypeNotSupportedMessageReturn", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to {0} The generated source will not handle marshalling of the return value of method '{1}'..
/// </summary>
return ResourceManager.GetString("TypeNotSupportedMessageReturnWithDetails", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to Specified type is not supported by source-generated P/Invokes.
/// </summary>
return ResourceManager.GetString("TypeNotSupportedTitle", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to The native type's 'Value' property must have a getter to support marshalling from managed to native..
/// </summary>
return ResourceManager.GetString("ValuePropertyMustHaveGetterDescription", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to The 'Value' property on the native type '{0}' must have a getter.
/// </summary>
return ResourceManager.GetString("ValuePropertyMustHaveGetterMessage", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to The native type's 'Value' property must have a setter to support marshalling from native to managed..
/// </summary>
return ResourceManager.GetString("ValuePropertyMustHaveSetterDescription", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to The 'Value' property on the native type '{0}' must have a setter.
/// </summary>
<?xml version="1.0" encoding="utf-8"?>
<root>
- <!--
- Microsoft ResX Schema
-
+ <!--
+ Microsoft ResX Schema
+
Version 2.0
-
- The primary goals of this format is to allow a simple XML format
- that is mostly human readable. The generation and parsing of the
- various data types are done through the TypeConverter classes
+
+ The primary goals of this format is to allow a simple XML format
+ that is mostly human readable. The generation and parsing of the
+ various data types are done through the TypeConverter classes
associated with the data types.
-
+
Example:
-
+
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
-
- There are any number of "resheader" rows that contain simple
+
+ There are any number of "resheader" rows that contain simple
name/value pairs.
-
- Each data row contains a name, and value. The row also contains a
- type or mimetype. Type corresponds to a .NET class that support
- text/value conversion through the TypeConverter architecture.
- Classes that don't support this are serialized and stored with the
+
+ Each data row contains a name, and value. The row also contains a
+ type or mimetype. Type corresponds to a .NET class that support
+ text/value conversion through the TypeConverter architecture.
+ Classes that don't support this are serialized and stored with the
mimetype set.
-
- The mimetype is used for serialized objects, and tells the
- ResXResourceReader how to depersist the object. This is currently not
+
+ The mimetype is used for serialized objects, and tells the
+ ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
-
- Note - application/x-microsoft.net.object.binary.base64 is the format
- that the ResXResourceWriter will generate, however the reader can
+
+ Note - application/x-microsoft.net.object.binary.base64 is the format
+ that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
-
+
mimetype: application/x-microsoft.net.object.binary.base64
- value : The object must be serialized with
+ value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
-
+
mimetype: application/x-microsoft.net.object.soap.base64
- value : The object must be serialized with
+ value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
- value : The object must be serialized into a byte array
+ value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<value>'{0}' has no equivalent in 'DllImportAtttribute' and will not be forwarded</value>
</data>
<data name="CannotForwardToDllImportTitle" xml:space="preserve">
- <value>Specified 'GeneratedDllImportAttribute' arguments cannot be forwarded to 'DllImportAttribute'</value>
+ <value>Specified 'LibraryImportAttribute' arguments cannot be forwarded to 'DllImportAttribute'</value>
</data>
<data name="CannotHaveMultipleMarshallingAttributesDescription" xml:space="preserve">
<value>The 'BlittableTypeAttribute' and 'NativeMarshallingAttribute' attributes are mutually exclusive.</value>
<value>Method '{0}' is contained in a type '{1}' that is not marked 'partial'. P/Invoke source generation will ignore method '{0}'.</value>
</data>
<data name="InvalidAttributedMethodDescription" xml:space="preserve">
- <value>Methods marked with 'GeneratedDllImportAttribute' should be 'static', 'partial', and non-generic. P/Invoke source generation will ignore methods that are non-'static', non-'partial', or generic.</value>
+ <value>Methods marked with 'LibraryImportAttribute' should be 'static', 'partial', and non-generic. P/Invoke source generation will ignore methods that are non-'static', non-'partial', or generic.</value>
</data>
<data name="InvalidAttributedMethodSignatureMessage" xml:space="preserve">
- <value>Method '{0}' should be 'static', 'partial', and non-generic when marked with 'GeneratedDllImportAttribute'. P/Invoke source generation will ignore method '{0}'.</value>
+ <value>Method '{0}' should be 'static', 'partial', and non-generic when marked with 'LibraryImportAttribute'. P/Invoke source generation will ignore method '{0}'.</value>
</data>
<data name="InvalidLibraryImportAttributeUsageTitle" xml:space="preserve">
<value>Invalid 'LibraryImportAttribute' usage</value>
<comment>{0} is a version number</comment>
</data>
<data name="TargetFrameworkNotSupportedMessage" xml:space="preserve">
- <value>'GeneratedDllImportAttribute' cannot be used for source-generated P/Invokes on an unknown target framework v{0}.</value>
+ <value>'LibraryImportAttribute' cannot be used for source-generated P/Invokes on an unknown target framework v{0}.</value>
<comment>{0} is a version number</comment>
</data>
<data name="TargetFrameworkNotSupportedTitle" xml:space="preserve">
if (_defaultInfo.CharEncoding == CharEncoding.Custom && _defaultInfo.StringMarshallingCustomType is not null)
{
AttributeData attrData = _contextSymbol is IMethodSymbol
- ? _contextSymbol.GetAttributes().First(a => a.AttributeClass.ToDisplayString() == TypeNames.GeneratedDllImportAttribute)
+ ? _contextSymbol.GetAttributes().First(a => a.AttributeClass.ToDisplayString() == TypeNames.LibraryImportAttribute)
: default;
marshallingInfo = CreateNativeMarshallingInfo(type, _defaultInfo.StringMarshallingCustomType, attrData, true, indirectionLevel, parsedCountInfo, useSiteAttributes, inspectedElements, ref maxIndirectionLevelUsed);
return true;
namespace Microsoft.Interop {
using System;
-
-
+
+
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
-
+
private static global::System.Resources.ResourceManager resourceMan;
-
+
private static global::System.Globalization.CultureInfo resourceCulture;
-
+
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
-
+
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
return resourceMan;
}
}
-
+
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
resourceCulture = value;
}
}
-
+
/// <summary>
/// Looks up a localized string similar to Marshalling an array from unmanaged to managed requires either the 'SizeParamIndex' or 'SizeConst' fields to be set on a 'MarshalAsAttribute' or the 'ConstantElementCount' or 'CountElementName' properties to be set on a 'MarshalUsingAttribute'..
/// </summary>
return ResourceManager.GetString("ArraySizeMustBeSpecified", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to The 'SizeParamIndex' value in the 'MarshalAsAttribute' is out of range..
/// </summary>
return ResourceManager.GetString("ArraySizeParamIndexOutOfRange", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to The 'BlittableTypeAttribute' and 'NativeMarshallingAttribute' attributes are mutually exclusive..
/// </summary>
return ResourceManager.GetString("CannotHaveMultipleMarshallingAttributesDescription", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to Type '{0}' is marked with 'BlittableTypeAttribute' and 'NativeMarshallingAttribute'. A type can only have one of these two attributes..
/// </summary>
return ResourceManager.GetString("CannotHaveMultipleMarshallingAttributesMessage", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to A native type with the 'GenericContiguousCollectionMarshallerAttribute' must have at least one of the two marshalling methods as well as a 'ManagedValues' property of type 'Span<T>' for some 'T' and a 'NativeValueStorage' property of type 'Span<byte>' to enable marshalling the managed type..
/// </summary>
return ResourceManager.GetString("CollectionNativeTypeMustHaveRequiredShapeDescription", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to The native type '{0}' must be a value type and have a constructor that takes two parameters, one of type '{1}' and an 'int', or have a parameterless instance method named 'ToManaged' that returns '{1}' as well as a 'ManagedValues' property of type 'Span<T>' for some 'T' and a 'NativeValueStorage' property of type 'Span<byte>'.
/// </summary>
return ResourceManager.GetString("CollectionNativeTypeMustHaveRequiredShapeMessage", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to The specified collection size parameter for an collection must be an integer type. If the size information is applied to a nested collection, the size parameter must be a collection of one less level of nesting with an integral element..
/// </summary>
return ResourceManager.GetString("CollectionSizeParamTypeMustBeIntegral", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to Only one of 'ConstantElementCount' or 'ElementCountInfo' may be used in a 'MarshalUsingAttribute' for a given 'ElementIndirectionLevel'.
/// </summary>
return ResourceManager.GetString("ConstantAndElementCountInfoDisallowed", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to The specified parameter needs to be marshalled from managed to native, but the native type '{0}' does not support it..
/// </summary>
return ResourceManager.GetString("CustomTypeMarshallingManagedToNativeUnsupported", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to The specified parameter needs to be marshalled from native to managed, but the native type '{0}' does not support it..
/// </summary>
return ResourceManager.GetString("CustomTypeMarshallingNativeToManagedUnsupported", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to This element cannot depend on '{0}' for collection size information without creating a dependency cycle.
/// </summary>
return ResourceManager.GetString("CyclicalCountInfo", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to Count information for a given element at a given indirection level can only be specified once.
/// </summary>
return ResourceManager.GetString("DuplicateCountInfo", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to Multiple marshalling attributes per element per indirection level is unsupported, but duplicate information was provided for indirection level {0}.
/// </summary>
return ResourceManager.GetString("DuplicateMarshallingInfo", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to Marshalling info was specified for 'ElementIndirectionLevel' {0}, but marshalling info was only needed for {1} level(s) of indirection.
/// </summary>
return ResourceManager.GetString("ExtraneousMarshallingInfo", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to The provided graph has cycles and cannot be topologically sorted..
/// </summary>
return ResourceManager.GetString("GraphHasCycles", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to The '[In]' attribute is not supported unless the '[Out]' attribute is also used. The behavior of the '[In]' attribute without the '[Out]' attribute is the same as the default behavior..
/// </summary>
return ResourceManager.GetString("InAttributeNotSupportedWithoutOut", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to The '[In]' and '[Out]' attributes are unsupported on parameters passed by reference. Use the 'in', 'ref', or 'out' keywords instead..
/// </summary>
return ResourceManager.GetString("InOutAttributeByRefNotSupported", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to The provided '[In]' and '[Out]' attributes on this parameter are unsupported on this parameter..
/// </summary>
return ResourceManager.GetString("InOutAttributeMarshalerNotSupported", resourceCulture);
}
}
-
+
/// <summary>
/// Marshalling bool without explicit marshalling information is not supported. Specify either 'MarshalUsingAttribute' or 'MarshalAsAttribute'..
/// </summary>
get {
return ResourceManager.GetString("MarshallingBoolAsUndefinedNotSupported", resourceCulture);
}
- }
-
+ }
+
/// <summary>
/// Looks up a localized string similar to Marshalling char with 'CharSet.{0}' is not supported. Instead, manually convert the char type to the desired byte representation and pass to the source-generated P/Invoke..
/// </summary>
return ResourceManager.GetString("MarshallingCharAsSpecifiedCharSetNotSupported", resourceCulture);
}
}
-
+
/// <summary>
- /// Looks up a localized string similar to Marshalling string or char without explicit marshalling information is not supported. Specify either 'GeneratedDllImportAttribute.CharSet' or 'MarshalAsAttribute'..
+ /// Looks up a localized string similar to Marshalling string or char without explicit marshalling information is not supported. Specify either 'LibraryImportAttribute.CharSet' or 'MarshalAsAttribute'..
/// </summary>
internal static string MarshallingStringOrCharAsUndefinedNotSupported {
get {
return ResourceManager.GetString("MarshallingStringOrCharAsUndefinedNotSupported", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to The native type '{0}' for managed type '{1}' must be a closed generic type or have the same arity as the managed type..
/// </summary>
return ResourceManager.GetString("NativeGenericTypeMustBeClosedOrMatchArityMessage", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to The native type must have at least one of the two marshalling methods to enable marshalling the managed type..
/// </summary>
return ResourceManager.GetString("NativeTypeMustHaveRequiredShapeDescription", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to The native type '{0}' must be a value type and have a constructor that takes one parameter of type '{1}' or a parameterless instance method named 'ToManaged' that returns '{1}'.
/// </summary>
return ResourceManager.GetString("NativeTypeMustHaveRequiredShapeMessage", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to The '[Out]' attribute is only supported on array parameters..
/// </summary>
return ResourceManager.GetString("OutByValueNotSupportedDescription", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to The '[Out]' attribute is not supported on the '{0}' parameter..
/// </summary>
return ResourceManager.GetString("OutByValueNotSupportedMessage", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to The 'Value' property must not be a 'ref' or 'readonly ref' property..
/// </summary>
return ResourceManager.GetString("RefValuePropertyUnsupportedDescription", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to The 'Value' property on the native type '{0}' must not be a 'ref' or 'readonly ref' property..
/// </summary>
return ResourceManager.GetString("RefValuePropertyUnsupportedMessage", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to Runtime marshalling must be disabled in this project by applying the 'System.Runtime.InteropServices.DisableRuntimeMarshallingAttribute' to the assembly to enable marshalling this type..
/// </summary>
return ResourceManager.GetString("RuntimeMarshallingMustBeDisabled", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to An abstract type derived from 'SafeHandle' cannot be marshalled by reference. The provided type must be concrete..
/// </summary>
return ResourceManager.GetString("SafeHandleByRefMustBeConcrete", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to Specified type is not supported by source-generated P/Invokes.
/// </summary>
return ResourceManager.GetString("TypeNotSupportedTitle", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to Marshalling a value between managed and native with a native type with a 'Value' property requires extra state, which is not supported in this context..
/// </summary>
return ResourceManager.GetString("ValuePropertyMarshallingRequiresAdditionalState", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to The native type's 'Value' property must have a getter to support marshalling from managed to native..
/// </summary>
return ResourceManager.GetString("ValuePropertyMustHaveGetterDescription", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to The 'Value' property on the native type '{0}' must have a getter.
/// </summary>
return ResourceManager.GetString("ValuePropertyMustHaveGetterMessage", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to The native type's 'Value' property must have a setter to support marshalling from native to managed..
/// </summary>
return ResourceManager.GetString("ValuePropertyMustHaveSetterDescription", resourceCulture);
}
}
-
+
/// <summary>
/// Looks up a localized string similar to The 'Value' property on the native type '{0}' must have a setter.
/// </summary>
<?xml version="1.0" encoding="utf-8"?>
<root>
- <!--
- Microsoft ResX Schema
-
+ <!--
+ Microsoft ResX Schema
+
Version 2.0
-
- The primary goals of this format is to allow a simple XML format
- that is mostly human readable. The generation and parsing of the
- various data types are done through the TypeConverter classes
+
+ The primary goals of this format is to allow a simple XML format
+ that is mostly human readable. The generation and parsing of the
+ various data types are done through the TypeConverter classes
associated with the data types.
-
+
Example:
-
+
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
-
- There are any number of "resheader" rows that contain simple
+
+ There are any number of "resheader" rows that contain simple
name/value pairs.
-
- Each data row contains a name, and value. The row also contains a
- type or mimetype. Type corresponds to a .NET class that support
- text/value conversion through the TypeConverter architecture.
- Classes that don't support this are serialized and stored with the
+
+ Each data row contains a name, and value. The row also contains a
+ type or mimetype. Type corresponds to a .NET class that support
+ text/value conversion through the TypeConverter architecture.
+ Classes that don't support this are serialized and stored with the
mimetype set.
-
- The mimetype is used for serialized objects, and tells the
- ResXResourceReader how to depersist the object. This is currently not
+
+ The mimetype is used for serialized objects, and tells the
+ ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
-
- Note - application/x-microsoft.net.object.binary.base64 is the format
- that the ResXResourceWriter will generate, however the reader can
+
+ Note - application/x-microsoft.net.object.binary.base64 is the format
+ that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
-
+
mimetype: application/x-microsoft.net.object.binary.base64
- value : The object must be serialized with
+ value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
-
+
mimetype: application/x-microsoft.net.object.soap.base64
- value : The object must be serialized with
+ value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
- value : The object must be serialized into a byte array
+ value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<value>Marshalling char with 'CharSet.{0}' is not supported. Instead, manually convert the char type to the desired byte representation and pass to the source-generated P/Invoke.</value>
</data>
<data name="MarshallingStringOrCharAsUndefinedNotSupported" xml:space="preserve">
- <value>Marshalling string or char without explicit marshalling information is not supported. Specify either 'GeneratedDllImportAttribute.CharSet' or 'MarshalAsAttribute'.</value>
+ <value>Marshalling string or char without explicit marshalling information is not supported. Specify either 'LibraryImportAttribute.CharSet' or 'MarshalAsAttribute'.</value>
</data>
<data name="OutByValueNotSupportedDescription" xml:space="preserve">
<value>The '[Out]' attribute is only supported on array parameters.</value>
public static class TypeNames
{
public const string DllImportAttribute = "System.Runtime.InteropServices.DllImportAttribute";
- public const string GeneratedDllImportAttribute = "System.Runtime.InteropServices.GeneratedDllImportAttribute";
+ public const string LibraryImportAttribute = "System.Runtime.InteropServices.LibraryImportAttribute";
public const string StringMarshalling = "System.Runtime.InteropServices.StringMarshalling";
public const string GeneratedMarshallingAttribute = "System.Runtime.InteropServices.GeneratedMarshallingAttribute";
</PropertyGroup>
<ItemGroup>
- <Compile Include="$(LibrariesProjectRoot)Common/src/System/Runtime/InteropServices/GeneratedDllImportAttribute.cs" Link="GeneratedDllImportAttribute.cs" />
+ <Compile Include="$(LibrariesProjectRoot)Common/src/System/Runtime/InteropServices/LibraryImportAttribute.cs" Link="LibraryImportAttribute.cs" />
<Compile Include="$(LibrariesProjectRoot)Common/src/System/Runtime/InteropServices/GeneratedMarshallingAttribute.cs" Link="GeneratedMarshallingAttribute.cs" />
<Compile Include="$(LibrariesProjectRoot)Common/src/System/Runtime/InteropServices/ArrayMarshaller.cs" Link="ArrayMarshaller.cs" />
<Compile Include="$(LibrariesProjectRoot)Common/src/System/Runtime/InteropServices/StringMarshalling.cs" Link="StringMarshalling.cs" />
{
public partial class Arrays
{
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "sum_int_array")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "sum_int_array")]
public static partial int Sum(int[] values, int numValues);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "sum_int_array")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "sum_int_array")]
public static partial int Sum(ref int values, int numValues);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "sum_int_array_ref")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "sum_int_array_ref")]
public static partial int SumInArray(in int[] values, int numValues);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "duplicate_int_array")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "duplicate_int_array")]
public static partial void Duplicate([MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1)] ref int[] values, int numValues);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "create_range_array")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "create_range_array")]
[return:MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 2)]
public static partial int[] CreateRange(int start, int end, out int numValues);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "create_range_array_out")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "create_range_array_out")]
public static partial void CreateRange_Out(int start, int end, out int numValues, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 2)] out int[] res);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "sum_char_array", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "sum_char_array", StringMarshalling = StringMarshalling.Utf16)]
public static partial int SumChars(char[] chars, int numElements);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "fill_char_array", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "fill_char_array", StringMarshalling = StringMarshalling.Utf16)]
public static partial void FillChars([Out] char[] chars, int length, ushort start);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "reverse_char_array", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "reverse_char_array", StringMarshalling = StringMarshalling.Utf16)]
public static partial void ReverseChars([MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1)] ref char[] chars, int numElements);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "sum_string_lengths")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "sum_string_lengths")]
public static partial int SumStringLengths([MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.LPWStr)] string[] strArray);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "reverse_strings_replace")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "reverse_strings_replace")]
public static partial void ReverseStrings_Ref([MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.LPWStr, SizeParamIndex = 1)] ref string[] strArray, out int numElements);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "reverse_strings_return")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "reverse_strings_return")]
[return: MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.LPWStr, SizeParamIndex = 1)]
public static partial string[] ReverseStrings_Return([MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.LPWStr)] string[] strArray, out int numElements);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "reverse_strings_out")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "reverse_strings_out")]
public static partial void ReverseStrings_Out([MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.LPWStr)] string[] strArray, out int numElements, [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.LPWStr, SizeParamIndex = 1)] out string[] res);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "get_long_bytes")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "get_long_bytes")]
[return:MarshalAs(UnmanagedType.LPArray, SizeConst = sizeof(long))]
public static partial byte[] GetLongBytes(long l);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "append_int_to_array")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "append_int_to_array")]
public static partial void Append([MarshalAs(UnmanagedType.LPArray, SizeConst = 1, SizeParamIndex = 1)] ref int[] values, int numOriginalValues, int newValue);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "fill_range_array")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "fill_range_array")]
[return: MarshalAs(UnmanagedType.U1)]
public static partial bool FillRangeArray([Out] IntStructWrapper[] array, int length, int start);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "double_values")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "double_values")]
public static partial void DoubleValues([In, Out] IntStructWrapper[] array, int length);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "and_all_members")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "and_all_members")]
[return:MarshalAs(UnmanagedType.U1)]
public static partial bool AndAllMembers(BoolStruct[] pArray, int length);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "transpose_matrix")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "transpose_matrix")]
[return: MarshalUsing(CountElementName = "numColumns")]
[return: MarshalUsing(CountElementName = "numRows", ElementIndirectionLevel = 1)]
public static partial int[][] TransposeMatrix(int[][] matrix, int[] numRows, int numColumns);
{
partial class NativeExportsNE
{
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "blittablestructs_return_instance")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "blittablestructs_return_instance")]
public static partial IntFields DoubleIntFields(IntFields result);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "blittablestructs_double_intfields_byref")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "blittablestructs_double_intfields_byref")]
public static partial void DoubleIntFieldsByRef(ref IntFields result);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "blittablestructs_double_intfields_byref")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "blittablestructs_double_intfields_byref")]
public static partial void DoubleIntFieldsByRefIn(in IntFields result);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "blittablestructs_double_intfields_refreturn")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "blittablestructs_double_intfields_refreturn")]
public static partial void DoubleIntFieldsRefReturn(
IntFields input,
ref IntFields result);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "blittablestructs_double_intfields_refreturn")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "blittablestructs_double_intfields_refreturn")]
public static partial void DoubleIntFieldsOutReturn(
IntFields input,
out IntFields result);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "blittablestructs_increment_invert_ptrfields_byref")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "blittablestructs_increment_invert_ptrfields_byref")]
public static partial void IncrementInvertPointerFieldsByRef(ref PointerFields result);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "blittablestructs_increment_invert_ptrfields_byref")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "blittablestructs_increment_invert_ptrfields_byref")]
public static partial void IncrementInvertPointerFieldsByRefIn(in PointerFields result);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "blittablestructs_increment_invert_ptrfields_refreturn")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "blittablestructs_increment_invert_ptrfields_refreturn")]
public static partial void IncrementInvertPointerFieldsRefReturn(
PointerFields input,
ref PointerFields result);
{
partial class NativeExportsNE
{
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "bytebool_return_as_uint")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "bytebool_return_as_uint")]
public static partial uint ReturnByteBoolAsUInt([MarshalAs(UnmanagedType.U1)] bool input);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "bytebool_return_as_uint")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "bytebool_return_as_uint")]
public static partial uint ReturnSByteBoolAsUInt([MarshalAs(UnmanagedType.I1)] bool input);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "variantbool_return_as_uint")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "variantbool_return_as_uint")]
public static partial uint ReturnVariantBoolAsUInt([MarshalAs(UnmanagedType.VariantBool)] bool input);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "winbool_return_as_uint")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "winbool_return_as_uint")]
public static partial uint ReturnIntBoolAsUInt([MarshalAs(UnmanagedType.I4)] bool input);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "winbool_return_as_uint")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "winbool_return_as_uint")]
public static partial uint ReturnUIntBoolAsUInt([MarshalAs(UnmanagedType.U4)] bool input);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "winbool_return_as_uint")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "winbool_return_as_uint")]
public static partial uint ReturnWinBoolAsUInt([MarshalAs(UnmanagedType.Bool)] bool input);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "winbool_return_as_uint")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "winbool_return_as_uint")]
[return: MarshalAs(UnmanagedType.U1)]
public static partial bool ReturnUIntAsByteBool(uint input);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "winbool_return_as_uint")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "winbool_return_as_uint")]
[return: MarshalAs(UnmanagedType.VariantBool)]
public static partial bool ReturnUIntAsVariantBool(uint input);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "winbool_return_as_uint")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "winbool_return_as_uint")]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool ReturnUIntAsWinBool(uint input);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "winbool_return_as_refuint")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "winbool_return_as_refuint")]
public static partial void ReturnUIntAsByteBool_Ref(uint input, [MarshalAs(UnmanagedType.U1)] ref bool res);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "winbool_return_as_refuint")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "winbool_return_as_refuint")]
public static partial void ReturnUIntAsByteBool_Out(uint input, [MarshalAs(UnmanagedType.U1)] out bool res);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "winbool_return_as_refuint")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "winbool_return_as_refuint")]
public static partial void ReturnUIntAsByteBool_In(uint input, [MarshalAs(UnmanagedType.U1)] in bool res);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "winbool_return_as_refuint")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "winbool_return_as_refuint")]
public static partial void ReturnUIntAsVariantBool_Ref(uint input, [MarshalAs(UnmanagedType.VariantBool)] ref bool res);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "winbool_return_as_refuint")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "winbool_return_as_refuint")]
public static partial void ReturnUIntAsVariantBool_Out(uint input, [MarshalAs(UnmanagedType.VariantBool)] out bool res);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "winbool_return_as_refuint")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "winbool_return_as_refuint")]
public static partial void ReturnUIntAsVariantBool_In(uint input, [MarshalAs(UnmanagedType.VariantBool)] in bool res);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "winbool_return_as_refuint")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "winbool_return_as_refuint")]
public static partial void ReturnUIntAsWinBool_Ref(uint input, [MarshalAs(UnmanagedType.Bool)] ref bool res);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "winbool_return_as_refuint")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "winbool_return_as_refuint")]
public static partial void ReturnUIntAsWinBool_Out(uint input, [MarshalAs(UnmanagedType.Bool)] out bool res);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "winbool_return_as_refuint")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "winbool_return_as_refuint")]
public static partial void ReturnUIntAsWinBool_In(uint input, [MarshalAs(UnmanagedType.Bool)] in bool res);
}
{
internal partial class CallingConventions
{
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "add_integers_cdecl")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "add_integers_cdecl")]
[UnmanagedCallConv(CallConvs = new[] { typeof(CallConvCdecl) })]
public static partial long AddLongsCdecl(long i, long j, long k, long l, long m, long n, long o, long p, long q);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "add_integers_stdcall")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "add_integers_stdcall")]
[UnmanagedCallConv(CallConvs = new[] { typeof(CallConvStdcall) })]
public static partial long AddLongsStdcall(long i, long j, long k, long l, long m, long n, long o, long p, long q);
}
{
partial class NativeExportsNE
{
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "unicode_return_as_uint", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "unicode_return_as_uint", StringMarshalling = StringMarshalling.Utf16)]
public static partial uint ReturnUnicodeAsUInt(char input);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "char_return_as_uint", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "char_return_as_uint", StringMarshalling = StringMarshalling.Utf16)]
public static partial char ReturnUIntAsUnicode(uint input);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "char_return_as_refuint", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "char_return_as_refuint", StringMarshalling = StringMarshalling.Utf16)]
public static partial void ReturnUIntAsUnicode_Ref(uint input, ref char res);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "char_return_as_refuint", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "char_return_as_refuint", StringMarshalling = StringMarshalling.Utf16)]
public static partial void ReturnUIntAsUnicode_Out(uint input, out char res);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "char_return_as_refuint", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "char_return_as_refuint", StringMarshalling = StringMarshalling.Utf16)]
public static partial void ReturnUIntAsUnicode_In(uint input, in char res);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "char_return_as_uint", StringMarshalling = StringMarshalling.Utf8)]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "char_return_as_uint", StringMarshalling = StringMarshalling.Utf8)]
[return: MarshalAs(UnmanagedType.U2)]
public static partial char ReturnU2AsU2IgnoreCharSet([MarshalAs(UnmanagedType.U2)] char input);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "char_return_as_uint", StringMarshalling = StringMarshalling.Utf8)]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "char_return_as_uint", StringMarshalling = StringMarshalling.Utf8)]
[return: MarshalAs(UnmanagedType.I2)]
public static partial char ReturnI2AsI2IgnoreCharSet([MarshalAs(UnmanagedType.I2)] char input);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "char_reverse_buffer_ref", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "char_reverse_buffer_ref", StringMarshalling = StringMarshalling.Utf16)]
public static partial void ReverseBuffer(ref char buffer, int len);
}
{
public partial class Collections
{
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "sum_int_array")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "sum_int_array")]
public static partial int Sum([MarshalUsing(typeof(ListMarshaller<int>))] List<int> values, int numValues);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "sum_int_array")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "sum_int_array")]
public static partial int Sum(ref int values, int numValues);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "sum_int_array_ref")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "sum_int_array_ref")]
public static partial int SumInArray([MarshalUsing(typeof(ListMarshaller<int>))] in List<int> values, int numValues);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "duplicate_int_array")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "duplicate_int_array")]
public static partial void Duplicate([MarshalUsing(typeof(ListMarshaller<int>), CountElementName = "numValues")] ref List<int> values, int numValues);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "create_range_array")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "create_range_array")]
[return:MarshalUsing(typeof(ListMarshaller<int>), CountElementName = "numValues")]
public static partial List<int> CreateRange(int start, int end, out int numValues);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "create_range_array_out")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "create_range_array_out")]
public static partial void CreateRange_Out(int start, int end, out int numValues, [MarshalUsing(typeof(ListMarshaller<int>), CountElementName = "numValues")] out List<int> res);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "sum_string_lengths")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "sum_string_lengths")]
public static partial int SumStringLengths([MarshalUsing(typeof(ListMarshaller<string>)), MarshalUsing(typeof(Utf16StringMarshaller), ElementIndirectionLevel = 1)] List<string> strArray);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "reverse_strings_replace")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "reverse_strings_replace")]
public static partial void ReverseStrings_Ref([MarshalUsing(typeof(ListMarshaller<string>), CountElementName = "numElements"), MarshalUsing(typeof(Utf16StringMarshaller), ElementIndirectionLevel = 1)] ref List<string> strArray, out int numElements);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "reverse_strings_return")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "reverse_strings_return")]
[return: MarshalUsing(typeof(ListMarshaller<string>), CountElementName = "numElements"), MarshalUsing(typeof(Utf16StringMarshaller), ElementIndirectionLevel = 1)]
public static partial List<string> ReverseStrings_Return([MarshalUsing(typeof(ListMarshaller<string>), CountElementName = "numElements"), MarshalUsing(typeof(Utf16StringMarshaller), ElementIndirectionLevel = 1)] List<string> strArray, out int numElements);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "reverse_strings_out")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "reverse_strings_out")]
public static partial void ReverseStrings_Out(
[MarshalUsing(typeof(ListMarshaller<string>)), MarshalUsing(typeof(Utf16StringMarshaller), ElementIndirectionLevel = 1)] List<string> strArray,
out int numElements,
[MarshalUsing(typeof(ListMarshaller<string>), CountElementName = "numElements"), MarshalUsing(typeof(Utf16StringMarshaller), ElementIndirectionLevel = 1)] out List<string> res);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "get_long_bytes")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "get_long_bytes")]
[return:MarshalUsing(typeof(ListMarshaller<byte>), ConstantElementCount = sizeof(long))]
public static partial List<byte> GetLongBytes(long l);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "and_all_members")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "and_all_members")]
[return:MarshalAs(UnmanagedType.U1)]
public static partial bool AndAllMembers([MarshalUsing(typeof(ListMarshaller<BoolStruct>))] List<BoolStruct> pArray, int length);
}
{
partial class NativeExportsNE
{
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "stringcontainer_deepduplicate")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "stringcontainer_deepduplicate")]
public static partial void DeepDuplicateStrings(StringContainer strings, out StringContainer pStringsOut);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "stringcontainer_reverse_strings")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "stringcontainer_reverse_strings")]
public static partial void ReverseStrings(ref StringContainer strings);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "get_long_bytes_as_double")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "get_long_bytes_as_double")]
public static partial double GetLongBytesAsDouble([MarshalUsing(typeof(DoubleToLongMarshaler))] double d);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "negate_bools")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "negate_bools")]
public static partial void NegateBools(
BoolStruct boolStruct,
out BoolStruct pBoolStructOut);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "and_bools_ref")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "and_bools_ref")]
[return: MarshalAs(UnmanagedType.U1)]
public static partial bool AndBoolsRef(in BoolStruct boolStruct);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "double_int_ref")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "double_int_ref")]
public static partial IntWrapper DoubleIntRef(IntWrapper pInt);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "reverse_replace_ref_ushort")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "reverse_replace_ref_ushort")]
public static partial void ReverseReplaceString([MarshalUsing(typeof(Utf16StringMarshaller))] ref string s);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "return_length_ushort")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "return_length_ushort")]
public static partial int ReturnStringLength([MarshalUsing(typeof(Utf16StringMarshaller))] string s);
}
{
public delegate void VoidVoid();
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "invoke_callback_after_gc")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "invoke_callback_after_gc")]
public static partial void InvokeAfterGC(VoidVoid cb);
public delegate int IntIntInt(int a, int b);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "invoke_callback_blittable_args")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "invoke_callback_blittable_args")]
public static partial int InvokeWithBlittableArgument(IntIntInt cb, int a, int b);
}
{
public partial class IntEnum
{
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "subtract_return_int")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "subtract_return_int")]
public static partial EnumTests.IntEnum Subtract_Return(EnumTests.IntEnum a, EnumTests.IntEnum b);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "subtract_out_int")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "subtract_out_int")]
public static partial void Subtract_Out(EnumTests.IntEnum a, EnumTests.IntEnum b, out EnumTests.IntEnum c);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "subtract_ref_int")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "subtract_ref_int")]
public static partial void Subtract_Ref(EnumTests.IntEnum a, ref EnumTests.IntEnum b);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "subtract_ref_int")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "subtract_ref_int")]
public static partial void Subtract_In(EnumTests.IntEnum a, in EnumTests.IntEnum b);
}
public partial class ByteEnum
{
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "subtract_return_byte")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "subtract_return_byte")]
public static partial EnumTests.ByteEnum Subtract_Return(EnumTests.ByteEnum a, EnumTests.ByteEnum b);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "subtract_out_byte")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "subtract_out_byte")]
public static partial void Subtract_Out(EnumTests.ByteEnum a, EnumTests.ByteEnum b, out EnumTests.ByteEnum c);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "subtract_ref_byte")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "subtract_ref_byte")]
public static partial void Subtract_Ref(EnumTests.ByteEnum a, ref EnumTests.ByteEnum b);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "subtract_ref_byte")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "subtract_ref_byte")]
public static partial void Subtract_In(EnumTests.ByteEnum a, in EnumTests.ByteEnum b);
}
}
{
public partial class FunctionPointer
{
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "invoke_managed_callback_after_gc")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "invoke_managed_callback_after_gc")]
public static unsafe partial void InvokeAfterGC(delegate* <void> cb);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "invoke_callback_after_gc")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "invoke_callback_after_gc")]
public static unsafe partial void InvokeAfterGC(delegate* unmanaged<void> cb);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "invoke_callback_after_gc")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "invoke_callback_after_gc")]
public static unsafe partial void InvokeAfterGC(delegate* unmanaged[Stdcall]<void> cb);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "invoke_managed_callback_blittable_args")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "invoke_managed_callback_blittable_args")]
public static unsafe partial int InvokeWithBlittableArgument(delegate* <int, int, int> cb, int a, int b);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "invoke_callback_blittable_args")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "invoke_callback_blittable_args")]
public static unsafe partial int InvokeWithBlittableArgument(delegate* unmanaged<int, int, int> cb, int a, int b);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "invoke_callback_blittable_args")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "invoke_callback_blittable_args")]
public static unsafe partial int InvokeWithBlittableArgument(delegate* unmanaged[Stdcall]<int, int, int> cb, int a, int b);
}
}
{
partial class NativeExportsNE
{
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "subtract_ref_int")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "subtract_ref_int")]
public static unsafe partial void Subtract_Int_Ptr(int a, int* b);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "subtract_ref_byte")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "subtract_ref_byte")]
public static unsafe partial void Subtract_Byte_Ptr(byte a, byte* b);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "blittablestructs_double_intfields_byref")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "blittablestructs_double_intfields_byref")]
public static unsafe partial void DoubleIntFields_Ptr(IntFields* result);
}
public static NativeExportsSafeHandle CreateNewHandle() => AllocateHandle();
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "alloc_handle")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "alloc_handle")]
private static partial NativeExportsSafeHandle AllocateHandle();
}
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "alloc_handle")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "alloc_handle")]
public static partial NativeExportsSafeHandle AllocateHandle();
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "alloc_handle_out")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "alloc_handle_out")]
public static partial void AllocateHandle(out NativeExportsSafeHandle handle);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "release_handle")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "release_handle")]
[return:MarshalAs(UnmanagedType.I1)]
private static partial bool ReleaseHandle(nint handle);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "is_handle_alive")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "is_handle_alive")]
[return:MarshalAs(UnmanagedType.I1)]
public static partial bool IsHandleAlive(NativeExportsSafeHandle handle);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "modify_handle")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "modify_handle")]
public static partial void ModifyHandle(ref NativeExportsSafeHandle handle, [MarshalAs(UnmanagedType.I1)] bool newHandle);
}
{
public partial class SetLastError
{
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "set_error", SetLastError = true)]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "set_error", SetLastError = true)]
public static partial int SetError(int error, byte shouldSetError);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "set_error", SetLastError = true)]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "set_error", SetLastError = true)]
[return: MarshalUsing(typeof(SetLastErrorMarshaller))]
public static partial int SetError_CustomMarshallingSetsError(int error, byte shouldSetError);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "set_error_return_string", SetLastError = true)]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "set_error_return_string", SetLastError = true)]
[return: MarshalAs(UnmanagedType.LPWStr)]
public static partial string SetError_NonBlittableSignature(int error, [MarshalAs(UnmanagedType.U1)] bool shouldSetError, [MarshalAs(UnmanagedType.LPWStr)] string errorString);
}
{
public partial class Span
{
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "sum_int_array")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "sum_int_array")]
public static partial int Sum([MarshalUsing(typeof(SpanMarshaller<int>))] Span<int> values, int numValues);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "sum_int_array")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "sum_int_array")]
public static partial int SumNeverNull([MarshalUsing(typeof(NeverNullSpanMarshaller<int>))] Span<int> values, int numValues);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "sum_int_array")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "sum_int_array")]
public static partial int SumNeverNull([MarshalUsing(typeof(NeverNullReadOnlySpanMarshaller<int>))] ReadOnlySpan<int> values, int numValues);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "sum_int_array_ref")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "sum_int_array_ref")]
public static partial int SumInArray([MarshalUsing(typeof(SpanMarshaller<int>))] in Span<int> values, int numValues);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "duplicate_int_array")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "duplicate_int_array")]
public static partial void Duplicate([MarshalUsing(typeof(SpanMarshaller<int>), CountElementName = "numValues")] ref Span<int> values, int numValues);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "duplicate_int_array")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "duplicate_int_array")]
public static partial void DuplicateRaw([MarshalUsing(typeof(DirectSpanMarshaller<int>), CountElementName = "numValues")] ref Span<int> values, int numValues);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "create_range_array")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "create_range_array")]
[return: MarshalUsing(typeof(SpanMarshaller<int>), CountElementName = "numValues")]
public static partial Span<int> CreateRange(int start, int end, out int numValues);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "create_range_array_out")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "create_range_array_out")]
public static partial void CreateRange_Out(int start, int end, out int numValues, [MarshalUsing(typeof(SpanMarshaller<int>), CountElementName = "numValues")] out Span<int> res);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "get_long_bytes")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "get_long_bytes")]
[return: MarshalUsing(typeof(SpanMarshaller<byte>), ConstantElementCount = sizeof(long))]
public static partial Span<byte> GetLongBytes(long l);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "and_all_members")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "and_all_members")]
[return: MarshalAs(UnmanagedType.U1)]
public static partial bool AndAllMembers([MarshalUsing(typeof(SpanMarshaller<BoolStruct>))] Span<BoolStruct> pArray, int length);
}
public partial class Utf16
{
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReturnLength, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReturnLength, StringMarshalling = StringMarshalling.Utf16)]
public static partial int ReturnLength(string s);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseReturn, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseReturn, StringMarshalling = StringMarshalling.Utf16)]
public static partial string Reverse_Return(string s);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseOut, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseOut, StringMarshalling = StringMarshalling.Utf16)]
public static partial void Reverse_Out(string s, out string ret);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseInplace, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseInplace, StringMarshalling = StringMarshalling.Utf16)]
public static partial void Reverse_Ref(ref string s);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseInplace, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseInplace, StringMarshalling = StringMarshalling.Utf16)]
public static partial void Reverse_In(in string s);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseReplace, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseReplace, StringMarshalling = StringMarshalling.Utf16)]
public static partial void Reverse_Replace_Ref(ref string s);
}
public partial class LPTStr
{
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReturnLength)]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReturnLength)]
public static partial int ReturnLength([MarshalAs(UnmanagedType.LPTStr)] string s);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReturnLength, StringMarshalling = StringMarshalling.Utf8)]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReturnLength, StringMarshalling = StringMarshalling.Utf8)]
public static partial int ReturnLength_IgnoreStringMarshalling([MarshalAs(UnmanagedType.LPTStr)] string s);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseReturn)]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseReturn)]
[return: MarshalAs(UnmanagedType.LPTStr)]
public static partial string Reverse_Return([MarshalAs(UnmanagedType.LPTStr)] string s);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseOut)]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseOut)]
public static partial void Reverse_Out([MarshalAs(UnmanagedType.LPTStr)] string s, [MarshalAs(UnmanagedType.LPTStr)] out string ret);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseInplace)]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseInplace)]
public static partial void Reverse_Ref([MarshalAs(UnmanagedType.LPTStr)] ref string s);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseInplace)]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseInplace)]
public static partial void Reverse_In([MarshalAs(UnmanagedType.LPTStr)] in string s);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseInplace)]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseInplace)]
public static partial void Reverse_Replace_Ref([MarshalAs(UnmanagedType.LPTStr)] ref string s);
}
public partial class LPWStr
{
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReturnLength)]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReturnLength)]
public static partial int ReturnLength([MarshalAs(UnmanagedType.LPWStr)] string s);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReturnLength, StringMarshalling = StringMarshalling.Utf8)]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReturnLength, StringMarshalling = StringMarshalling.Utf8)]
public static partial int ReturnLength_IgnoreStringMarshalling([MarshalAs(UnmanagedType.LPWStr)] string s);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseReturn)]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseReturn)]
[return: MarshalAs(UnmanagedType.LPWStr)]
public static partial string Reverse_Return([MarshalAs(UnmanagedType.LPWStr)] string s);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseOut)]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseOut)]
public static partial void Reverse_Out([MarshalAs(UnmanagedType.LPWStr)] string s, [MarshalAs(UnmanagedType.LPWStr)] out string ret);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseInplace)]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseInplace)]
public static partial void Reverse_Ref([MarshalAs(UnmanagedType.LPWStr)] ref string s);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseInplace)]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseInplace)]
public static partial void Reverse_In([MarshalAs(UnmanagedType.LPWStr)] in string s);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseInplace)]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseInplace)]
public static partial void Reverse_Replace_Ref([MarshalAs(UnmanagedType.LPWStr)] ref string s);
}
public partial class LPUTF8Str
{
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReturnLength)]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReturnLength)]
public static partial int ReturnLength([MarshalAs(UnmanagedType.LPUTF8Str)] string s);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReturnLength, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReturnLength, StringMarshalling = StringMarshalling.Utf16)]
public static partial int ReturnLength_IgnoreStringMarshalling([MarshalAs(UnmanagedType.LPUTF8Str)] string s);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseReturn)]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseReturn)]
[return: MarshalAs(UnmanagedType.LPUTF8Str)]
public static partial string Reverse_Return([MarshalAs(UnmanagedType.LPUTF8Str)] string s);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseOut)]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseOut)]
public static partial void Reverse_Out([MarshalAs(UnmanagedType.LPUTF8Str)] string s, [MarshalAs(UnmanagedType.LPUTF8Str)] out string ret);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseInplace)]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseInplace)]
public static partial void Reverse_In([MarshalAs(UnmanagedType.LPUTF8Str)] in string s);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseInplace)]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseInplace)]
public static partial void Reverse_Ref([MarshalAs(UnmanagedType.LPUTF8Str)] ref string s);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseInplace)]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseInplace)]
public static partial void Reverse_Replace_Ref([MarshalAs(UnmanagedType.LPUTF8Str)] ref string s);
}
public partial class Utf8
{
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReturnLength, StringMarshalling = StringMarshalling.Utf8)]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReturnLength, StringMarshalling = StringMarshalling.Utf8)]
public static partial int ReturnLength(string s);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseReturn, StringMarshalling = StringMarshalling.Utf8)]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseReturn, StringMarshalling = StringMarshalling.Utf8)]
public static partial string Reverse_Return(string s);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseOut, StringMarshalling = StringMarshalling.Utf8)]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseOut, StringMarshalling = StringMarshalling.Utf8)]
public static partial void Reverse_Out(string s, out string ret);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseInplace, StringMarshalling = StringMarshalling.Utf8)]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseInplace, StringMarshalling = StringMarshalling.Utf8)]
public static partial void Reverse_Ref(ref string s);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseInplace, StringMarshalling = StringMarshalling.Utf8)]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseInplace, StringMarshalling = StringMarshalling.Utf8)]
public static partial void Reverse_In(in string s);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseInplace, StringMarshalling = StringMarshalling.Utf8)]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseInplace, StringMarshalling = StringMarshalling.Utf8)]
public static partial void Reverse_Replace_Ref(ref string s);
}
public partial class LPStr
{
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReturnLength)]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReturnLength)]
public static partial int ReturnLength([MarshalAs(UnmanagedType.LPStr)] string s);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReturnLength, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReturnLength, StringMarshalling = StringMarshalling.Utf16)]
public static partial int ReturnLength_IgnoreStringMarshalling([MarshalAs(UnmanagedType.LPStr)] string s);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseReturn)]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseReturn)]
[return: MarshalAs(UnmanagedType.LPStr)]
public static partial string Reverse_Return([MarshalAs(UnmanagedType.LPStr)] string s);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseOut)]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseOut)]
public static partial void Reverse_Out([MarshalAs(UnmanagedType.LPStr)] string s, [MarshalAs(UnmanagedType.LPStr)] out string ret);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseInplace)]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseInplace)]
public static partial void Reverse_Ref([MarshalAs(UnmanagedType.LPStr)] ref string s);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseInplace)]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseInplace)]
public static partial void Reverse_In([MarshalAs(UnmanagedType.LPStr)] in string s);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseInplace)]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseInplace)]
public static partial void Reverse_Replace_Ref([MarshalAs(UnmanagedType.LPStr)] ref string s);
}
{
public partial class Utf16
{
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReturnLength, StringMarshallingCustomType = typeof(SharedTypes.Utf16StringMarshaller))]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReturnLength, StringMarshallingCustomType = typeof(SharedTypes.Utf16StringMarshaller))]
public static partial int ReturnLength(string s);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseReturn, StringMarshallingCustomType = typeof(SharedTypes.Utf16StringMarshaller))]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseReturn, StringMarshallingCustomType = typeof(SharedTypes.Utf16StringMarshaller))]
public static partial string Reverse_Return(string s);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseOut, StringMarshallingCustomType = typeof(SharedTypes.Utf16StringMarshaller))]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseOut, StringMarshallingCustomType = typeof(SharedTypes.Utf16StringMarshaller))]
public static partial void Reverse_Out(string s, out string ret);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseInplace, StringMarshallingCustomType = typeof(SharedTypes.Utf16StringMarshaller))]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseInplace, StringMarshallingCustomType = typeof(SharedTypes.Utf16StringMarshaller))]
public static partial void Reverse_Ref(ref string s);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseInplace, StringMarshallingCustomType = typeof(SharedTypes.Utf16StringMarshaller))]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseInplace, StringMarshallingCustomType = typeof(SharedTypes.Utf16StringMarshaller))]
public static partial void Reverse_In(in string s);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseReplace, StringMarshallingCustomType = typeof(SharedTypes.Utf16StringMarshaller))]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseReplace, StringMarshallingCustomType = typeof(SharedTypes.Utf16StringMarshaller))]
public static partial void Reverse_Replace_Ref(ref string s);
}
public partial class Utf8
{
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReturnLength, StringMarshallingCustomType = typeof(SharedTypes.Utf8StringMarshaller))]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReturnLength, StringMarshallingCustomType = typeof(SharedTypes.Utf8StringMarshaller))]
public static partial int ReturnLength(string s);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseReturn, StringMarshallingCustomType = typeof(SharedTypes.Utf8StringMarshaller))]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseReturn, StringMarshallingCustomType = typeof(SharedTypes.Utf8StringMarshaller))]
public static partial string Reverse_Return(string s);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseOut, StringMarshallingCustomType = typeof(SharedTypes.Utf8StringMarshaller))]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseOut, StringMarshallingCustomType = typeof(SharedTypes.Utf8StringMarshaller))]
public static partial void Reverse_Out(string s, out string ret);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseInplace, StringMarshallingCustomType = typeof(SharedTypes.Utf8StringMarshaller))]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseInplace, StringMarshallingCustomType = typeof(SharedTypes.Utf8StringMarshaller))]
public static partial void Reverse_Ref(ref string s);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseInplace, StringMarshallingCustomType = typeof(SharedTypes.Utf8StringMarshaller))]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseInplace, StringMarshallingCustomType = typeof(SharedTypes.Utf8StringMarshaller))]
public static partial void Reverse_In(in string s);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseReplace, StringMarshallingCustomType = typeof(SharedTypes.Utf8StringMarshaller))]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseReplace, StringMarshallingCustomType = typeof(SharedTypes.Utf8StringMarshaller))]
public static partial void Reverse_Replace_Ref(ref string s);
}
}
[assembly:DisableRuntimeMarshalling]
partial class C
{
- [GeneratedDllImportAttribute(""DoesNotExist"")]
+ [LibraryImportAttribute(""DoesNotExist"")]
public static partial S Method();
}
using System.Runtime.InteropServices;
partial class C
{
- [GeneratedDllImportAttribute(""DoesNotExist"")]
+ [LibraryImportAttribute(""DoesNotExist"")]
public static partial void Method();
}";
Compilation comp = await TestUtils.CreateCompilation(source);
[assembly:DisableRuntimeMarshalling]
partial class C
{
- [GeneratedDllImportAttribute(""DoesNotExist"")]
+ [LibraryImportAttribute(""DoesNotExist"")]
public static partial S Method();
}
using System.Runtime.InteropServices;
partial class C
{
- [GeneratedDllImportAttribute(""DoesNotExist"")]
+ [LibraryImportAttribute(""DoesNotExist"")]
public static partial void Method();
}";
Compilation comp = await TestUtils.CreateCompilation(source);
{
string source = $@"
using System.Runtime.InteropServices;
-{CodeSnippets.GeneratedDllImportAttributeDeclaration}
+{CodeSnippets.LibraryImportAttributeDeclaration}
partial class C
{{
- [GeneratedDllImportAttribute(""DoesNotExist"")]
+ [LibraryImportAttribute(""DoesNotExist"")]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool Method();
}}";
[module:SkipLocalsInit]
partial class C
{
- [GeneratedDllImportAttribute(""DoesNotExist"")]
+ [LibraryImportAttribute(""DoesNotExist"")]
public static partial S Method();
}
[SkipLocalsInit]
partial class C
{
- [GeneratedDllImportAttribute(""DoesNotExist"")]
+ [LibraryImportAttribute(""DoesNotExist"")]
public static partial S Method();
}
partial class C
{
[SkipLocalsInit]
- [GeneratedDllImportAttribute(""DoesNotExist"")]
+ [LibraryImportAttribute(""DoesNotExist"")]
public static partial S Method();
}
partial class C
{{
[{attributeSourceName}]
- [GeneratedDllImportAttribute(""DoesNotExist"")]
+ [LibraryImportAttribute(""DoesNotExist"")]
public static partial S Method1();
}}
partial class C
{
[UnmanagedCallConv(CallConvs = new Type[0])]
- [GeneratedDllImportAttribute(""DoesNotExist"")]
+ [LibraryImportAttribute(""DoesNotExist"")]
public static partial S Method1();
}
partial class C
{
[UnmanagedCallConv(CallConvs = new[]{typeof(CallConvStdcall)})]
- [GeneratedDllImportAttribute(""DoesNotExist"")]
+ [LibraryImportAttribute(""DoesNotExist"")]
public static partial S Method1();
}
partial class C
{
[UnmanagedCallConv(CallConvs = new[]{typeof(CallConvStdcall), typeof(CallConvSuppressGCTransition)})]
- [GeneratedDllImportAttribute(""DoesNotExist"")]
+ [LibraryImportAttribute(""DoesNotExist"")]
public static partial S Method1();
}
partial class C
{{
[DefaultDllImportSearchPaths(DllImportSearchPath.System32 | DllImportSearchPath.UserDirectories)]
- [GeneratedDllImportAttribute(""DoesNotExist"")]
+ [LibraryImportAttribute(""DoesNotExist"")]
public static partial S Method1();
}}
partial class C
{
[Other]
- [GeneratedDllImportAttribute(""DoesNotExist"")]
+ [LibraryImportAttribute(""DoesNotExist"")]
public static partial S Method1();
}
using System.Runtime.InteropServices;
partial class C
{
- [GeneratedDllImportAttribute(""DoesNotExist"")]
+ [LibraryImportAttribute(""DoesNotExist"")]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool Method1([In, Out] int[] a);
}
-" + CodeSnippets.GeneratedDllImportAttributeDeclaration;
+" + CodeSnippets.LibraryImportAttributeDeclaration;
Compilation origComp = await TestUtils.CreateCompilation(source, TestTargetFramework.Standard);
Compilation newComp = TestUtils.RunGenerators(origComp, out _, new Microsoft.Interop.LibraryImportGenerator());
using System.Runtime.InteropServices;
partial class C
{
- [GeneratedDllImportAttribute(""DoesNotExist"")]
+ [LibraryImportAttribute(""DoesNotExist"")]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool Method1([MarshalAs(UnmanagedType.I2)] int a);
}
-" + CodeSnippets.GeneratedDllImportAttributeDeclaration;
+" + CodeSnippets.LibraryImportAttributeDeclaration;
Compilation origComp = await TestUtils.CreateCompilation(source, TestTargetFramework.Standard);
Compilation newComp = TestUtils.RunGenerators(origComp, out _, new Microsoft.Interop.LibraryImportGenerator());
using System.Runtime.InteropServices;
partial class C
{
- [GeneratedDllImportAttribute(""DoesNotExist"")]
+ [LibraryImportAttribute(""DoesNotExist"")]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool Method1([MarshalAs(UnmanagedType.LPArray, SizeConst = 10, SizeParamIndex = 1, ArraySubType = UnmanagedType.I4)] int[] a, int b);
}
-" + CodeSnippets.GeneratedDllImportAttributeDeclaration;
+" + CodeSnippets.LibraryImportAttributeDeclaration;
Compilation origComp = await TestUtils.CreateCompilation(source, TestTargetFramework.Standard);
Compilation newComp = TestUtils.RunGenerators(origComp, out _, new Microsoft.Interop.LibraryImportGenerator());
internal static class CodeSnippets
{
/// <summary>
- /// Partially define attribute for pre-.NET 6.0
+ /// Partially define attribute for pre-.NET 7.0
/// </summary>
- public static readonly string GeneratedDllImportAttributeDeclaration = @"
+ public static readonly string LibraryImportAttributeDeclaration = @"
namespace System.Runtime.InteropServices
{
internal enum StringMarshalling
Utf16,
}
- sealed class GeneratedDllImportAttribute : System.Attribute
+ sealed class LibraryImportAttribute : System.Attribute
{
- public GeneratedDllImportAttribute(string a) { }
+ public LibraryImportAttribute(string a) { }
public StringMarshalling StringMarshalling { get; set; }
public Type StringMarshallingCustomType { get; set; }
}
";
/// <summary>
- /// Trivial declaration of GeneratedDllImport usage
+ /// Trivial declaration of LibraryImport usage
/// </summary>
public static readonly string TrivialClassDeclarations = @"
using System.Runtime.InteropServices;
partial class Basic
{
- [GeneratedDllImportAttribute(""DoesNotExist"")]
+ [LibraryImportAttribute(""DoesNotExist"")]
public static partial void Method1();
- [GeneratedDllImport(""DoesNotExist"")]
+ [LibraryImport(""DoesNotExist"")]
public static partial void Method2();
- [System.Runtime.InteropServices.GeneratedDllImportAttribute(""DoesNotExist"")]
+ [System.Runtime.InteropServices.LibraryImportAttribute(""DoesNotExist"")]
public static partial void Method3();
- [System.Runtime.InteropServices.GeneratedDllImport(""DoesNotExist"")]
+ [System.Runtime.InteropServices.LibraryImport(""DoesNotExist"")]
public static partial void Method4();
}
";
/// <summary>
- /// Trivial declaration of GeneratedDllImport usage
+ /// Trivial declaration of LibraryImport usage
/// </summary>
public static readonly string TrivialStructDeclarations = @"
using System.Runtime.InteropServices;
partial struct Basic
{
- [GeneratedDllImportAttribute(""DoesNotExist"")]
+ [LibraryImportAttribute(""DoesNotExist"")]
public static partial void Method1();
- [GeneratedDllImport(""DoesNotExist"")]
+ [LibraryImport(""DoesNotExist"")]
public static partial void Method2();
- [System.Runtime.InteropServices.GeneratedDllImportAttribute(""DoesNotExist"")]
+ [System.Runtime.InteropServices.LibraryImportAttribute(""DoesNotExist"")]
public static partial void Method3();
- [System.Runtime.InteropServices.GeneratedDllImport(""DoesNotExist"")]
+ [System.Runtime.InteropServices.LibraryImport(""DoesNotExist"")]
public static partial void Method4();
}
";
partial class Test
{
[DummyAttribute]
- [GeneratedDllImport(""DoesNotExist""), Dummy2Attribute(""string value"")]
+ [LibraryImport(""DoesNotExist""), Dummy2Attribute(""string value"")]
public static partial void Method();
}
";
{
partial class Test
{
- [GeneratedDllImport(""DoesNotExist"")]
+ [LibraryImport(""DoesNotExist"")]
public static partial void Method1();
}
}
{
partial class Test
{
- [GeneratedDllImport(""DoesNotExist"")]
+ [LibraryImport(""DoesNotExist"")]
public static partial void Method2();
}
}
{
partial class InnerClass
{
- [GeneratedDllImport(""DoesNotExist"")]
+ [LibraryImport(""DoesNotExist"")]
public static partial void Method();
}
}
{
partial struct InnerStruct
{
- [GeneratedDllImport(""DoesNotExist"")]
+ [LibraryImport(""DoesNotExist"")]
public static partial void Method();
}
}
{
partial struct InnerStruct
{
- [GeneratedDllImport(""DoesNotExist"")]
+ [LibraryImport(""DoesNotExist"")]
public static partial void Method();
}
}
{
partial class InnerClass
{
- [GeneratedDllImport(""DoesNotExist"")]
+ [LibraryImport(""DoesNotExist"")]
public static partial void Method();
}
}
using System.Runtime.InteropServices;
partial class Test
{
- [GeneratedDllImport(""DoesNotExist"")]
+ [LibraryImport(""DoesNotExist"")]
public static partial void Method1();
}
unsafe partial class Test
{
- [GeneratedDllImport(""DoesNotExist"")]
+ [LibraryImport(""DoesNotExist"")]
public static partial int* Method2();
}
";
using System.Runtime.InteropServices;
partial class Test
{
- [GeneratedDllImport(""DoesNotExist"", EntryPoint=""UserDefinedEntryPoint"")]
+ [LibraryImport(""DoesNotExist"", EntryPoint=""UserDefinedEntryPoint"")]
public static partial void NotAnExport();
}
";
/// <summary>
- /// Declaration with all GeneratedDllImport named arguments.
+ /// Declaration with all LibraryImport named arguments.
/// </summary>
- public static readonly string AllGeneratedDllImportNamedArguments = @"
+ public static readonly string AllLibraryImportNamedArguments = @"
using System.Runtime.InteropServices;
partial class Test
{
- [GeneratedDllImport(""DoesNotExist"",
+ [LibraryImport(""DoesNotExist"",
StringMarshalling = StringMarshalling.Utf16,
EntryPoint = ""UserDefinedEntryPoint"",
SetLastError = true)]
private const int One = 1;
private const int Two = 2;
- [GeneratedDllImport(nameof(Test),
+ [LibraryImport(nameof(Test),
StringMarshalling = (StringMarshalling)2,
EntryPoint = EntryPointName,
SetLastError = IsFalse)]
public static partial void Method1();
- [GeneratedDllImport(nameof(Test),
+ [LibraryImport(nameof(Test),
StringMarshalling = (StringMarshalling)Two,
EntryPoint = EntryPointName,
SetLastError = !IsTrue)]
public static partial void Method2();
- [GeneratedDllImport(nameof(Test),
+ [LibraryImport(nameof(Test),
StringMarshalling = (StringMarshalling)2,
EntryPoint = EntryPointName,
SetLastError = 0 != 1)]
using System.Runtime.InteropServices;
partial class Test
{
- [GeneratedDllImport(""DoesNotExist"")]
+ [LibraryImport(""DoesNotExist"")]
public static partial void Method(int t = 0);
}
";
partial class Test
{
[LCIDConversion(0)]
- [GeneratedDllImport(""DoesNotExist"")]
+ [LibraryImport(""DoesNotExist"")]
public static partial void Method();
}
";
partial class Test
{
- [GeneratedDllImport(""DoesNotExist"")]
+ [LibraryImport(""DoesNotExist"")]
[return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(NS.MyCustomMarshaler), MarshalCookie=""COOKIE1"")]
public static partial bool Method1([MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(NS.MyCustomMarshaler), MarshalCookie=""COOKIE2"")]bool t);
- [GeneratedDllImport(""DoesNotExist"")]
+ [LibraryImport(""DoesNotExist"")]
[return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalType = ""NS.MyCustomMarshaler"", MarshalCookie=""COOKIE3"")]
public static partial bool Method2([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType = ""NS.MyCustomMarshaler"", MarshalCookie=""COOKIE4"")]bool t);
}
namespace System.Runtime.InteropServices
{
// Prefix with ATTRIBUTE so the lengths will match during check.
- sealed class ATTRIBUTEGeneratedDllImportAttribute : Attribute
+ sealed class ATTRIBUTELibraryImportAttribute : Attribute
{
- public ATTRIBUTEGeneratedDllImportAttribute(string a) { }
+ public ATTRIBUTELibraryImportAttribute(string a) { }
}
}
partial class Test
{
- [ATTRIBUTEGeneratedDllImportAttribute(""DoesNotExist"")]
+ [ATTRIBUTELibraryImportAttribute(""DoesNotExist"")]
public static partial void Method1();
- [ATTRIBUTEGeneratedDllImport(""DoesNotExist"")]
+ [ATTRIBUTELibraryImport(""DoesNotExist"")]
public static partial void Method2();
- [System.Runtime.InteropServices.ATTRIBUTEGeneratedDllImport(""DoesNotExist"")]
+ [System.Runtime.InteropServices.ATTRIBUTELibraryImport(""DoesNotExist"")]
public static partial void Method3();
}
";
{preDeclaration}
partial class Test
{{
- [GeneratedDllImport(""DoesNotExist"", StringMarshalling = StringMarshalling.{value})]
+ [LibraryImport(""DoesNotExist"", StringMarshalling = StringMarshalling.{value})]
public static partial {typename} Method(
{typename} p,
in {typename} pIn,
{preDeclaration}
partial class Test
{{
- [GeneratedDllImport(""DoesNotExist"", StringMarshallingCustomType = typeof({stringMarshallingCustomTypeName}))]
+ [LibraryImport(""DoesNotExist"", StringMarshallingCustomType = typeof({stringMarshallingCustomTypeName}))]
public static partial {typeName} Method(
{typeName} p,
in {typeName} pIn,
{preDeclaration}
partial class Test
{{
- [GeneratedDllImport(""DoesNotExist"")]
+ [LibraryImport(""DoesNotExist"")]
public static partial {typeName} Method(
{typeName} p,
in {typeName} pIn,
{preDeclaration}
partial class Test
{{
- [GeneratedDllImport(""DoesNotExist"")]
+ [LibraryImport(""DoesNotExist"")]
public static partial {typeName} Method(
{typeName} p,
in {typeName} pIn,
{preDeclaration}
partial class Test
{{
- [GeneratedDllImport(""DoesNotExist"")]
+ [LibraryImport(""DoesNotExist"")]
public static unsafe partial {typeName} Method(
{typeName} p,
in {typeName} pIn,
{preDeclaration}
partial class Test
{{
- [GeneratedDllImport(""DoesNotExist"")]
+ [LibraryImport(""DoesNotExist"")]
public static partial void Method(
[{attributeName}] {typeName} p);
}}";
using System.Runtime.InteropServices;
partial class Test
{{
- [GeneratedDllImport(""DoesNotExist"")]
+ [LibraryImport(""DoesNotExist"")]
public static partial void {methodName}(
int {paramName});
}}";
using System.Runtime.InteropServices;
partial class Test
{{
- [GeneratedDllImport(""DoesNotExist"")]
+ [LibraryImport(""DoesNotExist"")]
[return: MarshalAs(UnmanagedType.{unmanagedType})]
public static partial {typeName} Method(
[MarshalAs(UnmanagedType.{unmanagedType})] {typeName} p,
using System.Runtime.InteropServices;
partial class Test
{{
- [GeneratedDllImport(""DoesNotExist"")]
+ [LibraryImport(""DoesNotExist"")]
[return: MarshalAs(UnmanagedType.{unmanagedType})]
public static unsafe partial {typeName} Method(
[MarshalAs(UnmanagedType.{unmanagedType})] {typeName} p,
partial class Test
{{
- [GeneratedDllImport(""DoesNotExist"")]
+ [LibraryImport(""DoesNotExist"")]
public static partial MyEnum Method(
MyEnum p,
in MyEnum pIn,
using System.Runtime.InteropServices;
partial class Test
{{
- [GeneratedDllImport(""DoesNotExist"", SetLastError = true)]
+ [LibraryImport(""DoesNotExist"", SetLastError = true)]
public static partial {typeName} Method({typeName} p);
}}";
{preDeclaration}
partial class Test
{{
- [GeneratedDllImport(""DoesNotExist"")]
+ [LibraryImport(""DoesNotExist"")]
[return:MarshalAs(UnmanagedType.LPArray, SizeConst=10)]
public static partial {elementType}[] Method(
{elementType}[] p,
{DisableRuntimeMarshalling}
partial class Test
{{
- [GeneratedDllImport(""DoesNotExist"")]
+ [LibraryImport(""DoesNotExist"")]
public static partial void Method(
{(isByRef ? "ref" : "")} {sizeParamType} pRefSize,
[MarshalAs(UnmanagedType.LPArray, SizeParamIndex=0)] ref int[] pRef
{preDeclaration}
partial class Test
{{
- [GeneratedDllImport(""DoesNotExist"")]
+ [LibraryImport(""DoesNotExist"")]
public static partial void Method(
[MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.{nestedMarshalInfo})] {elementType}[] pRef
);
{preDeclaration}
partial class Test
{{
- [GeneratedDllImport(""DoesNotExist"")]
+ [LibraryImport(""DoesNotExist"")]
[return: MarshalUsing(typeof({nativeTypeName}))]
public static partial {typeName} Method(
[MarshalUsing(typeof({nativeTypeName}))] {typeName} p,
partial class Test
{
- [GeneratedDllImport(""DoesNotExist"")]
+ [LibraryImport(""DoesNotExist"")]
public static partial void Method(
S s,
in S sIn);
{preDeclaration}
partial class Test
{{
- [GeneratedDllImport(""DoesNotExist"")]
+ [LibraryImport(""DoesNotExist"")]
public static partial void Method(
{byRefKind} {typeName} p);
}}";
{preDeclaration}
partial class Test
{{
- [GeneratedDllImport(""DoesNotExist"")]
+ [LibraryImport(""DoesNotExist"")]
public static partial void Method(
{typeName} p);
}}";
{preDeclaration}
partial class Test
{{
- [GeneratedDllImport(""DoesNotExist"")]
+ [LibraryImport(""DoesNotExist"")]
public static partial {typeName} Method();
}}";
partial class Test
{{
#if {define}
- [System.Runtime.InteropServices.GeneratedDllImport(""DoesNotExist"")]
+ [System.Runtime.InteropServices.LibraryImport(""DoesNotExist"")]
public static partial int Method(
int p,
in int pIn,
partial class Test
{{
#if {define}
- [GeneratedDllImport(""DoesNotExist"")]
+ [LibraryImport(""DoesNotExist"")]
public static partial int Method(
int p,
in int pIn,
using System.Runtime.InteropServices;
partial class Test
{{
- [GeneratedDllImport(""DoesNotExist"")]
+ [LibraryImport(""DoesNotExist"")]
#if {define}
public static partial int Method(
int p,
using System.Runtime.InteropServices;
partial class Test
{{
- [GeneratedDllImport(""DoesNotExist"")]
+ [LibraryImport(""DoesNotExist"")]
#if {define}
public static partial int Method(
int p,
{DisableRuntimeMarshalling}
partial class Test
{{
- [GeneratedDllImport(""DoesNotExist"")]
+ [LibraryImport(""DoesNotExist"")]
[return:MarshalUsing(ConstantElementCount=10)]
public static partial {collectionType} Method(
{collectionType} p,
{DisableRuntimeMarshalling}
partial class Test
{{
- [GeneratedDllImport(""DoesNotExist"")]
+ [LibraryImport(""DoesNotExist"")]
[return:MarshalUsing(typeof({marshallerType}), ConstantElementCount=10)]
public static partial {collectionType} Method(
[MarshalUsing(typeof({marshallerType}))] {collectionType} p,
{DisableRuntimeMarshalling}
partial class Test
{{
- [GeneratedDllImport(""DoesNotExist"")]
+ [LibraryImport(""DoesNotExist"")]
public static partial int Method(
[MarshalUsing(typeof({marshallerType}), CountElementName = MarshalUsingAttribute.ReturnsCountValue)] out {collectionType} pOut
);
{DisableRuntimeMarshalling}
partial class Test
{{
- [GeneratedDllImport(""DoesNotExist"")]
+ [LibraryImport(""DoesNotExist"")]
public static partial void Method(
{(isByRef ? "ref" : "")} {sizeParamType} pRefSize,
[MarshalUsing(CountElementName = ""pRefSize"")] ref int[] pRef
{DisableRuntimeMarshalling}
partial class Test
{{
- [GeneratedDllImport(""DoesNotExist"")]
+ [LibraryImport(""DoesNotExist"")]
public static partial void Method(
int pRefSize,
[MarshalUsing(ConstantElementCount = 10, CountElementName = ""pRefSize"")] ref int[] pRef
{DisableRuntimeMarshalling}
partial class Test
{{
- [GeneratedDllImport(""DoesNotExist"")]
+ [LibraryImport(""DoesNotExist"")]
public static partial void Method(
int pRefSize,
[MarshalUsing(CountElementName = null)] ref int[] pRef
[assembly:System.Runtime.CompilerServices.DisableRuntimeMarshalling]
partial class Test
{
- [GeneratedDllImport(""DoesNotExist"")]
+ [LibraryImport(""DoesNotExist"")]
[return:MarshalUsing(ConstantElementCount=10)]
[return:MarshalUsing(typeof(IntWrapper), ElementIndirectionLevel = 1)]
public static partial TestCollection<int> Method(
[assembly:System.Runtime.CompilerServices.DisableRuntimeMarshalling]
partial class Test
{
- [GeneratedDllImport(""DoesNotExist"")]
+ [LibraryImport(""DoesNotExist"")]
public static partial void Method(
[MarshalUsing(typeof(IntWrapper), ElementIndirectionLevel = 1)] [MarshalUsing(typeof(IntWrapper), ElementIndirectionLevel = 1)] TestCollection<int> p);
}
[assembly:System.Runtime.CompilerServices.DisableRuntimeMarshalling]
partial class Test
{
- [GeneratedDllImport(""DoesNotExist"")]
+ [LibraryImport(""DoesNotExist"")]
public static partial void Method(
[MarshalUsing(typeof(IntWrapper), ElementIndirectionLevel = 2)] TestCollection<int> p);
}
[assembly:System.Runtime.CompilerServices.DisableRuntimeMarshalling]
partial class Test
{
- [GeneratedDllImport(""DoesNotExist"")]
+ [LibraryImport(""DoesNotExist"")]
[return:MarshalUsing(ConstantElementCount=10)]
[return:MarshalAs(UnmanagedType.LPArray, SizeConst=10)]
public static partial int[] Method();
[assembly:System.Runtime.CompilerServices.DisableRuntimeMarshalling]
partial class Test
{
- [GeneratedDllImport(""DoesNotExist"")]
+ [LibraryImport(""DoesNotExist"")]
[return:MarshalUsing(CountElementName=MarshalUsingAttribute.ReturnsCountValue)]
public static partial int[] Method();
}
[assembly:System.Runtime.CompilerServices.DisableRuntimeMarshalling]
partial class Test
{
- [GeneratedDllImport(""DoesNotExist"")]
+ [LibraryImport(""DoesNotExist"")]
public static partial void Method(
[MarshalUsing(CountElementName=""arr"")] ref int[] arr
);
[assembly:System.Runtime.CompilerServices.DisableRuntimeMarshalling]
partial class Test
{
- [GeneratedDllImport(""DoesNotExist"")]
+ [LibraryImport(""DoesNotExist"")]
public static partial void Method(
[MarshalUsing(CountElementName=""arr2"")] ref int[] arr,
[MarshalUsing(CountElementName=""arr"")] ref int[] arr2
[assembly:System.Runtime.CompilerServices.DisableRuntimeMarshalling]
partial class Test
{
- [GeneratedDllImport(""DoesNotExist"")]
+ [LibraryImport(""DoesNotExist"")]
public static partial void Method(
[MarshalAs(UnmanagedType.LPArray, SizeParamIndex=1)] ref int[] arr,
[MarshalAs(UnmanagedType.LPArray, SizeParamIndex=0)] ref int[] arr2
[assembly:System.Runtime.CompilerServices.DisableRuntimeMarshalling]
partial class Test
{
- [GeneratedDllImport(""DoesNotExist"")]
+ [LibraryImport(""DoesNotExist"")]
public static partial void Method(
[MarshalUsing(CountElementName=""arr0"", ElementIndirectionLevel = 0)]
[MarshalUsing(CountElementName=""arr1"", ElementIndirectionLevel = 1)]
using System.Runtime.InteropServices;
partial struct Basic
{{
- [GeneratedDllImport(""DoesNotExist"")]
+ [LibraryImport(""DoesNotExist"")]
public static partial ref {typeName} RefReturn();
- [GeneratedDllImport(""DoesNotExist"")]
+ [LibraryImport(""DoesNotExist"")]
public static partial ref readonly {typeName} RefReadonlyReturn();
}}";
partial struct Basic
{
- [GeneratedDllImport(""DoesNotExist"", SetLa)]
+ [LibraryImport(""DoesNotExist"", SetLa)]
public static partial void Method();
}
";
partial struct Basic
{
- [GeneratedDllImport(DoesNotExist)]
+ [LibraryImport(DoesNotExist)]
public static partial void Method();
}
";
partial struct Basic
{
- [GeneratedDllImport(""DoesNotExist"", SetLastError = ""Foo"")]
+ [LibraryImport(""DoesNotExist"", SetLastError = ""Foo"")]
public static partial void Method();
}
";
{
public static IEnumerable<object[]> CodeSnippetsToCompile()
{
- // Not GeneratedDllImportAttribute
+ // Not LibraryImportAttribute
yield return new object[] { CodeSnippets.UserDefinedPrefixedAttributes, 0, 3 };
// No explicit marshalling for char or string
yield return new[] { CodeSnippets.NestedTypes };
yield return new[] { CodeSnippets.UnsafeContext };
yield return new[] { CodeSnippets.UserDefinedEntryPoint };
- yield return new[] { CodeSnippets.AllGeneratedDllImportNamedArguments };
+ yield return new[] { CodeSnippets.AllLibraryImportNamedArguments };
yield return new[] { CodeSnippets.DefaultParameters };
yield return new[] { CodeSnippets.UseCSharpFeaturesForConstants };
// Confirm that all unsupported target frameworks can be generated.
{
- string code = CodeSnippets.BasicParametersAndModifiers<byte>(CodeSnippets.GeneratedDllImportAttributeDeclaration);
+ string code = CodeSnippets.BasicParametersAndModifiers<byte>(CodeSnippets.LibraryImportAttributeDeclaration);
yield return new object[] { code, TestTargetFramework.Net5, false };
yield return new object[] { code, TestTargetFramework.Core, false };
yield return new object[] { code, TestTargetFramework.Standard, false };
// Confirm that all unsupported target frameworks fallback to a forwarder.
{
- string code = CodeSnippets.BasicParametersAndModifiers<byte[]>(CodeSnippets.GeneratedDllImportAttributeDeclaration);
+ string code = CodeSnippets.BasicParametersAndModifiers<byte[]>(CodeSnippets.LibraryImportAttributeDeclaration);
yield return new object[] { code, TestTargetFramework.Net5, true };
yield return new object[] { code, TestTargetFramework.Core, true };
yield return new object[] { code, TestTargetFramework.Standard, true };
// Confirm that all unsupported target frameworks fallback to a forwarder.
{
- string code = CodeSnippets.BasicParametersAndModifiersWithStringMarshalling<string>(StringMarshalling.Utf16, CodeSnippets.GeneratedDllImportAttributeDeclaration);
+ string code = CodeSnippets.BasicParametersAndModifiersWithStringMarshalling<string>(StringMarshalling.Utf16, CodeSnippets.LibraryImportAttributeDeclaration);
yield return new object[] { code, TestTargetFramework.Net5, true };
yield return new object[] { code, TestTargetFramework.Core, true };
yield return new object[] { code, TestTargetFramework.Standard, true };
public static IEnumerable<object[]> SnippetsWithBlittableTypesButNonBlittableDataToCompile()
{
- yield return new[] { CodeSnippets.AllGeneratedDllImportNamedArguments };
+ yield return new[] { CodeSnippets.AllLibraryImportNamedArguments };
yield return new[] { CodeSnippets.BasicParametersAndModifiers<int>() };
yield return new[] { CodeSnippets.SetLastErrorTrue<int>() };
}
}
[ConditionalFact]
- public async Task GeneratedDllImport_NoDiagnostic()
+ public async Task LibraryImport_NoDiagnostic()
{
string source = @$"
using System.Runtime.InteropServices;
partial class Test
{{
- [GeneratedDllImport(""DoesNotExist"")]
+ [LibraryImport(""DoesNotExist"")]
public static partial void Method();
}}
partial class Test
using System.Runtime.InteropServices;
partial class Test
{{
- [GeneratedDllImport(""DoesNotExist"")]
+ [LibraryImport(""DoesNotExist"")]
public static partial int {{|CS8795:Method|}}(out int ret);
}}";
await VerifyCS.VerifyCodeFixAsync(
partial class Test
{{
// P/Invoke
- [GeneratedDllImport(/*name*/""DoesNotExist"")] // comment
+ [LibraryImport(/*name*/""DoesNotExist"")] // comment
public static partial int {{|CS8795:Method1|}}(out int ret);
/** P/Invoke **/
- [GeneratedDllImport(""DoesNotExist"") /*name*/]
+ [LibraryImport(""DoesNotExist"") /*name*/]
// < ... >
public static partial int {{|CS8795:Method2|}}(out int ret);
}}";
using System.Runtime.InteropServices;
partial class Test
{{
- [System.ComponentModel.Description(""Test""), GeneratedDllImport(""DoesNotExist"")]
+ [System.ComponentModel.Description(""Test""), LibraryImport(""DoesNotExist"")]
public static partial int {{|CS8795:Method1|}}(out int ret);
[System.ComponentModel.Description(""Test"")]
- [GeneratedDllImport(""DoesNotExist"")]
+ [LibraryImport(""DoesNotExist"")]
[return: MarshalAs(UnmanagedType.I4)]
public static partial int {{|CS8795:Method2|}}(out int ret);
}}";
using System.Runtime.InteropServices;
partial class Test
{{
- [GeneratedDllImport(""DoesNotExist"", EntryPoint = ""Entry"")]
+ [LibraryImport(""DoesNotExist"", EntryPoint = ""Entry"")]
public static partial int {{|CS8795:Method1|}}(out int ret);
- [GeneratedDllImport(""DoesNotExist"", EntryPoint = ""Entry"", StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(""DoesNotExist"", EntryPoint = ""Entry"", StringMarshalling = StringMarshalling.Utf16)]
public static partial string {{|CS8795:Method2|}}(out int ret);
}}";
await VerifyCS.VerifyCodeFixAsync(
using System.Runtime.InteropServices;
partial class Test
{{
- [GeneratedDllImport(""DoesNotExist"", EntryPoint = ""Entry"")]
+ [LibraryImport(""DoesNotExist"", EntryPoint = ""Entry"")]
public static partial int {{|CS8795:Method|}}(out int ret);
- [GeneratedDllImport(""DoesNotExist"", EntryPoint = ""Entry"")]
+ [LibraryImport(""DoesNotExist"", EntryPoint = ""Entry"")]
public static partial int {{|CS8795:Method1|}}(out int ret);
- [GeneratedDllImport(""DoesNotExist"")]
+ [LibraryImport(""DoesNotExist"")]
public static partial int {{|CS8795:Method2|}}(out int ret);
- [GeneratedDllImport(""DoesNotExist"")]
+ [LibraryImport(""DoesNotExist"")]
public static partial int {{|CS8795:Method3|}}(out int ret);
- [GeneratedDllImport(""DoesNotExist"")]
+ [LibraryImport(""DoesNotExist"")]
public static partial int {{|CS8795:Method4|}}(out int ret);
}}";
await VerifyCS.VerifyCodeFixAsync(
using System.Runtime.InteropServices;
partial class Test
{{
- [GeneratedDllImport(""DoesNotExist"", EntryPoint = ""Entry"")]
+ [LibraryImport(""DoesNotExist"", EntryPoint = ""Entry"")]
public static partial int {{|CS8795:Method1|}}(out int ret);
}}";
await VerifyCS.VerifyCodeFixAsync(
using System.Runtime.InteropServices;
partial class Test
{{
- [GeneratedDllImport(""DoesNotExist"", EntryPoint = ""Entry"")]
+ [LibraryImport(""DoesNotExist"", EntryPoint = ""Entry"")]
[UnmanagedCallConv(CallConvs = new System.Type[] {{ typeof({callConvType.FullName}) }})]
public static partial int {{|CS8795:Method1|}}(out int ret);
}}";
using System.Runtime.InteropServices;
partial class Test
{{
- [GeneratedDllImport(""DoesNotExist"", EntryPoint = ""Entry"", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(""DoesNotExist"", EntryPoint = ""Entry"", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
public static partial string {{|CS8795:Method|}}(out int ret);
}}";
await VerifyCS.VerifyCodeFixAsync(
using System.Runtime.InteropServices;
partial class Test
{{
- [GeneratedDllImport(""DoesNotExist"", EntryPoint = ""Entry"")]
+ [LibraryImport(""DoesNotExist"", EntryPoint = ""Entry"")]
public static partial void {{|CS8795:Method|}}();
}}";
await VerifyCS.VerifyCodeFixAsync(source, fixedSourceNoSuffix, ConvertToLibraryImportKey);
using System.Runtime.InteropServices;
partial class Test
{{
- [GeneratedDllImport(""DoesNotExist"", EntryPoint = ""Entry{suffix}"")]
+ [LibraryImport(""DoesNotExist"", EntryPoint = ""Entry{suffix}"")]
public static partial void {{|CS8795:Method|}}();
}}";
await VerifyCS.VerifyCodeFixAsync(source, fixedSourceWithSuffix, $"{ConvertToLibraryImportKey}{suffix}");
using System.Runtime.InteropServices;
partial class Test
{{
- [GeneratedDllImport(""DoesNotExist"", EntryPoint = ""Entry"")]
+ [LibraryImport(""DoesNotExist"", EntryPoint = ""Entry"")]
public static partial void {{|CS8795:Method|}}();
}}";
await VerifyCS.VerifyCodeFixAsync(source, fixedSourceNoSuffix, ConvertToLibraryImportKey);
using System.Runtime.InteropServices;
partial class Test
{{
- [GeneratedDllImport(""DoesNotExist"", EntryPoint = ""EntryA"")]
+ [LibraryImport(""DoesNotExist"", EntryPoint = ""EntryA"")]
public static partial void {{|CS8795:Method|}}();
}}";
await VerifyCS.VerifyCodeFixAsync(source, fixedSourceWithASuffix, $"{ConvertToLibraryImportKey}A");
using System.Runtime.InteropServices;
partial class Test
{{
- [GeneratedDllImport(""DoesNotExist"", EntryPoint = ""EntryW"")]
+ [LibraryImport(""DoesNotExist"", EntryPoint = ""EntryW"")]
public static partial void {{|CS8795:Method|}}();
}}";
await VerifyCS.VerifyCodeFixAsync(source, fixedSourceWithWSuffix, $"{ConvertToLibraryImportKey}W");
using System.Runtime.InteropServices;
partial class Test
{{
- [GeneratedDllImport(""DoesNotExist"", EntryPoint = ""Entry"")]
+ [LibraryImport(""DoesNotExist"", EntryPoint = ""Entry"")]
public static partial void {{|CS8795:Method|}}();
}}";
await VerifyCS.VerifyCodeFixAsync(source, fixedSourceNoSuffix, ConvertToLibraryImportKey);
using System.Runtime.InteropServices;
partial class Test
{{
- [GeneratedDllImport(""DoesNotExist"", EntryPoint = ""EntryA"")]
+ [LibraryImport(""DoesNotExist"", EntryPoint = ""EntryA"")]
public static partial void {{|CS8795:Method|}}();
}}";
await VerifyCS.VerifyCodeFixAsync(source, fixedSourceWithASuffix, $"{ConvertToLibraryImportKey}A");
partial class Test
{{
private const string EntryPoint = ""Entry"";
- [GeneratedDllImport(""DoesNotExist"", EntryPoint = EntryPoint + ""A"")]
+ [LibraryImport(""DoesNotExist"", EntryPoint = EntryPoint + ""A"")]
public static partial void {{|CS8795:Method|}}();
}}";
await VerifyCS.VerifyCodeFixAsync(source, fixedSourceWithASuffix, $"{ConvertToLibraryImportKey}A");
using System.Runtime.InteropServices;
partial class Test
{{
- [GeneratedDllImport(""DoesNotExist"", EntryPoint = ""MethodA"")]
+ [LibraryImport(""DoesNotExist"", EntryPoint = ""MethodA"")]
public static partial void {{|CS8795:Method|}}();
}}";
await VerifyCS.VerifyCodeFixAsync(source, fixedSourceWithASuffix, $"{ConvertToLibraryImportKey}A");
partial class Test
{{
private const string Foo = ""Bar"";
- [GeneratedDllImport(""DoesNotExist"", EntryPoint = nameof(Foo) + ""A"")]
+ [LibraryImport(""DoesNotExist"", EntryPoint = nameof(Foo) + ""A"")]
public static partial void {{|CS8795:Method|}}();
}}";
await VerifyCS.VerifyCodeFixAsync(source, fixedSourceWithASuffix, $"{ConvertToLibraryImportKey}A");
using System.Runtime.InteropServices;
partial class Test
{{
- [GeneratedDllImport(""DoesNotExist"", EntryPoint = ""MethodA"")]
+ [LibraryImport(""DoesNotExist"", EntryPoint = ""MethodA"")]
public static partial void {{|CS8795:Method|}}();
}}";
await VerifyCS.VerifyCodeFixAsync(source, fixedSourceWithASuffix, $"{ConvertToLibraryImportKey}A");
using System.Runtime.InteropServices;
partial class Test
{
- [GeneratedDllImport(""DoesNotExist"")]
+ [LibraryImport(""DoesNotExist"")]
public static partial int {|CS8795:VoidMethod|}(int param);
- [GeneratedDllImport(""DoesNotExist"")]
+ [LibraryImport(""DoesNotExist"")]
public static partial int {|CS8795:Method|}(int param, out long @return);
public static void Code()
{
partial class Test
{
- [GeneratedDllImport(""DoesNotExist"")]
+ [LibraryImport(""DoesNotExist"")]
public static partial int {|CS8795:Method|}(out int ret);
- [GeneratedDllImport(""DoesNotExist"")]
+ [LibraryImport(""DoesNotExist"")]
public static partial int {|CS8795:Method2|}(out int ret);
- [GeneratedDllImport(""DoesNotExist"")]
+ [LibraryImport(""DoesNotExist"")]
public static partial int {|CS8795:Method3|}(out int ret);
}
}
{
partial class Test
{
- [GeneratedDllImport(""DoesNotExist"")]
+ [LibraryImport(""DoesNotExist"")]
public static partial int {|CS8795:Method|}(out int ret);
- [GeneratedDllImport(""DoesNotExist"")]
+ [LibraryImport(""DoesNotExist"")]
public static partial int {|CS8795:Method2|}(out int ret);
- [GeneratedDllImport(""DoesNotExist"")]
+ [LibraryImport(""DoesNotExist"")]
public static partial int {|CS8795:Method3|}(out int ret);
}
}";
using System.Runtime.InteropServices;
partial class Test
{{
- [GeneratedDllImport(""DoesNotExist"")]
+ [LibraryImport(""DoesNotExist"")]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool {{|CS8795:Method|}}([MarshalAs(UnmanagedType.Bool)] bool b);
}}";
{
string source = $@"
using System.Runtime.InteropServices;
-{CodeSnippets.GeneratedDllImportAttributeDeclaration}
+{CodeSnippets.LibraryImportAttributeDeclaration}
partial class Test
{{
- [GeneratedDllImport(""DoesNotExist"")]
+ [LibraryImport(""DoesNotExist"")]
public static partial void Method();
}}
";
[InlineData(TestTargetFramework.Core)]
[InlineData(TestTargetFramework.Standard)]
[InlineData(TestTargetFramework.Net5)]
- public async Task TargetFrameworkNotSupported_NoGeneratedDllImport_NoDiagnostic(TestTargetFramework targetFramework)
+ public async Task TargetFrameworkNotSupported_NoLibraryImport_NoDiagnostic(TestTargetFramework targetFramework)
{
string source = @"
using System.Runtime.InteropServices;
}
partial class Test
{
- [GeneratedDllImport(""DoesNotExist"")]
+ [LibraryImport(""DoesNotExist"")]
public static partial void Method1(NS.MyClass c);
- [GeneratedDllImport(""DoesNotExist"")]
+ [LibraryImport(""DoesNotExist"")]
public static partial void Method2(int i, List<int> list);
}
";
}
partial class Test
{
- [GeneratedDllImport(""DoesNotExist"")]
+ [LibraryImport(""DoesNotExist"")]
public static partial NS.MyClass Method1();
- [GeneratedDllImport(""DoesNotExist"")]
+ [LibraryImport(""DoesNotExist"")]
public static partial List<int> Method2();
}
";
using System.Runtime.InteropServices;
partial class Test
{
- [GeneratedDllImport(""DoesNotExist"")]
+ [LibraryImport(""DoesNotExist"")]
public static partial void Method(char c, string s);
}
";
using System.Runtime.InteropServices;
partial class Test
{
- [GeneratedDllImport(""DoesNotExist"")]
+ [LibraryImport(""DoesNotExist"")]
public static partial char Method1();
- [GeneratedDllImport(""DoesNotExist"")]
+ [LibraryImport(""DoesNotExist"")]
public static partial string Method2();
}
";
using System.Runtime.InteropServices;
partial class Test
{
- [GeneratedDllImport(""DoesNotExist"")]
+ [LibraryImport(""DoesNotExist"")]
public static partial void Method1([MarshalAs(UnmanagedType.BStr)] int i1, int i2);
- [GeneratedDllImport(""DoesNotExist"")]
+ [LibraryImport(""DoesNotExist"")]
public static partial void Method2(int i1, [MarshalAs(UnmanagedType.FunctionPtr)] bool b2);
}
";
using System.Runtime.InteropServices;
partial class Test
{
- [GeneratedDllImport(""DoesNotExist"")]
+ [LibraryImport(""DoesNotExist"")]
[return: MarshalAs(UnmanagedType.BStr)]
public static partial int Method1(int i);
- [GeneratedDllImport(""DoesNotExist"")]
+ [LibraryImport(""DoesNotExist"")]
[return: MarshalAs(UnmanagedType.FunctionPtr)]
public static partial bool Method2(int i);
}
using System.Runtime.InteropServices;
partial class Test
{
- [GeneratedDllImport(""DoesNotExist"")]
+ [LibraryImport(""DoesNotExist"")]
[return: MarshalAs(1)]
public static partial int Method1(int i);
- [GeneratedDllImport(""DoesNotExist"")]
+ [LibraryImport(""DoesNotExist"")]
public static partial int Method2([MarshalAs((short)0)] bool b);
}
";
using System.Runtime.InteropServices;
partial class Test
{
- [GeneratedDllImport(""DoesNotExist"")]
+ [LibraryImport(""DoesNotExist"")]
[return: MarshalAs(UnmanagedType.I4, SafeArraySubType=VarEnum.VT_I4)]
public static partial int Method1(int i);
- [GeneratedDllImport(""DoesNotExist"")]
+ [LibraryImport(""DoesNotExist"")]
public static partial int Method2([MarshalAs(UnmanagedType.I1, IidParameterIndex = 1)] bool b);
}
";
using System.Runtime.InteropServices;
partial class Test
{
- [GeneratedDllImport(""DoesNotExist"", StringMarshalling = StringMarshalling.Utf8)]
+ [LibraryImport(""DoesNotExist"", StringMarshalling = StringMarshalling.Utf8)]
public static partial void Method1(string s);
- [GeneratedDllImport(""DoesNotExist"", StringMarshalling = StringMarshalling.Custom, StringMarshallingCustomType = typeof(Native))]
+ [LibraryImport(""DoesNotExist"", StringMarshalling = StringMarshalling.Custom, StringMarshallingCustomType = typeof(Native))]
public static partial void Method2(string s);
struct Native
public string ToManaged() => default;
}
}
-" + CodeSnippets.GeneratedDllImportAttributeDeclaration;
+" + CodeSnippets.LibraryImportAttributeDeclaration;
// Compile against Standard so that we generate forwarders
Compilation comp = await TestUtils.CreateCompilation(source, TestTargetFramework.Standard);
{
(new DiagnosticResult(GeneratorDiagnostics.CannotForwardToDllImport))
.WithSpan(6, 32, 6, 39)
- .WithArguments($"{nameof(TypeNames.GeneratedDllImportAttribute)}{Type.Delimiter}{nameof(StringMarshalling)}={nameof(StringMarshalling)}{Type.Delimiter}{nameof(StringMarshalling.Utf8)}"),
+ .WithArguments($"{nameof(TypeNames.LibraryImportAttribute)}{Type.Delimiter}{nameof(StringMarshalling)}={nameof(StringMarshalling)}{Type.Delimiter}{nameof(StringMarshalling.Utf8)}"),
(new DiagnosticResult(GeneratorDiagnostics.CannotForwardToDllImport))
.WithSpan(9, 32, 9, 39)
- .WithArguments($"{nameof(TypeNames.GeneratedDllImportAttribute)}{Type.Delimiter}{nameof(StringMarshalling)}={nameof(StringMarshalling)}{Type.Delimiter}{nameof(StringMarshalling.Custom)}"),
+ .WithArguments($"{nameof(TypeNames.LibraryImportAttribute)}{Type.Delimiter}{nameof(StringMarshalling)}={nameof(StringMarshalling)}{Type.Delimiter}{nameof(StringMarshalling.Custom)}"),
(new DiagnosticResult(GeneratorDiagnostics.CannotForwardToDllImport))
.WithSpan(9, 32, 9, 39)
- .WithArguments($"{nameof(TypeNames.GeneratedDllImportAttribute)}{Type.Delimiter}{nameof(GeneratedDllImportAttribute.StringMarshallingCustomType)}", $"{nameof(StringMarshalling)}{Type.Delimiter}{nameof(StringMarshalling.Custom)}"),
+ .WithArguments($"{nameof(TypeNames.LibraryImportAttribute)}{Type.Delimiter}{nameof(LibraryImportAttribute.StringMarshallingCustomType)}", $"{nameof(StringMarshalling)}{Type.Delimiter}{nameof(StringMarshalling.Custom)}"),
(new DiagnosticResult(GeneratorDiagnostics.ParameterTypeNotSupportedWithDetails))
.WithSpan(9, 47, 9, 48)
};
{CodeSnippets.DisableRuntimeMarshalling}
partial class Test
{{
- [GeneratedDllImport(""DoesNotExist"", StringMarshalling = StringMarshalling.Custom)]
+ [LibraryImport(""DoesNotExist"", StringMarshalling = StringMarshalling.Custom)]
public static partial void Method1(out int i);
- [GeneratedDllImport(""DoesNotExist"", StringMarshalling = StringMarshalling.Utf8, StringMarshallingCustomType = typeof(Native))]
+ [LibraryImport(""DoesNotExist"", StringMarshalling = StringMarshalling.Utf8, StringMarshallingCustomType = typeof(Native))]
public static partial void Method2(out int i);
struct Native
DiagnosticResult[] expectedDiags = new DiagnosticResult[]
{
(new DiagnosticResult(GeneratorDiagnostics.InvalidStringMarshallingConfiguration))
- .WithSpan(6, 6, 6, 86),
+ .WithSpan(6, 6, 6, 81),
(new DiagnosticResult(GeneratorDiagnostics.InvalidStringMarshallingConfiguration))
- .WithSpan(9, 6, 9, 130)
+ .WithSpan(9, 6, 9, 125)
};
VerifyDiagnostics(expectedDiags, GetSortedDiagnostics(generatorDiags));
var newCompDiags = newComp.GetDiagnostics();
using System.Runtime.InteropServices;
partial class Test
{
- [GeneratedDllImport(""DoesNotExist"")]
+ [LibraryImport(""DoesNotExist"")]
public static void Method() { }
- [GeneratedDllImport(""DoesNotExist"")]
+ [LibraryImport(""DoesNotExist"")]
public static extern void ExternMethod();
}
";
using System.Runtime.InteropServices;
partial class Test
{
- [GeneratedDllImport(""DoesNotExist"")]
+ [LibraryImport(""DoesNotExist"")]
public partial void Method();
}
";
using System.Runtime.InteropServices;
partial class Test
{
- [GeneratedDllImport(""DoesNotExist"")]
+ [LibraryImport(""DoesNotExist"")]
public static partial void Method1<T>();
- [GeneratedDllImport(""DoesNotExist"")]
+ [LibraryImport(""DoesNotExist"")]
public static partial void Method2<T, U>();
}
";
using System.Runtime.InteropServices;
{typeKind} Test
{{
- [GeneratedDllImport(""DoesNotExist"")]
+ [LibraryImport(""DoesNotExist"")]
public static partial void Method();
}}
";
{{
partial class TestInner
{{
- [GeneratedDllImport(""DoesNotExist"")]
+ [LibraryImport(""DoesNotExist"")]
static partial void Method();
}}
}}
}
[ConditionalFact]
- public async Task AddingFileWithNewGeneratedDllImport_DoesNotRegenerateOriginalMethod()
+ public async Task AddingFileWithNewLibraryImport_DoesNotRegenerateOriginalMethod()
{
string source = CodeSnippets.BasicParametersAndModifiers<int>();
}
[ConditionalFact]
- public async Task ReplacingFileWithNewGeneratedDllImport_DoesNotRegenerateStubsInOtherFiles()
+ public async Task ReplacingFileWithNewLibraryImport_DoesNotRegenerateStubsInOtherFiles()
{
Compilation comp1 = await TestUtils.CreateCompilation(new string[] { CodeSnippets.BasicParametersAndModifiers<int>(), CodeSnippets.BasicParametersAndModifiers<bool>() });
var allowedDiagnostics = new HashSet<string>()
{
"CS8795", // Partial method impl missing
- "CS0234", // Missing type or namespace - GeneratedDllImportAttribute
- "CS0246", // Missing type or namespace - GeneratedDllImportAttribute
+ "CS0234", // Missing type or namespace - LibraryImportAttribute
+ "CS0246", // Missing type or namespace - LibraryImportAttribute
"CS8019", // Unnecessary using
};
{
// Include the assembly containing the new attribute and all of its references.
// [TODO] Remove once the attribute has been added to the BCL
- var attrAssem = typeof(GeneratedDllImportAttribute).GetTypeInfo().Assembly;
+ var attrAssem = typeof(LibraryImportAttribute).GetTypeInfo().Assembly;
return MetadataReference.CreateFromFile(attrAssem.Location);
}
{
public const string NativeExportsNE_Binary = "Microsoft.Interop.Tests." + nameof(NativeExportsNE);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "sumi")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "sumi")]
public static partial int Sum(int a, int b);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "sumouti")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "sumouti")]
public static partial void Sum(int a, int b, out int c);
- [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "sumrefi")]
+ [LibraryImport(NativeExportsNE_Binary, EntryPoint = "sumrefi")]
public static partial void Sum(int a, ref int b);
}