

dotnet 读 WPF 源代码笔记 wpfgfx_cor3.dll 是什么文件
source link: https://lindexi.gitee.io/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
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

本文是我在读 WPF 源代码做的笔记
通过 WPF 的架构文档可以了解到在 WPF 里面的架构如下图
这里有一层很重要的一层是 MilCore 层,这一层将会沟通 DirectX 和 托管层,而这一层在用户端的逻辑就放在 wpfgfx_cor3.dll 文件里面
这个文件的命名定义可以从 src\Microsoft.DotNet.Wpf\src\Shared\RefAssemblyAttrs.cs
的 DllImport 代码里面看到有如下代码
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 的定义如下
internal static class BuildInfo
{
internal const string WCP_VERSION_SUFFIX = "_cor3";
}
也就是说 wpfgfx_cor3.dll
中的 _core3
是 WCP_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 ,以避免陈旧错误知识的误导,同时有更好的阅读体验。
如果你想持续阅读我的最新博客,请点击 RSS 订阅,推荐使用RSS Stalker订阅博客,或者前往 CSDN 关注我的主页
本作品采用 知识共享署名-非商业性使用-相同方式共享 4.0 国际许可协议 进行许可。欢迎转载、使用、重新发布,但务必保留文章署名林德熙(包含链接: https://blog.lindexi.com ),不得用于商业目的,基于本文修改后的作品务必以相同的许可发布。如有任何疑问,请 与我联系 。
无盈利,不卖课,做纯粹的技术博客
以下是广告时间
推荐关注 Edi.Wang 的公众号
欢迎进入 Eleven 老师组建的 .NET 社区
以上广告全是友情推广,无盈利
Recommend
-
17
dotnet 读 WPF 源代码笔记 启动欢迎界面 SplashScreen 的原理本文是我在读 WPF 源代码做的笔记。在 WPF 中的启动界面,为了能让 WPF 的启动界面显示足够快,需要在应用的 WPF 主机还没有启动完成之前就显示出启动图,此时的启动图需要自己解析图片同时也需要自...
-
10
dotnet 读 WPF 源代码笔记 WIC 多媒体图片处理通过 WindowsCodecs.dll 实现功能本文是我在读 WPF 源代码做的笔记 在 WPF 中,作为一个现代化的 UI 框架,自然有很多多媒体相关的事情需要处理,在 WPF 中有特别的一层是 WIC 层,这一层将包...
-
10
dotnet 读 WPF 源代码笔记 AppDomainShutdownMonitor 的设计本文是我在读 WPF 源代码做的笔记。在 WPF 中的 AppDomainShutdownMonitor 类是一个不开放的类,这个类当前只是给 D3DImage 类使用。在 AppDomainShutdownMonitor 提供了在应用的进程或程序域关...
-
13
dotnet 读 WPF 源代码笔记 SafeMILHandleMemoryPressure 的作用本文来告诉大家在 WPF 里面的 SafeMILHandleMemoryPressure 类的作用。这是一个 internal 不开放的类,是在 WPF 中和 Dx 等模块调用使用的,用途就是辅助 GC 统计当前内存情况,用来在内存不...
-
14
dotnet 读 WPF 源代码笔记 XAML 创建对象的方法在 WPF 中,在 XAML 里面定义的对象的创建,实际上不是完全通过反射来进行创建的,在WPF框架里面,有进行了一系列的优化 在 WPF 中,将会通过 XamlTypeInvoker 的 CreateInstance 方法来进行...
-
12
dotnet 读 WPF 源代码笔记 使用 Win32 方法修改窗口的坐标和大小对窗口依赖属性的影响咱可以使用 Win32 的 SetWindowPos 修改窗口的坐标和大小,此时 WPF 的窗口的 Left 和 Top 和 Width 和 Height 依赖属性也会受到影响,本文将会告诉大家在啥时候会同步更改 W...
-
6
dotnet 读 WPF 源代码笔记 默认的 Main 函数是在哪创建的在使用默认的 WPF 项目开发的时候,咱是不需要自己编写 Main 函数的,在 WPF 中的 Main 函数是存放在 App.g.cs 里面,看起来这个 Main 函数是生成的函数,本文将介绍在 WPF 框架中是如何创建这个入...
-
10
dotnet 读 WPF 源代码笔记 创建 SolidColorBrush 性能没有想象那么差在 WPF 中,常用的画刷里面有纯色画刷 SolidColorBrush 类。因为画刷会对应到 DirectX 的资源,因此之前我以为纯色画刷其实会比 Color 会占用更多的资源。在 WPF 中 Color 其实是结构体,创建...
-
10
dotnet 读 WPF 源代码笔记 了解 WPF 已知问题 后台线程创建 WriteableBitmap 锁住主线程在 WPF 中,如果在没有开启 Dispatcher 的后台线程里面创建 WriteableBitmap 对象,在 WriteableBitmap 构造函数传入在主线程创建的 BitmapSource 也许就会锁住主线程。本...
-
2
Richa Katiyar May 19, 2022 3 minute read
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK