Commit Graph

113 Commits

Author SHA1 Message Date
Nikolay Sivov 52ce30d242 ole32: Make ole stream creation helper capable of handling flags data. 2012-07-17 12:50:19 +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 ea196ef0eb ole32: COM cleanup of storage IStream implementation. 2012-07-13 10:28:15 -05:00
Marcus Meissner 14c4ef3fdd ole32: Mark internal symbols has hidden visibility. 2011-04-25 13:02:01 +02: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
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 89646084ba ole32: Cache data and block locations in BigBlockStream objects. 2010-08-26 13:59:31 +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 e40afcb2b6 ole32: Always move unmodified streams instead of copying on commit. 2010-05-06 17:55:43 +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
Vincent Povirk 0b149df987 ole32: Create storage files with 4096-byte blocks when asked. 2010-04-13 11:30:48 +02:00
Vincent Povirk 49a817c064 ole32: Check the small block size limit of storage files.
This value is stored in the storage file header. We currently hard-code it to
0x1000. I don't expect to see files in the wild with other values, but
according to MS this is a valid configuration. For now, just fail if we see
another value.

I've also upgraded the message for unexpected values in storage file headers
to a fixme, since they are valid according to MS.
2010-03-22 10:47:58 +01:00
Vincent Povirk e05b8416b8 ole32: Track the lowest possibly-free small block in storage files.
This makes creating small block chains O(n) instead of O(n**2) because we
don't have to keep rechecking the first blocks in the file.
2010-03-22 10:47:42 +01:00
Vincent Povirk 5ceb003a24 ole32: Remove knowledge of block sizes from the BigBlockFile object.
We can't determine the correct block size until we read the header, and we
can't create the BigBlockFile until we know the correct block size. To
solve this dilemma, have StorageImpl calculate the file size it needs instead
of asking the BigBlockFile to "ensure a big block exists".
2010-03-15 13:46:48 +01:00
Vincent Povirk 926669741e ole32: Remove the NUM_BLOCKS_PER_DEPOT_BLOCK define.
This should always be calculated based on the big block size.
2010-03-15 13:46:31 +01:00
Vincent Povirk 7b43123762 ole32: Remove the BIG_BLOCK_SIZE define.
Big block sizes can be 512 or 4096, so we define arrays that are large
enough in either case.
2010-03-15 13:46:19 +01:00
Vincent Povirk 7f3211f383 ole32: Don't treat the header as a big block in StorageImpl_LoadFileHeader.
The header is always 512 bytes, regardless of the big block size.
2010-03-15 13:45:30 +01:00
Vincent Povirk 393c5af205 ole32: Add a cache for block chain streams in StorageImpl. 2009-12-16 12:24:27 +01:00
Vincent Povirk d799f7e189 ole32: Add a stub transacted storage type.
TransactedSnapshotImpl acts as a proxy between the user and the storage
interfaces that modify the file directly (or another transacted storage).
Currently, it does not change the operations.
2009-12-11 12:16:26 +01:00
Vincent Povirk 42142200d5 ole32: Add Invalidate to the storage vtable. 2009-12-11 12:16:26 +01:00
Vincent Povirk 8b3ff9d179 ole32: Remove the ancestorStorage attribute. 2009-12-10 11:51:39 +01:00
Vincent Povirk df0ef756b3 ole32: Add an attribute to StorageBaseImpl to track its reverted status. 2009-12-09 12:03:40 +01:00
Vincent Povirk 8518323e07 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.
2009-12-09 12:03:18 +01:00
Vincent Povirk 6d06c43e53 ole32: Use the storage vtable to resize streams. 2009-12-09 12:03:10 +01:00
Vincent Povirk 1d4c698ef3 ole32: Use the storage vtable to write to streams. 2009-12-09 12:02:59 +01:00
Vincent Povirk 62e54bacba ole32: Use the storage vtable to read streams. 2009-12-08 12:35:33 +01:00
Vincent Povirk ee39a21d2b ole32: Add DestroyDirEntry to the storage vtable. 2009-12-08 12:35:17 +01:00
Vincent Povirk 9300a92ccc ole32: Change the base IStorage filename to a pointer type.
The maximum size of the name returned by Stat() on a top-level storage has
nothing to do with DIRENTRY_NAME_BUFFER_LEN. Windows can return longer names
and probably has a limit of MAX_PATH. Also, Stat always returns an absolute
pathname, so we don't need a special case in StgOpenStorage.
2009-12-08 12:34:47 +01:00
Vincent Povirk f3d194b391 ole32: Add ReadDirEntry to the storage vtable. 2009-12-07 09:49:05 +01:00
Vincent Povirk 176cdfc75e ole32: Add WriteDirEntry to the storage vtable. 2009-12-07 09:49:05 +01:00
Vincent Povirk 8a332db2c5 ole32: Change ReadDirEntry return type to HRESULT. 2009-12-07 09:49:05 +01:00
Vincent Povirk df13a1d1fe ole32: Change WriteDirEntry return type to HRESULT. 2009-12-07 09:49:05 +01:00
Vincent Povirk 382ffed003 ole32: Make CreateDirEntry a virtual method. 2009-12-07 09:49:05 +01:00
Vincent Povirk cc98619ca4 ole32: Add an internal vtable to StorageBaseImpl objects. 2009-12-04 14:34:59 +01:00
Vincent Povirk f434ab1f2a ole32: Unify the logic for overriding the root storage filename in Stat.
This is needed so that the new transacted type will be able to easily support
this logic.
2009-12-04 14:34:59 +01:00
Vincent Povirk 5456724fd7 ole32: Move the create attribute from StorageImpl to StorageBaseImpl.
This is to avoid accessing the top-level StorageImpl directly.
2009-12-04 14:34:58 +01:00
Vincent Povirk 6c3961f0c4 ole32: Copy the storage filename at stat time, not read time. 2009-11-24 10:55:45 +01:00
Vincent Povirk d3c0a3a829 ole32: Invalidate open storage objects that outlive their parent. 2009-11-20 11:15:27 +01:00
Vincent Povirk e77e9e45aa ole32: Add a DirRef type for references to directory entries. 2009-11-18 11:03:58 +01:00
Vincent Povirk 93db14e79a ole32: Rename SmallBlockChainStream.ownerPropertyIndex to ownerDirEntry. 2009-11-16 11:33:22 +01:00
Vincent Povirk 848caa5168 ole32: Rename BlockChainStream.ownerPropertyIndex to ownerDirEntry. 2009-11-16 11:33:15 +01:00
Vincent Povirk df960e27c4 ole32: Rename stream.ownerProperty to dirEntry. 2009-11-16 11:33:06 +01:00
Vincent Povirk 4ba13cb9a7 ole32: Rename rootPropertySetIndex to storageDirEntry.
Not only is it not related to property set storages, it's also not the root
of the tree that's used to search for elements.
2009-11-16 11:32:58 +01:00
Vincent Povirk cf1242e03b ole32: Rename propertyUniqueID to clsid. 2009-11-16 11:32:47 +01:00