mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 10:17:22 +01:00
* CoreCLR: resolve and load nethost on demand instead of requiring it on load * Remove nethost loading from C# side * Added option to not chain Process.Dispose; see for last error only if result is empty
69 lines
2 KiB
C
69 lines
2 KiB
C
// Licensed to the .NET Foundation under one or more agreements.
|
|
// The .NET Foundation licenses this file to you under the MIT license.
|
|
|
|
#ifndef __NETHOST_H__
|
|
#define __NETHOST_H__
|
|
|
|
#include <stddef.h>
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
// Parameters for get_hostfxr_path
|
|
//
|
|
// Fields:
|
|
// size
|
|
// Size of the struct. This is used for versioning.
|
|
//
|
|
// assembly_path
|
|
// Path to the compenent's assembly.
|
|
// If specified, hostfxr is located as if the assembly_path is the apphost
|
|
//
|
|
// dotnet_root
|
|
// Path to directory containing the dotnet executable.
|
|
// If specified, hostfxr is located as if an application is started using
|
|
// 'dotnet app.dll', which means it will be searched for under the dotnet_root
|
|
// path and the assembly_path is ignored.
|
|
//
|
|
struct get_hostfxr_parameters {
|
|
size_t size;
|
|
const char_t *assembly_path;
|
|
const char_t *dotnet_root;
|
|
};
|
|
|
|
//
|
|
// Get the path to the hostfxr library
|
|
//
|
|
// Parameters:
|
|
// buffer
|
|
// Buffer that will be populated with the hostfxr path, including a null terminator.
|
|
//
|
|
// buffer_size
|
|
// [in] Size of buffer in char_t units.
|
|
// [out] Size of buffer used in char_t units. If the input value is too small
|
|
// or buffer is nullptr, this is populated with the minimum required size
|
|
// in char_t units for a buffer to hold the hostfxr path
|
|
//
|
|
// get_hostfxr_parameters
|
|
// Optional. Parameters that modify the behaviour for locating the hostfxr library.
|
|
// If nullptr, hostfxr is located using the enviroment variable or global registration
|
|
//
|
|
// Return value:
|
|
// 0 on success, otherwise failure
|
|
// 0x80008098 - buffer is too small (HostApiBufferTooSmall)
|
|
//
|
|
// Remarks:
|
|
// The full search for the hostfxr library is done on every call. To minimize the need
|
|
// to call this function multiple times, pass a large buffer (e.g. PATH_MAX).
|
|
//
|
|
using get_hostfxr_path_type = int(__stdcall *)(
|
|
char_t* buffer,
|
|
size_t* buffer_size,
|
|
const struct get_hostfxr_parameters* parameters);
|
|
|
|
#ifdef __cplusplus
|
|
} // extern "C"
|
|
#endif
|
|
|
|
#endif // __NETHOST_H__
|