Commit Graph

191 Commits

Author SHA1 Message Date
Rob Shearman b005e9ed0d ole32: Move the logic in StgCreateDocfile for "if no share mode given then DENY_NONE is the default" to before the validateSTGM check.
Add a test that shows this behaviour is correct.

Remove a test on the access mode that is redundant because it is already 
done in validateSTGM.
2007-05-10 12:15:11 +02:00
Michael Stefaniuc 5f62da109e janitorial: Pass HEAP_ZERO_MEMORY as flag to HeapAlloc() instead of zeroing out the allocated memory in a later call. 2007-04-25 12:26:07 +02:00
Dmitry Timoshkov dce12498d0 ole32: Move the storage signatures to the appropriate file that uses them. 2007-03-21 11:59:41 +01:00
Aric Stewart 838eb4037f ole32: Rework storage with blockfiles to properly use ILockBytes interfaces.
Rework storage to make all its interactions with the underlying data go 
though ReadAt and WriteAt to allow for an ILockBytes underlying layer.
Implement ReadAt and WriteAt in stg_bigblockfile.c for blockfiles.
2007-03-20 12:36:45 +01:00
Rob Shearman 3bd31cfd16 ole32: The stream returned by StgStreamImpl_Clone should have one reference, so call AddRef before returning.
Move the call to StorageBaseImpl_AddStream to StgStreamImpl_Construct to 
fix StgStreamImpl_Clone, which forgets to call it.
Add tests for OLE structured storage tests for IStream::Clone.
2007-02-26 17:33:36 +01:00
Rob Shearman b1ee49a74d ole32: ReadClassStm should return STG_E_READFAULT is not all of the data could be read, not S_FALSE.
Clear pclsid in case of errors.
Add tests for ReadClassStm.
2007-01-10 12:17:00 +01:00
Rob Shearman 35548d15c4 ole32: Fix Read/WriteClassStm to return an error if the passed in stream pointer is NULL. 2007-01-10 12:14:24 +01:00
Michael Gardiner f9d8449db2 ole32: Stop StgOpenStorage from creating a file when it does not already exist. 2007-01-04 20:53:39 +01:00
Kirill K. Smirnov 3cd3ca68fe ole32: Fix logic in Storage32Impl_SmallBlocksToBigBlocks function. 2006-11-27 17:44:47 +01:00
Michael Stefaniuc 21ff87bf50 ole32: Win64 printf format warning fixes. 2006-10-16 10:53:28 +02:00
Andrey Turkin 63f88b3d57 ole32: StgOpenStorage on non-existent file should create it (with test). 2006-09-28 14:14:59 +02:00
Robert Shearman aa336618ec ole32: Add a check for a condition where a stream has an invalid size
and so there aren't enough blocks in the chain to write data into.
2006-09-11 12:28:23 +02:00
Robert Shearman 106156cb75 ole32: Remove some assertions in the stuctured storage code by
returning error codes to the caller and by handling the error
condition.
2006-09-11 12:28:12 +02:00
Robert Shearman 79f7318a11 ole32: Convert the *_{Read,Write}At structured storage functions to
return HRESULTs instead of BOOLs so that errors can be properly
propagated from lower levels.
2006-09-11 12:27:45 +02:00
Robert Shearman f42d61df0d ole32: Move some functions out of compobj.c that don't belong there and update the copyright statement. 2006-08-16 16:42:32 +02:00
Robert Shearman 8d7bfca965 ole32: Fix a typo in IEnumSTATSTGImpl_QueryInterface where IStorage was being compared against instead of IEnumSTATSTG. 2006-08-09 20:40:11 +02:00
Robert Shearman f0dc9deff0 ole32: Ensure that a returned free block is valid in storage.
Otherwise, an IStream_SetSize call followed by an IStream_Read call 
could fail with STG_E_DOCFILECORRUPT.
2006-08-03 22:23:27 +02:00
Alexandre Julliard 518ee99f6f ole32: Make some functions and variables static. 2006-08-02 13:31:26 +02:00
Robert Shearman 1a5cd3ca9b ole32: Remove a check on the share mode for the NULL filename case as the check is already done earlier in StgCreateDocfile. 2006-07-31 21:25:35 +02:00
Mike McCormack 63cbef27a2 ole32: Use IsGUIDEqual to compare IIDs. 2006-07-31 17:18:24 +02:00
Mike McCormack 6ede65596a ole32: Add function parameters to FIXME messages. 2006-07-31 10:53:19 +02:00
Mike McCormack 24e69d544b ole32: Add a test showing what STGM_TRANSACTED does for streams. 2006-07-31 10:53:15 +02:00
Mike McCormack fd61c3f24b ole32: Add some missing traces. 2006-07-29 11:55:43 +02:00
Mike McCormack 55ab809854 ole32: Only print a FIXME if necessary in StgOpenStorageEx. 2006-07-11 12:41:42 +02:00
Alexandre Julliard ae525c1441 ole32: Make the virtual table functions static where possible. 2006-06-10 11:59:15 +02:00
Troy Rollo bdbc482651 ole32: Use STGM_WRITE when opening child storage to delete its children. 2006-05-31 11:45:29 +02:00
Jonathan Ernst 360a3f9142 Update the address of the Free Software Foundation. 2006-05-23 14:11:13 +02:00
Troy Rollo 1be295fb47 ole32: Fix excessive file sizes for Storage files.
The IStorage (DocFile) implementation was adding empty blocks at the
end of the file every time a caller wrote data that was not a multiple
of 512 bytes.  If the caller made a lot of very small writes the file
size could be huge even though the data in the file was tiny. This was
caused by BlockChainStream_SetSize trying to allocate file blocks for
the new data using a condition that bore no relationship to the
required condition, and it was not necessary to do so at that time
since it is done (the right way) by StorageImpl_GetNextFreeBigBlock
(called via BlockChainStream_Enlarge).
2006-05-23 13:00:13 +02:00
Mike Hearn 27800ef4cc ole32: Add StgCreateFile test and conformance fix. 2006-05-08 16:04:51 +02:00
Robert Shearman d9b7c36009 ole32: Fix typos in StgCreateStorageEx and StgOpenStorageEx. 2006-05-05 21:51:43 +02:00
Robert Shearman 6dd5dbef64 ole32: STGM_PRIORITY allows other IStorage objects to be opened in transacted mode with read/write access. 2006-05-05 21:51:31 +02:00
Robert Shearman 693da8c471 ole32: Check that the storage was opened with write access before creating a new stream or sub-storage. 2006-05-05 21:50:12 +02:00
Robert Shearman 5d051af6ae ole32: Copy the mode flags into the STATSTG structure in IStorage::Stat.
Copy the mode flags into the STATSTG structure in IStorage::Stat. Don't 
store the STGM_CREATE flag in openFlags, since it is only relevant when 
opening the stream and the tests show that it isn't returned in the 
STATSTG structure.
2006-05-05 21:49:39 +02:00
Robert Shearman b2207d83ad ole32: Fix access right check for opening and creating streams and storages.
Check the access mode for opening and creating streams and storages
doesn't exceed the access rights the current storage was opened with,
not the parent storage.
2006-05-05 21:49:04 +02:00
James Hawkins 2b5963f8e2 ole32: StorageImpl_GetROBigBlock can return NULL so check for NULL before doing a memcpy. 2006-05-05 17:51:08 +02:00
Mike McCormack 11e4b21a30 ole32: More tests and fixes for STGM_PRIORITY. 2006-04-18 11:15:03 +02:00
Mike McCormack eed120995b ole32: STGM_PRIORITY implies STGM_SHARE_EXCLUSIVE. 2006-04-03 12:15:34 +02:00
Mike McCormack 50436da519 ole32: Fix StgOpenStorage's handling of the STGM_PRIORITY flag. 2006-03-30 12:38:08 +02:00
Francois Gouget 6bddeb1cf7 Assorted spelling fixes. 2006-03-21 20:10:39 +01:00
Vitaly Lipatov aee52b747e ole32: Add descriptions for StgCreateDocfile and StgIsStorageFile functions. 2006-02-24 21:10:27 +01:00
Dr J A Gow e3af1227c9 ole32: Fix stream ref counting.
Stream methods called after parent object has been closed correctly
return STG_E_REVERTED.
Stream refcounting fixed. Now can safely call IStorage destructor
before IStream destructor and guarantee file will be closed.
2006-02-21 11:18:05 +01:00
Dr J A Gow c74e5a784d ole32: Fix up permissions when opening streams.
Fix up permissions when opening streams in storage objects when
storage object has been opened in transacted mode.
2006-02-21 11:17:32 +01:00
Robert Shearman 95312fcb63 ole: Remove "stub" from TRACEs of functions that aren't stubs. 2006-01-06 21:08:09 +01:00
Ulrich Czekalla 427920f8a2 ole: Fix SmallBlocksToBigBlocks loop.
Stop copying data when read returns 0 bytes
2006-01-06 12:16:04 +01:00
Ulrich Czekalla 707fa2c3a2 ole32: Return error instead of asserting if storage file is corrupt. 2005-12-22 17:15:05 +01:00
Markus Amsler ae542af541 Improve c2man Documented-Total count. 2005-11-09 10:30:57 +00:00
Robert Shearman 6bc4327c92 - Initialize out pointer to NULL before access check in
IStorage_CreateStorage.
- WriteClassStg should return E_INVALIDARG if pstg is NULL instead of
  asserting.
- ReadClassStg should return E_INVALIDARG if pstg is NULL instead of
  crashing and a NULL pclsid should cause it to return the same
  value.
2005-09-22 10:34:40 +00:00
Richard Cohen 908e9e889e Relax the share mode validation for transacted storage, with a test. 2005-09-07 09:22:15 +00:00
Mike McCormack 61aabd66f5 Warning fixes for gcc 4.0. 2005-08-15 10:49:39 +00:00
Alexandre Julliard 04b7382db9 Remove duplicate definition of FILE_BEGIN. 2005-07-28 10:24:01 +00:00
Stefan Huehner 4f82e547d7 Fix some missing-declarations warnings. 2005-07-24 17:11:59 +00:00
Vitaly Lipatov e633b45300 Added some documentation. 2005-07-07 17:21:44 +00:00
Dmitry Timoshkov eba47f1dfe Make remaining OLE interface vtables const. 2005-06-06 19:50:35 +00:00
Pierre d'Herbemont 49b1d335d9 Big Endian specific code fixes in order to conform with
NONAMELESSSTRUCT.
2005-05-18 09:44:13 +00:00
Juan Lang 2507264e05 - maintain proper byte order
- maintain PROPSETFLAG_ANSI flag based on codepage
- update comments
2005-05-14 11:06:44 +00:00
Mike McCormack e3b43fa458 Make sure a stream can't be created in read only storage. 2005-05-13 13:58:43 +00:00
Mike McCormack 809cf354e4 Fix a memory leak in the ole storage implementation. 2005-05-10 15:59:59 +00:00
Matthew Mastracci 6e028f414d Replace stub entry for StgOpenStorageEx with call to StgOpenStorage. 2005-05-06 14:32:30 +00:00
Matthew Mastracci 8188790946 Replace StgCreateStorageEx stub with call to StgCreateDocfile and add
required STGFMT_* enumerations.
2005-05-05 16:44:05 +00:00
Juan Lang b99dfb0c1a Define and use endian conversion macros for big-endian machines. 2005-04-24 17:22:26 +00:00
Mike McCormack 6714664dee Eliminate forward declarations, make functions static. 2005-03-31 15:26:30 +00:00
Huw Davies 9be7f2789f WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's
unclear when (if at all) this gets written.
2005-03-29 18:56:22 +00:00
Mike McCormack 17c3106896 Eliminate casts of the return value of HeapAlloc. 2005-03-21 11:25:13 +00:00
Troy Rollo 963b63ecbd ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. 2005-03-21 10:30:01 +00:00
Juan Lang ac24801db0 Add a comment about byte order, change types to reduce casting and not
cast away constness.
2005-03-17 10:25:13 +00:00
Mike McCormack 77fc6a5d82 StgOpenStorage shouldn't open zero length storage files. 2005-03-11 13:17:10 +00:00
Mike McCormack 6f2f76c410 Shared reading of storage files requires STGM_TRANSACTED. 2005-03-09 11:44:59 +00:00
Mike McCormack e9d334d0c9 Fix more incorrect uses of STGM_ enumerations. 2005-03-07 12:24:42 +00:00
Juan Lang 01239efa4a Implement StgCreatePropSetStg. 2005-03-07 10:59:09 +00:00
Mike McCormack a7609ee155 Test and fix grfMode handling in StgOpenDocfile. 2005-03-05 10:48:11 +00:00
Mike McCormack 607b43e6b4 Implement StgSetTimes. 2005-03-04 10:48:17 +00:00
Paul Vriens 8922da9ed4 Added some TRACE statements. 2005-02-25 13:58:37 +00:00
Mike McCormack db69dcb5c1 Add struct StorageBaseImpl at the start of derived structures instead
of trying to keep the first members the same.
2005-02-24 19:39:27 +00:00
Mike McCormack a6a91a440b Implement and test IPropertySetStorage. 2005-02-21 20:58:09 +00:00
Mike McCormack 71424b80e5 Tests and fixes for StgOpenStorage. 2005-01-11 15:08:08 +00:00
Mike McCormack 6f20133705 Test and fix a few problems with OLE storage streams. 2005-01-11 10:44:28 +00:00
Mike McCormack b146b75c27 Test and fix StgCreateDocFile grfModes. 2005-01-10 12:26:25 +00:00
Michael Stefaniuc 5ad7d858e0 Do not check for non NULL pointer before HeapFree'ing it. It's
redundant.
2004-12-23 17:06:43 +00:00
Alexandre Julliard ebe3c529b1 Janitorial: C booleans must not be compared against TRUE. 2004-12-09 14:07:59 +00:00
Eric Pouech 0a258964c2 Const correctness fixes. 2004-11-30 21:38:57 +00:00
Francois Gouget 486d020c1b Don't define COBJMACROS in objbase.h.
Update the Wine sources accordingly.
2004-10-07 03:06:48 +00:00
Joris Huizer 34cffce6f9 Ref count increment/decrement cleanup. 2004-09-24 01:16:53 +00:00
Hans Leidekker 719a789792 Fix signed/unsigned comparison warnings. 2004-09-22 02:46:38 +00:00
Alexandre Julliard 241a4c34b1 Get rid of the non-standard ICOM_THIS macro. 2004-09-09 21:03:58 +00:00
Alexandre Julliard f714b39762 Get rid of the no longer used ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
macro.
2004-08-23 19:39:48 +00:00
Alexandre Julliard 48c4bb3c31 Get rid of the non-standard ICOM_VTABLE macro. 2004-08-12 23:00:51 +00:00
Mike McCormack f0baf82b36 stat on memory storage should return a NULL name, not "". 2004-08-10 23:41:58 +00:00
Marcus Meissner e3a37c8a26 Revert broken strict aliasing fix. 2004-05-21 20:52:57 +00:00
Patrik Stridvall 070db4e5de Fixed some issues found by winapi_check. 2004-05-17 21:08:31 +00:00
Francois Gouget cfc3943c5f Make our ascii strings static const.
Remove a couple string variables that were used only once and use the
string literal directly.
2004-05-04 04:13:05 +00:00
Marcus Meissner ff39b877a4 Fixed strict aliasing issues in dlls/ole32. 2004-05-04 03:10:50 +00:00
Francois Gouget 7a58c6ec53 Add a stub for StgCreateStorageEx(). Returns
STG_E_UNIMPLEMENTEDFUNCTION as per MSDN. Fixes an error saving files
in Word XP.
2004-04-30 18:32:20 +00:00
Francois Gouget 8fc374d8b4 Make Unicode strings 'static const'. 2004-04-20 02:14:00 +00:00
Francois Gouget 52c0832161 Make Unicode strings static const. 2004-04-20 01:12:17 +00:00
Alexandre Julliard d07c1004e3 Moved a few remaining 16-bit definitions out of the standard headers. 2004-01-23 22:51:41 +00:00
Ge van Geldorp 100e11309b Fix various function prototypes to conform to PSDK. 2004-01-23 20:57:26 +00:00
Ge van Geldorp 399901e054 Rename LARGE_INTEGER and ULARGE_INTEGER members "s" to "u" to conform
with PSDK.
2004-01-23 01:51:33 +00:00
Mike McCormack ac57fc20b6 Change erroneous malloc to HeapAlloc. 2003-09-22 19:46:13 +00:00
Dave Miller 47fb938d54 Removed ordinals from comments. 2003-09-11 03:06:25 +00:00
Alexandre Julliard e37c6e18d0 Fixed header dependencies to be fully compatible with the Windows
headers (with help from Dimitrie O. Paun).
2003-09-05 23:08:26 +00:00