Commit a0d9ffda authored by Alexandre Julliard's avatar Alexandre Julliard

Removed a few inter-dll dependencies.

parent 8a0808fa
...@@ -5,7 +5,7 @@ VPATH = @srcdir@ ...@@ -5,7 +5,7 @@ VPATH = @srcdir@
MODULE = comdlg32 MODULE = comdlg32
SOVERSION = 1.0 SOVERSION = 1.0
ALTNAMES = commdlg ALTNAMES = commdlg
IMPORTS = shell32 ole32 comctl32 winspool IMPORTS = winspool
WRCEXTRA = -s -pcomdlg32 WRCEXTRA = -s -pcomdlg32
SPEC_SRCS = commdlg.spec comdlg32.spec SPEC_SRCS = commdlg.spec comdlg32.spec
......
...@@ -91,19 +91,8 @@ typedef struct { ...@@ -91,19 +91,8 @@ typedef struct {
#include "wine/undocshell.h" #include "wine/undocshell.h"
#include "shellapi.h" #include "shellapi.h"
/* DPA */
extern HDPA (WINAPI* COMDLG32_DPA_Create) (INT);
extern LPVOID (WINAPI* COMDLG32_DPA_GetPtr) (const HDPA, INT);
extern LPVOID (WINAPI* COMDLG32_DPA_DeleteAllPtrs) (const HDPA hdpa);
extern LPVOID (WINAPI* COMDLG32_DPA_DeletePtr) (const HDPA hdpa, INT i);
extern INT (WINAPI* COMDLG32_DPA_InsertPtr) (const HDPA, INT, LPVOID);
extern BOOL (WINAPI* COMDLG32_DPA_Destroy) (const HDPA);
/* IMAGELIST */ /* IMAGELIST */
extern HICON (WINAPI* COMDLG32_ImageList_GetIcon) (HIMAGELIST, INT, UINT);
extern HIMAGELIST (WINAPI *COMDLG32_ImageList_LoadImageA) (HINSTANCE, LPCSTR, INT, INT, COLORREF, UINT, UINT);
extern BOOL (WINAPI* COMDLG32_ImageList_Draw) (HIMAGELIST himl, int i, HDC hdcDest, int x, int y, UINT fStyle); extern BOOL (WINAPI* COMDLG32_ImageList_Draw) (HIMAGELIST himl, int i, HDC hdcDest, int x, int y, UINT fStyle);
extern BOOL (WINAPI* COMDLG32_ImageList_Destroy) (HIMAGELIST himl);
/* ITEMIDLIST */ /* ITEMIDLIST */
...@@ -118,6 +107,7 @@ extern BOOL (WINAPI *COMDLG32_SHGetPathFromIDListA) (LPCITEMIDLIST,LPSTR); ...@@ -118,6 +107,7 @@ extern BOOL (WINAPI *COMDLG32_SHGetPathFromIDListA) (LPCITEMIDLIST,LPSTR);
extern HRESULT (WINAPI *COMDLG32_SHGetSpecialFolderLocation)(HWND,INT,LPITEMIDLIST *); extern HRESULT (WINAPI *COMDLG32_SHGetSpecialFolderLocation)(HWND,INT,LPITEMIDLIST *);
extern DWORD (WINAPI *COMDLG32_SHGetDesktopFolder)(IShellFolder **); extern DWORD (WINAPI *COMDLG32_SHGetDesktopFolder)(IShellFolder **);
extern DWORD (WINAPI *COMDLG32_SHGetFileInfoA)(LPCSTR,DWORD,SHFILEINFOA*,UINT,UINT); extern DWORD (WINAPI *COMDLG32_SHGetFileInfoA)(LPCSTR,DWORD,SHFILEINFOA*,UINT,UINT);
extern LPVOID (WINAPI *COMDLG32_SHAlloc)(DWORD);
extern DWORD (WINAPI *COMDLG32_SHFree)(LPVOID); extern DWORD (WINAPI *COMDLG32_SHFree)(LPVOID);
/* PATH */ /* PATH */
......
...@@ -25,19 +25,8 @@ HINSTANCE COMCTL32_hInstance = 0; ...@@ -25,19 +25,8 @@ HINSTANCE COMCTL32_hInstance = 0;
HINSTANCE SHELL32_hInstance = 0; HINSTANCE SHELL32_hInstance = 0;
HINSTANCE SHLWAPI_hInstance = 0; HINSTANCE SHLWAPI_hInstance = 0;
/* DPA */
HDPA (WINAPI* COMDLG32_DPA_Create) (INT);
LPVOID (WINAPI* COMDLG32_DPA_GetPtr) (const HDPA, INT);
LPVOID (WINAPI* COMDLG32_DPA_DeletePtr) (const HDPA hdpa, INT i);
LPVOID (WINAPI* COMDLG32_DPA_DeleteAllPtrs) (const HDPA hdpa);
INT (WINAPI* COMDLG32_DPA_InsertPtr) (const HDPA, INT, LPVOID);
BOOL (WINAPI* COMDLG32_DPA_Destroy) (const HDPA);
/* IMAGELIST */ /* IMAGELIST */
HICON (WINAPI* COMDLG32_ImageList_GetIcon) (HIMAGELIST, INT, UINT);
HIMAGELIST (WINAPI *COMDLG32_ImageList_LoadImageA) (HINSTANCE, LPCSTR, INT, INT, COLORREF, UINT, UINT);
BOOL (WINAPI* COMDLG32_ImageList_Draw) (HIMAGELIST himl, int i, HDC hdcDest, int x, int y, UINT fStyle); BOOL (WINAPI* COMDLG32_ImageList_Draw) (HIMAGELIST himl, int i, HDC hdcDest, int x, int y, UINT fStyle);
BOOL (WINAPI* COMDLG32_ImageList_Destroy) (HIMAGELIST himl);
/* ITEMIDLIST */ /* ITEMIDLIST */
LPITEMIDLIST (WINAPI *COMDLG32_PIDL_ILClone) (LPCITEMIDLIST); LPITEMIDLIST (WINAPI *COMDLG32_PIDL_ILClone) (LPCITEMIDLIST);
...@@ -51,7 +40,10 @@ BOOL (WINAPI *COMDLG32_SHGetPathFromIDListA) (LPCITEMIDLIST,LPSTR); ...@@ -51,7 +40,10 @@ BOOL (WINAPI *COMDLG32_SHGetPathFromIDListA) (LPCITEMIDLIST,LPSTR);
HRESULT (WINAPI *COMDLG32_SHGetSpecialFolderLocation)(HWND,INT,LPITEMIDLIST *); HRESULT (WINAPI *COMDLG32_SHGetSpecialFolderLocation)(HWND,INT,LPITEMIDLIST *);
DWORD (WINAPI *COMDLG32_SHGetDesktopFolder)(IShellFolder **); DWORD (WINAPI *COMDLG32_SHGetDesktopFolder)(IShellFolder **);
DWORD (WINAPI *COMDLG32_SHGetFileInfoA)(LPCSTR,DWORD,SHFILEINFOA*,UINT,UINT); DWORD (WINAPI *COMDLG32_SHGetFileInfoA)(LPCSTR,DWORD,SHFILEINFOA*,UINT,UINT);
LPVOID (WINAPI *COMDLG32_SHAlloc)(DWORD);
DWORD (WINAPI *COMDLG32_SHFree)(LPVOID); DWORD (WINAPI *COMDLG32_SHFree)(LPVOID);
HRESULT (WINAPI *COMDLG32_StrRetToBufA)(LPSTRRET,LPITEMIDLIST,LPSTR,DWORD);
HRESULT (WINAPI *COMDLG32_StrRetToBufW)(LPSTRRET,LPITEMIDLIST,LPWSTR,DWORD);
/* PATH */ /* PATH */
BOOL (WINAPI *COMDLG32_PathIsRootA)(LPCSTR x); BOOL (WINAPI *COMDLG32_PathIsRootA)(LPCSTR x);
...@@ -115,19 +107,9 @@ BOOL WINAPI COMDLG32_DllEntryPoint(HINSTANCE hInstance, DWORD Reason, LPVOID Res ...@@ -115,19 +107,9 @@ BOOL WINAPI COMDLG32_DllEntryPoint(HINSTANCE hInstance, DWORD Reason, LPVOID Res
ERR("loading of comctl32 or shell32 or shlwapi failed\n"); ERR("loading of comctl32 or shell32 or shlwapi failed\n");
return FALSE; return FALSE;
} }
/* DPA */
COMDLG32_DPA_Create=(void*)GetProcAddress(COMCTL32_hInstance, (LPCSTR)328L);
COMDLG32_DPA_Destroy=(void*)GetProcAddress(COMCTL32_hInstance, (LPCSTR)329L);
COMDLG32_DPA_GetPtr=(void*)GetProcAddress(COMCTL32_hInstance, (LPCSTR)332L);
COMDLG32_DPA_InsertPtr=(void*)GetProcAddress(COMCTL32_hInstance, (LPCSTR)334L);
COMDLG32_DPA_DeletePtr=(void*)GetProcAddress(COMCTL32_hInstance, (LPCSTR)336L);
COMDLG32_DPA_DeleteAllPtrs=(void*)GetProcAddress(COMCTL32_hInstance, (LPCSTR)337L);
/* IMAGELIST */ /* IMAGELIST */
COMDLG32_ImageList_GetIcon=(void*)GetProcAddress(COMCTL32_hInstance,"ImageList_GetIcon");
COMDLG32_ImageList_LoadImageA=(void*)GetProcAddress(COMCTL32_hInstance,"ImageList_LoadImageA");
COMDLG32_ImageList_Draw=(void*)GetProcAddress(COMCTL32_hInstance,"ImageList_Draw"); COMDLG32_ImageList_Draw=(void*)GetProcAddress(COMCTL32_hInstance,"ImageList_Draw");
COMDLG32_ImageList_Destroy=(void*)GetProcAddress(COMCTL32_hInstance,"ImageList_Destroy");
/* ITEMISLIST */ /* ITEMISLIST */
...@@ -139,6 +121,7 @@ BOOL WINAPI COMDLG32_DllEntryPoint(HINSTANCE hInstance, DWORD Reason, LPVOID Res ...@@ -139,6 +121,7 @@ BOOL WINAPI COMDLG32_DllEntryPoint(HINSTANCE hInstance, DWORD Reason, LPVOID Res
/* SHELL */ /* SHELL */
COMDLG32_SHAlloc = (void*)GetProcAddress(SHELL32_hInstance, (LPCSTR)196L);
COMDLG32_SHFree = (void*)GetProcAddress(SHELL32_hInstance, (LPCSTR)195L); COMDLG32_SHFree = (void*)GetProcAddress(SHELL32_hInstance, (LPCSTR)195L);
COMDLG32_SHGetSpecialFolderLocation = (void*)GetProcAddress(SHELL32_hInstance,"SHGetSpecialFolderLocation"); COMDLG32_SHGetSpecialFolderLocation = (void*)GetProcAddress(SHELL32_hInstance,"SHGetSpecialFolderLocation");
COMDLG32_SHGetPathFromIDListA = (void*)GetProcAddress(SHELL32_hInstance,"SHGetPathFromIDListA"); COMDLG32_SHGetPathFromIDListA = (void*)GetProcAddress(SHELL32_hInstance,"SHGetPathFromIDListA");
......
...@@ -148,8 +148,8 @@ LPITEMIDLIST GetParentPidl(LPITEMIDLIST pidl); ...@@ -148,8 +148,8 @@ LPITEMIDLIST GetParentPidl(LPITEMIDLIST pidl);
LPITEMIDLIST GetPidlFromName(IShellFolder *psf,LPCSTR lpcstrFileName); LPITEMIDLIST GetPidlFromName(IShellFolder *psf,LPCSTR lpcstrFileName);
/* Shell memory allocation */ /* Shell memory allocation */
void *MemAlloc(UINT size); static void *MemAlloc(UINT size);
void MemFree(void *mem); static void MemFree(void *mem);
BOOL WINAPI GetFileName95(FileOpenDlgInfos *fodInfos); BOOL WINAPI GetFileName95(FileOpenDlgInfos *fodInfos);
HRESULT WINAPI FileOpenDlgProc95(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam); HRESULT WINAPI FileOpenDlgProc95(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
...@@ -835,9 +835,6 @@ static LRESULT FILEDLG95_OnWMInitDialog(HWND hwnd, WPARAM wParam, LPARAM lParam) ...@@ -835,9 +835,6 @@ static LRESULT FILEDLG95_OnWMInitDialog(HWND hwnd, WPARAM wParam, LPARAM lParam)
TRACE("\n"); TRACE("\n");
/* Make sure the common control DLL is loaded */
InitCommonControls();
/* Initialise shell objects */ /* Initialise shell objects */
FILEDLG95_SHELL_Init(hwnd); FILEDLG95_SHELL_Init(hwnd);
...@@ -2303,6 +2300,35 @@ static void FILEDLG95_LOOKIN_Clean(HWND hwnd) ...@@ -2303,6 +2300,35 @@ static void FILEDLG95_LOOKIN_Clean(HWND hwnd)
* TOOLS * TOOLS
*/ */
/* copied from shell32 to avoid linking to it */
static HRESULT COMDLG32_StrRetToStrNA (LPVOID dest, DWORD len, LPSTRRET src, LPITEMIDLIST pidl)
{
switch (src->uType)
{
case STRRET_WSTR:
WideCharToMultiByte(CP_ACP, 0, src->u.pOleStr, -1, (LPSTR)dest, len, NULL, NULL);
COMDLG32_SHFree(src->u.pOleStr);
break;
case STRRET_CSTRA:
lstrcpynA((LPSTR)dest, src->u.cStr, len);
break;
case STRRET_OFFSETA:
lstrcpynA((LPSTR)dest, ((LPCSTR)&pidl->mkid)+src->u.uOffset, len);
break;
default:
FIXME("unknown type!\n");
if (len)
{
*(LPSTR)dest = '\0';
}
return(FALSE);
}
return S_OK;
}
/*********************************************************************** /***********************************************************************
* GetName * GetName
* *
...@@ -2335,7 +2361,7 @@ HRESULT GetName(LPSHELLFOLDER lpsf, LPITEMIDLIST pidl,DWORD dwFlags,LPSTR lpstrF ...@@ -2335,7 +2361,7 @@ HRESULT GetName(LPSHELLFOLDER lpsf, LPITEMIDLIST pidl,DWORD dwFlags,LPSTR lpstrF
dwFlags, dwFlags,
&str))) &str)))
{ {
return StrRetToBufA(&str, pidl,lpstrFileName, MAX_PATH); return COMDLG32_StrRetToStrNA(lpstrFileName, MAX_PATH, &str, pidl);
} }
return E_FAIL; return E_FAIL;
} }
...@@ -2446,12 +2472,12 @@ BOOL GetFileExtension(IShellFolder *psf,LPITEMIDLIST pidl,LPSTR lpstrFileExtensi ...@@ -2446,12 +2472,12 @@ BOOL GetFileExtension(IShellFolder *psf,LPITEMIDLIST pidl,LPSTR lpstrFileExtensi
/* /*
* Memory allocation methods */ * Memory allocation methods */
void *MemAlloc(UINT size) static void *MemAlloc(UINT size)
{ {
return HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,size); return HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,size);
} }
void MemFree(void *mem) static void MemFree(void *mem)
{ {
if(mem) if(mem)
{ {
......
...@@ -108,7 +108,7 @@ IShellBrowser * IShellBrowserImpl_Construct(HWND hwndOwner) ...@@ -108,7 +108,7 @@ IShellBrowser * IShellBrowserImpl_Construct(HWND hwndOwner)
IShellBrowserImpl *sb; IShellBrowserImpl *sb;
FileOpenDlgInfos *fodInfos = (FileOpenDlgInfos *) GetPropA(hwndOwner,FileOpenDlgInfosStr); FileOpenDlgInfos *fodInfos = (FileOpenDlgInfos *) GetPropA(hwndOwner,FileOpenDlgInfosStr);
sb=(IShellBrowserImpl*)SHAlloc(sizeof(IShellBrowserImpl)); sb=(IShellBrowserImpl*)COMDLG32_SHAlloc(sizeof(IShellBrowserImpl));
/* Initialisation of the member variables */ /* Initialisation of the member variables */
sb->ref=1; sb->ref=1;
...@@ -704,6 +704,39 @@ HRESULT WINAPI IShellBrowserImpl_ICommDlgBrowser_OnStateChange(ICommDlgBrowser * ...@@ -704,6 +704,39 @@ HRESULT WINAPI IShellBrowserImpl_ICommDlgBrowser_OnStateChange(ICommDlgBrowser *
return NOERROR; return NOERROR;
} }
/* copied from shell32 to avoid linking to it */
static HRESULT COMDLG32_StrRetToStrNW (LPVOID dest, DWORD len, LPSTRRET src, LPITEMIDLIST pidl)
{
TRACE("dest=0x%p len=0x%lx strret=0x%p pidl=%p stub\n",dest,len,src,pidl);
switch (src->uType)
{
case STRRET_WSTR:
lstrcpynW((LPWSTR)dest, src->u.pOleStr, len);
COMDLG32_SHFree(src->u.pOleStr);
break;
case STRRET_CSTRA:
lstrcpynAtoW((LPWSTR)dest, src->u.cStr, len);
break;
case STRRET_OFFSETA:
if (pidl)
{
lstrcpynAtoW((LPWSTR)dest, ((LPCSTR)&pidl->mkid)+src->u.uOffset, len);
}
break;
default:
FIXME("unknown type!\n");
if (len)
{ *(LPSTR)dest = '\0';
}
return(FALSE);
}
return S_OK;
}
/************************************************************************** /**************************************************************************
* IShellBrowserImpl_ICommDlgBrowser_IncludeObject * IShellBrowserImpl_ICommDlgBrowser_IncludeObject
*/ */
...@@ -738,7 +771,7 @@ HRESULT WINAPI IShellBrowserImpl_ICommDlgBrowser_IncludeObject(ICommDlgBrowser * ...@@ -738,7 +771,7 @@ HRESULT WINAPI IShellBrowserImpl_ICommDlgBrowser_IncludeObject(ICommDlgBrowser *
return S_OK; return S_OK;
if (SUCCEEDED(IShellFolder_GetDisplayNameOf(fodInfos->Shell.FOIShellFolder, pidl, SHGDN_FORPARSING, &str))) if (SUCCEEDED(IShellFolder_GetDisplayNameOf(fodInfos->Shell.FOIShellFolder, pidl, SHGDN_FORPARSING, &str)))
{ if (SUCCEEDED(StrRetToBufW(&str, pidl,szPathW, MAX_PATH))) { if (SUCCEEDED(COMDLG32_StrRetToStrNW(szPathW, MAX_PATH, &str, pidl)))
{ {
if (COMDLG32_PathMatchSpecW(szPathW, fodInfos->ShellInfos.lpstrCurrentFilter)) if (COMDLG32_PathMatchSpecW(szPathW, fodInfos->ShellInfos.lpstrCurrentFilter))
return S_OK; return S_OK;
......
...@@ -318,7 +318,7 @@ BOOL WINAPI PrintDlgW( LPPRINTDLGW printdlg ) ...@@ -318,7 +318,7 @@ BOOL WINAPI PrintDlgW( LPPRINTDLGW printdlg )
/*********************************************************************** /***********************************************************************
* PRINTDLG_UpdatePrinterInfoTexts [internal] * PRINTDLG_UpdatePrinterInfoTexts [internal]
*/ */
void PRINTDLG_UpdatePrinterInfoTexts(HWND hDlg, PRINT_PTRA* PrintStructures) static void PRINTDLG_UpdatePrinterInfoTexts(HWND hDlg, PRINT_PTRA* PrintStructures)
{ {
char StatusMsg[256]; char StatusMsg[256];
char ResourceString[256]; char ResourceString[256];
...@@ -382,7 +382,7 @@ void PRINTDLG_UpdatePrinterInfoTexts(HWND hDlg, PRINT_PTRA* PrintStructures) ...@@ -382,7 +382,7 @@ void PRINTDLG_UpdatePrinterInfoTexts(HWND hDlg, PRINT_PTRA* PrintStructures)
* but on ID value, as some drivers name the same paper format * but on ID value, as some drivers name the same paper format
* differently (language differences, added paper size) * differently (language differences, added paper size)
*/ */
short PRINTSETUP32DLG_UpdateComboBox(HWND hDlg, static short PRINTSETUP32DLG_UpdateComboBox(HWND hDlg,
int nIDComboBox, int nIDComboBox,
char* PrinterName, char* PrinterName,
char* PortName) char* PortName)
...@@ -702,7 +702,7 @@ static LRESULT PRINTSETUP32DLG_WMInitDialog(HWND hDlg, WPARAM wParam, ...@@ -702,7 +702,7 @@ static LRESULT PRINTSETUP32DLG_WMInitDialog(HWND hDlg, WPARAM wParam,
* HGLOBAL to DevNames memory object on success or * HGLOBAL to DevNames memory object on success or
* zero on faillure * zero on faillure
*/ */
HGLOBAL PRINTDLG_CreateDevNames( static HGLOBAL PRINTDLG_CreateDevNames(
char* DeviceDriverName, char* DeviceDriverName,
char* DeviceName, char* DeviceName,
char* OutputPort, char* OutputPort,
......
...@@ -5,7 +5,7 @@ VPATH = @srcdir@ ...@@ -5,7 +5,7 @@ VPATH = @srcdir@
MODULE = shell32 MODULE = shell32
SOVERSION = 1.0 SOVERSION = 1.0
ALTNAMES = shell shlwapi ALTNAMES = shell shlwapi
IMPORTS = ole32 comctl32 IMPORTS = ole32
WRCEXTRA = -s -p$(MODULE) WRCEXTRA = -s -p$(MODULE)
SPEC_SRCS = \ SPEC_SRCS = \
......
...@@ -599,7 +599,7 @@ static HRESULT ShellView_FillList(IShellViewImpl * This) ...@@ -599,7 +599,7 @@ static HRESULT ShellView_FillList(IShellViewImpl * This)
for (i=0; i < DPA_GetPtrCount(hdpa); ++i) /* DPA_GetPtrCount is a macro*/ for (i=0; i < DPA_GetPtrCount(hdpa); ++i) /* DPA_GetPtrCount is a macro*/
{ {
pidl = (LPITEMIDLIST)DPA_GetPtr(hdpa, i); pidl = (LPITEMIDLIST)pDPA_GetPtr(hdpa, i);
/* in a commdlg This works as a filemask*/ /* in a commdlg This works as a filemask*/
if ( IncludeObject(This, pidl)==S_OK ) if ( IncludeObject(This, pidl)==S_OK )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment