Changeset 2997 for trunk/src/lib/nt/ntunlink.c
- Timestamp:
- Nov 2, 2016, 12:28:02 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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
Note:
See TracChangeset
for help on using the changeset viewer.