Commit fb2eca81 authored by Alexandre Julliard's avatar Alexandre Julliard

Import comctl32 functions from shell32 by ordinal.

Removed some unnecessary ordinals in comctl32.spec.
parent d97432ac
......@@ -95,7 +95,7 @@ static INT SIC_IconAppend (LPCSTR sSourceFile, INT dwSourceIndex, HICON hSmallIc
EnterCriticalSection(&SHELL32_SicCS);
index = pDPA_InsertPtr(sic_hdpa, 0x7fff, lpsice);
index = DPA_InsertPtr(sic_hdpa, 0x7fff, lpsice);
if ( INVALID_INDEX == index )
{
SHFree(lpsice);
......@@ -159,10 +159,10 @@ INT SIC_GetIconIndex (LPCSTR sSourceFile, INT dwSourceIndex )
EnterCriticalSection(&SHELL32_SicCS);
if (NULL != pDPA_GetPtr (sic_hdpa, 0))
if (NULL != DPA_GetPtr (sic_hdpa, 0))
{
/* search linear from position 0*/
index = pDPA_Search (sic_hdpa, &sice, 0, SIC_CompareEntries, 0, 0);
index = DPA_Search (sic_hdpa, &sice, 0, SIC_CompareEntries, 0, 0);
}
if ( INVALID_INDEX == index )
......@@ -172,7 +172,7 @@ INT SIC_GetIconIndex (LPCSTR sSourceFile, INT dwSourceIndex )
else
{
TRACE("-- found\n");
ret = ((LPSIC_ENTRY)pDPA_GetPtr(sic_hdpa, index))->dwListIndex;
ret = ((LPSIC_ENTRY)DPA_GetPtr(sic_hdpa, index))->dwListIndex;
}
LeaveCriticalSection(&SHELL32_SicCS);
......@@ -218,7 +218,7 @@ BOOL SIC_Initialize(void)
if (sic_hdpa) /* already initialized?*/
return TRUE;
sic_hdpa = pDPA_Create(16);
sic_hdpa = DPA_Create(16);
if (!sic_hdpa)
{
......@@ -262,14 +262,14 @@ void SIC_Destroy(void)
EnterCriticalSection(&SHELL32_SicCS);
if (sic_hdpa && NULL != pDPA_GetPtr (sic_hdpa, 0))
if (sic_hdpa && NULL != DPA_GetPtr (sic_hdpa, 0))
{
for (i=0; i < pDPA_GetPtrCount(sic_hdpa); ++i)
for (i=0; i < DPA_GetPtrCount(sic_hdpa); ++i)
{
lpsice = pDPA_GetPtr(sic_hdpa, i);
lpsice = DPA_GetPtr(sic_hdpa, i);
SHFree(lpsice);
}
pDPA_Destroy(sic_hdpa);
DPA_Destroy(sic_hdpa);
}
sic_hdpa = NULL;
......
......@@ -42,6 +42,9 @@
WINE_DEFAULT_DEBUG_CHANNEL(pidl);
WINE_DECLARE_DEBUG_CHANNEL(shell);
/* from comctl32.dll */
extern LPVOID WINAPI Alloc(INT);
extern BOOL WINAPI Free(LPVOID);
/*************************************************************************
* ILGetDisplayName [SHELL32.15]
......@@ -297,7 +300,7 @@ LPITEMIDLIST WINAPI ILGlobalClone(LPCITEMIDLIST pidl)
return NULL;
len = ILGetSize(pidl);
newpidl = (LPITEMIDLIST)pCOMCTL32_Alloc(len);
newpidl = (LPITEMIDLIST)Alloc(len);
if (newpidl)
memcpy(newpidl,pidl,len);
......@@ -640,7 +643,7 @@ void WINAPI ILGlobalFree( LPCITEMIDLIST pidl)
TRACE("%p\n",pidl);
if(!pidl) return;
pCOMCTL32_Free(pidl);
Free(pidl);
}
/*************************************************************************
* ILCreateFromPath [SHELL32.157]
......
......@@ -908,13 +908,6 @@ void (WINAPI *pDLLInitComctl)(LPVOID);
LPVOID (WINAPI *pCOMCTL32_Alloc) (INT);
BOOL (WINAPI *pCOMCTL32_Free) (LPVOID);
HDPA (WINAPI *pDPA_Create) (INT);
INT (WINAPI *pDPA_InsertPtr) (const HDPA, INT, LPVOID);
BOOL (WINAPI *pDPA_Sort) (const HDPA, PFNDPACOMPARE, LPARAM);
LPVOID (WINAPI *pDPA_GetPtr) (const HDPA, INT);
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);
HANDLE (WINAPI *pCreateMRUListA) (LPVOID lpcml);
DWORD (WINAPI *pFreeMRUListA) (HANDLE hMRUList);
INT (WINAPI *pAddMRUData) (HANDLE hList, LPCVOID lpData, DWORD cbData);
......@@ -954,21 +947,6 @@ BOOL WINAPI Shell32LibMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad)
/* comctl32 */
pDLLInitComctl=(void*)GetProcAddress(hComctl32,"InitCommonControlsEx");
pCOMCTL32_Alloc=(void*)GetProcAddress(hComctl32, (LPCSTR)71L);
pCOMCTL32_Free=(void*)GetProcAddress(hComctl32, (LPCSTR)73L);
pDPA_Create=(void*)GetProcAddress(hComctl32, (LPCSTR)328L);
pDPA_Destroy=(void*)GetProcAddress(hComctl32, (LPCSTR)329L);
pDPA_GetPtr=(void*)GetProcAddress(hComctl32, (LPCSTR)332L);
pDPA_InsertPtr=(void*)GetProcAddress(hComctl32, (LPCSTR)334L);
pDPA_DeletePtr=(void*)GetProcAddress(hComctl32, (LPCSTR)336L);
pDPA_Sort=(void*)GetProcAddress(hComctl32, (LPCSTR)338L);
pDPA_Search=(void*)GetProcAddress(hComctl32, (LPCSTR)339L);
pCreateMRUListA=(void*)GetProcAddress(hComctl32, (LPCSTR)151L /*"CreateMRUListA"*/);
pFreeMRUListA=(void*)GetProcAddress(hComctl32, (LPCSTR)152L /*"FreeMRUList"*/);
pAddMRUData=(void*)GetProcAddress(hComctl32, (LPCSTR)167L /*"AddMRUData"*/);
pFindMRUData=(void*)GetProcAddress(hComctl32, (LPCSTR)169L /*"FindMRUData"*/);
pEnumMRUListA=(void*)GetProcAddress(hComctl32, (LPCSTR)154L /*"EnumMRUListA"*/);
/* initialize the common controls */
if (pDLLInitComctl)
{
......
......@@ -47,24 +47,6 @@ extern HDPA sic_hdpa;
*/
extern void (WINAPI *pDLLInitComctl)(LPVOID);
extern LPVOID (WINAPI *pCOMCTL32_Alloc) (INT);
extern BOOL (WINAPI *pCOMCTL32_Free) (LPVOID);
extern HDPA (WINAPI *pDPA_Create) (INT);
extern INT (WINAPI *pDPA_InsertPtr) (const HDPA, INT, LPVOID);
extern BOOL (WINAPI *pDPA_Sort) (const HDPA, PFNDPACOMPARE, LPARAM);
extern LPVOID (WINAPI *pDPA_GetPtr) (const HDPA, INT);
extern BOOL (WINAPI *pDPA_Destroy) (const HDPA);
extern INT (WINAPI *pDPA_Search) (const HDPA, LPVOID, INT, PFNDPACOMPARE, LPARAM, UINT);
extern LPVOID (WINAPI *pDPA_DeletePtr) (const HDPA hdpa, INT i);
extern HANDLE (WINAPI *pCreateMRUListA) (LPVOID lpcml);
extern DWORD (WINAPI *pFreeMRUListA) (HANDLE hMRUList);
extern INT (WINAPI *pAddMRUData) (HANDLE hList, LPCVOID lpData, DWORD cbData);
extern INT (WINAPI *pFindMRUData) (HANDLE hList, LPCVOID lpData, DWORD cbData, LPINT lpRegNum);
extern INT (WINAPI *pEnumMRUListA) (HANDLE hList, INT nItemPos, LPVOID lpBuffer, DWORD nBufferSize);
#define pDPA_GetPtrCount(hdpa) (*(INT*)(hdpa))
BOOL WINAPI Shell_GetImageList(HIMAGELIST * lpBigList, HIMAGELIST * lpSmallList);
/* Iconcache */
......
......@@ -40,6 +40,29 @@
WINE_DEFAULT_DEBUG_CHANNEL(shell);
WINE_DECLARE_DEBUG_CHANNEL(pidl);
/* FIXME: !!! move CREATEMRULIST and flags to header file !!! */
/* !!! it is in both here and comctl32undoc.c !!! */
typedef struct tagCREATEMRULIST
{
DWORD cbSize; /* size of struct */
DWORD nMaxItems; /* max no. of items in list */
DWORD dwFlags; /* see below */
HKEY hKey; /* root reg. key under which list is saved */
LPCSTR lpszSubKey; /* reg. subkey */
PROC lpfnCompare; /* item compare proc */
} CREATEMRULISTA, *LPCREATEMRULISTA;
/* dwFlags */
#define MRUF_STRING_LIST 0 /* list will contain strings */
#define MRUF_BINARY_LIST 1 /* list will contain binary data */
#define MRUF_DELAYED_SAVE 2 /* only save list order to reg. is FreeMRUList */
extern HANDLE WINAPI CreateMRUListA(LPCREATEMRULISTA lpcml);
extern DWORD WINAPI FreeMRUList(HANDLE hMRUList);
extern INT WINAPI AddMRUData(HANDLE hList, LPCVOID lpData, DWORD cbData);
extern INT WINAPI FindMRUData(HANDLE hList, LPCVOID lpData, DWORD cbData, LPINT lpRegNum);
extern INT WINAPI EnumMRUListA(HANDLE hList, INT nItemPos, LPVOID lpBuffer, DWORD nBufferSize);
/*************************************************************************
* ParseFieldA [internal]
*
......@@ -526,7 +549,7 @@ static INT SHADD_create_add_mru_data(HANDLE mruhandle, LPSTR doc_name, LPSTR new
/* Add the new entry into the MRU list
*/
return pAddMRUData(mruhandle, (LPCVOID)buffer, *len);
return AddMRUData(mruhandle, (LPCVOID)buffer, *len);
}
/*************************************************************************
......@@ -543,24 +566,6 @@ static INT SHADD_create_add_mru_data(HANDLE mruhandle, LPSTR doc_name, LPSTR new
*/
DWORD WINAPI SHAddToRecentDocs (UINT uFlags,LPCVOID pv)
{
/* FIXME: !!! move CREATEMRULIST and flags to header file !!! */
/* !!! it is in both here and comctl32undoc.c !!! */
typedef struct tagCREATEMRULIST
{
DWORD cbSize; /* size of struct */
DWORD nMaxItems; /* max no. of items in list */
DWORD dwFlags; /* see below */
HKEY hKey; /* root reg. key under which list is saved */
LPCSTR lpszSubKey; /* reg. subkey */
PROC lpfnCompare; /* item compare proc */
} CREATEMRULIST, *LPCREATEMRULIST;
/* dwFlags */
#define MRUF_STRING_LIST 0 /* list will contain strings */
#define MRUF_BINARY_LIST 1 /* list will contain binary data */
#define MRUF_DELAYED_SAVE 2 /* only save list order to reg. is FreeMRUList */
/* If list is a string list lpfnCompare has the following prototype
* int CALLBACK MRUCompareString(LPCSTR s1, LPCSTR s2)
* for binary lists the prototype is
......@@ -709,7 +714,7 @@ typedef struct tagCREATEMRULIST
* new_lnk_filepath
* - path and file name of new .lnk file
*/
CREATEMRULIST mymru;
CREATEMRULISTA mymru;
HANDLE mruhandle;
INT len, pos, bufused, err;
INT i;
......@@ -719,13 +724,13 @@ typedef struct tagCREATEMRULIST
CHAR old_lnk_name[MAX_PATH];
short int slen;
mymru.cbSize = sizeof(CREATEMRULIST);
mymru.cbSize = sizeof(CREATEMRULISTA);
mymru.nMaxItems = 15;
mymru.dwFlags = MRUF_BINARY_LIST | MRUF_DELAYED_SAVE;
mymru.hKey = HCUbasekey;
mymru.lpszSubKey = "RecentDocs";
mymru.lpfnCompare = &SHADD_compare_mru;
mruhandle = pCreateMRUListA(&mymru);
mruhandle = CreateMRUListA(&mymru);
if (!mruhandle) {
/* MRU failed */
ERR("MRU processing failed, handle zero\n");
......@@ -733,12 +738,12 @@ typedef struct tagCREATEMRULIST
return 0;
}
len = lstrlenA(doc_name);
pos = pFindMRUData(mruhandle, doc_name, len, 0);
pos = FindMRUData(mruhandle, doc_name, len, 0);
/* Now get the MRU entry that will be replaced
* and delete the .lnk file for it
*/
if ((bufused = pEnumMRUListA(mruhandle, (pos == -1) ? 14 : pos,
if ((bufused = EnumMRUListA(mruhandle, (pos == -1) ? 14 : pos,
buffer, 2048)) != -1) {
ptr = buffer;
ptr += (lstrlenA(buffer) + 1);
......@@ -795,7 +800,7 @@ typedef struct tagCREATEMRULIST
*/
pos = SHADD_create_add_mru_data(mruhandle, doc_name, new_lnk_name,
buffer, &len);
pFreeMRUListA(mruhandle);
FreeMRUList(mruhandle);
TRACE("Updated MRU list, new doc is position %d\n", pos);
}
......
......@@ -577,7 +577,7 @@ static HRESULT ShellView_FillList(IShellViewImpl * This)
}
/* create a pointer array */
hdpa = pDPA_Create(16);
hdpa = DPA_Create(16);
if (!hdpa)
{
return(E_OUTOFMEMORY);
......@@ -586,21 +586,21 @@ static HRESULT ShellView_FillList(IShellViewImpl * This)
/* copy the items into the array*/
while((S_OK == IEnumIDList_Next(pEnumIDList,1, &pidl, &dwFetched)) && dwFetched)
{
if (pDPA_InsertPtr(hdpa, 0x7fff, pidl) == -1)
if (DPA_InsertPtr(hdpa, 0x7fff, pidl) == -1)
{
SHFree(pidl);
}
}
/* sort the array */
pDPA_Sort(hdpa, ShellView_CompareItems, (LPARAM)This->pSFParent);
DPA_Sort(hdpa, ShellView_CompareItems, (LPARAM)This->pSFParent);
/*turn the listview's redrawing off*/
SendMessageA(This->hWndList, WM_SETREDRAW, FALSE, 0);
for (i=0; i < DPA_GetPtrCount(hdpa); ++i) /* DPA_GetPtrCount is a macro*/
{
pidl = (LPITEMIDLIST)pDPA_GetPtr(hdpa, i);
pidl = (LPITEMIDLIST)DPA_GetPtr(hdpa, i);
/* in a commdlg This works as a filemask*/
if ( IncludeObject(This, pidl)==S_OK )
......@@ -612,7 +612,7 @@ static HRESULT ShellView_FillList(IShellViewImpl * This)
SendMessageA(This->hWndList, WM_SETREDRAW, TRUE, 0);
IEnumIDList_Release(pEnumIDList); /* destroy the list*/
pDPA_Destroy(hdpa);
DPA_Destroy(hdpa);
return 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