From bca05a62840c0ba463d9458e0b0ac34291d5e3a2 Mon Sep 17 00:00:00 2001 From: "Erich E. Hoover" Date: Sat, 26 Jul 2014 15:18:59 -0600 Subject: [PATCH 1/3] Added patch to store IOCS data in a property instead of GWLP_USERDATA. --- README.md | 1 + debian/changelog | 3 +- patches/Makefile | 18 +++++ ...LP_USERDATA-to-store-IOCS-to-avoid-c.patch | 71 +++++++++++++++++++ patches/atl-IOCS_Property/definition | 4 ++ 5 files changed, 96 insertions(+), 1 deletion(-) create mode 100644 patches/atl-IOCS_Property/0001-atl-Don-t-use-GWLP_USERDATA-to-store-IOCS-to-avoid-c.patch create mode 100644 patches/atl-IOCS_Property/definition diff --git a/README.md b/README.md index 1d9ba742..ddb59eab 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,7 @@ These patches fix the following Wine bugs: * GetSecurityInfo returns NULL DACL for process object ([Wine Bug #15980](http://bugs.winehq.org/show_bug.cgi?id=15980 "Rhapsody 2 crashes on startup (GetSecurityInfo returns NULL DACL for process object)")) * Fix for ConnectNamedPort return value in overlapped mode ([Wine Bug #16550](http://bugs.winehq.org/show_bug.cgi?id=16550 "ConnectNamedPort should never return OK in overlapped mode (affects chromium ui_tests.exe)")) * Workaround for TransactNamedPipe not being supported ([Wine Bug #17273](http://bugs.winehq.org/show_bug.cgi?id=17273 "Many apps and games need SetNamedPipeHandleState implementation (support for named pipe message mode)(FireFox+Flash, Win8/NET 4.x SDK/vcrun2012, WiX installers)")) +* ATL IOCS data should not be stored in GWLP_USERDATA ([Wine Bug #21767](http://bugs.winehq.org/show_bug.cgi?id=21767 "JLC's Internet TV crashes on startup")) * Support for process ACLs ([Wine Bug #22006](http://bugs.winehq.org/show_bug.cgi?id=22006 "OpenProcess does not enforce ACL")) * Return correct IMediaSeeking stream positions in quartz ([Wine Bug #23174](http://bugs.winehq.org/show_bug.cgi?id=23174 "Fallout 3: Diologue and Video/sound issues")) * Add implementation of WTSEnumerateProcessesW ([Wine Bug #29903](http://bugs.winehq.org/show_bug.cgi?id=29903 "Some Microsoft debuggers fail to enumerate processes due to wtsapi32.WTSEnumerateProcessesW() being a stub (Microsoft Visual Studio 2005, DbgCLR from .NET 2.0 SDK)")) diff --git a/debian/changelog b/debian/changelog index 8eae512d..c349cbc7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,7 +1,8 @@ wine-compholio (1.7.24) UNRELEASED; urgency=low * Added patch to implement AllocateAndGetTcpExTableFromStack. * Added patch to fix ConnectNamedPort return value in overlapped mode. - -- Erich E. Hoover Sat, 26 Jul 2014 14:41:52 -0600 + * Added patch to store IOCS data in a property instead of GWLP_USERDATA. + -- Erich E. Hoover Sat, 26 Jul 2014 15:18:40 -0600 wine-compholio (1.7.23) unstable; urgency=low * Rewrite of patch system to simplify maintaining large patchsets. diff --git a/patches/Makefile b/patches/Makefile index 6a7cfc54..972ac4e5 100644 --- a/patches/Makefile +++ b/patches/Makefile @@ -7,6 +7,7 @@ PATCH := $(CURDIR)/../debian/tools/gitapply.sh -d $(DESTDIR) PATCHLIST := Miscellaneous.ok \ Pipelight.ok \ + atl-IOCS_Property.ok \ fonts-Missing_Fonts.ok \ iphlpapi-TCP_Table.ok \ kernel32-GetVolumePathName.ok \ @@ -94,6 +95,23 @@ Pipelight.ok: echo '+ { "Pipelight", "Sebastian Lackner", "Implement X11DRV_FLUSH_GDI_DISPLAY ExtEscape command." },'; \ ) > Pipelight.ok +# Patchset atl-IOCS_Property +# | +# | Included patches: +# | * Store IOCS data in a property instead of GWLP_USERDATA. [by Qian Hong] +# | +# | This patchset fixes the following Wine bugs: +# | * [#21767] JLC's Internet TV crashes on startup +# | +# | Modified files: +# | * dlls/atl/atl_ax.c +# | +atl-IOCS_Property.ok: + $(PATCH) < atl-IOCS_Property/0001-atl-Don-t-use-GWLP_USERDATA-to-store-IOCS-to-avoid-c.patch + @( \ + echo '+ { "atl-IOCS_Property", "Qian Hong", "Store IOCS data in a property instead of GWLP_USERDATA." },'; \ + ) > atl-IOCS_Property.ok + # Patchset fonts-Missing_Fonts # | # | Included patches: diff --git a/patches/atl-IOCS_Property/0001-atl-Don-t-use-GWLP_USERDATA-to-store-IOCS-to-avoid-c.patch b/patches/atl-IOCS_Property/0001-atl-Don-t-use-GWLP_USERDATA-to-store-IOCS-to-avoid-c.patch new file mode 100644 index 00000000..8f888de6 --- /dev/null +++ b/patches/atl-IOCS_Property/0001-atl-Don-t-use-GWLP_USERDATA-to-store-IOCS-to-avoid-c.patch @@ -0,0 +1,71 @@ +From 4d79656ea8c30f14fcd4a8e6a901e7b50ea50eef Mon Sep 17 00:00:00 2001 +From: Qian Hong +Date: Thu, 17 Apr 2014 04:34:30 +0800 +Subject: atl: Don't use GWLP_USERDATA to store IOCS to avoid conflict with + Apps. + +--- + dlls/atl/atl_ax.c | 12 +++++++----- + 1 file changed, 7 insertions(+), 5 deletions(-) + +diff --git a/dlls/atl/atl_ax.c b/dlls/atl/atl_ax.c +index 5bafbf1..45936e8 100644 +--- a/dlls/atl/atl_ax.c ++++ b/dlls/atl/atl_ax.c +@@ -38,6 +38,8 @@ + + #include "wine/unicode.h" + ++#define WINE_IOCS_PROPERTY "WINE_IOCS" ++ + WINE_DEFAULT_DEBUG_CHANNEL(atl); + + typedef struct IOCS { +@@ -150,7 +152,7 @@ static HRESULT IOCS_Detach( IOCS *This ) /* remove subclassing */ + if ( This->hWnd ) + { + SetWindowLongPtrW( This->hWnd, GWLP_WNDPROC, (ULONG_PTR) This->OrigWndProc ); +- SetWindowLongPtrW( This->hWnd, GWLP_USERDATA, 0 ); ++ RemovePropA( This->hWnd, WINE_IOCS_PROPERTY ); + This->hWnd = NULL; + } + if ( This->control ) +@@ -906,7 +908,7 @@ static LRESULT IOCS_OnWndProc( IOCS *This, HWND hWnd, UINT uMsg, WPARAM wParam, + + static LRESULT CALLBACK AtlHost_wndproc( HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam ) + { +- IOCS *This = (IOCS*) GetWindowLongPtrW( hWnd, GWLP_USERDATA ); ++ IOCS *This = (IOCS*) GetPropA( hWnd, WINE_IOCS_PROPERTY ); + return IOCS_OnWndProc( This, hWnd, wMsg, wParam, lParam ); + } + +@@ -915,7 +917,7 @@ static HRESULT IOCS_Attach( IOCS *This, HWND hWnd, IUnknown *pUnkControl ) /* su + This->hWnd = hWnd; + IUnknown_QueryInterface( pUnkControl, &IID_IOleObject, (void**)&This->control ); + IOleObject_SetClientSite( This->control, &This->IOleClientSite_iface ); +- SetWindowLongPtrW( hWnd, GWLP_USERDATA, (ULONG_PTR) This ); ++ SetPropA( hWnd, WINE_IOCS_PROPERTY, This ); + This->OrigWndProc = (WNDPROC)SetWindowLongPtrW( hWnd, GWLP_WNDPROC, (ULONG_PTR) AtlHost_wndproc ); + + return S_OK; +@@ -1329,7 +1331,7 @@ HRESULT WINAPI AtlAxGetHost(HWND hWnd, IUnknown **host) + + *host = NULL; + +- This = (IOCS*) GetWindowLongPtrW( hWnd, GWLP_USERDATA ); ++ This = (IOCS*) GetPropA( hWnd, WINE_IOCS_PROPERTY ); + if ( !This ) + { + WARN("No container attached to %p\n", hWnd ); +@@ -1351,7 +1353,7 @@ HRESULT WINAPI AtlAxGetControl(HWND hWnd, IUnknown **pUnk) + + *pUnk = NULL; + +- This = (IOCS*) GetWindowLongPtrW( hWnd, GWLP_USERDATA ); ++ This = (IOCS*) GetPropA ( hWnd, WINE_IOCS_PROPERTY ); + if ( !This || !This->control ) + { + WARN("No control attached to %p\n", hWnd ); +-- +1.7.9.5 + diff --git a/patches/atl-IOCS_Property/definition b/patches/atl-IOCS_Property/definition new file mode 100644 index 00000000..6971e169 --- /dev/null +++ b/patches/atl-IOCS_Property/definition @@ -0,0 +1,4 @@ +Author: Qian Hong +Subject: Store IOCS data in a property instead of GWLP_USERDATA. +Revision: 1 +Fixes: [21767] ATL IOCS data should not be stored in GWLP_USERDATA From df56f3b7dd017561792531a89317a5d12a31e510 Mon Sep 17 00:00:00 2001 From: "Erich E. Hoover" Date: Sat, 26 Jul 2014 15:49:56 -0600 Subject: [PATCH 2/3] Added patch to implement SHCreateSessionKey. --- README.md | 1 + debian/changelog | 3 +- patches/Makefile | 18 +++++ ...shell32-Implement-SHCreateSessionKey.patch | 76 +++++++++++++++++++ patches/shell32-SHCreateSessionKey/definition | 4 + 5 files changed, 101 insertions(+), 1 deletion(-) create mode 100644 patches/shell32-SHCreateSessionKey/0001-shell32-Implement-SHCreateSessionKey.patch create mode 100644 patches/shell32-SHCreateSessionKey/definition diff --git a/README.md b/README.md index ddb59eab..350c7e80 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,7 @@ These patches fix the following Wine bugs: * Support for interface change notifications ([Wine Bug #32328](http://bugs.winehq.org/show_bug.cgi?id=32328 "Many .NET and Silverlight applications require SIO_ADDRESS_LIST_CHANGE for interface change notifications")) * Support for AllocateAndGetTcpExTableFromStack ([Wine Bug #34372](http://bugs.winehq.org/show_bug.cgi?id=34372 "Add missing function AllocateAndGetTcpExTableFromStack() to iphlpapi.dll")) * Support for inherited file ACLs ([Wine Bug #34406](http://bugs.winehq.org/show_bug.cgi?id=34406 "Finale Notepad 2012 doesn't copy/create user files on program start")) +* SHCreateSessionKey not implemented ([Wine Bug #35630](http://bugs.winehq.org/show_bug.cgi?id=35630 "SHCreateSessionKey is unimplemented")) * Add Dynamic DST exceptions for Israel Standard Time ([Wine Bug #36374](http://bugs.winehq.org/show_bug.cgi?id=36374 "Israel timezone handled incorrectly")) Besides that the following additional changes are included: diff --git a/debian/changelog b/debian/changelog index c349cbc7..f8c87ca4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,9 @@ wine-compholio (1.7.24) UNRELEASED; urgency=low + * Added patch to implement SHCreateSessionKey. * Added patch to implement AllocateAndGetTcpExTableFromStack. * Added patch to fix ConnectNamedPort return value in overlapped mode. * Added patch to store IOCS data in a property instead of GWLP_USERDATA. - -- Erich E. Hoover Sat, 26 Jul 2014 15:18:40 -0600 + -- Erich E. Hoover Sat, 26 Jul 2014 15:49:33 -0600 wine-compholio (1.7.23) unstable; urgency=low * Rewrite of patch system to simplify maintaining large patchsets. diff --git a/patches/Makefile b/patches/Makefile index 972ac4e5..bc63906f 100644 --- a/patches/Makefile +++ b/patches/Makefile @@ -24,6 +24,7 @@ PATCHLIST := Miscellaneous.ok \ server-Misc_ACL.ok \ server-Stored_ACLs.ok \ shell32-Default_Folder_ACLs.ok \ + shell32-SHCreateSessionKey.ok \ shlwapi-UrlCombine.ok \ strmbase-Lock_Race_Conditions.ok \ wineboot-HKEY_DYN_DATA.ok \ @@ -408,6 +409,23 @@ shell32-Default_Folder_ACLs.ok: echo '+ { "shell32-Default_Folder_ACLs", "Erich E. Hoover", "Generate default ACLs for user shell folders. [rev 6]" },'; \ ) > shell32-Default_Folder_ACLs.ok +# Patchset shell32-SHCreateSessionKey +# | +# | Included patches: +# | * shell32: Implement SHCreateSessionKey. [by Erich E. Hoover] +# | +# | This patchset fixes the following Wine bugs: +# | * [#35630] SHCreateSessionKey is unimplemented +# | +# | Modified files: +# | * dlls/shell32/shell32.spec, dlls/shell32/shellreg.c +# | +shell32-SHCreateSessionKey.ok: + $(PATCH) < shell32-SHCreateSessionKey/0001-shell32-Implement-SHCreateSessionKey.patch + @( \ + echo '+ { "shell32-SHCreateSessionKey", "Erich E. Hoover", "shell32: Implement SHCreateSessionKey." },'; \ + ) > shell32-SHCreateSessionKey.ok + # Patchset shlwapi-UrlCombine # | # | Included patches: diff --git a/patches/shell32-SHCreateSessionKey/0001-shell32-Implement-SHCreateSessionKey.patch b/patches/shell32-SHCreateSessionKey/0001-shell32-Implement-SHCreateSessionKey.patch new file mode 100644 index 00000000..b0ac04fd --- /dev/null +++ b/patches/shell32-SHCreateSessionKey/0001-shell32-Implement-SHCreateSessionKey.patch @@ -0,0 +1,76 @@ +From ea888427e5b49e9e3a08bdec8a35261f8e220542 Mon Sep 17 00:00:00 2001 +From: Dmitry Timoshkov +Date: Mon, 17 Feb 2014 11:52:46 +0900 +Subject: shell32: Implement SHCreateSessionKey. + +This implementation is based on the Geoff Chappell description, +and it seems to be enough for the application I have here. +--- + dlls/shell32/shell32.spec | 1 + + dlls/shell32/shellreg.c | 41 +++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 42 insertions(+) + +diff --git a/dlls/shell32/shell32.spec b/dlls/shell32/shell32.spec +index d73dcbb..ff1b522 100644 +--- a/dlls/shell32/shell32.spec ++++ b/dlls/shell32/shell32.spec +@@ -261,6 +261,7 @@ + 704 stdcall -noname GUIDFromStringW(wstr ptr) + 709 stdcall SHGetSetFolderCustomSettings(ptr str long) + 714 stdcall @(ptr) SHELL32_714 # PathIsTemporaryW ++ 723 stdcall SHCreateSessionKey(long ptr) + 727 stdcall SHGetImageList(long ptr ptr) + 730 stdcall -noname RestartDialogEx(long wstr long long) + 743 stdcall SHCreateFileExtractIconW(wstr long ptr ptr) +diff --git a/dlls/shell32/shellreg.c b/dlls/shell32/shellreg.c +index 37f3d9e..96a450e 100644 +--- a/dlls/shell32/shellreg.c ++++ b/dlls/shell32/shellreg.c +@@ -147,3 +147,44 @@ HRESULT WINAPI SHRegCloseKey (HKEY hkey) + TRACE("%p\n",hkey); + return RegCloseKey( hkey ); + } ++ ++static const char session_reg_key[] = "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\SessionInfo\\"; ++ ++static BOOL WINAPI create_session_key(INIT_ONCE *once, void *param, void **context) ++{ ++ static const char desktop_guid[] = "__wine_display_device_guid"; ++ ATOM guid_atom; ++ HKEY hkey_session; ++ LPWSTR session_reg_str = param; ++ ++ guid_atom = HandleToULong(GetPropA(GetDesktopWindow(), desktop_guid)); ++ if (!guid_atom) return FALSE; ++ ++ MultiByteToWideChar(CP_ACP, 0, session_reg_key, sizeof(session_reg_key), session_reg_str, sizeof(session_reg_key)); ++ ++ if (!GlobalGetAtomNameW(guid_atom, session_reg_str + sizeof(session_reg_key) - 1, 39)) ++ return FALSE; ++ ++ if (RegCreateKeyExW(HKEY_CURRENT_USER, session_reg_str, 0, NULL, ++ REG_OPTION_VOLATILE, KEY_WRITE, NULL, &hkey_session, NULL)) ++ return FALSE; ++ ++ RegCloseKey(hkey_session); ++ TRACE("session key %s\n", debugstr_w(session_reg_str)); ++ return TRUE; ++} ++ ++/************************************************************************* ++ * SHCreateSessionKey [SHELL32.723] ++ * ++ */ ++HRESULT WINAPI SHCreateSessionKey(REGSAM access, HKEY *hkey) ++{ ++ static INIT_ONCE init_once = INIT_ONCE_STATIC_INIT; ++ static WCHAR session_reg_str[sizeof(session_reg_key) + 39]; ++ ++ InitOnceExecuteOnce(&init_once, create_session_key, session_reg_str, NULL); ++ ++ TRACE("using session key %s\n", debugstr_w(session_reg_str)); ++ return RegOpenKeyExW(HKEY_CURRENT_USER, session_reg_str, 0, access, hkey); ++} +-- +1.7.9.5 + diff --git a/patches/shell32-SHCreateSessionKey/definition b/patches/shell32-SHCreateSessionKey/definition new file mode 100644 index 00000000..d8f5c1ff --- /dev/null +++ b/patches/shell32-SHCreateSessionKey/definition @@ -0,0 +1,4 @@ +Author: Erich E. Hoover +Subject: shell32: Implement SHCreateSessionKey. +Revision: 1 +Fixes: [35630] SHCreateSessionKey not implemented From 9561788866ff48b70bb7fe3b47408d44269b3b92 Mon Sep 17 00:00:00 2001 From: "Erich E. Hoover" Date: Sat, 26 Jul 2014 15:55:56 -0600 Subject: [PATCH 3/3] Fix authot in SHCreateSessionKey defintion file. --- patches/Makefile | 4 ++-- patches/shell32-SHCreateSessionKey/definition | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/patches/Makefile b/patches/Makefile index bc63906f..3f08e044 100644 --- a/patches/Makefile +++ b/patches/Makefile @@ -412,7 +412,7 @@ shell32-Default_Folder_ACLs.ok: # Patchset shell32-SHCreateSessionKey # | # | Included patches: -# | * shell32: Implement SHCreateSessionKey. [by Erich E. Hoover] +# | * shell32: Implement SHCreateSessionKey. [by Dmitry Timoshkov] # | # | This patchset fixes the following Wine bugs: # | * [#35630] SHCreateSessionKey is unimplemented @@ -423,7 +423,7 @@ shell32-Default_Folder_ACLs.ok: shell32-SHCreateSessionKey.ok: $(PATCH) < shell32-SHCreateSessionKey/0001-shell32-Implement-SHCreateSessionKey.patch @( \ - echo '+ { "shell32-SHCreateSessionKey", "Erich E. Hoover", "shell32: Implement SHCreateSessionKey." },'; \ + echo '+ { "shell32-SHCreateSessionKey", "Dmitry Timoshkov", "shell32: Implement SHCreateSessionKey." },'; \ ) > shell32-SHCreateSessionKey.ok # Patchset shlwapi-UrlCombine diff --git a/patches/shell32-SHCreateSessionKey/definition b/patches/shell32-SHCreateSessionKey/definition index d8f5c1ff..b32ad303 100644 --- a/patches/shell32-SHCreateSessionKey/definition +++ b/patches/shell32-SHCreateSessionKey/definition @@ -1,4 +1,4 @@ -Author: Erich E. Hoover +Author: Dmitry Timoshkov Subject: shell32: Implement SHCreateSessionKey. Revision: 1 Fixes: [35630] SHCreateSessionKey not implemented