From 24c1f25a26d685be6a2a410d2ae8b8898a074106 Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Fri, 23 Mar 2018 12:22:03 +0100 Subject: [PATCH] [SCRRUN] Sync with Wine Staging 3.3. CORE-14434 --- dll/win32/scrrun/CMakeLists.txt | 4 ++-- dll/win32/scrrun/dictionary.c | 22 ++++++++++++++++---- dll/win32/scrrun/filesystem.c | 34 +++++++++++++++++++++++-------- dll/win32/scrrun/precomp.h | 27 ++++++++++++++++++++++++ dll/win32/scrrun/scrrun.c | 18 ++++++++++++++-- dll/win32/scrrun/scrrun_private.h | 34 ++----------------------------- media/doc/README.WINE | 2 +- 7 files changed, 92 insertions(+), 49 deletions(-) create mode 100644 dll/win32/scrrun/precomp.h diff --git a/dll/win32/scrrun/CMakeLists.txt b/dll/win32/scrrun/CMakeLists.txt index 1bafb176bfb..d77282faf24 100644 --- a/dll/win32/scrrun/CMakeLists.txt +++ b/dll/win32/scrrun/CMakeLists.txt @@ -9,7 +9,7 @@ list(APPEND SOURCE dictionary.c filesystem.c scrrun.c - scrrun_private.h + precomp.h ${CMAKE_CURRENT_BINARY_DIR}/scrrun_stubs.c) list(APPEND scrrun_rc_deps @@ -29,5 +29,5 @@ add_dependencies(scrrun scrrun_idlheader stdole2) set_module_type(scrrun win32dll) target_link_libraries(scrrun uuid wine) add_importlibs(scrrun oleaut32 version advapi32 msvcrt kernel32 ntdll) -add_pch(scrrun scrrun_private.h SOURCE) +add_pch(scrrun precomp.h SOURCE) add_cd_file(TARGET scrrun DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/scrrun/dictionary.c b/dll/win32/scrrun/dictionary.c index 17810ce7787..681274e3218 100644 --- a/dll/win32/scrrun/dictionary.c +++ b/dll/win32/scrrun/dictionary.c @@ -16,13 +16,27 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#define COBJMACROS +#include "config.h" +#include "wine/port.h" + +#include + +#include "windef.h" +#include "winbase.h" +#include "ole2.h" +#include "olectl.h" +#include "dispex.h" +#include "scrrun.h" #include "scrrun_private.h" -#include -#include -#include -#include +#include "wine/debug.h" +#include "wine/unicode.h" +#include "wine/heap.h" +#include "wine/list.h" + +WINE_DEFAULT_DEBUG_CHANNEL(scrrun); #define BUCKET_COUNT 509 #define DICT_HASH_MOD 1201 diff --git a/dll/win32/scrrun/filesystem.c b/dll/win32/scrrun/filesystem.c index 45370e1e390..7a162a27764 100644 --- a/dll/win32/scrrun/filesystem.c +++ b/dll/win32/scrrun/filesystem.c @@ -16,12 +16,30 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#define COBJMACROS + +#include "config.h" +#include +#include + +#include "windef.h" +#include "winbase.h" +#include "ole2.h" +#include "olectl.h" +#include "dispex.h" +#include "ntsecapi.h" +#include "scrrun.h" #include "scrrun_private.h" +#include "wine/debug.h" +#include "wine/unicode.h" +#include "wine/heap.h" + +#ifdef __REACTOS__ #include -#include -#include -#include +#endif + +WINE_DEFAULT_DEBUG_CHANNEL(scrrun); static const WCHAR bsW[] = {'\\',0}; static const WCHAR utf16bom = 0xfeff; @@ -987,7 +1005,7 @@ static HRESULT WINAPI drive_get_VolumeName(IDrive *iface, BSTR *name) return E_POINTER; *name = NULL; - ret = GetVolumeInformationW(This->root, nameW, sizeof(nameW)/sizeof(WCHAR), NULL, NULL, NULL, NULL, 0); + ret = GetVolumeInformationW(This->root, nameW, ARRAY_SIZE(nameW), NULL, NULL, NULL, NULL, 0); if (ret) *name = SysAllocString(nameW); return ret ? S_OK : E_FAIL; @@ -1012,7 +1030,7 @@ static HRESULT WINAPI drive_get_FileSystem(IDrive *iface, BSTR *fs) return E_POINTER; *fs = NULL; - ret = GetVolumeInformationW(This->root, NULL, 0, NULL, NULL, NULL, nameW, sizeof(nameW)/sizeof(WCHAR)); + ret = GetVolumeInformationW(This->root, NULL, 0, NULL, NULL, NULL, nameW, ARRAY_SIZE(nameW)); if (ret) *fs = SysAllocString(nameW); return ret ? S_OK : E_FAIL; @@ -3427,13 +3445,13 @@ static HRESULT WINAPI filesys_GetSpecialFolder(IFileSystem3 *iface, switch (SpecialFolder) { case WindowsFolder: - ret = GetWindowsDirectoryW(pathW, sizeof(pathW)/sizeof(WCHAR)); + ret = GetWindowsDirectoryW(pathW, ARRAY_SIZE(pathW)); break; case SystemFolder: - ret = GetSystemDirectoryW(pathW, sizeof(pathW)/sizeof(WCHAR)); + ret = GetSystemDirectoryW(pathW, ARRAY_SIZE(pathW)); break; case TemporaryFolder: - ret = GetTempPathW(sizeof(pathW)/sizeof(WCHAR), pathW); + ret = GetTempPathW(ARRAY_SIZE(pathW), pathW); /* we don't want trailing backslash */ if (ret && pathW[ret-1] == '\\') pathW[ret-1] = 0; diff --git a/dll/win32/scrrun/precomp.h b/dll/win32/scrrun/precomp.h new file mode 100644 index 00000000000..6832cbfa94f --- /dev/null +++ b/dll/win32/scrrun/precomp.h @@ -0,0 +1,27 @@ + +#ifndef _SCRRUN_PRECOMP_H_ +#define _SCRRUN_PRECOMP_H_ + +#include + +#include + +#define WIN32_NO_STATUS +#define _INC_WINDOWS +#define COM_NO_WINDOWS_H + +#define COBJMACROS + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "scrrun_private.h" + +#endif /* !_SCRRUN_PRECOMP_H_ */ diff --git a/dll/win32/scrrun/scrrun.c b/dll/win32/scrrun/scrrun.c index 946f8b71ec9..8c60c8072f1 100644 --- a/dll/win32/scrrun/scrrun.c +++ b/dll/win32/scrrun/scrrun.c @@ -15,10 +15,24 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#define COBJMACROS +#include "config.h" +#include + +#include "windef.h" +#include "winbase.h" +#include "ole2.h" +#include "olectl.h" +#include "rpcproxy.h" + +#include +#include "scrrun.h" #include "scrrun_private.h" -#include +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(scrrun); static HINSTANCE scrrun_instance; @@ -166,7 +180,7 @@ static void release_typelib(void) if(!typelib) return; - for(i=0; i < sizeof(typeinfos)/sizeof(*typeinfos); i++) + for (i = 0; i < ARRAY_SIZE(typeinfos); i++) if(typeinfos[i]) ITypeInfo_Release(typeinfos[i]); diff --git a/dll/win32/scrrun/scrrun_private.h b/dll/win32/scrrun/scrrun_private.h index 69ff610a45b..d9ff2416a54 100644 --- a/dll/win32/scrrun/scrrun_private.h +++ b/dll/win32/scrrun/scrrun_private.h @@ -15,30 +15,10 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ - #ifndef _SCRRUN_PRIVATE_H_ #define _SCRRUN_PRIVATE_H_ -#include - -#include - -#define WIN32_NO_STATUS -#define _INC_WINDOWS -#define COM_NO_WINDOWS_H - -#define COBJMACROS - -#include -#include -#include -#include -#include -#include -#include - -#include -WINE_DEFAULT_DEBUG_CHANNEL(scrrun); +#define ARRAY_SIZE(array) (sizeof(array) / sizeof((array)[0])) extern HRESULT WINAPI FileSystem_CreateInstance(IClassFactory*,IUnknown*,REFIID,void**) DECLSPEC_HIDDEN; extern HRESULT WINAPI Dictionary_CreateInstance(IClassFactory*,IUnknown*,REFIID,void**) DECLSPEC_HIDDEN; @@ -68,14 +48,4 @@ struct provideclassinfo { extern void init_classinfo(const GUID *guid, IUnknown *outer, struct provideclassinfo *classinfo) DECLSPEC_HIDDEN; -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 /* _SCRRUN_PRIVATE_H_ */ +#endif diff --git a/media/doc/README.WINE b/media/doc/README.WINE index 5283c09505f..1a61dfada44 100644 --- a/media/doc/README.WINE +++ b/media/doc/README.WINE @@ -165,7 +165,7 @@ reactos/dll/win32/rsabase # Synced to WineStaging-3.3 reactos/dll/win32/rsaenh # Synced to WineStaging-2.9 reactos/dll/win32/sccbase # Synced to WineStaging-3.3 reactos/dll/win32/schannel # Synced to WineStaging-3.3 -reactos/dll/win32/scrrun # Synced to WineStaging-2.9 +reactos/dll/win32/scrrun # Synced to WineStaging-3.3 reactos/dll/win32/secur32 # Forked reactos/dll/win32/security # Forked (different .spec) reactos/dll/win32/sensapi # Synced to WineStaging-2.9 -- 2.17.1