Ignore:
Timestamp:
Oct 3, 2001, 9:22:00 PM (24 years ago)
Author:
sandervl
Message:

wine update

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/oleaut32/dispatch.c

    r6711 r6944  
    88 * TODO: Type coercion is implemented in variant.c but not called yet.
    99 */
    10 #ifdef __WIN32OS2__
    11 #define HAVE_FLOAT_H
    12 #define WINE_LARGE_INTEGER
    13 #include "oleaut32.h"
    14 #endif
     10
     11#include "config.h"
    1512
    1613#include <stdlib.h>
     
    1815#include <stdio.h>
    1916#include <ctype.h>
     17
     18#include "windef.h"
     19#include "ole.h"
     20#include "oleauto.h"
    2021#include "winerror.h"
    2122#include "winreg.h"         /* for HKEY_LOCAL_MACHINE */
    2223#include "winnls.h"         /* for PRIMARYLANGID */
    23 #include "ole.h"
    24 #include "heap.h"
     24
    2525#include "wine/obj_oleaut.h"
     26
    2627#include "debugtools.h"
    2728
     
    3132
    3233/******************************************************************************
    33  *         DispInvoke    (OLEAUT32.30)
     34 *              DispInvoke (OLEAUT32.30)
    3435 *
    3536 *
     
    4344 *              S_OK on success.
    4445 */
    45 HRESULT WINAPI
    46 DispInvoke(VOID*            _this,          /* object instance */
    47            ITypeInfo*       ptinfo,         /* object's type info */
    48            DISPID           dispidMember,   /* member id */
    49            USHORT           wFlags,         /* kind of method call */
    50            DISPPARAMS*      pparams,        /* array of arguments */
    51            VARIANT*         pvarResult,     /* result of method call */
    52            EXCEPINFO*       pexcepinfo,     /* information about exception */
    53            UINT*            puArgErr        /* index of bad argument(if any) */
    54           )
     46HRESULT WINAPI DispInvoke(
     47        VOID       *_this,        /* [in] object instance */
     48        ITypeInfo  *ptinfo,       /* [in] object's type info */
     49        DISPID      dispidMember, /* [in] member id */
     50        USHORT      wFlags,       /* [in] kind of method call */
     51        DISPPARAMS *pparams,      /* [in] array of arguments */
     52        VARIANT    *pvarResult,   /* [out] result of method call */
     53        EXCEPINFO  *pexcepinfo,   /* [out] information about exception */
     54        UINT       *puArgErr)     /* [out] index of bad argument(if any) */
    5555{
    5656    HRESULT hr = E_FAIL;
     
    7474
    7575/******************************************************************************
    76  *         DispGetIDsOfNames (OLEAUT32.29)
     76 *              DispGetIDsOfNames (OLEAUT32.29)
    7777 *
    7878 * Convert a set of names to dispids, based on information
     
    8686 *              S_OK on success.
    8787 */
    88 HRESULT WINAPI
    89 DispGetIDsOfNames(ITypeInfo* ptinfo,
    90                   OLECHAR**  rgszNames,
    91                   UINT       cNames,
    92                   DISPID*    rgdispid)
     88HRESULT WINAPI DispGetIDsOfNames(
     89        ITypeInfo  *ptinfo,    /* [in] */
     90        OLECHAR   **rgszNames, /* [in] */
     91        UINT        cNames,    /* [in] */
     92        DISPID     *rgdispid)  /* [out] */
    9393{
    9494    HRESULT hr = E_FAIL;
     
    103103
    104104/******************************************************************************
    105  *         DispGetParam    (OLEAUT32.30)
     105 *              DispGetParam (OLEAUT32.28)
    106106 *
    107107 * Retrive a parameter from a DISPPARAMS structures and coerce it to
     
    115115 *              S_OK on success.
    116116 */
    117 HRESULT WINAPI DispGetParam(DISPPARAMS* pdispparams, UINT position,
    118             VARTYPE vtTarg, VARIANT* pvarResult, UINT* puArgErr)
     117HRESULT WINAPI DispGetParam(
     118        DISPPARAMS *pdispparams, /* [in] */
     119        UINT        position,    /* [in] */
     120        VARTYPE     vtTarg,      /* [in] */
     121        VARIANT    *pvarResult,  /* [out] */
     122        UINT       *puArgErr)    /* [out] */
    119123{
    120     HRESULT hr = E_FAIL;
     124    /* position is counted backwards */
     125    UINT pos;
     126    HRESULT hr;
    121127
    122     /**
    123      * TODO : Call VariantChangeTypeEx with LCID 0 (system)
    124      */
     128    TRACE("position=%d, cArgs=%d, cNamedArgs=%d\n",
     129          position, pdispparams->cArgs, pdispparams->cNamedArgs);
     130    if (position < pdispparams->cArgs) {
     131      /* positional arg? */
     132      pos = pdispparams->cArgs - position - 1;
     133    } else {
     134      /* FIXME: is this how to handle named args? */
     135      for (pos=0; pos<pdispparams->cNamedArgs; pos++)
     136        if (pdispparams->rgdispidNamedArgs[pos] == position) break;
    125137
    126     FIXME("Coercion of arguments not implemented\n");
    127     return (hr);
     138      if (pos==pdispparams->cNamedArgs)
     139        return DISP_E_PARAMNOTFOUND;
     140    }
     141    hr = VariantChangeType(pvarResult,
     142                           &pdispparams->rgvarg[pos],
     143                           0, vtTarg);
     144    if (hr == DISP_E_TYPEMISMATCH) *puArgErr = pos;
     145    return hr;
    128146}
Note: See TracChangeset for help on using the changeset viewer.