Replaced some GetProcAddress() imports by the standard dll import

mechanism.
This commit is contained in:
Alexandre Julliard 2001-01-17 22:05:24 +00:00
parent 0618746265
commit 556d8b5ecb
9 changed files with 57 additions and 203 deletions

View File

@ -92,9 +92,6 @@ typedef struct {
#include "shlobj.h"
#include "shellapi.h"
/* IMAGELIST */
extern BOOL (WINAPI* COMDLG32_ImageList_Draw) (HIMAGELIST himl, int i, HDC hdcDest, int x, int y, UINT fStyle);
/* ITEMIDLIST */
extern LPITEMIDLIST (WINAPI *COMDLG32_PIDL_ILClone) (LPCITEMIDLIST);
@ -104,31 +101,10 @@ extern BOOL (WINAPI *COMDLG32_PIDL_ILRemoveLastID)(LPCITEMIDLIST);
extern BOOL (WINAPI *COMDLG32_PIDL_ILIsEqual)(LPCITEMIDLIST, LPCITEMIDLIST);
/* SHELL */
extern BOOL (WINAPI *COMDLG32_SHGetPathFromIDListA) (LPCITEMIDLIST,LPSTR);
extern HRESULT (WINAPI *COMDLG32_SHGetSpecialFolderLocation)(HWND,INT,LPITEMIDLIST *);
extern DWORD (WINAPI *COMDLG32_SHGetDesktopFolder)(IShellFolder **);
extern DWORD (WINAPI *COMDLG32_SHGetFileInfoA)(LPCSTR,DWORD,SHFILEINFOA*,UINT,UINT);
extern LPVOID (WINAPI *COMDLG32_SHAlloc)(DWORD);
extern DWORD (WINAPI *COMDLG32_SHFree)(LPVOID);
extern HRESULT (WINAPI *COMDLG32_SHGetDataFromIDListA)(LPSHELLFOLDER psf, LPCITEMIDLIST pidl, int nFormat, LPVOID dest, int len);
extern BOOL (WINAPI *COMDLG32_SHGetFolderPathA)(HWND,int,HANDLE,DWORD,LPSTR);
/* PATH */
extern BOOL (WINAPI *COMDLG32_PathIsRootA)(LPCSTR x);
extern LPSTR (WINAPI *COMDLG32_PathFindFileNameA)(LPCSTR path);
extern DWORD (WINAPI *COMDLG32_PathRemoveFileSpecA)(LPSTR fn);
extern BOOL (WINAPI *COMDLG32_PathMatchSpecW)(LPCWSTR x, LPCWSTR y);
extern LPSTR (WINAPI *COMDLG32_PathAddBackslashA)(LPSTR path);
extern BOOL (WINAPI *COMDLG32_PathCanonicalizeA)(LPSTR pszBuf, LPCSTR pszPath);
extern int (WINAPI *COMDLG32_PathGetDriveNumberA)(LPCSTR lpszPath);
extern BOOL (WINAPI *COMDLG32_PathIsRelativeA) (LPCSTR lpszPath);
extern LPSTR (WINAPI *COMDLG32_PathFindNextComponentA)(LPCSTR pszPath);
extern LPWSTR (WINAPI *COMDLG32_PathAddBackslashW)(LPWSTR lpszPath);
extern LPSTR (WINAPI *COMDLG32_PathFindExtensionA)(LPCVOID lpszPath);
extern BOOL (WINAPI *COMDLG32_PathAddExtensionA)(LPSTR pszPath,LPCSTR pszExtension);
extern BOOL WINAPI GetFileDialog95A(LPOPENFILENAMEA ofn,UINT iDlgType);
extern BOOL WINAPI GetFileDialog95W(LPOPENFILENAMEW ofn,UINT iDlgType);

View File

@ -20,16 +20,10 @@ HINSTANCE COMDLG32_hInstance = 0;
HINSTANCE16 COMDLG32_hInstance16 = 0;
static DWORD COMDLG32_TlsIndex;
static int COMDLG32_Attach = 0;
HINSTANCE COMCTL32_hInstance = 0;
HINSTANCE SHELL32_hInstance = 0;
HINSTANCE SHLWAPI_hInstance = 0;
HINSTANCE SHFOLDER_hInstance = 0;
/* IMAGELIST */
BOOL (WINAPI* COMDLG32_ImageList_Draw) (HIMAGELIST himl, int i, HDC hdcDest, int x, int y, UINT fStyle);
/* ITEMIDLIST */
LPITEMIDLIST (WINAPI *COMDLG32_PIDL_ILClone) (LPCITEMIDLIST);
LPITEMIDLIST (WINAPI *COMDLG32_PIDL_ILCombine)(LPCITEMIDLIST,LPCITEMIDLIST);
@ -38,31 +32,10 @@ BOOL (WINAPI *COMDLG32_PIDL_ILRemoveLastID)(LPCITEMIDLIST);
BOOL (WINAPI *COMDLG32_PIDL_ILIsEqual)(LPCITEMIDLIST, LPCITEMIDLIST);
/* SHELL */
BOOL (WINAPI *COMDLG32_SHGetPathFromIDListA) (LPCITEMIDLIST,LPSTR);
HRESULT (WINAPI *COMDLG32_SHGetSpecialFolderLocation)(HWND,INT,LPITEMIDLIST *);
DWORD (WINAPI *COMDLG32_SHGetDesktopFolder)(IShellFolder **);
DWORD (WINAPI *COMDLG32_SHGetFileInfoA)(LPCSTR,DWORD,SHFILEINFOA*,UINT,UINT);
LPVOID (WINAPI *COMDLG32_SHAlloc)(DWORD);
DWORD (WINAPI *COMDLG32_SHFree)(LPVOID);
HRESULT (WINAPI *COMDLG32_SHGetDataFromIDListA)(LPSHELLFOLDER psf, LPCITEMIDLIST pidl, int nFormat, LPVOID dest, int len);
HRESULT (WINAPI *COMDLG32_StrRetToBufA)(LPSTRRET,LPITEMIDLIST,LPSTR,DWORD);
HRESULT (WINAPI *COMDLG32_StrRetToBufW)(LPSTRRET,LPITEMIDLIST,LPWSTR,DWORD);
BOOL (WINAPI *COMDLG32_SHGetFolderPathA)(HWND,int,HANDLE,DWORD,LPSTR);
/* PATH */
BOOL (WINAPI *COMDLG32_PathIsRootA)(LPCSTR x);
LPSTR (WINAPI *COMDLG32_PathFindFileNameA)(LPCSTR path);
DWORD (WINAPI *COMDLG32_PathRemoveFileSpecA)(LPSTR fn);
BOOL (WINAPI *COMDLG32_PathMatchSpecW)(LPCWSTR x, LPCWSTR y);
LPSTR (WINAPI *COMDLG32_PathAddBackslashA)(LPSTR path);
BOOL (WINAPI *COMDLG32_PathCanonicalizeA)(LPSTR pszBuf, LPCSTR pszPath);
int (WINAPI *COMDLG32_PathGetDriveNumberA)(LPCSTR lpszPath);
BOOL (WINAPI *COMDLG32_PathIsRelativeA) (LPCSTR lpszPath);
LPSTR (WINAPI *COMDLG32_PathFindNextComponentA)(LPCSTR pszPath);
LPWSTR (WINAPI *COMDLG32_PathAddBackslashW)(LPWSTR lpszPath);
LPSTR (WINAPI *COMDLG32_PathFindExtensionA)(LPCVOID lpszPath);
BOOL (WINAPI *COMDLG32_PathAddExtensionA)(LPSTR pszPath,LPCSTR pszExtension);
/***********************************************************************
* COMDLG32_DllEntryPoint (COMDLG32.entry)
*
@ -87,18 +60,6 @@ BOOL WINAPI COMDLG32_DllEntryPoint(HINSTANCE hInstance, DWORD Reason, LPVOID Res
switch(Reason)
{
case DLL_PROCESS_ATTACH:
COMDLG32_Attach++;
if(COMDLG32_hInstance)
{
ERR("comdlg32.dll instantiated twice in one address space!\n");
/*
* We should return FALSE here, but that will break
* most apps that use CreateProcess because we do
* not yet support seperate address spaces.
*/
return TRUE;
}
COMDLG32_hInstance = hInstance;
DisableThreadLibraryCalls(hInstance);
@ -113,19 +74,14 @@ BOOL WINAPI COMDLG32_DllEntryPoint(HINSTANCE hInstance, DWORD Reason, LPVOID Res
COMDLG32_TlsIndex = 0xffffffff;
COMCTL32_hInstance = GetModuleHandleA("COMCTL32.DLL");
SHELL32_hInstance = GetModuleHandleA("SHELL32.DLL");
SHLWAPI_hInstance = GetModuleHandleA("SHLWAPI.DLL");
if (!COMCTL32_hInstance || !SHELL32_hInstance || !SHLWAPI_hInstance)
if (!SHELL32_hInstance)
{
ERR("loading of comctl32 or shell32 or shlwapi failed\n");
ERR("loading of shell32 failed\n");
return FALSE;
}
/* IMAGELIST */
GPA(COMDLG32_ImageList_Draw, COMCTL32_hInstance,"ImageList_Draw");
/* ITEMIDLIST */
GPA(COMDLG32_PIDL_ILIsEqual, SHELL32_hInstance, (LPCSTR)21L);
GPA(COMDLG32_PIDL_ILCombine, SHELL32_hInstance, (LPCSTR)25L);
@ -137,12 +93,6 @@ BOOL WINAPI COMDLG32_DllEntryPoint(HINSTANCE hInstance, DWORD Reason, LPVOID Res
GPA(COMDLG32_SHAlloc, SHELL32_hInstance, (LPCSTR)196L);
GPA(COMDLG32_SHFree, SHELL32_hInstance, (LPCSTR)195L);
GPA(COMDLG32_SHGetSpecialFolderLocation, SHELL32_hInstance,"SHGetSpecialFolderLocation");
GPA(COMDLG32_SHGetPathFromIDListA, SHELL32_hInstance,"SHGetPathFromIDListA");
GPA(COMDLG32_SHGetDesktopFolder, SHELL32_hInstance,"SHGetDesktopFolder");
GPA(COMDLG32_SHGetFileInfoA, SHELL32_hInstance,"SHGetFileInfoA");
GPA(COMDLG32_SHGetDataFromIDListA, SHELL32_hInstance,"SHGetDataFromIDListA");
/* for the first versions of shell32 SHGetFolderPathA is in SHFOLDER.DLL */
COMDLG32_SHGetFolderPathA = (void*)GetProcAddress(SHELL32_hInstance,"SHGetFolderPathA");
if (!COMDLG32_SHGetFolderPathA)
@ -151,42 +101,15 @@ BOOL WINAPI COMDLG32_DllEntryPoint(HINSTANCE hInstance, DWORD Reason, LPVOID Res
GPA(COMDLG32_SHGetFolderPathA, SHFOLDER_hInstance,"SHGetFolderPathA");
}
/* ### WARINIG ###
We can't do a GetProcAddress to link to StrRetToBuf[A|W] sine not all
versions of the shlwapi are exporting these functions. When we are
seperating the dlls then we have to dublicate code from shell32 into comdlg32.
Till then just call these functions. These functions don't have any side effects
so it won't break the use of any combination of native and buildin dll's (jsch) */
/* PATH */
GPA(COMDLG32_PathMatchSpecW, SHLWAPI_hInstance,"PathMatchSpecW");
GPA(COMDLG32_PathIsRootA, SHLWAPI_hInstance,"PathIsRootA");
GPA(COMDLG32_PathRemoveFileSpecA, SHLWAPI_hInstance,"PathRemoveFileSpecA");
GPA(COMDLG32_PathFindFileNameA, SHLWAPI_hInstance,"PathFindFileNameA");
GPA(COMDLG32_PathAddBackslashA, SHLWAPI_hInstance,"PathAddBackslashA");
GPA(COMDLG32_PathCanonicalizeA, SHLWAPI_hInstance,"PathCanonicalizeA");
GPA(COMDLG32_PathGetDriveNumberA, SHLWAPI_hInstance,"PathGetDriveNumberA");
GPA(COMDLG32_PathIsRelativeA, SHLWAPI_hInstance,"PathIsRelativeA");
GPA(COMDLG32_PathFindNextComponentA, SHLWAPI_hInstance,"PathFindNextComponentA");
GPA(COMDLG32_PathAddBackslashW, SHLWAPI_hInstance,"PathAddBackslashW");
GPA(COMDLG32_PathFindExtensionA, SHLWAPI_hInstance,"PathFindExtensionA");
GPA(COMDLG32_PathAddExtensionA, SHLWAPI_hInstance,"PathAddExtensionA");
break;
case DLL_PROCESS_DETACH:
if(!--COMDLG32_Attach)
{
if (COMDLG32_TlsIndex != 0xffffffff)
TlsFree(COMDLG32_TlsIndex);
COMDLG32_TlsIndex = 0xffffffff;
COMDLG32_hInstance = 0;
if(COMDLG32_hInstance16)
FreeLibrary16(COMDLG32_hInstance16);
if(SHFOLDER_hInstance)
FreeLibrary(SHFOLDER_hInstance);
}
break;
if (COMDLG32_TlsIndex != 0xffffffff) TlsFree(COMDLG32_TlsIndex);
COMDLG32_TlsIndex = 0xffffffff;
COMDLG32_hInstance = 0;
if(COMDLG32_hInstance16) FreeLibrary16(COMDLG32_hInstance16);
if(SHFOLDER_hInstance) FreeLibrary(SHFOLDER_hInstance);
break;
}
return TRUE;
}

View File

@ -763,12 +763,12 @@ HRESULT FILEDLG95_HandleCustomDialogMessages(HWND hwnd, UINT uMsg, WPARAM wParam
{
case CDM_GETFILEPATH:
GetDlgItemTextA(hwnd,IDC_FILENAME,lpstrPath, sizeof(lpstrPath));
lpstrFileSpec = (LPSTR)COMDLG32_PathFindFileNameA(lpstrPath);
lpstrFileSpec = (LPSTR)PathFindFileNameA(lpstrPath);
if (lpstrFileSpec==lpstrPath)
{
char lpstrCurrentDir[MAX_PATH];
/* Prepend the current path */
COMDLG32_SHGetPathFromIDListA(fodInfos->ShellInfos.pidlAbsCurrent,lpstrCurrentDir);
SHGetPathFromIDListA(fodInfos->ShellInfos.pidlAbsCurrent,lpstrCurrentDir);
if ((LPSTR)lParam!=NULL)
snprintf((LPSTR)lParam,(int)wParam,"%s\\%s",lpstrCurrentDir,lpstrPath);
reqSize=strlen(lpstrCurrentDir)+1+strlen(lpstrPath)+1;
@ -782,14 +782,14 @@ HRESULT FILEDLG95_HandleCustomDialogMessages(HWND hwnd, UINT uMsg, WPARAM wParam
return reqSize;
case CDM_GETFOLDERPATH:
COMDLG32_SHGetPathFromIDListA(fodInfos->ShellInfos.pidlAbsCurrent,lpstrPath);
SHGetPathFromIDListA(fodInfos->ShellInfos.pidlAbsCurrent,lpstrPath);
if ((LPSTR)lParam!=NULL)
lstrcpynA((LPSTR)lParam,lpstrPath,(int)wParam);
return strlen(lpstrPath);
case CDM_GETSPEC:
reqSize=GetDlgItemTextA(hwnd,IDC_FILENAME,lpstrPath, sizeof(lpstrPath));
lpstrFileSpec = (LPSTR)COMDLG32_PathFindFileNameA(lpstrPath);
lpstrFileSpec = (LPSTR)PathFindFileNameA(lpstrPath);
if ((LPSTR)lParam!=NULL)
lstrcpynA((LPSTR)lParam, lpstrFileSpec, (int)wParam);
return strlen(lpstrFileSpec);
@ -974,7 +974,7 @@ static LRESULT FILEDLG95_InitControls(HWND hwnd)
/* Initialise the file name edit control */
if(fodInfos->ofnInfos->lpstrFile)
{
LPSTR lpstrFile = COMDLG32_PathFindFileNameA(fodInfos->ofnInfos->lpstrFile);
LPSTR lpstrFile = PathFindFileNameA(fodInfos->ofnInfos->lpstrFile);
SetDlgItemTextA(hwnd, IDC_FILENAME, lpstrFile);
}
@ -1175,7 +1175,7 @@ BOOL FILEDLG95_OnOpenMultipleFiles(HWND hwnd, LPSTR lpstrFileList, UINT nFileCou
lpstrFile = fodInfos->ofnInfos->lpstrFile;
lpstrFile[0] = '\0';
COMDLG32_SHGetPathFromIDListA( fodInfos->ShellInfos.pidlAbsCurrent, lpstrPathSpec );
SHGetPathFromIDListA( fodInfos->ShellInfos.pidlAbsCurrent, lpstrPathSpec );
if ( !(fodInfos->ofnInfos->Flags & OFN_NOVALIDATE) &&
( fodInfos->ofnInfos->Flags & OFN_FILEMUSTEXIST))
@ -1288,7 +1288,7 @@ BOOL FILEDLG95_OnOpen(HWND hwnd)
*/
/* Get the current directory name */
if (!COMDLG32_SHGetPathFromIDListA(fodInfos->ShellInfos.pidlAbsCurrent, lpstrPathAndFile))
if (!SHGetPathFromIDListA(fodInfos->ShellInfos.pidlAbsCurrent, lpstrPathAndFile))
{
/* we are in a special folder, default to desktop */
if(FAILED(COMDLG32_SHGetFolderPathA(hwnd, CSIDL_DESKTOPDIRECTORY|CSIDL_FLAG_CREATE, 0, 0, lpstrPathAndFile)))
@ -1297,26 +1297,26 @@ BOOL FILEDLG95_OnOpen(HWND hwnd)
GetCurrentDirectoryA(MAX_PATH, lpstrPathAndFile);
}
}
COMDLG32_PathAddBackslashA(lpstrPathAndFile);
PathAddBackslashA(lpstrPathAndFile);
TRACE("current directory=%s\n", lpstrPathAndFile);
/* if the user specifyed a fully qualified path use it */
if(COMDLG32_PathIsRelativeA(lpstrFileList))
if(PathIsRelativeA(lpstrFileList))
{
strcat(lpstrPathAndFile, lpstrFileList);
}
else
{
/* does the path have a drive letter? */
if (COMDLG32_PathGetDriveNumberA(lpstrFileList) == -1)
if (PathGetDriveNumberA(lpstrFileList) == -1)
strcpy(lpstrPathAndFile+2, lpstrFileList);
else
strcpy(lpstrPathAndFile, lpstrFileList);
}
/* resolve "." and ".." */
COMDLG32_PathCanonicalizeA(lpstrTemp, lpstrPathAndFile );
PathCanonicalizeA(lpstrTemp, lpstrPathAndFile );
strcpy(lpstrPathAndFile, lpstrTemp);
TRACE("canon=%s\n", lpstrPathAndFile);
@ -1349,7 +1349,7 @@ BOOL FILEDLG95_OnOpen(HWND hwnd)
goto ret;
}
if (FAILED (COMDLG32_SHGetDesktopFolder(&lpsf))) return FALSE;
if (FAILED (SHGetDesktopFolder(&lpsf))) return FALSE;
lpszTemp1 = lpszTemp = lpstrPathAndFile;
while (lpszTemp1)
@ -1358,7 +1358,7 @@ BOOL FILEDLG95_OnOpen(HWND hwnd)
WCHAR lpwstrTemp[MAX_PATH];
DWORD dwEaten, dwAttributes;
lpszTemp = COMDLG32_PathFindNextComponentA(lpszTemp);
lpszTemp = PathFindNextComponentA(lpszTemp);
if (!lpszTemp) break; /* end of path */
@ -1384,7 +1384,7 @@ BOOL FILEDLG95_OnOpen(HWND hwnd)
TRACE("parse now=%s next=%s sf=%p\n",debugstr_w(lpwstrTemp), debugstr_a(lpszTemp), lpsf);
if(lstrlenW(lpwstrTemp)==2) COMDLG32_PathAddBackslashW(lpwstrTemp);
if(lstrlenW(lpwstrTemp)==2) PathAddBackslashW(lpwstrTemp);
dwAttributes = SFGAO_FOLDER;
if(SUCCEEDED(IShellFolder_ParseDisplayName(lpsf, hwnd, NULL, lpwstrTemp, &dwEaten, &pidl, &dwAttributes)))
@ -1455,7 +1455,7 @@ BOOL FILEDLG95_OnOpen(HWND hwnd)
TRACE("ONOPEN_SEARCH %s\n", lpstrPathAndFile);
{
int iPos;
LPSTR lpszTemp = COMDLG32_PathFindFileNameA(lpstrPathAndFile);
LPSTR lpszTemp = PathFindFileNameA(lpstrPathAndFile);
DWORD len;
/* replace the current filter */
@ -1499,7 +1499,7 @@ BOOL FILEDLG95_OnOpen(HWND hwnd)
/* add default extension */
if (fodInfos->ofnInfos->lpstrDefExt)
{
if (! *COMDLG32_PathFindExtensionA(lpstrPathAndFile))
if (! *PathFindExtensionA(lpstrPathAndFile))
{
strcat(lpstrPathAndFile, ".");
strcat(lpstrPathAndFile, fodInfos->ofnInfos->lpstrDefExt);
@ -1520,17 +1520,17 @@ BOOL FILEDLG95_OnOpen(HWND hwnd)
+ 1] = '\0';
/* set filename offset */
lpszTemp = COMDLG32_PathFindFileNameA(lpstrPathAndFile);
lpszTemp = PathFindFileNameA(lpstrPathAndFile);
fodInfos->ofnInfos->nFileOffset = lpszTemp - lpstrPathAndFile;
/* set extension offset */
lpszTemp = COMDLG32_PathFindExtensionA(lpstrPathAndFile);
lpszTemp = PathFindExtensionA(lpstrPathAndFile);
fodInfos->ofnInfos->nFileExtension = (*lpszTemp) ? lpszTemp - lpstrPathAndFile + 1 : 0;
/* set the lpstrFileTitle */
if(fodInfos->ofnInfos->lpstrFileTitle)
{
LPSTR lpstrFileTitle = COMDLG32_PathFindFileNameA(lpstrPathAndFile);
LPSTR lpstrFileTitle = PathFindFileNameA(lpstrPathAndFile);
strncpy(fodInfos->ofnInfos->lpstrFileTitle, lpstrFileTitle, fodInfos->ofnInfos->nMaxFileTitle);
}
@ -1675,7 +1675,7 @@ static BOOL FILEDLG95_SHELL_BrowseToDesktop(HWND hwnd)
TRACE("\n");
COMDLG32_SHGetSpecialFolderLocation(0,CSIDL_DESKTOP,&pidl);
SHGetSpecialFolderLocation(0,CSIDL_DESKTOP,&pidl);
hres = IShellBrowser_BrowseObject(fodInfos->Shell.FOIShellBrowser, pidl, SBSP_ABSOLUTE);
COMDLG32_SHFree(pidl);
return SUCCEEDED(hres);
@ -1900,13 +1900,13 @@ static HRESULT FILEDLG95_LOOKIN_Init(HWND hwndCombo)
CBSetItemHeight(hwndCombo,0,GetSystemMetrics(SM_CYSMICON));
/* Initialise data of Desktop folder */
COMDLG32_SHGetSpecialFolderLocation(0,CSIDL_DESKTOP,&pidlTmp);
SHGetSpecialFolderLocation(0,CSIDL_DESKTOP,&pidlTmp);
FILEDLG95_LOOKIN_AddItem(hwndCombo, pidlTmp,LISTEND);
COMDLG32_SHFree(pidlTmp);
COMDLG32_SHGetSpecialFolderLocation(0,CSIDL_DRIVES,&pidlDrives);
SHGetSpecialFolderLocation(0,CSIDL_DRIVES,&pidlDrives);
COMDLG32_SHGetDesktopFolder(&psfRoot);
SHGetDesktopFolder(&psfRoot);
if (psfRoot)
{
@ -1981,7 +1981,7 @@ static LRESULT FILEDLG95_LOOKIN_DrawItem(LPDRAWITEMSTRUCT pDIStruct)
if(pDIStruct->itemID == liInfos->uSelectedItem)
{
ilItemImage = (HIMAGELIST) COMDLG32_SHGetFileInfoA ((LPCSTR) tmpFolder->pidlItem,
ilItemImage = (HIMAGELIST) SHGetFileInfoA ((LPCSTR) tmpFolder->pidlItem,
0,
&sfi,
sizeof (SHFILEINFOA),
@ -1991,7 +1991,7 @@ static LRESULT FILEDLG95_LOOKIN_DrawItem(LPDRAWITEMSTRUCT pDIStruct)
}
else
{
ilItemImage = (HIMAGELIST) COMDLG32_SHGetFileInfoA ((LPCSTR) tmpFolder->pidlItem,
ilItemImage = (HIMAGELIST) SHGetFileInfoA ((LPCSTR) tmpFolder->pidlItem,
0,
&sfi,
sizeof (SHFILEINFOA),
@ -2018,7 +2018,7 @@ static LRESULT FILEDLG95_LOOKIN_DrawItem(LPDRAWITEMSTRUCT pDIStruct)
if(pDIStruct->itemState & ODS_COMBOBOXEDIT)
{
iIndentation = 0;
ilItemImage = (HIMAGELIST) COMDLG32_SHGetFileInfoA ((LPCSTR) tmpFolder->pidlItem,
ilItemImage = (HIMAGELIST) SHGetFileInfoA ((LPCSTR) tmpFolder->pidlItem,
0,
&sfi,
sizeof (SHFILEINFOA),
@ -2048,7 +2048,7 @@ static LRESULT FILEDLG95_LOOKIN_DrawItem(LPDRAWITEMSTRUCT pDIStruct)
(pDIStruct->rcItem.top + pDIStruct->rcItem.bottom + tm.tmHeight) / 2;
/* Draw the icon from the image list */
COMDLG32_ImageList_Draw(ilItemImage,
ImageList_Draw(ilItemImage,
sfi.iIcon,
pDIStruct->hDC,
rectIcon.left,
@ -2139,7 +2139,7 @@ static int FILEDLG95_LOOKIN_AddItem(HWND hwnd,LPITEMIDLIST pidl, int iInsertId)
liInfos->iMaxIndentation = tmpFolder->m_iIndent;
sfi.dwAttributes = SFGAO_FILESYSANCESTOR | SFGAO_FILESYSTEM;
COMDLG32_SHGetFileInfoA((LPSTR)pidl,
SHGetFileInfoA((LPSTR)pidl,
0,
&sfi,
sizeof(sfi),
@ -2629,7 +2629,7 @@ HRESULT GetName(LPSHELLFOLDER lpsf, LPITEMIDLIST pidl,DWORD dwFlags,LPSTR lpstrF
if(!lpsf)
{
HRESULT hRes;
COMDLG32_SHGetDesktopFolder(&lpsf);
SHGetDesktopFolder(&lpsf);
hRes = GetName(lpsf,pidl,dwFlags,lpstrFileName);
IShellFolder_Release(lpsf);
return hRes;
@ -2655,7 +2655,7 @@ IShellFolder *GetShellFolderFromPidl(LPITEMIDLIST pidlAbs)
TRACE("%p\n", pidlAbs);
if(SUCCEEDED(COMDLG32_SHGetDesktopFolder(&psfParent)))
if(SUCCEEDED(SHGetDesktopFolder(&psfParent)))
{
psf = psfParent;
if(pidlAbs && pidlAbs->mkid.cb)
@ -2709,7 +2709,7 @@ LPITEMIDLIST GetPidlFromName(IShellFolder *lpsf,LPCSTR lpcstrFileName)
if(!lpsf)
{
COMDLG32_SHGetDesktopFolder(&lpsf);
SHGetDesktopFolder(&lpsf);
pidl = GetPidlFromName(lpsf, lpcstrFileName);
IShellFolder_Release(lpsf);
}

View File

@ -14,6 +14,7 @@
#include "heap.h"
#include "debugtools.h"
#include "shlwapi.h"
#include "filedlgbrowser.h"
#include "cdlg.h"
#include "shlguid.h"
@ -75,7 +76,7 @@ extern HRESULT SendCustomDlgNotificationMessage(HWND hwndParentDlg, UINT uCode);
static void COMDLG32_UpdateCurrentDir(FileOpenDlgInfos *fodInfos)
{
char lpstrPath[MAX_PATH];
COMDLG32_SHGetPathFromIDListA(fodInfos->ShellInfos.pidlAbsCurrent,lpstrPath);
SHGetPathFromIDListA(fodInfos->ShellInfos.pidlAbsCurrent,lpstrPath);
SetCurrentDirectoryA(lpstrPath);
TRACE("new current folder %s\n", lpstrPath);
}
@ -138,7 +139,7 @@ IShellBrowser * IShellBrowserImpl_Construct(HWND hwndOwner)
sb->lpVtbl = &IShellBrowserImpl_Vtbl;
sb->lpVtblCommDlgBrowser = &IShellBrowserImpl_ICommDlgBrowser_Vtbl;
sb->lpVtblServiceProvider = &IShellBrowserImpl_IServiceProvider_Vtbl;
COMDLG32_SHGetSpecialFolderLocation(hwndOwner, CSIDL_DESKTOP,
SHGetSpecialFolderLocation(hwndOwner, CSIDL_DESKTOP,
&fodInfos->ShellInfos.pidlAbsCurrent);
TRACE("%p\n", sb);
@ -789,7 +790,7 @@ HRESULT WINAPI IShellBrowserImpl_ICommDlgBrowser_IncludeObject(ICommDlgBrowser *
{
if (SUCCEEDED(COMDLG32_StrRetToStrNW(szPathW, MAX_PATH, &str, pidl)))
{
if (COMDLG32_PathMatchSpecW(szPathW, fodInfos->ShellInfos.lpstrCurrentFilter))
if (PathMatchSpecW(szPathW, fodInfos->ShellInfos.lpstrCurrentFilter))
return S_OK;
}
}

View File

@ -233,10 +233,10 @@ static HRESULT WINAPI IExtractIconA_fnExtract(IExtractIconA * iface, LPCSTR pszF
FIXME("(%p) (file=%p index=%u %p %p size=%u) semi-stub\n", This, pszFile, nIconIndex, phiconLarge, phiconSmall, nIconSize);
if (phiconLarge)
*phiconLarge = pImageList_GetIcon(ShellBigIconList, nIconIndex, ILD_TRANSPARENT);
*phiconLarge = ImageList_GetIcon(ShellBigIconList, nIconIndex, ILD_TRANSPARENT);
if (phiconSmall)
*phiconSmall = pImageList_GetIcon(ShellSmallIconList, nIconIndex, ILD_TRANSPARENT);
*phiconSmall = ImageList_GetIcon(ShellSmallIconList, nIconIndex, ILD_TRANSPARENT);
return S_OK;
}

View File

@ -82,8 +82,8 @@ static INT SIC_IconAppend (LPCSTR sSourceFile, INT dwSourceIndex, HICON hSmallIc
}
else
{
index = pImageList_AddIcon (ShellSmallIconList, hSmallIcon);
index1= pImageList_AddIcon (ShellBigIconList, hBigIcon);
index = ImageList_AddIcon (ShellSmallIconList, hSmallIcon);
index1= ImageList_AddIcon (ShellBigIconList, hBigIcon);
if (index!=index1)
{
@ -175,8 +175,8 @@ static HICON WINE_UNUSED SIC_GetIcon (LPCSTR sSourceFile, INT dwSourceIndex, BOO
}
if (bSmallIcon)
return pImageList_GetIcon(ShellSmallIconList, index, ILD_NORMAL);
return pImageList_GetIcon(ShellBigIconList, index, ILD_NORMAL);
return ImageList_GetIcon(ShellSmallIconList, index, ILD_NORMAL);
return ImageList_GetIcon(ShellBigIconList, index, ILD_NORMAL);
}
/*****************************************************************************
@ -203,11 +203,11 @@ BOOL SIC_Initialize(void)
return(FALSE);
}
ShellSmallIconList = pImageList_Create(16,16,ILC_COLORDDB | ILC_MASK,0,0x20);
ShellBigIconList = pImageList_Create(32,32,ILC_COLORDDB | ILC_MASK,0,0x20);
ShellSmallIconList = ImageList_Create(16,16,ILC_COLORDDB | ILC_MASK,0,0x20);
ShellBigIconList = ImageList_Create(32,32,ILC_COLORDDB | ILC_MASK,0,0x20);
pImageList_SetBkColor(ShellSmallIconList, GetSysColor(COLOR_WINDOW));
pImageList_SetBkColor(ShellBigIconList, GetSysColor(COLOR_WINDOW));
ImageList_SetBkColor(ShellSmallIconList, GetSysColor(COLOR_WINDOW));
ImageList_SetBkColor(ShellBigIconList, GetSysColor(COLOR_WINDOW));
for (index=1; index<39; index++)
{

View File

@ -305,7 +305,7 @@ DWORD WINAPI SHGetFileInfoA(LPCSTR path,DWORD dwFileAttributes,
/* icon handle */
if (SUCCEEDED(hr) && (flags & SHGFI_ICON))
psfi->hIcon = pImageList_GetIcon((flags & SHGFI_LARGEICON) ? ShellBigIconList:ShellSmallIconList, psfi->iIcon, ILD_NORMAL);
psfi->hIcon = ImageList_GetIcon((flags & SHGFI_LARGEICON) ? ShellBigIconList:ShellSmallIconList, psfi->iIcon, ILD_NORMAL);
if (flags & (SHGFI_UNKNOWN1 | SHGFI_UNKNOWN2 | SHGFI_UNKNOWN3))
FIXME("unknown attribute!\n");
@ -836,13 +836,6 @@ HRESULT WINAPI SHELL32_DllGetVersion (DLLVERSIONINFO *pdvi)
*
*/
void (WINAPI* pDLLInitComctl)(LPVOID);
INT (WINAPI* pImageList_AddIcon) (HIMAGELIST himl, HICON hIcon);
INT (WINAPI* pImageList_ReplaceIcon) (HIMAGELIST, INT, HICON);
HIMAGELIST (WINAPI * pImageList_Create) (INT,INT,UINT,INT,INT);
BOOL (WINAPI* pImageList_Draw) (HIMAGELIST himl, int i, HDC hdcDest, int x, int y, UINT fStyle);
HICON (WINAPI * pImageList_GetIcon) (HIMAGELIST, INT, UINT);
INT (WINAPI* pImageList_GetImageCount)(HIMAGELIST);
COLORREF (WINAPI *pImageList_SetBkColor)(HIMAGELIST, COLORREF);
LPVOID (WINAPI* pCOMCTL32_Alloc) (INT);
BOOL (WINAPI* pCOMCTL32_Free) (LPVOID);
@ -855,16 +848,10 @@ BOOL (WINAPI* pDPA_Destroy) (const HDPA);
INT (WINAPI *pDPA_Search) (const HDPA, LPVOID, INT, PFNDPACOMPARE, LPARAM, UINT);
LPVOID (WINAPI *pDPA_DeletePtr) (const HDPA hdpa, INT i);
/* user32 */
HICON (WINAPI *pLookupIconIdFromDirectoryEx)(LPBYTE dir, BOOL bIcon, INT width, INT height, UINT cFlag);
HICON (WINAPI *pCreateIconFromResourceEx)(LPBYTE bits,UINT cbSize, BOOL bIcon, DWORD dwVersion, INT width, INT height,UINT cFlag);
static HINSTANCE hComctl32;
static INT shell32_RefCount = 0;
LONG shell32_ObjCount = 0;
HINSTANCE shell32_hInstance = 0;
HMODULE huser32 = 0;
HIMAGELIST ShellSmallIconList = 0;
HIMAGELIST ShellBigIconList = 0;
@ -883,15 +870,11 @@ BOOL WINAPI Shell32LibMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad)
switch (fdwReason)
{
case DLL_PROCESS_ATTACH:
shell32_RefCount++;
if (shell32_hInstance) return TRUE;
shell32_hInstance = hinstDLL;
hComctl32 = GetModuleHandleA("COMCTL32.DLL");
if(!huser32) huser32 = GetModuleHandleA("USER32.DLL");
DisableThreadLibraryCalls(shell32_hInstance);
if (!hComctl32 || !huser32)
if (!hComctl32)
{
ERR("P A N I C SHELL32 loading failed\n");
return FALSE;
@ -899,13 +882,6 @@ BOOL WINAPI Shell32LibMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad)
/* comctl32 */
pDLLInitComctl=(void*)GetProcAddress(hComctl32,"InitCommonControlsEx");
pImageList_Create=(void*)GetProcAddress(hComctl32,"ImageList_Create");
pImageList_AddIcon=(void*)GetProcAddress(hComctl32,"ImageList_AddIcon");
pImageList_ReplaceIcon=(void*)GetProcAddress(hComctl32,"ImageList_ReplaceIcon");
pImageList_GetIcon=(void*)GetProcAddress(hComctl32,"ImageList_GetIcon");
pImageList_GetImageCount=(void*)GetProcAddress(hComctl32,"ImageList_GetImageCount");
pImageList_Draw=(void*)GetProcAddress(hComctl32,"ImageList_Draw");
pImageList_SetBkColor=(void*)GetProcAddress(hComctl32,"ImageList_SetBkColor");
pCOMCTL32_Alloc=(void*)GetProcAddress(hComctl32, (LPCSTR)71L);
pCOMCTL32_Free=(void*)GetProcAddress(hComctl32, (LPCSTR)73L);
pDPA_Create=(void*)GetProcAddress(hComctl32, (LPCSTR)328L);
@ -915,9 +891,6 @@ BOOL WINAPI Shell32LibMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad)
pDPA_DeletePtr=(void*)GetProcAddress(hComctl32, (LPCSTR)336L);
pDPA_Sort=(void*)GetProcAddress(hComctl32, (LPCSTR)338L);
pDPA_Search=(void*)GetProcAddress(hComctl32, (LPCSTR)339L);
/* user32 */
pLookupIconIdFromDirectoryEx=(void*)GetProcAddress(huser32,"LookupIconIdFromDirectoryEx");
pCreateIconFromResourceEx=(void*)GetProcAddress(huser32,"CreateIconFromResourceEx");
/* initialize the common controls */
if (pDLLInitComctl)
@ -932,18 +905,12 @@ BOOL WINAPI Shell32LibMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad)
break;
case DLL_THREAD_ATTACH:
shell32_RefCount++;
break;
case DLL_THREAD_DETACH:
shell32_RefCount--;
break;
case DLL_PROCESS_DETACH:
shell32_RefCount--;
if ( !shell32_RefCount )
{
shell32_hInstance = 0;
if (pdesktopfolder)
@ -960,10 +927,7 @@ BOOL WINAPI Shell32LibMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad)
{
WARN("leaving with %lu objects left (memory leak)\n", shell32_ObjCount);
}
}
TRACE("refcount=%u objcount=%lu \n", shell32_RefCount, shell32_ObjCount);
break;
break;
}
return TRUE;
}

View File

@ -30,13 +30,6 @@ extern HDPA sic_hdpa;
* pointer to functions dynamically loaded
*/
extern void (WINAPI* pDLLInitComctl)(LPVOID);
extern INT (WINAPI* pImageList_AddIcon) (HIMAGELIST himl, HICON hIcon);
extern INT (WINAPI* pImageList_ReplaceIcon) (HIMAGELIST, INT, HICON);
extern HIMAGELIST (WINAPI* pImageList_Create) (INT,INT,UINT,INT,INT);
extern BOOL (WINAPI* pImageList_Draw) (HIMAGELIST himl, int i, HDC hdcDest, int x, int y, UINT fStyle);
extern HICON (WINAPI* pImageList_GetIcon) (HIMAGELIST, INT, UINT);
extern INT (WINAPI* pImageList_GetImageCount)(HIMAGELIST);
extern COLORREF (WINAPI *pImageList_SetBkColor)(HIMAGELIST, COLORREF);
extern LPVOID (WINAPI* pCOMCTL32_Alloc) (INT);
extern BOOL (WINAPI* pCOMCTL32_Free) (LPVOID);
@ -50,9 +43,6 @@ extern INT (WINAPI* pDPA_Search) (const HDPA, LPVOID, INT, PFNDPACOMPARE, LPARAM
extern LPVOID (WINAPI* pDPA_DeletePtr) (const HDPA hdpa, INT i);
#define pDPA_GetPtrCount(hdpa) (*(INT*)(hdpa))
extern HICON (WINAPI *pLookupIconIdFromDirectoryEx)(LPBYTE dir, BOOL bIcon, INT width, INT height, UINT cFlag);
extern HICON (WINAPI *pCreateIconFromResourceEx)(LPBYTE bits,UINT cbSize, BOOL bIcon, DWORD dwVersion, INT width, INT height,UINT cFlag);
/* ole2 */
/*
extern HRESULT (WINAPI* pOleInitialize)(LPVOID reserved);

View File

@ -601,7 +601,7 @@ LRESULT WINAPI FileMenu_DrawItem(
ExtTextOutA (lpdis->hDC, xt , yt, ETO_OPAQUE, &TextRect, pMyItem->szItemText, pMyItem->cchItemText, NULL);
Shell_GetImageList(0, &hImageList);
pImageList_Draw(hImageList, pMyItem->iIconIndex, lpdis->hDC, xi, yi, ILD_NORMAL);
ImageList_Draw(hImageList, pMyItem->iIconIndex, lpdis->hDC, xi, yi, ILD_NORMAL);
TRACE("-- 0x%04x 0x%04x 0x%04x 0x%04x\n", TextRect.left, TextRect.top, TextRect.right, TextRect.bottom);