Commit b98c2a75 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

wshom: Fix WshNetwork interface definition.

parent 61dc7de4
...@@ -25,14 +25,13 @@ WINE_DEFAULT_DEBUG_CHANNEL(wshom); ...@@ -25,14 +25,13 @@ WINE_DEFAULT_DEBUG_CHANNEL(wshom);
static HRESULT WINAPI WshNetwork2_QueryInterface(IWshNetwork2 *iface, REFIID riid, void **ppv) static HRESULT WINAPI WshNetwork2_QueryInterface(IWshNetwork2 *iface, REFIID riid, void **ppv)
{ {
if(IsEqualGUID(riid, &IID_IUnknown)) { TRACE("%p, %s, %p.\n", iface, debugstr_guid(riid), ppv);
TRACE("(IID_IUnknown %p)\n", ppv);
*ppv = iface; if(IsEqualGUID(riid, &IID_IUnknown) ||
}else if(IsEqualGUID(riid, &IID_IDispatch)) { IsEqualGUID(riid, &IID_IDispatch) ||
TRACE("(IID_IDispatch %p)\n", ppv); IsEqualGUID(riid, &IID_IWshNetwork) ||
*ppv = iface; IsEqualGUID(riid, &IID_IWshNetwork2))
}else if(IsEqualGUID(riid, &IID_IWshNetwork2)) { {
TRACE("(IID_IWshNetwork2 %p)\n", ppv);
*ppv = iface; *ppv = iface;
}else { }else {
FIXME("Unknown iface %s\n", debugstr_guid(riid)); FIXME("Unknown iface %s\n", debugstr_guid(riid));
...@@ -85,9 +84,106 @@ static HRESULT WINAPI WshNetwork2_Invoke(IWshNetwork2 *iface, DISPID dispIdMembe ...@@ -85,9 +84,106 @@ static HRESULT WINAPI WshNetwork2_Invoke(IWshNetwork2 *iface, DISPID dispIdMembe
return E_NOTIMPL; 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 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)\n", UserDomain); 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; return E_NOTIMPL;
} }
...@@ -100,6 +196,19 @@ static const IWshNetwork2Vtbl WshNetwork2Vtbl = { ...@@ -100,6 +196,19 @@ static const IWshNetwork2Vtbl WshNetwork2Vtbl = {
WshNetwork2_GetIDsOfNames, WshNetwork2_GetIDsOfNames,
WshNetwork2_Invoke, WshNetwork2_Invoke,
WshNetwork2_get_UserDomain, 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 }; static IWshNetwork2 WshNetwork2 = { &WshNetwork2Vtbl };
......
...@@ -28,6 +28,21 @@ ...@@ -28,6 +28,21 @@
DEFINE_GUID(GUID_NULL,0,0,0,0,0,0,0,0,0,0,0); 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__) #define test_provideclassinfo(a, b) _test_provideclassinfo((IDispatch*)a, b, __LINE__)
static void _test_provideclassinfo(IDispatch *disp, const GUID *guid, int line) static void _test_provideclassinfo(IDispatch *disp, const GUID *guid, int line)
{ {
...@@ -673,20 +688,20 @@ static void test_popup(void) ...@@ -673,20 +688,20 @@ static void test_popup(void)
SysFreeString(text); SysFreeString(text);
IWshShell_Release(sh); IWshShell_Release(sh);
} }
static void test_wshnetwork(void) static void test_wshnetwork(void)
{ {
IDispatch *disp; IDispatch *disp;
IUnknown *network;
HRESULT hr; HRESULT hr;
hr = CoCreateInstance(&CLSID_WshNetwork, NULL, CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER, hr = CoCreateInstance(&CLSID_WshNetwork, NULL, CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER,
&IID_IDispatch, (void**)&disp); &IID_IDispatch, (void**)&disp);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDispatch_QueryInterface(disp, &IID_IWshNetwork2, (void**)&network); check_interface(disp, &IID_IWshNetwork, TRUE);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); check_interface(disp, &IID_IWshNetwork2, TRUE);
IUnknown_Release(network); IDispatch_Release(disp);
} }
START_TEST(wshom) START_TEST(wshom)
......
...@@ -610,14 +610,81 @@ library IWshRuntimeLibrary ...@@ -610,14 +610,81 @@ library IWshRuntimeLibrary
}; };
[ [
uuid(24be5a31-edfe-11d2-b933-00104b365c9f), uuid(f935dc25-1cf0-11d0-adb9-00c04fd58a0b),
odl, odl,
dual, dual,
oleautomation oleautomation,
hidden
] ]
interface IWshNetwork2 : IDispatch { interface IWshNetwork : IDispatch {
[id(0x60020000), propget] [id(0x60020000), propget]
HRESULT UserDomain([out, retval] BSTR *out_UserDomain); 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 : IWshNetwork {
[id(0x7d4)]
HRESULT AddWindowsPrinterConnection(
[in] BSTR PrinterName,
[in, optional, defaultvalue("")] BSTR DriverName,
[in, optional, defaultvalue("LPT1")] BSTR Port);
} }
[ [
......
...@@ -610,14 +610,81 @@ library IWshRuntimeLibrary ...@@ -610,14 +610,81 @@ library IWshRuntimeLibrary
}; };
[ [
uuid(24be5a31-edfe-11d2-b933-00104b365c9f), uuid(f935dc25-1cf0-11d0-adb9-00c04fd58a0b),
odl, odl,
dual, dual,
oleautomation oleautomation,
hidden
] ]
interface IWshNetwork2 : IDispatch { interface IWshNetwork : IDispatch {
[id(0x60020000), propget] [id(0x60020000), propget]
HRESULT UserDomain([out, retval] BSTR *out_UserDomain); 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 : IWshNetwork {
[id(0x7d4)]
HRESULT AddWindowsPrinterConnection(
[in] BSTR PrinterName,
[in, optional, defaultvalue("")] BSTR DriverName,
[in, optional, defaultvalue("LPT1")] BSTR Port);
} }
[ [
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment