mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2024-09-13 09:17:20 -07:00
Rebase against 7f955f22d317cad1e7d5323179e9a0ee635c9768.
This commit is contained in:
parent
e9ce651159
commit
ec4fd3ebdc
@ -1,4 +1,4 @@
|
||||
From bee86127f9ab33523d66ef7d28b8a44519a8852b Mon Sep 17 00:00:00 2001
|
||||
From 2f853c3bc210e0aa49e47cade7ae81f47c3bd430 Mon Sep 17 00:00:00 2001
|
||||
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
|
||||
Date: Sat, 26 Jul 2014 12:31:50 -0600
|
||||
Subject: iphlpapi: Implement AllocateAndGetTcpExTableFromStack. (v2)
|
||||
@ -7,11 +7,11 @@ Based on a patch by Ralf Habacker.
|
||||
---
|
||||
dlls/iphlpapi/iphlpapi.spec | 1 +
|
||||
dlls/iphlpapi/ipstats.c | 36 ++++++++++++++++++++++++++++++++++++
|
||||
dlls/iphlpapi/ipstats.h | 1 +
|
||||
include/iphlpapi.h | 1 +
|
||||
3 files changed, 38 insertions(+)
|
||||
|
||||
diff --git a/dlls/iphlpapi/iphlpapi.spec b/dlls/iphlpapi/iphlpapi.spec
|
||||
index 4be42fe9971..05d1ada5b07 100644
|
||||
index 1686644..4769c3c 100644
|
||||
--- a/dlls/iphlpapi/iphlpapi.spec
|
||||
+++ b/dlls/iphlpapi/iphlpapi.spec
|
||||
@@ -5,6 +5,7 @@
|
||||
@ -23,10 +23,10 @@ index 4be42fe9971..05d1ada5b07 100644
|
||||
@ stdcall AllocateAndGetUdpTableFromStack( ptr long long long )
|
||||
@ stdcall CancelIPChangeNotify( ptr )
|
||||
diff --git a/dlls/iphlpapi/ipstats.c b/dlls/iphlpapi/ipstats.c
|
||||
index 5965bf9dae6..4284b91bf20 100644
|
||||
index 863edd3..2d7bdfd 100644
|
||||
--- a/dlls/iphlpapi/ipstats.c
|
||||
+++ b/dlls/iphlpapi/ipstats.c
|
||||
@@ -2327,6 +2327,42 @@ DWORD WINAPI AllocateAndGetTcpTableFromStack( PMIB_TCPTABLE *ppTcpTable, BOOL bO
|
||||
@@ -2330,6 +2330,42 @@ DWORD WINAPI AllocateAndGetTcpTableFromStack( PMIB_TCPTABLE *ppTcpTable, BOOL bO
|
||||
return build_tcp_table( TCP_TABLE_BASIC_ALL, (void **)ppTcpTable, bOrder, heap, flags, NULL );
|
||||
}
|
||||
|
||||
@ -69,18 +69,18 @@ index 5965bf9dae6..4284b91bf20 100644
|
||||
static DWORD get_udp_table_sizes( UDP_TABLE_CLASS class, DWORD row_count, DWORD *row_size )
|
||||
{
|
||||
DWORD table_size;
|
||||
diff --git a/dlls/iphlpapi/ipstats.h b/dlls/iphlpapi/ipstats.h
|
||||
index bf5bb9269fc..d8835aa3154 100644
|
||||
--- a/dlls/iphlpapi/ipstats.h
|
||||
+++ b/dlls/iphlpapi/ipstats.h
|
||||
@@ -34,6 +34,7 @@ DWORD getInterfaceStatsByName(const char *name, PMIB_IFROW entry) DECLSPEC_HIDDE
|
||||
diff --git a/include/iphlpapi.h b/include/iphlpapi.h
|
||||
index 54d93d1..8ed6c78 100644
|
||||
--- a/include/iphlpapi.h
|
||||
+++ b/include/iphlpapi.h
|
||||
@@ -156,6 +156,7 @@ ULONG WINAPI GetAdaptersAddresses(ULONG family, ULONG flags, PVOID reserved,
|
||||
|
||||
DWORD WINAPI AllocateAndGetUdpTableFromStack(PMIB_UDPTABLE *ppUdpTable, BOOL bOrder, HANDLE heap, DWORD flags) DECLSPEC_HIDDEN;
|
||||
DWORD WINAPI AllocateAndGetTcpTableFromStack(PMIB_TCPTABLE *ppTcpTable, BOOL bOrder, HANDLE heap, DWORD flags) DECLSPEC_HIDDEN;
|
||||
+DWORD WINAPI AllocateAndGetTcpExTableFromStack(VOID **ppTcpTable, BOOL bOrder, HANDLE heap, DWORD flags, DWORD family) DECLSPEC_HIDDEN;
|
||||
DWORD WINAPI AllocateAndGetIpNetTableFromStack(PMIB_IPNETTABLE *ppIpNetTable, BOOL bOrder, HANDLE heap, DWORD flags) DECLSPEC_HIDDEN;
|
||||
DWORD WINAPI AllocateAndGetIpForwardTableFromStack(PMIB_IPFORWARDTABLE *ppIpForwardTable, BOOL bOrder, HANDLE heap, DWORD flags) DECLSPEC_HIDDEN;
|
||||
DWORD WINAPI AllocateAndGetUdpTableFromStack(PMIB_UDPTABLE *ppUdpTable, BOOL bOrder, HANDLE heap, DWORD flags);
|
||||
DWORD WINAPI AllocateAndGetTcpTableFromStack(PMIB_TCPTABLE *ppTcpTable, BOOL bOrder, HANDLE heap, DWORD flags);
|
||||
+DWORD WINAPI AllocateAndGetTcpExTableFromStack(VOID **ppTcpTable, BOOL bOrder, HANDLE heap, DWORD flags, DWORD family);
|
||||
DWORD WINAPI AllocateAndGetIpNetTableFromStack(PMIB_IPNETTABLE *ppIpNetTable, BOOL bOrder, HANDLE heap, DWORD flags);
|
||||
DWORD WINAPI AllocateAndGetIpForwardTableFromStack(PMIB_IPFORWARDTABLE *ppIpForwardTable, BOOL bOrder, HANDLE heap, DWORD flags);
|
||||
|
||||
--
|
||||
2.11.0
|
||||
2.7.4
|
||||
|
||||
|
1
patches/kernel32-Debugger/definition
Normal file
1
patches/kernel32-Debugger/definition
Normal file
@ -0,0 +1 @@
|
||||
Fixes: [35928] Crash handlers/debuggers fail to display user-interface when invoked for crashing (non-interactive) service processes (inherited Wine service window station/desktop)
|
@ -1,43 +0,0 @@
|
||||
From cd1986bee6af083bfcb46eebdc3c40d040f35b43 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Sun, 17 Jan 2016 00:48:11 +0100
|
||||
Subject: ntdll: Add stub for RtlQueryPackageIdentity.
|
||||
|
||||
---
|
||||
dlls/ntdll/ntdll.spec | 1 +
|
||||
dlls/ntdll/rtl.c | 10 ++++++++++
|
||||
2 files changed, 11 insertions(+)
|
||||
|
||||
diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec
|
||||
index 50f4acf5926..c6f15c53ded 100644
|
||||
--- a/dlls/ntdll/ntdll.spec
|
||||
+++ b/dlls/ntdll/ntdll.spec
|
||||
@@ -810,6 +810,7 @@
|
||||
@ stdcall RtlQueryInformationActivationContext(long long ptr long ptr long ptr)
|
||||
@ stub RtlQueryInformationActiveActivationContext
|
||||
@ stub RtlQueryInterfaceMemoryStream
|
||||
+@ stdcall RtlQueryPackageIdentity(long ptr ptr ptr ptr ptr)
|
||||
@ stub RtlQueryProcessBackTraceInformation
|
||||
@ stdcall RtlQueryProcessDebugInformation(long long ptr)
|
||||
@ stub RtlQueryProcessHeapInformation
|
||||
diff --git a/dlls/ntdll/rtl.c b/dlls/ntdll/rtl.c
|
||||
index 09a9c921bb5..8ade7525f0e 100644
|
||||
--- a/dlls/ntdll/rtl.c
|
||||
+++ b/dlls/ntdll/rtl.c
|
||||
@@ -1672,3 +1672,13 @@ RTL_UNLOAD_EVENT_TRACE * WINAPI RtlGetUnloadEventTrace(void)
|
||||
FIXME("stub!\n");
|
||||
return NULL;
|
||||
}
|
||||
+
|
||||
+/*********************************************************************
|
||||
+ * RtlQueryPackageIdentity [NTDLL.@]
|
||||
+ */
|
||||
+NTSTATUS WINAPI RtlQueryPackageIdentity(HANDLE token, WCHAR *fullname, SIZE_T *fullname_size,
|
||||
+ WCHAR *appid, SIZE_T *appid_size, BOOLEAN *packaged)
|
||||
+{
|
||||
+ FIXME("(%p, %p, %p, %p, %p, %p): stub\n", token, fullname, fullname_size, appid, appid_size, packaged);
|
||||
+ return STATUS_NOT_FOUND;
|
||||
+}
|
||||
--
|
||||
2.14.1
|
||||
|
@ -1,66 +0,0 @@
|
||||
From 3148c0a69b1dd084541d0e2b09ddd8f47ec732fc Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Sun, 17 Jan 2016 00:46:34 +0100
|
||||
Subject: [PATCH] include: Add IApplicationActivationManager interface
|
||||
declaration.
|
||||
|
||||
---
|
||||
include/shobjidl.idl | 37 +++++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 37 insertions(+)
|
||||
|
||||
diff --git a/include/shobjidl.idl b/include/shobjidl.idl
|
||||
index e0fe01c..73278e4 100644
|
||||
--- a/include/shobjidl.idl
|
||||
+++ b/include/shobjidl.idl
|
||||
@@ -3713,6 +3713,35 @@ interface IItemNameLimits : IUnknown
|
||||
[out] int *max_length);
|
||||
}
|
||||
|
||||
+typedef [v1_enum] enum ACTIVATEOPTIONS
|
||||
+{
|
||||
+ AO_NONE = 0x00000000,
|
||||
+ AO_DESIGNMODE = 0x00000001,
|
||||
+ AO_NOERRORUI = 0x00000002,
|
||||
+ AO_NOSPLASHSCREEN = 0x00000004,
|
||||
+ AO_PRELAUNCH = 0x02000000
|
||||
+} ACTIVATEOPTIONS;
|
||||
+
|
||||
+[
|
||||
+ uuid(2e941141-7f97-4756-ba1d-9decde894a3d),
|
||||
+ object,
|
||||
+ pointer_default(unique)
|
||||
+]
|
||||
+interface IApplicationActivationManager : IUnknown
|
||||
+{
|
||||
+ HRESULT ActivateApplication([in] LPCWSTR appusermodelid,
|
||||
+ [in, unique] LPCWSTR arguments,
|
||||
+ [in] ACTIVATEOPTIONS options,
|
||||
+ [out] DWORD *processid);
|
||||
+ HRESULT ActivateForFile([in] LPCWSTR appusermodelid,
|
||||
+ [in] IShellItemArray *itemarray,
|
||||
+ [in, unique] LPCWSTR verb,
|
||||
+ [out] DWORD *processid);
|
||||
+ HRESULT ActivateForProtocol([in] LPCWSTR appusermodelid,
|
||||
+ [in] IShellItemArray *itemarray,
|
||||
+ [out] DWORD *processid);
|
||||
+}
|
||||
+
|
||||
/*****************************************************************************
|
||||
* ShellObjects typelibrary
|
||||
*/
|
||||
@@ -3817,4 +3846,12 @@ library ShellObjects
|
||||
{
|
||||
interface IQueryCancelAutoPlay;
|
||||
}
|
||||
+
|
||||
+ [
|
||||
+ uuid(45ba127d-10a8-46ea-8ab7-56ea9078943c)
|
||||
+ ]
|
||||
+ coclass ApplicationActivationManager
|
||||
+ {
|
||||
+ interface IApplicationActivationManager;
|
||||
+ }
|
||||
}
|
||||
--
|
||||
1.9.1
|
||||
|
@ -52,7 +52,7 @@ usage()
|
||||
# Get the upstream commit sha
|
||||
upstream_commit()
|
||||
{
|
||||
echo "540c48b91175b11c7b8646d0a036b20c46425080"
|
||||
echo "7f955f22d317cad1e7d5323179e9a0ee635c9768"
|
||||
}
|
||||
|
||||
# Show version information
|
||||
@ -313,7 +313,6 @@ patch_enable_all ()
|
||||
enable_shdocvw_ParseURLFromOutsideSource_Tests="$1"
|
||||
enable_shell32_ACE_Viewer="$1"
|
||||
enable_shell32_Context_Menu="$1"
|
||||
enable_shell32_File_Property_Dialog="$1"
|
||||
enable_shell32_Microsoft_Windows_Themes="$1"
|
||||
enable_shell32_NewMenu_Interface="$1"
|
||||
enable_shell32_Placeholder_Icons="$1"
|
||||
@ -1127,9 +1126,6 @@ patch_enable ()
|
||||
shell32-Context_Menu)
|
||||
enable_shell32_Context_Menu="$2"
|
||||
;;
|
||||
shell32-File_Property_Dialog)
|
||||
enable_shell32_File_Property_Dialog="$2"
|
||||
;;
|
||||
shell32-Microsoft_Windows_Themes)
|
||||
enable_shell32_Microsoft_Windows_Themes="$2"
|
||||
;;
|
||||
@ -2003,13 +1999,9 @@ if test "$enable_shell32_SHFileOperation_Win9x" -eq 1; then
|
||||
fi
|
||||
|
||||
if test "$enable_shell32_ACE_Viewer" -eq 1; then
|
||||
if test "$enable_shell32_File_Property_Dialog" -gt 1; then
|
||||
abort "Patchset shell32-File_Property_Dialog disabled, but shell32-ACE_Viewer depends on that."
|
||||
fi
|
||||
if test "$enable_shell32_Progress_Dialog" -gt 1; then
|
||||
abort "Patchset shell32-Progress_Dialog disabled, but shell32-ACE_Viewer depends on that."
|
||||
fi
|
||||
enable_shell32_File_Property_Dialog=1
|
||||
enable_shell32_Progress_Dialog=1
|
||||
fi
|
||||
|
||||
@ -4180,7 +4172,7 @@ fi
|
||||
# | * [#34372] Support for AllocateAndGetTcpExTableFromStack
|
||||
# |
|
||||
# | Modified files:
|
||||
# | * dlls/iphlpapi/iphlpapi.spec, dlls/iphlpapi/ipstats.c, dlls/iphlpapi/ipstats.h
|
||||
# | * dlls/iphlpapi/iphlpapi.spec, dlls/iphlpapi/ipstats.c, include/iphlpapi.h
|
||||
# |
|
||||
if test "$enable_iphlpapi_TCP_Table" -eq 1; then
|
||||
patch_apply iphlpapi-TCP_Table/0001-iphlpapi-Implement-AllocateAndGetTcpExTableFromStack.patch
|
||||
@ -4270,6 +4262,10 @@ fi
|
||||
|
||||
# Patchset kernel32-Debugger
|
||||
# |
|
||||
# | This patchset fixes the following Wine bugs:
|
||||
# | * [#35928] Crash handlers/debuggers fail to display user-interface when invoked for crashing (non-interactive) service
|
||||
# | processes (inherited Wine service window station/desktop)
|
||||
# |
|
||||
# | Modified files:
|
||||
# | * dlls/kernel32/except.c
|
||||
# |
|
||||
@ -5249,15 +5245,11 @@ fi
|
||||
# Patchset ntdll-RtlQueryPackageIdentity
|
||||
# |
|
||||
# | Modified files:
|
||||
# | * dlls/ntdll/ntdll.spec, dlls/ntdll/rtl.c, dlls/ntdll/tests/Makefile.in, dlls/ntdll/tests/rtl.c, include/shobjidl.idl
|
||||
# | * dlls/ntdll/tests/Makefile.in, dlls/ntdll/tests/rtl.c
|
||||
# |
|
||||
if test "$enable_ntdll_RtlQueryPackageIdentity" -eq 1; then
|
||||
patch_apply ntdll-RtlQueryPackageIdentity/0001-ntdll-Add-stub-for-RtlQueryPackageIdentity.patch
|
||||
patch_apply ntdll-RtlQueryPackageIdentity/0002-include-Add-IApplicationActivationManager-interface-.patch
|
||||
patch_apply ntdll-RtlQueryPackageIdentity/0003-ntdll-tests-Add-basic-tests-for-RtlQueryPackageIdent.patch
|
||||
(
|
||||
printf '%s\n' '+ { "Michael Müller", "ntdll: Add stub for RtlQueryPackageIdentity.", 1 },';
|
||||
printf '%s\n' '+ { "Michael Müller", "include: Add IApplicationActivationManager interface declaration.", 1 },';
|
||||
printf '%s\n' '+ { "Michael Müller", "ntdll/tests: Add basic tests for RtlQueryPackageIdentity.", 1 },';
|
||||
) >> "$patchlist"
|
||||
fi
|
||||
@ -6568,21 +6560,6 @@ if test "$enable_shdocvw_ParseURLFromOutsideSource_Tests" -eq 1; then
|
||||
) >> "$patchlist"
|
||||
fi
|
||||
|
||||
# Patchset shell32-File_Property_Dialog
|
||||
# |
|
||||
# | This patchset fixes the following Wine bugs:
|
||||
# | * [#40426] Implement general tab for file property dialog
|
||||
# |
|
||||
# | Modified files:
|
||||
# | * dlls/shell32/shell32.rc, dlls/shell32/shlview_cmenu.c, dlls/shell32/shresdef.h
|
||||
# |
|
||||
if test "$enable_shell32_File_Property_Dialog" -eq 1; then
|
||||
patch_apply shell32-File_Property_Dialog/0001-shell32-Add-general-tab-in-file-property-dialog.patch
|
||||
(
|
||||
printf '%s\n' '+ { "Michael Müller", "shell32: Add general tab in file property dialog.", 1 },';
|
||||
) >> "$patchlist"
|
||||
fi
|
||||
|
||||
# Patchset shell32-SHFileOperation_Move
|
||||
# |
|
||||
# | This patchset fixes the following Wine bugs:
|
||||
@ -6622,8 +6599,8 @@ fi
|
||||
# Patchset shell32-ACE_Viewer
|
||||
# |
|
||||
# | This patchset has the following (direct or indirect) dependencies:
|
||||
# | * shell32-File_Property_Dialog, server-File_Permissions, ntdll-FileDispositionInformation, kernel32-CopyFileEx,
|
||||
# | shell32-SHFileOperation_Move, shell32-Progress_Dialog
|
||||
# | * server-File_Permissions, ntdll-FileDispositionInformation, kernel32-CopyFileEx, shell32-SHFileOperation_Move,
|
||||
# | shell32-Progress_Dialog
|
||||
# |
|
||||
# | Modified files:
|
||||
# | * dlls/aclui/Makefile.in, dlls/aclui/aclui.rc, dlls/aclui/aclui_main.c, dlls/aclui/resource.h, dlls/aclui/user_icons.bmp,
|
||||
|
@ -1,4 +1,4 @@
|
||||
From 4bfacb4f36a83c5b9cd5826742da89d305d1c1b3 Mon Sep 17 00:00:00 2001
|
||||
From 10282216ac965075a8bf43734bfdaabd24fedf25 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Mon, 8 May 2017 23:33:45 +0200
|
||||
Subject: shell32: Add security property tab.
|
||||
@ -11,7 +11,7 @@ Subject: shell32: Add security property tab.
|
||||
4 files changed, 438 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/shell32/Makefile.in b/dlls/shell32/Makefile.in
|
||||
index b12d6169fb5..fd0b49a26d7 100644
|
||||
index 970ecba..d6d6eca 100644
|
||||
--- a/dlls/shell32/Makefile.in
|
||||
+++ b/dlls/shell32/Makefile.in
|
||||
@@ -1,7 +1,7 @@
|
||||
@ -24,10 +24,10 @@ index b12d6169fb5..fd0b49a26d7 100644
|
||||
EXTRALIBS = $(CORESERVICES_LIBS)
|
||||
# AUTHORS file is in the top-level directory
|
||||
diff --git a/dlls/shell32/shell32.rc b/dlls/shell32/shell32.rc
|
||||
index e11002db92e..11deef73f93 100644
|
||||
index 826e291..d7129b6 100644
|
||||
--- a/dlls/shell32/shell32.rc
|
||||
+++ b/dlls/shell32/shell32.rc
|
||||
@@ -205,6 +205,33 @@ the folder?"
|
||||
@@ -204,6 +204,33 @@ the folder?"
|
||||
IDS_RUNDLG_BROWSE_FILTER_EXE "Executable files (*.exe)"
|
||||
IDS_RUNDLG_BROWSE_FILTER_ALL "All files (*.*)"
|
||||
|
||||
@ -62,19 +62,22 @@ index e11002db92e..11deef73f93 100644
|
||||
/* FIXME: Some will be unused until desktop.ini support is implemented */
|
||||
IDS_PROGRAMS "Programs"
|
||||
diff --git a/dlls/shell32/shlview_cmenu.c b/dlls/shell32/shlview_cmenu.c
|
||||
index 50b4da11014..7545c598b39 100644
|
||||
index fc761e1..0bdb85e 100644
|
||||
--- a/dlls/shell32/shlview_cmenu.c
|
||||
+++ b/dlls/shell32/shlview_cmenu.c
|
||||
@@ -40,9 +40,128 @@
|
||||
@@ -39,12 +39,131 @@
|
||||
|
||||
#include "shresdef.h"
|
||||
#include "shlwapi.h"
|
||||
+#include "aclui.h"
|
||||
+#include "aclapi.h"
|
||||
+
|
||||
|
||||
#include "wine/heap.h"
|
||||
#include "wine/debug.h"
|
||||
|
||||
+/* Small hack: We need to remove DECLSPEC_HIDDEN from the aclui export. */
|
||||
+const GUID IID_ISecurityInformation = {0x965fc360, 0x16ff, 0x11d0, {0x91, 0xcb, 0x0, 0xaa, 0x0, 0xbb, 0xb7, 0x23}};
|
||||
|
||||
+
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(shell);
|
||||
|
||||
+/* According to https://blogs.msdn.microsoft.com/oldnewthing/20070726-00/?p=25833 */
|
||||
@ -194,8 +197,8 @@ index 50b4da11014..7545c598b39 100644
|
||||
typedef struct
|
||||
{
|
||||
IContextMenu3 IContextMenu3_iface;
|
||||
@@ -684,6 +803,269 @@ error:
|
||||
HeapFree(GetProcessHeap(), 0, props);
|
||||
@@ -615,6 +734,269 @@ error:
|
||||
heap_free(props);
|
||||
}
|
||||
|
||||
+static HRESULT WINAPI filesecurity_QueryInterface(ISecurityInformation *iface, REFIID riid, void **ppv)
|
||||
@ -464,16 +467,16 @@ index 50b4da11014..7545c598b39 100644
|
||||
#define MAX_PROP_PAGES 99
|
||||
|
||||
static void DoOpenProperties(ContextMenu *This, HWND hwnd)
|
||||
@@ -766,6 +1148,7 @@ static void DoOpenProperties(ContextMenu *This, HWND hwnd)
|
||||
if (SUCCEEDED(ret))
|
||||
{
|
||||
init_file_properties_pages(lpDo, Properties_AddPropSheetCallback, (LPARAM)&psh);
|
||||
+ init_security_properties_pages(lpDo, Properties_AddPropSheetCallback, (LPARAM)&psh);
|
||||
@@ -697,6 +1079,7 @@ static void DoOpenProperties(ContextMenu *This, HWND hwnd)
|
||||
if (SUCCEEDED(ret))
|
||||
{
|
||||
init_file_properties_pages(lpDo, Properties_AddPropSheetCallback, (LPARAM)&psh);
|
||||
+ init_security_properties_pages(lpDo, Properties_AddPropSheetCallback, (LPARAM)&psh);
|
||||
|
||||
hpsxa = SHCreatePropSheetExtArrayEx(HKEY_CLASSES_ROOT, wszFiletype, MAX_PROP_PAGES - psh.nPages, lpDo);
|
||||
if (hpsxa != NULL)
|
||||
hpsxa = SHCreatePropSheetExtArrayEx(HKEY_CLASSES_ROOT, wszFiletype, MAX_PROP_PAGES - psh.nPages, lpDo);
|
||||
if (hpsxa != NULL)
|
||||
diff --git a/dlls/shell32/shresdef.h b/dlls/shell32/shresdef.h
|
||||
index 1445077b86e..974da3c7ab5 100644
|
||||
index ed76ac8..26fc4cd 100644
|
||||
--- a/dlls/shell32/shresdef.h
|
||||
+++ b/dlls/shell32/shresdef.h
|
||||
@@ -157,6 +157,33 @@
|
||||
@ -511,5 +514,5 @@ index 1445077b86e..974da3c7ab5 100644
|
||||
#define IDS_RECYCLEBIN_FOLDER_NAME 8964
|
||||
|
||||
--
|
||||
2.12.2
|
||||
2.7.4
|
||||
|
||||
|
@ -1,3 +1,2 @@
|
||||
Fixes: Implement a basic security property tab
|
||||
Depends: shell32-Progress_Dialog
|
||||
Depends: shell32-File_Property_Dialog
|
||||
|
@ -1,509 +0,0 @@
|
||||
From 85a66b44d805d0a24a05903d54d716ba0f8595a2 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Sun, 21 Jun 2015 01:10:54 +0200
|
||||
Subject: shell32: Add general tab in file property dialog.
|
||||
|
||||
---
|
||||
dlls/shell32/shell32.rc | 66 ++++++++
|
||||
dlls/shell32/shlview_cmenu.c | 347 +++++++++++++++++++++++++++++++++++++++++--
|
||||
dlls/shell32/shresdef.h | 28 ++++
|
||||
3 files changed, 425 insertions(+), 16 deletions(-)
|
||||
|
||||
diff --git a/dlls/shell32/shell32.rc b/dlls/shell32/shell32.rc
|
||||
index 847d2ce..2641bc6 100644
|
||||
--- a/dlls/shell32/shell32.rc
|
||||
+++ b/dlls/shell32/shell32.rc
|
||||
@@ -341,6 +341,72 @@ FONT 8, "MS Shell Dlg"
|
||||
PUSHBUTTON "&Browse...", IDC_RUNDLG_BROWSE, 180, 63, 50, 14, WS_TABSTOP
|
||||
}
|
||||
|
||||
+IDD_FOLDER_PROPERTIES DIALOGEX 0, 0, 240, 155
|
||||
+STYLE DS_SHELLFONT | WS_CHILD | WS_CAPTION
|
||||
+CAPTION "General"
|
||||
+FONT 8, "MS Shell Dlg"
|
||||
+BEGIN
|
||||
+ ICON "", IDC_FPROP_ICON, 10, 5, 32, 32, WS_VISIBLE
|
||||
+ EDITTEXT IDC_FPROP_PATH, 70, 10, 160, 14, WS_TABSTOP
|
||||
+
|
||||
+ LTEXT "", -1, 5, 30, 230, 1, SS_ETCHEDHORZ
|
||||
+ LTEXT "File type:", IDC_FPROP_TYPE_LABEL, 10, 35, 60, 10
|
||||
+ EDITTEXT IDC_FPROP_TYPE, 70, 35, 160, 10, ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP
|
||||
+
|
||||
+ LTEXT "", -1, 5, 50, 230, 1, SS_ETCHEDHORZ
|
||||
+ LTEXT "Location:", IDC_FPROP_LOCATION_LABEL, 10, 55, 60, 10
|
||||
+ EDITTEXT IDC_FPROP_LOCATION, 70, 55, 160, 10, ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP
|
||||
+ LTEXT "Size:", IDC_FPROP_SIZE_LABEL, 10, 70, 60, 10
|
||||
+ EDITTEXT IDC_FPROP_SIZE, 70, 70, 160, 10, ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP
|
||||
+
|
||||
+ LTEXT "", -1, 5, 85, 230, 1, SS_ETCHEDHORZ
|
||||
+ LTEXT "Creation date:", IDC_FPROP_CREATED_LABEL, 10, 90, 60, 10
|
||||
+ EDITTEXT IDC_FPROP_CREATED, 70, 90, 160, 10, ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP
|
||||
+
|
||||
+ LTEXT "", -1, 5, 105, 230, 1, SS_ETCHEDHORZ
|
||||
+ LTEXT "Attributes:", IDC_FPROP_ATTRIB_LABEL, 10, 110, 60, 10
|
||||
+ AUTOCHECKBOX "&Read-only", IDC_FPROP_READONLY, 70, 110, 70, 10
|
||||
+ AUTOCHECKBOX "&Hidden", IDC_FPROP_HIDDEN, 70, 125, 70, 10
|
||||
+ AUTOCHECKBOX "&Archive", IDC_FPROP_ARCHIVE, 70, 140, 70, 10
|
||||
+END
|
||||
+
|
||||
+IDD_FILE_PROPERTIES DIALOGEX 0, 0, 240, 200
|
||||
+STYLE DS_SHELLFONT | WS_CHILD | WS_CAPTION
|
||||
+CAPTION "General"
|
||||
+FONT 8, "MS Shell Dlg"
|
||||
+BEGIN
|
||||
+ ICON "", IDC_FPROP_ICON, 10, 5, 32, 32, WS_VISIBLE
|
||||
+ EDITTEXT IDC_FPROP_PATH, 70, 10, 160, 14, WS_TABSTOP
|
||||
+
|
||||
+ LTEXT "", -1, 5, 30, 230, 1, SS_ETCHEDHORZ
|
||||
+ LTEXT "File type:", IDC_FPROP_TYPE_LABEL, 10, 35, 60, 10
|
||||
+ EDITTEXT IDC_FPROP_TYPE, 70, 35, 160, 10, ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP
|
||||
+ LTEXT "Open with:", IDC_FPROP_OPENWITH_LABEL, 10, 50, 60, 10
|
||||
+ ICON "", IDC_FPROP_PROG_ICON, 70, 50, 16, 16, WS_VISIBLE
|
||||
+ EDITTEXT IDC_FPROP_PROG_NAME, 85, 50, 80, 10, ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP
|
||||
+ PUSHBUTTON "&Change...", IDC_FPROP_PROG_CHANGE, 170, 48, 60, 14, WS_CHILD | WS_TABSTOP
|
||||
+
|
||||
+ LTEXT "", -1, 5, 65, 230, 1, SS_ETCHEDHORZ
|
||||
+ LTEXT "Location:", IDC_FPROP_LOCATION_LABEL, 10, 70, 60, 10
|
||||
+ EDITTEXT IDC_FPROP_LOCATION, 70, 70, 160, 10, ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP
|
||||
+ LTEXT "Size:", IDC_FPROP_SIZE_LABEL, 10, 85, 60, 10
|
||||
+ EDITTEXT IDC_FPROP_SIZE, 70, 85, 160, 10, ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP
|
||||
+
|
||||
+ LTEXT "", -1, 5, 100, 230, 1, SS_ETCHEDHORZ
|
||||
+ LTEXT "Creation date:", IDC_FPROP_CREATED_LABEL, 10, 105, 60, 10
|
||||
+ EDITTEXT IDC_FPROP_CREATED, 70, 105, 160, 10, ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP
|
||||
+ LTEXT "Last modified:", IDC_FPROP_MODIFIED_LABEL, 10, 120, 60, 10
|
||||
+ EDITTEXT IDC_FPROP_MODIFIED, 70, 120, 160, 10, ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP
|
||||
+ LTEXT "Last accessed:", IDC_FPROP_ACCESSED_LABEL, 10, 135, 60, 10
|
||||
+ EDITTEXT IDC_FPROP_ACCESSED, 70, 135, 160, 10, ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP
|
||||
+
|
||||
+ LTEXT "", -1, 5, 150, 230, 1, SS_ETCHEDHORZ
|
||||
+ LTEXT "Attributes:", IDC_FPROP_ATTRIB_LABEL, 10, 155, 60, 10
|
||||
+ AUTOCHECKBOX "&Read-only", IDC_FPROP_READONLY, 70, 155, 70, 10
|
||||
+ AUTOCHECKBOX "&Hidden", IDC_FPROP_HIDDEN, 70, 170, 70, 10
|
||||
+ AUTOCHECKBOX "&Archive", IDC_FPROP_ARCHIVE, 70, 185, 70, 10
|
||||
+END
|
||||
+
|
||||
LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
|
||||
|
||||
/* @makedep: shell32.rgs */
|
||||
diff --git a/dlls/shell32/shlview_cmenu.c b/dlls/shell32/shlview_cmenu.c
|
||||
index 099f5bc..aa7a7de 100644
|
||||
--- a/dlls/shell32/shlview_cmenu.c
|
||||
+++ b/dlls/shell32/shlview_cmenu.c
|
||||
@@ -39,6 +39,7 @@
|
||||
#include "shellfolder.h"
|
||||
|
||||
#include "shresdef.h"
|
||||
+#include "shlwapi.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(shell);
|
||||
|
||||
@@ -284,6 +285,318 @@ static BOOL CALLBACK Properties_AddPropSheetCallback(HPROPSHEETPAGE hpage, LPARA
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
+static BOOL format_date(FILETIME *time, WCHAR *buffer, DWORD size)
|
||||
+{
|
||||
+ FILETIME ft;
|
||||
+ SYSTEMTIME st;
|
||||
+ int ret;
|
||||
+
|
||||
+ if (!FileTimeToLocalFileTime(time, &ft))
|
||||
+ return FALSE;
|
||||
+
|
||||
+ if (!FileTimeToSystemTime(&ft, &st))
|
||||
+ return FALSE;
|
||||
+
|
||||
+ ret = GetDateFormatW(LOCALE_USER_DEFAULT, DATE_LONGDATE, &st, NULL, buffer, size);
|
||||
+ if (ret)
|
||||
+ {
|
||||
+ buffer[ret - 1] = ' ';
|
||||
+ ret = GetTimeFormatW(LOCALE_USER_DEFAULT, 0, &st, NULL, buffer + ret , size - ret);
|
||||
+ }
|
||||
+ return ret != 0;
|
||||
+}
|
||||
+
|
||||
+static BOOL get_program_description(WCHAR *path, WCHAR *buffer, DWORD size)
|
||||
+{
|
||||
+ static const WCHAR translationW[] = {
|
||||
+ '\\','V','a','r','F','i','l','e','I','n','f','o',
|
||||
+ '\\','T','r','a','n','s','l','a','t','i','o','n',0
|
||||
+ };
|
||||
+ static const WCHAR fileDescFmtW[] = {
|
||||
+ '\\','S','t','r','i','n','g','F','i','l','e','I','n','f','o',
|
||||
+ '\\','%','0','4','x','%','0','4','x',
|
||||
+ '\\','F','i','l','e','D','e','s','c','r','i','p','t','i','o','n',0
|
||||
+ };
|
||||
+ WCHAR fileDescW[41], *desc;
|
||||
+ DWORD versize, *lang;
|
||||
+ UINT dlen, llen, i;
|
||||
+ BOOL ret = FALSE;
|
||||
+ PVOID data;
|
||||
+
|
||||
+ versize = GetFileVersionInfoSizeW(path, NULL);
|
||||
+ if (!versize) return FALSE;
|
||||
+
|
||||
+ data = HeapAlloc(GetProcessHeap(), 0, versize);
|
||||
+ if (!data) return FALSE;
|
||||
+
|
||||
+ if (!GetFileVersionInfoW(path, 0, versize, data))
|
||||
+ goto out;
|
||||
+
|
||||
+ if (!VerQueryValueW(data, translationW, (LPVOID *)&lang, &llen))
|
||||
+ goto out;
|
||||
+
|
||||
+ for (i = 0; i < llen / sizeof(DWORD); i++)
|
||||
+ {
|
||||
+ sprintfW(fileDescW, fileDescFmtW, LOWORD(lang[i]), HIWORD(lang[i]));
|
||||
+ if (VerQueryValueW(data, fileDescW, (LPVOID *)&desc, &dlen))
|
||||
+ {
|
||||
+ if (dlen > size - 1) dlen = size - 1;
|
||||
+ memcpy(buffer, desc, dlen * sizeof(WCHAR));
|
||||
+ buffer[dlen] = 0;
|
||||
+ ret = TRUE;
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+out:
|
||||
+ HeapFree(GetProcessHeap(), 0, data);
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+struct file_properties_info
|
||||
+{
|
||||
+ LONG refcount;
|
||||
+ WCHAR path[MAX_PATH];
|
||||
+ WCHAR dir[MAX_PATH];
|
||||
+ WCHAR *filename;
|
||||
+ DWORD attrib;
|
||||
+};
|
||||
+
|
||||
+static void init_file_properties_dlg(HWND hwndDlg, struct file_properties_info *props)
|
||||
+{
|
||||
+ WCHAR buffer[MAX_PATH], buffer2[MAX_PATH];
|
||||
+ WIN32_FILE_ATTRIBUTE_DATA exinfo;
|
||||
+ SHFILEINFOW shinfo;
|
||||
+
|
||||
+ SetDlgItemTextW(hwndDlg, IDC_FPROP_PATH, props->filename);
|
||||
+ SetDlgItemTextW(hwndDlg, IDC_FPROP_LOCATION, props->dir);
|
||||
+
|
||||
+ if (SHGetFileInfoW(props->path, 0, &shinfo, sizeof(shinfo), SHGFI_TYPENAME|SHGFI_ICON))
|
||||
+ {
|
||||
+ if (shinfo.hIcon) SendDlgItemMessageW(hwndDlg, IDC_FPROP_ICON, STM_SETICON, (WPARAM)shinfo.hIcon, 0);
|
||||
+ if (shinfo.szTypeName[0]) SetDlgItemTextW(hwndDlg, IDC_FPROP_TYPE, shinfo.szTypeName);
|
||||
+ }
|
||||
+
|
||||
+ if (!GetFileAttributesExW(props->path, GetFileExInfoStandard, &exinfo))
|
||||
+ return;
|
||||
+
|
||||
+ if (format_date(&exinfo.ftCreationTime, buffer, sizeof(buffer) / sizeof(buffer[0])))
|
||||
+ SetDlgItemTextW(hwndDlg, IDC_FPROP_CREATED, buffer);
|
||||
+
|
||||
+ if (exinfo.dwFileAttributes & FILE_ATTRIBUTE_READONLY)
|
||||
+ SendDlgItemMessageW(hwndDlg, IDC_FPROP_READONLY, BM_SETCHECK, BST_CHECKED, 0);
|
||||
+ if (exinfo.dwFileAttributes & FILE_ATTRIBUTE_HIDDEN)
|
||||
+ SendDlgItemMessageW(hwndDlg, IDC_FPROP_HIDDEN, BM_SETCHECK, BST_CHECKED, 0);
|
||||
+ if (exinfo.dwFileAttributes & FILE_ATTRIBUTE_ARCHIVE)
|
||||
+ SendDlgItemMessageW(hwndDlg, IDC_FPROP_ARCHIVE, BM_SETCHECK, BST_CHECKED, 0);
|
||||
+
|
||||
+ if (exinfo.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
|
||||
+ {
|
||||
+ static const WCHAR unknownW[] = {'(','u','n','k','n','o','w','n',')',0};
|
||||
+ SetDlgItemTextW(hwndDlg, IDC_FPROP_SIZE, unknownW);
|
||||
+
|
||||
+ /* TODO: Implement counting for directories */
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ /* Information about files only */
|
||||
+ StrFormatByteSizeW(((LONGLONG)exinfo.nFileSizeHigh << 32) | exinfo.nFileSizeLow,
|
||||
+ buffer, sizeof(buffer) / sizeof(buffer[0]));
|
||||
+ SetDlgItemTextW(hwndDlg, IDC_FPROP_SIZE, buffer);
|
||||
+
|
||||
+ if (format_date(&exinfo.ftLastWriteTime, buffer, sizeof(buffer) / sizeof(buffer[0])))
|
||||
+ SetDlgItemTextW(hwndDlg, IDC_FPROP_MODIFIED, buffer);
|
||||
+ if (format_date(&exinfo.ftLastAccessTime, buffer, sizeof(buffer) / sizeof(buffer[0])))
|
||||
+ SetDlgItemTextW(hwndDlg, IDC_FPROP_ACCESSED, buffer);
|
||||
+
|
||||
+ if (FindExecutableW(props->path, NULL, buffer) <= (HINSTANCE)32)
|
||||
+ return;
|
||||
+
|
||||
+ /* Information about executables */
|
||||
+ if (SHGetFileInfoW(buffer, 0, &shinfo, sizeof(shinfo), SHGFI_ICON | SHGFI_SMALLICON) && shinfo.hIcon)
|
||||
+ SendDlgItemMessageW(hwndDlg, IDC_FPROP_PROG_ICON, STM_SETICON, (WPARAM)shinfo.hIcon, 0);
|
||||
+
|
||||
+ if (get_program_description(buffer, buffer2, sizeof(buffer2) / sizeof(buffer2[0])))
|
||||
+ SetDlgItemTextW(hwndDlg, IDC_FPROP_PROG_NAME, buffer2);
|
||||
+ else
|
||||
+ {
|
||||
+ WCHAR *p = strrchrW(buffer, '\\');
|
||||
+ SetDlgItemTextW(hwndDlg, IDC_FPROP_PROG_NAME, p ? ++p : buffer);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+static INT_PTR CALLBACK file_properties_proc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||
+{
|
||||
+ switch (uMsg)
|
||||
+ {
|
||||
+ case WM_INITDIALOG:
|
||||
+ {
|
||||
+ LPPROPSHEETPAGEW ppsp = (LPPROPSHEETPAGEW)lParam;
|
||||
+ SetWindowLongPtrW(hwndDlg, DWLP_USER, (LONG_PTR)ppsp->lParam);
|
||||
+ init_file_properties_dlg(hwndDlg, (struct file_properties_info *)ppsp->lParam);
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ case WM_COMMAND:
|
||||
+ if (LOWORD(wParam) == IDC_FPROP_PROG_CHANGE)
|
||||
+ {
|
||||
+ /* TODO: Implement file association dialog */
|
||||
+ MessageBoxA(hwndDlg, "Not implemented yet.", "Error", MB_OK | MB_ICONEXCLAMATION);
|
||||
+ }
|
||||
+ else if (LOWORD(wParam) == IDC_FPROP_READONLY ||
|
||||
+ LOWORD(wParam) == IDC_FPROP_HIDDEN ||
|
||||
+ LOWORD(wParam) == IDC_FPROP_ARCHIVE)
|
||||
+ {
|
||||
+ SendMessageW(GetParent(hwndDlg), PSM_CHANGED, (WPARAM)hwndDlg, 0);
|
||||
+ }
|
||||
+ else if (LOWORD(wParam) == IDC_FPROP_PATH && HIWORD(wParam) == EN_CHANGE)
|
||||
+ {
|
||||
+ SendMessageW(GetParent(hwndDlg), PSM_CHANGED, (WPARAM)hwndDlg, 0);
|
||||
+ }
|
||||
+ break;
|
||||
+
|
||||
+ case WM_NOTIFY:
|
||||
+ {
|
||||
+ LPPSHNOTIFY lppsn = (LPPSHNOTIFY)lParam;
|
||||
+ if (lppsn->hdr.code == PSN_APPLY)
|
||||
+ {
|
||||
+ struct file_properties_info *props = (struct file_properties_info *)GetWindowLongPtrW(hwndDlg, DWLP_USER);
|
||||
+ WCHAR newname[MAX_PATH], newpath[MAX_PATH];
|
||||
+ DWORD attributes;
|
||||
+
|
||||
+ attributes = GetFileAttributesW(props->path);
|
||||
+ if (attributes != INVALID_FILE_ATTRIBUTES)
|
||||
+ {
|
||||
+ attributes &= ~(FILE_ATTRIBUTE_READONLY|FILE_ATTRIBUTE_HIDDEN|FILE_ATTRIBUTE_ARCHIVE);
|
||||
+
|
||||
+ if (SendDlgItemMessageW(hwndDlg, IDC_FPROP_READONLY, BM_GETCHECK, 0, 0) == BST_CHECKED)
|
||||
+ attributes |= FILE_ATTRIBUTE_READONLY;
|
||||
+ if (SendDlgItemMessageW(hwndDlg, IDC_FPROP_HIDDEN, BM_GETCHECK, 0, 0) == BST_CHECKED)
|
||||
+ attributes |= FILE_ATTRIBUTE_HIDDEN;
|
||||
+ if (SendDlgItemMessageW(hwndDlg, IDC_FPROP_ARCHIVE, BM_GETCHECK, 0, 0) == BST_CHECKED)
|
||||
+ attributes |= FILE_ATTRIBUTE_ARCHIVE;
|
||||
+
|
||||
+ if (!SetFileAttributesW(props->path, attributes))
|
||||
+ ERR("failed to update file attributes of %s\n", debugstr_w(props->path));
|
||||
+ }
|
||||
+
|
||||
+ /* Update filename it it was changed */
|
||||
+ if (GetDlgItemTextW(hwndDlg, IDC_FPROP_PATH, newname, sizeof(newname)/sizeof(newname[0])) &&
|
||||
+ strcmpW(props->filename, newname) &&
|
||||
+ strlenW(props->dir) + strlenW(newname) + 2 < sizeof(newpath) / sizeof(newpath[0]))
|
||||
+ {
|
||||
+ static const WCHAR slash[] = {'\\', 0};
|
||||
+ strcpyW(newpath, props->dir);
|
||||
+ strcatW(newpath, slash);
|
||||
+ strcatW(newpath, newname);
|
||||
+
|
||||
+ if (!MoveFileW(props->path, newpath))
|
||||
+ ERR("failed to move file %s to %s\n", debugstr_w(props->path), debugstr_w(newpath));
|
||||
+ else
|
||||
+ {
|
||||
+ WCHAR *p;
|
||||
+ strcpyW(props->path, newpath);
|
||||
+ strcpyW(props->dir, newpath);
|
||||
+ if ((p = strrchrW(props->dir, '\\')))
|
||||
+ {
|
||||
+ *p = 0;
|
||||
+ props->filename = p + 1;
|
||||
+ }
|
||||
+ else
|
||||
+ props->filename = props->dir;
|
||||
+ SetDlgItemTextW(hwndDlg, IDC_FPROP_LOCATION, props->dir);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ return TRUE;
|
||||
+ }
|
||||
+ }
|
||||
+ break;
|
||||
+
|
||||
+ default:
|
||||
+ break;
|
||||
+ }
|
||||
+ return FALSE;
|
||||
+}
|
||||
+
|
||||
+static UINT CALLBACK file_properties_callback(HWND hwnd, UINT uMsg, LPPROPSHEETPAGEW ppsp)
|
||||
+{
|
||||
+ struct file_properties_info *props = (struct file_properties_info *)ppsp->lParam;
|
||||
+ if (uMsg == PSPCB_RELEASE)
|
||||
+ {
|
||||
+ if (!InterlockedDecrement(&props->refcount))
|
||||
+ HeapFree(GetProcessHeap(), 0, props);
|
||||
+ }
|
||||
+ return 1;
|
||||
+}
|
||||
+
|
||||
+static void init_file_properties_pages(IDataObject *pDo, LPFNADDPROPSHEETPAGE lpfnAddPage, LPARAM lParam)
|
||||
+{
|
||||
+ static WCHAR title[] = {'G','e','n','e','r','a','l',0};
|
||||
+ struct file_properties_info *props;
|
||||
+ HPROPSHEETPAGE general_page;
|
||||
+ PROPSHEETPAGEW propsheet;
|
||||
+ FORMATETC format;
|
||||
+ STGMEDIUM stgm;
|
||||
+ HRESULT hr;
|
||||
+ WCHAR *p;
|
||||
+
|
||||
+ props = HeapAlloc(GetProcessHeap(), 0, sizeof(*props));
|
||||
+ if (!props) return;
|
||||
+
|
||||
+ format.cfFormat = CF_HDROP;
|
||||
+ format.ptd = NULL;
|
||||
+ format.dwAspect = DVASPECT_CONTENT;
|
||||
+ format.lindex = -1;
|
||||
+ format.tymed = TYMED_HGLOBAL;
|
||||
+
|
||||
+ hr = IDataObject_GetData(pDo, &format, &stgm);
|
||||
+ if (FAILED(hr)) goto error;
|
||||
+
|
||||
+ if (!DragQueryFileW((HDROP)stgm.DUMMYUNIONNAME.hGlobal, 0,
|
||||
+ props->path, sizeof(props->path) / sizeof(props->path[0])))
|
||||
+ {
|
||||
+ ReleaseStgMedium(&stgm);
|
||||
+ goto error;
|
||||
+ }
|
||||
+
|
||||
+ ReleaseStgMedium(&stgm);
|
||||
+
|
||||
+ props->refcount = 1;
|
||||
+ props->attrib = GetFileAttributesW(props->path);
|
||||
+ if (props->attrib == INVALID_FILE_ATTRIBUTES)
|
||||
+ goto error;
|
||||
+
|
||||
+ strcpyW(props->dir, props->path);
|
||||
+ if ((p = strrchrW(props->dir, '\\')))
|
||||
+ {
|
||||
+ *p = 0;
|
||||
+ props->filename = p + 1;
|
||||
+ }
|
||||
+ else
|
||||
+ props->filename = props->dir;
|
||||
+
|
||||
+ memset(&propsheet, 0, sizeof(propsheet));
|
||||
+ propsheet.dwSize = sizeof(propsheet);
|
||||
+ propsheet.dwFlags = PSP_DEFAULT | PSP_USETITLE | PSP_USECALLBACK;
|
||||
+ propsheet.hInstance = shell32_hInstance;
|
||||
+ if (props->attrib & FILE_ATTRIBUTE_DIRECTORY)
|
||||
+ propsheet.u.pszTemplate = (LPWSTR)MAKEINTRESOURCE(IDD_FOLDER_PROPERTIES);
|
||||
+ else
|
||||
+ propsheet.u.pszTemplate = (LPWSTR)MAKEINTRESOURCE(IDD_FILE_PROPERTIES);
|
||||
+ propsheet.pfnDlgProc = file_properties_proc;
|
||||
+ propsheet.pfnCallback = file_properties_callback;
|
||||
+ propsheet.lParam = (LPARAM)props;
|
||||
+ propsheet.pszTitle = title;
|
||||
+
|
||||
+ general_page = CreatePropertySheetPageW(&propsheet);
|
||||
+ if (general_page) lpfnAddPage(general_page, lParam);
|
||||
+ return;
|
||||
+
|
||||
+error:
|
||||
+ HeapFree(GetProcessHeap(), 0, props);
|
||||
+}
|
||||
+
|
||||
#define MAX_PROP_PAGES 99
|
||||
|
||||
static void DoOpenProperties(ContextMenu *This, HWND hwnd)
|
||||
@@ -363,22 +676,24 @@ static void DoOpenProperties(ContextMenu *This, HWND hwnd)
|
||||
IShellFolder_Release(lpDesktopSF);
|
||||
}
|
||||
|
||||
- if (SUCCEEDED(ret))
|
||||
- {
|
||||
- hpsxa = SHCreatePropSheetExtArrayEx(HKEY_CLASSES_ROOT, wszFiletype, MAX_PROP_PAGES - psh.nPages, lpDo);
|
||||
- if (hpsxa != NULL)
|
||||
- {
|
||||
- SHAddFromPropSheetExtArray(hpsxa, Properties_AddPropSheetCallback, (LPARAM)&psh);
|
||||
- SHDestroyPropSheetExtArray(hpsxa);
|
||||
- }
|
||||
- hpsxa = SHCreatePropSheetExtArrayEx(HKEY_CLASSES_ROOT, wszFiletypeAll, MAX_PROP_PAGES - psh.nPages, lpDo);
|
||||
- if (hpsxa != NULL)
|
||||
- {
|
||||
- SHAddFromPropSheetExtArray(hpsxa, Properties_AddPropSheetCallback, (LPARAM)&psh);
|
||||
- SHDestroyPropSheetExtArray(hpsxa);
|
||||
- }
|
||||
- IDataObject_Release(lpDo);
|
||||
- }
|
||||
+ if (SUCCEEDED(ret))
|
||||
+ {
|
||||
+ init_file_properties_pages(lpDo, Properties_AddPropSheetCallback, (LPARAM)&psh);
|
||||
+
|
||||
+ hpsxa = SHCreatePropSheetExtArrayEx(HKEY_CLASSES_ROOT, wszFiletype, MAX_PROP_PAGES - psh.nPages, lpDo);
|
||||
+ if (hpsxa != NULL)
|
||||
+ {
|
||||
+ SHAddFromPropSheetExtArray(hpsxa, Properties_AddPropSheetCallback, (LPARAM)&psh);
|
||||
+ SHDestroyPropSheetExtArray(hpsxa);
|
||||
+ }
|
||||
+ hpsxa = SHCreatePropSheetExtArrayEx(HKEY_CLASSES_ROOT, wszFiletypeAll, MAX_PROP_PAGES - psh.nPages, lpDo);
|
||||
+ if (hpsxa != NULL)
|
||||
+ {
|
||||
+ SHAddFromPropSheetExtArray(hpsxa, Properties_AddPropSheetCallback, (LPARAM)&psh);
|
||||
+ SHDestroyPropSheetExtArray(hpsxa);
|
||||
+ }
|
||||
+ IDataObject_Release(lpDo);
|
||||
+ }
|
||||
|
||||
if (psh.nPages)
|
||||
PropertySheetW(&psh);
|
||||
diff --git a/dlls/shell32/shresdef.h b/dlls/shell32/shresdef.h
|
||||
index 183a75e..1518de5 100644
|
||||
--- a/dlls/shell32/shresdef.h
|
||||
+++ b/dlls/shell32/shresdef.h
|
||||
@@ -152,6 +152,10 @@
|
||||
/* Note: this string is referenced from the registry*/
|
||||
#define IDS_RECYCLEBIN_FOLDER_NAME 8964
|
||||
|
||||
+/* Properties dialog */
|
||||
+#define IDD_FILE_PROPERTIES 8
|
||||
+#define IDD_FOLDER_PROPERTIES 9
|
||||
+
|
||||
#define IDD_ICON 0x4300
|
||||
#define IDD_MESSAGE 0x4301
|
||||
|
||||
@@ -232,6 +236,30 @@ FIXME: Need to add them, but for now just let them use the same: searching.avi
|
||||
#define IDC_RUNDLG_EDITPATH 12298
|
||||
#define IDC_RUNDLG_LABEL 12305
|
||||
|
||||
+/* file property dialog */
|
||||
+#define IDC_FPROP_ICON 13000
|
||||
+#define IDC_FPROP_PATH 13001
|
||||
+#define IDC_FPROP_TYPE_LABEL 13002
|
||||
+#define IDC_FPROP_TYPE 13003
|
||||
+#define IDC_FPROP_OPENWITH_LABEL 13004
|
||||
+#define IDC_FPROP_PROG_ICON 13005
|
||||
+#define IDC_FPROP_PROG_NAME 13006
|
||||
+#define IDC_FPROP_PROG_CHANGE 13007
|
||||
+#define IDC_FPROP_LOCATION_LABEL 13008
|
||||
+#define IDC_FPROP_LOCATION 13009
|
||||
+#define IDC_FPROP_SIZE_LABEL 13010
|
||||
+#define IDC_FPROP_SIZE 13011
|
||||
+#define IDC_FPROP_CREATED_LABEL 13012
|
||||
+#define IDC_FPROP_CREATED 13013
|
||||
+#define IDC_FPROP_MODIFIED_LABEL 13014
|
||||
+#define IDC_FPROP_MODIFIED 13015
|
||||
+#define IDC_FPROP_ACCESSED_LABEL 13016
|
||||
+#define IDC_FPROP_ACCESSED 13017
|
||||
+#define IDC_FPROP_ATTRIB_LABEL 13018
|
||||
+#define IDC_FPROP_READONLY 13019
|
||||
+#define IDC_FPROP_HIDDEN 13020
|
||||
+#define IDC_FPROP_ARCHIVE 13021
|
||||
+
|
||||
/* bitmaps */
|
||||
/* explorer toolbar icons
|
||||
* FIXME: images are hacky and should be re-drawn; also dark and light bitmaps are same for now
|
||||
--
|
||||
2.4.3
|
||||
|
@ -1 +0,0 @@
|
||||
Fixes: [40426] Implement general tab for file property dialog
|
Loading…
Reference in New Issue
Block a user