Skip to content

Commit

Permalink
Minor cleanup. Upgraded dependencies to GA versions.
Browse files Browse the repository at this point in the history
  • Loading branch information
kshyju committed Nov 15, 2024
1 parent 526d6d0 commit 4310a3d
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 4 deletions.
4 changes: 2 additions & 2 deletions host/src/FunctionsNetHost/FunctionsNetHost.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="System.CommandLine" Version="2.0.0-beta4.22272.1" />
<PackageReference Include="System.Text.Json" Version="9.0.0-preview.6.24327.7" />
<PackageReference Include="Microsoft.NETCore.DotNetAppHost" Version="9.0.0-preview.6.24327.7" />
<PackageReference Include="System.Text.Json" Version="9.0.0" />
<PackageReference Include="Microsoft.NETCore.DotNetAppHost" Version="9.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
19 changes: 19 additions & 0 deletions host/src/FunctionsNetHost/Native/NativeExports.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,25 @@ public static unsafe int RegisterCallbacks(IntPtr pInProcessApplication,
Logger.Log($"Error in RegisterCallbacks: {ex}");
return 0;
}
}

[UnmanagedCallersOnly(EntryPoint = "register_startuphook_callback")]
public static unsafe int RegisterStartupHookCallback(IntPtr pInProcessApplication,
delegate* unmanaged<byte**, int, IntPtr, IntPtr> requestCallback,
IntPtr grpcHandler)
{
Logger.LogTrace("NativeExports.RegisterStartupHookCallback method invoked.");

try
{
NativeHostApplication.Instance.SetStartupHookCallbackHandles(requestCallback, grpcHandler);
return 1;
}
catch (Exception ex)
{
Logger.Log($"Error in RegisterStartupHookCallback: {ex}");
return 0;
}
}

[UnmanagedCallersOnly(EntryPoint = "send_streaming_message")]
Expand Down
4 changes: 2 additions & 2 deletions host/src/PlaceholderApp/Interop/NativeMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ internal static unsafe void RegisterForStartupHookCallback()

internal static void RegisterStartupHookMessageHandlingCallback(delegate* unmanaged<byte**, int, nint, nint> requestCallback, nint grpcHandler)
{
_ = register_startuphook_callbacks(nint.Zero, requestCallback, grpcHandler);
_ = register_startuphook_callback(nint.Zero, requestCallback, grpcHandler);
}

/// <summary>
Expand All @@ -45,7 +45,7 @@ internal static SpecializeMessage WaitForSpecializationMessage()
}

[DllImport(NativeWorkerDll)]
private static extern unsafe int register_startuphook_callbacks(nint pInProcessApplication, delegate* unmanaged<byte**, int, nint, nint> requestCallback, nint grpcHandler);
private static extern unsafe int register_startuphook_callback(nint pInProcessApplication, delegate* unmanaged<byte**, int, nint, nint> requestCallback, nint grpcHandler);

[UnmanagedCallersOnly]
private static unsafe nint StartupHookCallbackHandler(byte** nativeMessage, int nativeMessageSize, nint grpcHandler)
Expand Down

0 comments on commit 4310a3d

Please sign in to comment.