From e71b6a1edff978cf3d86c45710eb82031a2ea13a Mon Sep 17 00:00:00 2001 From: Steven Kirk Date: Sun, 28 Oct 2018 23:30:01 +0100 Subject: [PATCH] Compare IntPtrs with IntPtr.Zero instead of null D'oh. I wish C# would warn for this. --- src/Windows/Avalonia.Win32/Win32Platform.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Windows/Avalonia.Win32/Win32Platform.cs b/src/Windows/Avalonia.Win32/Win32Platform.cs index 06fe1ad058..103ca57cdb 100644 --- a/src/Windows/Avalonia.Win32/Win32Platform.cs +++ b/src/Windows/Avalonia.Win32/Win32Platform.cs @@ -247,7 +247,7 @@ namespace Avalonia.Win32 var user32 = LoadLibrary("user32.dll"); var method = GetProcAddress(user32, nameof(SetProcessDpiAwarenessContext)); - if (method != null) + if (method != IntPtr.Zero) { if (SetProcessDpiAwarenessContext(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2) || SetProcessDpiAwarenessContext(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE)) @@ -259,7 +259,7 @@ namespace Avalonia.Win32 var shcore = LoadLibrary("shcore.dll"); method = GetProcAddress(shcore, nameof(SetProcessDpiAwareness)); - if (method != null) + if (method != IntPtr.Zero) { SetProcessDpiAwareness(PROCESS_DPI_AWARENESS.PROCESS_PER_MONITOR_DPI_AWARE); return;