Commit Graph

361 Commits

Author SHA1 Message Date
Frédéric Delanoy 37abf45e6c ole32: Use BOOL type where appropriate. 2013-11-20 11:25:55 +01:00
Frédéric Delanoy 4bb61ec0df ole32: Use BOOL type where appropriate. 2013-10-15 14:28:20 +02:00
Aric Stewart df6115aea6 ole32: Do not fail if partial blocks are read. 2013-06-17 19:30:49 +02:00
Aric Stewart b69d67f146 ole32: Not all uses of StorageImpl_ReadBigBlock fail if no bytes are read. 2013-06-12 15:51:07 +02:00
Nikolay Sivov 448a44ca5f ole32: Simplify IEnumSTATSTG initialization. 2013-04-19 16:16:18 +02:00
Nikolay Sivov 3b9568802a ole32: Remove some casts that are not needed. 2013-04-19 16:16:17 +02:00
Nikolay Sivov 5132f60298 ole32: Store SMWR storage instance role separately. 2013-04-19 16:16:17 +02:00
Nikolay Sivov a06db6cce5 ole32: Stub for IDirectWriterLock. 2013-04-18 17:00:17 +02:00
Nikolay Sivov c29f3dff8c ole32: Accept STGM_DIRECT_SWMR mode. 2013-04-18 17:00:12 +02:00
Andrew Talbot faaeeea937 ole32: Avoid signed-unsigned integer comparisons. 2013-02-22 10:20:57 +01:00
Hans Leidekker 7895eae15b ole32: Convert the remaining RegCreateKey and RegOpenKey calls to the wrappers. 2012-11-26 16:59:22 +01:00
Frédéric Delanoy 3cdd1abd09 ole32: Avoid erroneously freeing a variable in ReadFmtUserTypeStg. 2012-11-12 12:14:48 +01:00
Frédéric Delanoy 780228b6ca ole32: Fix some leaks (coverity). 2012-11-09 11:56:18 +01:00
André Hentschel fbe682a22a ole32: Don't leak memory allocated by ProgIDFromCLSID (coverity). 2012-10-29 10:40:32 +01:00
Nikolay Sivov 53dd90aeb3 ole32: Give names to 1Ole stream header fields. 2012-07-18 11:14:18 +02:00
Nikolay Sivov 52ce30d242 ole32: Make ole stream creation helper capable of handling flags data. 2012-07-17 12:50:19 +02:00
Nikolay Sivov 88e6c8175b ole32: Use interface macros to call methods. 2012-07-17 12:50:18 +02:00
Nikolay Sivov 3956296128 ole32: Implement SetConvertStg(). 2012-07-16 15:21:45 +02:00
Nikolay Sivov a3a97558de ole32: No need to test for null implementation pointer in methods. 2012-07-16 15:21:44 +02:00
Nikolay Sivov ac032593c0 ole32: COM cleanup of IPropertySetStorage interface. 2012-07-16 15:21:44 +02:00
Nikolay Sivov 0c658860b1 ole32: COM cleanup for IStorage interface of base storage implementation. 2012-07-13 10:29:13 -05:00
Nikolay Sivov 08303391e9 ole32: Simplify storage root entry name initialization. 2012-07-13 10:28:57 -05:00
Nikolay Sivov 7b373edb81 ole32: Implement GetConvertStg(). 2012-07-13 10:28:42 -05:00
Nikolay Sivov ea196ef0eb ole32: COM cleanup of storage IStream implementation. 2012-07-13 10:28:15 -05:00
Bruno Jesus 2cd2628c7b ole32: Make sure StgIsStorageILockBytes tests real data. 2012-04-16 17:49:30 +02:00
Andrew Talbot 85fc5a3ae9 ole32: Remove unneeded address-of operators from array names. 2011-10-31 23:54:07 +01:00
Vincent Povirk cb9e572611 ole32: Discard existing data when creating a new storage on an ILockBytes. 2011-09-13 09:20:29 +02:00
Vincent Povirk c72ecb1de6 ole32: Avoid opening source storage in IStorage::CopyTo. 2011-06-03 17:37:09 +02:00
Alexandre Julliard 7efe6d9895 ole32: Delete the transacted storage scratch file on release. 2011-05-26 13:27:41 +02:00
Michael Stefaniuc 4ff5c02098 ole32: COM cleanup for the IEnumSTATSTG iface. 2011-01-04 11:14:25 +01:00
David Hedberg 41193de135 ole32: Avoid unneccessary stream conversion.
Truncating a large stream to less than 0x1000 bytes would cause an
unnecessarily expensive conversion.
2010-11-23 13:17:06 +01:00
Andrew Bogott 42cd791c4d ole32: Use default values if options passed to StgCreateStorageEx are NULL. 2010-11-18 12:52:38 +01:00
Vincent Povirk e883aeb394 ole32: Cache the contents of one extended big block depot block. 2010-11-16 21:54:18 +01:00
Vincent Povirk 8d101b269d ole32: Cache all extended big block depot locations. 2010-11-04 11:55:48 +01:00
Vincent Povirk 2752c3bcd0 ole32: Don't fail if the file ends during a big block.
Apparently, it's valid for the last block in a file to be incomplete.
2010-09-08 13:30:46 +02:00
Vincent Povirk 89646084ba ole32: Cache data and block locations in BigBlockStream objects. 2010-08-26 13:59:31 +02:00
Vincent Povirk 101de22a1a ole32: Flush before returning from any storage API call that writes. 2010-08-26 13:59:28 +02:00
Vincent Povirk 5116b979b2 ole32: Flush the ILockBytes object of a storage on commit and final release.
Some ILockBytes objects will not really write changes until their Flush
method is called. Also, further optimizations to the storage implementation
will involve caching writes, which will have to be flushed at times.
2010-07-19 14:38:16 +02:00
Vincent Povirk b7dbfcbd48 ole32: Remove an unused variable. 2010-07-19 14:38:16 +02:00
Vincent Povirk d0e6e4aa82 ole32: Use ILockBytes_Stat to get the filename of a storage. 2010-07-19 14:38:16 +02:00
Vincent Povirk 14f8f9d5b5 ole32: Remove the BigBlockFile abstraction and always use an ILockBytes. 2010-07-19 14:38:16 +02:00
Vincent Povirk 7f3c92b2a0 ole32: Update storage header saving code based on the latest MS spec.
These fields are needed for the MS storage implementation to load
files that were created by Wine with a block size of 4096.
2010-07-19 14:38:16 +02:00
Vincent Povirk 9c95761d9e ole32: Always check the size of the small block root chain.
In some storage files, the size of this stream is not a multiple of the big
block size. This means that we may need to enlarge the stream even when we
don't really have to allocate more space for it.
2010-05-28 16:22:24 +02:00
Vincent Povirk 57ddceea34 ole32: Use a temporary variable in TransactedSnapshotImpl_EnsureReadEntry.
CreateStubEntry can change the value of This->entries, in which case the
assignment can go to the wrong place. So instead, assign to a temporary
variable, and copy the data back after all CreateStubEntry calls are finished.
2010-05-13 11:51:07 +02:00
Marcus Meissner bf1e9a2e93 ole32: Fixed 2 uninitialized variable use (Coverity). 2010-05-10 10:03:43 +02:00
Vincent Povirk dbf123ba0d ole32: Fix reads past the end of streams. 2010-05-07 12:46:50 +02:00
Vincent Povirk 4ad114cfae ole32: Use the cached information in BlockChainStream_GetCount. 2010-05-07 12:46:39 +02:00
Vincent Povirk e40afcb2b6 ole32: Always move unmodified streams instead of copying on commit. 2010-05-06 17:55:43 +02:00
Vincent Povirk d07a4868a1 ole32: Rewrite transacted storage to be more lazy.
When creating a new transacted storage object (or reverting an
existing one), rather than copy the original storage, we simply create
a "stub directory entry" for the root. As stub entries are accessed,
we fill in their data from the parent and create new stubs for any
linked entries. The streams have copy on write semantics - reads are
from the original entry until a change is made, then we make a copy in
the scratch file.

When committing transacted storages, we have to create a new tree with
the new data so that the storage entry can be modified in one step,
but unmodified sections of the tree can now be shared between the new
tree and the old. An entry can be shared if it and all entries
reachable from it are unmodified. In the trivial case where nothing
has been modified, we don't have to make a new tree at all.
2010-05-06 17:55:34 +02:00
Vincent Povirk 42550953a6 ole32: Store the location of all blocks in a big block chain in memory.
A big block chain is a linked list, and we pretty much need random
access to them. This should theoretically make accessing a random
point in the chain O(log2 n) instead of O(n) (with disk access scaling
based on the size of the read/write, not its location). It
theoretically takes O(n) memory based on the size, but it can do
better if the chain isn't very fragmented (which I believe will
generally be the case for long chains). It also involves fetching all
the big block locations when we open the chain, but we already do that
anyway (and it should be faster to read it all in one go than
piecemeal).
2010-05-05 10:41:57 +02:00