weolar / miniblink49

a lighter, faster browser kernel of blink to integrate HTML UI in your app. 一个小巧、轻量的浏览器内核,用来取代wke和libcef
Apache License 2.0
7.23k stars 1.09k forks source link

OnLoadUrlBegin事件中wkeNetGetRawHttpHead出返回null值 #565

Open liangruiben opened 1 year ago

liangruiben commented 1 year ago

使用MBforNET的MiniBlink_DLL来构建一个C#浏览器,在OnLoadUrlBegin事件检测HTTP请求数据时
wkeSlist rawHead = (sender as WebView).NetGetRawHttpHead(e.Job); 会出错,访问网址www.qq.com 查看是在MB_WebView.cs

        public wkeSlist NetGetRawHttpHead(IntPtr job)
        {
            IntPtr ptr = MBApi.wkeNetGetRawHttpHead(job);
            return (wkeSlist)ptr.UTF8PtrToStruct(typeof(wkeSlist));//在 这一步已经跳出错误了。ptr.UTF8PtrToStruct(typeof(wkeSlist))会出现NULL值。
        }

其中wkeNetGetRawHttpHead是MB_API.cs中的

        [DllImport(m_strDll, EntryPoint = "wkeNetGetRawHttpHead", CallingConvention = CallingConvention.Cdecl)]
        public static extern IntPtr wkeNetGetRawHttpHead(IntPtr job);

不知如何解决