[CSCRIPT][WSCRIPT] Sync with Wine Staging 3.3. CORE-14434
authorAmine Khaldi <amine.khaldi@reactos.org>
Sun, 25 Mar 2018 11:48:58 +0000 (12:48 +0100)
committerAmine Khaldi <amine.khaldi@reactos.org>
Sun, 25 Mar 2018 11:48:58 +0000 (12:48 +0100)
base/applications/cmdutils/cscript/CMakeLists.txt
base/applications/cmdutils/wscript/CMakeLists.txt
base/applications/cmdutils/wscript/arguments.c
base/applications/cmdutils/wscript/host.c
base/applications/cmdutils/wscript/main.c
base/applications/cmdutils/wscript/precomp.h [new file with mode: 0644]
base/applications/cmdutils/wscript/wscript.h
media/doc/README.WINE

index ab8d104..472f94b 100644 (file)
@@ -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)
index a38899b..ef489fd 100644 (file)
@@ -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)
index f36b56e..7961948 100644 (file)
  * 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;
 
index b867fae..68013f8 100644 (file)
  * 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;
index 568d090..0191b5a 100644 (file)
  * 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 (file)
index 0000000..1b7afda
--- /dev/null
@@ -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_ */
index 905a8ea..ca18363 100644 (file)
  * 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_ */
index 1fdf308..533d838 100644 (file)
@@ -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