VirtualBox

Changeset 3009 in kBuild


Ignore:
Timestamp:
Nov 7, 2016 2:21:59 AM (8 years ago)
Author:
bird
Message:

ntunlink: W apis.

Location:
trunk/src/lib/nt
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/nt/fts-nt.c

    r3006 r3009  
    179179
    180180        /* fts_open() requires at least one path */
    181         if (*argv == NULL) {
     181        if (wcsargv ? *wcsargv == NULL : *argv == NULL) {
    182182                errno = EINVAL;
    183183                return (NULL);
     
    209209
    210210        /* Allocate/initialize root(s). */
    211         for (root = NULL, nitems = 0; *argv != NULL; ++argv, ++nitems) {
     211        for (root = NULL, nitems = 0; wcsargv ? *wcsargv != NULL : *argv != NULL; ++nitems) {
    212212                /* NT: We need to do some small input transformations to make this and
    213213                       the API user code happy.  1. Lone drive letters get a dot
     
    228228                                p = fts_alloc_utf16(sp, *wcsargv, len);
    229229                        }
     230                        wcsargv++;
    230231                } else {
    231232                        len = strlen(*argv);
     
    240241                                p = fts_alloc_ansi(sp, *argv, len);
    241242                        }
     243                        argv++;
    242244                }
    243245                if (p != NULL) { /* likely */ } else { goto mem3; }
  • trunk/src/lib/nt/nthlp.h

    r2997 r3009  
    7575void        birdCloseFile(HANDLE hFile);
    7676int         birdDosToNtPath(const char *pszPath, MY_UNICODE_STRING *pNtPath);
     77int         birdDosToNtPathW(const wchar_t *pwszPath, MY_UNICODE_STRING *pNtPath);
    7778int         birdDosToRelativeNtPath(const char *pszPath, MY_UNICODE_STRING *pNtPath);
     79int         birdDosToRelativeNtPathW(const wchar_t *pszPath, MY_UNICODE_STRING *pNtPath);
    7880void        birdFreeNtPath(MY_UNICODE_STRING *pNtPath);
    7981
  • trunk/src/lib/nt/ntunlink.c

    r2997 r3009  
    8383
    8484
    85 static int birdUnlinkInternal(HANDLE hRoot, const char *pszFile, int fReadOnlyToo, int fFast)
     85static int birdUnlinkInternal(HANDLE hRoot, const char *pszFile, const wchar_t *pwszFile, int fReadOnlyToo, int fFast)
    8686{
    8787    MY_UNICODE_STRING   NtPath;
     
    9191        hRoot = NULL;
    9292    if (hRoot == NULL)
    93         rc = birdDosToNtPath(pszFile, &NtPath);
     93    {
     94        if (pwszFile)
     95            rc = birdDosToNtPathW(pwszFile, &NtPath);
     96        else
     97            rc = birdDosToNtPath(pszFile, &NtPath);
     98    }
    9499    else
    95         rc = birdDosToRelativeNtPath(pszFile, &NtPath);
     100    {
     101        if (pwszFile)
     102            rc = birdDosToRelativeNtPathW(pwszFile, &NtPath);
     103        else
     104            rc = birdDosToRelativeNtPath(pszFile, &NtPath);
     105    }
    96106    if (rc == 0)
    97107    {
     
    162172int birdUnlink(const char *pszFile)
    163173{
    164     return birdUnlinkInternal(NULL /*hRoot*/, pszFile, 0 /*fReadOnlyToo*/, 0 /*fFast*/);
     174    return birdUnlinkInternal(NULL /*hRoot*/, pszFile, NULL /*pwszFile*/, 0 /*fReadOnlyToo*/, 0 /*fFast*/);
     175}
     176
     177
     178int birdUnlinkW(const wchar_t *pwszFile)
     179{
     180    return birdUnlinkInternal(NULL /*hRoot*/, NULL /*pwszFile*/, pwszFile, 0 /*fReadOnlyToo*/, 0 /*fFast*/);
    165181}
    166182
     
    168184int birdUnlinkEx(void *hRoot, const char *pszFile)
    169185{
    170     return birdUnlinkInternal((HANDLE)hRoot, pszFile, 0 /*fReadOnlyToo*/, 0 /*fFast*/);
     186    return birdUnlinkInternal((HANDLE)hRoot, pszFile, NULL /*pwszFile*/, 0 /*fReadOnlyToo*/, 0 /*fFast*/);
     187}
     188
     189
     190int birdUnlinkExW(void *hRoot, const wchar_t *pwszFile)
     191{
     192    return birdUnlinkInternal((HANDLE)hRoot, NULL /*pszFile*/, pwszFile, 0 /*fReadOnlyToo*/, 0 /*fFast*/);
    171193}
    172194
     
    174196int birdUnlinkForced(const char *pszFile)
    175197{
    176     return birdUnlinkInternal(NULL /*hRoot*/, pszFile, 1 /*fReadOnlyToo*/, 0 /*fFast*/);
     198    return birdUnlinkInternal(NULL /*hRoot*/, pszFile, NULL /*pwszFile*/, 1 /*fReadOnlyToo*/, 0 /*fFast*/);
     199}
     200
     201
     202int birdUnlinkForcedW(const wchar_t *pwszFile)
     203{
     204    return birdUnlinkInternal(NULL /*hRoot*/, NULL /*pszFile*/, pwszFile, 1 /*fReadOnlyToo*/, 0 /*fFast*/);
    177205}
    178206
     
    180208int birdUnlinkForcedEx(void *hRoot, const char *pszFile)
    181209{
    182     return birdUnlinkInternal((HANDLE)hRoot, pszFile, 1 /*fReadOnlyToo*/, 0 /*fFast*/);
     210    return birdUnlinkInternal((HANDLE)hRoot, pszFile, NULL /*pwszFile*/, 1 /*fReadOnlyToo*/, 0 /*fFast*/);
     211}
     212
     213
     214int birdUnlinkForcedExW(void *hRoot, const wchar_t *pwszFile)
     215{
     216    return birdUnlinkInternal((HANDLE)hRoot, NULL /*pszFile*/, pwszFile, 1 /*fReadOnlyToo*/, 0 /*fFast*/);
    183217}
    184218
     
    186220int birdUnlinkForcedFast(const char *pszFile)
    187221{
    188     return birdUnlinkInternal(NULL /*hRoot*/, pszFile, 1 /*fReadOnlyToo*/, 1 /*fFast*/);
     222    return birdUnlinkInternal(NULL /*hRoot*/, pszFile, NULL /*pwszFile*/, 1 /*fReadOnlyToo*/, 1 /*fFast*/);
     223}
     224
     225
     226int birdUnlinkForcedFastW(const wchar_t *pwszFile)
     227{
     228    return birdUnlinkInternal(NULL /*hRoot*/, NULL /*pszFile*/, pwszFile, 1 /*fReadOnlyToo*/, 1 /*fFast*/);
    189229}
    190230
     
    192232int birdUnlinkForcedFastEx(void *hRoot, const char *pszFile)
    193233{
    194     return birdUnlinkInternal((HANDLE)hRoot, pszFile, 1 /*fReadOnlyToo*/, 1 /*fFast*/);
    195 }
    196 
     234    return birdUnlinkInternal((HANDLE)hRoot, pszFile, NULL /*pwszFile*/, 1 /*fReadOnlyToo*/, 1 /*fFast*/);
     235}
     236
     237
     238int birdUnlinkForcedFastExW(void *hRoot, const wchar_t *pwszFile)
     239{
     240    return birdUnlinkInternal((HANDLE)hRoot, NULL /*pszFile*/, pwszFile, 1 /*fReadOnlyToo*/, 1 /*fFast*/);
     241}
     242
  • trunk/src/lib/nt/ntunlink.h

    r2997 r3009  
    3535
    3636int birdUnlink(const char *pszFile);
     37int birdUnlinkW(const wchar_t *pwszFile);
    3738int birdUnlinkEx(void *hRoot, const char *pszFile);
     39int birdUnlinkExW(void *hRoot, const wchar_t *pwszFile);
    3840int birdUnlinkForced(const char *pszFile);
     41int birdUnlinkForcedW(const wchar_t *pwszFile);
    3942int birdUnlinkForcedEx(void *hRoot, const char *pszFile);
     43int birdUnlinkForcedExW(void *hRoot, const wchar_t *pszFile);
    4044int birdUnlinkForcedFast(const char *pszFile);
     45int birdUnlinkForcedFastW(const wchar_t *pwszFile);
    4146int birdUnlinkForcedFastEx(void *hRoot, const char *pszFile);
     47int birdUnlinkForcedFastExW(void *hRoot, const wchar_t *pwszFile);
    4248
    4349#undef  unlink
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette