[1] | 1 | /* $Id: path-win.cpp 99758 2023-05-11 21:37:59Z vboxsync $ */
|
---|
| 2 | /** @file
|
---|
[8245] | 3 | * IPRT - Path manipulation.
|
---|
[1] | 4 | */
|
---|
| 5 |
|
---|
| 6 | /*
|
---|
[98103] | 7 | * Copyright (C) 2006-2023 Oracle and/or its affiliates.
|
---|
[1] | 8 | *
|
---|
[96407] | 9 | * This file is part of VirtualBox base platform packages, as
|
---|
| 10 | * available from https://www.virtualbox.org.
|
---|
[5999] | 11 | *
|
---|
[96407] | 12 | * This program is free software; you can redistribute it and/or
|
---|
| 13 | * modify it under the terms of the GNU General Public License
|
---|
| 14 | * as published by the Free Software Foundation, in version 3 of the
|
---|
| 15 | * License.
|
---|
| 16 | *
|
---|
| 17 | * This program is distributed in the hope that it will be useful, but
|
---|
| 18 | * WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
| 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
| 20 | * General Public License for more details.
|
---|
| 21 | *
|
---|
| 22 | * You should have received a copy of the GNU General Public License
|
---|
| 23 | * along with this program; if not, see <https://www.gnu.org/licenses>.
|
---|
| 24 | *
|
---|
[5999] | 25 | * The contents of this file may alternatively be used under the terms
|
---|
| 26 | * of the Common Development and Distribution License Version 1.0
|
---|
[96407] | 27 | * (CDDL), a copy of it is provided in the "COPYING.CDDL" file included
|
---|
| 28 | * in the VirtualBox distribution, in which case the provisions of the
|
---|
[5999] | 29 | * CDDL are applicable instead of those of the GPL.
|
---|
| 30 | *
|
---|
| 31 | * You may elect to license modified versions of this file under the
|
---|
| 32 | * terms and conditions of either the GPL or the CDDL or both.
|
---|
[96407] | 33 | *
|
---|
| 34 | * SPDX-License-Identifier: GPL-3.0-only OR CDDL-1.0
|
---|
[1] | 35 | */
|
---|
| 36 |
|
---|
| 37 |
|
---|
[57358] | 38 | /*********************************************************************************************************************************
|
---|
| 39 | * Header Files *
|
---|
| 40 | *********************************************************************************************************************************/
|
---|
[1] | 41 | #define LOG_GROUP RTLOGGROUP_PATH
|
---|
[62592] | 42 | #include <iprt/win/windows.h>
|
---|
[63311] | 43 | #include <iprt/win/shlobj.h>
|
---|
[1] | 44 |
|
---|
| 45 | #include <iprt/path.h>
|
---|
| 46 | #include <iprt/assert.h>
|
---|
[78184] | 47 | #include <iprt/ctype.h>
|
---|
[76409] | 48 | #include <iprt/err.h>
|
---|
[36879] | 49 | #include <iprt/ldr.h>
|
---|
[76409] | 50 | #include <iprt/log.h>
|
---|
[10911] | 51 | #include <iprt/mem.h>
|
---|
[1] | 52 | #include <iprt/param.h>
|
---|
[76409] | 53 | #include <iprt/string.h>
|
---|
| 54 | #include <iprt/time.h>
|
---|
| 55 | #include <iprt/utf16.h>
|
---|
[1] | 56 | #include "internal/path.h"
|
---|
| 57 | #include "internal/fs.h"
|
---|
| 58 |
|
---|
[36879] | 59 | /* Needed for lazy loading SHGetFolderPathW in RTPathUserDocuments(). */
|
---|
[53839] | 60 | typedef HRESULT WINAPI FNSHGETFOLDERPATHW(HWND, int, HANDLE, DWORD, LPWSTR);
|
---|
[36879] | 61 | typedef FNSHGETFOLDERPATHW *PFNSHGETFOLDERPATHW;
|
---|
[1] | 62 |
|
---|
[99758] | 63 |
|
---|
[14054] | 64 | RTDECL(int) RTPathReal(const char *pszPath, char *pszRealPath, size_t cchRealPath)
|
---|
[1] | 65 | {
|
---|
| 66 | /*
|
---|
[7401] | 67 | * Convert to UTF-16, call Win32 APIs, convert back.
|
---|
[1] | 68 | */
|
---|
| 69 | PRTUTF16 pwszPath;
|
---|
[74460] | 70 | int rc = RTPathWinFromUtf8(&pwszPath, pszPath, 0 /*fFlags*/);
|
---|
| 71 | if (RT_SUCCESS(rc))
|
---|
[1] | 72 | {
|
---|
[74460] | 73 | LPWSTR lpFile;
|
---|
| 74 | WCHAR wsz[RTPATH_MAX];
|
---|
| 75 | rc = GetFullPathNameW((LPCWSTR)pwszPath, RT_ELEMENTS(wsz), &wsz[0], &lpFile);
|
---|
| 76 | if (rc > 0 && rc < RT_ELEMENTS(wsz))
|
---|
| 77 | {
|
---|
| 78 | /* Check that it exists. (Use RTPathAbs() to just resolve the name.) */
|
---|
| 79 | DWORD dwAttr = GetFileAttributesW(wsz);
|
---|
| 80 | if (dwAttr != INVALID_FILE_ATTRIBUTES)
|
---|
| 81 | rc = RTUtf16ToUtf8Ex((PRTUTF16)&wsz[0], RTSTR_MAX, &pszRealPath, cchRealPath, NULL);
|
---|
| 82 | else
|
---|
| 83 | rc = RTErrConvertFromWin32(GetLastError());
|
---|
| 84 | }
|
---|
| 85 | else if (rc <= 0)
|
---|
| 86 | rc = RTErrConvertFromWin32(GetLastError());
|
---|
[1] | 87 | else
|
---|
[74460] | 88 | rc = VERR_FILENAME_TOO_LONG;
|
---|
| 89 |
|
---|
| 90 | RTPathWinFree(pwszPath);
|
---|
[1] | 91 | }
|
---|
| 92 | return rc;
|
---|
| 93 | }
|
---|
| 94 |
|
---|
[52944] | 95 | #if 0
|
---|
[14054] | 96 | RTDECL(int) RTPathAbs(const char *pszPath, char *pszAbsPath, size_t cchAbsPath)
|
---|
[1] | 97 | {
|
---|
| 98 | /*
|
---|
[15813] | 99 | * Validation.
|
---|
[15756] | 100 | */
|
---|
[15813] | 101 | AssertPtr(pszAbsPath);
|
---|
| 102 | AssertPtr(pszPath);
|
---|
| 103 | if (RT_UNLIKELY(!*pszPath))
|
---|
| 104 | return VERR_INVALID_PARAMETER;
|
---|
[15756] | 105 |
|
---|
| 106 | /*
|
---|
[7401] | 107 | * Convert to UTF-16, call Win32 API, convert back.
|
---|
[1] | 108 | */
|
---|
[7401] | 109 | LPWSTR pwszPath;
|
---|
| 110 | int rc = RTStrToUtf16(pszPath, &pwszPath);
|
---|
[1] | 111 | if (!RT_SUCCESS(rc))
|
---|
| 112 | return (rc);
|
---|
| 113 |
|
---|
[7401] | 114 | LPWSTR pwszFile; /* Ignored */
|
---|
| 115 | RTUTF16 wsz[RTPATH_MAX];
|
---|
| 116 | rc = GetFullPathNameW(pwszPath, RT_ELEMENTS(wsz), &wsz[0], &pwszFile);
|
---|
| 117 | if (rc > 0 && rc < RT_ELEMENTS(wsz))
|
---|
[15809] | 118 | {
|
---|
| 119 | size_t cch;
|
---|
| 120 | rc = RTUtf16ToUtf8Ex(&wsz[0], RTSTR_MAX, &pszAbsPath, cchAbsPath, &cch);
|
---|
| 121 | if (RT_SUCCESS(rc))
|
---|
| 122 | {
|
---|
[52944] | 123 | # if 1 /** @todo This code is completely bonkers. */
|
---|
[15809] | 124 | /*
|
---|
| 125 | * Remove trailing slash if the path may be pointing to a directory.
|
---|
| 126 | * (See posix variant.)
|
---|
| 127 | */
|
---|
| 128 | if ( cch > 1
|
---|
| 129 | && RTPATH_IS_SLASH(pszAbsPath[cch - 1])
|
---|
| 130 | && !RTPATH_IS_VOLSEP(pszAbsPath[cch - 2])
|
---|
| 131 | && !RTPATH_IS_SLASH(pszAbsPath[cch - 2]))
|
---|
| 132 | pszAbsPath[cch - 1] = '\0';
|
---|
[52944] | 133 | # endif
|
---|
[15809] | 134 | }
|
---|
| 135 | }
|
---|
[1] | 136 | else if (rc <= 0)
|
---|
| 137 | rc = RTErrConvertFromWin32(GetLastError());
|
---|
| 138 | else
|
---|
| 139 | rc = VERR_FILENAME_TOO_LONG;
|
---|
| 140 |
|
---|
[7401] | 141 | RTUtf16Free(pwszPath);
|
---|
[1] | 142 | return rc;
|
---|
| 143 | }
|
---|
[52944] | 144 | #endif
|
---|
[1] | 145 |
|
---|
| 146 |
|
---|
[14050] | 147 | RTDECL(int) RTPathUserHome(char *pszPath, size_t cchPath)
|
---|
[1] | 148 | {
|
---|
[53825] | 149 | /*
|
---|
| 150 | * Validate input
|
---|
| 151 | */
|
---|
| 152 | AssertPtrReturn(pszPath, VERR_INVALID_POINTER);
|
---|
| 153 | AssertReturn(cchPath, VERR_INVALID_PARAMETER);
|
---|
| 154 |
|
---|
[7401] | 155 | RTUTF16 wszPath[RTPATH_MAX];
|
---|
[53825] | 156 | bool fValidFolderPath = false;
|
---|
[1] | 157 |
|
---|
| 158 | /*
|
---|
[53825] | 159 | * Try with Windows XP+ functionality first.
|
---|
[1] | 160 | */
|
---|
[53833] | 161 | RTLDRMOD hShell32;
|
---|
| 162 | int rc = RTLdrLoadSystem("Shell32.dll", true /*fNoUnload*/, &hShell32);
|
---|
| 163 | if (RT_SUCCESS(rc))
|
---|
[53825] | 164 | {
|
---|
[53833] | 165 | PFNSHGETFOLDERPATHW pfnSHGetFolderPathW;
|
---|
| 166 | rc = RTLdrGetSymbol(hShell32, "SHGetFolderPathW", (void**)&pfnSHGetFolderPathW);
|
---|
[53825] | 167 | if (RT_SUCCESS(rc))
|
---|
| 168 | {
|
---|
[53833] | 169 | HRESULT hrc = pfnSHGetFolderPathW(0, CSIDL_PROFILE, NULL, SHGFP_TYPE_CURRENT, wszPath);
|
---|
| 170 | fValidFolderPath = (hrc == S_OK);
|
---|
[53825] | 171 | }
|
---|
[53833] | 172 | RTLdrClose(hShell32);
|
---|
[53825] | 173 | }
|
---|
| 174 |
|
---|
[53833] | 175 | DWORD dwAttr;
|
---|
[53825] | 176 | if ( !fValidFolderPath
|
---|
[7401] | 177 | || (dwAttr = GetFileAttributesW(&wszPath[0])) == INVALID_FILE_ATTRIBUTES
|
---|
[1] | 178 | || !(dwAttr & FILE_ATTRIBUTE_DIRECTORY))
|
---|
| 179 | {
|
---|
[53825] | 180 | /*
|
---|
| 181 | * Fall back to Windows specific environment variables. HOME is not used.
|
---|
| 182 | */
|
---|
[7401] | 183 | if ( !GetEnvironmentVariableW(L"USERPROFILE", &wszPath[0], RTPATH_MAX)
|
---|
| 184 | || (dwAttr = GetFileAttributesW(&wszPath[0])) == INVALID_FILE_ATTRIBUTES
|
---|
[1] | 185 | || !(dwAttr & FILE_ATTRIBUTE_DIRECTORY))
|
---|
| 186 | {
|
---|
[7401] | 187 | /* %HOMEDRIVE%%HOMEPATH% */
|
---|
| 188 | if (!GetEnvironmentVariableW(L"HOMEDRIVE", &wszPath[0], RTPATH_MAX))
|
---|
[1] | 189 | return VERR_PATH_NOT_FOUND;
|
---|
[7401] | 190 | size_t const cwc = RTUtf16Len(&wszPath[0]);
|
---|
[14065] | 191 | if ( !GetEnvironmentVariableW(L"HOMEPATH", &wszPath[cwc], RTPATH_MAX - (DWORD)cwc)
|
---|
[7401] | 192 | || (dwAttr = GetFileAttributesW(&wszPath[0])) == INVALID_FILE_ATTRIBUTES
|
---|
[1] | 193 | || !(dwAttr & FILE_ATTRIBUTE_DIRECTORY))
|
---|
| 194 | return VERR_PATH_NOT_FOUND;
|
---|
| 195 | }
|
---|
| 196 | }
|
---|
| 197 |
|
---|
| 198 | /*
|
---|
| 199 | * Convert and return.
|
---|
| 200 | */
|
---|
[7418] | 201 | return RTUtf16ToUtf8Ex(&wszPath[0], RTSTR_MAX, &pszPath, cchPath, NULL);
|
---|
[1] | 202 | }
|
---|
| 203 |
|
---|
[36675] | 204 |
|
---|
[36611] | 205 | RTDECL(int) RTPathUserDocuments(char *pszPath, size_t cchPath)
|
---|
| 206 | {
|
---|
| 207 | /*
|
---|
| 208 | * Validate input
|
---|
| 209 | */
|
---|
| 210 | AssertPtrReturn(pszPath, VERR_INVALID_POINTER);
|
---|
| 211 | AssertReturn(cchPath, VERR_INVALID_PARAMETER);
|
---|
[1] | 212 |
|
---|
[36879] | 213 | RTLDRMOD hShell32;
|
---|
[46624] | 214 | int rc = RTLdrLoadSystem("Shell32.dll", true /*fNoUnload*/, &hShell32);
|
---|
[36879] | 215 | if (RT_SUCCESS(rc))
|
---|
| 216 | {
|
---|
| 217 | PFNSHGETFOLDERPATHW pfnSHGetFolderPathW;
|
---|
| 218 | rc = RTLdrGetSymbol(hShell32, "SHGetFolderPathW", (void**)&pfnSHGetFolderPathW);
|
---|
| 219 | if (RT_SUCCESS(rc))
|
---|
| 220 | {
|
---|
| 221 | RTUTF16 wszPath[RTPATH_MAX];
|
---|
| 222 | HRESULT hrc = pfnSHGetFolderPathW(0, CSIDL_PERSONAL, NULL, SHGFP_TYPE_CURRENT, wszPath);
|
---|
| 223 | if ( hrc == S_OK /* Found */
|
---|
| 224 | || hrc == S_FALSE) /* Found, but doesn't exist */
|
---|
| 225 | {
|
---|
| 226 | /*
|
---|
| 227 | * Convert and return.
|
---|
| 228 | */
|
---|
| 229 | RTLdrClose(hShell32);
|
---|
| 230 | return RTUtf16ToUtf8Ex(&wszPath[0], RTSTR_MAX, &pszPath, cchPath, NULL);
|
---|
| 231 | }
|
---|
| 232 | }
|
---|
| 233 | RTLdrClose(hShell32);
|
---|
| 234 | }
|
---|
[36611] | 235 | return VERR_PATH_NOT_FOUND;
|
---|
| 236 | }
|
---|
| 237 |
|
---|
| 238 |
|
---|
[64640] | 239 | #if 0 /* use nt version of this */
|
---|
| 240 |
|
---|
[1] | 241 | RTR3DECL(int) RTPathQueryInfo(const char *pszPath, PRTFSOBJINFO pObjInfo, RTFSOBJATTRADD enmAdditionalAttribs)
|
---|
| 242 | {
|
---|
[23291] | 243 | return RTPathQueryInfoEx(pszPath, pObjInfo, enmAdditionalAttribs, RTPATH_F_ON_LINK);
|
---|
| 244 | }
|
---|
[64640] | 245 | #endif
|
---|
| 246 | #if 0
|
---|
[23291] | 247 |
|
---|
| 248 |
|
---|
| 249 | RTR3DECL(int) RTPathQueryInfoEx(const char *pszPath, PRTFSOBJINFO pObjInfo, RTFSOBJATTRADD enmAdditionalAttribs, uint32_t fFlags)
|
---|
| 250 | {
|
---|
[1] | 251 | /*
|
---|
| 252 | * Validate input.
|
---|
| 253 | */
|
---|
[23291] | 254 | AssertPtrReturn(pszPath, VERR_INVALID_POINTER);
|
---|
| 255 | AssertReturn(*pszPath, VERR_INVALID_PARAMETER);
|
---|
| 256 | AssertPtrReturn(pObjInfo, VERR_INVALID_POINTER);
|
---|
| 257 | AssertMsgReturn( enmAdditionalAttribs >= RTFSOBJATTRADD_NOTHING
|
---|
| 258 | && enmAdditionalAttribs <= RTFSOBJATTRADD_LAST,
|
---|
| 259 | ("Invalid enmAdditionalAttribs=%p\n", enmAdditionalAttribs),
|
---|
| 260 | VERR_INVALID_PARAMETER);
|
---|
| 261 | AssertMsgReturn(RTPATH_F_IS_VALID(fFlags, 0), ("%#x\n", fFlags), VERR_INVALID_PARAMETER);
|
---|
[1] | 262 |
|
---|
| 263 | /*
|
---|
| 264 | * Query file info.
|
---|
| 265 | */
|
---|
[64620] | 266 | uint32_t uReparseTag = RTFSMODE_SYMLINK_REPARSE_TAG;
|
---|
[21619] | 267 | WIN32_FILE_ATTRIBUTE_DATA Data;
|
---|
[7401] | 268 | PRTUTF16 pwszPath;
|
---|
[7418] | 269 | int rc = RTStrToUtf16(pszPath, &pwszPath);
|
---|
[1] | 270 | if (RT_FAILURE(rc))
|
---|
| 271 | return rc;
|
---|
[21619] | 272 | if (!GetFileAttributesExW(pwszPath, GetFileExInfoStandard, &Data))
|
---|
[1] | 273 | {
|
---|
[21619] | 274 | /* Fallback to FindFileFirst in case of sharing violation. */
|
---|
| 275 | if (GetLastError() == ERROR_SHARING_VIOLATION)
|
---|
| 276 | {
|
---|
| 277 | WIN32_FIND_DATAW FindData;
|
---|
| 278 | HANDLE hDir = FindFirstFileW(pwszPath, &FindData);
|
---|
| 279 | if (hDir == INVALID_HANDLE_VALUE)
|
---|
| 280 | {
|
---|
| 281 | rc = RTErrConvertFromWin32(GetLastError());
|
---|
| 282 | RTUtf16Free(pwszPath);
|
---|
| 283 | return rc;
|
---|
| 284 | }
|
---|
| 285 | FindClose(hDir);
|
---|
[33437] | 286 |
|
---|
| 287 | Data.dwFileAttributes = FindData.dwFileAttributes;
|
---|
| 288 | Data.ftCreationTime = FindData.ftCreationTime;
|
---|
| 289 | Data.ftLastAccessTime = FindData.ftLastAccessTime;
|
---|
| 290 | Data.ftLastWriteTime = FindData.ftLastWriteTime;
|
---|
| 291 | Data.nFileSizeHigh = FindData.nFileSizeHigh;
|
---|
| 292 | Data.nFileSizeLow = FindData.nFileSizeLow;
|
---|
[64620] | 293 | uReparseTag = FindData.dwReserved0;
|
---|
[21619] | 294 | }
|
---|
| 295 | else
|
---|
| 296 | {
|
---|
| 297 | rc = RTErrConvertFromWin32(GetLastError());
|
---|
| 298 | RTUtf16Free(pwszPath);
|
---|
| 299 | return rc;
|
---|
| 300 | }
|
---|
[1] | 301 | }
|
---|
[33437] | 302 |
|
---|
| 303 | /*
|
---|
| 304 | * Getting the information for the link target is a bit annoying and
|
---|
| 305 | * subject to the same access violation mess as above.. :/
|
---|
| 306 | */
|
---|
| 307 | /** @todo we're too lazy wrt to error paths here... */
|
---|
[64620] | 308 | if ( (Data.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT)
|
---|
| 309 | && ((fFlags & RTPATH_F_FOLLOW_LINK) || uReparseTag != RTFSMODE_SYMLINK_REPARSE_TAG))
|
---|
[23291] | 310 | {
|
---|
[33437] | 311 | HANDLE hFinal = CreateFileW(pwszPath,
|
---|
| 312 | GENERIC_READ,
|
---|
| 313 | FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
|
---|
| 314 | NULL,
|
---|
| 315 | OPEN_EXISTING,
|
---|
| 316 | FILE_FLAG_BACKUP_SEMANTICS,
|
---|
| 317 | NULL);
|
---|
| 318 | if (hFinal != INVALID_HANDLE_VALUE)
|
---|
| 319 | {
|
---|
| 320 | BY_HANDLE_FILE_INFORMATION FileData;
|
---|
| 321 | if (GetFileInformationByHandle(hFinal, &FileData))
|
---|
| 322 | {
|
---|
| 323 | Data.dwFileAttributes = FileData.dwFileAttributes;
|
---|
| 324 | Data.ftCreationTime = FileData.ftCreationTime;
|
---|
| 325 | Data.ftLastAccessTime = FileData.ftLastAccessTime;
|
---|
| 326 | Data.ftLastWriteTime = FileData.ftLastWriteTime;
|
---|
| 327 | Data.nFileSizeHigh = FileData.nFileSizeHigh;
|
---|
| 328 | Data.nFileSizeLow = FileData.nFileSizeLow;
|
---|
[64620] | 329 | uReparseTag = 0;
|
---|
[33437] | 330 | }
|
---|
| 331 | CloseHandle(hFinal);
|
---|
| 332 | }
|
---|
| 333 | else if (GetLastError() != ERROR_SHARING_VIOLATION)
|
---|
| 334 | {
|
---|
| 335 | rc = RTErrConvertFromWin32(GetLastError());
|
---|
| 336 | RTUtf16Free(pwszPath);
|
---|
| 337 | return rc;
|
---|
| 338 | }
|
---|
[23291] | 339 | }
|
---|
[1] | 340 |
|
---|
[33437] | 341 | RTUtf16Free(pwszPath);
|
---|
| 342 |
|
---|
[1] | 343 | /*
|
---|
| 344 | * Setup the returned data.
|
---|
| 345 | */
|
---|
| 346 | pObjInfo->cbObject = ((uint64_t)Data.nFileSizeHigh << 32)
|
---|
| 347 | | (uint64_t)Data.nFileSizeLow;
|
---|
| 348 | pObjInfo->cbAllocated = pObjInfo->cbObject;
|
---|
| 349 |
|
---|
| 350 | Assert(sizeof(uint64_t) == sizeof(Data.ftCreationTime));
|
---|
| 351 | RTTimeSpecSetNtTime(&pObjInfo->BirthTime, *(uint64_t *)&Data.ftCreationTime);
|
---|
| 352 | RTTimeSpecSetNtTime(&pObjInfo->AccessTime, *(uint64_t *)&Data.ftLastAccessTime);
|
---|
| 353 | RTTimeSpecSetNtTime(&pObjInfo->ModificationTime, *(uint64_t *)&Data.ftLastWriteTime);
|
---|
| 354 | pObjInfo->ChangeTime = pObjInfo->ModificationTime;
|
---|
| 355 |
|
---|
| 356 | pObjInfo->Attr.fMode = rtFsModeFromDos((Data.dwFileAttributes << RTFS_DOS_SHIFT) & RTFS_DOS_MASK_NT,
|
---|
[64620] | 357 | pszPath, strlen(pszPath), uReparseTag);
|
---|
[1] | 358 |
|
---|
| 359 | /*
|
---|
| 360 | * Requested attributes (we cannot provide anything actually).
|
---|
| 361 | */
|
---|
| 362 | switch (enmAdditionalAttribs)
|
---|
| 363 | {
|
---|
[34002] | 364 | case RTFSOBJATTRADD_NOTHING:
|
---|
| 365 | pObjInfo->Attr.enmAdditional = RTFSOBJATTRADD_NOTHING;
|
---|
[1] | 366 | break;
|
---|
| 367 |
|
---|
| 368 | case RTFSOBJATTRADD_UNIX:
|
---|
| 369 | pObjInfo->Attr.enmAdditional = RTFSOBJATTRADD_UNIX;
|
---|
| 370 | pObjInfo->Attr.u.Unix.uid = ~0U;
|
---|
| 371 | pObjInfo->Attr.u.Unix.gid = ~0U;
|
---|
| 372 | pObjInfo->Attr.u.Unix.cHardlinks = 1;
|
---|
[13104] | 373 | pObjInfo->Attr.u.Unix.INodeIdDevice = 0; /** @todo use volume serial number */
|
---|
| 374 | pObjInfo->Attr.u.Unix.INodeId = 0; /** @todo use fileid (see GetFileInformationByHandle). */
|
---|
[1] | 375 | pObjInfo->Attr.u.Unix.fFlags = 0;
|
---|
| 376 | pObjInfo->Attr.u.Unix.GenerationId = 0;
|
---|
| 377 | pObjInfo->Attr.u.Unix.Device = 0;
|
---|
| 378 | break;
|
---|
| 379 |
|
---|
[34002] | 380 | case RTFSOBJATTRADD_UNIX_OWNER:
|
---|
[34003] | 381 | pObjInfo->Attr.enmAdditional = RTFSOBJATTRADD_UNIX_OWNER;
|
---|
| 382 | pObjInfo->Attr.u.UnixOwner.uid = ~0U;
|
---|
| 383 | pObjInfo->Attr.u.UnixOwner.szName[0] = '\0'; /** @todo return something sensible here. */
|
---|
[1] | 384 | break;
|
---|
| 385 |
|
---|
[34002] | 386 | case RTFSOBJATTRADD_UNIX_GROUP:
|
---|
[34003] | 387 | pObjInfo->Attr.enmAdditional = RTFSOBJATTRADD_UNIX_GROUP;
|
---|
| 388 | pObjInfo->Attr.u.UnixGroup.gid = ~0U;
|
---|
| 389 | pObjInfo->Attr.u.UnixGroup.szName[0] = '\0';
|
---|
[34002] | 390 | break;
|
---|
| 391 |
|
---|
| 392 | case RTFSOBJATTRADD_EASIZE:
|
---|
| 393 | pObjInfo->Attr.enmAdditional = RTFSOBJATTRADD_EASIZE;
|
---|
| 394 | pObjInfo->Attr.u.EASize.cb = 0;
|
---|
| 395 | break;
|
---|
| 396 |
|
---|
[1] | 397 | default:
|
---|
| 398 | AssertMsgFailed(("Impossible!\n"));
|
---|
| 399 | return VERR_INTERNAL_ERROR;
|
---|
| 400 | }
|
---|
| 401 |
|
---|
| 402 | return VINF_SUCCESS;
|
---|
| 403 | }
|
---|
| 404 |
|
---|
[64640] | 405 | #endif /* using NT version*/
|
---|
[1] | 406 |
|
---|
[64640] | 407 |
|
---|
[1] | 408 | RTR3DECL(int) RTPathSetTimes(const char *pszPath, PCRTTIMESPEC pAccessTime, PCRTTIMESPEC pModificationTime,
|
---|
| 409 | PCRTTIMESPEC pChangeTime, PCRTTIMESPEC pBirthTime)
|
---|
| 410 | {
|
---|
[23291] | 411 | return RTPathSetTimesEx(pszPath, pAccessTime, pModificationTime, pChangeTime, pBirthTime, RTPATH_F_ON_LINK);
|
---|
| 412 | }
|
---|
| 413 |
|
---|
| 414 |
|
---|
| 415 | RTR3DECL(int) RTPathSetTimesEx(const char *pszPath, PCRTTIMESPEC pAccessTime, PCRTTIMESPEC pModificationTime,
|
---|
| 416 | PCRTTIMESPEC pChangeTime, PCRTTIMESPEC pBirthTime, uint32_t fFlags)
|
---|
| 417 | {
|
---|
[1] | 418 | /*
|
---|
| 419 | * Validate input.
|
---|
| 420 | */
|
---|
[23291] | 421 | AssertPtrReturn(pszPath, VERR_INVALID_POINTER);
|
---|
| 422 | AssertReturn(*pszPath, VERR_INVALID_PARAMETER);
|
---|
| 423 | AssertPtrNullReturn(pAccessTime, VERR_INVALID_POINTER);
|
---|
| 424 | AssertPtrNullReturn(pModificationTime, VERR_INVALID_POINTER);
|
---|
| 425 | AssertPtrNullReturn(pChangeTime, VERR_INVALID_POINTER);
|
---|
| 426 | AssertPtrNullReturn(pBirthTime, VERR_INVALID_POINTER);
|
---|
| 427 | AssertMsgReturn(RTPATH_F_IS_VALID(fFlags, 0), ("%#x\n", fFlags), VERR_INVALID_PARAMETER);
|
---|
[1] | 428 |
|
---|
| 429 | /*
|
---|
| 430 | * Convert the path.
|
---|
| 431 | */
|
---|
| 432 | PRTUTF16 pwszPath;
|
---|
[74460] | 433 | int rc = RTPathWinFromUtf8(&pwszPath, pszPath, 0 /*fFlags*/);
|
---|
[1] | 434 | if (RT_SUCCESS(rc))
|
---|
| 435 | {
|
---|
[23291] | 436 | HANDLE hFile;
|
---|
[23292] | 437 | if (fFlags & RTPATH_F_FOLLOW_LINK)
|
---|
[23291] | 438 | hFile = CreateFileW(pwszPath,
|
---|
| 439 | FILE_WRITE_ATTRIBUTES, /* dwDesiredAccess */
|
---|
| 440 | FILE_SHARE_WRITE | FILE_SHARE_READ | FILE_SHARE_DELETE, /* dwShareMode */
|
---|
| 441 | NULL, /* security attribs */
|
---|
| 442 | OPEN_EXISTING, /* dwCreationDisposition */
|
---|
| 443 | FILE_FLAG_BACKUP_SEMANTICS | FILE_ATTRIBUTE_NORMAL,
|
---|
| 444 | NULL);
|
---|
| 445 | else
|
---|
| 446 | {
|
---|
| 447 | /** @todo Symlink: Test RTPathSetTimesEx on Windows. (The code is disabled
|
---|
| 448 | * because it's not tested yet.) */
|
---|
| 449 | #if 0 //def FILE_FLAG_OPEN_REPARSE_POINT
|
---|
| 450 | hFile = CreateFileW(pwszPath,
|
---|
| 451 | FILE_WRITE_ATTRIBUTES, /* dwDesiredAccess */
|
---|
| 452 | FILE_SHARE_WRITE | FILE_SHARE_READ | FILE_SHARE_DELETE, /* dwShareMode */
|
---|
| 453 | NULL, /* security attribs */
|
---|
| 454 | OPEN_EXISTING, /* dwCreationDisposition */
|
---|
| 455 | FILE_FLAG_BACKUP_SEMANTICS | FILE_ATTRIBUTE_NORMAL | FILE_FLAG_OPEN_REPARSE_POINT,
|
---|
| 456 | NULL);
|
---|
| 457 |
|
---|
| 458 | if (hFile == INVALID_HANDLE_VALUE && GetLastError() == ERROR_INVALID_PARAMETER)
|
---|
| 459 | #endif
|
---|
| 460 | hFile = CreateFileW(pwszPath,
|
---|
| 461 | FILE_WRITE_ATTRIBUTES, /* dwDesiredAccess */
|
---|
| 462 | FILE_SHARE_WRITE | FILE_SHARE_READ | FILE_SHARE_DELETE, /* dwShareMode */
|
---|
| 463 | NULL, /* security attribs */
|
---|
| 464 | OPEN_EXISTING, /* dwCreationDisposition */
|
---|
| 465 | FILE_FLAG_BACKUP_SEMANTICS | FILE_ATTRIBUTE_NORMAL,
|
---|
| 466 | NULL);
|
---|
| 467 | }
|
---|
[1] | 468 | if (hFile != INVALID_HANDLE_VALUE)
|
---|
| 469 | {
|
---|
| 470 | /*
|
---|
| 471 | * Check if it's a no-op.
|
---|
| 472 | */
|
---|
| 473 | if (!pAccessTime && !pModificationTime && !pBirthTime)
|
---|
| 474 | rc = VINF_SUCCESS; /* NOP */
|
---|
| 475 | else
|
---|
| 476 | {
|
---|
| 477 | /*
|
---|
| 478 | * Convert the input and call the API.
|
---|
| 479 | */
|
---|
| 480 | FILETIME CreationTimeFT;
|
---|
| 481 | PFILETIME pCreationTimeFT = NULL;
|
---|
| 482 | if (pBirthTime)
|
---|
| 483 | pCreationTimeFT = RTTimeSpecGetNtFileTime(pBirthTime, &CreationTimeFT);
|
---|
| 484 |
|
---|
| 485 | FILETIME LastAccessTimeFT;
|
---|
| 486 | PFILETIME pLastAccessTimeFT = NULL;
|
---|
| 487 | if (pAccessTime)
|
---|
| 488 | pLastAccessTimeFT = RTTimeSpecGetNtFileTime(pAccessTime, &LastAccessTimeFT);
|
---|
| 489 |
|
---|
| 490 | FILETIME LastWriteTimeFT;
|
---|
| 491 | PFILETIME pLastWriteTimeFT = NULL;
|
---|
| 492 | if (pModificationTime)
|
---|
| 493 | pLastWriteTimeFT = RTTimeSpecGetNtFileTime(pModificationTime, &LastWriteTimeFT);
|
---|
| 494 |
|
---|
| 495 | if (SetFileTime(hFile, pCreationTimeFT, pLastAccessTimeFT, pLastWriteTimeFT))
|
---|
| 496 | rc = VINF_SUCCESS;
|
---|
| 497 | else
|
---|
| 498 | {
|
---|
| 499 | DWORD Err = GetLastError();
|
---|
| 500 | rc = RTErrConvertFromWin32(Err);
|
---|
[13837] | 501 | Log(("RTPathSetTimes('%s', %p, %p, %p, %p): SetFileTime failed with lasterr %d (%Rrc)\n",
|
---|
[1] | 502 | pszPath, pAccessTime, pModificationTime, pChangeTime, pBirthTime, Err, rc));
|
---|
| 503 | }
|
---|
| 504 | }
|
---|
| 505 | BOOL fRc = CloseHandle(hFile); Assert(fRc); NOREF(fRc);
|
---|
| 506 | }
|
---|
| 507 | else
|
---|
| 508 | {
|
---|
| 509 | DWORD Err = GetLastError();
|
---|
| 510 | rc = RTErrConvertFromWin32(Err);
|
---|
| 511 | Log(("RTPathSetTimes('%s',,,,): failed with %Rrc and lasterr=%u\n", pszPath, rc, Err));
|
---|
| 512 | }
|
---|
| 513 |
|
---|
[74460] | 514 | RTPathWinFree(pwszPath);
|
---|
[1] | 515 | }
|
---|
| 516 |
|
---|
| 517 | LogFlow(("RTPathSetTimes(%p:{%s}, %p:{%RDtimespec}, %p:{%RDtimespec}, %p:{%RDtimespec}, %p:{%RDtimespec}): return %Rrc\n",
|
---|
| 518 | pszPath, pszPath, pAccessTime, pAccessTime, pModificationTime, pModificationTime,
|
---|
| 519 | pChangeTime, pChangeTime, pBirthTime, pBirthTime));
|
---|
| 520 | return rc;
|
---|
| 521 | }
|
---|
| 522 |
|
---|
| 523 |
|
---|
| 524 |
|
---|
| 525 |
|
---|
| 526 | /**
|
---|
| 527 | * Internal worker for RTFileRename and RTFileMove.
|
---|
| 528 | *
|
---|
| 529 | * @returns iprt status code.
|
---|
| 530 | * @param pszSrc The source filename.
|
---|
| 531 | * @param pszDst The destination filename.
|
---|
| 532 | * @param fFlags The windows MoveFileEx flags.
|
---|
| 533 | * @param fFileType The filetype. We use the RTFMODE filetypes here. If it's 0,
|
---|
| 534 | * anything goes. If it's RTFS_TYPE_DIRECTORY we'll check that the
|
---|
| 535 | * source is a directory. If Its RTFS_TYPE_FILE we'll check that it's
|
---|
| 536 | * not a directory (we are NOT checking whether it's a file).
|
---|
| 537 | */
|
---|
[26476] | 538 | DECLHIDDEN(int) rtPathWin32MoveRename(const char *pszSrc, const char *pszDst, uint32_t fFlags, RTFMODE fFileType)
|
---|
[1] | 539 | {
|
---|
| 540 | /*
|
---|
| 541 | * Convert the strings.
|
---|
| 542 | */
|
---|
| 543 | PRTUTF16 pwszSrc;
|
---|
[74460] | 544 | int rc = RTPathWinFromUtf8(&pwszSrc, pszSrc, 0 /*fFlags*/);
|
---|
[1] | 545 | if (RT_SUCCESS(rc))
|
---|
| 546 | {
|
---|
| 547 | PRTUTF16 pwszDst;
|
---|
[74460] | 548 | rc = RTPathWinFromUtf8(&pwszDst, pszDst, 0 /*fFlags*/);
|
---|
[1] | 549 | if (RT_SUCCESS(rc))
|
---|
| 550 | {
|
---|
| 551 | /*
|
---|
| 552 | * Check object type if requested.
|
---|
| 553 | * This is open to race conditions.
|
---|
| 554 | */
|
---|
| 555 | if (fFileType)
|
---|
| 556 | {
|
---|
| 557 | DWORD dwAttr = GetFileAttributesW(pwszSrc);
|
---|
| 558 | if (dwAttr == INVALID_FILE_ATTRIBUTES)
|
---|
| 559 | rc = RTErrConvertFromWin32(GetLastError());
|
---|
| 560 | else if (RTFS_IS_DIRECTORY(fFileType))
|
---|
| 561 | rc = dwAttr & FILE_ATTRIBUTE_DIRECTORY ? VINF_SUCCESS : VERR_NOT_A_DIRECTORY;
|
---|
| 562 | else
|
---|
| 563 | rc = dwAttr & FILE_ATTRIBUTE_DIRECTORY ? VERR_IS_A_DIRECTORY : VINF_SUCCESS;
|
---|
| 564 | }
|
---|
| 565 | if (RT_SUCCESS(rc))
|
---|
| 566 | {
|
---|
| 567 | if (MoveFileExW(pwszSrc, pwszDst, fFlags))
|
---|
| 568 | rc = VINF_SUCCESS;
|
---|
| 569 | else
|
---|
| 570 | {
|
---|
| 571 | DWORD Err = GetLastError();
|
---|
| 572 | rc = RTErrConvertFromWin32(Err);
|
---|
| 573 | Log(("MoveFileExW('%s', '%s', %#x, %RTfmode): fails with rc=%Rrc & lasterr=%d\n",
|
---|
| 574 | pszSrc, pszDst, fFlags, fFileType, rc, Err));
|
---|
| 575 | }
|
---|
| 576 | }
|
---|
[74460] | 577 | RTPathWinFree(pwszDst);
|
---|
[1] | 578 | }
|
---|
[74460] | 579 | RTPathWinFree(pwszSrc);
|
---|
[1] | 580 | }
|
---|
| 581 | return rc;
|
---|
| 582 | }
|
---|
| 583 |
|
---|
| 584 |
|
---|
| 585 | RTR3DECL(int) RTPathRename(const char *pszSrc, const char *pszDst, unsigned fRename)
|
---|
| 586 | {
|
---|
| 587 | /*
|
---|
| 588 | * Validate input.
|
---|
| 589 | */
|
---|
[90781] | 590 | AssertPtrReturn(pszSrc, VERR_INVALID_POINTER);
|
---|
| 591 | AssertPtrReturn(pszDst, VERR_INVALID_POINTER);
|
---|
[1] | 592 | AssertMsgReturn(*pszSrc, ("%p\n", pszSrc), VERR_INVALID_PARAMETER);
|
---|
| 593 | AssertMsgReturn(*pszDst, ("%p\n", pszDst), VERR_INVALID_PARAMETER);
|
---|
| 594 | AssertMsgReturn(!(fRename & ~RTPATHRENAME_FLAGS_REPLACE), ("%#x\n", fRename), VERR_INVALID_PARAMETER);
|
---|
| 595 |
|
---|
| 596 | /*
|
---|
| 597 | * Call the worker.
|
---|
| 598 | */
|
---|
| 599 | int rc = rtPathWin32MoveRename(pszSrc, pszDst, fRename & RTPATHRENAME_FLAGS_REPLACE ? MOVEFILE_REPLACE_EXISTING : 0, 0);
|
---|
| 600 |
|
---|
| 601 | LogFlow(("RTPathRename(%p:{%s}, %p:{%s}, %#x): returns %Rrc\n", pszSrc, pszSrc, pszDst, pszDst, fRename, rc));
|
---|
| 602 | return rc;
|
---|
| 603 | }
|
---|
| 604 |
|
---|
[937] | 605 |
|
---|
[39612] | 606 | RTR3DECL(int) RTPathUnlink(const char *pszPath, uint32_t fUnlink)
|
---|
| 607 | {
|
---|
[62584] | 608 | RT_NOREF_PV(pszPath); RT_NOREF_PV(fUnlink);
|
---|
[39612] | 609 | return VERR_NOT_IMPLEMENTED;
|
---|
| 610 | }
|
---|
| 611 |
|
---|
| 612 |
|
---|
[937] | 613 | RTDECL(bool) RTPathExists(const char *pszPath)
|
---|
| 614 | {
|
---|
[23291] | 615 | return RTPathExistsEx(pszPath, RTPATH_F_FOLLOW_LINK);
|
---|
| 616 | }
|
---|
| 617 |
|
---|
| 618 |
|
---|
| 619 | RTDECL(bool) RTPathExistsEx(const char *pszPath, uint32_t fFlags)
|
---|
| 620 | {
|
---|
[937] | 621 | /*
|
---|
| 622 | * Validate input.
|
---|
| 623 | */
|
---|
| 624 | AssertPtrReturn(pszPath, false);
|
---|
| 625 | AssertReturn(*pszPath, false);
|
---|
[23291] | 626 | Assert(RTPATH_F_IS_VALID(fFlags, 0));
|
---|
[937] | 627 |
|
---|
| 628 | /*
|
---|
| 629 | * Try query file info.
|
---|
| 630 | */
|
---|
[23291] | 631 | DWORD dwAttr;
|
---|
[7403] | 632 | PRTUTF16 pwszPath;
|
---|
[74460] | 633 | int rc = RTPathWinFromUtf8(&pwszPath, pszPath, 0 /*fFlags*/);
|
---|
[937] | 634 | if (RT_SUCCESS(rc))
|
---|
| 635 | {
|
---|
[23291] | 636 | dwAttr = GetFileAttributesW(pwszPath);
|
---|
[74460] | 637 | RTPathWinFree(pwszPath);
|
---|
[937] | 638 | }
|
---|
[23291] | 639 | else
|
---|
| 640 | dwAttr = INVALID_FILE_ATTRIBUTES;
|
---|
| 641 | if (dwAttr == INVALID_FILE_ATTRIBUTES)
|
---|
| 642 | return false;
|
---|
| 643 |
|
---|
| 644 | #ifdef FILE_ATTRIBUTE_REPARSE_POINT
|
---|
| 645 | if ( (fFlags & RTPATH_F_FOLLOW_LINK)
|
---|
| 646 | && (dwAttr & FILE_ATTRIBUTE_REPARSE_POINT))
|
---|
| 647 | {
|
---|
| 648 | AssertFailed();
|
---|
| 649 | /** @todo Symlinks: RTPathExists+RTPathExistsEx is misbehaving on symbolic
|
---|
| 650 | * links on Windows. */
|
---|
| 651 | }
|
---|
| 652 | #endif
|
---|
| 653 |
|
---|
| 654 | return true;
|
---|
[937] | 655 | }
|
---|
| 656 |
|
---|
[10911] | 657 |
|
---|
[15808] | 658 | RTDECL(int) RTPathGetCurrent(char *pszPath, size_t cchPath)
|
---|
| 659 | {
|
---|
| 660 | int rc;
|
---|
| 661 |
|
---|
[78153] | 662 | if (cchPath > 0)
|
---|
[15808] | 663 | {
|
---|
[78153] | 664 | /*
|
---|
| 665 | * GetCurrentDirectory may in some cases omit the drive letter, according
|
---|
| 666 | * to MSDN, thus the GetFullPathName call.
|
---|
| 667 | */
|
---|
| 668 | RTUTF16 wszCurPath[RTPATH_MAX];
|
---|
| 669 | if (GetCurrentDirectoryW(RTPATH_MAX, wszCurPath))
|
---|
| 670 | {
|
---|
| 671 | RTUTF16 wszFullPath[RTPATH_MAX];
|
---|
| 672 | if (GetFullPathNameW(wszCurPath, RTPATH_MAX, wszFullPath, NULL))
|
---|
[78184] | 673 | {
|
---|
| 674 | if ( wszFullPath[1] == ':'
|
---|
| 675 | && RT_C_IS_LOWER(wszFullPath[0]))
|
---|
| 676 | wszFullPath[0] = RT_C_TO_UPPER(wszFullPath[0]);
|
---|
| 677 |
|
---|
[78153] | 678 | rc = RTUtf16ToUtf8Ex(&wszFullPath[0], RTSTR_MAX, &pszPath, cchPath, NULL);
|
---|
[78184] | 679 | }
|
---|
[78153] | 680 | else
|
---|
| 681 | rc = RTErrConvertFromWin32(GetLastError());
|
---|
| 682 | }
|
---|
[15808] | 683 | else
|
---|
| 684 | rc = RTErrConvertFromWin32(GetLastError());
|
---|
| 685 | }
|
---|
| 686 | else
|
---|
[78153] | 687 | rc = VERR_BUFFER_OVERFLOW;
|
---|
[15808] | 688 | return rc;
|
---|
| 689 | }
|
---|
| 690 |
|
---|
| 691 |
|
---|
[10911] | 692 | RTDECL(int) RTPathSetCurrent(const char *pszPath)
|
---|
| 693 | {
|
---|
| 694 | /*
|
---|
| 695 | * Validate input.
|
---|
| 696 | */
|
---|
| 697 | AssertPtrReturn(pszPath, VERR_INVALID_POINTER);
|
---|
| 698 | AssertReturn(*pszPath, VERR_INVALID_PARAMETER);
|
---|
| 699 |
|
---|
| 700 | /*
|
---|
| 701 | * This interface is almost identical to the Windows API.
|
---|
| 702 | */
|
---|
| 703 | PRTUTF16 pwszPath;
|
---|
[74460] | 704 | int rc = RTPathWinFromUtf8(&pwszPath, pszPath, 0 /*fFlags*/);
|
---|
[10911] | 705 | if (RT_SUCCESS(rc))
|
---|
| 706 | {
|
---|
[28918] | 707 | /** @todo improve the slash stripping a bit? */
|
---|
[10911] | 708 | size_t cwc = RTUtf16Len(pwszPath);
|
---|
| 709 | if ( cwc >= 2
|
---|
| 710 | && ( pwszPath[cwc - 1] == L'/'
|
---|
| 711 | || pwszPath[cwc - 1] == L'\\')
|
---|
| 712 | && pwszPath[cwc - 2] != ':')
|
---|
| 713 | pwszPath[cwc - 1] = L'\0';
|
---|
| 714 |
|
---|
| 715 | if (!SetCurrentDirectoryW(pwszPath))
|
---|
| 716 | rc = RTErrConvertFromWin32(GetLastError());
|
---|
| 717 |
|
---|
[74460] | 718 | RTPathWinFree(pwszPath);
|
---|
[10911] | 719 | }
|
---|
| 720 | return rc;
|
---|
| 721 | }
|
---|
| 722 |
|
---|
[52944] | 723 |
|
---|
| 724 | RTDECL(int) RTPathGetCurrentOnDrive(char chDrive, char *pszPath, size_t cbPath)
|
---|
| 725 | {
|
---|
| 726 | int rc;
|
---|
[78153] | 727 | if (cbPath > 0)
|
---|
| 728 | {
|
---|
| 729 | WCHAR wszInput[4];
|
---|
| 730 | wszInput[0] = chDrive;
|
---|
| 731 | wszInput[1] = ':';
|
---|
| 732 | wszInput[2] = '\0';
|
---|
| 733 | RTUTF16 wszFullPath[RTPATH_MAX];
|
---|
| 734 | if (GetFullPathNameW(wszInput, RTPATH_MAX, wszFullPath, NULL))
|
---|
| 735 | rc = RTUtf16ToUtf8Ex(&wszFullPath[0], RTSTR_MAX, &pszPath, cbPath, NULL);
|
---|
| 736 | else
|
---|
| 737 | rc = RTErrConvertFromWin32(GetLastError());
|
---|
| 738 | }
|
---|
[52944] | 739 | else
|
---|
[78153] | 740 | rc = VERR_BUFFER_OVERFLOW;
|
---|
[52944] | 741 | return rc;
|
---|
| 742 | }
|
---|
| 743 |
|
---|