From eae3333c2f729993b5f1f1f5833f0040dfc3e422 Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Sun, 25 Mar 2018 12:48:58 +0100 Subject: [PATCH] [CSCRIPT][WSCRIPT] Sync with Wine Staging 3.3. CORE-14434 --- .../cmdutils/cscript/CMakeLists.txt | 4 +- .../cmdutils/wscript/CMakeLists.txt | 4 +- .../applications/cmdutils/wscript/arguments.c | 13 +++++++ base/applications/cmdutils/wscript/host.c | 19 ++++++++++ base/applications/cmdutils/wscript/main.c | 19 +++++++++- base/applications/cmdutils/wscript/precomp.h | 21 +++++++++++ base/applications/cmdutils/wscript/wscript.h | 37 +------------------ media/doc/README.WINE | 4 +- 8 files changed, 79 insertions(+), 42 deletions(-) create mode 100644 base/applications/cmdutils/wscript/precomp.h diff --git a/base/applications/cmdutils/cscript/CMakeLists.txt b/base/applications/cmdutils/cscript/CMakeLists.txt index ab8d104426a..472f94b6224 100644 --- a/base/applications/cmdutils/cscript/CMakeLists.txt +++ b/base/applications/cmdutils/cscript/CMakeLists.txt @@ -7,7 +7,7 @@ list(APPEND SOURCE ${wscript_folder}/arguments.c ${wscript_folder}/host.c ${wscript_folder}/main.c - ${wscript_folder}/wscript.h) + ${wscript_folder}/precomp.h) add_executable(cscript ${SOURCE} rsrc.rc) add_idl_headers(cscript_idlheader ihost.idl) @@ -17,5 +17,5 @@ target_link_libraries(cscript uuid wine) set_module_type(cscript win32cui UNICODE) add_importlibs(cscript shell32 oleaut32 ole32 advapi32 user32 msvcrt kernel32 ntdll) add_dependencies(cscript stdole2 cscript_idlheader) -add_pch(cscript ${wscript_folder}/wscript.h SOURCE) +add_pch(cscript ${wscript_folder}/precomp.h SOURCE) add_cd_file(TARGET cscript DESTINATION reactos/system32 FOR all) diff --git a/base/applications/cmdutils/wscript/CMakeLists.txt b/base/applications/cmdutils/wscript/CMakeLists.txt index a38899b0e34..ef489fd10ae 100644 --- a/base/applications/cmdutils/wscript/CMakeLists.txt +++ b/base/applications/cmdutils/wscript/CMakeLists.txt @@ -3,7 +3,7 @@ list(APPEND SOURCE arguments.c host.c main.c - wscript.h) + precomp.h) add_executable(wscript ${SOURCE} rsrc.rc) add_idl_headers(wscript_idlheader ihost.idl) @@ -13,5 +13,5 @@ target_link_libraries(wscript uuid wine) set_module_type(wscript win32gui UNICODE) add_importlibs(wscript shell32 oleaut32 ole32 user32 advapi32 msvcrt kernel32 ntdll) add_dependencies(wscript stdole2 wscript_idlheader) -add_pch(wscript wscript.h SOURCE) +add_pch(wscript precomp.h SOURCE) add_cd_file(TARGET wscript DESTINATION reactos/system32 FOR all) diff --git a/base/applications/cmdutils/wscript/arguments.c b/base/applications/cmdutils/wscript/arguments.c index f36b56e08c5..7961948b6a5 100644 --- a/base/applications/cmdutils/wscript/arguments.c +++ b/base/applications/cmdutils/wscript/arguments.c @@ -16,8 +16,21 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#include + +#define COBJMACROS +#define CONST_VTABLE + +#include +#include +#include + #include "wscript.h" +#include + +WINE_DEFAULT_DEBUG_CHANNEL(wscript); + WCHAR **argums; int numOfArgs; diff --git a/base/applications/cmdutils/wscript/host.c b/base/applications/cmdutils/wscript/host.c index b867fae65c3..68013f80170 100644 --- a/base/applications/cmdutils/wscript/host.c +++ b/base/applications/cmdutils/wscript/host.c @@ -16,8 +16,23 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#include + +#define COBJMACROS +#define CONST_VTABLE + +#include +#include +#include + #include "wscript.h" +#include +#include +#include + +WINE_DEFAULT_DEBUG_CHANNEL(wscript); + #define BUILDVERSION 16535 static const WCHAR wshNameW[] = {'W','i','n','d','o','w','s',' ','S','c','r','i','p','t',' ','H','o','s','t',0}; @@ -307,7 +322,11 @@ static HRESULT WINAPI Host_Echo(IHost *iface, SAFEARRAY *args) { WCHAR *output = NULL, *ptr; unsigned argc, i, len; +#ifdef __REACTOS__ LONG ubound, lbound; +#else + int ubound, lbound; +#endif VARIANT *argv; BSTR *strs; HRESULT hres; diff --git a/base/applications/cmdutils/wscript/main.c b/base/applications/cmdutils/wscript/main.c index 568d090ebcd..0191b5ac28a 100644 --- a/base/applications/cmdutils/wscript/main.c +++ b/base/applications/cmdutils/wscript/main.c @@ -16,10 +16,25 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "wscript.h" +#include +#define COBJMACROS +#ifdef __REACTOS__ +#define CONST_VTABLE +#endif + +#include +#include +#include +#include #include #include +#include + +#include "wscript.h" + +#include +#include #ifdef _WIN64 @@ -35,6 +50,8 @@ #endif +WINE_DEFAULT_DEBUG_CHANNEL(wscript); + static const WCHAR wscriptW[] = {'W','S','c','r','i','p','t',0}; static const WCHAR wshW[] = {'W','S','H',0}; WCHAR scriptFullName[MAX_PATH]; diff --git a/base/applications/cmdutils/wscript/precomp.h b/base/applications/cmdutils/wscript/precomp.h new file mode 100644 index 00000000000..1b7afda49ec --- /dev/null +++ b/base/applications/cmdutils/wscript/precomp.h @@ -0,0 +1,21 @@ + +#ifndef _WSCRIPT_PRECOMP_H_ +#define _WSCRIPT_PRECOMP_H_ + +#include + +#define WIN32_NO_STATUS +#define _INC_WINDOWS +#define COBJMACROS +#define CONST_VTABLE + +#include +#include +#include +#include +#include +#include + +#include "wscript.h" + +#endif /* !_WSCRIPT_PRECOMP_H_ */ diff --git a/base/applications/cmdutils/wscript/wscript.h b/base/applications/cmdutils/wscript/wscript.h index 905a8ea6fd5..ca18363233c 100644 --- a/base/applications/cmdutils/wscript/wscript.h +++ b/base/applications/cmdutils/wscript/wscript.h @@ -16,25 +16,9 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#ifndef _WSCRIPT_H_ -#define _WSCRIPT_H_ +#pragma once -#include - -#define WIN32_NO_STATUS -#define _INC_WINDOWS -#define COBJMACROS -#define CONST_VTABLE - -#include -#include -#include -#include -#include -#include -#include - -WINE_DEFAULT_DEBUG_CHANNEL(wscript); +#include "ihost.h" extern IHost host_obj; @@ -51,20 +35,3 @@ extern WCHAR **argums; extern int numOfArgs; extern VARIANT_BOOL wshInteractive; - -static inline void * __WINE_ALLOC_SIZE(1) heap_alloc(size_t len) -{ - return HeapAlloc(GetProcessHeap(), 0, len); -} - -static inline void * __WINE_ALLOC_SIZE(1) heap_alloc_zero(size_t len) -{ - return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len); -} - -static inline BOOL heap_free(void *mem) -{ - return HeapFree(GetProcessHeap(), 0, mem); -} - -#endif /* _WSCRIPT_H_ */ diff --git a/media/doc/README.WINE b/media/doc/README.WINE index 1fdf3089a89..533d838867a 100644 --- a/media/doc/README.WINE +++ b/media/doc/README.WINE @@ -226,12 +226,12 @@ reactos/win32ss/printing/monitors/localmon/ui/ # Synced to WineStaging-3.3 (kno ReactOS shares the following programs with Winehq. -reactos/base/applications/cmdutils/cscript # Synced to WineStaging-2.9 +reactos/base/applications/cmdutils/cscript # Synced to WineStaging-3.3 reactos/base/applications/cmdutils/reg # Synced to Wine-3.0 reactos/base/applications/cmdutils/schtasks # Synced to WineStaging-2.9 reactos/base/applications/cmdutils/taskkill # Synced to Wine-3.0 reactos/base/applications/cmdutils/wmic # Synced to WineStaging-2.9 -reactos/base/applications/cmdutils/wscript # Synced to WineStaging-2.9 +reactos/base/applications/cmdutils/wscript # Synced to WineStaging-3.3 reactos/base/applications/cmdutils/xcopy # Synced to Wine-3.0 reactos/base/applications/games/winmine # Synced to WineStaging-2.16 with our own resources. reactos/base/applications/extrac32 # Synced to WineStaging-2.9