Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions
nsXPCDispTestMethods Class Reference

#include <nsXPCDispTestMethods.h>

Inheritance diagram for nsXPCDispTestMethods:
Inheritance graph
[legend]
Collaboration diagram for nsXPCDispTestMethods:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 nsXPCDispTestMethods ()
STDMETHOD() InterfaceSupportsErrorInfo (REFIID riid)
STDMETHOD() NoParameters ()
STDMETHOD() ReturnBSTR (BSTR *result)
STDMETHOD() ReturnI4 (INT *result)
STDMETHOD() ReturnUI1 (BYTE *result)
STDMETHOD() ReturnI2 (SHORT *result)
STDMETHOD() ReturnR4 (FLOAT *result)
STDMETHOD() ReturnR8 (DOUBLE *result)
STDMETHOD() ReturnBool (VARIANT_BOOL *result)
STDMETHOD() ReturnIDispatch (IDispatch **result)
STDMETHOD() ReturnError (SCODE *result)
STDMETHOD() ReturnDate (DATE *result)
STDMETHOD() ReturnIUnknown (IUnknown **result)
STDMETHOD() ReturnI1 (unsigned char *result)
STDMETHOD() ReturnUI2 (USHORT *result)
STDMETHOD() ReturnUI4 (ULONG *result)
STDMETHOD() ReturnInt (INT *result)
STDMETHOD() ReturnUInt (UINT *result)
STDMETHOD() TakesBSTR (BSTR result)
STDMETHOD() TakesI4 (INT result)
STDMETHOD() TakesUI1 (BYTE result)
STDMETHOD() TakesI2 (SHORT result)
STDMETHOD() TakesR4 (FLOAT result)
STDMETHOD() TakesR8 (DOUBLE result)
STDMETHOD() TakesBool (VARIANT_BOOL result)
STDMETHOD() TakesIDispatch (IDispatch *result)
STDMETHOD() TakesError (SCODE result)
STDMETHOD() TakesDate (DATE result)
STDMETHOD() TakesIUnknown (IUnknown *result)
STDMETHOD() TakesI1 (unsigned char result)
STDMETHOD() TakesUI2 (USHORT result)
STDMETHOD() TakesUI4 (ULONG result)
STDMETHOD() TakesInt (INT result)
STDMETHOD() TakesUInt (UINT result)
STDMETHOD() OutputsBSTR (BSTR *result)
STDMETHOD() OutputsI4 (LONG *result)
STDMETHOD() OutputsUI1 (BYTE *result)
STDMETHOD() OutputsI2 (SHORT *result)
STDMETHOD() OutputsR4 (FLOAT *result)
STDMETHOD() OutputsR8 (DOUBLE *result)
STDMETHOD() OutputsBool (VARIANT_BOOL *result)
STDMETHOD() OutputsIDispatch (IDispatch **result)
STDMETHOD() OutputsError (SCODE *result)
STDMETHOD() OutputsDate (DATE *result)
STDMETHOD() OutputsIUnknown (IUnknown **result)
STDMETHOD() OutputsI1 (unsigned char *result)
STDMETHOD() OutputsUI2 (USHORT *result)
STDMETHOD() OutputsUI4 (ULONG *result)
STDMETHOD() InOutsBSTR (BSTR *result)
STDMETHOD() InOutsI4 (LONG *result)
STDMETHOD() InOutsUI1 (BYTE *result)
STDMETHOD() InOutsI2 (SHORT *result)
STDMETHOD() InOutsR4 (FLOAT *result)
STDMETHOD() InOutsR8 (DOUBLE *result)
STDMETHOD() InOutsBool (VARIANT_BOOL *result)
STDMETHOD() InOutsIDispatch (IDispatch **result)
STDMETHOD() InOutsError (SCODE *result)
STDMETHOD() InOutsDate (DATE *result)
STDMETHOD() InOutsIUnknown (IUnknown **result)
STDMETHOD() InOutsI1 (unsigned char *result)
STDMETHOD() InOutsUI2 (USHORT *result)
STDMETHOD() InOutsUI4 (ULONG *result)
STDMETHOD() OneParameterWithReturn (LONG input, LONG *result)
STDMETHOD() StringInputAndReturn (BSTR str, BSTR *result)
STDMETHOD() IDispatchInputAndReturn (IDispatch *input, IDispatch **result)
STDMETHOD() TwoParameters (LONG one, LONG two)
STDMETHOD() TwelveInParameters (LONG one, LONG two, LONG three, LONG four, LONG five, LONG six, LONG seven, LONG eight, LONG nine, LONG ten, LONG eleven, LONG twelve)
STDMETHOD() TwelveOutParameters (LONG *one, LONG *two, LONG *three, LONG *four, LONG *five, LONG *six, LONG *seven, LONG *eight, LONG *nine, LONG *ten, LONG *eleven, LONG *twelve)
STDMETHOD() TwelveStrings (BSTR one, BSTR two, BSTR three, BSTR four, BSTR five, BSTR six, BSTR seven, BSTR eight, BSTR nine, BSTR ten, BSTR eleven, BSTR twelve)
STDMETHOD() TwelveOutStrings (BSTR *one, BSTR *two, BSTR *three, BSTR *four, BSTR *five, BSTR *six, BSTR *seven, BSTR *eight, BSTR *nine, BSTR *ten, BSTR *eleven, BSTR *twelve)
STDMETHOD() TwelveIDispatch (IDispatch *one, IDispatch *two, IDispatch *three, IDispatch *four, IDispatch *five, IDispatch *six, IDispatch *seven, IDispatch *eight, IDispatch *nine, IDispatch *ten, IDispatch *eleven, IDispatch *twelve)
STDMETHOD() TwelveOutIDispatch (IDispatch **one, IDispatch **two, IDispatch **three, IDispatch **four, IDispatch **five, IDispatch **six, IDispatch **seven, IDispatch **eight, IDispatch **nine, IDispatch **ten, IDispatch **eleven, IDispatch **twelve)
STDMETHOD() CreateError ()

Detailed Description

Definition at line 18 of file nsXPCDispTestMethods.h.


Constructor & Destructor Documentation

Definition at line 25 of file nsXPCDispTestMethods.h.

{}

Member Function Documentation

Definition at line 672 of file nsXPCDispTestMethods.cpp.

{
    CComBSTR someText(L"CreateError Test");
    ICreateErrorInfo * pCreateError;
    IErrorInfo * pError;
    HRESULT result = CreateErrorInfo(&pCreateError);
    if (FAILED(result))
        return E_NOTIMPL;
    result = pCreateError->QueryInterface(&pError);
    if (FAILED(result))
        return E_NOTIMPL;
    result = pCreateError->SetDescription(someText);
    if (FAILED(result))
        return E_NOTIMPL;
    result = pCreateError->SetGUID(IID_nsIXPCDispTestMethods);
    if (FAILED(result))
        return E_NOTIMPL;
    CComBSTR source(L"XPCIDispatchTest.nsXPCDispTestMethods.1");
    result = pCreateError->SetSource(source);
    if (FAILED(result))
        return E_NOTIMPL;
    result = SetErrorInfo(0, pError);
    if (FAILED(result))
        return E_NOTIMPL;
    pError->Release();
    pCreateError->Release();
    return E_FAIL;
}
STDMETHODIMP nsXPCDispTestMethods::IDispatchInputAndReturn ( IDispatch input,
IDispatch **  result 
)

Definition at line 510 of file nsXPCDispTestMethods.cpp.

{
    if (result == NULL)
        return E_POINTER;
    HRESULT hResult = VerifynsXPCDispSimple(input);

    hResult = XPCCreateInstance<IDispatch>(CLSID_nsXPCDispSimple, IID_IDispatch, result);
    if (FAILED(hResult))
        return hResult;
    CComVariant variant;
    hResult = GetProperty(input, L"Number", variant);
    if (FAILED(hResult))
        return hResult;
    return PutProperty(*result, L"Number", variant.lVal + 5);
}

Here is the call graph for this function:

STDMETHODIMP nsXPCDispTestMethods::InOutsBool ( VARIANT_BOOL *  result)

Definition at line 414 of file nsXPCDispTestMethods.cpp.

{
    if (result == NULL)
        return E_POINTER;
    *result = !*result;
    return S_OK;
}
STDMETHODIMP nsXPCDispTestMethods::InOutsBSTR ( BSTR *  result)

Definition at line 369 of file nsXPCDispTestMethods.cpp.

{
    if (result == NULL)
        return E_POINTER;
    CComBSTR str(*result);
    str += L"Appended";
    SysFreeString(*result);
    *result = str.Detach();
    return S_OK;
}
STDMETHODIMP nsXPCDispTestMethods::InOutsDate ( DATE *  result)

Definition at line 448 of file nsXPCDispTestMethods.cpp.

{
    if (result == NULL)
        return E_POINTER;
    ULONG days;
    HRESULT hResult = VarUI4FromDate(*result, &days);
    if (FAILED(hResult))
        return hResult;

    return VarDateFromUI4(days + 1, result);
}
STDMETHODIMP nsXPCDispTestMethods::InOutsError ( SCODE *  result)

Definition at line 441 of file nsXPCDispTestMethods.cpp.

{
    if (result == NULL)
        return E_POINTER;
    *result += 1;
    return S_OK;
}
STDMETHODIMP nsXPCDispTestMethods::InOutsI1 ( unsigned char *  result)

Definition at line 471 of file nsXPCDispTestMethods.cpp.

{
    if (result == NULL)
        return E_POINTER;
    ++*result;
    return S_OK;
}
STDMETHODIMP nsXPCDispTestMethods::InOutsI2 ( SHORT *  result)

Definition at line 393 of file nsXPCDispTestMethods.cpp.

{
    if (result == NULL)
        return E_POINTER;
    *result += 10000;
    return S_OK;
}
STDMETHODIMP nsXPCDispTestMethods::InOutsI4 ( LONG result)

Definition at line 379 of file nsXPCDispTestMethods.cpp.

{
    if (result == NULL)
        return E_POINTER;
    *result -= 4000000;
    return S_OK;
}
STDMETHODIMP nsXPCDispTestMethods::InOutsIDispatch ( IDispatch **  result)

Definition at line 421 of file nsXPCDispTestMethods.cpp.

{
    if (result == NULL)
        return E_POINTER;
    CComPtr<nsIXPCDispSimple> ptr;
    ptr.CoCreateInstance(CLSID_nsXPCDispSimple);
    CComPtr<IDispatch> incoming(*result);
    CComVariant value;
    HRESULT hResult = GetProperty(incoming, L"Number", value);
    if (FAILED(hResult))
        return hResult;
    if (value.lVal != 10)
        return E_FAIL;
    hResult = ptr->put_Number(value.lVal + 5);
    if (FAILED(hResult))
        return hResult;

    *result = ptr.Detach();
    return S_OK;
}

Here is the call graph for this function:

STDMETHODIMP nsXPCDispTestMethods::InOutsIUnknown ( IUnknown **  result)

Definition at line 459 of file nsXPCDispTestMethods.cpp.

{
    if (result == NULL)
        return E_POINTER;
        
    CComPtr<IUnknown> ptr(*result);
    ULONG before = (*result)->AddRef();
    ULONG after = (*result)->Release();
    if (before - 1 != after)
        return E_FAIL;
    return nsXPCDispSimple::CreateInstance(result);
}
STDMETHODIMP nsXPCDispTestMethods::InOutsR4 ( FLOAT *  result)

Definition at line 400 of file nsXPCDispTestMethods.cpp.

{
    if (result == NULL)
        return E_POINTER;
    *result += 5.05f;
    return S_OK;
}
STDMETHODIMP nsXPCDispTestMethods::InOutsR8 ( DOUBLE *  result)

Definition at line 407 of file nsXPCDispTestMethods.cpp.

{
    if (result == NULL)
        return E_POINTER;
    *result += 50000000.00000005;
    return S_OK;
}
STDMETHODIMP nsXPCDispTestMethods::InOutsUI1 ( BYTE result)

Definition at line 386 of file nsXPCDispTestMethods.cpp.

{
    if (result == NULL)
        return E_POINTER;
    *result -= 42;
    return S_OK;
}
STDMETHODIMP nsXPCDispTestMethods::InOutsUI2 ( USHORT result)

Definition at line 478 of file nsXPCDispTestMethods.cpp.

{
    if (result == NULL)
        return E_POINTER;
    *result += 42;
    return S_OK;
}
STDMETHODIMP nsXPCDispTestMethods::InOutsUI4 ( ULONG result)

Definition at line 485 of file nsXPCDispTestMethods.cpp.

{
    if (result == NULL)
        return E_POINTER;
    *result -= 42;
    return S_OK;
}
STDMETHODIMP nsXPCDispTestMethods::InterfaceSupportsErrorInfo ( REFIID  riid)

Definition at line 12 of file nsXPCDispTestMethods.cpp.

{
    static const IID* arr[] = 
    {
        &IID_nsIXPCDispTestMethods,
    };

    for (int i=0;i<sizeof(arr)/sizeof(arr[0]);i++)
    {
        if (InlineIsEqualGUID(*arr[i],riid))
            return S_OK;
    }
    return S_FALSE;
}

Definition at line 27 of file nsXPCDispTestMethods.cpp.

{
    return S_OK;
}
STDMETHODIMP nsXPCDispTestMethods::OneParameterWithReturn ( LONG  input,
LONG result 
)

Definition at line 492 of file nsXPCDispTestMethods.cpp.

{
    if (result == NULL)
        return E_POINTER;
    *result = input + 42;
    return S_OK;
}
STDMETHODIMP nsXPCDispTestMethods::OutputsBool ( VARIANT_BOOL *  result)

Definition at line 312 of file nsXPCDispTestMethods.cpp.

{
    if (result == NULL)
        return E_POINTER;
    *result = VARIANT_TRUE;
    return S_OK;
}
STDMETHODIMP nsXPCDispTestMethods::OutputsBSTR ( BSTR *  result)

Definition at line 268 of file nsXPCDispTestMethods.cpp.

{
    if (result == NULL)
        return E_POINTER;
        
    CComBSTR x("Boo");
    *result = x.Detach();
    return S_OK;
}
STDMETHODIMP nsXPCDispTestMethods::OutputsDate ( DATE *  result)

Definition at line 332 of file nsXPCDispTestMethods.cpp.

{
    if (result == NULL)
        return E_POINTER;
    CComBSTR dateStr(L"5/2/02");
    return VarDateFromStr(dateStr, LOCALE_SYSTEM_DEFAULT,
                          LOCALE_NOUSEROVERRIDE, result);
}
STDMETHODIMP nsXPCDispTestMethods::OutputsError ( SCODE *  result)

Definition at line 325 of file nsXPCDispTestMethods.cpp.

{
    if (result == NULL)
        return E_POINTER;
    *result = E_FAIL;
    return S_OK;
}
STDMETHODIMP nsXPCDispTestMethods::OutputsI1 ( unsigned char *  result)

Definition at line 347 of file nsXPCDispTestMethods.cpp.

{
    if (result == NULL)
        return E_POINTER;
        
    *result = L'x';
    return S_OK;
}
STDMETHODIMP nsXPCDispTestMethods::OutputsI2 ( SHORT *  result)

Definition at line 291 of file nsXPCDispTestMethods.cpp.

{
    if (result == NULL)
        return E_POINTER;
    *result = 9999;
    return S_OK;
}
STDMETHODIMP nsXPCDispTestMethods::OutputsI4 ( LONG result)

Definition at line 277 of file nsXPCDispTestMethods.cpp.

{
    if (result == NULL)
        return E_POINTER;
    *result = 99999;
    return S_OK;
}

Definition at line 319 of file nsXPCDispTestMethods.cpp.

{
    if (result == NULL)
        return E_POINTER;
    return nsXPCDispSimple::CreateInstance(result);
}
STDMETHODIMP nsXPCDispTestMethods::OutputsIUnknown ( IUnknown **  result)

Definition at line 340 of file nsXPCDispTestMethods.cpp.

{
    if (result == NULL)
        return E_POINTER;
        
    return XPCCreateInstance<IUnknown>(CLSID_nsXPCDispTestNoIDispatch, IID_IUnknown, result);
}
STDMETHODIMP nsXPCDispTestMethods::OutputsR4 ( FLOAT *  result)

Definition at line 298 of file nsXPCDispTestMethods.cpp.

{
    if (result == NULL)
        return E_POINTER;
    *result = 999999.1f;
    return S_OK;
}
STDMETHODIMP nsXPCDispTestMethods::OutputsR8 ( DOUBLE *  result)

Definition at line 305 of file nsXPCDispTestMethods.cpp.

{
    if (result == NULL)
        return E_POINTER;
    *result = 99999999999.99;
    return S_OK;
}
STDMETHODIMP nsXPCDispTestMethods::OutputsUI1 ( BYTE result)

Definition at line 284 of file nsXPCDispTestMethods.cpp.

{
    if (result == NULL)
        return E_POINTER;
    *result = 99;
    return S_OK;
}
STDMETHODIMP nsXPCDispTestMethods::OutputsUI2 ( USHORT result)

Definition at line 355 of file nsXPCDispTestMethods.cpp.

{
    if (result == NULL)
        return E_POINTER;
    *result = 9999;
    return S_OK;
}
STDMETHODIMP nsXPCDispTestMethods::OutputsUI4 ( ULONG result)

Definition at line 362 of file nsXPCDispTestMethods.cpp.

{
    if (result == NULL)
        return E_POINTER;
    *result = 3000000000;
    return S_OK;
}
STDMETHODIMP nsXPCDispTestMethods::ReturnBool ( VARIANT_BOOL *  result)

Definition at line 75 of file nsXPCDispTestMethods.cpp.

{
    if (result == NULL)
        return E_POINTER;
    *result = VARIANT_TRUE;
    return S_OK;
}
STDMETHODIMP nsXPCDispTestMethods::ReturnBSTR ( BSTR *  result)

Definition at line 31 of file nsXPCDispTestMethods.cpp.

{
    if (result == NULL)
        return E_POINTER;
        
    CComBSTR x("Boo");
    *result = x.Detach();
    return S_OK;
}
STDMETHODIMP nsXPCDispTestMethods::ReturnDate ( DATE *  result)

Definition at line 95 of file nsXPCDispTestMethods.cpp.

{
    if (result == NULL)
        return E_POINTER;
    CComBSTR dateStr(L"5/2/02");
    return VarDateFromStr(dateStr, LOCALE_SYSTEM_DEFAULT,
                          LOCALE_NOUSEROVERRIDE, result);
}
STDMETHODIMP nsXPCDispTestMethods::ReturnError ( SCODE *  result)

Definition at line 88 of file nsXPCDispTestMethods.cpp.

{
    if (result == NULL)
        return E_POINTER;
    *result = E_FAIL;
    return S_OK;
}
STDMETHODIMP nsXPCDispTestMethods::ReturnI1 ( unsigned char *  result)

Definition at line 110 of file nsXPCDispTestMethods.cpp.

{
    if (result == NULL)
        return E_POINTER;
        
    *result = 120;
    return S_OK;
}
STDMETHODIMP nsXPCDispTestMethods::ReturnI2 ( SHORT *  result)

Definition at line 54 of file nsXPCDispTestMethods.cpp.

{
    if (result == NULL)
        return E_POINTER;
    *result = 9999;
    return S_OK;
}
STDMETHODIMP nsXPCDispTestMethods::ReturnI4 ( INT result)

Definition at line 40 of file nsXPCDispTestMethods.cpp.

{
    if (result == NULL)
        return E_POINTER;
    *result = 99999;
    return S_OK;
}
STDMETHODIMP nsXPCDispTestMethods::ReturnIDispatch ( IDispatch **  result)

Definition at line 82 of file nsXPCDispTestMethods.cpp.

{
    if (result == NULL)
        return E_POINTER;
    return nsXPCDispSimple::CreateInstance(result);
}
STDMETHODIMP nsXPCDispTestMethods::ReturnInt ( INT result)

Definition at line 132 of file nsXPCDispTestMethods.cpp.

{
    if (result == NULL)
        return E_POINTER;
    *result = -999999;
    return S_OK;
}
STDMETHODIMP nsXPCDispTestMethods::ReturnIUnknown ( IUnknown **  result)

Definition at line 103 of file nsXPCDispTestMethods.cpp.

{
    if (result == NULL)
        return E_POINTER;
        
    return XPCCreateInstance<IUnknown>(CLSID_nsXPCDispTestNoIDispatch, IID_IUnknown, result);
}
STDMETHODIMP nsXPCDispTestMethods::ReturnR4 ( FLOAT *  result)

Definition at line 61 of file nsXPCDispTestMethods.cpp.

{
    if (result == NULL)
        return E_POINTER;
    *result = 99999.1f;
    return S_OK;
}
STDMETHODIMP nsXPCDispTestMethods::ReturnR8 ( DOUBLE *  result)

Definition at line 68 of file nsXPCDispTestMethods.cpp.

{
    if (result == NULL)
        return E_POINTER;
    *result = 99999999999.99;
    return S_OK;
}
STDMETHODIMP nsXPCDispTestMethods::ReturnUI1 ( BYTE result)

Definition at line 47 of file nsXPCDispTestMethods.cpp.

{
    if (result == NULL)
        return E_POINTER;
    *result = 99;
    return S_OK;
}
STDMETHODIMP nsXPCDispTestMethods::ReturnUI2 ( USHORT result)

Definition at line 118 of file nsXPCDispTestMethods.cpp.

{
    if (result == NULL)
        return E_POINTER;
    *result = 9999;
    return S_OK;
}
STDMETHODIMP nsXPCDispTestMethods::ReturnUI4 ( ULONG result)

Definition at line 125 of file nsXPCDispTestMethods.cpp.

{
    if (result == NULL)
        return E_POINTER;
    *result = 3000000000;
    return S_OK;
}
STDMETHODIMP nsXPCDispTestMethods::ReturnUInt ( UINT result)

Definition at line 139 of file nsXPCDispTestMethods.cpp.

{
    if (result == NULL)
        return E_POINTER;
        
    *result = 3000000000;
    return S_OK;
}
STDMETHODIMP nsXPCDispTestMethods::StringInputAndReturn ( BSTR  str,
BSTR *  result 
)

Definition at line 500 of file nsXPCDispTestMethods.cpp.

{
    if (result == NULL)
        return E_POINTER;
    CComBSTR input(str);
    input += L"Appended";
    *result = input.Detach();
    return S_OK;
}
STDMETHODIMP nsXPCDispTestMethods::TakesBool ( VARIANT_BOOL  result)

Definition at line 175 of file nsXPCDispTestMethods.cpp.

{
    return result ? S_OK : E_FAIL;
}
STDMETHODIMP nsXPCDispTestMethods::TakesBSTR ( BSTR  result)

Definition at line 147 of file nsXPCDispTestMethods.cpp.

{
    CComBSTR str(result);
    static CComBSTR test(L"TakesBSTR");
    return str == test ? S_OK: E_FAIL;
}
STDMETHODIMP nsXPCDispTestMethods::TakesDate ( DATE  result)

Definition at line 229 of file nsXPCDispTestMethods.cpp.

{
    CComBSTR dateStr(L"5/2/02");
    DATE myDate;
    HRESULT hResult = VarDateFromStr(dateStr, LOCALE_SYSTEM_DEFAULT,
                                    LOCALE_NOUSEROVERRIDE, &myDate);
    if (SUCCEEDED(hResult))
        return myDate == result ? S_OK : E_FAIL;
    else
        return hResult;
}
STDMETHODIMP nsXPCDispTestMethods::TakesError ( SCODE  result)

Definition at line 225 of file nsXPCDispTestMethods.cpp.

{
    return result == E_FAIL ? S_OK : E_FAIL;
}
STDMETHODIMP nsXPCDispTestMethods::TakesI1 ( unsigned char  result)

Definition at line 248 of file nsXPCDispTestMethods.cpp.

{
    return result == 42 ? S_OK : E_FAIL;
}
STDMETHODIMP nsXPCDispTestMethods::TakesI2 ( SHORT  result)

Definition at line 161 of file nsXPCDispTestMethods.cpp.

{
    return result == 32000 ? S_OK : E_FAIL;
}
STDMETHODIMP nsXPCDispTestMethods::TakesI4 ( INT  result)

Definition at line 153 of file nsXPCDispTestMethods.cpp.

{
    return result == 999999 ? S_OK : E_FAIL;
}
STDMETHODIMP nsXPCDispTestMethods::TakesIDispatch ( IDispatch result)

Definition at line 221 of file nsXPCDispTestMethods.cpp.

{
    return VerifynsXPCDispSimple(result);
}

Here is the call graph for this function:

STDMETHODIMP nsXPCDispTestMethods::TakesInt ( INT  result)

Definition at line 260 of file nsXPCDispTestMethods.cpp.

{
    return result == -10000000 ? S_OK : E_FAIL;
}
STDMETHODIMP nsXPCDispTestMethods::TakesIUnknown ( IUnknown result)

Definition at line 240 of file nsXPCDispTestMethods.cpp.

{
    CComPtr<IUnknown> ptr(result);
    ULONG before = result->AddRef();
    ULONG after = result->Release();
    CComQIPtr<nsIXPCDispTestNoIDispatch> noIDispatch(ptr);
    return before - 1 == after ? S_OK : E_FAIL;
}

Here is the call graph for this function:

STDMETHODIMP nsXPCDispTestMethods::TakesR4 ( FLOAT  result)

Definition at line 165 of file nsXPCDispTestMethods.cpp.

{
    // Hopefully we won't run into any precision/rounding issues
    return result == 99999.99f ? S_OK : E_FAIL;
}
STDMETHODIMP nsXPCDispTestMethods::TakesR8 ( DOUBLE  result)

Definition at line 170 of file nsXPCDispTestMethods.cpp.

{
    // Hopefully we won't run into any precision/rounding issues
    return result == 999999999.99 ? S_OK : E_FAIL;
}
STDMETHODIMP nsXPCDispTestMethods::TakesUI1 ( BYTE  result)

Definition at line 157 of file nsXPCDispTestMethods.cpp.

{
    return result == 42 ? S_OK : E_FAIL;
}
STDMETHODIMP nsXPCDispTestMethods::TakesUI2 ( USHORT  result)

Definition at line 252 of file nsXPCDispTestMethods.cpp.

{
    return result == 50000 ? S_OK : E_FAIL;
}
STDMETHODIMP nsXPCDispTestMethods::TakesUI4 ( ULONG  result)

Definition at line 256 of file nsXPCDispTestMethods.cpp.

{
    return result == 0xF0000000 ? S_OK : E_FAIL;
}
STDMETHODIMP nsXPCDispTestMethods::TakesUInt ( UINT  result)

Definition at line 264 of file nsXPCDispTestMethods.cpp.

{
    return result == 0xE0000000 ? S_OK : E_FAIL;
}
STDMETHODIMP nsXPCDispTestMethods::TwelveIDispatch ( IDispatch one,
IDispatch two,
IDispatch three,
IDispatch four,
IDispatch five,
IDispatch six,
IDispatch seven,
IDispatch eight,
IDispatch nine,
IDispatch ten,
IDispatch eleven,
IDispatch twelve 
)

Definition at line 609 of file nsXPCDispTestMethods.cpp.

{
    HRESULT hResult;
    VERIFYSIMPLE(one);
    VERIFYSIMPLE(two);
    VERIFYSIMPLE(three);
    VERIFYSIMPLE(four);
    VERIFYSIMPLE(five);
    VERIFYSIMPLE(six);
    VERIFYSIMPLE(seven);
    VERIFYSIMPLE(eight);
    VERIFYSIMPLE(nine);
    VERIFYSIMPLE(ten);
    VERIFYSIMPLE(eleven);
    VERIFYSIMPLE(twelve);
    return S_OK;
}
STDMETHODIMP nsXPCDispTestMethods::TwelveInParameters ( LONG  one,
LONG  two,
LONG  three,
LONG  four,
LONG  five,
LONG  six,
LONG  seven,
LONG  eight,
LONG  nine,
LONG  ten,
LONG  eleven,
LONG  twelve 
)

Definition at line 529 of file nsXPCDispTestMethods.cpp.

{
    return one + two + three + four + five + six + seven + eight + nine + 
        ten + eleven + twelve == 78 ? S_OK : E_FAIL;
}
STDMETHODIMP nsXPCDispTestMethods::TwelveOutIDispatch ( IDispatch **  one,
IDispatch **  two,
IDispatch **  three,
IDispatch **  four,
IDispatch **  five,
IDispatch **  six,
IDispatch **  seven,
IDispatch **  eight,
IDispatch **  nine,
IDispatch **  ten,
IDispatch **  eleven,
IDispatch **  twelve 
)

Definition at line 645 of file nsXPCDispTestMethods.cpp.

                                                                           {
    HRESULT hResult;
    ASSIGNSIMPLE(one);
    ASSIGNSIMPLE(two);
    ASSIGNSIMPLE(three);
    ASSIGNSIMPLE(four);
    ASSIGNSIMPLE(five);
    ASSIGNSIMPLE(six);
    ASSIGNSIMPLE(seven);
    ASSIGNSIMPLE(eight);
    ASSIGNSIMPLE(nine);
    ASSIGNSIMPLE(ten);
    ASSIGNSIMPLE(eleven);
    ASSIGNSIMPLE(twelve);
    return S_OK;
}
STDMETHODIMP nsXPCDispTestMethods::TwelveOutParameters ( LONG one,
LONG two,
LONG three,
LONG four,
LONG five,
LONG six,
LONG seven,
LONG eight,
LONG nine,
LONG ten,
LONG eleven,
LONG twelve 
)

Definition at line 539 of file nsXPCDispTestMethods.cpp.

{
    if (one == 0 || two == 0 || three == 0 || four == 0 || 
        five == 0 || six == 0 || seven == 0 || eight == 0 ||
        nine == 0 || ten == 0 || eleven == 0 || twelve == 0)
        return E_POINTER;
    
    *one = 1;
    *two = 2;
    *three = 3;
    *four = 4;
    *five = 5;
    *six = 6;
    *seven = 7;
    *eight = 8;
    *nine = 9;
    *ten = 10;
    *eleven = 11;
    *twelve = 12;
    return S_OK;
}
STDMETHODIMP nsXPCDispTestMethods::TwelveOutStrings ( BSTR *  one,
BSTR *  two,
BSTR *  three,
BSTR *  four,
BSTR *  five,
BSTR *  six,
BSTR *  seven,
BSTR *  eight,
BSTR *  nine,
BSTR *  ten,
BSTR *  eleven,
BSTR *  twelve 
)

Definition at line 589 of file nsXPCDispTestMethods.cpp.

{
    ASSIGNPARAM(one);
    ASSIGNPARAM(two);
    ASSIGNPARAM(three);
    ASSIGNPARAM(four);
    ASSIGNPARAM(five);
    ASSIGNPARAM(six);
    ASSIGNPARAM(seven);
    ASSIGNPARAM(eight);
    ASSIGNPARAM(nine);
    ASSIGNPARAM(ten);
    ASSIGNPARAM(eleven);
    ASSIGNPARAM(twelve);
    return S_OK;
}
STDMETHODIMP nsXPCDispTestMethods::TwelveStrings ( BSTR  one,
BSTR  two,
BSTR  three,
BSTR  four,
BSTR  five,
BSTR  six,
BSTR  seven,
BSTR  eight,
BSTR  nine,
BSTR  ten,
BSTR  eleven,
BSTR  twelve 
)

Definition at line 576 of file nsXPCDispTestMethods.cpp.

{
    return TESTPARAM(one) && TESTPARAM(two) && TESTPARAM(three) && 
        TESTPARAM(four) && TESTPARAM(five) && TESTPARAM(six) && 
        TESTPARAM(seven) && TESTPARAM(eight) && TESTPARAM(nine) && 
        TESTPARAM(ten) && TESTPARAM(eleven) && TESTPARAM(twelve) ? 
            S_OK : E_FAIL;
}
STDMETHODIMP nsXPCDispTestMethods::TwoParameters ( LONG  one,
LONG  two 
)

Definition at line 525 of file nsXPCDispTestMethods.cpp.

{
    return one + 1 == two ? S_OK : E_FAIL;
}

The documentation for this class was generated from the following files: