Changeset 2997 in kBuild
- Timestamp:
- Nov 1, 2016 11:28:02 PM (8 years ago)
- Location:
- trunk/src/lib/nt
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/nt/fts-nt.h
r2992 r2997 53 53 #ifdef _WINNT_ 54 54 typedef HANDLE fts_fd_t; 55 # define NT_FTS_INVALID_HANDLE_VALUE INVALID_HANDLE_VALUE 55 56 #else 56 57 typedef void * fts_fd_t; 58 # define NT_FTS_INVALID_HANDLE_VALUE ((void *)~(uintptr_t)0) 57 59 #endif 58 60 #define FTSCALL __cdecl … … 98 100 int fts_errno; /* errno for this node */ 99 101 fts_fd_t fts_symfd; /* NT: Normally -1; -2 we followed this symlinked dir */ 100 fts_fd_t fts_dirfd; /* NT: Handle to the directory */102 fts_fd_t fts_dirfd; /* NT: Handle to the directory (NT_FTS_)INVALID_HANDLE_VALUE if not valid */ 101 103 size_t fts_pathlen; /* strlen(fts_path) */ 102 104 size_t fts_namelen; /* strlen(fts_name) */ -
trunk/src/lib/nt/nthlp.h
r2985 r2997 75 75 void birdCloseFile(HANDLE hFile); 76 76 int birdDosToNtPath(const char *pszPath, MY_UNICODE_STRING *pNtPath); 77 int birdDosToRelativeNtPath(const char *pszPath, MY_UNICODE_STRING *pNtPath); 77 78 void birdFreeNtPath(MY_UNICODE_STRING *pNtPath); 78 79 -
trunk/src/lib/nt/nthlpfs.c
r2985 r2997 175 175 176 176 /** 177 * Converts UNIX slashes to DOS ones and trims trailing ones.177 * Converts UNIX slashes to DOS ones. 178 178 * 179 179 * @returns 0 … … 194 194 } 195 195 196 #if 0 196 197 /* Strip trailing slashes (NT doesn't like them). */ 197 198 while ( pNtPath->Length >= sizeof(wchar_t) … … 210 211 pNtPath->Buffer[1] = '\0'; 211 212 } 213 #endif 212 214 213 215 return 0; -
trunk/src/lib/nt/ntunlink.c
r2985 r2997 83 83 84 84 85 static int birdUnlinkInternal( const char *pszFile, int fReadOnlyToo, int fFast)85 static int birdUnlinkInternal(HANDLE hRoot, const char *pszFile, int fReadOnlyToo, int fFast) 86 86 { 87 87 MY_UNICODE_STRING NtPath; 88 88 int rc; 89 89 90 rc = birdDosToNtPath(pszFile, &NtPath); 90 if (hRoot == INVALID_HANDLE_VALUE) 91 hRoot = NULL; 92 if (hRoot == NULL) 93 rc = birdDosToNtPath(pszFile, &NtPath); 94 else 95 rc = birdDosToRelativeNtPath(pszFile, &NtPath); 91 96 if (rc == 0) 92 97 { … … 96 101 /* This uses FILE_DELETE_ON_CLOSE. Probably only suitable when in a hurry... */ 97 102 MY_OBJECT_ATTRIBUTES ObjAttr; 98 MyInitializeObjectAttributes(&ObjAttr, &NtPath, OBJ_CASE_INSENSITIVE, NULL /*hRoot*/, NULL /*pSecAttr*/);103 MyInitializeObjectAttributes(&ObjAttr, &NtPath, OBJ_CASE_INSENSITIVE, hRoot, NULL /*pSecAttr*/); 99 104 rcNt = g_pfnNtDeleteFile(&ObjAttr); 100 105 … … 113 118 for (;;) 114 119 { 115 rcNt = birdOpenFileUniStr( NULL /*hRoot*/,120 rcNt = birdOpenFileUniStr(hRoot, 116 121 &NtPath, 117 122 DELETE, … … 157 162 int birdUnlink(const char *pszFile) 158 163 { 159 return birdUnlinkInternal(pszFile, 0 /*fReadOnlyToo*/, 0 /*fFast*/); 164 return birdUnlinkInternal(NULL /*hRoot*/, pszFile, 0 /*fReadOnlyToo*/, 0 /*fFast*/); 165 } 166 167 168 int birdUnlinkEx(void *hRoot, const char *pszFile) 169 { 170 return birdUnlinkInternal((HANDLE)hRoot, pszFile, 0 /*fReadOnlyToo*/, 0 /*fFast*/); 160 171 } 161 172 … … 163 174 int birdUnlinkForced(const char *pszFile) 164 175 { 165 return birdUnlinkInternal(pszFile, 1 /*fReadOnlyToo*/, 0 /*fFast*/); 176 return birdUnlinkInternal(NULL /*hRoot*/, pszFile, 1 /*fReadOnlyToo*/, 0 /*fFast*/); 177 } 178 179 180 int birdUnlinkForcedEx(void *hRoot, const char *pszFile) 181 { 182 return birdUnlinkInternal((HANDLE)hRoot, pszFile, 1 /*fReadOnlyToo*/, 0 /*fFast*/); 166 183 } 167 184 … … 169 186 int birdUnlinkForcedFast(const char *pszFile) 170 187 { 171 return birdUnlinkInternal( pszFile, 1 /*fReadOnlyToo*/, 1 /*fFast*/);188 return birdUnlinkInternal(NULL /*hRoot*/, pszFile, 1 /*fReadOnlyToo*/, 1 /*fFast*/); 172 189 } 173 190 191 192 int birdUnlinkForcedFastEx(void *hRoot, const char *pszFile) 193 { 194 return birdUnlinkInternal((HANDLE)hRoot, pszFile, 1 /*fReadOnlyToo*/, 1 /*fFast*/); 195 } 196 -
trunk/src/lib/nt/ntunlink.h
r2713 r2997 35 35 36 36 int birdUnlink(const char *pszFile); 37 int birdUnlinkEx(void *hRoot, const char *pszFile); 37 38 int birdUnlinkForced(const char *pszFile); 39 int birdUnlinkForcedEx(void *hRoot, const char *pszFile); 38 40 int birdUnlinkForcedFast(const char *pszFile); 41 int birdUnlinkForcedFastEx(void *hRoot, const char *pszFile); 39 42 40 43 #undef unlink
Note:
See TracChangeset
for help on using the changeset viewer.