首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >专栏 >dotnet 读 WPF 源代码笔记 wpfgfx_cor3.dll 是什么文件

dotnet 读 WPF 源代码笔记 wpfgfx_cor3.dll 是什么文件

作者头像
林德熙
发布2020-12-22 15:27:14
发布2020-12-22 15:27:14
1.1K00
代码可运行
举报
文章被收录于专栏:林德熙的博客林德熙的博客
运行总次数:0
代码可运行

本文是我在读 WPF 源代码做的笔记

通过 WPF 的架构文档可以了解到在 WPF 里面的架构如下图

这里有一层很重要的一层是 MilCore 层,这一层将会沟通 DirectX 和 托管层,而这一层在用户端的逻辑就放在 wpfgfx_cor3.dll 文件里面

这个文件的命名定义可以从 src\Microsoft.DotNet.Wpf\src\Shared\RefAssemblyAttrs.cs 的 DllImport 代码里面看到有如下代码

代码语言:javascript
代码运行次数:0
运行
复制
    internal static class DllImport
    {
        internal const string PresentationNative = "PresentationNative" + BuildInfo.WCP_VERSION_SUFFIX + ".dll";
        internal const string PresentationCFFRasterizerNative = "PresentationCFFRasterizerNative" + BuildInfo.WCP_VERSION_SUFFIX + ".dll";
        internal const string MilCore = "wpfgfx" + BuildInfo.WCP_VERSION_SUFFIX + ".dll";

        // DLL's w/o version suffix
        internal const string UIAutomationCore = "UIAutomationCore.dll";
        internal const string Wininet = "Wininet.dll";
        internal const string WindowsCodecs = "WindowsCodecs.dll";
        internal const string WindowsCodecsExt = "WindowsCodecsExt.dll";
        internal const string Mscms = "mscms.dll";
        internal const string PrntvPt = "prntvpt.dll";
        internal const string Ole32 = "ole32.dll";
        internal const string User32 = "user32.dll";
        internal const string NInput = "ninput.dll";
        internal const string ApiSetWinRT = "api-ms-win-core-winrt-l1-1-0.dll";
        internal const string ApiSetWinRTString = "api-ms-win-core-winrt-string-l1-1-0.dll";
    }

而 BuildInfo.WCP_VERSION_SUFFIX 的定义如下

代码语言:javascript
代码运行次数:0
运行
复制
    internal static class BuildInfo
    {
        internal const string WCP_VERSION_SUFFIX = "_cor3";
    }

也就是说 wpfgfx_cor3.dll 中的 _core3WCP_VERSION_SUFFIX 版本定义的意思,就不知道后续还加不加到 .NET 5 了哈

而 WPF GFX 本身是一个很大的代码库,如下图

当前的 WPF 在 https://github.com/dotnet/wpf 完全开源,使用友好的 MIT 协议,意味着允许任何人任何组织和企业任意处置,包括使用,复制,修改,合并,发表,分发,再授权,或者销售。在仓库里面包含了完全的构建逻辑,只需要本地的网络足够好(因为需要下载一堆构建工具),即可进行本地构建


本文会经常更新,请阅读原文: https://blog.lindexi.com/post/dotnet-%E8%AF%BB-WPF-%E6%BA%90%E4%BB%A3%E7%A0%81%E7%AC%94%E8%AE%B0-wpfgfx_cor3.dll-%E6%98%AF%E4%BB%80%E4%B9%88%E6%96%87%E4%BB%B6.html ,以避免陈旧错误知识的误导,同时有更好的阅读体验。

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档