| 859 | } |
| 860 | |
| 861 | HRESULT CaptionTextHandler::MyCDWriteText_ValidateVisual(uDWM::CDWriteText* This) |
| 862 | { |
| 863 | // 0x2 redraw text |
| 864 | // 0x8 offset changed |
| 865 | // 0x10 rtl mirrored changed |
| 866 | if ((This->GetDirtyFlags() & (0x8 | 0x10))) |
| 867 | { |
| 868 | This->SetDirtyFlags(0x2); |
| 869 | } |
| 870 | if ((This->GetDirtyFlags() & 0x2)) |
| 871 | { |
| 872 | This->SetDirtyFlags(0x8); |
| 873 | } |
| 874 | if (!g_CDWriteText_scalar_deleting_destructor_Org) |
| 875 | { |
| 876 | g_CDWriteText_scalar_deleting_destructor_Org_Address = HookHelper::get_vftable_from<decltype(g_CDWriteText_scalar_deleting_destructor_Org)>(This); |
| 877 | HookHelper::PatchPointerT( |
| 878 | g_CDWriteText_scalar_deleting_destructor_Org_Address, |
| 879 | MyCDWriteText_scalar_deleting_destructor, |
| 880 | &g_CDWriteText_scalar_deleting_destructor_Org |
| 881 | ); |
| 882 | } |
| 883 | if (!g_CDWriteText_UpdateOffset_Org) |
| 884 | { |
| 885 | PVOID CVisual_UpdateOffset_Org{ nullptr }; |
| 886 | PVOID CSpriteVisual_SetSize_Org{ nullptr }; |
| 887 | uDWM::g_projectionArray.ApplyToVariable("CVisual::UpdateOffset", CVisual_UpdateOffset_Org); |
| 888 | uDWM::g_projectionArray.ApplyToVariable("CSpriteVisual::SetSize", CSpriteVisual_SetSize_Org); |
| 889 | |
| 890 | for (auto& vf : std::span{ HookHelper::get_vftable_from(This), 32}) |
| 891 | { |
| 892 | if (vf == CVisual_UpdateOffset_Org) |
| 893 | { |
| 894 | g_CDWriteText_UpdateOffset_Org_Address = reinterpret_cast<decltype(g_CDWriteText_UpdateOffset_Org_Address)>(&vf); |
| 895 | HookHelper::PatchPointerT( |
| 896 | g_CDWriteText_UpdateOffset_Org_Address, |
| 897 | MyCDWriteText_UpdateOffset, |
| 898 | &g_CDWriteText_UpdateOffset_Org |
| 899 | ); |
| 900 | } |
| 901 | if (vf == CSpriteVisual_SetSize_Org) |
| 902 | { |
| 903 | g_CDWriteText_SetSize_Org_Address = reinterpret_cast<decltype(g_CDWriteText_SetSize_Org_Address)>(&vf); |
| 904 | HookHelper::PatchPointerT( |
| 905 | g_CDWriteText_SetSize_Org_Address, |
| 906 | MyCDWriteText_SetSize, |
| 907 | &g_CDWriteText_SetSize_Org |
| 908 | ); |
| 909 | } |
| 910 | } |
| 911 | } |
| 912 | if (g_window = uDWM::TryGetWindowFromVisual(This); g_window && g_window->GetData()) |
| 913 | { |
| 914 | auto& windowState = g_textVisualStateMap[This]; |
| 915 | |
| 916 | windowState.active = g_window->TreatAsActiveWindow(); |
| 917 | windowState.maximized = g_window->TreatAsMaximized(); |
| 918 |
nothing calls this directly
no test coverage detected