mirror of
https://github.com/not-wlan/drvmap
synced 2026-08-09 13:00:07 +00:00
Merge pull request #7 from BerkanYildiz/patch-1
Delete registry key when unloading
This commit is contained in:
+8
-1
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user