1
0
mirror of https://github.com/wine-mirror/wine synced 2024-07-01 07:14:31 +00:00

wshom: Fix WshNetwork interface definition.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
This commit is contained in:
Nikolay Sivov 2022-11-30 08:42:10 +03:00 committed by Alexandre Julliard
parent 61dc7de497
commit b98c2a757e
4 changed files with 278 additions and 20 deletions

View File

@ -25,14 +25,13 @@ WINE_DEFAULT_DEBUG_CHANNEL(wshom);
static HRESULT WINAPI WshNetwork2_QueryInterface(IWshNetwork2 *iface, REFIID riid, void **ppv)
{
if(IsEqualGUID(riid, &IID_IUnknown)) {
TRACE("(IID_IUnknown %p)\n", ppv);
*ppv = iface;
}else if(IsEqualGUID(riid, &IID_IDispatch)) {
TRACE("(IID_IDispatch %p)\n", ppv);
*ppv = iface;
}else if(IsEqualGUID(riid, &IID_IWshNetwork2)) {
TRACE("(IID_IWshNetwork2 %p)\n", ppv);
TRACE("%p, %s, %p.\n", iface, debugstr_guid(riid), ppv);
if(IsEqualGUID(riid, &IID_IUnknown) ||
IsEqualGUID(riid, &IID_IDispatch) ||
IsEqualGUID(riid, &IID_IWshNetwork) ||
IsEqualGUID(riid, &IID_IWshNetwork2))
{
*ppv = iface;
}else {
FIXME("Unknown iface %s\n", debugstr_guid(riid));
@ -85,9 +84,106 @@ static HRESULT WINAPI WshNetwork2_Invoke(IWshNetwork2 *iface, DISPID dispIdMembe
return E_NOTIMPL;
}
static HRESULT WINAPI WshNetwork2_get_UserDomain(IWshNetwork2 *iface, BSTR *UserDomain)
static HRESULT WINAPI WshNetwork2_get_UserDomain(IWshNetwork2 *iface, BSTR *user_domain)
{
FIXME("(%p)\n", UserDomain);
FIXME("%p stub\n", user_domain);
return E_NOTIMPL;
}
static HRESULT WINAPI WshNetwork2_get_UserName(IWshNetwork2 *iface, BSTR *user_name)
{
FIXME("%p stub\n", user_name);
return E_NOTIMPL;
}
static HRESULT WINAPI WshNetwork2_get_UserProfile(IWshNetwork2 *iface, BSTR *user_profile)
{
FIXME("%p stub\n", user_profile);
return E_NOTIMPL;
}
static HRESULT WINAPI WshNetwork2_get_ComputerName(IWshNetwork2 *iface, BSTR *name)
{
FIXME("%p stub\n", name);
return E_NOTIMPL;
}
static HRESULT WINAPI WshNetwork2_get_Organization(IWshNetwork2 *iface, BSTR *name)
{
FIXME("%p stub\n", name);
return E_NOTIMPL;
}
static HRESULT WINAPI WshNetwork2_get_Site(IWshNetwork2 *iface, BSTR *name)
{
FIXME("%p stub\n", name);
return E_NOTIMPL;
}
static HRESULT WINAPI WshNetwork2_MapNetworkDrive(IWshNetwork2 *iface, BSTR local_name, BSTR remote_name,
VARIANT *update_profile, VARIANT *user_name, VARIANT *password)
{
FIXME("%s, %s, %s, %p, %p stub\n", debugstr_w(local_name), debugstr_w(remote_name), debugstr_variant(update_profile),
user_name, password);
return E_NOTIMPL;
}
static HRESULT WINAPI WshNetwork2_RemoveNetworkDrive(IWshNetwork2 *iface, BSTR name, VARIANT *force, VARIANT *update_profile)
{
FIXME("%s, %s, %s stub\n", debugstr_w(name), debugstr_variant(force), debugstr_variant(update_profile));
return E_NOTIMPL;
}
static HRESULT WINAPI WshNetwork2_EnumNetworkDrives(IWshNetwork2 *iface, IWshCollection **ret)
{
FIXME("%p stub\n", ret);
return E_NOTIMPL;
}
static HRESULT WINAPI WshNetwork2_AddPrinterConnection(IWshNetwork2 *iface, BSTR local_name, BSTR remote_name,
VARIANT *update_profile, VARIANT *user_name, VARIANT *password)
{
FIXME("%s, %s, %s, %p, %p stub\n", debugstr_w(local_name), debugstr_w(remote_name), debugstr_variant(update_profile),
user_name, password);
return E_NOTIMPL;
}
static HRESULT WINAPI WshNetwork2_RemovePrinterConnection(IWshNetwork2 *iface, BSTR name, VARIANT *force, VARIANT *update_profile)
{
FIXME("%s, %s, %s stub\n", debugstr_w(name), debugstr_variant(force), debugstr_variant(update_profile));
return E_NOTIMPL;
}
static HRESULT WINAPI WshNetwork2_EnumPrinterConnections(IWshNetwork2 *iface, IWshCollection **ret)
{
FIXME("%p stub\n", ret);
return E_NOTIMPL;
}
static HRESULT WINAPI WshNetwork2_SetDefaultPrinter(IWshNetwork2 *iface, BSTR name)
{
FIXME("%s stub\n", debugstr_w(name));
return E_NOTIMPL;
}
static HRESULT WINAPI WshNetwork2_AddWindowsPrinterConnection(IWshNetwork2 *iface, BSTR printer_name,
BSTR driver_name, BSTR port)
{
FIXME("%s, %s, %s stub\n", debugstr_w(printer_name), debugstr_w(driver_name), debugstr_w(port));
return E_NOTIMPL;
}
@ -100,6 +196,19 @@ static const IWshNetwork2Vtbl WshNetwork2Vtbl = {
WshNetwork2_GetIDsOfNames,
WshNetwork2_Invoke,
WshNetwork2_get_UserDomain,
WshNetwork2_get_UserName,
WshNetwork2_get_UserProfile,
WshNetwork2_get_ComputerName,
WshNetwork2_get_Organization,
WshNetwork2_get_Site,
WshNetwork2_MapNetworkDrive,
WshNetwork2_RemoveNetworkDrive,
WshNetwork2_EnumNetworkDrives,
WshNetwork2_AddPrinterConnection,
WshNetwork2_RemovePrinterConnection,
WshNetwork2_EnumPrinterConnections,
WshNetwork2_SetDefaultPrinter,
WshNetwork2_AddWindowsPrinterConnection,
};
static IWshNetwork2 WshNetwork2 = { &WshNetwork2Vtbl };

View File

@ -28,6 +28,21 @@
DEFINE_GUID(GUID_NULL,0,0,0,0,0,0,0,0,0,0,0);
#define check_interface(a, b, c) check_interface_(__LINE__, a, b, c)
static void check_interface_(unsigned int line, void *iface_ptr, REFIID iid, BOOL supported)
{
IUnknown *iface = iface_ptr;
HRESULT hr, expected_hr;
IUnknown *unk;
expected_hr = supported ? S_OK : E_NOINTERFACE;
hr = IUnknown_QueryInterface(iface, iid, (void **)&unk);
ok_(__FILE__, line)(hr == expected_hr, "Got hr %#lx, expected %#lx.\n", hr, expected_hr);
if (SUCCEEDED(hr))
IUnknown_Release(unk);
}
#define test_provideclassinfo(a, b) _test_provideclassinfo((IDispatch*)a, b, __LINE__)
static void _test_provideclassinfo(IDispatch *disp, const GUID *guid, int line)
{
@ -673,20 +688,20 @@ static void test_popup(void)
SysFreeString(text);
IWshShell_Release(sh);
}
static void test_wshnetwork(void)
{
IDispatch *disp;
IUnknown *network;
HRESULT hr;
hr = CoCreateInstance(&CLSID_WshNetwork, NULL, CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER,
&IID_IDispatch, (void**)&disp);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDispatch_QueryInterface(disp, &IID_IWshNetwork2, (void**)&network);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
check_interface(disp, &IID_IWshNetwork, TRUE);
check_interface(disp, &IID_IWshNetwork2, TRUE);
IUnknown_Release(network);
IDispatch_Release(disp);
}
START_TEST(wshom)

View File

@ -609,15 +609,82 @@ library IWshRuntimeLibrary
HRESULT CurrentDirectory([in] BSTR out_Directory);
};
[
uuid(f935dc25-1cf0-11d0-adb9-00c04fd58a0b),
odl,
dual,
oleautomation,
hidden
]
interface IWshNetwork : IDispatch {
[id(0x60020000), propget]
HRESULT UserDomain([out, retval] BSTR *out_UserDomain);
[id(0x60020001), propget]
HRESULT UserName([out, retval] BSTR *out_UserName);
[id(0x60020002), propget]
HRESULT UserProfile([out, retval] BSTR *out_UserProfile);
[id(0x60020003), propget]
HRESULT ComputerName([out, retval] BSTR *out_ComputerName);
[id(0x60020004), propget, hidden]
HRESULT Organization([out, retval] BSTR *out_Organization);
[id(0x60020005), propget, hidden]
HRESULT Site([out, retval] BSTR *out_Site);
[id(0x3e8)]
HRESULT MapNetworkDrive(
[in] BSTR LocalName,
[in] BSTR RemoteName,
[in, optional] VARIANT *UpdateProfile,
[in, optional] VARIANT *UserName,
[in, optional] VARIANT *Password);
[id(0x3e9)]
HRESULT RemoveNetworkDrive(
[in] BSTR Name,
[in, optional] VARIANT *Force,
[in, optional] VARIANT *UpdateProfile);
[id(0x3ea)]
HRESULT EnumNetworkDrives([out, retval] IWshCollection **out_Enum);
[id(0x7d0)]
HRESULT AddPrinterConnection(
[in] BSTR LocalName,
[in] BSTR RemoteName,
[in, optional] VARIANT *UpdateProfile,
[in, optional] VARIANT *UserName,
[in, optional] VARIANT *Password);
[id(0x7d1)]
HRESULT RemovePrinterConnection(
[in] BSTR Name,
[in, optional] VARIANT *Force,
[in, optional] VARIANT *UpdateProfile);
[id(0x7d2)]
HRESULT EnumPrinterConnections([out, retval] IWshCollection **out_Enum);
[id(0x7d3)]
HRESULT SetDefaultPrinter([in] BSTR Name);
}
[
uuid(24be5a31-edfe-11d2-b933-00104b365c9f),
odl,
dual,
oleautomation
]
interface IWshNetwork2 : IDispatch {
[id(0x60020000), propget]
HRESULT UserDomain([out, retval] BSTR *out_UserDomain);
interface IWshNetwork2 : IWshNetwork {
[id(0x7d4)]
HRESULT AddWindowsPrinterConnection(
[in] BSTR PrinterName,
[in, optional, defaultvalue("")] BSTR DriverName,
[in, optional, defaultvalue("LPT1")] BSTR Port);
}
[

View File

@ -609,15 +609,82 @@ library IWshRuntimeLibrary
HRESULT CurrentDirectory([in] BSTR out_Directory);
};
[
uuid(f935dc25-1cf0-11d0-adb9-00c04fd58a0b),
odl,
dual,
oleautomation,
hidden
]
interface IWshNetwork : IDispatch {
[id(0x60020000), propget]
HRESULT UserDomain([out, retval] BSTR *out_UserDomain);
[id(0x60020001), propget]
HRESULT UserName([out, retval] BSTR *out_UserName);
[id(0x60020002), propget]
HRESULT UserProfile([out, retval] BSTR *out_UserProfile);
[id(0x60020003), propget]
HRESULT ComputerName([out, retval] BSTR *out_ComputerName);
[id(0x60020004), propget, hidden]
HRESULT Organization([out, retval] BSTR *out_Organization);
[id(0x60020005), propget, hidden]
HRESULT Site([out, retval] BSTR *out_Site);
[id(0x3e8)]
HRESULT MapNetworkDrive(
[in] BSTR LocalName,
[in] BSTR RemoteName,
[in, optional] VARIANT *UpdateProfile,
[in, optional] VARIANT *UserName,
[in, optional] VARIANT *Password);
[id(0x3e9)]
HRESULT RemoveNetworkDrive(
[in] BSTR Name,
[in, optional] VARIANT *Force,
[in, optional] VARIANT *UpdateProfile);
[id(0x3ea)]
HRESULT EnumNetworkDrives([out, retval] IWshCollection **out_Enum);
[id(0x7d0)]
HRESULT AddPrinterConnection(
[in] BSTR LocalName,
[in] BSTR RemoteName,
[in, optional] VARIANT *UpdateProfile,
[in, optional] VARIANT *UserName,
[in, optional] VARIANT *Password);
[id(0x7d1)]
HRESULT RemovePrinterConnection(
[in] BSTR Name,
[in, optional] VARIANT *Force,
[in, optional] VARIANT *UpdateProfile);
[id(0x7d2)]
HRESULT EnumPrinterConnections([out, retval] IWshCollection **out_Enum);
[id(0x7d3)]
HRESULT SetDefaultPrinter([in] BSTR Name);
}
[
uuid(24be5a31-edfe-11d2-b933-00104b365c9f),
odl,
dual,
oleautomation
]
interface IWshNetwork2 : IDispatch {
[id(0x60020000), propget]
HRESULT UserDomain([out, retval] BSTR *out_UserDomain);
interface IWshNetwork2 : IWshNetwork {
[id(0x7d4)]
HRESULT AddWindowsPrinterConnection(
[in] BSTR PrinterName,
[in, optional, defaultvalue("")] BSTR DriverName,
[in, optional, defaultvalue("LPT1")] BSTR Port);
}
[