v2: Fix the logic so that having NoDefaultCurrentDirectoryInExePath set does not break the search
*The three most relevant cases* Case 1: NoDefaultCurrentDirectoryInExePath = False NeedCurrentDirectoryForExePathW = True GetCurrentDirectoryW != 0 (True) SearchPathW = True Overall = True (stop search) Case 2: NoDefaultCurrentDirectoryInExePath = False NeedCurrentDirectoryForExePathW = True GetCurrentDirectoryW != 0 (True) SearchPathW = False Overall = False (continue search) Case 3: NoDefaultCurrentDirectoryInExePath = True NeedCurrentDirectoryForExePathW = False GetCurrentDirectoryW (not called) SearchPathW (not called) Overall = False (continue search)
Best, Erich