Author: akhaldi
Date: Mon Nov 3 18:21:49 2014
New Revision: 65230
URL:
http://svn.reactos.org/svn/reactos?rev=65230&view=rev
Log:
[SHELL32]
* Partial sync of shellord.c with Wine 1.7.27.
CORE-8540
Modified:
branches/shell-experiments/dll/win32/shell32/wine/shellord.c
Modified: branches/shell-experiments/dll/win32/shell32/wine/shellord.c
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
==============================================================================
--- branches/shell-experiments/dll/win32/shell32/wine/shellord.c [iso-8859-1] (original)
+++ branches/shell-experiments/dll/win32/shell32/wine/shellord.c [iso-8859-1] Mon Nov 3
18:21:49 2014
@@ -84,42 +84,43 @@
/* Function pointers for GET_FUNC macro */
static HMODULE SHELL32_hshlwapi=NULL;
-/*************************************************************************
- * ParseFieldA [internal]
+
+/*************************************************************************
+ * ParseFieldA [internal]
*
* copies a field from a ',' delimited string
*
* first field is nField = 1
*/
DWORD WINAPI ParseFieldA(
- LPCSTR src,
- DWORD nField,
- LPSTR dst,
- DWORD len)
-{
- WARN("(%s,0x%08x,%p,%d) semi-stub.\n",debugstr_a(src),nField,dst,len);
-
- if (!src || !src[0] || !dst || !len)
- return 0;
-
- /* skip n fields delimited by ',' */
- while (nField > 1)
- {
- if (*src=='\0') return FALSE;
- if (*(src++)==',') nField--;
- }
-
- /* copy part till the next ',' to dst */
- while ( *src!='\0' && *src!=',' && (len--)>0 )
*(dst++)=*(src++);
-
- /* finalize the string */
- *dst=0x0;
-
- return TRUE;
-}
-
-/*************************************************************************
- * ParseFieldW [internal]
+ LPCSTR src,
+ DWORD nField,
+ LPSTR dst,
+ DWORD len)
+{
+ WARN("(%s,0x%08x,%p,%d) semi-stub.\n",debugstr_a(src),nField,dst,len);
+
+ if (!src || !src[0] || !dst || !len)
+ return 0;
+
+ /* skip n fields delimited by ',' */
+ while (nField > 1)
+ {
+ if (*src=='\0') return FALSE;
+ if (*(src++)==',') nField--;
+ }
+
+ /* copy part till the next ',' to dst */
+ while ( *src!='\0' && *src!=',' && (len--)>0 )
*(dst++)=*(src++);
+
+ /* finalize the string */
+ *dst=0x0;
+
+ return TRUE;
+}
+
+/*************************************************************************
+ * ParseFieldW [internal]
*
* copies a field from a ',' delimited string
*
@@ -127,33 +128,33 @@
*/
DWORD WINAPI ParseFieldW(LPCWSTR src, DWORD nField, LPWSTR dst, DWORD len)
{
- WARN("(%s,0x%08x,%p,%d) semi-stub.\n", debugstr_w(src), nField, dst, len);
-
- if (!src || !src[0] || !dst || !len)
- return 0;
-
- /* skip n fields delimited by ',' */
- while (nField > 1)
- {
- if (*src == 0x0) return FALSE;
- if (*src++ == ',') nField--;
- }
-
- /* copy part till the next ',' to dst */
- while ( *src != 0x0 && *src != ',' && (len--)>0 ) *(dst++)
= *(src++);
-
- /* finalize the string */
- *dst = 0x0;
-
- return TRUE;
-}
-
-/*************************************************************************
- * ParseField [SHELL32.58]
+ WARN("(%s,0x%08x,%p,%d) semi-stub.\n", debugstr_w(src), nField, dst, len);
+
+ if (!src || !src[0] || !dst || !len)
+ return 0;
+
+ /* skip n fields delimited by ',' */
+ while (nField > 1)
+ {
+ if (*src == 0x0) return FALSE;
+ if (*src++ == ',') nField--;
+ }
+
+ /* copy part till the next ',' to dst */
+ while ( *src != 0x0 && *src != ',' && (len--)>0 ) *(dst++) =
*(src++);
+
+ /* finalize the string */
+ *dst = 0x0;
+
+ return TRUE;
+}
+
+/*************************************************************************
+ * ParseField [SHELL32.58]
*/
EXTERN_C DWORD WINAPI ParseFieldAW(LPCVOID src, DWORD nField, LPVOID dst, DWORD len)
{
- if (SHELL_OsIsUnicode())
+ if (SHELL_OsIsUnicode())
return ParseFieldW((LPCWSTR)src, nField, (LPWSTR)dst, len);
return ParseFieldA((LPCSTR)src, nField, (LPSTR)dst, len);
}
@@ -208,7 +209,7 @@
}
/*************************************************************************
- * SHGetSetSettings [SHELL32.68]
+ * SHGetSetSettings [SHELL32.68]
*/
EXTERN_C VOID WINAPI SHGetSetSettings(LPSHELLSTATE lpss, DWORD dwMask, BOOL bSet)
{
@@ -223,7 +224,7 @@
}
/*************************************************************************
- * SHGetSettings [SHELL32.@]
+ * SHGetSettings [SHELL32.@]
*
* NOTES
* the registry path are for win98 (tested)
@@ -232,55 +233,55 @@
*/
EXTERN_C VOID WINAPI SHGetSettings(LPSHELLFLAGSTATE lpsfs, DWORD dwMask)
{
- HKEY hKey;
- DWORD dwData;
- DWORD dwDataSize = sizeof (DWORD);
-
- TRACE("(%p 0x%08x)\n",lpsfs,dwMask);
-
- if (RegCreateKeyExA(HKEY_CURRENT_USER,
"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced",
- 0, 0, 0, KEY_ALL_ACCESS, 0, &hKey, 0))
- return;
-
- if ( (SSF_SHOWEXTENSIONS & dwMask) && !RegQueryValueExA(hKey,
"HideFileExt", 0, 0, (LPBYTE)&dwData, &dwDataSize))
- lpsfs->fShowExtensions = ((dwData == 0) ? 0 : 1);
-
- if ( (SSF_SHOWINFOTIP & dwMask) && !RegQueryValueExA(hKey,
"ShowInfoTip", 0, 0, (LPBYTE)&dwData, &dwDataSize))
- lpsfs->fShowInfoTip = ((dwData == 0) ? 0 : 1);
-
- if ( (SSF_DONTPRETTYPATH & dwMask) && !RegQueryValueExA(hKey,
"DontPrettyPath", 0, 0, (LPBYTE)&dwData, &dwDataSize))
- lpsfs->fDontPrettyPath = ((dwData == 0) ? 0 : 1);
-
- if ( (SSF_HIDEICONS & dwMask) && !RegQueryValueExA(hKey,
"HideIcons", 0, 0, (LPBYTE)&dwData, &dwDataSize))
- lpsfs->fHideIcons = ((dwData == 0) ? 0 : 1);
-
- if ( (SSF_MAPNETDRVBUTTON & dwMask) && !RegQueryValueExA(hKey,
"MapNetDrvBtn", 0, 0, (LPBYTE)&dwData, &dwDataSize))
- lpsfs->fMapNetDrvBtn = ((dwData == 0) ? 0 : 1);
-
- if ( (SSF_SHOWATTRIBCOL & dwMask) && !RegQueryValueExA(hKey,
"ShowAttribCol", 0, 0, (LPBYTE)&dwData, &dwDataSize))
- lpsfs->fShowAttribCol = ((dwData == 0) ? 0 : 1);
-
- if (((SSF_SHOWALLOBJECTS | SSF_SHOWSYSFILES) & dwMask) &&
!RegQueryValueExA(hKey, "Hidden", 0, 0, (LPBYTE)&dwData, &dwDataSize))
- { if (dwData == 0)
- { if (SSF_SHOWALLOBJECTS & dwMask) lpsfs->fShowAllObjects = 0;
- if (SSF_SHOWSYSFILES & dwMask) lpsfs->fShowSysFiles = 0;
- }
- else if (dwData == 1)
- { if (SSF_SHOWALLOBJECTS & dwMask) lpsfs->fShowAllObjects = 1;
- if (SSF_SHOWSYSFILES & dwMask) lpsfs->fShowSysFiles = 0;
- }
- else if (dwData == 2)
- { if (SSF_SHOWALLOBJECTS & dwMask) lpsfs->fShowAllObjects = 0;
- if (SSF_SHOWSYSFILES & dwMask) lpsfs->fShowSysFiles = 1;
- }
- }
- RegCloseKey (hKey);
-
- TRACE("-- 0x%04x\n", *(WORD*)lpsfs);
-}
-
-/*************************************************************************
- * SHShellFolderView_Message [SHELL32.73]
+ HKEY hKey;
+ DWORD dwData;
+ DWORD dwDataSize = sizeof (DWORD);
+
+ TRACE("(%p 0x%08x)\n",lpsfs,dwMask);
+
+ if (RegCreateKeyExA(HKEY_CURRENT_USER,
"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced",
+ 0, 0, 0, KEY_ALL_ACCESS, 0, &hKey, 0))
+ return;
+
+ if ( (SSF_SHOWEXTENSIONS & dwMask) && !RegQueryValueExA(hKey,
"HideFileExt", 0, 0, (LPBYTE)&dwData, &dwDataSize))
+ lpsfs->fShowExtensions = ((dwData == 0) ? 0 : 1);
+
+ if ( (SSF_SHOWINFOTIP & dwMask) && !RegQueryValueExA(hKey,
"ShowInfoTip", 0, 0, (LPBYTE)&dwData, &dwDataSize))
+ lpsfs->fShowInfoTip = ((dwData == 0) ? 0 : 1);
+
+ if ( (SSF_DONTPRETTYPATH & dwMask) && !RegQueryValueExA(hKey,
"DontPrettyPath", 0, 0, (LPBYTE)&dwData, &dwDataSize))
+ lpsfs->fDontPrettyPath = ((dwData == 0) ? 0 : 1);
+
+ if ( (SSF_HIDEICONS & dwMask) && !RegQueryValueExA(hKey,
"HideIcons", 0, 0, (LPBYTE)&dwData, &dwDataSize))
+ lpsfs->fHideIcons = ((dwData == 0) ? 0 : 1);
+
+ if ( (SSF_MAPNETDRVBUTTON & dwMask) && !RegQueryValueExA(hKey,
"MapNetDrvBtn", 0, 0, (LPBYTE)&dwData, &dwDataSize))
+ lpsfs->fMapNetDrvBtn = ((dwData == 0) ? 0 : 1);
+
+ if ( (SSF_SHOWATTRIBCOL & dwMask) && !RegQueryValueExA(hKey,
"ShowAttribCol", 0, 0, (LPBYTE)&dwData, &dwDataSize))
+ lpsfs->fShowAttribCol = ((dwData == 0) ? 0 : 1);
+
+ if (((SSF_SHOWALLOBJECTS | SSF_SHOWSYSFILES) & dwMask) &&
!RegQueryValueExA(hKey, "Hidden", 0, 0, (LPBYTE)&dwData, &dwDataSize))
+ { if (dwData == 0)
+ { if (SSF_SHOWALLOBJECTS & dwMask) lpsfs->fShowAllObjects = 0;
+ if (SSF_SHOWSYSFILES & dwMask) lpsfs->fShowSysFiles = 0;
+ }
+ else if (dwData == 1)
+ { if (SSF_SHOWALLOBJECTS & dwMask) lpsfs->fShowAllObjects = 1;
+ if (SSF_SHOWSYSFILES & dwMask) lpsfs->fShowSysFiles = 0;
+ }
+ else if (dwData == 2)
+ { if (SSF_SHOWALLOBJECTS & dwMask) lpsfs->fShowAllObjects = 0;
+ if (SSF_SHOWSYSFILES & dwMask) lpsfs->fShowSysFiles = 1;
+ }
+ }
+ RegCloseKey (hKey);
+
+ TRACE("-- 0x%04x\n", *(WORD*)lpsfs);
+}
+
+/*************************************************************************
+ * SHShellFolderView_Message [SHELL32.73]
*
* Send a message to an explorer cabinet window.
*
@@ -300,16 +301,16 @@
* that was clicked.
*/
LRESULT WINAPI SHShellFolderView_Message(
- HWND hwndCabinet,
- UINT uMessage,
- LPARAM lParam)
-{
- FIXME("%p %08x %08lx stub\n",hwndCabinet, uMessage, lParam);
- return 0;
-}
-
-/*************************************************************************
- * RegisterShellHook [SHELL32.181]
+ HWND hwndCabinet,
+ UINT uMessage,
+ LPARAM lParam)
+{
+ FIXME("%p %08x %08lx stub\n",hwndCabinet, uMessage, lParam);
+ return 0;
+}
+
+/*************************************************************************
+ * RegisterShellHook [SHELL32.181]
*
* Register a shell hook.
*
@@ -321,8 +322,8 @@
* Exported by ordinal
*/
BOOL WINAPI RegisterShellHook(
- HWND hWnd,
- DWORD dwType)
+ HWND hWnd,
+ DWORD dwType)
{
if (dwType == 3)
return RegisterShellHookWindow(hWnd);
@@ -334,7 +335,7 @@
}
/*************************************************************************
- * ShellMessageBoxW [SHELL32.182]
+ * ShellMessageBoxW [SHELL32.182]
*
* See ShellMessageBoxA.
*
@@ -345,47 +346,47 @@
* shlwapi as well.
*/
EXTERN_C int ShellMessageBoxW(
- HINSTANCE hInstance,
- HWND hWnd,
- LPCWSTR lpText,
- LPCWSTR lpCaption,
- UINT uType,
- ...)
-{
- WCHAR szText[100],szTitle[100];
- LPCWSTR pszText = szText, pszTitle = szTitle;
- LPWSTR pszTemp;
+ HINSTANCE hInstance,
+ HWND hWnd,
+ LPCWSTR lpText,
+ LPCWSTR lpCaption,
+ UINT uType,
+ ...)
+{
+ WCHAR szText[100],szTitle[100];
+ LPCWSTR pszText = szText, pszTitle = szTitle;
+ LPWSTR pszTemp;
va_list args;
- int ret;
+ int ret;
va_start(args, uType);
- /* wvsprintfA(buf,fmt, args); */
-
- TRACE("(%p,%p,%p,%p,%08x)\n",
- hInstance,hWnd,lpText,lpCaption,uType);
-
- if (IS_INTRESOURCE(lpCaption))
- LoadStringW(hInstance, LOWORD(lpCaption), szTitle,
sizeof(szTitle)/sizeof(szTitle[0]));
- else
- pszTitle = lpCaption;
-
- if (IS_INTRESOURCE(lpText))
- LoadStringW(hInstance, LOWORD(lpText), szText, sizeof(szText)/sizeof(szText[0]));
- else
- pszText = lpText;
-
- FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_STRING,
- pszText, 0, 0, (LPWSTR)&pszTemp, 0, &args);
+ /* wvsprintfA(buf,fmt, args); */
+
+ TRACE("(%p,%p,%p,%p,%08x)\n",
+ hInstance,hWnd,lpText,lpCaption,uType);
+
+ if (IS_INTRESOURCE(lpCaption))
+ LoadStringW(hInstance, LOWORD(lpCaption), szTitle,
sizeof(szTitle)/sizeof(szTitle[0]));
+ else
+ pszTitle = lpCaption;
+
+ if (IS_INTRESOURCE(lpText))
+ LoadStringW(hInstance, LOWORD(lpText), szText, sizeof(szText)/sizeof(szText[0]));
+ else
+ pszText = lpText;
+
+ FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_STRING,
+ pszText, 0, 0, (LPWSTR)&pszTemp, 0, &args);
va_end(args);
- ret = MessageBoxW(hWnd,pszTemp,pszTitle,uType);
- LocalFree(pszTemp);
- return ret;
-}
-
-/*************************************************************************
- * ShellMessageBoxA [SHELL32.183]
+ ret = MessageBoxW(hWnd,pszTemp,pszTitle,uType);
+ LocalFree(pszTemp);
+ return ret;
+}
+
+/*************************************************************************
+ * ShellMessageBoxA [SHELL32.183]
*
* Format and output an error message.
*
@@ -403,43 +404,43 @@
* Exported by ordinal
*/
EXTERN_C int ShellMessageBoxA(
- HINSTANCE hInstance,
- HWND hWnd,
- LPCSTR lpText,
- LPCSTR lpCaption,
- UINT uType,
- ...)
-{
- char szText[100],szTitle[100];
- LPCSTR pszText = szText, pszTitle = szTitle;
- LPSTR pszTemp;
+ HINSTANCE hInstance,
+ HWND hWnd,
+ LPCSTR lpText,
+ LPCSTR lpCaption,
+ UINT uType,
+ ...)
+{
+ char szText[100],szTitle[100];
+ LPCSTR pszText = szText, pszTitle = szTitle;
+ LPSTR pszTemp;
va_list args;
- int ret;
+ int ret;
va_start(args, uType);
- /* wvsprintfA(buf,fmt, args); */
-
- TRACE("(%p,%p,%p,%p,%08x)\n",
- hInstance,hWnd,lpText,lpCaption,uType);
-
- if (IS_INTRESOURCE(lpCaption))
- LoadStringA(hInstance, LOWORD(lpCaption), szTitle, sizeof(szTitle));
- else
- pszTitle = lpCaption;
-
- if (IS_INTRESOURCE(lpText))
- LoadStringA(hInstance, LOWORD(lpText), szText, sizeof(szText));
- else
- pszText = lpText;
-
- FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_STRING,
- pszText, 0, 0, (LPSTR)&pszTemp, 0, &args);
+ /* wvsprintfA(buf,fmt, args); */
+
+ TRACE("(%p,%p,%p,%p,%08x)\n",
+ hInstance,hWnd,lpText,lpCaption,uType);
+
+ if (IS_INTRESOURCE(lpCaption))
+ LoadStringA(hInstance, LOWORD(lpCaption), szTitle, sizeof(szTitle));
+ else
+ pszTitle = lpCaption;
+
+ if (IS_INTRESOURCE(lpText))
+ LoadStringA(hInstance, LOWORD(lpText), szText, sizeof(szText));
+ else
+ pszText = lpText;
+
+ FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_STRING,
+ pszText, 0, 0, (LPSTR)&pszTemp, 0, &args);
va_end(args);
- ret = MessageBoxA(hWnd,pszTemp,pszTitle,uType);
- LocalFree(pszTemp);
- return ret;
+ ret = MessageBoxA(hWnd,pszTemp,pszTitle,uType);
+ LocalFree(pszTemp);
+ return ret;
}
/*************************************************************************
@@ -500,7 +501,7 @@
}
/*************************************************************************
- * SHDoDragDrop [SHELL32.88]
+ * SHDoDragDrop [SHELL32.88]
*
* Probably equivalent to DoDragDrop but under Windows 9x it could use the
* shell32 built-in "mini-COM" without the need to load ole32.dll - see
SHLoadOLE
@@ -513,19 +514,19 @@
* DoDragDrop, SHLoadOLE
*/
HRESULT WINAPI SHDoDragDrop(
- HWND hWnd,
+ HWND hWnd,
IDataObject * lpDataObject,
- LPDROPSOURCE lpDropSource,
- DWORD dwOKEffect,
- LPDWORD pdwEffect)
+ LPDROPSOURCE lpDropSource,
+ DWORD dwOKEffect,
+ LPDWORD pdwEffect)
{
FIXME("(%p %p %p 0x%08x %p):stub.\n",
- hWnd, lpDataObject, lpDropSource, dwOKEffect, pdwEffect);
- return DoDragDrop(lpDataObject, lpDropSource, dwOKEffect, pdwEffect);
-}
-
-/*************************************************************************
- * ArrangeWindows [SHELL32.184]
+ hWnd, lpDataObject, lpDropSource, dwOKEffect, pdwEffect);
+ return DoDragDrop(lpDataObject, lpDropSource, dwOKEffect, pdwEffect);
+}
+
+/*************************************************************************
+ * ArrangeWindows [SHELL32.184]
*
*/
WORD WINAPI ArrangeWindows(
@@ -537,12 +538,12 @@
{
/* Unimplemented in WinXP SP3 */
TRACE("(%p 0x%08x %p 0x%04x %p):stub.\n",
- hwndParent, dwReserved, lpRect, cKids, lpKids);
+ hwndParent, dwReserved, lpRect, cKids, lpKids);
return 0;
}
/*************************************************************************
- * SignalFileOpen [SHELL32.103]
+ * SignalFileOpen [SHELL32.103]
*
* NOTES
* exported by ordinal
@@ -576,17 +577,17 @@
/* Get the key for the policies location in the registry
*/
if (RegOpenKeyExA(HKEY_LOCAL_MACHINE,
-
"Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer",
- 0, KEY_READ, &Policy_basekey)) {
-
- if (RegOpenKeyExA(HKEY_CURRENT_USER,
-
"Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer",
- 0, KEY_READ, &Policy_basekey)) {
- TRACE("No Explorer Policies location exists. Policy wanted=%s\n",
- policy);
- *len = 0;
- return ERROR_FILE_NOT_FOUND;
- }
+ "Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer",
+ 0, KEY_READ, &Policy_basekey)) {
+
+ if (RegOpenKeyExA(HKEY_CURRENT_USER,
+ "Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer",
+ 0, KEY_READ, &Policy_basekey)) {
+ TRACE("No Explorer Policies location exists. Policy wanted=%s\n",
+ policy);
+ *len = 0;
+ return ERROR_FILE_NOT_FOUND;
+ }
}
/* Retrieve the data if it exists
@@ -643,7 +644,7 @@
*/
/* Create the MRU data structure for "RecentDocs"
- */
+ */
ptr = buffer;
lstrcpyA(ptr, doc_name);
ptr += (lstrlenA(buffer) + 1);
@@ -666,7 +667,7 @@
}
/*************************************************************************
- * SHAddToRecentDocs [SHELL32.@]
+ * SHAddToRecentDocs [SHELL32.@]
*
* Modify (add/clear) Shell's list of recently used documents.
*
@@ -721,21 +722,21 @@
datalen = 64;
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;
+ ERR("Error %d getting policy \"NoRecentDocsHistory\"\n", ret);
+ return;
}
if (ret == ERROR_SUCCESS) {
- if (!( (type == REG_DWORD) ||
- ((type == REG_BINARY) && (datalen == 4)) )) {
- ERR("Error policy data for \"NoRecentDocsHistory\" not formatted
correctly, type=%d, len=%d\n",
- type, datalen);
- return;
- }
-
- TRACE("policy value for NoRecentDocsHistory = %08x\n", data[0]);
- /* now test the actual policy value */
- if ( data[0] != 0)
- return;
+ if (!( (type == REG_DWORD) ||
+ ((type == REG_BINARY) && (datalen == 4)) )) {
+ ERR("Error policy data for \"NoRecentDocsHistory\" not formatted
correctly, type=%d, len=%d\n",
+ type, datalen);
+ return;
+ }
+
+ TRACE("policy value for NoRecentDocsHistory = %08x\n", data[0]);
+ /* now test the actual policy value */
+ if ( data[0] != 0)
+ return;
}
/* Open key to where the necessary info is
@@ -745,59 +746,59 @@
* key is stored in the DLL global data.
*/
if (RegCreateKeyExA(HKEY_CURRENT_USER,
- "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer",
- 0, 0, 0, KEY_READ, 0, &HCUbasekey, 0)) {
- ERR("Failed to create
'Software\\Microsoft\\Windows\\CurrentVersion\\Explorer'\n");
- return;
+ "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer",
+ 0, 0, 0, KEY_READ, 0, &HCUbasekey, 0)) {
+ ERR("Failed to create
'Software\\Microsoft\\Windows\\CurrentVersion\\Explorer'\n");
+ return;
}
/* Get path to user's "Recent" directory
*/
if(SUCCEEDED(SHGetMalloc(&ppM))) {
- if (SUCCEEDED(SHGetSpecialFolderLocation(hwnd, CSIDL_RECENT,
- &pidl))) {
- SHGetPathFromIDListA(pidl, link_dir);
- IMalloc_Free(ppM, pidl);
+ if (SUCCEEDED(SHGetSpecialFolderLocation(hwnd, CSIDL_RECENT,
+ &pidl))) {
+ SHGetPathFromIDListA(pidl, link_dir);
+ IMalloc_Free(ppM, pidl);
+ }
+ else {
+ /* serious issues */
+ link_dir[0] = 0;
+ ERR("serious issues 1\n");
+ }
}
else {
- /* serious issues */
- link_dir[0] = 0;
- ERR("serious issues 1\n");
- }
- }
- else {
- /* serious issues */
- link_dir[0] = 0;
- ERR("serious issues 2\n");
+ /* serious issues */
+ link_dir[0] = 0;
+ ERR("serious issues 2\n");
}
TRACE("Users Recent dir %s\n", link_dir);
/* If no input, then go clear the lists */
if (!pv) {
- /* clear user's Recent dir
- */
-
- /* FIXME: delete all files in "link_dir"
- *
- * while( more files ) {
- * lstrcpyA(old_lnk_name, link_dir);
- * PathAppendA(old_lnk_name, filenam);
- * DeleteFileA(old_lnk_name);
- * }
- */
- FIXME("should delete all files in %s\\\n", link_dir);
-
- /* clear MRU list
- */
- /* MS Bug ?? v4.72.3612.1700 of shell32 does the delete against
- * HKEY_LOCAL_MACHINE version of ...CurrentVersion\Explorer
- * and naturally it fails w/ rc=2. It should do it against
- * HKEY_CURRENT_USER which is where it is stored, and where
- * the MRU routines expect it!!!!
- */
- RegDeleteKeyA(HCUbasekey, "RecentDocs");
- RegCloseKey(HCUbasekey);
- return;
+ /* clear user's Recent dir
+ */
+
+ /* FIXME: delete all files in "link_dir"
+ *
+ * while( more files ) {
+ * lstrcpyA(old_lnk_name, link_dir);
+ * PathAppendA(old_lnk_name, filenam);
+ * DeleteFileA(old_lnk_name);
+ * }
+ */
+ FIXME("should delete all files in %s\\\n", link_dir);
+
+ /* clear MRU list
+ */
+ /* MS Bug ?? v4.72.3612.1700 of shell32 does the delete against
+ * HKEY_LOCAL_MACHINE version of ...CurrentVersion\Explorer
+ * and naturally it fails w/ rc=2. It should do it against
+ * HKEY_CURRENT_USER which is where it is stored, and where
+ * the MRU routines expect it!!!!
+ */
+ RegDeleteKeyA(HCUbasekey, "RecentDocs");
+ RegCloseKey(HCUbasekey);
+ return;
}
/* Have data to add, the jobs to be done:
@@ -855,172 +856,172 @@
/* *** JOB 1: Update registry for ...\Explorer\RecentDocs list *** */
{ /* on input needs:
- * doc_name - pure file-spec, no path
- * link_dir - path to the user's Recent directory
- * HCUbasekey - key of ...Windows\CurrentVersion\Explorer" node
- * creates:
- * new_lnk_name- pure file-spec, no path for new .lnk file
- * new_lnk_filepath
- * - path and file name of new .lnk file
- */
- CREATEMRULISTA mymru;
- HANDLE mruhandle;
- INT len, pos, bufused, err;
- INT i;
- DWORD attr;
- CHAR buffer[2048];
- CHAR *ptr;
- CHAR old_lnk_name[MAX_PATH];
- short int slen;
-
- 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 = CreateMRUListA(&mymru);
- if (!mruhandle) {
- /* MRU failed */
- ERR("MRU processing failed, handle zero\n");
- RegCloseKey(HCUbasekey);
- return;
- }
- len = lstrlenA(doc_name);
- 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 = EnumMRUListA(mruhandle, (pos == -1) ? 14 : pos,
+ * doc_name - pure file-spec, no path
+ * link_dir - path to the user's Recent directory
+ * HCUbasekey - key of ...Windows\CurrentVersion\Explorer" node
+ * creates:
+ * new_lnk_name- pure file-spec, no path for new .lnk file
+ * new_lnk_filepath
+ * - path and file name of new .lnk file
+ */
+ CREATEMRULISTA mymru;
+ HANDLE mruhandle;
+ INT len, pos, bufused, err;
+ INT i;
+ DWORD attr;
+ CHAR buffer[2048];
+ CHAR *ptr;
+ CHAR old_lnk_name[MAX_PATH];
+ short int slen;
+
+ 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 = CreateMRUListA(&mymru);
+ if (!mruhandle) {
+ /* MRU failed */
+ ERR("MRU processing failed, handle zero\n");
+ RegCloseKey(HCUbasekey);
+ return;
+ }
+ len = lstrlenA(doc_name);
+ 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 = EnumMRUListA(mruhandle, (pos == -1) ? 14 : pos,
buffer, 2048)) != -1) {
- ptr = buffer;
- ptr += (lstrlenA(buffer) + 1);
- slen = *((short int*)ptr);
- ptr += 2; /* skip the length area */
- if (bufused >= slen + (ptr-buffer)) {
- /* buffer size looks good */
- ptr += 12; /* get to string */
- len = bufused - (ptr-buffer); /* get length of buf remaining */
- if ((lstrlenA(ptr) > 0) && (lstrlenA(ptr) <= len-1)) {
- /* appears to be good string */
- lstrcpyA(old_lnk_name, link_dir);
- PathAppendA(old_lnk_name, ptr);
- if (!DeleteFileA(old_lnk_name)) {
- if ((attr = GetFileAttributesA(old_lnk_name)) == INVALID_FILE_ATTRIBUTES) {
- if ((err = GetLastError()) != ERROR_FILE_NOT_FOUND) {
- ERR("Delete for %s failed, err=%d, attr=%08x\n",
- old_lnk_name, err, attr);
- }
- else {
- TRACE("old .lnk file %s did not exist\n",
- old_lnk_name);
- }
- }
- else {
- ERR("Delete for %s failed, attr=%08x\n",
- old_lnk_name, attr);
- }
- }
- else {
- TRACE("deleted old .lnk file %s\n", old_lnk_name);
- }
- }
- }
- }
-
- /* Create usable .lnk file name for the "Recent" directory
- */
- wsprintfA(new_lnk_name, "%s.lnk", doc_name);
- lstrcpyA(new_lnk_filepath, link_dir);
- PathAppendA(new_lnk_filepath, new_lnk_name);
- i = 1;
- olderrormode = SetErrorMode(SEM_FAILCRITICALERRORS);
- while (GetFileAttributesA(new_lnk_filepath) != INVALID_FILE_ATTRIBUTES) {
- i++;
- wsprintfA(new_lnk_name, "%s (%u).lnk", doc_name, i);
- lstrcpyA(new_lnk_filepath, link_dir);
- PathAppendA(new_lnk_filepath, new_lnk_name);
- }
- SetErrorMode(olderrormode);
- TRACE("new shortcut will be %s\n", new_lnk_filepath);
-
- /* Now add the new MRU entry and data
- */
- pos = SHADD_create_add_mru_data(mruhandle, doc_name, new_lnk_name,
- buffer, &len);
- FreeMRUList(mruhandle);
- TRACE("Updated MRU list, new doc is position %d\n", pos);
+ ptr = buffer;
+ ptr += (lstrlenA(buffer) + 1);
+ slen = *((short int*)ptr);
+ ptr += 2; /* skip the length area */
+ if (bufused >= slen + (ptr-buffer)) {
+ /* buffer size looks good */
+ ptr += 12; /* get to string */
+ len = bufused - (ptr-buffer); /* get length of buf remaining */
+ if ((lstrlenA(ptr) > 0) && (lstrlenA(ptr) <= len-1)) {
+ /* appears to be good string */
+ lstrcpyA(old_lnk_name, link_dir);
+ PathAppendA(old_lnk_name, ptr);
+ if (!DeleteFileA(old_lnk_name)) {
+ if ((attr = GetFileAttributesA(old_lnk_name)) == INVALID_FILE_ATTRIBUTES) {
+ if ((err = GetLastError()) != ERROR_FILE_NOT_FOUND) {
+ ERR("Delete for %s failed, err=%d, attr=%08x\n",
+ old_lnk_name, err, attr);
+ }
+ else {
+ TRACE("old .lnk file %s did not exist\n",
+ old_lnk_name);
+ }
+ }
+ else {
+ ERR("Delete for %s failed, attr=%08x\n",
+ old_lnk_name, attr);
+ }
+ }
+ else {
+ TRACE("deleted old .lnk file %s\n", old_lnk_name);
+ }
+ }
+ }
+ }
+
+ /* Create usable .lnk file name for the "Recent" directory
+ */
+ wsprintfA(new_lnk_name, "%s.lnk", doc_name);
+ lstrcpyA(new_lnk_filepath, link_dir);
+ PathAppendA(new_lnk_filepath, new_lnk_name);
+ i = 1;
+ olderrormode = SetErrorMode(SEM_FAILCRITICALERRORS);
+ while (GetFileAttributesA(new_lnk_filepath) != INVALID_FILE_ATTRIBUTES) {
+ i++;
+ wsprintfA(new_lnk_name, "%s (%u).lnk", doc_name, i);
+ lstrcpyA(new_lnk_filepath, link_dir);
+ PathAppendA(new_lnk_filepath, new_lnk_name);
+ }
+ SetErrorMode(olderrormode);
+ TRACE("new shortcut will be %s\n", new_lnk_filepath);
+
+ /* Now add the new MRU entry and data
+ */
+ pos = SHADD_create_add_mru_data(mruhandle, doc_name, new_lnk_name,
+ buffer, &len);
+ FreeMRUList(mruhandle);
+ TRACE("Updated MRU list, new doc is position %d\n", pos);
}
/* *** JOB 2: Create shortcut in user's "Recent" directory *** */
{ /* on input needs:
- * doc_name - pure file-spec, no path
- * new_lnk_filepath
- * - path and file name of new .lnk file
- * uFlags[in] - flags on call to SHAddToRecentDocs
- * pv[in] - document path/pidl on call to SHAddToRecentDocs
- */
- IShellLinkA *psl = NULL;
- IPersistFile *pPf = NULL;
- HRESULT hres;
- CHAR desc[MAX_PATH];
- WCHAR widelink[MAX_PATH];
-
- CoInitialize(0);
-
- hres = CoCreateInstance(&CLSID_ShellLink,
- NULL,
- CLSCTX_INPROC_SERVER,
- &IID_IShellLinkA,
- (LPVOID )&psl);
- if(SUCCEEDED(hres)) {
+ * doc_name - pure file-spec, no path
+ * new_lnk_filepath
+ * - path and file name of new .lnk file
+ * uFlags[in] - flags on call to SHAddToRecentDocs
+ * pv[in] - document path/pidl on call to SHAddToRecentDocs
+ */
+ IShellLinkA *psl = NULL;
+ IPersistFile *pPf = NULL;
+ HRESULT hres;
+ CHAR desc[MAX_PATH];
+ WCHAR widelink[MAX_PATH];
+
+ CoInitialize(0);
+
+ hres = CoCreateInstance( &CLSID_ShellLink,
+ NULL,
+ CLSCTX_INPROC_SERVER,
+ &IID_IShellLinkA,
+ (LPVOID )&psl);
+ if(SUCCEEDED(hres)) {
hres = IShellLinkA_QueryInterface(psl, &IID_IPersistFile, (LPVOID
*)&pPf);
- if(FAILED(hres)) {
- /* bombed */
- ERR("failed QueryInterface for IPersistFile %08x\n", hres);
- goto fail;
- }
-
- /* Set the document path or pidl */
- if (uFlags == SHARD_PIDL) {
- hres = IShellLinkA_SetIDList(psl, pv);
- } else {
- hres = IShellLinkA_SetPath(psl, pv);
- }
- if(FAILED(hres)) {
- /* bombed */
- ERR("failed Set{IDList|Path} %08x\n", hres);
- goto fail;
- }
-
- lstrcpyA(desc, "Shortcut to ");
- lstrcatA(desc, doc_name);
- hres = IShellLinkA_SetDescription(psl, desc);
- if(FAILED(hres)) {
- /* bombed */
- ERR("failed SetDescription %08x\n", hres);
- goto fail;
- }
-
- MultiByteToWideChar(CP_ACP, 0, new_lnk_filepath, -1,
- widelink, MAX_PATH);
- /* create the short cut */
- hres = IPersistFile_Save(pPf, widelink, TRUE);
- if(FAILED(hres)) {
- /* bombed */
- ERR("failed IPersistFile::Save %08x\n", hres);
- goto fail;
- }
- hres = IPersistFile_SaveCompleted(pPf, widelink);
- TRACE("shortcut %s has been created, result=%08x\n",
- new_lnk_filepath, hres);
- }
- else {
- ERR("CoCreateInstance failed, hres=%08x\n", hres);
- }
+ if(FAILED(hres)) {
+ /* bombed */
+ ERR("failed QueryInterface for IPersistFile %08x\n", hres);
+ goto fail;
+ }
+
+ /* Set the document path or pidl */
+ if (uFlags == SHARD_PIDL) {
+ hres = IShellLinkA_SetIDList(psl, pv);
+ } else {
+ hres = IShellLinkA_SetPath(psl, pv);
+ }
+ if(FAILED(hres)) {
+ /* bombed */
+ ERR("failed Set{IDList|Path} %08x\n", hres);
+ goto fail;
+ }
+
+ lstrcpyA(desc, "Shortcut to ");
+ lstrcatA(desc, doc_name);
+ hres = IShellLinkA_SetDescription(psl, desc);
+ if(FAILED(hres)) {
+ /* bombed */
+ ERR("failed SetDescription %08x\n", hres);
+ goto fail;
+ }
+
+ MultiByteToWideChar(CP_ACP, 0, new_lnk_filepath, -1,
+ widelink, MAX_PATH);
+ /* create the short cut */
+ hres = IPersistFile_Save(pPf, widelink, TRUE);
+ if(FAILED(hres)) {
+ /* bombed */
+ ERR("failed IPersistFile::Save %08x\n", hres);
+ goto fail;
+ }
+ hres = IPersistFile_SaveCompleted(pPf, widelink);
+ TRACE("shortcut %s has been created, result=%08x\n",
+ new_lnk_filepath, hres);
+ }
+ else {
+ ERR("CoCreateInstance failed, hres=%08x\n", hres);
+ }
}
fail:
@@ -1032,7 +1033,7 @@
}
/*************************************************************************
- * SHCreateShellFolderViewEx [SHELL32.174]
+ * SHCreateShellFolderViewEx [SHELL32.174]
*
* Create a new instance of the default Shell folder view object.
*
@@ -1044,32 +1045,33 @@
* see IShellFolder::CreateViewObject
*/
HRESULT WINAPI SHCreateShellFolderViewEx(
- 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=%p\n",
- psvcbi->pshf, psvcbi->pidl, psvcbi->pfnCallback,
- psvcbi->fvm, psvcbi->psvOuter);
-
- *ppv = NULL;
+ 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=%p\n",
+ psvcbi->pshf, psvcbi->pidl, psvcbi->pfnCallback,
+ psvcbi->fvm, psvcbi->psvOuter);
+
+ *ppv = NULL;
hRes = IShellView_Constructor(psvcbi->pshf, &psf);
+
if (FAILED(hRes))
return hRes;
- hRes = IShellView_QueryInterface(psf, &IID_IShellView, (LPVOID *)ppv);
-
- return hRes;
-}
-/*************************************************************************
- * SHWinHelp [SHELL32.127]
+ hRes = IShellView_QueryInterface(psf, &IID_IShellView, (LPVOID *)ppv);
+
+ return hRes;
+}
+/*************************************************************************
+ * SHWinHelp [SHELL32.127]
*
*/
EXTERN_C HRESULT WINAPI SHWinHelp (DWORD v, DWORD w, DWORD x, DWORD z)
-{ FIXME("0x%08x 0x%08x 0x%08x 0x%08x stub\n",v,w,x,z);
- return 0;
+{ FIXME("0x%08x 0x%08x 0x%08x 0x%08x stub\n",v,w,x,z);
+ return 0;
}
/*************************************************************************
* SHRunControlPanel [SHELL32.161]
@@ -1083,34 +1085,34 @@
static IUnknown * SHELL32_IExplorerInterface=0;
/*************************************************************************
- * SHSetInstanceExplorer [SHELL32.176]
+ * SHSetInstanceExplorer [SHELL32.176]
*
* NOTES
* Sets the interface
*/
VOID WINAPI SHSetInstanceExplorer (IUnknown * lpUnknown)
-{ TRACE("%p\n", lpUnknown);
- SHELL32_IExplorerInterface = lpUnknown;
-}
-/*************************************************************************
- * SHGetInstanceExplorer [SHELL32.@]
+{ TRACE("%p\n", lpUnknown);
+ SHELL32_IExplorerInterface = lpUnknown;
+}
+/*************************************************************************
+ * SHGetInstanceExplorer [SHELL32.@]
*
* NOTES
* gets the interface pointer of the explorer and a reference
*/
HRESULT WINAPI SHGetInstanceExplorer (IUnknown **lpUnknown)
-{ TRACE("%p\n", lpUnknown);
-
- *lpUnknown = SHELL32_IExplorerInterface;
-
- if (!SHELL32_IExplorerInterface)
- return E_FAIL;
-
- IUnknown_AddRef(SHELL32_IExplorerInterface);
- return S_OK;
-}
-/*************************************************************************
- * SHFreeUnusedLibraries [SHELL32.123]
+{ TRACE("%p\n", lpUnknown);
+
+ *lpUnknown = SHELL32_IExplorerInterface;
+
+ if (!SHELL32_IExplorerInterface)
+ return E_FAIL;
+
+ IUnknown_AddRef(SHELL32_IExplorerInterface);
+ return S_OK;
+}
+/*************************************************************************
+ * SHFreeUnusedLibraries [SHELL32.123]
*
* Probably equivalent to CoFreeUnusedLibraries but under Windows 9x it could use
* the shell32 built-in "mini-COM" without the need to load ole32.dll - see
SHLoadOLE
@@ -1124,11 +1126,11 @@
*/
void WINAPI SHFreeUnusedLibraries (void)
{
- FIXME("stub\n");
- CoFreeUnusedLibraries();
-}
-/*************************************************************************
- * DAD_AutoScroll [SHELL32.129]
+ FIXME("stub\n");
+ CoFreeUnusedLibraries();
+}
+/*************************************************************************
+ * DAD_AutoScroll [SHELL32.129]
*
*/
BOOL WINAPI DAD_AutoScroll(HWND hwnd, AUTO_SCROLL_DATA *samples, const POINT * pt)
@@ -1137,7 +1139,7 @@
return FALSE;
}
/*************************************************************************
- * DAD_DragEnter [SHELL32.130]
+ * DAD_DragEnter [SHELL32.130]
*
*/
BOOL WINAPI DAD_DragEnter(HWND hwnd)
@@ -1146,7 +1148,7 @@
return FALSE;
}
/*************************************************************************
- * DAD_DragEnterEx [SHELL32.131]
+ * DAD_DragEnterEx [SHELL32.131]
*
*/
BOOL WINAPI DAD_DragEnterEx(HWND hwnd, POINT p)
@@ -1155,7 +1157,7 @@
return FALSE;
}
/*************************************************************************
- * DAD_DragMove [SHELL32.134]
+ * DAD_DragMove [SHELL32.134]
*
*/
BOOL WINAPI DAD_DragMove(POINT p)
@@ -1164,7 +1166,7 @@
return FALSE;
}
/*************************************************************************
- * DAD_DragLeave [SHELL32.132]
+ * DAD_DragLeave [SHELL32.132]
*
*/
BOOL WINAPI DAD_DragLeave(VOID)
@@ -1173,20 +1175,20 @@
return FALSE;
}
/*************************************************************************
- * DAD_SetDragImage [SHELL32.136]
+ * DAD_SetDragImage [SHELL32.136]
*
* NOTES
* exported by name
*/
BOOL WINAPI DAD_SetDragImage(
- HIMAGELIST himlTrack,
- LPPOINT lppt)
+ HIMAGELIST himlTrack,
+ LPPOINT lppt)
{
FIXME("%p %p stub\n",himlTrack, lppt);
- return FALSE;
-}
-/*************************************************************************
- * DAD_ShowDragImage [SHELL32.137]
+ return FALSE;
+}
+/*************************************************************************
+ * DAD_ShowDragImage [SHELL32.137]
*
* NOTES
* exported by name
@@ -1209,87 +1211,87 @@
static const WCHAR szwSettings[] = {
'S','e','t','t','i','n','g','s',0
};
/*************************************************************************
- * ReadCabinetState [SHELL32.651] NT 4.0
+ * ReadCabinetState [SHELL32.651] NT 4.0
*
*/
BOOL WINAPI ReadCabinetState(CABINETSTATE *cs, int length)
{
- HKEY hkey = 0;
- DWORD type, r;
-
- TRACE("%p %d\n", cs, length);
-
- if( (cs == NULL) || (length < (int)sizeof(*cs)) )
- return FALSE;
-
- r = RegOpenKeyW( HKEY_CURRENT_USER, szwCabLocation, &hkey );
- if( r == ERROR_SUCCESS )
- {
- type = REG_BINARY;
- r = RegQueryValueExW( hkey, szwSettings,
- NULL, &type, (LPBYTE)cs, (LPDWORD)&length );
- RegCloseKey( hkey );
-
- }
-
- /* if we can't read from the registry, create default values */
- if ( (r != ERROR_SUCCESS) || (cs->cLength < sizeof(*cs)) ||
- (cs->cLength != length) )
- {
- ERR("Initializing shell cabinet settings\n");
- memset(cs, 0, sizeof(*cs));
- cs->cLength = sizeof(*cs);
- cs->nVersion = 2;
- cs->fFullPathTitle = FALSE;
- cs->fSaveLocalView = TRUE;
- cs->fNotShell = FALSE;
- cs->fSimpleDefault = TRUE;
- cs->fDontShowDescBar = FALSE;
- cs->fNewWindowMode = FALSE;
- cs->fShowCompColor = FALSE;
- cs->fDontPrettyNames = FALSE;
- cs->fAdminsCreateCommonGroups = TRUE;
- cs->fMenuEnumFilter = 96;
- }
-
- return TRUE;
-}
-
-/*************************************************************************
- * WriteCabinetState [SHELL32.652] NT 4.0
+ HKEY hkey = 0;
+ DWORD type, r;
+
+ TRACE("%p %d\n", cs, length);
+
+ if( (cs == NULL) || (length < (int)sizeof(*cs)) )
+ return FALSE;
+
+ r = RegOpenKeyW( HKEY_CURRENT_USER, szwCabLocation, &hkey );
+ if( r == ERROR_SUCCESS )
+ {
+ type = REG_BINARY;
+ r = RegQueryValueExW( hkey, szwSettings,
+ NULL, &type, (LPBYTE)cs, (LPDWORD)&length );
+ RegCloseKey( hkey );
+
+ }
+
+ /* if we can't read from the registry, create default values */
+ if ( (r != ERROR_SUCCESS) || (cs->cLength < sizeof(*cs)) ||
+ (cs->cLength != length) )
+ {
+ ERR("Initializing shell cabinet settings\n");
+ memset(cs, 0, sizeof(*cs));
+ cs->cLength = sizeof(*cs);
+ cs->nVersion = 2;
+ cs->fFullPathTitle = FALSE;
+ cs->fSaveLocalView = TRUE;
+ cs->fNotShell = FALSE;
+ cs->fSimpleDefault = TRUE;
+ cs->fDontShowDescBar = FALSE;
+ cs->fNewWindowMode = FALSE;
+ cs->fShowCompColor = FALSE;
+ cs->fDontPrettyNames = FALSE;
+ cs->fAdminsCreateCommonGroups = TRUE;
+ cs->fMenuEnumFilter = 96;
+ }
+
+ return TRUE;
+}
+
+/*************************************************************************
+ * WriteCabinetState [SHELL32.652] NT 4.0
*
*/
BOOL WINAPI WriteCabinetState(CABINETSTATE *cs)
{
- DWORD r;
- HKEY hkey = 0;
-
- TRACE("%p\n",cs);
-
- if( cs == NULL )
- return FALSE;
-
- r = RegCreateKeyExW( HKEY_CURRENT_USER, szwCabLocation, 0,
- NULL, 0, KEY_ALL_ACCESS, NULL, &hkey, NULL);
- if( r == ERROR_SUCCESS )
- {
- r = RegSetValueExW( hkey, szwSettings, 0,
- REG_BINARY, (LPBYTE) cs, cs->cLength);
-
- RegCloseKey( hkey );
- }
-
- return (r==ERROR_SUCCESS);
-}
-
-/*************************************************************************
- * FileIconInit [SHELL32.660]
+ DWORD r;
+ HKEY hkey = 0;
+
+ TRACE("%p\n",cs);
+
+ if( cs == NULL )
+ return FALSE;
+
+ r = RegCreateKeyExW( HKEY_CURRENT_USER, szwCabLocation, 0,
+ NULL, 0, KEY_ALL_ACCESS, NULL, &hkey, NULL);
+ if( r == ERROR_SUCCESS )
+ {
+ r = RegSetValueExW( hkey, szwSettings, 0,
+ REG_BINARY, (LPBYTE) cs, cs->cLength);
+
+ RegCloseKey( hkey );
+ }
+
+ return (r==ERROR_SUCCESS);
+}
+
+/*************************************************************************
+ * FileIconInit [SHELL32.660]
*
*/
BOOL WINAPI FileIconInit(BOOL bFullInit)
{
FIXME("(%s)\n", bFullInit ? "true" : "false");
- return FALSE;
+ return FALSE;
}
/*************************************************************************
@@ -1315,7 +1317,6 @@
BOOL bResult = FALSE;
TRACE("\n");
-
if (!OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &hToken))
{
return FALSE;
@@ -1345,7 +1346,6 @@
}
CloseHandle(hToken);
-
if (!AllocateAndInitializeSid(&Authority, 2, SECURITY_BUILTIN_DOMAIN_RID,
DOMAIN_ALIAS_RID_ADMINS, 0, 0, 0, 0, 0, 0,
&lpSid))
@@ -1369,7 +1369,7 @@
}
/*************************************************************************
- * SHAllocShared [SHELL32.520]
+ * SHAllocShared [SHELL32.520]
*
* See shlwapi.SHAllocShared
*/
@@ -1383,7 +1383,7 @@
}
/*************************************************************************
- * SHLockShared [SHELL32.521]
+ * SHLockShared [SHELL32.521]
*
* See shlwapi.SHLockShared
*/
@@ -1397,7 +1397,7 @@
}
/*************************************************************************
- * SHUnlockShared [SHELL32.522]
+ * SHUnlockShared [SHELL32.522]
*
* See shlwapi.SHUnlockShared
*/
@@ -1411,7 +1411,7 @@
}
/*************************************************************************
- * SHFreeShared [SHELL32.523]
+ * SHFreeShared [SHELL32.523]
*
* See shlwapi.SHFreeShared
*/
@@ -1425,15 +1425,15 @@
}
/*************************************************************************
- * SetAppStartingCursor [SHELL32.99]
+ * SetAppStartingCursor [SHELL32.99]
*/
EXTERN_C HRESULT WINAPI SetAppStartingCursor(HWND u, DWORD v)
-{ FIXME("hwnd=%p 0x%04x stub\n",u,v );
- return 0;
-}
-
-/*************************************************************************
- * SHLoadOLE [SHELL32.151]
+{ FIXME("hwnd=%p 0x%04x stub\n",u,v );
+ return 0;
+}
+
+/*************************************************************************
+ * SHLoadOLE [SHELL32.151]
*
* To reduce the memory usage of Windows 95, its shell32 contained an
* internal implementation of a part of COM (see e.g. SHGetMalloc, SHCoCreateInstance,
@@ -1452,11 +1452,11 @@
* hack in SHCoCreateInstance)
*/
HRESULT WINAPI SHLoadOLE(LPARAM lParam)
-{ FIXME("0x%08lx stub\n",lParam);
- return S_OK;
-}
-/*************************************************************************
- * DriveType [SHELL32.64]
+{ FIXME("0x%08lx stub\n",lParam);
+ return S_OK;
+}
+/*************************************************************************
+ * DriveType [SHELL32.64]
*
*/
EXTERN_C int WINAPI DriveType(int DriveType)
@@ -1465,7 +1465,6 @@
root[0] = L'A' + DriveType;
return GetDriveTypeW(root);
}
-
/*************************************************************************
* InvalidateDriveType [SHELL32.65]
* Unimplemented in XP SP3
@@ -1475,64 +1474,61 @@
TRACE("0x%08x stub\n",u);
return 0;
}
-
-/*************************************************************************
- * SHAbortInvokeCommand [SHELL32.198]
+/*************************************************************************
+ * SHAbortInvokeCommand [SHELL32.198]
*
*/
EXTERN_C HRESULT WINAPI SHAbortInvokeCommand(void)
-{ FIXME("stub\n");
- return 1;
-}
-
-/*************************************************************************
- * SHOutOfMemoryMessageBox [SHELL32.126]
+{ FIXME("stub\n");
+ return 1;
+}
+/*************************************************************************
+ * SHOutOfMemoryMessageBox [SHELL32.126]
*
*/
int WINAPI SHOutOfMemoryMessageBox(
- HWND hwndOwner,
- LPCSTR lpCaption,
- UINT uType)
-{
- FIXME("%p %s 0x%08x stub\n",hwndOwner, lpCaption, uType);
+ HWND hwndOwner,
+ LPCSTR lpCaption,
+ UINT uType)
+{
+ FIXME("%p %s 0x%08x stub\n",hwndOwner, lpCaption, uType);
+ return 0;
+}
+/*************************************************************************
+ * SHFlushClipboard [SHELL32.121]
+ *
+ */
+EXTERN_C HRESULT WINAPI SHFlushClipboard(void)
+{
+ return OleFlushClipboard();
+}
+
+/*************************************************************************
+ * SHWaitForFileToOpen [SHELL32.97]
+ *
+ */
+BOOL WINAPI SHWaitForFileToOpen(
+ LPCITEMIDLIST pidl,
+ DWORD dwFlags,
+ DWORD dwTimeout)
+{
+ FIXME("%p 0x%08x 0x%08x stub\n", pidl, dwFlags, dwTimeout);
return 0;
}
-/*************************************************************************
- * SHFlushClipboard [SHELL32.121]
- *
- */
-EXTERN_C HRESULT WINAPI SHFlushClipboard(void)
-{
- return OleFlushClipboard();
-}
-
-/*************************************************************************
- * SHWaitForFileToOpen [SHELL32.97]
- *
- */
-BOOL WINAPI SHWaitForFileToOpen(
- LPCITEMIDLIST pidl,
- DWORD dwFlags,
- DWORD dwTimeout)
-{
- FIXME("%p 0x%08x 0x%08x stub\n", pidl, dwFlags, dwTimeout);
- return 0;
-}
-
/************************************************************************
- * RLBuildListOfPaths [SHELL32.146]
+ * RLBuildListOfPaths [SHELL32.146]
*
* NOTES
* builds a DPA
*/
EXTERN_C DWORD WINAPI RLBuildListOfPaths (void)
-{ FIXME("stub\n");
- return 0;
+{ FIXME("stub\n");
+ return 0;
}
/************************************************************************
- * SHValidateUNC [SHELL32.173]
+ * SHValidateUNC [SHELL32.173]
*
*/
EXTERN_C BOOL WINAPI SHValidateUNC (HWND hwndOwner, LPWSTR pszFile, UINT fConnect)
@@ -1617,9 +1613,9 @@
}
/************************************************************************
- * DoEnvironmentSubst [SHELL32.53]
- *
- * See DoEnvironmentSubstA.
+ * DoEnvironmentSubst [SHELL32.53]
+ *
+ * See DoEnvironmentSubstA.
*/
DWORD WINAPI DoEnvironmentSubstAW(LPVOID x, UINT y)
{
@@ -1701,7 +1697,7 @@
}
/*************************************************************************
- * SHAddFromPropSheetExtArray [SHELL32.167]
+ * SHAddFromPropSheetExtArray [SHELL32.167]
*/
UINT WINAPI SHAddFromPropSheetExtArray(HPSXA hpsxa, LPFNADDPROPSHEETPAGE lpfnAddPage,
LPARAM lParam)
{
@@ -1731,16 +1727,15 @@
}
/*************************************************************************
- * SHCreatePropSheetExtArray [SHELL32.168]
+ * SHCreatePropSheetExtArray [SHELL32.168]
*/
HPSXA WINAPI SHCreatePropSheetExtArray(HKEY hKey, LPCWSTR pszSubKey, UINT max_iface)
{
return SHCreatePropSheetExtArrayEx(hKey, pszSubKey, max_iface, NULL);
}
-
-/*************************************************************************
- * SHCreatePropSheetExtArrayEx [SHELL32.194]
+/*************************************************************************
+ * SHCreatePropSheetExtArrayEx [SHELL32.194]
*/
EXTERN_C HPSXA WINAPI SHCreatePropSheetExtArrayEx(HKEY hKey, LPCWSTR pszSubKey, UINT
max_iface, IDataObject *pDataObj)
{
@@ -1822,6 +1817,7 @@
}
}
}
+
} while (psxa->uiCount != psxa->uiAllocated);
}
else
@@ -1840,7 +1836,7 @@
}
/*************************************************************************
- * SHReplaceFromPropSheetExtArray [SHELL32.170]
+ * SHReplaceFromPropSheetExtArray [SHELL32.170]
*/
UINT WINAPI SHReplaceFromPropSheetExtArray(HPSXA hpsxa, UINT uPageID,
LPFNADDPROPSHEETPAGE lpfnReplaceWith, LPARAM lParam)
{
@@ -1871,7 +1867,7 @@
}
/*************************************************************************
- * SHDestroyPropSheetExtArray [SHELL32.169]
+ * SHDestroyPropSheetExtArray [SHELL32.169]
*/
void WINAPI SHDestroyPropSheetExtArray(HPSXA hpsxa)
{
@@ -1892,14 +1888,14 @@
}
/*************************************************************************
- * CIDLData_CreateFromIDArray [SHELL32.83]
+ * CIDLData_CreateFromIDArray [SHELL32.83]
*
* Create IDataObject from PIDLs??
*/
HRESULT WINAPI CIDLData_CreateFromIDArray(
- LPCITEMIDLIST pidlFolder,
+ LPCITEMIDLIST pidlFolder,
UINT cpidlFiles,
- LPCITEMIDLIST *lppidlFiles,
+ LPCITEMIDLIST *lppidlFiles,
IDataObject **ppdataObject)
{
UINT i;
@@ -1909,7 +1905,7 @@
TRACE("(%p, %d, %p, %p)\n", pidlFolder, cpidlFiles, lppidlFiles,
ppdataObject);
if (TRACE_ON(pidl))
{
- pdump (pidlFolder);
+ pdump (pidlFolder);
for (i = 0; i < cpidlFiles; i++)
pdump(lppidlFiles[i]);
}
@@ -1918,26 +1914,26 @@
}
/*************************************************************************
- * SHCreateStdEnumFmtEtc [SHELL32.74]
+ * SHCreateStdEnumFmtEtc [SHELL32.74]
*
* NOTES
*
*/
HRESULT WINAPI SHCreateStdEnumFmtEtc(
UINT cFormats,
- const FORMATETC *lpFormats,
- LPENUMFORMATETC *ppenumFormatetc)
-{
- IEnumFORMATETC *pef;
- HRESULT hRes;
- TRACE("cf=%d fe=%p pef=%p\n", cFormats, lpFormats, ppenumFormatetc);
+ const FORMATETC *lpFormats,
+ LPENUMFORMATETC *ppenumFormatetc)
+{
+ IEnumFORMATETC *pef;
+ HRESULT hRes;
+ TRACE("cf=%d fe=%p pef=%p\n", cFormats, lpFormats, ppenumFormatetc);
hRes = IEnumFORMATETC_Constructor(cFormats, lpFormats, &pef);
if (FAILED(hRes))
return hRes;
- IEnumFORMATETC_AddRef(pef);
- hRes = IEnumFORMATETC_QueryInterface(pef, &IID_IEnumFORMATETC,
(LPVOID*)ppenumFormatetc);
+ IEnumFORMATETC_AddRef(pef);
+ hRes = IEnumFORMATETC_QueryInterface(pef, &IID_IEnumFORMATETC,
(LPVOID*)ppenumFormatetc);
return hRes;
}
@@ -1968,7 +1964,7 @@
}
/*************************************************************************
- * SHFindFiles (SHELL32.90)
+ * SHFindFiles (SHELL32.90)
*/
BOOL WINAPI SHFindFiles( LPCITEMIDLIST pidlFolder, LPCITEMIDLIST pidlSaveFile )
{
@@ -1977,7 +1973,7 @@
}
/*************************************************************************
- * SHUpdateImageW (SHELL32.192)
+ * SHUpdateImageW (SHELL32.192)
*
* Notifies the shell that an icon in the system image list has been changed.
*
@@ -2001,7 +1997,7 @@
}
/*************************************************************************
- * SHUpdateImageA (SHELL32.191)
+ * SHUpdateImageA (SHELL32.191)
*
* See SHUpdateImageW.
*/
@@ -2093,9 +2089,6 @@
return TRUE;
}
-/*************************************************************************
- * SHStartNetConnectionDialog (SHELL32.@)
- */
HRESULT WINAPI SHStartNetConnectionDialog(HWND hwnd, LPCSTR pszRemoteName, DWORD dwType)
{
FIXME("%p, %s, 0x%08x - stub\n", hwnd, debugstr_a(pszRemoteName), dwType);
@@ -2259,7 +2252,6 @@
{
FIXME("()\n");
return TRUE;
-
}
/*************************************************************************