Ignore:
Timestamp:
Sep 15, 2001, 11:32:00 AM (24 years ago)
Author:
sandervl
Message:

restored old version + wine update

File:
1 edited

Legend:

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

    r6689 r6711  
    11/*
    2  *  OLE2DISP library
     2 *      OLE2DISP library
    33 *
    4  *  Copyright 1995  Martin von Loewis
     4 *      Copyright 1995  Martin von Loewis
    55 */
    66#ifdef __WIN32OS2__
     
    3131
    3232/******************************************************************************
    33  *      BSTR_AllocBytes [Internal]
     33 *              BSTR_AllocBytes [Internal]
    3434 */
    3535static BSTR16 BSTR_AllocBytes(int n)
     
    5656
    5757/******************************************************************************
    58  *      SysAllocString16    [OLE2DISP.2]
     58 *              SysAllocString16        [OLE2DISP.2]
    5959 */
    6060BSTR16 WINAPI SysAllocString16(LPCOLESTR16 in)
    6161{
    62     BSTR16 out;
    63 
     62        BSTR16 out;
     63   
     64        if (!in) return 0;
     65   
     66        out = BSTR_AllocBytes(strlen(in)+1);
     67        if(!out)return 0;
     68        strcpy(BSTR_GetAddr(out),in);
     69        return out;
     70}
     71#endif
     72
     73/******************************************************************************
     74 *              SysAllocString  [OLEAUT32.2]
     75 */
     76BSTR WINAPI SysAllocString(LPCOLESTR in)
     77{
    6478    if (!in) return 0;
    65 
    66     out = BSTR_AllocBytes(strlen(in)+1);
    67     if(!out)return 0;
    68     strcpy(BSTR_GetAddr(out),in);
    69     return out;
    70 }
    71 #endif
    72 
    73 /******************************************************************************
    74  *      SysAllocString  [OLEAUT32.2]
    75  */
    76 BSTR WINAPI SysAllocString(LPCOLESTR in)
    77 {
    78     if (!in) return 0;
    79 
     79   
    8080    /* Delegate this to the SysAllocStringLen32 method. */
    8181    return SysAllocStringLen(in, lstrlenW(in));
     
    8484#ifndef __WIN32OS2__
    8585/******************************************************************************
    86  *      SysReAllocString16  [OLE2DISP.3]
     86 *              SysReAllocString16      [OLE2DISP.3]
    8787 */
    8888INT16 WINAPI SysReAllocString16(LPBSTR16 old,LPCOLESTR16 in)
    8989{
    90     BSTR16 new=SysAllocString16(in);
    91     BSTR_Free(*old);
    92     *old=new;
    93     return 1;
    94 }
    95 #endif
    96 
    97 /******************************************************************************
    98  *      SysReAllocString    [OLEAUT32.3]
     90        BSTR16 new=SysAllocString16(in);
     91        BSTR_Free(*old);
     92        *old=new;
     93        return 1;
     94}
     95#endif
     96
     97/******************************************************************************
     98 *              SysReAllocString        [OLEAUT32.3]
    9999 */
    100100INT WINAPI SysReAllocString(LPBSTR old,LPCOLESTR in)
     
    103103     * Sanity check
    104104     */
    105     if (old==NULL)
     105    if (old==NULL) 
    106106      return 0;
    107107
     
    109109     * Make sure we free the old string.
    110110     */
    111     if (*old!=NULL)
     111    if (*old!=NULL)     
    112112      SysFreeString(*old);
    113113
     
    122122#ifndef __WIN32OS2__
    123123/******************************************************************************
    124  *      SysAllocStringLen16 [OLE2DISP.4]
     124 *              SysAllocStringLen16     [OLE2DISP.4]
    125125 */
    126126BSTR16 WINAPI SysAllocStringLen16(const char *in, int len)
    127127{
    128     BSTR16 out=BSTR_AllocBytes(len+1);
    129 
    130     if (!out)
    131         return 0;
     128        BSTR16 out=BSTR_AllocBytes(len+1);
     129
     130        if (!out)
     131                return 0;
    132132
    133133    /*
     
    137137     */
    138138    if (in != 0)
    139     strcpy(BSTR_GetAddr(out),in);
     139        strcpy(BSTR_GetAddr(out),in);
    140140    else
    141141      memset(BSTR_GetAddr(out), 0, len+1);
    142142
    143     return out;
     143        return out;
    144144}
    145145#endif
     
    152152 * he describes it as a "DWORD count of characters". By experimenting with
    153153 * a windows application, this count seems to be a DWORD count of bytes in
    154  * the string. Meaning that the count is double the number of wide
     154 * the string. Meaning that the count is double the number of wide 
    155155 * characters in the string.
    156156 */
     
    214214#ifndef __WIN32OS2__
    215215/******************************************************************************
    216  *      SysReAllocStringLen16   [OLE2DISP.5]
     216 *              SysReAllocStringLen16   [OLE2DISP.5]
    217217 */
    218218int WINAPI SysReAllocStringLen16(BSTR16 *old,const char *in,int len)
    219219{
    220     BSTR16 new=SysAllocStringLen16(in,len);
    221     BSTR_Free(*old);
    222     *old=new;
     220        BSTR16 new=SysAllocStringLen16(in,len);
     221        BSTR_Free(*old);
     222        *old=new;
     223        return 1;
     224}
     225#endif
     226
     227 
     228/******************************************************************************
     229 *             SysReAllocStringLen   [OLEAUT32.5]
     230 */
     231int WINAPI SysReAllocStringLen(BSTR* old, const OLECHAR* in, unsigned int len)
     232{
     233    /*
     234     * Sanity check
     235     */
     236    if (old==NULL)
     237      return 0;
     238
     239    /*
     240     * Make sure we free the old string.
     241     */
     242    if (*old!=NULL)     
     243      SysFreeString(*old);
     244
     245    /*
     246     * Allocate the new string
     247     */
     248    *old = SysAllocStringLen(in, len);
     249
    223250    return 1;
    224251}
    225 #endif
    226 
    227 
    228 /******************************************************************************
    229  *             SysReAllocStringLen   [OLEAUT32.5]
    230  */
    231 int WINAPI SysReAllocStringLen(BSTR* old, const OLECHAR* in, unsigned int len)
    232 {
    233     /*
    234      * Sanity check
    235      */
    236     if (old==NULL)
    237       return 0;
    238 
    239     /*
    240      * Make sure we free the old string.
    241      */
    242     if (*old!=NULL)
    243       SysFreeString(*old);
    244 
    245     /*
    246      * Allocate the new string
    247      */
    248     *old = SysAllocStringLen(in, len);
    249 
    250     return 1;
    251 }
    252 
    253 #ifndef __WIN32OS2__
    254 /******************************************************************************
    255  *      SysFreeString16 [OLE2DISP.6]
     252
     253#ifndef __WIN32OS2__
     254/******************************************************************************
     255 *              SysFreeString16 [OLE2DISP.6]
    256256 */
    257257void WINAPI SysFreeString16(BSTR16 in)
    258258{
    259     BSTR_Free(in);
    260 }
    261 #endif
    262 
    263 /******************************************************************************
    264  *      SysFreeString   [OLEAUT32.6]
     259        BSTR_Free(in);
     260}
     261#endif
     262
     263/******************************************************************************
     264 *              SysFreeString   [OLEAUT32.6]
    265265 */
    266266void WINAPI SysFreeString(BSTR in)
    267267{
    268268    DWORD* bufferPointer;
    269 
     269   
    270270    /* NULL is a valid parameter */
    271271    if(!in) return;
     
    288288#ifndef __WIN32OS2__
    289289/******************************************************************************
    290  *      SysStringLen16  [OLE2DISP.7]
     290 *              SysStringLen16  [OLE2DISP.7]
    291291 */
    292292int WINAPI SysStringLen16(BSTR16 str)
    293293{
    294     return strlen(BSTR_GetAddr(str));
     294        return strlen(BSTR_GetAddr(str));
    295295}
    296296#endif
     
    310310     if (!str) return 0;
    311311    /*
    312      * The length of the string (in bytes) is contained in a DWORD placed
     312     * The length of the string (in bytes) is contained in a DWORD placed 
    313313     * just before the BSTR pointer
    314314     */
     
    334334     if (!str) return 0;
    335335    /*
    336      * The length of the string (in bytes) is contained in a DWORD placed
     336     * The length of the string (in bytes) is contained in a DWORD placed 
    337337     * just before the BSTR pointer
    338338     */
     
    349349 */
    350350HRESULT WINAPI CreateDispTypeInfo16(
    351     INTERFACEDATA *pidata,
    352     LCID lcid,
    353     ITypeInfo **pptinfo)
    354 {
    355     FIXME("(%p,%ld,%p),stub\n",pidata,lcid,pptinfo);
    356     return 0;
     351        INTERFACEDATA *pidata,
     352        LCID lcid,
     353        ITypeInfo **pptinfo)
     354{
     355        FIXME("(%p,%ld,%p),stub\n",pidata,lcid,pptinfo);
     356        return 0;
    357357}
    358358#endif
     
    362362 */
    363363HRESULT WINAPI CreateDispTypeInfo(
    364     INTERFACEDATA *pidata,
    365     LCID lcid,
    366     ITypeInfo **pptinfo)
    367 {
    368     FIXME("(%p,%ld,%p),stub\n",pidata,lcid,pptinfo);
    369     return 0;
     364        INTERFACEDATA *pidata,
     365        LCID lcid,
     366        ITypeInfo **pptinfo)
     367{
     368        FIXME("(%p,%ld,%p),stub\n",pidata,lcid,pptinfo);
     369        return 0;
    370370}
    371371
     
    377377        IUnknown* punkOuter,
    378378        void* pvThis,
    379     ITypeInfo* ptinfo,
    380     IUnknown** ppunkStdDisp)
    381 {
    382     FIXME("(%p,%p,%p,%p),stub\n",punkOuter, pvThis, ptinfo,
     379        ITypeInfo* ptinfo,
     380        IUnknown** ppunkStdDisp)
     381{
     382        FIXME("(%p,%p,%p,%p),stub\n",punkOuter, pvThis, ptinfo,
    383383               ppunkStdDisp);
    384     return 0;
     384        return 0;
    385385}
    386386#endif
     
    392392        IUnknown* punkOuter,
    393393        void* pvThis,
    394     ITypeInfo* ptinfo,
    395     IUnknown** ppunkStdDisp)
    396 {
    397     FIXME("(%p,%p,%p,%p),stub\n",punkOuter, pvThis, ptinfo,
     394        ITypeInfo* ptinfo,
     395        IUnknown** ppunkStdDisp)
     396{
     397        FIXME("(%p,%p,%p,%p),stub\n",punkOuter, pvThis, ptinfo,
    398398               ppunkStdDisp);
    399     return 0;
     399        return 0;
    400400}
    401401
     
    405405 */
    406406HRESULT WINAPI RegisterActiveObject16(
    407     IUnknown *punk, REFCLSID rclsid, DWORD dwFlags, unsigned long *pdwRegister
     407        IUnknown *punk, REFCLSID rclsid, DWORD dwFlags, unsigned long *pdwRegister
    408408) {
    409     FIXME("(%p,%s,0x%08lx,%p):stub\n",punk,debugstr_guid(rclsid),dwFlags,pdwRegister);
    410     return 0;
    411 }
    412 #endif
    413 
    414 /******************************************************************************
    415  *      OleTranslateColor   [OLEAUT32.421]
     409        FIXME("(%p,%s,0x%08lx,%p):stub\n",punk,debugstr_guid(rclsid),dwFlags,pdwRegister);
     410        return 0;
     411}
     412#endif
     413
     414/******************************************************************************
     415 *              OleTranslateColor       [OLEAUT32.421]
    416416 *
    417417 * Converts an OLE_COLOR to a COLORREF.
    418418 * See the documentation for conversion rules.
    419  * pColorRef can be NULL. In that case the user only wants to test the
     419 * pColorRef can be NULL. In that case the user only wants to test the 
    420420 * conversion.
    421421 */
Note: See TracChangeset for help on using the changeset viewer.