https://git.reactos.org/?p=reactos.git;a=commitdiff;h=6a5af78c498cfe194b979…
commit 6a5af78c498cfe194b979cb5b013458b2701e831
Author: Amine Khaldi <amine.khaldi(a)reactos.org>
AuthorDate: Sun Mar 25 12:39:53 2018 +0100
Commit: Amine Khaldi <amine.khaldi(a)reactos.org>
CommitDate: Sun Mar 25 12:40:20 2018 +0100
[WSHOM.OCX] Sync with Wine Staging 3.3. CORE-14434
---
dll/win32/wshom.ocx/CMakeLists.txt | 4 +--
dll/win32/wshom.ocx/precomp.h | 15 ++++++++++
dll/win32/wshom.ocx/shell.c | 56 ++++++++++++++++++++-----------------
dll/win32/wshom.ocx/wshom.rc | 2 +-
dll/win32/wshom.ocx/wshom_main.c | 10 +++++--
dll/win32/wshom.ocx/wshom_private.h | 20 ++++++-------
media/doc/README.WINE | 2 +-
7 files changed, 65 insertions(+), 44 deletions(-)
diff --git a/dll/win32/wshom.ocx/CMakeLists.txt b/dll/win32/wshom.ocx/CMakeLists.txt
index 6c0381fc04..56c3d3f1aa 100644
--- a/dll/win32/wshom.ocx/CMakeLists.txt
+++ b/dll/win32/wshom.ocx/CMakeLists.txt
@@ -12,7 +12,7 @@ add_typelib(wshom.idl)
list(APPEND SOURCE
shell.c
wshom_main.c
- wshom_private.h)
+ precomp.h)
add_library(wshom SHARED
${SOURCE}
@@ -30,5 +30,5 @@ set_module_type(wshom win32ocx)
target_link_libraries(wshom uuid wine)
add_importlibs(wshom oleaut32 ole32 shell32 advapi32 advapi32_vista user32 msvcrt
kernel32 ntdll)
add_dependencies(wshom stdole2 wshom_idlheader)
-add_pch(wshom wshom_private.h SOURCE)
+add_pch(wshom precomp.h SOURCE)
add_cd_file(TARGET wshom DESTINATION reactos/system32 FOR all)
diff --git a/dll/win32/wshom.ocx/precomp.h b/dll/win32/wshom.ocx/precomp.h
new file mode 100644
index 0000000000..8bd9d4326e
--- /dev/null
+++ b/dll/win32/wshom.ocx/precomp.h
@@ -0,0 +1,15 @@
+
+#ifndef _WSHOM_PRECOMP_H_
+#define _WSHOM_PRECOMP_H_
+
+#define WIN32_NO_STATUS
+#define _INC_WINDOWS
+
+#include "wshom_private.h"
+
+#include <wshom.h>
+#include <ocidl.h>
+
+#include <wine/debug.h>
+
+#endif /* !_WSHOM_PRECOMP_H_ */
diff --git a/dll/win32/wshom.ocx/shell.c b/dll/win32/wshom.ocx/shell.c
index bdae7d9fcd..1aa353a17a 100644
--- a/dll/win32/wshom.ocx/shell.c
+++ b/dll/win32/wshom.ocx/shell.c
@@ -17,13 +17,17 @@
*/
#include "wshom_private.h"
+#include "wshom.h"
-#include <shellapi.h>
-#include <shlobj.h>
-#include <dispex.h>
-#include <winreg.h>
+#include "shellapi.h"
+#include "shlobj.h"
+#include "dispex.h"
-#include <wine/unicode.h>
+#include "wine/debug.h"
+#include "wine/heap.h"
+#include "wine/unicode.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(wshom);
typedef struct
{
@@ -127,7 +131,7 @@ static ULONG WINAPI WshExec_Release(IWshExec *iface)
if (!ref) {
CloseHandle(This->info.hThread);
CloseHandle(This->info.hProcess);
- HeapFree(GetProcessHeap(), 0, This);
+ heap_free(This);
}
return ref;
@@ -322,7 +326,7 @@ static HRESULT WshExec_create(BSTR command, IWshExec **ret)
*ret = NULL;
- This = HeapAlloc(GetProcessHeap(), 0, sizeof(*This));
+ This = heap_alloc(sizeof(*This));
if (!This)
return E_OUTOFMEMORY;
@@ -330,7 +334,7 @@ static HRESULT WshExec_create(BSTR command, IWshExec **ret)
This->ref = 1;
if (!CreateProcessW(NULL, command, NULL, NULL, FALSE, 0, NULL, NULL, &si,
&This->info)) {
- HeapFree(GetProcessHeap(), 0, This);
+ heap_free(This);
return HRESULT_FROM_WIN32(GetLastError());
}
@@ -380,7 +384,7 @@ static ULONG WINAPI WshEnvironment_Release(IWshEnvironment *iface)
TRACE("(%p) ref = %d\n", This, ref);
if (!ref)
- HeapFree(GetProcessHeap(), 0, This);
+ heap_free(This);
return ref;
}
@@ -516,7 +520,7 @@ static HRESULT WshEnvironment_Create(IWshEnvironment **env)
{
WshEnvironment *This;
- This = HeapAlloc(GetProcessHeap(), 0, sizeof(*This));
+ This = heap_alloc(sizeof(*This));
if (!This) return E_OUTOFMEMORY;
This->IWshEnvironment_iface.lpVtbl = &WshEnvironmentVtbl;
@@ -569,7 +573,7 @@ static ULONG WINAPI WshCollection_Release(IWshCollection *iface)
TRACE("(%p) ref = %d\n", This, ref);
if (!ref)
- HeapFree(GetProcessHeap(), 0, This);
+ heap_free(This);
return ref;
}
@@ -718,7 +722,7 @@ static HRESULT WshCollection_Create(IWshCollection **collection)
{
WshCollection *This;
- This = HeapAlloc(GetProcessHeap(), 0, sizeof(*This));
+ This = heap_alloc(sizeof(*This));
if (!This) return E_OUTOFMEMORY;
This->IWshCollection_iface.lpVtbl = &WshCollectionVtbl;
@@ -775,7 +779,7 @@ static ULONG WINAPI WshShortcut_Release(IWshShortcut *iface)
{
SysFreeString(This->path_link);
IShellLinkW_Release(This->link);
- HeapFree(GetProcessHeap(), 0, This);
+ heap_free(This);
}
return ref;
@@ -856,7 +860,7 @@ static HRESULT WINAPI WshShortcut_get_Arguments(IWshShortcut *iface,
BSTR *Argum
*Arguments = NULL;
- hr = IShellLinkW_GetArguments(This->link, buffW, sizeof(buffW)/sizeof(WCHAR));
+ hr = IShellLinkW_GetArguments(This->link, buffW, ARRAY_SIZE(buffW));
if (FAILED(hr))
return hr;
@@ -914,7 +918,7 @@ static HRESULT WINAPI WshShortcut_get_IconLocation(IWshShortcut
*iface, BSTR *Ic
if (!IconPath)
return E_POINTER;
- hr = IShellLinkW_GetIconLocation(This->link, buffW, sizeof(buffW)/sizeof(WCHAR),
&icon);
+ hr = IShellLinkW_GetIconLocation(This->link, buffW, ARRAY_SIZE(buffW),
&icon);
if (FAILED(hr)) return hr;
sprintfW(pathW, fmtW, buffW, icon);
@@ -1003,7 +1007,7 @@ static HRESULT WINAPI WshShortcut_get_WorkingDirectory(IWshShortcut
*iface, BSTR
return E_POINTER;
*WorkingDirectory = NULL;
- hr = IShellLinkW_GetWorkingDirectory(This->link, buffW,
sizeof(buffW)/sizeof(WCHAR));
+ hr = IShellLinkW_GetWorkingDirectory(This->link, buffW, ARRAY_SIZE(buffW));
if (FAILED(hr)) return hr;
*WorkingDirectory = SysAllocString(buffW);
@@ -1074,7 +1078,7 @@ static HRESULT WshShortcut_Create(const WCHAR *path, IDispatch
**shortcut)
*shortcut = NULL;
- This = HeapAlloc(GetProcessHeap(), 0, sizeof(*This));
+ This = heap_alloc(sizeof(*This));
if (!This) return E_OUTOFMEMORY;
This->IWshShortcut_iface.lpVtbl = &WshShortcutVtbl;
@@ -1084,7 +1088,7 @@ static HRESULT WshShortcut_Create(const WCHAR *path, IDispatch
**shortcut)
&IID_IShellLinkW, (void**)&This->link);
if (FAILED(hr))
{
- HeapFree(GetProcessHeap(), 0, This);
+ heap_free(This);
return hr;
}
@@ -1092,7 +1096,7 @@ static HRESULT WshShortcut_Create(const WCHAR *path, IDispatch
**shortcut)
if (!This->path_link)
{
IShellLinkW_Release(This->link);
- HeapFree(GetProcessHeap(), 0, This);
+ heap_free(This);
return E_OUTOFMEMORY;
}
@@ -1392,7 +1396,7 @@ static HKEY get_root_key(const WCHAR *path)
};
int i;
- for (i = 0; i < sizeof(rootkeys)/sizeof(rootkeys[0]); i++) {
+ for (i = 0; i < ARRAY_SIZE(rootkeys); i++) {
if (!strncmpW(path, rootkeys[i].full, strlenW(rootkeys[i].full)))
return rootkeys[i].hkey;
if (rootkeys[i].abbrev[0] && !strncmpW(path, rootkeys[i].abbrev,
strlenW(rootkeys[i].abbrev)))
@@ -1423,7 +1427,7 @@ static HRESULT split_reg_path(const WCHAR *path, WCHAR **subkey,
WCHAR **value)
unsigned int len = *value - *subkey - 1;
WCHAR *ret;
- ret = HeapAlloc(GetProcessHeap(), 0, (len+1)*sizeof(WCHAR));
+ ret = heap_alloc((len + 1)*sizeof(WCHAR));
if (!ret)
return E_OUTOFMEMORY;
@@ -1463,7 +1467,7 @@ static HRESULT WINAPI WshShell3_RegRead(IWshShell3 *iface, BSTR
name, VARIANT *v
if (ret == ERROR_SUCCESS) {
void *data;
- data = HeapAlloc(GetProcessHeap(), 0, datalen);
+ data = heap_alloc(datalen);
if (!data) {
hr = E_OUTOFMEMORY;
goto fail;
@@ -1471,7 +1475,7 @@ static HRESULT WINAPI WshShell3_RegRead(IWshShell3 *iface, BSTR
name, VARIANT *v
ret = RegGetValueW(root, subkey, val, RRF_RT_ANY, &type, data,
&datalen);
if (ret) {
- HeapFree(GetProcessHeap(), 0, data);
+ heap_free(data);
hr = HRESULT_FROM_WIN32(ret);
goto fail;
}
@@ -1561,7 +1565,7 @@ static HRESULT WINAPI WshShell3_RegRead(IWshShell3 *iface, BSTR
name, VARIANT *v
hr = E_FAIL;
};
- HeapFree(GetProcessHeap(), 0, data);
+ heap_free(data);
if (FAILED(hr))
VariantInit(value);
}
@@ -1570,7 +1574,7 @@ static HRESULT WINAPI WshShell3_RegRead(IWshShell3 *iface, BSTR
name, VARIANT *v
fail:
if (val)
- HeapFree(GetProcessHeap(), 0, subkey);
+ heap_free(subkey);
return hr;
}
@@ -1658,7 +1662,7 @@ static HRESULT WINAPI WshShell3_RegWrite(IWshShell3 *iface, BSTR
name, VARIANT *
fail:
VariantClear(&v);
if (val)
- HeapFree(GetProcessHeap(), 0, subkey);
+ heap_free(subkey);
return hr;
}
diff --git a/dll/win32/wshom.ocx/wshom.rc b/dll/win32/wshom.ocx/wshom.rc
index 806e788de5..5de4b9e8e0 100644
--- a/dll/win32/wshom.ocx/wshom.rc
+++ b/dll/win32/wshom.ocx/wshom.rc
@@ -16,7 +16,7 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-#include <windef.h>
+#include "windef.h"
LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
diff --git a/dll/win32/wshom.ocx/wshom_main.c b/dll/win32/wshom.ocx/wshom_main.c
index e199783f1d..a44b44ce8f 100644
--- a/dll/win32/wshom.ocx/wshom_main.c
+++ b/dll/win32/wshom.ocx/wshom_main.c
@@ -18,7 +18,13 @@
#include "wshom_private.h"
-#include <rpcproxy.h>
+#include "initguid.h"
+#include "wshom.h"
+#include "rpcproxy.h"
+
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(wshom);
static HINSTANCE wshom_instance;
@@ -101,7 +107,7 @@ 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/wshom.ocx/wshom_private.h b/dll/win32/wshom.ocx/wshom_private.h
index abe06d3d41..a3fa3b0f88 100644
--- a/dll/win32/wshom.ocx/wshom_private.h
+++ b/dll/win32/wshom.ocx/wshom_private.h
@@ -16,20 +16,18 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-#ifndef _WSHOM_PRIVATE_H_
-#define _WSHOM_PRIVATE_H_
+#pragma once
+
+#include <stdarg.h>
-#define WIN32_NO_STATUS
-#define _INC_WINDOWS
#define COBJMACROS
-#include <windef.h>
-#include <winbase.h>
-#include <wshom.h>
-#include <ocidl.h>
+#include "windef.h"
+#include "winbase.h"
+#include "ole2.h"
+#include "olectl.h"
-#include <wine/debug.h>
-WINE_DEFAULT_DEBUG_CHANNEL(wshom);
+#define ARRAY_SIZE(array) (sizeof(array) / sizeof((array)[0]))
/* typelibs */
typedef enum tid_t {
@@ -53,5 +51,3 @@ struct provideclassinfo {
extern void init_classinfo(const GUID *guid, IUnknown *outer, struct provideclassinfo
*classinfo) DECLSPEC_HIDDEN;
HRESULT WINAPI WshShellFactory_CreateInstance(IClassFactory*,IUnknown*,REFIID,void**)
DECLSPEC_HIDDEN;
-
-#endif /* _WSHOM_PRIVATE_H_ */
diff --git a/media/doc/README.WINE b/media/doc/README.WINE
index 650765d74f..0922d5ff44 100644
--- a/media/doc/README.WINE
+++ b/media/doc/README.WINE
@@ -211,7 +211,7 @@ reactos/dll/win32/wldap32 # Synced to WineStaging-3.3
reactos/dll/win32/wmi # Synced to WineStaging-2.9
reactos/dll/win32/wmiutils # Synced to WineStaging-3.3
reactos/dll/win32/wmvcore # Synced to WineStaging-3.3
-reactos/dll/win32/wshom.ocx # Synced to Wine-3.0
+reactos/dll/win32/wshom.ocx # Synced to WineStaging-3.3
reactos/dll/win32/wtsapi32 # Synced to Wine-3.0
reactos/dll/win32/wuapi # Synced to WineStaging-2.9
reactos/dll/win32/xinput1_1 # Synced to WineStaging-2.9