Merge pull request #7 from BerkanYildiz/patch-1

Delete registry key when unloading
This commit is contained in:
not-wlan
2018-12-24 02:28:22 +01:00
committed by GitHub
+8 -1
View File
@@ -102,10 +102,17 @@ namespace native
inline bool unload_driver(const std::wstring& service)
{
HKEY key;
UNICODE_STRING str;
auto wservice = internal::make_path(service);
RtlInitUnicodeString(&str, wservice.c_str());
if (!RegOpenKeyW(HKEY_LOCAL_MACHINE, L"system\\CurrentControlSet\\Services", &key))
{
RegDeleteKeyW(key, L"Capcom");
RegCloseKey(key);
}
return ZwUnloadDriver(&str) >= 0;
}
}
}