From 46db1b61d4426b7dc155ebaf91ba0ee6e3895731 Mon Sep 17 00:00:00 2001 From: Brian Fiete Date: Fri, 28 Mar 2025 11:43:08 -0400 Subject: [PATCH] SendMessageTimeoutW result size fix, isExpanded for reg string GetValue --- BeefLibs/corlib/src/Windows.bf | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/BeefLibs/corlib/src/Windows.bf b/BeefLibs/corlib/src/Windows.bf index a393399e..be1ce04f 100644 --- a/BeefLibs/corlib/src/Windows.bf +++ b/BeefLibs/corlib/src/Windows.bf @@ -369,11 +369,15 @@ namespace System return .Ok; } - public Result GetValue(StringView name, String outData) + public Result GetValue(StringView name, String outData, bool* isExpanded = null) { + if (isExpanded != null) + *isExpanded = false; bool gotData = false; GetValue(name, scope [?] (regType, regData) => { + if (isExpanded != null) + *isExpanded = regType == Windows.REG_EXPAND_SZ; if ((regType == Windows.REG_SZ) || (regType == Windows.REG_EXPAND_SZ)) { gotData = true; @@ -474,7 +478,7 @@ namespace System public Result SetValueExpand(StringView name, StringView strValue) { - let result = Windows.RegSetValueExA(this, name.ToScopeCStr!(), 0, Windows.REG_EXPAND_SZ, strValue.ToScopeCStr!(), (uint32)strValue.Length + 1); + let result = Windows.RegSetValueExA(this, name.ToScopeCStr!(), 0, Windows.REG_EXPAND_SZ, strValue.ToScopeCStr!(), (uint32)strValue.Length + 1); if (result != 0) return .Err; return .Ok; @@ -1773,7 +1777,7 @@ namespace System public static extern int32 SendMessageW(HWnd hWnd, int32 msg, int wParam, int lParam); [Import("user32.lib"), CLink, CallingConvention(.Stdcall)] - public static extern int32 SendMessageTimeoutW(HWnd hWnd, int32 msg, int wParam, int lParam, int32 flags, int32 timeout, int32* result); + public static extern int32 SendMessageTimeoutW(HWnd hWnd, int32 msg, int wParam, int lParam, int32 flags, int32 timeout, int* result); [Import("user32.lib "), CLink, CallingConvention(.Stdcall)] public static extern HWnd SetFocus(HWnd hWnd);