ddnet/src/base
Robert Müller 1697231916 Handle non-default Windows directory in os_version_str
- Retrieve version information of `kernel32.dll` without providing a fixed path to the Windows directory, to handle the case that Windows is not installed in the default location `C:\Windows`. This works because `GetFileVersionInfoSizeW` and `GetFileVersionInfoW` use the search sequence defined by `LoadLibrary`, so they will find the DLL without the path explicitly being specified. The version is retrieved from `kernel32.dll` instead of `user32.dll`, as the former is more commonly used for this purpose.
- Use the unicode (wide character) functions consistently instead of the ANSI functions.
- Use the correct format specifier `%hu` for `unsigned short` (i.e. `WORD` in the Windows API).

References:

- https://learn.microsoft.com/en-us/windows/win32/api/winver/nf-winver-getfileversioninfosizew
- https://learn.microsoft.com/en-us/windows/win32/api/winver/nf-winver-getfileversioninfow
- https://stackoverflow.com/a/44672263/1708371
2022-10-03 13:17:26 +02:00
..
tl Add CLockScope 2022-06-03 12:21:23 +02:00
unicode Changed file names to match classic source.c include header.h 2022-05-07 00:54:29 +02:00
bezier.cpp Move src/game/bezier.cpp/h to src/base/bezier.cpp/h 2022-09-24 20:53:59 +02:00
bezier.h Move src/game/bezier.cpp/h to src/base/bezier.cpp/h 2022-09-24 20:53:59 +02:00
color.h Reworked color system 2022-07-06 11:39:51 +02:00
detect.h Emscripten support 2022-03-25 12:42:18 +01:00
dynamic.h Run clang-format 2020-09-26 21:50:15 +02:00
hash.cpp Added external linkage instead of static const 2022-04-03 01:12:27 +02:00
hash.h Remove useless typedef in c++ 2022-06-25 21:05:54 +02:00
hash_bundled.cpp Use cpp 2021-06-24 17:19:17 +02:00
hash_ctxt.h Remove useless typedef in c++ 2022-06-25 21:05:54 +02:00
hash_libtomcrypt.cpp Fix more unsafe define 2022-06-29 23:52:03 +02:00
hash_openssl.cpp Ignore openssl deprecation warning for now (fixes #5597) 2022-07-27 09:06:57 +02:00
lock_scope.h Fix TSA warnings in Clang 15 (fixes #5548) 2022-09-15 23:31:09 +02:00
log.cpp Change log format 2022-09-14 19:37:55 +02:00
log.h Add logging macros log_{error,warn,info,debug,trace} 2022-04-29 15:32:42 +02:00
logger.h More vector naming format 2022-06-15 19:37:37 +02:00
math.h Work around Windows's definition of min/max 2022-05-31 17:26:35 +02:00
system.cpp Handle non-default Windows directory in os_version_str 2022-10-03 13:17:26 +02:00
system.h Use str_isspace in str_skip_(to_)whitespace(s), add tests 2022-09-30 14:54:33 +02:00
types.h Allow multiple addresses per server in the serverbrowser 2022-07-10 16:52:07 +02:00
vmath.h Replace 2 floats array with vec2 where it makes sense 2022-07-06 11:39:43 +02:00