Beispiel #1
0
static HRESULT xmlnodelist_invoke(IUnknown *iface, DISPID id, LCID lcid, WORD flags, DISPPARAMS *params,
        VARIANT *res, EXCEPINFO *ei)
{
    xmlnodelist *This = impl_from_IXMLDOMNodeList( (IXMLDOMNodeList*)iface );

    TRACE("(%p)->(%x %x %x %p %p %p)\n", This, id, lcid, flags, params, res, ei);

    V_VT(res) = VT_DISPATCH;
    V_DISPATCH(res) = NULL;

    if (id < DISPID_DOM_COLLECTION_BASE || id > DISPID_DOM_COLLECTION_MAX)
        return DISP_E_UNKNOWNNAME;

    switch(flags)
    {
        case INVOKE_PROPERTYGET:
        {
            IXMLDOMNode *disp = NULL;

            IXMLDOMNodeList_get_item(&This->IXMLDOMNodeList_iface, id - DISPID_DOM_COLLECTION_BASE, &disp);
            V_DISPATCH(res) = (IDispatch*)disp;
            break;
        }
        default:
        {
            FIXME("unimplemented flags %x\n", flags);
            break;
        }
    }

    TRACE("ret %p\n", V_DISPATCH(res));

    return S_OK;
}
Beispiel #2
0
void kuhl_m_iis_apphost_genericEnumNodes(int argc, wchar_t * argv[], IXMLDOMDocument *pXMLDom, PCWSTR path, IISXMLType xmltype, LPCWSTR provider, LPCBYTE data, DWORD szData)
{
	IXMLDOMNodeList *pNodes;
	IXMLDOMNode *pNode;
	DOMNodeType type;
	BOOL mustBreak = FALSE;
	long length, i;

	if((IXMLDOMDocument_selectNodes(pXMLDom, (BSTR) path, &pNodes) == S_OK) && pNodes)
	{
		if(IXMLDOMNodeList_get_length(pNodes, &length) == S_OK)
		{
			for(i = 0; (i < length) && !mustBreak; i++)
			{
				if((IXMLDOMNodeList_get_item(pNodes, i, &pNode) == S_OK) && pNode)
				{
					if((IXMLDOMNode_get_nodeType(pNode, &type) == S_OK) && (type == NODE_ELEMENT))
					{
						switch(xmltype)
						{
						case IISXMLType_ApplicationPools:
							kuhl_m_iis_apphost_apppool(argc, argv, pXMLDom, pNode);
							break;
						case IISXMLType_Sites:
							kuhl_m_iis_apphost_site(argc, argv, pXMLDom, pNode);
							break;
						case IISXMLType_Providers:
							mustBreak = kuhl_m_iis_apphost_provider(argc, argv, pXMLDom, pNode, provider, data, szData);
							break;
						}
					}
					IXMLDOMNode_Release(pNode);
				}
			}
		}
	}
}
Beispiel #3
0
static HRESULT nodelist_get_item(IUnknown *iface, LONG index, VARIANT *item)
{
    V_VT(item) = VT_DISPATCH;
    return IXMLDOMNodeList_get_item((IXMLDOMNodeList*)iface, index, (IXMLDOMNode**)&V_DISPATCH(item));
}
Beispiel #4
0
static HRESULT xmlnodelist_invoke(IUnknown *iface, DISPID id, LCID lcid, WORD flags, DISPPARAMS *params,
        VARIANT *res, EXCEPINFO *ei)
{
    xmlnodelist *This = impl_from_IXMLDOMNodeList( (IXMLDOMNodeList*)iface );

    TRACE("(%p)->(%x %x %x %p %p %p)\n", This, id, lcid, flags, params, res, ei);

    if (id >= DISPID_DOM_COLLECTION_BASE && id <= DISPID_DOM_COLLECTION_MAX)
    {
        switch(flags)
        {
            case DISPATCH_PROPERTYGET:
            {
                IXMLDOMNode *disp = NULL;

                V_VT(res) = VT_DISPATCH;
                IXMLDOMNodeList_get_item(&This->IXMLDOMNodeList_iface, id - DISPID_DOM_COLLECTION_BASE, &disp);
                V_DISPATCH(res) = (IDispatch*)disp;
                break;
            }
            default:
            {
                FIXME("unimplemented flags %x\n", flags);
                break;
            }
        }
    }
    else if (id == DISPID_VALUE)
    {
        switch(flags)
        {
            case DISPATCH_METHOD|DISPATCH_PROPERTYGET:
            case DISPATCH_PROPERTYGET:
            case DISPATCH_METHOD:
            {
                IXMLDOMNode *item;
                VARIANT index;
                HRESULT hr;

                if (params->cArgs - params->cNamedArgs != 1) return DISP_E_BADPARAMCOUNT;

                VariantInit(&index);
                hr = VariantChangeType(&index, params->rgvarg, 0, VT_I4);
                if(FAILED(hr))
                {
                    FIXME("failed to convert arg, %s\n", debugstr_variant(params->rgvarg));
                    return hr;
                }

                IXMLDOMNodeList_get_item(&This->IXMLDOMNodeList_iface, V_I4(&index), &item);
                V_VT(res) = VT_DISPATCH;
                V_DISPATCH(res) = (IDispatch*)item;
                break;
            }
            default:
            {
                FIXME("DISPID_VALUE: unimplemented flags %x\n", flags);
                break;
            }
        }
    }
    else
        return DISP_E_UNKNOWNNAME;

    TRACE("ret %p\n", V_DISPATCH(res));

    return S_OK;
}
Beispiel #5
0
void kuhl_m_iis_apphost_site(int argc, wchar_t * argv[], IXMLDOMDocument *pXMLDom, IXMLDOMNode *pNode)
{
	PWSTR gen;
	IXMLDOMNodeList *pAppNodes, *pVdirNodes;
	IXMLDOMNode *pAppNode, *pVdirNode;
	DOMNodeType type;
	long lengthApp, lengthVdir, i, j;

	if(gen = kull_m_xml_getAttribute(pNode, L"name"))
	{
		kprintf(L"\n* Site: \'%s\'\n", gen);
		LocalFree(gen);
		if((IXMLDOMNode_selectNodes(pNode, L"application", &pAppNodes) == S_OK) && pAppNodes)
		{
			if(IXMLDOMNodeList_get_length(pAppNodes, &lengthApp) == S_OK)
			{
				for(i = 0; i < lengthApp; i++)
				{
					if((IXMLDOMNodeList_get_item(pAppNodes, i, &pAppNode) == S_OK) && pAppNode)
					{
						if((IXMLDOMNode_get_nodeType(pAppNode, &type) == S_OK) && (type == NODE_ELEMENT))
						{
							if(gen = kull_m_xml_getAttribute(pAppNode, L"path"))
							{
								kprintf(L"  > Application Path: %s\n", gen);
								LocalFree(gen);
								
								if((IXMLDOMNode_selectNodes(pAppNode, L"virtualDirectory", &pVdirNodes) == S_OK) && pVdirNodes)
								{
									if(IXMLDOMNodeList_get_length(pVdirNodes, &lengthVdir) == S_OK)
									{
										for(j = 0; j < lengthVdir; j++)
										{
											if((IXMLDOMNodeList_get_item(pVdirNodes, j, &pVdirNode) == S_OK) && pVdirNode)
											{
												if((IXMLDOMNode_get_nodeType(pVdirNode, &type) == S_OK) && (type == NODE_ELEMENT))
												{
													if(gen = kull_m_xml_getAttribute(pVdirNode, L"path"))
													{
														kprintf(L"    - VirtualDirectory Path: %s ( ", gen);
														LocalFree(gen);

														if(gen = kull_m_xml_getAttribute(pVdirNode, L"physicalPath"))
														{
															kprintf(L"%s", gen);
															LocalFree(gen);
														}
														kprintf(L" )\n");

														if(gen = kull_m_xml_getAttribute(pVdirNode, L"userName"))
														{
															kprintf(L"      Username: %s\n", gen);
															LocalFree(gen);
															if(gen = kull_m_xml_getAttribute(pVdirNode, L"password"))
															{
																kprintf(L"      Password: %s\n", gen);
																kuhl_m_iis_maybeEncrypted(argc, argv, pXMLDom, gen);
																LocalFree(gen);
															}
														}
													}
												}
												IXMLDOMNode_Release(pVdirNode);
											}
										}
									}
								}
							}
						}
						IXMLDOMNode_Release(pAppNode);
					}
				}
			}
		}
	}
}