Commit 91d50716 authored by Viktor Legodzinski's avatar Viktor Legodzinski
Browse files

fix: Further guards for win32 only functions

parent 972b61b2
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -389,6 +389,8 @@ public static unsafe class PInvokeInterface
        ph2_rangeallocator_allocate_ptr = GetDelegate<ph2_rangeallocator_allocate_delegate>(handle, "ph2_rangeallocator_allocate");
        ph2_rangeallocator_deallocate_ptr = GetDelegate<ph2_rangeallocator_deallocate_delegate>(handle, "ph2_rangeallocator_deallocate");

        if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
        {
            ph2_breakpoint_create_ptr = GetDelegate<ph2_breakpoint_create_delegate>(handle, "ph2_breakpoint_create");
            ph2_breakpoint_destructor_ptr = GetDelegate<ph2_breakpoint_destructor_delegate>(handle, "ph2_breakpoint_destructor");
            ph2_breakpoint_hook_ptr = GetDelegate<ph2_breakpoint_hook_delegate>(handle, "ph2_breakpoint_hook");
@@ -398,6 +400,7 @@ public static unsafe class PInvokeInterface
            ph2_hwbreakpoint_destructor_ptr = GetDelegate<ph2_hwbreakpoint_destructor_delegate>(handle, "ph2_hwbreakpoint_destructor");
            ph2_hwbreakpoint_hook_ptr = GetDelegate<ph2_hwbreakpoint_hook_delegate>(handle, "ph2_hwbreakpoint_hook");
            ph2_hwbreakpoint_unhook_ptr = GetDelegate<ph2_hwbreakpoint_unhook_delegate>(handle, "ph2_hwbreakpoint_unhook");
        }

        ph2_fballocator_create_ptr = GetDelegate<ph2_fballocator_create_delegate>(handle, "ph2_fballocator_create");
        ph2_fballocator_destructor_ptr = GetDelegate<ph2_fballocator_destructor_delegate>(handle, "ph2_fballocator_destructor");
@@ -405,6 +408,8 @@ public static unsafe class PInvokeInterface
        ph2_fballocator_calloc_ptr = GetDelegate<ph2_fballocator_calloc_delegate>(handle, "ph2_fballocator_calloc");
        ph2_fballocator_free_ptr = GetDelegate<ph2_fballocator_free_delegate>(handle, "ph2_fballocator_free");

        if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
        {
            ph2_iathook_create_ptr = GetDelegate<ph2_iathook_create_delegate>(handle, "ph2_iathook_create");
            ph2_iathook_destructor_ptr = GetDelegate<ph2_iathook_destructor_delegate>(handle, "ph2_iathook_destructor");
            ph2_iathook_hook_ptr = GetDelegate<ph2_iathook_hook_delegate>(handle, "ph2_iathook_hook");
@@ -415,6 +420,7 @@ public static unsafe class PInvokeInterface
            ph2_eathook_destructor_ptr = GetDelegate<ph2_eathook_destructor_delegate>(handle, "ph2_eathook_destructor");
            ph2_eathook_hook_ptr = GetDelegate<ph2_eathook_hook_delegate>(handle, "ph2_eathook_hook");
            ph2_eathook_unhook_ptr = GetDelegate<ph2_eathook_unhook_delegate>(handle, "ph2_eathook_unhook");
        }

        ph2_vfuncmap_create_ptr = GetDelegate<ph2_vfuncmap_create_delegate>(handle, "ph2_vfuncmap_create");
        ph2_vfuncmap_destructor_ptr = GetDelegate<ph2_vfuncmap_destructor_delegate>(handle, "ph2_vfuncmap_destructor");