https://git.reactos.org/?p=reactos.git;a=commitdiff;h=fd8ec79fd18919b88b2db…
commit fd8ec79fd18919b88b2db5398e82b0fe2ed5db91
Author: Amine Khaldi <amine.khaldi(a)reactos.org>
AuthorDate: Mon Oct 1 00:11:58 2018 +0100
Commit: Amine Khaldi <amine.khaldi(a)reactos.org>
CommitDate: Mon Oct 1 00:11:58 2018 +0100
[CSCRIPT][WSCRIPT] Sync with Wine Staging 3.17. CORE-15127
---
base/applications/cmdutils/cscript/CMakeLists.txt | 2 +-
base/applications/cmdutils/wscript/CMakeLists.txt | 2 ++
base/applications/cmdutils/wscript/host.c | 6 +++---
base/applications/cmdutils/wscript/main.c | 8 ++++----
media/doc/README.WINE | 4 ++--
5 files changed, 12 insertions(+), 10 deletions(-)
diff --git a/base/applications/cmdutils/cscript/CMakeLists.txt
b/base/applications/cmdutils/cscript/CMakeLists.txt
index 472f94b622..5e0b98d08c 100644
--- a/base/applications/cmdutils/cscript/CMakeLists.txt
+++ b/base/applications/cmdutils/cscript/CMakeLists.txt
@@ -1,5 +1,5 @@
-add_definitions(-DCSCRIPT_BUILD)
+add_definitions(-DCSCRIPT_BUILD -D__WINESRC__)
set(wscript_folder ${REACTOS_SOURCE_DIR}/base/applications/cmdutils/wscript)
include_directories(${wscript_folder})
diff --git a/base/applications/cmdutils/wscript/CMakeLists.txt
b/base/applications/cmdutils/wscript/CMakeLists.txt
index ef489fd10a..a574ff5fb5 100644
--- a/base/applications/cmdutils/wscript/CMakeLists.txt
+++ b/base/applications/cmdutils/wscript/CMakeLists.txt
@@ -1,4 +1,6 @@
+add_definitions(-D__WINESRC__)
+
list(APPEND SOURCE
arguments.c
host.c
diff --git a/base/applications/cmdutils/wscript/host.c
b/base/applications/cmdutils/wscript/host.c
index 68013f8017..c6bc31c8bd 100644
--- a/base/applications/cmdutils/wscript/host.c
+++ b/base/applications/cmdutils/wscript/host.c
@@ -84,7 +84,7 @@ static void print_string(const WCHAR *string)
ret = WriteConsoleW(GetStdHandle(STD_OUTPUT_HANDLE), string, len, &count, NULL);
if(ret) {
static const WCHAR crnlW[] = {'\r','\n'};
- WriteConsoleW(GetStdHandle(STD_OUTPUT_HANDLE), crnlW,
sizeof(crnlW)/sizeof(*crnlW), &count, NULL);
+ WriteConsoleW(GetStdHandle(STD_OUTPUT_HANDLE), crnlW, ARRAY_SIZE(crnlW),
&count, NULL);
return;
}
@@ -183,7 +183,7 @@ static HRESULT WINAPI Host_get_FullName(IHost *iface, BSTR *out_Path)
WINE_TRACE("(%p)\n", out_Path);
- if(GetModuleFileNameW(NULL, fullPath, sizeof(fullPath)/sizeof(WCHAR)) == 0)
+ if(GetModuleFileNameW(NULL, fullPath, ARRAY_SIZE(fullPath)) == 0)
return E_FAIL;
if(!(*out_Path = SysAllocString(fullPath)))
return E_OUTOFMEMORY;
@@ -198,7 +198,7 @@ static HRESULT WINAPI Host_get_Path(IHost *iface, BSTR *out_Path)
WINE_TRACE("(%p)\n", out_Path);
- if(GetModuleFileNameW(NULL, path, sizeof(path)/sizeof(WCHAR)) == 0)
+ if(GetModuleFileNameW(NULL, path, ARRAY_SIZE(path)) == 0)
return E_FAIL;
pos = strrchrW(path, '\\');
howMany = pos - path;
diff --git a/base/applications/cmdutils/wscript/main.c
b/base/applications/cmdutils/wscript/main.c
index 0191b5ac28..e3ffe35ca3 100644
--- a/base/applications/cmdutils/wscript/main.c
+++ b/base/applications/cmdutils/wscript/main.c
@@ -256,7 +256,7 @@ static BOOL get_engine_clsid(const WCHAR *ext, CLSID *clsid)
if(res != ERROR_SUCCESS)
return FALSE;
- size = sizeof(fileid)/sizeof(WCHAR);
+ size = ARRAY_SIZE(fileid);
res = RegQueryValueW(hkey, NULL, fileid, &size);
RegCloseKey(hkey);
if(res != ERROR_SUCCESS)
@@ -269,7 +269,7 @@ static BOOL get_engine_clsid(const WCHAR *ext, CLSID *clsid)
if(res != ERROR_SUCCESS)
return FALSE;
- size = sizeof(progid)/sizeof(WCHAR);
+ size = ARRAY_SIZE(progid);
res = RegQueryValueW(hkey, NULL, progid, &size);
RegCloseKey(hkey);
if(res != ERROR_SUCCESS)
@@ -449,8 +449,8 @@ int WINAPI wWinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPWSTR
cmdline, int cm
WINE_FIXME("No file name specified\n");
return 1;
}
- res = GetFullPathNameW(filename, sizeof(scriptFullName)/sizeof(WCHAR),
scriptFullName, &filepart);
- if(!res || res > sizeof(scriptFullName)/sizeof(WCHAR))
+ res = GetFullPathNameW(filename, ARRAY_SIZE(scriptFullName), scriptFullName,
&filepart);
+ if(!res || res > ARRAY_SIZE(scriptFullName))
return 1;
ext = strrchrW(filepart, '.');
diff --git a/media/doc/README.WINE b/media/doc/README.WINE
index c71caf4196..63027239d4 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-3.3
+reactos/base/applications/cmdutils/cscript # Synced to WineStaging-3.17
reactos/base/applications/cmdutils/reg # Synced to WineStaging-3.9
reactos/base/applications/cmdutils/schtasks # Synced to WineStaging-3.3
reactos/base/applications/cmdutils/taskkill # Synced to WineStaging-3.3
reactos/base/applications/cmdutils/wmic # Synced to WineStaging-3.3
-reactos/base/applications/cmdutils/wscript # Synced to WineStaging-3.3
+reactos/base/applications/cmdutils/wscript # Synced to WineStaging-3.17
reactos/base/applications/cmdutils/xcopy # Synced to WineStaging-3.3
reactos/base/applications/games/winmine # Synced to WineStaging-2.16 with our own
resources.
reactos/base/applications/extrac32 # Synced to WineStaging-3.3