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

ntunlink: W apis.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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
Note: See TracChangeset for help on using the changeset viewer.