Zhiyi Zhang (@zhiyi) commented about dlls/kernelbase/file.c:
+ { + LongPathEnabled = 0; + } + TRACE("in registry LongPathsEnabled: %ld\n", LongPathEnabled); + } + return LongPathEnabled == 1; +} + +static BOOL is_longpath_enabled_in_manifest(void) +{ + return RtlGetCurrentPeb()->IsLongPathAwareProcess != 0; +} + +static BOOL is_longpath_enabled(void) +{ + return is_win10_1607_or_later() && is_longpath_enabled_in_reg() && is_longpath_enabled_in_manifest(); What really happen should probably be RtlGetCurrentPeb()->IsLongPathAwareProcess = is_win10_1607_or_later() && is_longpath_enabled_in_reg() && is_longpath_enabled_in_manifest();
Then other functions just check RtlGetCurrentPeb()->IsLongPathAwareProcess. And, of course, please test it. You can manually test the PEB field or add a conformance test to test the field. The latter is preferred. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/7540#note_99123