Author: janderwald
Date: Thu May 7 22:05:29 2009
New Revision: 40828
URL:
http://svn.reactos.org/svn/reactos?rev=40828&view=rev
Log:
- Pass IDataObject to the folder shell extension init function
- Fixes displaying property sheet handler extension for directories such as TortoiseSVN
Modified:
trunk/reactos/dll/win32/shell32/folder_options.c
trunk/reactos/dll/win32/shell32/fprop.c
trunk/reactos/dll/win32/shell32/shell32_main.h
Modified: trunk/reactos/dll/win32/shell32/folder_options.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/folder_o…
==============================================================================
--- trunk/reactos/dll/win32/shell32/folder_options.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/folder_options.c [iso-8859-1] Thu May 7 22:05:29
2009
@@ -83,6 +83,7 @@
};
*/
+HPSXA WINAPI SHCreatePropSheetExtArrayEx(HKEY hKey, LPCWSTR pszSubKey, UINT max_iface,
IDataObject *pDataObj);
INT_PTR
CALLBACK
@@ -562,15 +563,16 @@
}
BOOL
-SH_ShowFolderProperties(LPWSTR pwszFolder)
+SH_ShowFolderProperties(LPWSTR pwszFolder, LPCITEMIDLIST pidlFolder, LPCITEMIDLIST *
apidl)
{
HPROPSHEETPAGE hppages[MAX_PROPERTY_SHEET_PAGE];
HPROPSHEETPAGE hpage;
PROPSHEETHEADERW psh;
BOOL ret;
WCHAR szName[MAX_PATH] = {0};
- HPSXA hpsx;
+ HPSXA hpsx = NULL;
LPWSTR pFolderName;
+ IDataObject * pDataObj = NULL;
if (!PathIsDirectoryW(pwszFolder))
return FALSE;
@@ -594,15 +596,25 @@
psh.u3.phpage = hppages;
psh.pszCaption = szName;
- hpsx = SHCreatePropSheetExtArray(HKEY_CLASSES_ROOT,
- L"Directory",
- MAX_PROPERTY_SHEET_PAGE-1);
-
- SHAddFromPropSheetExtArray(hpsx,
- (LPFNADDPROPSHEETPAGE)FolderAddPropSheetPageProc,
- (LPARAM)&psh);
+
+ if (SHCreateDataObject(pidlFolder, 1, apidl, NULL, &IID_IDataObject,
(void**)&pDataObj) == S_OK)
+ {
+ hpsx = SHCreatePropSheetExtArrayEx(HKEY_CLASSES_ROOT, L"Directory",
MAX_PROPERTY_SHEET_PAGE-1, pDataObj);
+ if (hpsx)
+ {
+ SHAddFromPropSheetExtArray(hpsx,
+ (LPFNADDPROPSHEETPAGE)FolderAddPropSheetPageProc,
+ (LPARAM)&psh);
+ }
+ }
ret = PropertySheetW(&psh);
+ if (pDataObj)
+ IDataObject_Release(pDataObj);
+
+ if (hpsx)
+ SHDestroyPropSheetExtArray(hpsx);
+
if (ret < 0)
return FALSE;
else
Modified: trunk/reactos/dll/win32/shell32/fprop.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/fprop.c?…
==============================================================================
--- trunk/reactos/dll/win32/shell32/fprop.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/fprop.c [iso-8859-1] Thu May 7 22:05:29 2009
@@ -807,7 +807,7 @@
if (PathIsDirectoryW(wFileName))
{
- return SH_ShowFolderProperties(wFileName);
+ return SH_ShowFolderProperties(wFileName, pidlFolder, apidl);
}
if (wcslen(wFileName) == 3)
Modified: trunk/reactos/dll/win32/shell32/shell32_main.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shell32_…
==============================================================================
--- trunk/reactos/dll/win32/shell32/shell32_main.h [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/shell32_main.h [iso-8859-1] Thu May 7 22:05:29 2009
@@ -235,5 +235,5 @@
BOOL SH_ShowDriveProperties(WCHAR * drive, LPCITEMIDLIST pidlFolder, LPCITEMIDLIST *
apidl);
BOOL SH_ShowRecycleBinProperties(WCHAR sDrive);
BOOL SH_ShowPropertiesDialog(LPWSTR lpf, LPCITEMIDLIST pidlFolder, LPCITEMIDLIST *
apidl);
-BOOL SH_ShowFolderProperties(LPWSTR pwszFolder);
+BOOL SH_ShowFolderProperties(LPWSTR pwszFolder, LPCITEMIDLIST pidlFolder, LPCITEMIDLIST *
apidl);
#endif