https://git.reactos.org/?p=reactos.git;a=commitdiff;h=24c1f25a26d685be6a2a4…
commit 24c1f25a26d685be6a2a410d2ae8b8898a074106
Author: Amine Khaldi <amine.khaldi(a)reactos.org>
AuthorDate: Fri Mar 23 12:22:03 2018 +0100
Commit: Amine Khaldi <amine.khaldi(a)reactos.org>
CommitDate: Fri Mar 23 12:22:03 2018 +0100
[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(-)
diff --git a/dll/win32/scrrun/CMakeLists.txt b/dll/win32/scrrun/CMakeLists.txt
index 1bafb176bf..d77282faf2 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 17810ce778..681274e321 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 <stdarg.h>
+
+#include "windef.h"
+#include "winbase.h"
+#include "ole2.h"
+#include "olectl.h"
+#include "dispex.h"
+#include "scrrun.h"
#include "scrrun_private.h"
-#include <olectl.h>
-#include <wine/list.h>
-#include <wine/port.h>
-#include <wine/unicode.h>
+#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 45370e1e39..7a162a2776 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 <stdarg.h>
+#include <limits.h>
+
+#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 <winver.h>
-#include <olectl.h>
-#include <ntsecapi.h>
-#include <wine/unicode.h>
+#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 0000000000..6832cbfa94
--- /dev/null
+++ b/dll/win32/scrrun/precomp.h
@@ -0,0 +1,27 @@
+
+#ifndef _SCRRUN_PRECOMP_H_
+#define _SCRRUN_PRECOMP_H_
+
+#include <wine/config.h>
+
+#include <stdarg.h>
+
+#define WIN32_NO_STATUS
+#define _INC_WINDOWS
+#define COM_NO_WINDOWS_H
+
+#define COBJMACROS
+
+#include <windef.h>
+#include <winbase.h>
+#include <winnls.h>
+#include <objbase.h>
+#include <oleauto.h>
+#include <dispex.h>
+#include <scrrun.h>
+
+#include <wine/debug.h>
+
+#include "scrrun_private.h"
+
+#endif /* !_SCRRUN_PRECOMP_H_ */
diff --git a/dll/win32/scrrun/scrrun.c b/dll/win32/scrrun/scrrun.c
index 946f8b71ec..8c60c8072f 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 <stdarg.h>
+
+#include "windef.h"
+#include "winbase.h"
+#include "ole2.h"
+#include "olectl.h"
+#include "rpcproxy.h"
+
+#include <initguid.h>
+#include "scrrun.h"
#include "scrrun_private.h"
-#include <rpcproxy.h>
+#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 69ff610a45..d9ff2416a5 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 <wine/config.h>
-
-#include <stdarg.h>
-
-#define WIN32_NO_STATUS
-#define _INC_WINDOWS
-#define COM_NO_WINDOWS_H
-
-#define COBJMACROS
-
-#include <windef.h>
-#include <winbase.h>
-#include <winnls.h>
-#include <objbase.h>
-#include <oleauto.h>
-#include <dispex.h>
-#include <scrrun.h>
-
-#include <wine/debug.h>
-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 5283c09505..1a61dfada4 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