aboutsummaryrefslogtreecommitdiffstats
path: root/api/registry.h
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2021-05-04 18:46:59 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2021-05-05 11:17:39 +0200
commit747ba7121d1d94dac982b9148076d7006e2c170f (patch)
tree960900a770c9887c16613f7d02e8479451c12883 /api/registry.h
parentapi: don't pass bogus previous buffer size argument (diff)
downloadwintun-747ba7121d1d94dac982b9148076d7006e2c170f.tar.xz
wintun-747ba7121d1d94dac982b9148076d7006e2c170f.zip
api: clean up NetSetup2 GUIDs
Recent versions of Windows fail to tidy up, causing issues when reusing GUIDs. Check to see if a GUID might be orphaned, and forcibly clear out the registry state if so. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to '')
-rw-r--r--api/registry.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/api/registry.h b/api/registry.h
index 2a85a06..106a79d 100644
--- a/api/registry.h
+++ b/api/registry.h
@@ -141,3 +141,15 @@ _Return_type_success_(return != FALSE) BOOL
*/
_Return_type_success_(return != FALSE) BOOL
RegistryQueryDWORDWait(_In_ HKEY Key, _In_opt_z_ const WCHAR *Name, _In_ DWORD Timeout, _Out_ DWORD *Value);
+
+/**
+ * Deletes the entire registry key subtree recursively.
+ *
+ * @param Key Handle of the registry key to at which the subtree is rooted.
+ *
+ * @param Name Name of the subtree to delete.
+ *
+ * @return If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To
+ * get extended error information, call GetLastError.
+ */
+_Return_type_success_(return != FALSE) BOOL RegistryDeleteKeyRecursive(_In_ HKEY Key, _In_z_ const WCHAR *Name);