mirror of
https://github.com/reactos/reactos.git
synced 2025-05-06 18:31:26 +00:00
[WSHOM.OCX] Sync with Wine Staging 3.3. CORE-14434
This commit is contained in:
parent
94435b53d7
commit
6a5af78c49
7 changed files with 65 additions and 44 deletions
|
@ -12,7 +12,7 @@ add_typelib(wshom.idl)
|
||||||
list(APPEND SOURCE
|
list(APPEND SOURCE
|
||||||
shell.c
|
shell.c
|
||||||
wshom_main.c
|
wshom_main.c
|
||||||
wshom_private.h)
|
precomp.h)
|
||||||
|
|
||||||
add_library(wshom SHARED
|
add_library(wshom SHARED
|
||||||
${SOURCE}
|
${SOURCE}
|
||||||
|
@ -30,5 +30,5 @@ set_module_type(wshom win32ocx)
|
||||||
target_link_libraries(wshom uuid wine)
|
target_link_libraries(wshom uuid wine)
|
||||||
add_importlibs(wshom oleaut32 ole32 shell32 advapi32 advapi32_vista user32 msvcrt kernel32 ntdll)
|
add_importlibs(wshom oleaut32 ole32 shell32 advapi32 advapi32_vista user32 msvcrt kernel32 ntdll)
|
||||||
add_dependencies(wshom stdole2 wshom_idlheader)
|
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)
|
add_cd_file(TARGET wshom DESTINATION reactos/system32 FOR all)
|
||||||
|
|
15
dll/win32/wshom.ocx/precomp.h
Normal file
15
dll/win32/wshom.ocx/precomp.h
Normal file
|
@ -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_ */
|
|
@ -17,13 +17,17 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "wshom_private.h"
|
#include "wshom_private.h"
|
||||||
|
#include "wshom.h"
|
||||||
|
|
||||||
#include <shellapi.h>
|
#include "shellapi.h"
|
||||||
#include <shlobj.h>
|
#include "shlobj.h"
|
||||||
#include <dispex.h>
|
#include "dispex.h"
|
||||||
#include <winreg.h>
|
|
||||||
|
|
||||||
#include <wine/unicode.h>
|
#include "wine/debug.h"
|
||||||
|
#include "wine/heap.h"
|
||||||
|
#include "wine/unicode.h"
|
||||||
|
|
||||||
|
WINE_DEFAULT_DEBUG_CHANNEL(wshom);
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
|
@ -127,7 +131,7 @@ static ULONG WINAPI WshExec_Release(IWshExec *iface)
|
||||||
if (!ref) {
|
if (!ref) {
|
||||||
CloseHandle(This->info.hThread);
|
CloseHandle(This->info.hThread);
|
||||||
CloseHandle(This->info.hProcess);
|
CloseHandle(This->info.hProcess);
|
||||||
HeapFree(GetProcessHeap(), 0, This);
|
heap_free(This);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ref;
|
return ref;
|
||||||
|
@ -322,7 +326,7 @@ static HRESULT WshExec_create(BSTR command, IWshExec **ret)
|
||||||
|
|
||||||
*ret = NULL;
|
*ret = NULL;
|
||||||
|
|
||||||
This = HeapAlloc(GetProcessHeap(), 0, sizeof(*This));
|
This = heap_alloc(sizeof(*This));
|
||||||
if (!This)
|
if (!This)
|
||||||
return E_OUTOFMEMORY;
|
return E_OUTOFMEMORY;
|
||||||
|
|
||||||
|
@ -330,7 +334,7 @@ static HRESULT WshExec_create(BSTR command, IWshExec **ret)
|
||||||
This->ref = 1;
|
This->ref = 1;
|
||||||
|
|
||||||
if (!CreateProcessW(NULL, command, NULL, NULL, FALSE, 0, NULL, NULL, &si, &This->info)) {
|
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());
|
return HRESULT_FROM_WIN32(GetLastError());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -380,7 +384,7 @@ static ULONG WINAPI WshEnvironment_Release(IWshEnvironment *iface)
|
||||||
TRACE("(%p) ref = %d\n", This, ref);
|
TRACE("(%p) ref = %d\n", This, ref);
|
||||||
|
|
||||||
if (!ref)
|
if (!ref)
|
||||||
HeapFree(GetProcessHeap(), 0, This);
|
heap_free(This);
|
||||||
|
|
||||||
return ref;
|
return ref;
|
||||||
}
|
}
|
||||||
|
@ -516,7 +520,7 @@ static HRESULT WshEnvironment_Create(IWshEnvironment **env)
|
||||||
{
|
{
|
||||||
WshEnvironment *This;
|
WshEnvironment *This;
|
||||||
|
|
||||||
This = HeapAlloc(GetProcessHeap(), 0, sizeof(*This));
|
This = heap_alloc(sizeof(*This));
|
||||||
if (!This) return E_OUTOFMEMORY;
|
if (!This) return E_OUTOFMEMORY;
|
||||||
|
|
||||||
This->IWshEnvironment_iface.lpVtbl = &WshEnvironmentVtbl;
|
This->IWshEnvironment_iface.lpVtbl = &WshEnvironmentVtbl;
|
||||||
|
@ -569,7 +573,7 @@ static ULONG WINAPI WshCollection_Release(IWshCollection *iface)
|
||||||
TRACE("(%p) ref = %d\n", This, ref);
|
TRACE("(%p) ref = %d\n", This, ref);
|
||||||
|
|
||||||
if (!ref)
|
if (!ref)
|
||||||
HeapFree(GetProcessHeap(), 0, This);
|
heap_free(This);
|
||||||
|
|
||||||
return ref;
|
return ref;
|
||||||
}
|
}
|
||||||
|
@ -718,7 +722,7 @@ static HRESULT WshCollection_Create(IWshCollection **collection)
|
||||||
{
|
{
|
||||||
WshCollection *This;
|
WshCollection *This;
|
||||||
|
|
||||||
This = HeapAlloc(GetProcessHeap(), 0, sizeof(*This));
|
This = heap_alloc(sizeof(*This));
|
||||||
if (!This) return E_OUTOFMEMORY;
|
if (!This) return E_OUTOFMEMORY;
|
||||||
|
|
||||||
This->IWshCollection_iface.lpVtbl = &WshCollectionVtbl;
|
This->IWshCollection_iface.lpVtbl = &WshCollectionVtbl;
|
||||||
|
@ -775,7 +779,7 @@ static ULONG WINAPI WshShortcut_Release(IWshShortcut *iface)
|
||||||
{
|
{
|
||||||
SysFreeString(This->path_link);
|
SysFreeString(This->path_link);
|
||||||
IShellLinkW_Release(This->link);
|
IShellLinkW_Release(This->link);
|
||||||
HeapFree(GetProcessHeap(), 0, This);
|
heap_free(This);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ref;
|
return ref;
|
||||||
|
@ -856,7 +860,7 @@ static HRESULT WINAPI WshShortcut_get_Arguments(IWshShortcut *iface, BSTR *Argum
|
||||||
|
|
||||||
*Arguments = NULL;
|
*Arguments = NULL;
|
||||||
|
|
||||||
hr = IShellLinkW_GetArguments(This->link, buffW, sizeof(buffW)/sizeof(WCHAR));
|
hr = IShellLinkW_GetArguments(This->link, buffW, ARRAY_SIZE(buffW));
|
||||||
if (FAILED(hr))
|
if (FAILED(hr))
|
||||||
return hr;
|
return hr;
|
||||||
|
|
||||||
|
@ -914,7 +918,7 @@ static HRESULT WINAPI WshShortcut_get_IconLocation(IWshShortcut *iface, BSTR *Ic
|
||||||
if (!IconPath)
|
if (!IconPath)
|
||||||
return E_POINTER;
|
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;
|
if (FAILED(hr)) return hr;
|
||||||
|
|
||||||
sprintfW(pathW, fmtW, buffW, icon);
|
sprintfW(pathW, fmtW, buffW, icon);
|
||||||
|
@ -1003,7 +1007,7 @@ static HRESULT WINAPI WshShortcut_get_WorkingDirectory(IWshShortcut *iface, BSTR
|
||||||
return E_POINTER;
|
return E_POINTER;
|
||||||
|
|
||||||
*WorkingDirectory = NULL;
|
*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;
|
if (FAILED(hr)) return hr;
|
||||||
|
|
||||||
*WorkingDirectory = SysAllocString(buffW);
|
*WorkingDirectory = SysAllocString(buffW);
|
||||||
|
@ -1074,7 +1078,7 @@ static HRESULT WshShortcut_Create(const WCHAR *path, IDispatch **shortcut)
|
||||||
|
|
||||||
*shortcut = NULL;
|
*shortcut = NULL;
|
||||||
|
|
||||||
This = HeapAlloc(GetProcessHeap(), 0, sizeof(*This));
|
This = heap_alloc(sizeof(*This));
|
||||||
if (!This) return E_OUTOFMEMORY;
|
if (!This) return E_OUTOFMEMORY;
|
||||||
|
|
||||||
This->IWshShortcut_iface.lpVtbl = &WshShortcutVtbl;
|
This->IWshShortcut_iface.lpVtbl = &WshShortcutVtbl;
|
||||||
|
@ -1084,7 +1088,7 @@ static HRESULT WshShortcut_Create(const WCHAR *path, IDispatch **shortcut)
|
||||||
&IID_IShellLinkW, (void**)&This->link);
|
&IID_IShellLinkW, (void**)&This->link);
|
||||||
if (FAILED(hr))
|
if (FAILED(hr))
|
||||||
{
|
{
|
||||||
HeapFree(GetProcessHeap(), 0, This);
|
heap_free(This);
|
||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1092,7 +1096,7 @@ static HRESULT WshShortcut_Create(const WCHAR *path, IDispatch **shortcut)
|
||||||
if (!This->path_link)
|
if (!This->path_link)
|
||||||
{
|
{
|
||||||
IShellLinkW_Release(This->link);
|
IShellLinkW_Release(This->link);
|
||||||
HeapFree(GetProcessHeap(), 0, This);
|
heap_free(This);
|
||||||
return E_OUTOFMEMORY;
|
return E_OUTOFMEMORY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1392,7 +1396,7 @@ static HKEY get_root_key(const WCHAR *path)
|
||||||
};
|
};
|
||||||
int i;
|
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)))
|
if (!strncmpW(path, rootkeys[i].full, strlenW(rootkeys[i].full)))
|
||||||
return rootkeys[i].hkey;
|
return rootkeys[i].hkey;
|
||||||
if (rootkeys[i].abbrev[0] && !strncmpW(path, rootkeys[i].abbrev, strlenW(rootkeys[i].abbrev)))
|
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;
|
unsigned int len = *value - *subkey - 1;
|
||||||
WCHAR *ret;
|
WCHAR *ret;
|
||||||
|
|
||||||
ret = HeapAlloc(GetProcessHeap(), 0, (len+1)*sizeof(WCHAR));
|
ret = heap_alloc((len + 1)*sizeof(WCHAR));
|
||||||
if (!ret)
|
if (!ret)
|
||||||
return E_OUTOFMEMORY;
|
return E_OUTOFMEMORY;
|
||||||
|
|
||||||
|
@ -1463,7 +1467,7 @@ static HRESULT WINAPI WshShell3_RegRead(IWshShell3 *iface, BSTR name, VARIANT *v
|
||||||
if (ret == ERROR_SUCCESS) {
|
if (ret == ERROR_SUCCESS) {
|
||||||
void *data;
|
void *data;
|
||||||
|
|
||||||
data = HeapAlloc(GetProcessHeap(), 0, datalen);
|
data = heap_alloc(datalen);
|
||||||
if (!data) {
|
if (!data) {
|
||||||
hr = E_OUTOFMEMORY;
|
hr = E_OUTOFMEMORY;
|
||||||
goto fail;
|
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);
|
ret = RegGetValueW(root, subkey, val, RRF_RT_ANY, &type, data, &datalen);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
HeapFree(GetProcessHeap(), 0, data);
|
heap_free(data);
|
||||||
hr = HRESULT_FROM_WIN32(ret);
|
hr = HRESULT_FROM_WIN32(ret);
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
@ -1561,7 +1565,7 @@ static HRESULT WINAPI WshShell3_RegRead(IWshShell3 *iface, BSTR name, VARIANT *v
|
||||||
hr = E_FAIL;
|
hr = E_FAIL;
|
||||||
};
|
};
|
||||||
|
|
||||||
HeapFree(GetProcessHeap(), 0, data);
|
heap_free(data);
|
||||||
if (FAILED(hr))
|
if (FAILED(hr))
|
||||||
VariantInit(value);
|
VariantInit(value);
|
||||||
}
|
}
|
||||||
|
@ -1570,7 +1574,7 @@ static HRESULT WINAPI WshShell3_RegRead(IWshShell3 *iface, BSTR name, VARIANT *v
|
||||||
|
|
||||||
fail:
|
fail:
|
||||||
if (val)
|
if (val)
|
||||||
HeapFree(GetProcessHeap(), 0, subkey);
|
heap_free(subkey);
|
||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1658,7 +1662,7 @@ static HRESULT WINAPI WshShell3_RegWrite(IWshShell3 *iface, BSTR name, VARIANT *
|
||||||
fail:
|
fail:
|
||||||
VariantClear(&v);
|
VariantClear(&v);
|
||||||
if (val)
|
if (val)
|
||||||
HeapFree(GetProcessHeap(), 0, subkey);
|
heap_free(subkey);
|
||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <windef.h>
|
#include "windef.h"
|
||||||
|
|
||||||
LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
|
LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,13 @@
|
||||||
|
|
||||||
#include "wshom_private.h"
|
#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;
|
static HINSTANCE wshom_instance;
|
||||||
|
|
||||||
|
@ -101,7 +107,7 @@ void release_typelib(void)
|
||||||
if(!typelib)
|
if(!typelib)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
for(i=0; i < sizeof(typeinfos)/sizeof(*typeinfos); i++)
|
for(i = 0; i < ARRAY_SIZE(typeinfos); i++)
|
||||||
if(typeinfos[i])
|
if(typeinfos[i])
|
||||||
ITypeInfo_Release(typeinfos[i]);
|
ITypeInfo_Release(typeinfos[i]);
|
||||||
|
|
||||||
|
|
|
@ -16,20 +16,18 @@
|
||||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _WSHOM_PRIVATE_H_
|
#pragma once
|
||||||
#define _WSHOM_PRIVATE_H_
|
|
||||||
|
#include <stdarg.h>
|
||||||
|
|
||||||
#define WIN32_NO_STATUS
|
|
||||||
#define _INC_WINDOWS
|
|
||||||
#define COBJMACROS
|
#define COBJMACROS
|
||||||
|
|
||||||
#include <windef.h>
|
#include "windef.h"
|
||||||
#include <winbase.h>
|
#include "winbase.h"
|
||||||
#include <wshom.h>
|
#include "ole2.h"
|
||||||
#include <ocidl.h>
|
#include "olectl.h"
|
||||||
|
|
||||||
#include <wine/debug.h>
|
#define ARRAY_SIZE(array) (sizeof(array) / sizeof((array)[0]))
|
||||||
WINE_DEFAULT_DEBUG_CHANNEL(wshom);
|
|
||||||
|
|
||||||
/* typelibs */
|
/* typelibs */
|
||||||
typedef enum tid_t {
|
typedef enum tid_t {
|
||||||
|
@ -53,5 +51,3 @@ struct provideclassinfo {
|
||||||
extern void init_classinfo(const GUID *guid, IUnknown *outer, struct provideclassinfo *classinfo) DECLSPEC_HIDDEN;
|
extern void init_classinfo(const GUID *guid, IUnknown *outer, struct provideclassinfo *classinfo) DECLSPEC_HIDDEN;
|
||||||
|
|
||||||
HRESULT WINAPI WshShellFactory_CreateInstance(IClassFactory*,IUnknown*,REFIID,void**) DECLSPEC_HIDDEN;
|
HRESULT WINAPI WshShellFactory_CreateInstance(IClassFactory*,IUnknown*,REFIID,void**) DECLSPEC_HIDDEN;
|
||||||
|
|
||||||
#endif /* _WSHOM_PRIVATE_H_ */
|
|
||||||
|
|
|
@ -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/wmi # Synced to WineStaging-2.9
|
||||||
reactos/dll/win32/wmiutils # Synced to WineStaging-3.3
|
reactos/dll/win32/wmiutils # Synced to WineStaging-3.3
|
||||||
reactos/dll/win32/wmvcore # 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/wtsapi32 # Synced to Wine-3.0
|
||||||
reactos/dll/win32/wuapi # Synced to WineStaging-2.9
|
reactos/dll/win32/wuapi # Synced to WineStaging-2.9
|
||||||
reactos/dll/win32/xinput1_1 # Synced to WineStaging-2.9
|
reactos/dll/win32/xinput1_1 # Synced to WineStaging-2.9
|
||||||
|
|
Loading…
Reference in a new issue