diff options
author | Simon Rozman <simon@rozman.si> | 2020-10-23 22:04:40 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2020-10-30 16:51:01 +0100 |
commit | 84c066fa798a4d669f9fa3145a29ed9d46db47d5 (patch) | |
tree | 51ddf7fae7fe213e1130daf7f0c306892792a8c7 /api/registry.h | |
parent | api: connect rundll32 child with parent using stdout and stderr (diff) | |
download | wintun-84c066fa798a4d669f9fa3145a29ed9d46db47d5.tar.xz wintun-84c066fa798a4d669f9fa3145a29ed9d46db47d5.zip |
api: revise logging
RegistryQueryString() may produce one or more "File not found" errors
when called from RegistryQueryStringWait() - which is expected while
waiting. Those errors were annoying and awkward to read in the log.
Furthermore, should RegistryQueryString() fail, it already displays
detailed Windows error message and the parent's logging was simplified
to prevent repetitions in the log.
Signed-off-by: Simon Rozman <simon@rozman.si>
Diffstat (limited to '')
-rw-r--r-- | api/registry.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/api/registry.h b/api/registry.h index 16322d3..783280a 100644 --- a/api/registry.h +++ b/api/registry.h @@ -81,11 +81,15 @@ RegistryGetMultiString(_Inout_ WCHAR **Buf, _In_ DWORD Len, _In_ DWORD ValueType * string from the multi-string is returned. The string must be released with * HeapFree(GetProcessHeap(), 0, Value) after use. * + * @Log Set to TRUE to log all failures; FALSE to skip logging the innermost errors. Skipping innermost + * errors reduces log clutter when we are using RegistryQueryString() from + * RegistryQueryStringWait() and some errors are expected to occur. + * * @return ERROR_SUCCESS on success; ERROR_INVALID_DATATYPE when the registry value is not a string; Win32 error code * otherwise. */ WINTUN_STATUS -RegistryQueryString(_In_ HKEY Key, _In_opt_z_ const WCHAR *Name, _Out_ WCHAR **Value); +RegistryQueryString(_In_ HKEY Key, _In_opt_z_ const WCHAR *Name, _Out_ WCHAR **Value, _In_ BOOL Log); /** * Reads string value from registry key. It waits for the registry value to become available. |