https://git.reactos.org/?p=reactos.git;a=commitdiff;h=eae3333c2f729993b5f1f…
commit eae3333c2f729993b5f1f1f5833f0040dfc3e422
Author: Amine Khaldi <amine.khaldi(a)reactos.org>
AuthorDate: Sun Mar 25 12:48:58 2018 +0100
Commit: Amine Khaldi <amine.khaldi(a)reactos.org>
CommitDate: Sun Mar 25 12:48:58 2018 +0100
[CSCRIPT][WSCRIPT] Sync with Wine Staging 3.3. CORE-14434
---
base/applications/cmdutils/cscript/CMakeLists.txt | 4 +--
base/applications/cmdutils/wscript/CMakeLists.txt | 4 +--
base/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(-)
diff --git a/base/applications/cmdutils/cscript/CMakeLists.txt
b/base/applications/cmdutils/cscript/CMakeLists.txt
index ab8d104426..472f94b622 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 a38899b0e3..ef489fd10a 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 f36b56e08c..7961948b6a 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 <stdarg.h>
+
+#define COBJMACROS
+#define CONST_VTABLE
+
+#include <windef.h>
+#include <winbase.h>
+#include <ole2.h>
+
#include "wscript.h"
+#include <wine/debug.h>
+
+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 b867fae65c..68013f8017 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 <stdarg.h>
+
+#define COBJMACROS
+#define CONST_VTABLE
+
+#include <windef.h>
+#include <winbase.h>
+#include <ole2.h>
+
#include "wscript.h"
+#include <wine/debug.h>
+#include <wine/heap.h>
+#include <wine/unicode.h>
+
+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 568d090ebc..0191b5ac28 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 <stdarg.h>
+
+#define COBJMACROS
+#ifdef __REACTOS__
+#define CONST_VTABLE
+#endif
+#include <windef.h>
+#include <winbase.h>
+#include <winreg.h>
+#include <ole2.h>
#include <shellapi.h>
#include <activscp.h>
+#include <initguid.h>
+
+#include "wscript.h"
+
+#include <wine/debug.h>
+#include <wine/unicode.h>
#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 0000000000..1b7afda49e
--- /dev/null
+++ b/base/applications/cmdutils/wscript/precomp.h
@@ -0,0 +1,21 @@
+
+#ifndef _WSCRIPT_PRECOMP_H_
+#define _WSCRIPT_PRECOMP_H_
+
+#include <stdarg.h>
+
+#define WIN32_NO_STATUS
+#define _INC_WINDOWS
+#define COBJMACROS
+#define CONST_VTABLE
+
+#include <windef.h>
+#include <winbase.h>
+#include <initguid.h>
+#include <ole2.h>
+#include <wine/debug.h>
+#include <wine/unicode.h>
+
+#include "wscript.h"
+
+#endif /* !_WSCRIPT_PRECOMP_H_ */
diff --git a/base/applications/cmdutils/wscript/wscript.h
b/base/applications/cmdutils/wscript/wscript.h
index 905a8ea6fd..ca18363233 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 <stdarg.h>
-
-#define WIN32_NO_STATUS
-#define _INC_WINDOWS
-#define COBJMACROS
-#define CONST_VTABLE
-
-#include <windef.h>
-#include <winbase.h>
-#include <initguid.h>
-#include <ole2.h>
-#include <ihost.h>
-#include <wine/debug.h>
-#include <wine/unicode.h>
-
-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 1fdf3089a8..533d838867 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