https://git.reactos.org/?p=reactos.git;a=commitdiff;h=9fefb011f46b2f2f16c9fc...
commit 9fefb011f46b2f2f16c9fc39016cab6bd60d9661 Author: Amine Khaldi amine.khaldi@reactos.org AuthorDate: Fri Mar 23 12:24:25 2018 +0100 Commit: Amine Khaldi amine.khaldi@reactos.org CommitDate: Fri Mar 23 12:24:25 2018 +0100
[SHDOCVW] Sync with Wine Staging 3.3. CORE-14434 --- dll/win32/shdocvw/CMakeLists.txt | 4 +-- dll/win32/shdocvw/precomp.h | 17 +++++++++++++ dll/win32/shdocvw/shdocvw.h | 36 ++++++++------------------ dll/win32/shdocvw/shdocvw.rc | 4 +-- dll/win32/shdocvw/shdocvw.spec | 4 +-- dll/win32/shdocvw/shdocvw_main.c | 55 ++++++++++++++++++++++++++++++++++++---- dll/win32/shdocvw/shlinstobj.c | 15 +++++++++++ media/doc/README.WINE | 2 +- 8 files changed, 99 insertions(+), 38 deletions(-)
diff --git a/dll/win32/shdocvw/CMakeLists.txt b/dll/win32/shdocvw/CMakeLists.txt index f79613e308..5efd1fda99 100644 --- a/dll/win32/shdocvw/CMakeLists.txt +++ b/dll/win32/shdocvw/CMakeLists.txt @@ -9,7 +9,7 @@ spec2def(shdocvw.dll shdocvw.spec ADD_IMPORTLIB) list(APPEND SOURCE shdocvw_main.c shlinstobj.c - shdocvw.h + precomp.h ${CMAKE_CURRENT_BINARY_DIR}/shdocvw_stubs.c)
add_typelib(shdocvw_v1.idl) @@ -25,5 +25,5 @@ target_link_libraries(shdocvw uuid wine) add_delay_importlibs(shdocvw ole32 oleaut32 ieframe) add_importlibs(shdocvw shlwapi advapi32 msvcrt kernel32 ntdll) add_dependencies(shdocvw stdole2) -add_pch(shdocvw shdocvw.h SOURCE) +add_pch(shdocvw precomp.h SOURCE) add_cd_file(TARGET shdocvw DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/shdocvw/precomp.h b/dll/win32/shdocvw/precomp.h new file mode 100644 index 0000000000..48f0f29716 --- /dev/null +++ b/dll/win32/shdocvw/precomp.h @@ -0,0 +1,17 @@ + +#ifndef _SHDOCVW_PRECOMP_H +#define _SHDOCVW_PRECOMP_H + +#include <wine/config.h> + +#define WIN32_NO_STATUS +#define _INC_WINDOWS +#define COM_NO_WINDOWS_H + +#include "shdocvw.h" + +#include <winreg.h> + +#include <wine/debug.h> + +#endif /* !_SHDOCVW_PRECOMP_H */ diff --git a/dll/win32/shdocvw/shdocvw.h b/dll/win32/shdocvw/shdocvw.h index 626a9f8eeb..8cac507321 100644 --- a/dll/win32/shdocvw/shdocvw.h +++ b/dll/win32/shdocvw/shdocvw.h @@ -22,24 +22,21 @@ #ifndef __WINE_SHDOCVW_H #define __WINE_SHDOCVW_H
-#include <wine/config.h> +#define COBJMACROS
#include <stdarg.h>
-#define WIN32_NO_STATUS -#define _INC_WINDOWS -#define COM_NO_WINDOWS_H - -#define COBJMACROS +#include "windef.h" +#include "winbase.h" +#include "winuser.h"
-#include <windef.h> -#include <winbase.h> -#include <winnls.h> -#include <winreg.h> -#include <shlobj.h> +#include "ole2.h" +#include "shlobj.h" +#include "exdisp.h"
-#include <wine/debug.h> -WINE_DEFAULT_DEBUG_CHANNEL(shdocvw); +#include "wine/unicode.h" +#include "wine/heap.h" +#include "wine/list.h"
/********************************************************************** * Shell Instance Objects @@ -54,17 +51,4 @@ extern LONG SHDOCVW_refCount DECLSPEC_HIDDEN; static inline void SHDOCVW_LockModule(void) { InterlockedIncrement( &SHDOCVW_refCount ); } static inline void SHDOCVW_UnlockModule(void) { InterlockedDecrement( &SHDOCVW_refCount ); }
- -/* memory allocation functions */ - -static inline void* __WINE_ALLOC_SIZE(1) heap_alloc(size_t len) -{ - return HeapAlloc(GetProcessHeap(), 0, len); -} - -static inline BOOL heap_free(void *mem) -{ - return HeapFree(GetProcessHeap(), 0, mem); -} - #endif /* __WINE_SHDOCVW_H */ diff --git a/dll/win32/shdocvw/shdocvw.rc b/dll/win32/shdocvw/shdocvw.rc index ba5c8ae8f3..b262a8d3cc 100644 --- a/dll/win32/shdocvw/shdocvw.rc +++ b/dll/win32/shdocvw/shdocvw.rc @@ -16,7 +16,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
-#include <windef.h> +#include "windef.h"
1 WINE_REGISTRY "shdocvw_v1.rgs"
@@ -32,4 +32,4 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL #define WINE_PRODUCTVERSION_STR "6.0.2900.2180" #define WINE_EXTRAVALUES VALUE "OLESelfRegister",""
-#include <wine/wine_common_ver.rc> +#include "wine/wine_common_ver.rc" diff --git a/dll/win32/shdocvw/shdocvw.spec b/dll/win32/shdocvw/shdocvw.spec index 55c81d1c4b..f90cd11c6f 100644 --- a/dll/win32/shdocvw/shdocvw.spec +++ b/dll/win32/shdocvw/shdocvw.spec @@ -29,8 +29,8 @@ 129 stub DoFileDownloadEx 130 stdcall -noname RunInstallUninstallStubs2(long) 131 stub -noname SHCreateSplashScreen -132 stub DoOrganizeFavDlg -133 stub DoOrganizeFavDlgW +132 stdcall DoOrganizeFavDlg(long str) +133 stdcall DoOrganizeFavDlgW(long wstr) 134 stub DoPrivacyDlg 135 stub -noname IsFileUrl 136 stub -noname IsFileUrlW diff --git a/dll/win32/shdocvw/shdocvw_main.c b/dll/win32/shdocvw/shdocvw_main.c index 8a4c8c0269..ef9e3a7dfb 100644 --- a/dll/win32/shdocvw/shdocvw_main.c +++ b/dll/win32/shdocvw/shdocvw_main.c @@ -20,10 +20,24 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
+#include "config.h" + +#include <stdarg.h> +#include <stdio.h> + +#include "wine/unicode.h" +#include "wine/debug.h" + #include "shdocvw.h"
-#include <shlwapi.h> -#include <wininet.h> +#include "winreg.h" +#include "shlwapi.h" +#include "wininet.h" +#include "isguids.h" + +#include "initguid.h" + +WINE_DEFAULT_DEBUG_CHANNEL(shdocvw);
LONG SHDOCVW_refCount = 0;
@@ -365,8 +379,7 @@ DWORD WINAPI ParseURLFromOutsideSourceW(LPCWSTR url, LPWSTR out, LPDWORD plen, L HRESULT hr; DWORD needed; DWORD len; - DWORD res = 0; - + DWORD res;
TRACE("(%s, %p, %p, %p) len: %d, unknown: 0x%x\n", debugstr_w(url), out, plen, unknown, plen ? *plen : 0, unknown ? *unknown : 0); @@ -392,10 +405,12 @@ DWORD WINAPI ParseURLFromOutsideSourceW(LPCWSTR url, LPWSTR out, LPDWORD plen, L needed = lstrlenW(buffer_out)+1; TRACE("got 0x%x with %s (need %d)\n", hr, debugstr_w(buffer_out), needed);
+ res = 0; if (*plen >= needed) { if (out != NULL) { lstrcpyW(out, buffer_out); - res++; + /* On success, 1 is returned for unicode version */ + res = 1; } needed--; } @@ -438,6 +453,7 @@ DWORD WINAPI ParseURLFromOutsideSourceA(LPCSTR url, LPSTR out, LPDWORD plen, LPD if (*plen >= needed) { if (out != NULL) { WideCharToMultiByte(CP_ACP, 0, buffer, -1, out, *plen, NULL, NULL); + /* On success, string size including terminating 0 is returned for ansi version */ res = needed; } needed--; @@ -546,3 +562,32 @@ BOOL WINAPI DoFileDownload(LPWSTR filename) FIXME("(%s) stub\n", debugstr_w(filename)); return FALSE; } + +/****************************************************************** + * DoOrganizeFavDlgW (SHDOCVW.@) + */ +BOOL WINAPI DoOrganizeFavDlgW(HWND hwnd, LPCWSTR initDir) +{ + FIXME("(%p %s) stub\n", hwnd, debugstr_w(initDir)); + return FALSE; +} + +/****************************************************************** + * DoOrganizeFavDlg (SHDOCVW.@) + */ +BOOL WINAPI DoOrganizeFavDlg(HWND hwnd, LPCSTR initDir) +{ + LPWSTR initDirW = NULL; + BOOL res; + + TRACE("(%p %s)\n", hwnd, debugstr_a(initDir)); + + if (initDir) { + DWORD len = MultiByteToWideChar(CP_ACP, 0, initDir, -1, NULL, 0); + initDirW = heap_alloc(len * sizeof(WCHAR)); + MultiByteToWideChar(CP_ACP, 0, initDir, -1, initDirW, len); + } + res = DoOrganizeFavDlgW(hwnd, initDirW); + heap_free(initDirW); + return res; +} diff --git a/dll/win32/shdocvw/shlinstobj.c b/dll/win32/shdocvw/shlinstobj.c index 1a4e2d2f56..9c3232c65e 100644 --- a/dll/win32/shdocvw/shlinstobj.c +++ b/dll/win32/shdocvw/shlinstobj.c @@ -23,8 +23,23 @@ * some registry entries. This feature was introduced with win2k. Please * search for 'Shell Instance Objects' on MSDN to get more information. */
+#include <stdarg.h> + +#define COBJMACROS + +#include "windef.h" +#include "winbase.h" +#include "winreg.h" +#include "objbase.h" +#include "oleauto.h" + #include "shdocvw.h"
+#include "wine/unicode.h" +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(shdocvw); + #define CHARS_IN_GUID 39
/****************************************************************************** diff --git a/media/doc/README.WINE b/media/doc/README.WINE index a360d2838e..23c4ed6176 100644 --- a/media/doc/README.WINE +++ b/media/doc/README.WINE @@ -171,7 +171,7 @@ reactos/dll/win32/security # Forked (different .spec) reactos/dll/win32/sensapi # Synced to WineStaging-3.3 reactos/dll/win32/setupapi # Forked at Wine-20050524 reactos/dll/win32/shdoclc # Synced to WineStaging-3.3 -reactos/dll/win32/shdocvw # Synced to Wine-3.0 +reactos/dll/win32/shdocvw # Synced to WineStaging-3.3 reactos/dll/win32/shell32 # Forked at Wine-20071011 reactos/dll/win32/shfolder # Synced to WineStaging-2.9 reactos/dll/win32/shlwapi # Synced to WineStaging-3.3