Changeset 3271 for trunk/src


Ignore:
Timestamp:
Mar 29, 2000, 5:24:08 PM (25 years ago)
Author:
cbratschi
Message:

onopen fix, FindFirstFileMultiA, "shell.dll" icon fix, load exe icons

Location:
trunk/src/shell32
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/shell32/enumidlist.cpp

    r3250 r3271  
    1 /* $Id: enumidlist.cpp,v 1.3 2000-03-27 15:09:19 cbratschi Exp $ */
     1/* $Id: enumidlist.cpp,v 1.4 2000-03-29 15:24:03 cbratschi Exp $ */
    22
    33/*
     
    187187        ICOM_THIS(IEnumIDListImpl,iface);
    188188
     189        const MULTICOUNT = 64;
    189190        LPITEMIDLIST    pidl=NULL;
    190         WIN32_FIND_DATAA stffile;
     191        WIN32_FIND_DATAA *stffile = NULL;
     192        DWORD count;
    191193        HANDLE hFile;
    192194        CHAR  szPath[MAX_PATH];
     
    204206        {
    205207          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)
    208212          {
    209213            do
    210214            {
    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, ".."))
    217220                  {
     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))
    218232                    continue;
    219                   }
     233                  free(stffile);
     234                  FindClose(hFile);
    220235                  return FALSE;
    221236                }
    222               } else if (dwFlags & SHCONTF_NONFOLDERS)
    223               { //file
    224                 pidl = _ILCreateValue(&stffile);
    225                 if(pidl && AddToEnumList2((IEnumIDList*)This, pidl))
    226                 {
    227                   continue;
    228                 }
    229                 return FALSE;
    230237              }
    231             } while( FindNextFileA(hFile,&stffile));
    232             FindClose (hFile);
     238            } while(FindNextFileMultiA(hFile,stffile,&(count = MULTICOUNT)));
     239            FindClose(hFile);
    233240            UniteEnumLists((IEnumIDList*)This);
    234241          }
     
    239246        {
    240247          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)
    243252          {
    244253            do
    245254            {
    246               if (! (stffile.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) )
     255              for (int x = 0;x < count;x++)
    247256              {
    248                 pidl = _ILCreateValue(&stffile);
    249                 if(pidl && AddToEnumList((IEnumIDList*)This, pidl))
     257                if (! (stffile[x].dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) )
    250258                {
    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;
    252265                }
    253                 return FALSE;
    254266              }
    255             } while( FindNextFileA(hFile,&stffile));
     267            } while(FindNextFileMultiA(hFile,stffile,&(count = MULTICOUNT)));
    256268            FindClose (hFile);
    257269          }
    258270        }
     271        if (stffile) free(stffile);
     272
    259273        return TRUE;
    260274}
  • trunk/src/shell32/folders.cpp

    r3243 r3271  
    1 /* $Id: folders.cpp,v 1.2 2000-03-26 16:34:41 cbratschi Exp $ */
     1/* $Id: folders.cpp,v 1.3 2000-03-29 15:24:03 cbratschi Exp $ */
    22
    33/*
     
    217217        else    /* object is file */
    218218        {
    219           if (_ILGetExtension (pSimplePidl, sTemp, MAX_PATH)
    220               && HCR_MapTypeToValue(sTemp, sTemp, MAX_PATH, TRUE)
     219          if (_ILGetExtension (pSimplePidl, sTemp, MAX_PATH))
     220          {
     221            if (HCR_MapTypeToValue(sTemp, sTemp, MAX_PATH, TRUE)
    221222              && HCR_GetDefaultIcon(sTemp, sTemp, MAX_PATH, &dwNr))
    222           {
    223             if (!strcmp("%1",sTemp))            /* icon is in the file */
    224223            {
    225               SHGetPathFromIDListA(This->pidl, sTemp);
    226               dwNr = 0;
     224              if (!strcmp("%1",sTemp))            /* icon is in the file */
     225              {
     226                SHGetPathFromIDListA(This->pidl, sTemp);
     227                dwNr = 0;
     228              }
     229              lstrcpynA(szIconFile, sTemp, cchMax);
     230              *piIndex = dwNr;
     231            } else
     232            {
     233              //icon is in the file/file is icon
     234              if (stricmp(sTemp,"EXE") == 0) //CB: add more
     235              {
     236                SHGetPathFromIDListA(This->pidl, sTemp);
     237                dwNr = 0;
     238                lstrcpynA(szIconFile, sTemp, cchMax);
     239                *piIndex = dwNr;
     240              } else //default icon
     241              {
     242                lstrcpynA(szIconFile, "shell32.dll", cchMax);
     243                *piIndex = 0;
     244              }
    227245            }
    228             lstrcpynA(szIconFile, sTemp, cchMax);
    229             *piIndex = dwNr;
    230           }
    231           else                                  /* default icon */
     246          } else                                  /* default icon */
    232247          {
    233248            lstrcpynA(szIconFile, "shell32.dll", cchMax);
  • trunk/src/shell32/iconcache.cpp

    r3250 r3271  
    1 /* $Id: iconcache.cpp,v 1.5 2000-03-27 15:09:20 cbratschi Exp $ */
     1/* $Id: iconcache.cpp,v 1.6 2000-03-29 15:24:04 cbratschi Exp $ */
    22
    33/*
     
    251251HGLOBAL WINAPI ICO_ExtractIconEx(LPCSTR lpszExeFileName, HICON * RetPtr, UINT nIconIndex, UINT n, UINT cxDesired, UINT cyDesired )
    252252{  HGLOBAL  hRet = 0;
    253    LPBYTE      pData;
     253   LPBYTE   pData;
    254254   OFSTRUCT ofs;
    255255   DWORD    sig;
    256256   HFILE    hFile = OpenFile( lpszExeFileName, &ofs, OF_READ );
    257    UINT      iconDirCount = 0,iconCount = 0;
    258    LPBYTE      peimage;
    259    HANDLE      fmapping;
     257   UINT     iconDirCount = 0,iconCount = 0;
     258   LPBYTE   peimage;
     259   HANDLE   fmapping;
    260260   ULONG    uSize;
    261261
     
    619619   if ( INVALID_INDEX == index )
    620620   {
    621      ret = SIC_LoadIcon (sSourceFile, dwSourceIndex);
     621     if (strcmp(sSourceFile,"shell32.dll") == 0)
     622       ret = -1; //icon not in cache -> set to default
     623     else
     624       ret = SIC_LoadIcon (sSourceFile, dwSourceIndex);
    622625   }
    623626   else
  • trunk/src/shell32/shellord.cpp

    r3243 r3271  
    1 /* $Id: shellord.cpp,v 1.6 2000-03-26 16:34:51 cbratschi Exp $ */
     1/* $Id: shellord.cpp,v 1.7 2000-03-29 15:24:05 cbratschi Exp $ */
    22/*
    33 * The parameters of many functions changes between different OS versions
     
    614614{
    615615        TRACE("(0x%08x)\n", hWndOwner);
    616         if (MessageBoxA( hWndOwner, "Do you want to exit WINE?", "Shutdown", MB_YESNO|MB_ICONQUESTION) == IDOK)
     616        if (MessageBoxA( hWndOwner, "Do you want to exit Odin?", "Shutdown", MB_YESNO|MB_ICONQUESTION) == IDYES)
    617617        { SendMessageA ( hWndOwner, WM_QUIT, 0, 0);
    618618        }
  • trunk/src/shell32/shlfolder.cpp

    r3257 r3271  
    1 /* $Id: shlfolder.cpp,v 1.11 2000-03-28 15:28:53 cbratschi Exp $ */
     1/* $Id: shlfolder.cpp,v 1.12 2000-03-29 15:24:06 cbratschi Exp $ */
    22/*
    33 * Shell Folder stuff
     
    17211721     psd->cxChar = DesktopSFHeader[iColumn].cxChar;
    17221722     psd->str.uType = STRRET_CSTRA;
     1723     psd->str.u.cStr[0] = 0;
    17231724     LoadStringA(shell32_hInstance, DesktopSFHeader[iColumn].colnameid, psd->str.u.cStr, MAX_PATH);
    17241725     return S_OK;
     
    17261727   else
    17271728   {
     1729     psd->str.u.cStr[0] = 0;
    17281730     /* the data from the pidl */
    17291731     switch(iColumn)
  • trunk/src/shell32/shlview.cpp

    r3257 r3271  
    1 /* $Id: shlview.cpp,v 1.11 2000-03-28 15:28:54 cbratschi Exp $ */
     1/* $Id: shlview.cpp,v 1.12 2000-03-29 15:24:08 cbratschi Exp $ */
    22/*
    33 * ShellView
     
    12001200                SHELLDETAILS sd;
    12011201
    1202                 IShellFolder2_GetDetailsOf(This->pSF2Parent, pidl, lpdi->item.iSubItem, &sd);
    1203                 StrRetToStrNA( lpdi->item.pszText, lpdi->item.cchTextMax, &sd.str, NULL);
    1204                 TRACE("-- text=%s\n",lpdi->item.pszText);
     1202                if(IShellFolder2_GetDetailsOf(This->pSF2Parent, pidl, lpdi->item.iSubItem, &sd) == S_OK)
     1203                {
     1204                  StrRetToStrNA( lpdi->item.pszText, lpdi->item.cchTextMax, &sd.str, NULL);
     1205                  TRACE("-- text=%s\n",lpdi->item.pszText);
     1206                } else lpdi->item.pszText[0] = 0;
    12051207              }
    12061208              else
     
    12101212            }
    12111213            if(lpdi->item.mask & LVIF_IMAGE)    /* image requested */
    1212          {
    1213            lpdi->item.iImage = SHMapPIDLToSystemImageListIndex(This->pSFParent, pidl, 0);
    1214          }
     1214            {
     1215              lpdi->item.iImage = SHMapPIDLToSystemImageListIndex(This->pSFParent, pidl, 0);
     1216            }
     1217#if 0 //CB: experimental (local cache would be better)
     1218            lpdi->item.mask |= LVIF_DI_SETITEM;
     1219#endif
    12151220       break;
    12161221
Note: See TracChangeset for help on using the changeset viewer.