Ignore:
Timestamp:
Sep 17, 2000, 12:31:07 PM (25 years ago)
Author:
davidr
Message:

Updates from wine

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/ole32/filemoniker.cpp

    r3167 r4274  
    1 /* $Id: filemoniker.cpp,v 1.2 2000-03-19 15:33:06 davidr Exp $ */
     1/* $Id: filemoniker.cpp,v 1.3 2000-09-17 10:31:03 davidr Exp $ */
    22/*
    33 *  FileMonikers functions.
     
    1717#include "winnls.h"
    1818
    19 DEFAULT_DEBUG_CHANNEL(ole)
     19DEFAULT_DEBUG_CHANNEL(moniker)
    2020
    2121/********************************************************************************/
     
    6363/* IROTData prototype function */
    6464static HRESULT WINAPI FileMonikerROTDataImpl_GetComparaisonData(IROTData* iface,BYTE* pbData,ULONG cbMax,ULONG* pcbData);
    65 
    6665
    6766/********************************************************************************/
     
    347346    DWORD doubleLenHex;
    348347    int i=0;
    349     WCHAR temp = 0;
    350348
    351349
     
    421419 *        FileMoniker_GetSizeMax
    422420 ******************************************************************************/
    423 HRESULT WINAPI FileMonikerImpl_GetSizeMax(IMoniker* iface,
    424                                           ULARGE_INTEGER* pcbSize)/* Pointer to size of stream needed to save object */
     421HRESULT WINAPI FileMonikerImpl_GetSizeMax(IMoniker* iface,ULARGE_INTEGER* pcbSize)
    425422{
    426423    ICOM_THIS(FileMonikerImpl,iface);
    427     DWORD len=lstrlenW(This->filePathName);
    428     DWORD sizeMAx;
    429 
    430     TRACE("(%p,%p)\n",iface,pcbSize);
    431424
    432425    if (pcbSize==NULL)
    433426        return E_POINTER;
    434427
    435     /* for more details see FileMonikerImpl_Save coments */
    436    
    437     sizeMAx =  sizeof(WORD) +           /* first WORD is 0 */
    438                sizeof(DWORD)+           /* length of filePath including "\0" in the end of the string */
    439                (len+1)+                 /* filePath string */
    440                sizeof(DWORD)+           /* constant : 0xDEADFFFF */
    441                10*sizeof(WORD)+         /* 10 zero WORD */
    442                sizeof(DWORD);           /* size of the unicode filePath: "\0" not included */
    443 
    444     if(!This->bIsLongFileName)
    445     {
    446        
    447         sizeMAx += sizeof(DWORD)+           /* size of the unicode filePath: "\0" not included */
    448                    sizeof(WORD)+            /* constant : 0x3 */
    449                    len*sizeof(WCHAR);       /* unicde filePath string */
    450     }
    451    
    452     pcbSize->LowPart=sizeMAx;
    453     pcbSize->HighPart=0;
    454 
     428    /* GetSizeMax = SizeToSave + 2*len + 22 */
     429    FileMonikerImpl_GetSizeToSave(iface,pcbSize);
     430    pcbSize->LowPart += 2 * lstrlenW(This->filePathName) + 22;
     431    pcbSize->HighPart = 0;
     432
     433    TRACE("(iface:%p pcbSize:(LowPart:%ld - HighPart:0))\n",iface,pcbSize->LowPart);
    455434    return S_OK;
    456435}
     436
     437HRESULT FileMonikerImpl_GetSizeToSave(IMoniker* iface,ULARGE_INTEGER* pcbSize)
     438{
     439    ICOM_THIS(FileMonikerImpl,iface);
     440    DWORD len = lstrlenW(This->filePathName);
     441
     442    if (pcbSize==NULL)
     443        return E_POINTER;
     444
     445    pcbSize->LowPart = sizeof(WORD)      +  /* first WORD is 0 */
     446        sizeof(DWORD)     +  /* length of filePath including "\0" in the end of the string */
     447        len + 1           +  /* filePath string */
     448        sizeof(DWORD)     +  /* constant : 0xDEADFFFF */
     449        10 * sizeof(WORD) +  /* 10 zero WORD */
     450        sizeof(DWORD) +       /* size of the unicode filePath: "\0" not included */
     451        ((!This->bIsLongFileName) ?
     452         sizeof(DWORD)     +  /* size of the unicode filePath: "\0" not included */
     453         sizeof(WORD)      +  /* constant : 0x3 */
     454         len * sizeof(WCHAR) : 0); /* unicde filePath string */
     455    pcbSize->HighPart = 0;
     456
     457    return S_OK;
     458}
     459
    457460
    458461void WINAPI FileMonikerImpl_CheckFileFormat(FileMonikerImpl* This, LPCOLESTR lpszPathName)
     
    473476        return;
    474477    }
     478
    475479    len = lstrlenW(lpszPathName);
    476     if(len == 0)
    477     {
    478         return;
    479     }
    480 
    481480    if( len >= 2)
    482481    {
Note: See TracChangeset for help on using the changeset viewer.