Closed henrypp closed 1 month ago
It is complete useless...
Older OS support is not the only reason to resolve functions dynamically. Another one is avoiding loading too many DLLs on startup. Statically importing all functions from above will also force System Informer to always load netapi32.dll
, dnsapi.dll
, ws2_32.dll
, powrprof.dll
, and all their dependencies, which is not desired.
@diversenok
Another one is avoiding loading too many DLLs on startup.
for this created delay-loaded dlls
The dynamic lookup of routines in many of these paths is very much intentional and by design. Some of these paths load specific DLLs (symprv.c
), are dealing with COM objects, could be locating an routine offset, or otherwise intentionally choosing to resolve it at runtime (specifically not as a delay load). Maybe some of them could be cleaned. But we need to be careful about doing all the ones you mentioned, because as I said - it's intentional in many paths.
It is complete useless...
Not everyone would agree?
There's also other reasons:
There just isn't a good one-size-fits-all reason to make everything static imports when they're just unrelaible and have worse performance. Some functions are static, others are delay-load or dynamic and all three are used when it makes sense.
@dmex, okay, i understand
PS: i think, there is no reason to create another issue, just to your knowlege! i dont open throught VS, i only compile throught builder
json-c/json.h & pcre2.h are not exists
[ERROR] (1) thirdparty.h(19,1): error C1189: #error: "vcpkg is mssing" [phlib.vcxproj]
It is complete useless...
// vista+:
--- https://github.com/winsiderss/systeminformer/blob/6bc650bbc687fc355eeb8881c1e601e915470ea6/phlib/guisup.c#L111 https://github.com/winsiderss/systeminformer/blob/6bc650bbc687fc355eeb8881c1e601e915470ea6/phlib/guisup.c#L112 https://github.com/winsiderss/systeminformer/blob/6bc650bbc687fc355eeb8881c1e601e915470ea6/phlib/guisup.c#L113 https://github.com/winsiderss/systeminformer/blob/6bc650bbc687fc355eeb8881c1e601e915470ea6/phlib/guisup.c#L114 https://github.com/winsiderss/systeminformer/blob/6bc650bbc687fc355eeb8881c1e601e915470ea6/phlib/guisup.c#L115 https://github.com/winsiderss/systeminformer/blob/6bc650bbc687fc355eeb8881c1e601e915470ea6/phlib/guisup.c#L116 https://github.com/winsiderss/systeminformer/blob/6bc650bbc687fc355eeb8881c1e601e915470ea6/phlib/guisup.c#L117 https://github.com/winsiderss/systeminformer/blob/6bc650bbc687fc355eeb8881c1e601e915470ea6/phlib/guisup.c#L118 https://github.com/winsiderss/systeminformer/blob/6bc650bbc687fc355eeb8881c1e601e915470ea6/phlib/icotobmp.c#L185 https://github.com/winsiderss/systeminformer/blob/6bc650bbc687fc355eeb8881c1e601e915470ea6/phlib/icotobmp.c#L186 https://github.com/winsiderss/systeminformer/blob/6bc650bbc687fc355eeb8881c1e601e915470ea6/phlib/icotobmp.c#L187 https://github.com/winsiderss/systeminformer/blob/6bc650bbc687fc355eeb8881c1e601e915470ea6/phlib/secwmi.c#L102 https://github.com/winsiderss/systeminformer/blob/6bc650bbc687fc355eeb8881c1e601e915470ea6/phlib/secwmi.c#L161 https://github.com/winsiderss/systeminformer/blob/6bc650bbc687fc355eeb8881c1e601e915470ea6/phlib/util.c#L5481 // it works even on Win 7, but declaration required! https://github.com/winsiderss/systeminformer/blob/6bc650bbc687fc355eeb8881c1e601e915470ea6/phlib/secwmi.c#L102 https://github.com/winsiderss/systeminformer/blob/6bc650bbc687fc355eeb8881c1e601e915470ea6/phlib/secwmi.c#L162 // it works even on xp, even when "Minimum supported client | Windows 8.1, Windows Vista" https://github.com/winsiderss/systeminformer/blob/6bc650bbc687fc355eeb8881c1e601e915470ea6/phlib/native.c#L16394 https://github.com/winsiderss/systeminformer/blob/6bc650bbc687fc355eeb8881c1e601e915470ea6/phlib/native.c#L16398 https://github.com/winsiderss/systeminformer/blob/6bc650bbc687fc355eeb8881c1e601e915470ea6/phlib/native.c#L16399 ---// xp+:
--- // all works started XP https://github.com/winsiderss/systeminformer/blob/6bc650bbc687fc355eeb8881c1e601e915470ea6/phlib/symprv.c#L516 https://github.com/winsiderss/systeminformer/blob/6bc650bbc687fc355eeb8881c1e601e915470ea6/phlib/util.c#L5221 https://github.com/winsiderss/systeminformer/blob/6bc650bbc687fc355eeb8881c1e601e915470ea6/phlib/util.c#L5365 https://github.com/winsiderss/systeminformer/blob/6bc650bbc687fc355eeb8881c1e601e915470ea6/phlib/util.c#L5366 https://github.com/winsiderss/systeminformer/blob/6bc650bbc687fc355eeb8881c1e601e915470ea6/phlib/util.c#L5448 https://github.com/winsiderss/systeminformer/blob/6bc650bbc687fc355eeb8881c1e601e915470ea6/phlib/util.c#L8231 https://github.com/winsiderss/systeminformer/blob/6bc650bbc687fc355eeb8881c1e601e915470ea6/phlib/verify.c#L63 https://github.com/winsiderss/systeminformer/blob/6bc650bbc687fc355eeb8881c1e601e915470ea6/phlib/guisup.c#L3722 https://github.com/winsiderss/systeminformer/blob/6bc650bbc687fc355eeb8881c1e601e915470ea6/phlib/http.c#L1124 ---// 2000+:
--- https://github.com/winsiderss/systeminformer/blob/6bc650bbc687fc355eeb8881c1e601e915470ea6/phlib/guisup.c#L4481 https://github.com/winsiderss/systeminformer/blob/6bc650bbc687fc355eeb8881c1e601e915470ea6/phlib/guisup.c#L4482 https://github.com/winsiderss/systeminformer/blob/6bc650bbc687fc355eeb8881c1e601e915470ea6/phlib/guisup.c#L4483 https://github.com/winsiderss/systeminformer/blob/6bc650bbc687fc355eeb8881c1e601e915470ea6/phlib/guisup.c#L4484 https://github.com/winsiderss/systeminformer/blob/6bc650bbc687fc355eeb8881c1e601e915470ea6/phlib/http.c#L1117 https://github.com/winsiderss/systeminformer/blob/6bc650bbc687fc355eeb8881c1e601e915470ea6/phlib/http.c#L1122 https://github.com/winsiderss/systeminformer/blob/6bc650bbc687fc355eeb8881c1e601e915470ea6/phlib/http.c#L1123 https://github.com/winsiderss/systeminformer/blob/6bc650bbc687fc355eeb8881c1e601e915470ea6/phlib/lsasup.c#L1193 https://github.com/winsiderss/systeminformer/blob/6bc650bbc687fc355eeb8881c1e601e915470ea6/phlib/lsasup.c#L1194 https://github.com/winsiderss/systeminformer/blob/6bc650bbc687fc355eeb8881c1e601e915470ea6/phlib/native.c#L16395 ---and many more! you need pull request?