Ignore:
Timestamp:
Aug 13, 2025, 1:34:19 AM (4 weeks ago)
Author:
bird
Message:

lib/nt,kmk: Fixed around rm/unlink semantics and general support for long file names in lib/nt.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/nt/nthlpfs.c

    r3223 r3682  
    149149             * Convert the wide DOS path to an NT path.
    150150             */
    151             if (g_pfnRtlDosPathNameToNtPathName_U(wszTmp, pNtPath, NULL, FALSE))
     151            if (g_pfnRtlDosLongPathNameToNtPathName_U_WithStatus)
     152            {
     153                rcNt = g_pfnRtlDosLongPathNameToNtPathName_U_WithStatus(wszTmp, pNtPath, NULL, NULL);
     154                if (MY_NT_SUCCESS(rcNt))
     155                    return 0;
     156            }
     157            else if (g_pfnRtlDosPathNameToNtPathName_U(wszTmp, pNtPath, NULL, NULL))
    152158                return 0;
     159            else
     160                rcNt = -1;
    153161        }
    154         rcNt = -1;
     162        else
     163            rcNt = -1;
    155164    }
    156165    return birdSetErrnoFromNt(rcNt);
     
    168177     * Convert the wide DOS path to an NT path.
    169178     */
    170     if (g_pfnRtlDosPathNameToNtPathName_U(pwszPath, pNtPath, NULL, FALSE))
     179    if (g_pfnRtlDosLongPathNameToNtPathName_U_WithStatus)
     180    {
     181        MY_NTSTATUS rcNt = g_pfnRtlDosLongPathNameToNtPathName_U_WithStatus(pwszPath, pNtPath, NULL, NULL);
     182        if (MY_NT_SUCCESS(rcNt))
     183            return 0;
     184        return birdSetErrnoFromNt(rcNt);
     185    }
     186    if (g_pfnRtlDosPathNameToNtPathName_U(pwszPath, pNtPath, NULL, NULL))
    171187        return 0;
    172188    return birdSetErrnoFromNt(STATUS_NO_MEMORY);
Note: See TracChangeset for help on using the changeset viewer.