Changeset 3009 in kBuild
- Timestamp:
- Nov 7, 2016 2:21:59 AM (8 years ago)
- Location:
- trunk/src/lib/nt
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/nt/fts-nt.c
r3006 r3009 179 179 180 180 /* fts_open() requires at least one path */ 181 if ( *argv == NULL) {181 if (wcsargv ? *wcsargv == NULL : *argv == NULL) { 182 182 errno = EINVAL; 183 183 return (NULL); … … 209 209 210 210 /* 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) { 212 212 /* NT: We need to do some small input transformations to make this and 213 213 the API user code happy. 1. Lone drive letters get a dot … … 228 228 p = fts_alloc_utf16(sp, *wcsargv, len); 229 229 } 230 wcsargv++; 230 231 } else { 231 232 len = strlen(*argv); … … 240 241 p = fts_alloc_ansi(sp, *argv, len); 241 242 } 243 argv++; 242 244 } 243 245 if (p != NULL) { /* likely */ } else { goto mem3; } -
trunk/src/lib/nt/nthlp.h
r2997 r3009 75 75 void birdCloseFile(HANDLE hFile); 76 76 int birdDosToNtPath(const char *pszPath, MY_UNICODE_STRING *pNtPath); 77 int birdDosToNtPathW(const wchar_t *pwszPath, MY_UNICODE_STRING *pNtPath); 77 78 int birdDosToRelativeNtPath(const char *pszPath, MY_UNICODE_STRING *pNtPath); 79 int birdDosToRelativeNtPathW(const wchar_t *pszPath, MY_UNICODE_STRING *pNtPath); 78 80 void birdFreeNtPath(MY_UNICODE_STRING *pNtPath); 79 81 -
trunk/src/lib/nt/ntunlink.c
r2997 r3009 83 83 84 84 85 static int birdUnlinkInternal(HANDLE hRoot, const char *pszFile, int fReadOnlyToo, int fFast)85 static int birdUnlinkInternal(HANDLE hRoot, const char *pszFile, const wchar_t *pwszFile, int fReadOnlyToo, int fFast) 86 86 { 87 87 MY_UNICODE_STRING NtPath; … … 91 91 hRoot = NULL; 92 92 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 } 94 99 else 95 rc = birdDosToRelativeNtPath(pszFile, &NtPath); 100 { 101 if (pwszFile) 102 rc = birdDosToRelativeNtPathW(pwszFile, &NtPath); 103 else 104 rc = birdDosToRelativeNtPath(pszFile, &NtPath); 105 } 96 106 if (rc == 0) 97 107 { … … 162 172 int birdUnlink(const char *pszFile) 163 173 { 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 178 int birdUnlinkW(const wchar_t *pwszFile) 179 { 180 return birdUnlinkInternal(NULL /*hRoot*/, NULL /*pwszFile*/, pwszFile, 0 /*fReadOnlyToo*/, 0 /*fFast*/); 165 181 } 166 182 … … 168 184 int birdUnlinkEx(void *hRoot, const char *pszFile) 169 185 { 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 190 int birdUnlinkExW(void *hRoot, const wchar_t *pwszFile) 191 { 192 return birdUnlinkInternal((HANDLE)hRoot, NULL /*pszFile*/, pwszFile, 0 /*fReadOnlyToo*/, 0 /*fFast*/); 171 193 } 172 194 … … 174 196 int birdUnlinkForced(const char *pszFile) 175 197 { 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 202 int birdUnlinkForcedW(const wchar_t *pwszFile) 203 { 204 return birdUnlinkInternal(NULL /*hRoot*/, NULL /*pszFile*/, pwszFile, 1 /*fReadOnlyToo*/, 0 /*fFast*/); 177 205 } 178 206 … … 180 208 int birdUnlinkForcedEx(void *hRoot, const char *pszFile) 181 209 { 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 214 int birdUnlinkForcedExW(void *hRoot, const wchar_t *pwszFile) 215 { 216 return birdUnlinkInternal((HANDLE)hRoot, NULL /*pszFile*/, pwszFile, 1 /*fReadOnlyToo*/, 0 /*fFast*/); 183 217 } 184 218 … … 186 220 int birdUnlinkForcedFast(const char *pszFile) 187 221 { 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 226 int birdUnlinkForcedFastW(const wchar_t *pwszFile) 227 { 228 return birdUnlinkInternal(NULL /*hRoot*/, NULL /*pszFile*/, pwszFile, 1 /*fReadOnlyToo*/, 1 /*fFast*/); 189 229 } 190 230 … … 192 232 int birdUnlinkForcedFastEx(void *hRoot, const char *pszFile) 193 233 { 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 238 int 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 35 35 36 36 int birdUnlink(const char *pszFile); 37 int birdUnlinkW(const wchar_t *pwszFile); 37 38 int birdUnlinkEx(void *hRoot, const char *pszFile); 39 int birdUnlinkExW(void *hRoot, const wchar_t *pwszFile); 38 40 int birdUnlinkForced(const char *pszFile); 41 int birdUnlinkForcedW(const wchar_t *pwszFile); 39 42 int birdUnlinkForcedEx(void *hRoot, const char *pszFile); 43 int birdUnlinkForcedExW(void *hRoot, const wchar_t *pszFile); 40 44 int birdUnlinkForcedFast(const char *pszFile); 45 int birdUnlinkForcedFastW(const wchar_t *pwszFile); 41 46 int birdUnlinkForcedFastEx(void *hRoot, const char *pszFile); 47 int birdUnlinkForcedFastExW(void *hRoot, const wchar_t *pwszFile); 42 48 43 49 #undef unlink
Note:
See TracChangeset
for help on using the changeset viewer.