Skip to content

Commit 6db8064

Browse files
author
shine xus
committed
QUIC_API_VERSION
1 parent 6d0fba3 commit 6db8064

6 files changed

Lines changed: 9 additions & 0 deletions

File tree

0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
517 KB
Binary file not shown.

‎HiddifyConfigsCLI/msquic.dll‎

517 KB
Binary file not shown.

‎HiddifyConfigsCLI/src/Checking/Handshakers/Hysteria2/Hysteria2Handshaker.cs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ internal static class Hysteria2Handshaker
4040

4141
LogHelper.Verbose($"[Hysteria2] QUIC 已连接 {node.Host}:{targetPort} → {connection.ToString}");
4242

43+
// 尝试使用 ChatGPT 修改过的 MsQuic
4344
// await using var stream = await connection.OpenOutboundStreamAsync(QuicStreamType.Bidirectional, cts.Token);
4445
await using var stream = await connection.OpenBidirectionalStreamAsync(cts.Token);
4546

‎HiddifyConfigsCLI/src/Checking/Handshakers/Hysteria2/Hysteria2MsQuicNative.cs‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// HiddifyConfigsCLI.src.Checking/Handshakers/Hysteria2/MsQuic/Hysteria2MsQuicNative.cs
22
// Grok 写的代码,我一点也不懂。
33

4+
using HiddifyConfigsCLI.src.Logging;
45
using System.Runtime.CompilerServices;
56
using System.Runtime.InteropServices;
67

@@ -231,7 +232,14 @@ private struct QUIC_API_TABLE_RAW
231232

232233
static Hysteria2MsQuicNative()
233234
{
235+
// 调试信息
236+
LogHelper.Debug("[Hysteria2MsQuicNative] 正在加载 MsQuic...");
234237
int status = MsQuicOpenVersion(QUIC_API_VERSION, out nint apiPtr);
238+
239+
// 调试信息
240+
// 0x80004002 MsQuic DLL 加载成功,API 版本(QUIC_API_VERSION = 3)不可用或不兼容,apiPtr = 0 说明 MsQuic 没有返回有效的函数表指针。
241+
LogHelper.Debug($"[Hysteria2MsQuicNative] MsQuicOpenVersion status=0x{status:X8}, apiPtr={apiPtr}");
242+
235243
if (status != QUIC_STATUS_SUCCESS)
236244
throw new PlatformNotSupportedException($"MsQuic 加载失败: 0x{status:X8}");
237245

0 commit comments

Comments
 (0)