move StringFromCLSID to routine

This commit is contained in:
henrypp committed 2018-09-21 12:32:13 +06:00
1 parent 1ae4bb1d3f
commit e8df3b20ce
1 file changed
+3 -9
+3 -9
View File
@@ -1834,7 +1834,6 @@ DWORD _wfp_createfilter (LPCWSTR name, FWPM_FILTER_CONDITION* lpcond, UINT32 con
filter.filterCondition = lpcond;
}
if (layer)
CopyMemory (&filter.layerKey, layer, sizeof (GUID));
@@ -3477,15 +3476,10 @@ bool _wfp_isfiltersinstalled ()
if (RegOpenKeyEx (HKEY_LOCAL_MACHINE, L"SYSTEM\\CurrentControlSet\\services\\BFE\\Parameters\\Policy\\Persistent\\Provider", 0, KEY_READ, &hkey) == ERROR_SUCCESS)
{
OLECHAR* guidString = nullptr;
static const rstring guidString = _r_str_fromguid (GUID_WfpProvider);
if (SUCCEEDED (StringFromCLSID (GUID_WfpProvider, &guidString)))
{
if (RegQueryValueEx (hkey, guidString, nullptr, nullptr, nullptr, nullptr) == ERROR_SUCCESS)
result = true;
CoTaskMemFree (guidString);
}
if (RegQueryValueEx (hkey, guidString, nullptr, nullptr, nullptr, nullptr) == ERROR_SUCCESS)
result = true;
RegCloseKey (hkey);
}