Refactored DllImport notes.
This commit is contained in:
Родитель
a7da6031bb
Коммит
a990d43f00
|
@ -44,8 +44,10 @@ Below are scenarios that are represented in the metadata and that language proje
|
|||
DISCLAIMER: This list is a work in progress and is not yet comprehensive.
|
||||
|
||||
* Namespaces allow users to import only the APIs they require and/or to control any code generation that is producing language bindings
|
||||
* Entry points are assumed to be the same as function names unless the [EntryPoint](https://learn.microsoft.com/dotnet/api/system.runtime.interopservices.dllimportattribute.entrypoint) property of the `DllImport` attribute is specified
|
||||
* Calling convention is captured in the [CallingConvention](https://learn.microsoft.com/dotnet/api/system.runtime.interopservices.dllimportattribute.callingconvention) property of the `DllImport` attribute
|
||||
* The [DllImport](https://learn.microsoft.com/dotnet/api/system.runtime.interopservices.dllimportattribute) attribute is used to define several properties of a function:
|
||||
* Entry points are assumed to be the same as function names unless the [EntryPoint](https://learn.microsoft.com/dotnet/api/system.runtime.interopservices.dllimportattribute.entrypoint) property is specified
|
||||
* Calling convention is captured in the [CallingConvention](https://learn.microsoft.com/dotnet/api/system.runtime.interopservices.dllimportattribute.callingconvention) property
|
||||
* Whether a function calls `SetLastError` before returning is captured in the [SetLastError](https://learn.microsoft.com/dotnet/api/system.runtime.interopservices.dllimportattribute.setlasterror) property
|
||||
* typedefs (e.g. `BCRYPT_KEY_HANDLE`) are represented as CLR structs with a single field where the `NativeTypedef` attribute is applied to the struct. The type being defined is given by the name of the struct, and the type it is being defined as is the type of the struct field. typedefs can include the attributes `AlsoUsableFor`, `RAIIFree` and `InvalidHandleValue`:
|
||||
* `AlsoUsableFor` indicates that the type is implicitly convertible to another type (e.g. `BCRYPT_HANDLE`)
|
||||
* `RAIIFree` indicates what function should be used to close the handle (e.g. `BCryptDestroyKey`)
|
||||
|
|
Загрузка…
Ссылка в новой задаче