Skip to content

Commit 3f42166

Browse files
authored
backport-native-handle-validation
1 parent e05b0e6 commit 3f42166

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Windows/Avalonia.Win32/Win32NativeControlHost.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,10 @@ public DumbWindow(bool layered = false, IntPtr? parent = null)
9494
IntPtr.Zero,
9595
IntPtr.Zero,
9696
IntPtr.Zero);
97+
98+
if (Handle == IntPtr.Zero)
99+
throw new InvalidOperationException("Unable to create child window for native control host. Application manifest with supported OS list might be required.");
100+
97101
if (layered)
98102
UnmanagedMethods.SetLayeredWindowAttributes(Handle, 0, 255,
99103
UnmanagedMethods.LayeredWindowFlags.LWA_ALPHA);

0 commit comments

Comments
 (0)