coreclr_delegates.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. // Licensed to the .NET Foundation under one or more agreements.
  2. // The .NET Foundation licenses this file to you under the MIT license.
  3. #ifndef __CORECLR_DELEGATES_H__
  4. #define __CORECLR_DELEGATES_H__
  5. #include <stdint.h>
  6. #if defined(_WIN32)
  7. #define CORECLR_DELEGATE_CALLTYPE __stdcall
  8. #ifdef _WCHAR_T_DEFINED
  9. typedef wchar_t char_t;
  10. #else
  11. typedef unsigned short char_t;
  12. #endif
  13. #else
  14. #define CORECLR_DELEGATE_CALLTYPE
  15. typedef char char_t;
  16. #endif
  17. #define UNMANAGEDCALLERSONLY_METHOD ((const char_t*)-1)
  18. // Signature of delegate returned by coreclr_delegate_type::load_assembly_and_get_function_pointer
  19. typedef int (CORECLR_DELEGATE_CALLTYPE *load_assembly_and_get_function_pointer_fn)(
  20. const char_t *assembly_path /* Fully qualified path to assembly */,
  21. const char_t *type_name /* Assembly qualified type name */,
  22. const char_t *method_name /* Public static method name compatible with delegateType */,
  23. const char_t *delegate_type_name /* Assembly qualified delegate type name or null
  24. or UNMANAGEDCALLERSONLY_METHOD if the method is marked with
  25. the UnmanagedCallersOnlyAttribute. */,
  26. void *reserved /* Extensibility parameter (currently unused and must be 0) */,
  27. /*out*/ void **delegate /* Pointer where to store the function pointer result */);
  28. // Signature of delegate returned by load_assembly_and_get_function_pointer_fn when delegate_type_name == null (default)
  29. typedef int (CORECLR_DELEGATE_CALLTYPE *component_entry_point_fn)(void *arg, int32_t arg_size_in_bytes);
  30. typedef int (CORECLR_DELEGATE_CALLTYPE *get_function_pointer_fn)(
  31. const char_t *type_name /* Assembly qualified type name */,
  32. const char_t *method_name /* Public static method name compatible with delegateType */,
  33. const char_t *delegate_type_name /* Assembly qualified delegate type name or null,
  34. or UNMANAGEDCALLERSONLY_METHOD if the method is marked with
  35. the UnmanagedCallersOnlyAttribute. */,
  36. void *load_context /* Extensibility parameter (currently unused and must be 0) */,
  37. void *reserved /* Extensibility parameter (currently unused and must be 0) */,
  38. /*out*/ void **delegate /* Pointer where to store the function pointer result */);
  39. #endif // __CORECLR_DELEGATES_H__