winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
December 2009
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
3 participants
1233 discussions
Start a n
N
ew thread
Vincent Povirk : ole32: Store the parent of internal storage objects.
by Alexandre Julliard
09 Dec '09
09 Dec '09
Module: wine Branch: master Commit: 5b79c5a5e4b5409dfbf609572870898079f45767 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5b79c5a5e4b5409dfbf609572…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Mon Nov 30 17:02:52 2009 -0600 ole32: Store the parent of internal storage objects. --- dlls/ole32/storage32.c | 40 +++++++++++++++++++++++++++++----------- 1 files changed, 29 insertions(+), 11 deletions(-) diff --git a/dlls/ole32/storage32.c b/dlls/ole32/storage32.c index 9652077..c39915e 100644 --- a/dlls/ole32/storage32.c +++ b/dlls/ole32/storage32.c @@ -82,11 +82,13 @@ struct StorageInternalImpl * Entry in the parent's stream tracking list */ struct list ParentListEntry; + + StorageBaseImpl *parentStorage; }; typedef struct StorageInternalImpl StorageInternalImpl; /* Method definitions for the Storage32InternalImpl class. */ -static StorageInternalImpl* StorageInternalImpl_Construct(StorageImpl* ancestorStorage, +static StorageInternalImpl* StorageInternalImpl_Construct(StorageBaseImpl* parentStorage, DWORD openFlags, DirRef storageDirEntry); static void StorageImpl_Destroy(StorageBaseImpl* iface); static BOOL StorageImpl_ReadBigBlock(StorageImpl* This, ULONG blockIndex, void* buffer); @@ -585,7 +587,7 @@ static HRESULT WINAPI StorageBaseImpl_OpenStorage( } newStorage = StorageInternalImpl_Construct( - This->ancestorStorage, + This, grfMode, storageEntryRef); @@ -3842,49 +3844,63 @@ static void StorageInternalImpl_Destroy( StorageBaseImpl *iface) static HRESULT StorageInternalImpl_CreateDirEntry(StorageBaseImpl *base, const DirEntry *newData, DirRef *index) { - return StorageBaseImpl_CreateDirEntry(&base->ancestorStorage->base, + StorageInternalImpl* This = (StorageInternalImpl*) base; + + return StorageBaseImpl_CreateDirEntry(This->parentStorage, newData, index); } static HRESULT StorageInternalImpl_WriteDirEntry(StorageBaseImpl *base, DirRef index, const DirEntry *data) { - return StorageBaseImpl_WriteDirEntry(&base->ancestorStorage->base, + StorageInternalImpl* This = (StorageInternalImpl*) base; + + return StorageBaseImpl_WriteDirEntry(This->parentStorage, index, data); } static HRESULT StorageInternalImpl_ReadDirEntry(StorageBaseImpl *base, DirRef index, DirEntry *data) { - return StorageBaseImpl_ReadDirEntry(&base->ancestorStorage->base, + StorageInternalImpl* This = (StorageInternalImpl*) base; + + return StorageBaseImpl_ReadDirEntry(This->parentStorage, index, data); } static HRESULT StorageInternalImpl_DestroyDirEntry(StorageBaseImpl *base, DirRef index) { - return StorageBaseImpl_DestroyDirEntry(&base->ancestorStorage->base, + StorageInternalImpl* This = (StorageInternalImpl*) base; + + return StorageBaseImpl_DestroyDirEntry(This->parentStorage, index); } static HRESULT StorageInternalImpl_StreamReadAt(StorageBaseImpl *base, DirRef index, ULARGE_INTEGER offset, ULONG size, void *buffer, ULONG *bytesRead) { - return StorageBaseImpl_StreamReadAt(&base->ancestorStorage->base, + StorageInternalImpl* This = (StorageInternalImpl*) base; + + return StorageBaseImpl_StreamReadAt(This->parentStorage, index, offset, size, buffer, bytesRead); } static HRESULT StorageInternalImpl_StreamWriteAt(StorageBaseImpl *base, DirRef index, ULARGE_INTEGER offset, ULONG size, const void *buffer, ULONG *bytesWritten) { - return StorageBaseImpl_StreamWriteAt(&base->ancestorStorage->base, + StorageInternalImpl* This = (StorageInternalImpl*) base; + + return StorageBaseImpl_StreamWriteAt(This->parentStorage, index, offset, size, buffer, bytesWritten); } static HRESULT StorageInternalImpl_StreamSetSize(StorageBaseImpl *base, DirRef index, ULARGE_INTEGER newsize) { - return StorageBaseImpl_StreamSetSize(&base->ancestorStorage->base, + StorageInternalImpl* This = (StorageInternalImpl*) base; + + return StorageBaseImpl_StreamSetSize(This->parentStorage, index, newsize); } @@ -4345,7 +4361,7 @@ static const StorageBaseImplVtbl StorageInternalImpl_BaseVtbl = */ static StorageInternalImpl* StorageInternalImpl_Construct( - StorageImpl* ancestorStorage, + StorageBaseImpl* parentStorage, DWORD openFlags, DirRef storageDirEntry) { @@ -4369,7 +4385,9 @@ static StorageInternalImpl* StorageInternalImpl_Construct( /* * Keep the ancestor storage pointer but do not nail a reference to it. */ - newStorage->base.ancestorStorage = ancestorStorage; + newStorage->base.ancestorStorage = parentStorage->ancestorStorage; + + newStorage->parentStorage = parentStorage; /* * Keep a reference to the directory entry of this storage
1
0
0
0
Vincent Povirk : ole32: Don' t track the stream size in storage stream objects.
by Alexandre Julliard
09 Dec '09
09 Dec '09
Module: wine Branch: master Commit: 8518323e070377c07a3d421573dc3348e28008a4 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8518323e070377c07a3d42157…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Mon Nov 30 15:40:53 2009 -0600 ole32: Don't track the stream size in storage stream objects. We can't do this safely when there are multiple objects for a single stream. --- dlls/ole32/stg_stream.c | 128 ++--------------------------------------------- dlls/ole32/storage32.c | 14 ++++-- dlls/ole32/storage32.h | 16 +----- 3 files changed, 17 insertions(+), 141 deletions(-) diff --git a/dlls/ole32/stg_stream.c b/dlls/ole32/stg_stream.c index 00a61a2..bfecbc7 100644 --- a/dlls/ole32/stg_stream.c +++ b/dlls/ole32/stg_stream.c @@ -75,21 +75,6 @@ static void StgStreamImpl_Destroy(StgStreamImpl* This) This->parentStorage = 0; /* - * Make sure we clean-up the block chain stream objects that we were using. - */ - if (This->bigBlockChain != 0) - { - BlockChainStream_Destroy(This->bigBlockChain); - This->bigBlockChain = 0; - } - - if (This->smallBlockChain != 0) - { - SmallBlockChainStream_Destroy(This->smallBlockChain); - This->smallBlockChain = 0; - } - - /* * Finally, free the memory used-up by the class. */ HeapFree(GetProcessHeap(), 0, This); @@ -180,73 +165,6 @@ static ULONG WINAPI StgStreamImpl_Release( } /*** - * This method will open the block chain pointed by the directory entry - * that describes the stream. - * If the stream's size is null, no chain is opened. - */ -static void StgStreamImpl_OpenBlockChain( - StgStreamImpl* This) -{ - DirEntry currentEntry; - HRESULT hr; - - /* - * Make sure no old object is left over. - */ - if (This->smallBlockChain != 0) - { - SmallBlockChainStream_Destroy(This->smallBlockChain); - This->smallBlockChain = 0; - } - - if (This->bigBlockChain != 0) - { - BlockChainStream_Destroy(This->bigBlockChain); - This->bigBlockChain = 0; - } - - /* - * Read the information from the directory entry. - */ - hr = StorageBaseImpl_ReadDirEntry(This->parentStorage, - This->dirEntry, - ¤tEntry); - - if (SUCCEEDED(hr)) - { - This->streamSize = currentEntry.size; - - /* - * This code supports only streams that are <32 bits in size. - */ - assert(This->streamSize.u.HighPart == 0); - - if(currentEntry.startingBlock == BLOCK_END_OF_CHAIN) - { - assert( (This->streamSize.u.HighPart == 0) && (This->streamSize.u.LowPart == 0) ); - } - else - { - if ( (This->streamSize.u.HighPart == 0) && - (This->streamSize.u.LowPart < LIMIT_TO_USE_SMALL_BLOCK) ) - { - This->smallBlockChain = SmallBlockChainStream_Construct( - This->parentStorage->ancestorStorage, - NULL, - This->dirEntry); - } - else - { - This->bigBlockChain = BlockChainStream_Construct( - This->parentStorage->ancestorStorage, - NULL, - This->dirEntry); - } - } - } -} - -/*** * This method is part of the ISequentialStream interface. * * It reads a block of information from the stream at the current @@ -319,7 +237,6 @@ static HRESULT WINAPI StgStreamImpl_Write( { StgStreamImpl* const This=(StgStreamImpl*)iface; - ULARGE_INTEGER newSize; ULONG bytesWritten = 0; HRESULT res; @@ -365,22 +282,6 @@ static HRESULT WINAPI StgStreamImpl_Write( TRACE("<-- S_OK, written 0\n"); return S_OK; } - else - { - newSize.u.HighPart = 0; - newSize.u.LowPart = This->currentPosition.u.LowPart + cb; - } - - /* - * Verify if we need to grow the stream - */ - if (newSize.u.LowPart > This->streamSize.u.LowPart) - { - /* grow stream */ - res = IStream_SetSize(iface, newSize); - if (FAILED(res)) - return res; - } res = StorageBaseImpl_StreamWriteAt(This->parentStorage, This->dirEntry, @@ -415,6 +316,8 @@ static HRESULT WINAPI StgStreamImpl_Seek( StgStreamImpl* const This=(StgStreamImpl*)iface; ULARGE_INTEGER newPosition; + DirEntry currentEntry; + HRESULT hr; TRACE("(%p, %d, %d, %p)\n", iface, dlibMove.u.LowPart, dwOrigin, plibNewPosition); @@ -453,7 +356,9 @@ static HRESULT WINAPI StgStreamImpl_Seek( *plibNewPosition = This->currentPosition; break; case STREAM_SEEK_END: - *plibNewPosition = This->streamSize; + hr = StorageBaseImpl_ReadDirEntry(This->parentStorage, This->dirEntry, ¤tEntry); + if (FAILED(hr)) return hr; + *plibNewPosition = currentEntry.size; break; default: WARN("invalid dwOrigin %d\n", dwOrigin); @@ -511,16 +416,7 @@ static HRESULT WINAPI StgStreamImpl_SetSize( return STG_E_ACCESSDENIED; } - if (This->streamSize.u.LowPart == libNewSize.u.LowPart) - return S_OK; - hr = StorageBaseImpl_StreamSetSize(This->parentStorage, This->dirEntry, libNewSize); - - if (SUCCEEDED(hr)) - { - This->streamSize = libNewSize; - } - return hr; } @@ -853,20 +749,6 @@ StgStreamImpl* StgStreamImpl_Construct( newStream->currentPosition.u.HighPart = 0; newStream->currentPosition.u.LowPart = 0; - /* - * Initialize the rest of the data. - */ - newStream->streamSize.u.HighPart = 0; - newStream->streamSize.u.LowPart = 0; - newStream->bigBlockChain = 0; - newStream->smallBlockChain = 0; - - /* - * Read the size from the directory entry and determine if the blocks forming - * this stream are large or small. - */ - StgStreamImpl_OpenBlockChain(newStream); - /* add us to the storage's list of active streams */ StorageBaseImpl_AddStream(parentStorage, newStream); } diff --git a/dlls/ole32/storage32.c b/dlls/ole32/storage32.c index ec38adb..9652077 100644 --- a/dlls/ole32/storage32.c +++ b/dlls/ole32/storage32.c @@ -2339,16 +2339,22 @@ static HRESULT StorageImpl_StreamWriteAt(StorageBaseImpl *base, DirRef index, StorageImpl *This = (StorageImpl*)base; DirEntry data; HRESULT hr; + ULARGE_INTEGER newSize; hr = StorageImpl_ReadDirEntry(This, index, &data); if (FAILED(hr)) return hr; - /* FIXME: Enlarge the stream first if necessary. */ + /* Grow the stream if necessary */ + newSize.QuadPart = 0; + newSize.QuadPart = offset.QuadPart + size; - if (data.size.QuadPart == 0) + if (newSize.QuadPart > data.size.QuadPart) { - /* This shouldn't happen for now, because the stream object will set the size. */ - assert(FALSE); + hr = StorageImpl_StreamSetSize(base, index, newSize); + if (FAILED(hr)) + return hr; + + data.size = newSize; } if (data.size.QuadPart < LIMIT_TO_USE_SMALL_BLOCK) diff --git a/dlls/ole32/storage32.h b/dlls/ole32/storage32.h index 53cb76a..ba4288d 100644 --- a/dlls/ole32/storage32.h +++ b/dlls/ole32/storage32.h @@ -293,7 +293,8 @@ static inline HRESULT StorageBaseImpl_StreamReadAt(StorageBaseImpl *This, return This->baseVtbl->StreamReadAt(This, index, offset, size, buffer, bytesRead); } -/* Write size bytes to this directory entry's stream at the given offset. */ +/* Write size bytes to this directory entry's stream at the given offset, + * growing the stream if necessary. */ static inline HRESULT StorageBaseImpl_StreamWriteAt(StorageBaseImpl *This, DirRef index, ULARGE_INTEGER offset, ULONG size, const void *buffer, ULONG *bytesWritten) { @@ -431,22 +432,9 @@ struct StgStreamImpl DirRef dirEntry; /* - * Helper variable that contains the size of the stream - */ - ULARGE_INTEGER streamSize; - - /* * This is the current position of the cursor in the stream */ ULARGE_INTEGER currentPosition; - - /* - * The information in the stream is represented by a chain of small blocks - * or a chain of large blocks. Depending on the case, one of the two - * following variables points to that information. - */ - BlockChainStream* bigBlockChain; - SmallBlockChainStream* smallBlockChain; }; /*
1
0
0
0
Vincent Povirk : ole32: Use the storage vtable to resize streams.
by Alexandre Julliard
09 Dec '09
09 Dec '09
Module: wine Branch: master Commit: 6d06c43e53a1e0d266230f5ae92aad671ed63e2b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6d06c43e53a1e0d266230f5ae…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Mon Nov 30 15:05:41 2009 -0600 ole32: Use the storage vtable to resize streams. --- dlls/ole32/stg_stream.c | 89 +---------------------------------------- dlls/ole32/storage32.c | 100 ++++++++++++++++++++++++++++++++++++++++++++++- dlls/ole32/storage32.h | 7 +++ 3 files changed, 108 insertions(+), 88 deletions(-) diff --git a/dlls/ole32/stg_stream.c b/dlls/ole32/stg_stream.c index e02a3f5..00a61a2 100644 --- a/dlls/ole32/stg_stream.c +++ b/dlls/ole32/stg_stream.c @@ -483,7 +483,6 @@ static HRESULT WINAPI StgStreamImpl_SetSize( { StgStreamImpl* const This=(StgStreamImpl*)iface; - DirEntry currentEntry; HRESULT hr; TRACE("(%p, %d)\n", iface, libNewSize.u.LowPart); @@ -512,99 +511,17 @@ static HRESULT WINAPI StgStreamImpl_SetSize( return STG_E_ACCESSDENIED; } - /* In simple mode keep the stream size above the small block limit */ - if (This->parentStorage->openFlags & STGM_SIMPLE) - libNewSize.u.LowPart = max(libNewSize.u.LowPart, LIMIT_TO_USE_SMALL_BLOCK); - if (This->streamSize.u.LowPart == libNewSize.u.LowPart) return S_OK; - /* - * This will happen if we're creating a stream - */ - if ((This->smallBlockChain == 0) && (This->bigBlockChain == 0)) - { - if (libNewSize.u.LowPart < LIMIT_TO_USE_SMALL_BLOCK) - { - This->smallBlockChain = SmallBlockChainStream_Construct( - This->parentStorage->ancestorStorage, - NULL, - This->dirEntry); - } - else - { - This->bigBlockChain = BlockChainStream_Construct( - This->parentStorage->ancestorStorage, - NULL, - This->dirEntry); - } - } - - /* - * Read this stream's size to see if it's small blocks or big blocks - */ - StorageBaseImpl_ReadDirEntry(This->parentStorage, - This->dirEntry, - ¤tEntry); - /* - * Determine if we have to switch from small to big blocks or vice versa - */ - if ( (This->smallBlockChain!=0) && - (currentEntry.size.u.LowPart < LIMIT_TO_USE_SMALL_BLOCK) ) - { - if (libNewSize.u.LowPart >= LIMIT_TO_USE_SMALL_BLOCK) - { - /* - * Transform the small block chain into a big block chain - */ - This->bigBlockChain = Storage32Impl_SmallBlocksToBigBlocks( - This->parentStorage->ancestorStorage, - &This->smallBlockChain); - } - } - else if ( (This->bigBlockChain!=0) && - (currentEntry.size.u.LowPart >= LIMIT_TO_USE_SMALL_BLOCK) ) - { - if (libNewSize.u.LowPart < LIMIT_TO_USE_SMALL_BLOCK) - { - /* - * Transform the big block chain into a small block chain - */ - This->smallBlockChain = Storage32Impl_BigBlocksToSmallBlocks( - This->parentStorage->ancestorStorage, - &This->bigBlockChain); - } - } - - if (This->smallBlockChain!=0) - { - SmallBlockChainStream_SetSize(This->smallBlockChain, libNewSize); - } - else - { - BlockChainStream_SetSize(This->bigBlockChain, libNewSize); - } - - /* - * Write the new information about this stream to the directory entry - */ - hr = StorageBaseImpl_ReadDirEntry(This->parentStorage, - This->dirEntry, - ¤tEntry); - - currentEntry.size.u.HighPart = libNewSize.u.HighPart; - currentEntry.size.u.LowPart = libNewSize.u.LowPart; + hr = StorageBaseImpl_StreamSetSize(This->parentStorage, This->dirEntry, libNewSize); if (SUCCEEDED(hr)) { - StorageBaseImpl_WriteDirEntry(This->parentStorage, - This->dirEntry, - ¤tEntry); + This->streamSize = libNewSize; } - This->streamSize = libNewSize; - - return S_OK; + return hr; } /*** diff --git a/dlls/ole32/storage32.c b/dlls/ole32/storage32.c index f34dadd..ec38adb 100644 --- a/dlls/ole32/storage32.c +++ b/dlls/ole32/storage32.c @@ -2246,6 +2246,93 @@ static HRESULT StorageImpl_StreamReadAt(StorageBaseImpl *base, DirRef index, } } +static HRESULT StorageImpl_StreamSetSize(StorageBaseImpl *base, DirRef index, + ULARGE_INTEGER newsize) +{ + StorageImpl *This = (StorageImpl*)base; + DirEntry data; + HRESULT hr; + SmallBlockChainStream *smallblock=NULL; + BlockChainStream *bigblock=NULL; + + hr = StorageImpl_ReadDirEntry(This, index, &data); + if (FAILED(hr)) return hr; + + /* In simple mode keep the stream size above the small block limit */ + if (This->base.openFlags & STGM_SIMPLE) + newsize.QuadPart = max(newsize.QuadPart, LIMIT_TO_USE_SMALL_BLOCK); + + if (data.size.QuadPart == newsize.QuadPart) + return S_OK; + + /* Create a block chain object of the appropriate type */ + if (data.size.QuadPart == 0) + { + if (newsize.QuadPart < LIMIT_TO_USE_SMALL_BLOCK) + { + smallblock = SmallBlockChainStream_Construct(This, NULL, index); + if (!smallblock) return E_OUTOFMEMORY; + } + else + { + bigblock = BlockChainStream_Construct(This, NULL, index); + if (!bigblock) return E_OUTOFMEMORY; + } + } + else if (data.size.QuadPart < LIMIT_TO_USE_SMALL_BLOCK) + { + smallblock = SmallBlockChainStream_Construct(This, NULL, index); + if (!smallblock) return E_OUTOFMEMORY; + } + else + { + bigblock = BlockChainStream_Construct(This, NULL, index); + if (!bigblock) return E_OUTOFMEMORY; + } + + /* Change the block chain type if necessary. */ + if (smallblock && newsize.QuadPart >= LIMIT_TO_USE_SMALL_BLOCK) + { + bigblock = Storage32Impl_SmallBlocksToBigBlocks(This, &smallblock); + if (!bigblock) + { + SmallBlockChainStream_Destroy(smallblock); + return E_FAIL; + } + } + else if (bigblock && newsize.QuadPart < LIMIT_TO_USE_SMALL_BLOCK) + { + smallblock = Storage32Impl_BigBlocksToSmallBlocks(This, &bigblock); + if (!smallblock) + { + BlockChainStream_Destroy(bigblock); + return E_FAIL; + } + } + + /* Set the size of the block chain. */ + if (smallblock) + { + SmallBlockChainStream_SetSize(smallblock, newsize); + SmallBlockChainStream_Destroy(smallblock); + } + else + { + BlockChainStream_SetSize(bigblock, newsize); + BlockChainStream_Destroy(bigblock); + } + + /* Set the size in the directory entry. */ + hr = StorageImpl_ReadDirEntry(This, index, &data); + if (SUCCEEDED(hr)) + { + data.size = newsize; + + hr = StorageImpl_WriteDirEntry(This, index, &data); + } + return hr; +} + static HRESULT StorageImpl_StreamWriteAt(StorageBaseImpl *base, DirRef index, ULARGE_INTEGER offset, ULONG size, const void *buffer, ULONG *bytesWritten) { @@ -2325,7 +2412,8 @@ static const StorageBaseImplVtbl StorageImpl_BaseVtbl = StorageImpl_BaseReadDirEntry, StorageImpl_DestroyDirEntry, StorageImpl_StreamReadAt, - StorageImpl_StreamWriteAt + StorageImpl_StreamWriteAt, + StorageImpl_StreamSetSize }; static HRESULT StorageImpl_Construct( @@ -3787,6 +3875,13 @@ static HRESULT StorageInternalImpl_StreamWriteAt(StorageBaseImpl *base, index, offset, size, buffer, bytesWritten); } +static HRESULT StorageInternalImpl_StreamSetSize(StorageBaseImpl *base, + DirRef index, ULARGE_INTEGER newsize) +{ + return StorageBaseImpl_StreamSetSize(&base->ancestorStorage->base, + index, newsize); +} + /****************************************************************************** ** ** Storage32InternalImpl_Commit @@ -4235,7 +4330,8 @@ static const StorageBaseImplVtbl StorageInternalImpl_BaseVtbl = StorageInternalImpl_ReadDirEntry, StorageInternalImpl_DestroyDirEntry, StorageInternalImpl_StreamReadAt, - StorageInternalImpl_StreamWriteAt + StorageInternalImpl_StreamWriteAt, + StorageInternalImpl_StreamSetSize }; /****************************************************************************** diff --git a/dlls/ole32/storage32.h b/dlls/ole32/storage32.h index ef8c894..53cb76a 100644 --- a/dlls/ole32/storage32.h +++ b/dlls/ole32/storage32.h @@ -254,6 +254,7 @@ struct StorageBaseImplVtbl { HRESULT (*DestroyDirEntry)(StorageBaseImpl*,DirRef); HRESULT (*StreamReadAt)(StorageBaseImpl*,DirRef,ULARGE_INTEGER,ULONG,void*,ULONG*); HRESULT (*StreamWriteAt)(StorageBaseImpl*,DirRef,ULARGE_INTEGER,ULONG,const void*,ULONG*); + HRESULT (*StreamSetSize)(StorageBaseImpl*,DirRef,ULARGE_INTEGER); }; static inline void StorageBaseImpl_Destroy(StorageBaseImpl *This) @@ -299,6 +300,12 @@ static inline HRESULT StorageBaseImpl_StreamWriteAt(StorageBaseImpl *This, return This->baseVtbl->StreamWriteAt(This, index, offset, size, buffer, bytesWritten); } +static inline HRESULT StorageBaseImpl_StreamSetSize(StorageBaseImpl *This, + DirRef index, ULARGE_INTEGER newsize) +{ + return This->baseVtbl->StreamSetSize(This, index, newsize); +} + /**************************************************************************** * StorageBaseImpl stream list handlers */
1
0
0
0
Vincent Povirk : ole32: Use the storage vtable to write to streams.
by Alexandre Julliard
09 Dec '09
09 Dec '09
Module: wine Branch: master Commit: 1d4c698ef38ed35297968cafd5573a4f137335ab URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1d4c698ef38ed35297968cafd…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Mon Nov 30 11:38:45 2009 -0600 ole32: Use the storage vtable to write to streams. --- dlls/ole32/stg_stream.c | 34 ++++---------------------- dlls/ole32/storage32.c | 59 +++++++++++++++++++++++++++++++++++++++++++++- dlls/ole32/storage32.h | 8 ++++++ 3 files changed, 71 insertions(+), 30 deletions(-) diff --git a/dlls/ole32/stg_stream.c b/dlls/ole32/stg_stream.c index 0888180..e02a3f5 100644 --- a/dlls/ole32/stg_stream.c +++ b/dlls/ole32/stg_stream.c @@ -382,34 +382,12 @@ static HRESULT WINAPI StgStreamImpl_Write( return res; } - /* - * Depending on the type of chain that was opened when the stream was constructed, - * we delegate the work to the method that readwrites to the block chains. - */ - if (This->smallBlockChain!=0) - { - res = SmallBlockChainStream_WriteAt(This->smallBlockChain, - This->currentPosition, - cb, - pv, - pcbWritten); - - } - else if (This->bigBlockChain!=0) - { - res = BlockChainStream_WriteAt(This->bigBlockChain, - This->currentPosition, - cb, - pv, - pcbWritten); - } - else - { - /* this should never happen because the IStream_SetSize call above will - * make sure a big or small block chain is created */ - assert(FALSE); - res = 0; - } + res = StorageBaseImpl_StreamWriteAt(This->parentStorage, + This->dirEntry, + This->currentPosition, + cb, + pv, + pcbWritten); /* * Advance the position pointer for the number of positions written. diff --git a/dlls/ole32/storage32.c b/dlls/ole32/storage32.c index 0e5861d..f34dadd 100644 --- a/dlls/ole32/storage32.c +++ b/dlls/ole32/storage32.c @@ -2246,6 +2246,52 @@ static HRESULT StorageImpl_StreamReadAt(StorageBaseImpl *base, DirRef index, } } +static HRESULT StorageImpl_StreamWriteAt(StorageBaseImpl *base, DirRef index, + ULARGE_INTEGER offset, ULONG size, const void *buffer, ULONG *bytesWritten) +{ + StorageImpl *This = (StorageImpl*)base; + DirEntry data; + HRESULT hr; + + hr = StorageImpl_ReadDirEntry(This, index, &data); + if (FAILED(hr)) return hr; + + /* FIXME: Enlarge the stream first if necessary. */ + + if (data.size.QuadPart == 0) + { + /* This shouldn't happen for now, because the stream object will set the size. */ + assert(FALSE); + } + + if (data.size.QuadPart < LIMIT_TO_USE_SMALL_BLOCK) + { + SmallBlockChainStream *stream; + + stream = SmallBlockChainStream_Construct(This, NULL, index); + if (!stream) return E_OUTOFMEMORY; + + hr = SmallBlockChainStream_WriteAt(stream, offset, size, buffer, bytesWritten); + + SmallBlockChainStream_Destroy(stream); + + return hr; + } + else + { + BlockChainStream *stream; + + stream = BlockChainStream_Construct(This, NULL, index); + if (!stream) return E_OUTOFMEMORY; + + hr = BlockChainStream_WriteAt(stream, offset, size, buffer, bytesWritten); + + BlockChainStream_Destroy(stream); + + return hr; + } +} + /* * Virtual function table for the IStorage32Impl class. */ @@ -2278,7 +2324,8 @@ static const StorageBaseImplVtbl StorageImpl_BaseVtbl = StorageImpl_BaseWriteDirEntry, StorageImpl_BaseReadDirEntry, StorageImpl_DestroyDirEntry, - StorageImpl_StreamReadAt + StorageImpl_StreamReadAt, + StorageImpl_StreamWriteAt }; static HRESULT StorageImpl_Construct( @@ -3733,6 +3780,13 @@ static HRESULT StorageInternalImpl_StreamReadAt(StorageBaseImpl *base, index, offset, size, buffer, bytesRead); } +static HRESULT StorageInternalImpl_StreamWriteAt(StorageBaseImpl *base, + DirRef index, ULARGE_INTEGER offset, ULONG size, const void *buffer, ULONG *bytesWritten) +{ + return StorageBaseImpl_StreamWriteAt(&base->ancestorStorage->base, + index, offset, size, buffer, bytesWritten); +} + /****************************************************************************** ** ** Storage32InternalImpl_Commit @@ -4180,7 +4234,8 @@ static const StorageBaseImplVtbl StorageInternalImpl_BaseVtbl = StorageInternalImpl_WriteDirEntry, StorageInternalImpl_ReadDirEntry, StorageInternalImpl_DestroyDirEntry, - StorageInternalImpl_StreamReadAt + StorageInternalImpl_StreamReadAt, + StorageInternalImpl_StreamWriteAt }; /****************************************************************************** diff --git a/dlls/ole32/storage32.h b/dlls/ole32/storage32.h index 24070d1..ef8c894 100644 --- a/dlls/ole32/storage32.h +++ b/dlls/ole32/storage32.h @@ -253,6 +253,7 @@ struct StorageBaseImplVtbl { HRESULT (*ReadDirEntry)(StorageBaseImpl*,DirRef,DirEntry*); HRESULT (*DestroyDirEntry)(StorageBaseImpl*,DirRef); HRESULT (*StreamReadAt)(StorageBaseImpl*,DirRef,ULARGE_INTEGER,ULONG,void*,ULONG*); + HRESULT (*StreamWriteAt)(StorageBaseImpl*,DirRef,ULARGE_INTEGER,ULONG,const void*,ULONG*); }; static inline void StorageBaseImpl_Destroy(StorageBaseImpl *This) @@ -291,6 +292,13 @@ static inline HRESULT StorageBaseImpl_StreamReadAt(StorageBaseImpl *This, return This->baseVtbl->StreamReadAt(This, index, offset, size, buffer, bytesRead); } +/* Write size bytes to this directory entry's stream at the given offset. */ +static inline HRESULT StorageBaseImpl_StreamWriteAt(StorageBaseImpl *This, + DirRef index, ULARGE_INTEGER offset, ULONG size, const void *buffer, ULONG *bytesWritten) +{ + return This->baseVtbl->StreamWriteAt(This, index, offset, size, buffer, bytesWritten); +} + /**************************************************************************** * StorageBaseImpl stream list handlers */
1
0
0
0
Juan Lang : rsaenh/tests: Fix memory leak.
by Alexandre Julliard
09 Dec '09
09 Dec '09
Module: wine Branch: master Commit: 71b4ac9c71dfa7736a7e7cff09d5899c209fd7fe URL:
http://source.winehq.org/git/wine.git/?a=commit;h=71b4ac9c71dfa7736a7e7cff0…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Tue Dec 8 11:40:37 2009 -0800 rsaenh/tests: Fix memory leak. --- dlls/rsaenh/tests/rsaenh.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/dlls/rsaenh/tests/rsaenh.c b/dlls/rsaenh/tests/rsaenh.c index 2c7ca0e..83ec872 100644 --- a/dlls/rsaenh/tests/rsaenh.c +++ b/dlls/rsaenh/tests/rsaenh.c @@ -2355,9 +2355,9 @@ static void test_null_provider(void) CryptDestroyKey(key); result = CryptGetUserKey(prov, AT_KEYEXCHANGE, &key); ok(result, "CryptGetUserKey with AT_KEYEXCHANGE failed: %08x\n", GetLastError()); + CryptDestroyKey(key); result = CryptGetUserKey(prov, AT_SIGNATURE, &key); ok(!result, "expected CryptGetUserKey to fail\n"); - CryptDestroyKey(key); CryptReleaseContext(prov, 0); CryptAcquireContext(&prov, szContainer, NULL, PROV_RSA_FULL,
1
0
0
0
Juan Lang : crypt32: Compare CRL' s authority key identifier against the certificate' s subject key identifier property, which also decodes the certificate' s extension if necessary.
by Alexandre Julliard
09 Dec '09
09 Dec '09
Module: wine Branch: master Commit: 4df042b54bae0159a5b8216b4bb2a59dfc561dec URL:
http://source.winehq.org/git/wine.git/?a=commit;h=4df042b54bae0159a5b8216b4…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Tue Dec 8 10:18:27 2009 -0800 crypt32: Compare CRL's authority key identifier against the certificate's subject key identifier property, which also decodes the certificate's extension if necessary. --- dlls/crypt32/crl.c | 21 ++++++++++++++------- 1 files changed, 14 insertions(+), 7 deletions(-) diff --git a/dlls/crypt32/crl.c b/dlls/crypt32/crl.c index a24e6ad..72180c5 100644 --- a/dlls/crypt32/crl.c +++ b/dlls/crypt32/crl.c @@ -167,14 +167,21 @@ static BOOL compare_crl_issued_by(PCCRL_CONTEXT pCrlContext, DWORD dwType, } else if (info->KeyId.cbData) { - if ((ext = CertFindExtension( - szOID_SUBJECT_KEY_IDENTIFIER, - issuer->pCertInfo->cExtension, - issuer->pCertInfo->rgExtension))) + DWORD size; + + ret = CertGetCertificateContextProperty(issuer, + CERT_KEY_IDENTIFIER_PROP_ID, NULL, &size); + if (ret && size == info->KeyId.cbData) { - if (info->KeyId.cbData == ext->Value.cbData) - ret = !memcmp(info->KeyId.pbData, - ext->Value.pbData, info->KeyId.cbData); + LPBYTE buf = CryptMemAlloc(size); + + if (buf) + { + CertGetCertificateContextProperty(issuer, + CERT_KEY_IDENTIFIER_PROP_ID, buf, &size); + ret = !memcmp(buf, info->KeyId.pbData, size); + CryptMemFree(buf); + } else ret = FALSE; }
1
0
0
0
Juan Lang : winhttp: Fix test error when run as non-administrator.
by Alexandre Julliard
09 Dec '09
09 Dec '09
Module: wine Branch: master Commit: 1becda464de4a12e66cfc4128fffd6de9044cb0c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1becda464de4a12e66cfc4128…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Tue Dec 8 09:47:08 2009 -0800 winhttp: Fix test error when run as non-administrator. --- dlls/winhttp/tests/winhttp.c | 13 ++++++++++--- 1 files changed, 10 insertions(+), 3 deletions(-) diff --git a/dlls/winhttp/tests/winhttp.c b/dlls/winhttp/tests/winhttp.c index fe9bb05..2810fbb 100644 --- a/dlls/winhttp/tests/winhttp.c +++ b/dlls/winhttp/tests/winhttp.c @@ -1000,9 +1000,16 @@ static void test_set_default_proxy_config(void) info.lpszProxy = normalString; SetLastError(0xdeadbeef); ret = WinHttpSetDefaultProxyConfiguration(&info); - ok(ret, "WinHttpSetDefaultProxyConfiguration failed: %d\n", GetLastError()); - - set_default_proxy_reg_value( saved_proxy_settings, len, type ); + if (ret) + { + ok(ret, "always true\n"); + set_default_proxy_reg_value( saved_proxy_settings, len, type ); + } + else if (GetLastError() == ERROR_ACCESS_DENIED) + skip("couldn't set default proxy configuration: access denied\n"); + else + ok(ret, "WinHttpSetDefaultProxyConfiguration failed: %d\n", + GetLastError()); } START_TEST (winhttp)
1
0
0
0
Juan Lang : wininet: Fix an apparent typo.
by Alexandre Julliard
09 Dec '09
09 Dec '09
Module: wine Branch: master Commit: 66b4ad208d4bcce2623c4aeeb22ff0e1e4d0856d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=66b4ad208d4bcce2623c4aeeb…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Fri Dec 4 14:39:37 2009 -0800 wininet: Fix an apparent typo. --- dlls/wininet/http.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c index 1f7dcfd..b75986f 100644 --- a/dlls/wininet/http.c +++ b/dlls/wininet/http.c @@ -2953,7 +2953,7 @@ BOOL WINAPI HttpQueryInfoW(HINTERNET hHttpRequest, DWORD dwInfoLevel, DWORD info = dwInfoLevel & HTTP_QUERY_HEADER_MASK; DWORD i; - TRACE("(%p, 0x%08x)--> %d\n", hHttpRequest, dwInfoLevel, dwInfoLevel); + TRACE("(%p, 0x%08x)--> %d\n", hHttpRequest, dwInfoLevel, info); TRACE(" Attribute:"); for (i = 0; i < (sizeof(query_flags) / sizeof(query_flags[0])); i++) { if (query_flags[i].val == info) {
1
0
0
0
Juan Lang : wininet: Trace more parameters to HTTP_GetCustomHeaderIndex.
by Alexandre Julliard
09 Dec '09
09 Dec '09
Module: wine Branch: master Commit: 3cd54553f313b090af21be6315dabd8a862438e7 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3cd54553f313b090af21be631…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Fri Dec 4 14:37:46 2009 -0800 wininet: Trace more parameters to HTTP_GetCustomHeaderIndex. --- dlls/wininet/http.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c index 6123c5f..1f7dcfd 100644 --- a/dlls/wininet/http.c +++ b/dlls/wininet/http.c @@ -4797,7 +4797,7 @@ static INT HTTP_GetCustomHeaderIndex(http_request_t *lpwhr, LPCWSTR lpszField, { DWORD index; - TRACE("%s\n", debugstr_w(lpszField)); + TRACE("%s, %d, %d\n", debugstr_w(lpszField), requested_index, request_only); for (index = 0; index < lpwhr->nCustHeaders; index++) {
1
0
0
0
Andrew Eikum : mshtml: Implement IHTMLFrameBase::get_name.
by Alexandre Julliard
08 Dec '09
08 Dec '09
Module: wine Branch: master Commit: 578881f600e20fbef51df2fdebc5ea641de6f24f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=578881f600e20fbef51df2fde…
Author: Andrew Eikum <aeikum(a)codeweavers.com> Date: Mon Dec 7 16:28:12 2009 -0600 mshtml: Implement IHTMLFrameBase::get_name. --- dlls/mshtml/htmlframebase.c | 38 ++++++++++++++++++++++++++++++++++++-- dlls/mshtml/tests/dom.c | 34 +++++++++++++++++++++++++++------- 2 files changed, 63 insertions(+), 9 deletions(-) diff --git a/dlls/mshtml/htmlframebase.c b/dlls/mshtml/htmlframebase.c index 47aa9fb..7174298 100644 --- a/dlls/mshtml/htmlframebase.c +++ b/dlls/mshtml/htmlframebase.c @@ -149,8 +149,42 @@ static HRESULT WINAPI HTMLFrameBase_put_name(IHTMLFrameBase *iface, BSTR v) static HRESULT WINAPI HTMLFrameBase_get_name(IHTMLFrameBase *iface, BSTR *p) { HTMLFrameBase *This = HTMLFRAMEBASE_THIS(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; + nsAString nsstr; + const PRUnichar *strdata; + nsresult nsres; + + TRACE("(%p)->(%p)\n", This, p); + + if(This->nsframe) { + nsAString_Init(&nsstr, NULL); + nsres = nsIDOMHTMLFrameElement_GetName(This->nsframe, &nsstr); + }else if(This->nsiframe) { + nsAString_Init(&nsstr, NULL); + nsres = nsIDOMHTMLIFrameElement_GetName(This->nsiframe, &nsstr); + }else { + ERR("No attached ns frame object\n"); + return E_UNEXPECTED; + } + + if(NS_FAILED(nsres)) { + ERR("GetName failed: 0x%08x\n", nsres); + nsAString_Finish(&nsstr); + return E_FAIL; + } + + nsAString_GetData(&nsstr, &strdata); + if(*strdata) { + *p = SysAllocString(strdata); + if(!*p) { + nsAString_Finish(&nsstr); + return E_OUTOFMEMORY; + } + }else + *p = NULL; + + nsAString_Finish(&nsstr); + + return S_OK; } static HRESULT WINAPI HTMLFrameBase_put_border(IHTMLFrameBase *iface, VARIANT v) diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c index 0ede169..1c970c8 100644 --- a/dlls/mshtml/tests/dom.c +++ b/dlls/mshtml/tests/dom.c @@ -65,8 +65,9 @@ static const char cond_comment_str[] = "<!--[if gte IE 4]> <br> <![endif]-->" "</body></html>"; static const char frameset_str[] = - "<html><head><title>frameset test</title></head><frameset rows=\"28, *\">" + "<html><head><title>frameset test</title></head><frameset rows=\"25, 25, *\">" "<frame src=\"about:blank\" name=\"nm1\" id=\"fr1\"><frame src=\"about:blank\" name=\"nm2\" id=\"fr2\">" + "<frame src=\"about:blank\" id=\"fr3\">" "</frameset></html>"; static WCHAR characterW[] = {'c','h','a','r','a','c','t','e','r',0}; @@ -5918,7 +5919,7 @@ static void test_frameset(IHTMLDocument2 *doc) /* test result length */ hres = IHTMLFramesCollection2_get_length(frames, &length); ok(hres == S_OK, "IHTMLFramesCollection2_get_length failed: 0x%08x\n", hres); - ok(length == 2, "IHTMLFramesCollection2_get_length should have been 2, was: %d\n", length); + ok(length == 3, "IHTMLFramesCollection2_get_length should have been 3, was: %d\n", length); /* test first frame */ V_VT(&index_var) = VT_I4; @@ -5941,8 +5942,8 @@ static void test_frameset(IHTMLDocument2 *doc) } VariantClear(&result_var); - /* fail on third frame */ - V_I4(&index_var) = 2; + /* fail on next frame */ + V_I4(&index_var) = 3; hres = IHTMLFramesCollection2_item(frames, &index_var, &result_var); ok(hres == DISP_E_MEMBERNOTFOUND, "IHTMLFramesCollection2_item should have" "failed with DISP_E_MEMBERNOTFOUND, instead: 0x%08x\n", hres); @@ -5975,7 +5976,7 @@ static void test_frameset(IHTMLDocument2 *doc) /* test result length */ hres = IHTMLWindow2_get_length(window, &length); ok(hres == S_OK, "IHTMLWindow2_get_length failed: 0x%08x\n", hres); - ok(length == 2, "IHTMLWindow2_get_length should have been 2, was: %d\n", length); + ok(length == 3, "IHTMLWindow2_get_length should have been 3, was: %d\n", length); /* test first frame */ V_VT(&index_var) = VT_I4; @@ -5998,8 +5999,8 @@ static void test_frameset(IHTMLDocument2 *doc) } VariantClear(&result_var); - /* fail on third frame */ - V_I4(&index_var) = 2; + /* fail on next frame */ + V_I4(&index_var) = 3; hres = IHTMLWindow2_item(window, &index_var, &result_var); ok(hres == DISP_E_MEMBERNOTFOUND, "IHTMLWindow2_item should have" "failed with DISP_E_MEMBERNOTFOUND, instead: 0x%08x\n", hres); @@ -6059,6 +6060,25 @@ static void test_frameset(IHTMLDocument2 *doc) ok(!strcmp_wa(str, "no"), "get_scrolling should have given 'no', gave: %s\n", wine_dbgstr_w(str)); SysFreeString(str); + /* get_name */ + hres = IHTMLFrameBase_get_name(fbase, &str); + ok(hres == S_OK, "IHTMLFrameBase_get_name failed: 0x%08x\n", hres); + ok(!strcmp_wa(str, "nm1"), "get_name should have given 'nm1', gave: %s\n", wine_dbgstr_w(str)); + SysFreeString(str); + + IHTMLFrameBase_Release(fbase); + IHTMLElement_Release(elem); + + /* get_name with no name attr */ + elem = get_doc_elem_by_id(doc, "fr3"); + hres = IHTMLElement_QueryInterface(elem, &IID_IHTMLFrameBase, (void**)&fbase); + ok(hres == S_OK, "Could not get IHTMLFrameBase interface: 0x%08x\n", hres); + + hres = IHTMLFrameBase_get_name(fbase, &str); + ok(hres == S_OK, "IHTMLFrameBase_get_name failed: 0x%08x\n", hres); + ok(str == NULL, "get_name should have given 'null', gave: %s\n", wine_dbgstr_w(str)); + SysFreeString(str); + IHTMLFrameBase_Release(fbase); IHTMLElement_Release(elem); }
1
0
0
0
← Newer
1
...
83
84
85
86
87
88
89
...
124
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
Results per page:
10
25
50
100
200