#include <string.h>
#include <stdarg.h>
#include <stdio.h>
+
+#define COBJMACROS
+
#include "winerror.h"
#include "windef.h"
#include "winbase.h"
extern INT WINAPI FindMRUData(HANDLE hList, LPCVOID lpData, DWORD cbData, LPINT lpRegNum);
extern INT WINAPI EnumMRUListA(HANDLE hList, INT nItemPos, LPVOID lpBuffer, DWORD nBufferSize);
+
+/* Get a function pointer from a DLL handle */
+#define GET_FUNC(func, module, name, fail) \
+ do { \
+ if (!func) { \
+ if (!SHELL32_h##module && !(SHELL32_h##module = LoadLibraryA(#module ".dll"))) return fail; \
+ func = (void*)GetProcAddress(SHELL32_h##module, name); \
+ if (!func) return fail; \
+ } \
+ } while (0)
+
+/* Function pointers for GET_FUNC macro */
+static HMODULE SHELL32_hshlwapi=NULL;
+static HANDLE (WINAPI *pSHAllocShared)(LPCVOID,DWORD,DWORD);
+static LPVOID (WINAPI *pSHLockShared)(HANDLE,DWORD);
+static BOOL (WINAPI *pSHUnlockShared)(LPVOID);
+static BOOL (WINAPI *pSHFreeShared)(HANDLE,DWORD);
+
+
/*************************************************************************
* ParseFieldA [internal]
*
* the registry path are for win98 (tested)
* and possibly are the same in nt40
*
- * FIXME: implement new flags such as SSF_WIN95CLASSIC and SSF_STARTPANELON
- *
*/
VOID WINAPI SHGetSettings(LPSHELLFLAGSTATE lpsfs, DWORD dwMask)
{
* shell view to re-sort the item list. dwParam identifies the column
* that was clicked.
*/
-int WINAPI SHShellFolderView_Message(
+LRESULT WINAPI SHShellFolderView_Message(
HWND hwndCabinet,
- DWORD dwMessage,
- DWORD dwParam)
+ UINT uMessage,
+ LPARAM lParam)
{
- FIXME("%p %08lx %08lx stub\n",hwndCabinet, dwMessage, dwParam);
+ FIXME("%p %08x %08lx stub\n",hwndCabinet, uMessage, lParam);
return 0;
}
LPDROPTARGET pDropTarget)
{
FIXME("(%p,%p):stub.\n", hWnd, pDropTarget);
- if (GetShellOle()) return pRegisterDragDrop(hWnd, pDropTarget);
- return 0;
+ return RegisterDragDrop(hWnd, pDropTarget);
}
/*************************************************************************
HRESULT WINAPI SHRevokeDragDrop(HWND hWnd)
{
FIXME("(%p):stub.\n",hWnd);
- if (GetShellOle()) return pRevokeDragDrop(hWnd);
- return 0;
+ return RevokeDragDrop(hWnd);
}
/*************************************************************************
{
FIXME("(%p %p %p 0x%08lx %p):stub.\n",
hWnd, lpDataObject, lpDropSource, dwOKEffect, pdwEffect);
- if (GetShellOle()) return pDoDragDrop(lpDataObject, lpDropSource, dwOKEffect, pdwEffect);
- return 0;
+ return DoDragDrop(lpDataObject, lpDropSource, dwOKEffect, pdwEffect);
}
/*************************************************************************
* mruhandle [IN] handle for created MRU list
* doc_name [IN] null termed pure doc name
* new_lnk_name [IN] null termed path and file name for .lnk file
- * buffer [IN/OUT] 2048 byte area to consturct MRU data
+ * buffer [IN/OUT] 2048 byte area to construct MRU data
* len [OUT] ptr to int to receive space used in buffer
*
* RETURNS
*
* NOTES
* exported by name
- *
- * FIXME: ?? MSDN shows this as a VOID
*/
-DWORD WINAPI SHAddToRecentDocs (UINT uFlags,LPCVOID pv)
+void WINAPI SHAddToRecentDocs (UINT uFlags,LPCVOID pv)
{
/* If list is a string list lpfnCompare has the following prototype
* int CALLBACK MRUCompareString(LPCSTR s1, LPCSTR s2)
ret=SHADD_get_policy( "NoRecentDocsHistory", &type, &data, &datalen);
if ((ret > 0) && (ret != ERROR_FILE_NOT_FOUND)) {
ERR("Error %d getting policy \"NoRecentDocsHistory\"\n", ret);
- return 0;
+ return;
}
if (ret == ERROR_SUCCESS) {
if (!( (type == REG_DWORD) ||
((type == REG_BINARY) && (datalen == 4)) )) {
- ERR("Error policy data for \"NoRecentDocsHistory\" not formated correctly, type=%ld, len=%ld\n",
+ ERR("Error policy data for \"NoRecentDocsHistory\" not formatted correctly, type=%ld, len=%ld\n",
type, datalen);
- return 0;
+ return;
}
TRACE("policy value for NoRecentDocsHistory = %08lx\n", data[0]);
/* now test the actual policy value */
if ( data[0] != 0)
- return 0;
+ return;
}
/* Open key to where the necessary info is
"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer",
0, 0, 0, KEY_READ, 0, &HCUbasekey, 0)) {
ERR("Failed to create 'Software\\Microsoft\\Windows\\CurrentVersion\\Explorer'\n");
- return 0;
+ return;
}
/* Get path to user's "Recent" directory
*/
RegDeleteKeyA(HCUbasekey, "RecentDocs");
RegCloseKey(HCUbasekey);
- return 0;
+ return;
}
/* Have data to add, the jobs to be done:
SHGetPathFromIDListA((LPCITEMIDLIST) pv, doc_name);
}
else {
- lstrcpyA(doc_name, (LPSTR) pv);
+ lstrcpyA(doc_name, (LPCSTR) pv);
}
TRACE("full document name %s\n", doc_name);
PathStripPathA(doc_name);
/* MRU failed */
ERR("MRU processing failed, handle zero\n");
RegCloseKey(HCUbasekey);
- return 0;
+ return;
}
len = lstrlenA(doc_name);
pos = FindMRUData(mruhandle, doc_name, len, 0);
/* all done */
RegCloseKey(HCUbasekey);
- return 0;
+ return;
}
/*************************************************************************
* see IShellFolder::CreateViewObject
*/
HRESULT WINAPI SHCreateShellFolderViewEx(
- LPCSHELLFOLDERVIEWINFO psvcbi, /* [in] shelltemplate struct */
- LPSHELLVIEW* ppv) /* [out] IShellView pointer */
+ LPCSFV psvcbi, /* [in] shelltemplate struct */
+ IShellView **ppv) /* [out] IShellView pointer */
{
IShellView * psf;
HRESULT hRes;
- TRACE("sf=%p pidl=%p cb=%p mode=0x%08x parm=0x%08lx\n",
- psvcbi->pshf, psvcbi->pidlFolder, psvcbi->lpfnCallback,
- psvcbi->uViewMode, psvcbi->dwUser);
+ TRACE("sf=%p pidl=%p cb=%p mode=0x%08x parm=%p\n",
+ psvcbi->pshf, psvcbi->pidl, psvcbi->pfnCallback,
+ psvcbi->fvm, psvcbi->psvOuter);
psf = IShellView_Constructor(psvcbi->pshf);
* DAD_AutoScroll [SHELL32.129]
*
*/
-DWORD WINAPI DAD_AutoScroll(HWND hwnd, LPSCROLLSAMPLES samples, LPPOINT pt)
+BOOL WINAPI DAD_AutoScroll(HWND hwnd, AUTO_SCROLL_DATA *samples, LPPOINT pt)
{
FIXME("hwnd = %p %p %p\n",hwnd,samples,pt);
return 0;
/*************************************************************************
* SHAllocShared [SHELL32.520]
*
- * NOTES
- * parameter1 is return value from HeapAlloc
- * parameter2 is equal to the size allocated with HeapAlloc
- * parameter3 is return value from GetCurrentProcessId
- *
- * the return value is posted as lParam with 0x402 (WM_USER+2) to somewhere
- * WM_USER+2 could be the undocumented CWM_SETPATH
- * the allocated memory contains a pidl
+ * See shlwapi.SHAllocShared
*/
-HGLOBAL WINAPI SHAllocShared(LPVOID psrc, DWORD size, DWORD procID)
-{ HGLOBAL hmem;
- LPVOID pmem;
-
- TRACE("ptr=%p size=0x%04lx procID=0x%04lx\n",psrc,size,procID);
- hmem = GlobalAlloc(GMEM_FIXED, size);
- if (!hmem)
- return 0;
-
- pmem = GlobalLock (hmem);
-
- if (! pmem)
- return 0;
-
- memcpy (pmem, psrc, size);
- GlobalUnlock(hmem);
- return hmem;
+HANDLE WINAPI SHAllocShared(LPVOID lpvData, DWORD dwSize, DWORD dwProcId)
+{
+ GET_FUNC(pSHAllocShared, shlwapi, (char*)7, NULL);
+ return pSHAllocShared(lpvData, dwSize, dwProcId);
}
+
/*************************************************************************
* SHLockShared [SHELL32.521]
*
- * NOTES
- * parameter1 is return value from SHAllocShared
- * parameter2 is return value from GetCurrentProcessId
- * the receiver of (WM_USER+2) tries to lock the HANDLE (?)
- * the return value seems to be a memory address
+ * See shlwapi.SHLockShared
*/
-LPVOID WINAPI SHLockShared(HANDLE hmem, DWORD procID)
-{ TRACE("handle=%p procID=0x%04lx\n",hmem,procID);
- return GlobalLock(hmem);
+LPVOID WINAPI SHLockShared(HANDLE hShared, DWORD dwProcId)
+{
+ GET_FUNC(pSHLockShared, shlwapi, (char*)8, NULL);
+ return pSHLockShared(hShared, dwProcId);
}
+
/*************************************************************************
* SHUnlockShared [SHELL32.522]
*
- * NOTES
- * parameter1 is return value from SHLockShared
+ * See shlwapi.SHUnlockShared
*/
-BOOL WINAPI SHUnlockShared(LPVOID pv)
+BOOL WINAPI SHUnlockShared(LPVOID lpView)
{
- TRACE("%p\n",pv);
- return GlobalUnlock((HANDLE)pv);
+ GET_FUNC(pSHUnlockShared, shlwapi, (char*)9, FALSE);
+ return pSHUnlockShared(lpView);
}
+
/*************************************************************************
* SHFreeShared [SHELL32.523]
*
- * NOTES
- * parameter1 is return value from SHAllocShared
- * parameter2 is return value from GetCurrentProcessId
+ * See shlwapi.SHFreeShared
*/
-BOOL WINAPI SHFreeShared(
- HANDLE hMem,
- DWORD pid)
+BOOL WINAPI SHFreeShared(HANDLE hShared, DWORD dwProcId)
{
- TRACE("handle=%p 0x%04lx\n",hMem,pid);
- return (BOOL)GlobalFree(hMem);
+ GET_FUNC(pSHFreeShared, shlwapi, (char*)10, FALSE);
+ return pSHFreeShared(hShared, dwProcId);
}
/*************************************************************************
* SHLoadOLE [SHELL32.151]
*
*/
-HRESULT WINAPI SHLoadOLE(DWORD u)
-{ FIXME("0x%04lx stub\n",u);
+HRESULT WINAPI SHLoadOLE(LPARAM lParam)
+{ FIXME("0x%04lx stub\n",lParam);
return S_OK;
}
/*************************************************************************
/*************************************************************************
- * SHELL32_256
+ * SHELL32_256 (SHELL32.256)
*/
HRESULT WINAPI SHELL32_256(LPDWORD lpdw0, LPDWORD lpdw1)
{
ret = E_INVALIDARG;
else
{
- LPVOID lpdata = 0;/*LocalAlloc(GMEM_ZEROINIT, 0x4E4);*/
+ LPVOID lpdata = 0;/*LocalAlloc(LMEM_ZEROINIT, 0x4E4);*/
if (!lpdata)
ret = E_OUTOFMEMORY;
return ret;
}
+
+/*************************************************************************
+ * SHFindFiles (SHELL32.90)
+ */
+BOOL WINAPI SHFindFiles( LPCITEMIDLIST pidlFolder, LPCITEMIDLIST pidlSaveFile )
+{
+ FIXME("%p %p\n", pidlFolder, pidlSaveFile );
+ return FALSE;
+}
+
+/*************************************************************************
+ * SHUpdateImageW (SHELL32.192)
+ *
+ * Notifies the shell that an icon in the system image list has been changed.
+ *
+ * PARAMS
+ * pszHashItem [I] Path to file that contains the icon.
+ * iIndex [I] Zero-based index of the icon in the file.
+ * uFlags [I] Flags determining the icon attributes. See notes.
+ * iImageIndex [I] Index of the icon in the system image list.
+ *
+ * NOTES
+ * uFlags can be one or more of the following flags:
+ * GIL_NOTFILENAME - pszHashItem is not a file name.
+ * GIL_SIMULATEDOC - Create a document icon using the specified icon.
+ */
+void WINAPI SHUpdateImageW(LPCWSTR pszHashItem, int iIndex, UINT uFlags, int iImageIndex)
+{
+ FIXME("%s, %d, 0x%x, %d - stub\n", debugstr_w(pszHashItem), iIndex, uFlags, iImageIndex);
+}
+
+VOID WINAPI SHUpdateImageA(LPCSTR pszHashItem, INT iIndex, UINT uFlags, INT iImageIndex)
+{
+ FIXME("%s, %d, 0x%x, %d - stub\n", debugstr_a(pszHashItem), iIndex, uFlags, iImageIndex);
+}
+
+INT WINAPI SHHandleUpdateImage(LPCITEMIDLIST pidlExtra)
+{
+ FIXME("%p - stub\n", pidlExtra);
+
+ return -1;
+}
+
+
+BOOL WINAPI SHObjectProperties(HWND hwnd, DWORD dwType, LPCWSTR szObject, LPCWSTR szPage)
+{
+ FIXME("%p, 0x%08lx, %s, %s - stub\n", hwnd, dwType, debugstr_w(szObject), debugstr_w(szPage));
+
+ MessageBox (NULL, TEXT("SHObjectProperties-WINAPI:\n\nTODO: Add the function code."), TEXT("SHObjectProperties; Dev: frik85"), 0);
+
+
+ return TRUE;
+}
+
+BOOL WINAPI SHGetNewLinkInfoA(LPCSTR pszLinkTo, LPCSTR pszDir, LPSTR pszName, BOOL *pfMustCopy,
+ UINT uFlags)
+{
+ FIXME("%s, %s, %p, %p, 0x%08x - stub\n", debugstr_a(pszLinkTo), debugstr_a(pszDir),
+ pszName, pfMustCopy, uFlags);
+
+ return FALSE;
+}
+
+BOOL WINAPI SHGetNewLinkInfoW(LPCWSTR pszLinkTo, LPCWSTR pszDir, LPWSTR pszName, BOOL *pfMustCopy,
+ UINT uFlags)
+{
+ FIXME("%s, %s, %p, %p, 0x%08x - stub\n", debugstr_w(pszLinkTo), debugstr_w(pszDir),
+ pszName, pfMustCopy, uFlags);
+
+ return FALSE;
+}
+
+HRESULT WINAPI SHStartNetConnectionDialog(HWND hwnd, LPCSTR pszRemoteName, DWORD dwType)
+{
+ FIXME("%p, %s, 0x%08lx - stub\n", hwnd, debugstr_a(pszRemoteName), dwType);
+
+ return S_OK;
+}
+
+HRESULT WINAPI SHEmptyRecycleBinA(HWND hwnd, LPCSTR pszRootPath, DWORD dwFlags)
+{
+ FIXME("%p, %s, 0x%08lx - stub\n", hwnd, debugstr_a(pszRootPath), dwFlags);
+
+ return S_OK;
+}
+
+HRESULT WINAPI SHEmptyRecycleBinW(HWND hwnd, LPCWSTR pszRootPath, DWORD dwFlags)
+{
+ FIXME("%p, %s, 0x%08lx - stub\n", hwnd, debugstr_w(pszRootPath), dwFlags);
+
+ return S_OK;
+}
+
+DWORD WINAPI SHFormatDrive(HWND hwnd, UINT drive, UINT fmtID, UINT options)
+{
+ FIXME("%p, 0x%08x, 0x%08x, 0x%08x - stub\n", hwnd, drive, fmtID, options);
+
+ return SHFMT_NOFORMAT;
+}
+
+HRESULT WINAPI SHQueryRecycleBinA(LPCSTR pszRootPath, LPSHQUERYRBINFO pSHQueryRBInfo)
+{
+ FIXME("%s, %p - stub\n", debugstr_a(pszRootPath), pSHQueryRBInfo);
+
+ pSHQueryRBInfo->i64Size = 0;
+ pSHQueryRBInfo->i64NumItems = 0;
+
+ return S_OK;
+}
+
+HRESULT WINAPI SHQueryRecycleBinW(LPCWSTR pszRootPath, LPSHQUERYRBINFO pSHQueryRBInfo)
+{
+ FIXME("%s, %p - stub\n", debugstr_w(pszRootPath), pSHQueryRBInfo);
+
+ pSHQueryRBInfo->i64Size = 0;
+ pSHQueryRBInfo->i64NumItems = 0;
+
+ return S_OK;
+}