Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Gecko Bug 1522696] Specify argument types and all parameters when calling SendMessageW from wpt font installation code #15100

Merged
merged 1 commit into from Jan 27, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
20 changes: 16 additions & 4 deletions tools/wptrunner/wptrunner/font.py
Expand Up @@ -92,8 +92,14 @@ def install_windows_font(self, _, font_path):

gdi32 = ctypes.WinDLL('gdi32')
if gdi32.AddFontResourceW(font_path):
return bool(ctypes.windll.user32.SendMessageW(hwnd_broadcast,
wm_fontchange))
from ctypes import wintypes
wparam = 0
lparam = 0
SendMessageW = ctypes.windll.user32.SendMessageW
SendMessageW.argtypes = [wintypes.HANDLE, wintypes.UINT,
wintypes.WPARAM, wintypes.LPARAM]
return bool(SendMessageW(hwnd_broadcast, wm_fontchange,
wparam, lparam))

def remove_linux_font(self, font_name, _):
if self.created_dir:
Expand All @@ -120,5 +126,11 @@ def remove_windows_font(self, _, font_path):

gdi32 = ctypes.WinDLL('gdi32')
if gdi32.RemoveFontResourceW(font_path):
return bool(ctypes.windll.user32.SendMessageW(hwnd_broadcast,
wm_fontchange))
from ctypes import wintypes
wparam = 0
lparam = 0
SendMessageW = ctypes.windll.user32.SendMessageW
SendMessageW.argtypes = [wintypes.HANDLE, wintypes.UINT,
wintypes.WPARAM, wintypes.LPARAM]
return bool(SendMessageW(hwnd_broadcast, wm_fontchange,
wparam, lparam))