Changeset 7521 for trunk/src/crtdll/dir.c
- Timestamp:
- Dec 2, 2001, 12:06:23 AM (24 years ago)
- File:
-
- 1 edited
-
trunk/src/crtdll/dir.c (modified) (19 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/crtdll/dir.c
r6712 r7521 1 1 /* 2 2 * CRTDLL drive/directory functions 3 * 3 * 4 4 * Copyright 1996,1998 Marcus Meissner 5 5 * Copyright 1996 Jukka Iivonen … … 19 19 20 20 #include <string.h> 21 #include <ctype.h> /* toupper proto */ 21 22 22 23 DEFAULT_DEBUG_CHANNEL(crtdll); … … 57 58 * RETURNS 58 59 * Sucess: 0 59 * 60 * 60 61 * Failure: -1 61 62 */ … … 64 65 dprintf(("CRTDLL: _chdir(%s)\n", 65 66 newdir)); 66 67 67 68 if (!SetCurrentDirectoryA(newdir)) 68 69 { … … 84 85 * RETURNS 85 86 * Sucess: 0 86 * 87 * Failure: 1 87 * 88 * Failure: 1 88 89 */ 89 90 BOOL CDECL CRTDLL__chdrive(INT newdrive) … … 91 92 char buffer[3] = "A:"; 92 93 buffer[0] += newdrive - 1; 93 94 94 95 dprintf(("CRTDLL: _chdrive(%s)\n", 95 96 buffer)); 96 97 97 98 if (!SetCurrentDirectoryA( buffer )) 98 99 { … … 108 109 /********************************************************************* 109 110 * _findclose (CRTDLL.098) 110 * 111 * 111 112 * Free the resources from a search handle created from _findfirst. 112 113 * … … 123 124 dprintf(("CRTDLL: _findclose(%08xh)\n", 124 125 hand)); 125 126 126 127 if (!FindClose((HANDLE)hand)) 127 128 { … … 141 142 * PARAMS 142 143 * fspec [in] File specification string for search, e.g "C:\*.BAT" 143 * 144 * 144 145 * ft [out] A pointer to a find_t structure to populate. 145 146 * … … 155 156 WIN32_FIND_DATAA find_data; 156 157 HANDLE hfind; 157 158 158 159 dprintf(("CRTDLL: _findfirst(%s)\n", 159 160 fspec)); … … 173 174 /********************************************************************* 174 175 * _findnext (CRTDLL.100) 175 * 176 * 176 177 * Return the next matching file/directory from a search hadle. 177 178 * 178 179 * PARAMS 179 180 * hand [in] Search handle from a pervious call to _findfirst 180 * 181 * 181 182 * ft [out] A pointer to a find_t structure to populate. 182 183 * … … 190 191 { 191 192 WIN32_FIND_DATAA find_data; 192 193 193 194 dprintf(("CRTDLL: _findnext(%08xh)\n", 194 195 hand)); 195 196 196 197 if (!FindNextFileA(hand, &find_data)) 197 198 { … … 224 225 { 225 226 // return (_getcwd(buf, size)); 226 227 227 228 char dir[_MAX_PATH]; 228 229 int dir_len = GetCurrentDirectoryA(_MAX_PATH,dir); 229 230 230 231 dprintf(("CRTDLL: _getcwd()\n")); 231 232 232 233 if (dir_len < 1) 233 234 return NULL; /* FIXME: Real return value untested */ … … 258 259 { 259 260 // return (_getdcwd(drive, buffer, maxlen)); 260 261 261 262 static CHAR* dummy; 262 263 263 264 dprintf(("CRTDLL: _getdcwd()\n")); 264 265 265 266 if (!drive || drive == CRTDLL__getdrive()) 266 267 return CRTDLL__getcwd(buf,size); /* current */ … … 305 306 DWORD ret[4]; 306 307 UINT err; 307 308 308 309 dprintf(("CRTDLL: _getdiskfree(%08xh)\n", disk)); 309 310 310 311 if (disk > 26) 311 312 return ERROR_INVALID_PARAMETER; /* CRTDLL doesn't set errno here */ … … 335 336 { 336 337 // return DRIVE_GetCurrentDrive() + 1; 337 338 338 339 char buffer[MAX_PATH]; 339 340 340 341 dprintf(("CRTDLL: _getdrive()\n")); 341 342 342 if (!GetCurrentDirectoryA( sizeof(buffer), buffer )) 343 return 0; 344 if (buffer[1] != ':') 343 if (!GetCurrentDirectoryA( sizeof(buffer), buffer )) 344 return 0; 345 if (buffer[1] != ':') 345 346 return 0; 346 347 return toupper(buffer[0]) - 'A' + 1; … … 357 358 dprintf(("CRTDLL: _mkdir(%s)\n", 358 359 newdir)); 359 360 360 361 if (CreateDirectoryA(newdir,NULL)) 361 362 return 0; … … 368 369 * _rmdir (CRTDLL.255) 369 370 * 370 * Delete a directory 371 * Delete a directory 371 372 * 372 373 */ … … 375 376 dprintf(("CRTDLL: _rmdir(%s)\n", 376 377 dir)); 377 378 378 379 if (RemoveDirectoryA(dir)) 379 380 return 0;
Note:
See TracChangeset
for help on using the changeset viewer.
