File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -663,7 +663,21 @@ void CheckAntiVirusStatus()
663
663
664
664
// Get status from WSC
665
665
WSC_SECURITY_PROVIDER_HEALTH health = (WSC_SECURITY_PROVIDER_HEALTH)-1 ;
666
- WscGetSecurityProviderHealth (WSC_SECURITY_PROVIDER_ANTIVIRUS, &health);
666
+ {
667
+ using FunctionT = decltype (&WscGetSecurityProviderHealth);
668
+
669
+ static auto _WscGetSecurityProviderHealth = ([]() -> FunctionT {
670
+ if (HMODULE wscapi = LoadLibraryW (L" Wscapi.dll" ))
671
+ {
672
+ return reinterpret_cast <FunctionT>(static_cast <void *>(GetProcAddress (wscapi, " WscGetSecurityProviderHealth" )));
673
+ }
674
+
675
+ return nullptr ;
676
+ })();
677
+
678
+ if (_WscGetSecurityProviderHealth)
679
+ _WscGetSecurityProviderHealth (WSC_SECURITY_PROVIDER_ANTIVIRUS, &health);
680
+ }
667
681
668
682
// Dump results
669
683
SString strStatus (" AV health: %s (%d)" , *EnumToString (health), health);
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ project "Loader"
18
18
" unrar" , " d3d9" ,
19
19
" detours" , " Imagehlp" ,
20
20
" ../../vendor/nvapi/x86/nvapi.lib" ,
21
- " cryptopp" , " Wscapi " ,
21
+ " cryptopp" ,
22
22
}
23
23
24
24
pchheader " StdInc.h"
You can’t perform that action at this time.
0 commit comments