Chore (Windows): adds comments

This commit is contained in:
李通洲
2026-03-03 22:34:12 +08:00
parent b64d8a013d
commit ddc2131343
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -209,7 +209,7 @@ static const char* detectWine(void)
static void getSystemReleaseAndVersion(FFPlatformSysinfo* info)
{
RTL_OSVERSIONINFOW osVersion = { .dwOSVersionInfoSize = sizeof(osVersion) };
if (!NT_SUCCESS(RtlGetVersion(&osVersion)))
if (!NT_SUCCESS(RtlGetVersion(&osVersion))) // From PEB, not affected by manifest shenanigans
return;
FF_HKEY_AUTO_DESTROY hKey = NULL;
@@ -233,7 +233,7 @@ static void getSystemReleaseAndVersion(FFPlatformSysinfo* info)
ffStrbufSetF(&info->name, "Wine_%s", wineVersion);
else
{
switch (osVersion.dwPlatformId)
switch (osVersion.dwPlatformId) // Hardcoded as WIN32_NT, but just in case
{
case VER_PLATFORM_WIN32s:
ffStrbufSetStatic(&info->name, "WIN32s");
+2 -2
View File
@@ -18,8 +18,8 @@ const char* ffDetectDisksImpl(FFDiskOptions* options, FFlist* disks)
// For cross-platform portability; used by `presets/examples/13.jsonc`
if (options->folders.length == 1 && options->folders.chars[0] == '/')
{
wchar_t path[MAX_PATH + 1];
GetSystemWindowsDirectoryW(path, ARRAY_SIZE(path));
wchar_t path[16];
GetSystemWindowsDirectoryW(path, ARRAY_SIZE(path)); // Loads from KernelBaseGlobalData, very fast
options->folders.chars[0] = (char) path[0];
ffStrbufAppendS(&options->folders, ":\\");
}