Changeset 3271 for trunk/src/shell32/enumidlist.cpp
- Timestamp:
- Mar 29, 2000, 5:24:08 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/shell32/enumidlist.cpp
r3250 r3271 1 /* $Id: enumidlist.cpp,v 1. 3 2000-03-27 15:09:19cbratschi Exp $ */1 /* $Id: enumidlist.cpp,v 1.4 2000-03-29 15:24:03 cbratschi Exp $ */ 2 2 3 3 /* … … 187 187 ICOM_THIS(IEnumIDListImpl,iface); 188 188 189 const MULTICOUNT = 64; 189 190 LPITEMIDLIST pidl=NULL; 190 WIN32_FIND_DATAA stffile; 191 WIN32_FIND_DATAA *stffile = NULL; 192 DWORD count; 191 193 HANDLE hFile; 192 194 CHAR szPath[MAX_PATH]; … … 204 206 { 205 207 TRACE("-- (%p)-> enumerate SHCONTF_FOLDERS of %s\n",This,debugstr_a(szPath)); 206 hFile = FindFirstFileA(szPath,&stffile); 207 if ( hFile != INVALID_HANDLE_VALUE ) 208 count = MULTICOUNT; 209 stffile = (WIN32_FIND_DATAA*)malloc(count*sizeof(WIN32_FIND_DATAA)); 210 hFile = FindFirstFileMultiA(szPath,stffile,&count); 211 if (hFile != INVALID_HANDLE_VALUE) 208 212 { 209 213 do 210 214 { 211 if (stffile.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) 212 { //directory 213 if (strcmp (stffile.cFileName, ".") && strcmp (stffile.cFileName, "..")) 214 { 215 pidl = _ILCreateFolder (&stffile); 216 if(pidl && AddToEnumList((IEnumIDList*)This, pidl)) 215 for (int x = 0;x < count;x++) 216 { 217 if (stffile[x].dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) 218 { //directory 219 if (strcmp (stffile[x].cFileName, ".") && strcmp (stffile[x].cFileName, "..")) 217 220 { 221 pidl = _ILCreateFolder (&stffile[x]); 222 if (pidl && AddToEnumList((IEnumIDList*)This, pidl)) 223 continue; 224 free(stffile); 225 FindClose(hFile); 226 return FALSE; 227 } 228 } else if (dwFlags & SHCONTF_NONFOLDERS) 229 { //file 230 pidl = _ILCreateValue(&stffile[x]); 231 if (pidl && AddToEnumList2((IEnumIDList*)This, pidl)) 218 232 continue; 219 } 233 free(stffile); 234 FindClose(hFile); 220 235 return FALSE; 221 236 } 222 } else if (dwFlags & SHCONTF_NONFOLDERS)223 { //file224 pidl = _ILCreateValue(&stffile);225 if(pidl && AddToEnumList2((IEnumIDList*)This, pidl))226 {227 continue;228 }229 return FALSE;230 237 } 231 } while( FindNextFileA(hFile,&stffile));232 FindClose 238 } while(FindNextFileMultiA(hFile,stffile,&(count = MULTICOUNT))); 239 FindClose(hFile); 233 240 UniteEnumLists((IEnumIDList*)This); 234 241 } … … 239 246 { 240 247 TRACE("-- (%p)-> enumerate SHCONTF_NONFOLDERS of %s\n",This,debugstr_a(szPath)); 241 hFile = FindFirstFileA(szPath,&stffile); 242 if ( hFile != INVALID_HANDLE_VALUE ) 248 count = MULTICOUNT; 249 if (!stffile) stffile = (WIN32_FIND_DATAA*)malloc(count*sizeof(WIN32_FIND_DATAA)); 250 hFile = FindFirstFileMultiA(szPath,stffile,&count); 251 if (hFile != INVALID_HANDLE_VALUE) 243 252 { 244 253 do 245 254 { 246 if (! (stffile.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY))255 for (int x = 0;x < count;x++) 247 256 { 248 pidl = _ILCreateValue(&stffile); 249 if(pidl && AddToEnumList((IEnumIDList*)This, pidl)) 257 if (! (stffile[x].dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) ) 250 258 { 251 continue; 259 pidl = _ILCreateValue(&stffile[x]); 260 if (pidl && AddToEnumList((IEnumIDList*)This, pidl)) 261 continue; 262 free(stffile); 263 FindClose(hFile); 264 return FALSE; 252 265 } 253 return FALSE;254 266 } 255 } while( FindNextFileA(hFile,&stffile));267 } while(FindNextFileMultiA(hFile,stffile,&(count = MULTICOUNT))); 256 268 FindClose (hFile); 257 269 } 258 270 } 271 if (stffile) free(stffile); 272 259 273 return TRUE; 260 274 }
Note:
See TracChangeset
for help on using the changeset viewer.