reactos/dll/win32/ole32/stg_prop.c

2916 lines
85 KiB
C
Raw Normal View History

Sync to Wine-20050310: Jon Griffiths <jon_p_griffiths@yahoo.com> - Documentation spelling fixes. Mike McCormack <mike@codeweavers.com> - Implement and test IPropertySetStorage. - Fix more incorrect uses of STGM_ enumerations. - Add struct StorageBaseImpl at the start of derived structures instead of trying to keep the first members the same. - StgOpenStorage shouldn't open zero length storage files. - Shared reading of storage files requires STGM_TRANSACTED. - Test and fix grfMode handling in StgOpenDocfile. - Implement StgSetTimes. Robert Shearman <rob@codeweavers.com> - Better tracing. - Small cleanup of creation functions. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. - Move marshaling state machine into stub manager from ifstub. - Add additional needed states for table-weak marshaling, as shown by tests. - Protect external reference count from underflows/overflows. - Make COM use the RPC runtime as the backend for RPC calls. Based on a patch by Ove Ksven. - Invoke objects in STA's in the correct thread by sending messages to the hidden apartment window. - Use I_RpcGetBuffer, instead of our own buffer routines to fix an occasional test crash caused by heap corruption. - Zero the memory block passed to RpcServerRegisterIfEx so we don't pass garbage in some of the fields we don't fill in. - Return the correct error code from create_server and fix two handle leaks. - TODO update. - Remove cruft left over from previous RPC backend implementation in the apartment structure. - Don't pass an IPID by value for proxy_manager_create_ifproxy. - Disable more of RPC_UnregisterInterface to prevent the RPC runtime using freed memory. - Rename various external RPC backend functions so that they all have the same "RPC_" prefix. - Reduce the timeout of the function that connects to a local server to 30s, like native. - Make each ifproxy have its own channel buffer to fix a bug where a proxy with multiple interfaces could invoke the wrong stub buffer on the server. - The Global Interface Table should do table-strong marshaling instead of normal marshaling so that an interface can be retrieved more than one time. Mike Hearn <mh@codeweavers.com> - Avoid infinite loop when doing a typelib marshalled IUnknown::QueryInterface by only doing an extra QI if requested IID is not equal to marshalled IID. Rob Shearman <rob@codeweavers.com> Mike Hearn <mh@codeweavers.com> - Add re-entrancy tests to the test suite. - Run RPCs on a new thread client side so we can pump the message loop. Juan Lang <juan_lang@yahoo.com> - Fix the calling convention of DllCanUnloadNow. - Move vtbl to end of file and get rid of unnecessary prototypes. - Implement StgCreatePropSetStg. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Paul Vriens <Paul.Vriens@xs4all.nl> - Added some TRACE statements. svn path=/trunk/; revision=14083
2005-03-14 23:17:44 +00:00
/*
* Compound Storage (32 bit version)
* Storage implementation
*
* This file contains the compound file implementation
* of the storage interface.
*
* Copyright 1999 Francis Beaudet
* Copyright 1999 Sylvain St-Germain
* Copyright 1999 Thuy Nguyen
* Copyright 2005 Mike McCormack
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
* Copyright 2005 Juan Lang
Sync to Wine-20050310: Jon Griffiths <jon_p_griffiths@yahoo.com> - Documentation spelling fixes. Mike McCormack <mike@codeweavers.com> - Implement and test IPropertySetStorage. - Fix more incorrect uses of STGM_ enumerations. - Add struct StorageBaseImpl at the start of derived structures instead of trying to keep the first members the same. - StgOpenStorage shouldn't open zero length storage files. - Shared reading of storage files requires STGM_TRANSACTED. - Test and fix grfMode handling in StgOpenDocfile. - Implement StgSetTimes. Robert Shearman <rob@codeweavers.com> - Better tracing. - Small cleanup of creation functions. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. - Move marshaling state machine into stub manager from ifstub. - Add additional needed states for table-weak marshaling, as shown by tests. - Protect external reference count from underflows/overflows. - Make COM use the RPC runtime as the backend for RPC calls. Based on a patch by Ove Ksven. - Invoke objects in STA's in the correct thread by sending messages to the hidden apartment window. - Use I_RpcGetBuffer, instead of our own buffer routines to fix an occasional test crash caused by heap corruption. - Zero the memory block passed to RpcServerRegisterIfEx so we don't pass garbage in some of the fields we don't fill in. - Return the correct error code from create_server and fix two handle leaks. - TODO update. - Remove cruft left over from previous RPC backend implementation in the apartment structure. - Don't pass an IPID by value for proxy_manager_create_ifproxy. - Disable more of RPC_UnregisterInterface to prevent the RPC runtime using freed memory. - Rename various external RPC backend functions so that they all have the same "RPC_" prefix. - Reduce the timeout of the function that connects to a local server to 30s, like native. - Make each ifproxy have its own channel buffer to fix a bug where a proxy with multiple interfaces could invoke the wrong stub buffer on the server. - The Global Interface Table should do table-strong marshaling instead of normal marshaling so that an interface can be retrieved more than one time. Mike Hearn <mh@codeweavers.com> - Avoid infinite loop when doing a typelib marshalled IUnknown::QueryInterface by only doing an extra QI if requested IID is not equal to marshalled IID. Rob Shearman <rob@codeweavers.com> Mike Hearn <mh@codeweavers.com> - Add re-entrancy tests to the test suite. - Run RPCs on a new thread client side so we can pump the message loop. Juan Lang <juan_lang@yahoo.com> - Fix the calling convention of DllCanUnloadNow. - Move vtbl to end of file and get rid of unnecessary prototypes. - Implement StgCreatePropSetStg. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Paul Vriens <Paul.Vriens@xs4all.nl> - Added some TRACE statements. svn path=/trunk/; revision=14083
2005-03-14 23:17:44 +00:00
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
*
Sync to Wine-20050524: Alexandre Julliard <julliard@winehq.org> - Added rules for building import libraries in the individual dll makefiles, and added support for building a .def.a static import library too. - Removed unnecessary code in the 16-bit DllEntryPoint function of some dlls, and also fixed its ordinal in a few places. - Comment out stub WEP entry points so that we can call WEP for builtin dlls too. Juan Lang <juan_lang@yahoo.com> - Obvious fixes to PropVariantClear and PropVariantCopy for vector types. - Add a comment, and a no-op cleanup. - Differentiate between version 0 and version 1 property storages. - Store property names in the code page of the property set. - maintain proper byte order - maintain PROPSETFLAG_ANSI flag based on codepage - update comments - Correct/improve error checking in IPropertyStorage. - convert strings between property storage's code page and system code page - add tests for setting code page - fix tests and behavior to match WinXP - Define and use endian conversion macros for big-endian machines. Marcus Meissner <marcus@jet.franken.de> - Move the Dll init function to compobj.c to avoid having global variables. Remove need of ole32_main.h. - Make HGLOBALStream_* functions static. - Make _xmalloc16() static. - Staticify FTMarshalImpl definition. Francois Gouget <fgouget@free.fr> - Specify the proper call convention in the PropSysFreeString() implementation. - Tweak the API documentation to silence winapi_check warnings. Robert Shearman <rob@codeweavers.com> - Add error messages on failure in file moniker load function. - Fix incorrect pointer check in both monikers. - Fix max size calculation of item moniker to match native. - Add a generic moniker marshaler that works by saving & loading monikers to & from the stream. - Use the generic moniker marshal in the file & item monikers and add a class factory for each. - Implement IROTData::GetComparisonData for file & item monikers. - Add a useful trace message. - Fix more places where custom header size was calculated exclusive of the data size member. - Optimize custom marshaling by getting size before calling the custom marshaler so we can write the header before and not use a second stream. - Change remaining blocks of code with 2-space indentation to 4-space indentation. - Make vtables const. - Remove an unnecessary memcpy and let the compiler do the work. - Write custom header up to and including size, not excluding. - Add a stub implementation of CoIsHandlerConnected. - Marshal objects & monikers into the ROT. - Test for this behaviour. Mike McCormack <mike@codeweavers.com> - Remove unnecessary declarations and make functions static. - Remove forward declarations. - Make sure a stream can't be created in read only storage. - Fix a memory leak in the ole storage implementation. - Remove function prototypes. Kevin Koltzau <kevin@plop.org> - Implement Hash function on composite moniker. Jeff Latimer <jeffl@defcen.gov.au> - Implement the IEnumMoniker interface for the ROT and provide tests to exercise the interface. Pierre d'Herbemont <stegefin@free.fr> - Big Endian specific code fixes in order to conform with NONAMELESSSTRUCT. Matthew Mastracci <matt@aclaro.com> - Replace stub entry for StgOpenStorageEx with call to StgOpenStorage. - Replace StgCreateStorageEx stub with call to StgCreateDocfile and add required STGFMT_* enumerations. svn path=/trunk/; revision=15562
2005-05-28 09:30:04 +00:00
* TODO:
* - I don't honor the maximum property set size.
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
* - Certain bogus files could result in reading past the end of a buffer.
* - Mac-generated files won't be read correctly, even if they're little
* endian, because I disregard whether the generator was a Mac. This means
* strings will probably be munged (as I don't understand Mac scripts.)
* - Not all PROPVARIANT types are supported.
Sync to Wine-20050524: Alexandre Julliard <julliard@winehq.org> - Added rules for building import libraries in the individual dll makefiles, and added support for building a .def.a static import library too. - Removed unnecessary code in the 16-bit DllEntryPoint function of some dlls, and also fixed its ordinal in a few places. - Comment out stub WEP entry points so that we can call WEP for builtin dlls too. Juan Lang <juan_lang@yahoo.com> - Obvious fixes to PropVariantClear and PropVariantCopy for vector types. - Add a comment, and a no-op cleanup. - Differentiate between version 0 and version 1 property storages. - Store property names in the code page of the property set. - maintain proper byte order - maintain PROPSETFLAG_ANSI flag based on codepage - update comments - Correct/improve error checking in IPropertyStorage. - convert strings between property storage's code page and system code page - add tests for setting code page - fix tests and behavior to match WinXP - Define and use endian conversion macros for big-endian machines. Marcus Meissner <marcus@jet.franken.de> - Move the Dll init function to compobj.c to avoid having global variables. Remove need of ole32_main.h. - Make HGLOBALStream_* functions static. - Make _xmalloc16() static. - Staticify FTMarshalImpl definition. Francois Gouget <fgouget@free.fr> - Specify the proper call convention in the PropSysFreeString() implementation. - Tweak the API documentation to silence winapi_check warnings. Robert Shearman <rob@codeweavers.com> - Add error messages on failure in file moniker load function. - Fix incorrect pointer check in both monikers. - Fix max size calculation of item moniker to match native. - Add a generic moniker marshaler that works by saving & loading monikers to & from the stream. - Use the generic moniker marshal in the file & item monikers and add a class factory for each. - Implement IROTData::GetComparisonData for file & item monikers. - Add a useful trace message. - Fix more places where custom header size was calculated exclusive of the data size member. - Optimize custom marshaling by getting size before calling the custom marshaler so we can write the header before and not use a second stream. - Change remaining blocks of code with 2-space indentation to 4-space indentation. - Make vtables const. - Remove an unnecessary memcpy and let the compiler do the work. - Write custom header up to and including size, not excluding. - Add a stub implementation of CoIsHandlerConnected. - Marshal objects & monikers into the ROT. - Test for this behaviour. Mike McCormack <mike@codeweavers.com> - Remove unnecessary declarations and make functions static. - Remove forward declarations. - Make sure a stream can't be created in read only storage. - Fix a memory leak in the ole storage implementation. - Remove function prototypes. Kevin Koltzau <kevin@plop.org> - Implement Hash function on composite moniker. Jeff Latimer <jeffl@defcen.gov.au> - Implement the IEnumMoniker interface for the ROT and provide tests to exercise the interface. Pierre d'Herbemont <stegefin@free.fr> - Big Endian specific code fixes in order to conform with NONAMELESSSTRUCT. Matthew Mastracci <matt@aclaro.com> - Replace stub entry for StgOpenStorageEx with call to StgOpenStorage. - Replace StgCreateStorageEx stub with call to StgCreateDocfile and add required STGFMT_* enumerations. svn path=/trunk/; revision=15562
2005-05-28 09:30:04 +00:00
* - User defined properties are not supported, see comment in
* PropertyStorage_ReadFromStream
Sync to Wine-20050310: Jon Griffiths <jon_p_griffiths@yahoo.com> - Documentation spelling fixes. Mike McCormack <mike@codeweavers.com> - Implement and test IPropertySetStorage. - Fix more incorrect uses of STGM_ enumerations. - Add struct StorageBaseImpl at the start of derived structures instead of trying to keep the first members the same. - StgOpenStorage shouldn't open zero length storage files. - Shared reading of storage files requires STGM_TRANSACTED. - Test and fix grfMode handling in StgOpenDocfile. - Implement StgSetTimes. Robert Shearman <rob@codeweavers.com> - Better tracing. - Small cleanup of creation functions. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. - Move marshaling state machine into stub manager from ifstub. - Add additional needed states for table-weak marshaling, as shown by tests. - Protect external reference count from underflows/overflows. - Make COM use the RPC runtime as the backend for RPC calls. Based on a patch by Ove Ksven. - Invoke objects in STA's in the correct thread by sending messages to the hidden apartment window. - Use I_RpcGetBuffer, instead of our own buffer routines to fix an occasional test crash caused by heap corruption. - Zero the memory block passed to RpcServerRegisterIfEx so we don't pass garbage in some of the fields we don't fill in. - Return the correct error code from create_server and fix two handle leaks. - TODO update. - Remove cruft left over from previous RPC backend implementation in the apartment structure. - Don't pass an IPID by value for proxy_manager_create_ifproxy. - Disable more of RPC_UnregisterInterface to prevent the RPC runtime using freed memory. - Rename various external RPC backend functions so that they all have the same "RPC_" prefix. - Reduce the timeout of the function that connects to a local server to 30s, like native. - Make each ifproxy have its own channel buffer to fix a bug where a proxy with multiple interfaces could invoke the wrong stub buffer on the server. - The Global Interface Table should do table-strong marshaling instead of normal marshaling so that an interface can be retrieved more than one time. Mike Hearn <mh@codeweavers.com> - Avoid infinite loop when doing a typelib marshalled IUnknown::QueryInterface by only doing an extra QI if requested IID is not equal to marshalled IID. Rob Shearman <rob@codeweavers.com> Mike Hearn <mh@codeweavers.com> - Add re-entrancy tests to the test suite. - Run RPCs on a new thread client side so we can pump the message loop. Juan Lang <juan_lang@yahoo.com> - Fix the calling convention of DllCanUnloadNow. - Move vtbl to end of file and get rid of unnecessary prototypes. - Implement StgCreatePropSetStg. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Paul Vriens <Paul.Vriens@xs4all.nl> - Added some TRACE statements. svn path=/trunk/; revision=14083
2005-03-14 23:17:44 +00:00
*/
#include "config.h"
#include "wine/port.h"
#include <assert.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define COBJMACROS
#define NONAMELESSUNION
#include "windef.h"
#include "winbase.h"
#include "winnls.h"
#include "winuser.h"
#include "wine/unicode.h"
#include "wine/debug.h"
#include "dictionary.h"
Sync to Wine-20050310: Jon Griffiths <jon_p_griffiths@yahoo.com> - Documentation spelling fixes. Mike McCormack <mike@codeweavers.com> - Implement and test IPropertySetStorage. - Fix more incorrect uses of STGM_ enumerations. - Add struct StorageBaseImpl at the start of derived structures instead of trying to keep the first members the same. - StgOpenStorage shouldn't open zero length storage files. - Shared reading of storage files requires STGM_TRANSACTED. - Test and fix grfMode handling in StgOpenDocfile. - Implement StgSetTimes. Robert Shearman <rob@codeweavers.com> - Better tracing. - Small cleanup of creation functions. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. - Move marshaling state machine into stub manager from ifstub. - Add additional needed states for table-weak marshaling, as shown by tests. - Protect external reference count from underflows/overflows. - Make COM use the RPC runtime as the backend for RPC calls. Based on a patch by Ove Ksven. - Invoke objects in STA's in the correct thread by sending messages to the hidden apartment window. - Use I_RpcGetBuffer, instead of our own buffer routines to fix an occasional test crash caused by heap corruption. - Zero the memory block passed to RpcServerRegisterIfEx so we don't pass garbage in some of the fields we don't fill in. - Return the correct error code from create_server and fix two handle leaks. - TODO update. - Remove cruft left over from previous RPC backend implementation in the apartment structure. - Don't pass an IPID by value for proxy_manager_create_ifproxy. - Disable more of RPC_UnregisterInterface to prevent the RPC runtime using freed memory. - Rename various external RPC backend functions so that they all have the same "RPC_" prefix. - Reduce the timeout of the function that connects to a local server to 30s, like native. - Make each ifproxy have its own channel buffer to fix a bug where a proxy with multiple interfaces could invoke the wrong stub buffer on the server. - The Global Interface Table should do table-strong marshaling instead of normal marshaling so that an interface can be retrieved more than one time. Mike Hearn <mh@codeweavers.com> - Avoid infinite loop when doing a typelib marshalled IUnknown::QueryInterface by only doing an extra QI if requested IID is not equal to marshalled IID. Rob Shearman <rob@codeweavers.com> Mike Hearn <mh@codeweavers.com> - Add re-entrancy tests to the test suite. - Run RPCs on a new thread client side so we can pump the message loop. Juan Lang <juan_lang@yahoo.com> - Fix the calling convention of DllCanUnloadNow. - Move vtbl to end of file and get rid of unnecessary prototypes. - Implement StgCreatePropSetStg. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Paul Vriens <Paul.Vriens@xs4all.nl> - Added some TRACE statements. svn path=/trunk/; revision=14083
2005-03-14 23:17:44 +00:00
#include "storage32.h"
#include "enumx.h"
#include "oleauto.h"
Sync to Wine-20050310: Jon Griffiths <jon_p_griffiths@yahoo.com> - Documentation spelling fixes. Mike McCormack <mike@codeweavers.com> - Implement and test IPropertySetStorage. - Fix more incorrect uses of STGM_ enumerations. - Add struct StorageBaseImpl at the start of derived structures instead of trying to keep the first members the same. - StgOpenStorage shouldn't open zero length storage files. - Shared reading of storage files requires STGM_TRANSACTED. - Test and fix grfMode handling in StgOpenDocfile. - Implement StgSetTimes. Robert Shearman <rob@codeweavers.com> - Better tracing. - Small cleanup of creation functions. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. - Move marshaling state machine into stub manager from ifstub. - Add additional needed states for table-weak marshaling, as shown by tests. - Protect external reference count from underflows/overflows. - Make COM use the RPC runtime as the backend for RPC calls. Based on a patch by Ove Ksven. - Invoke objects in STA's in the correct thread by sending messages to the hidden apartment window. - Use I_RpcGetBuffer, instead of our own buffer routines to fix an occasional test crash caused by heap corruption. - Zero the memory block passed to RpcServerRegisterIfEx so we don't pass garbage in some of the fields we don't fill in. - Return the correct error code from create_server and fix two handle leaks. - TODO update. - Remove cruft left over from previous RPC backend implementation in the apartment structure. - Don't pass an IPID by value for proxy_manager_create_ifproxy. - Disable more of RPC_UnregisterInterface to prevent the RPC runtime using freed memory. - Rename various external RPC backend functions so that they all have the same "RPC_" prefix. - Reduce the timeout of the function that connects to a local server to 30s, like native. - Make each ifproxy have its own channel buffer to fix a bug where a proxy with multiple interfaces could invoke the wrong stub buffer on the server. - The Global Interface Table should do table-strong marshaling instead of normal marshaling so that an interface can be retrieved more than one time. Mike Hearn <mh@codeweavers.com> - Avoid infinite loop when doing a typelib marshalled IUnknown::QueryInterface by only doing an extra QI if requested IID is not equal to marshalled IID. Rob Shearman <rob@codeweavers.com> Mike Hearn <mh@codeweavers.com> - Add re-entrancy tests to the test suite. - Run RPCs on a new thread client side so we can pump the message loop. Juan Lang <juan_lang@yahoo.com> - Fix the calling convention of DllCanUnloadNow. - Move vtbl to end of file and get rid of unnecessary prototypes. - Implement StgCreatePropSetStg. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Paul Vriens <Paul.Vriens@xs4all.nl> - Added some TRACE statements. svn path=/trunk/; revision=14083
2005-03-14 23:17:44 +00:00
WINE_DEFAULT_DEBUG_CHANNEL(storage);
#ifdef _MSC_VER
#define __ASM_STDCALL_FUNC(name,args,code)
#endif
Sync to Wine-20050830: Francois Gouget <fgouget@free.fr> - Use LPSTORAGE to better match the PSDK. Document the real SEGPTR type using the standard documentation mechanisms. Fixes winapi_check warnings. Robert Shearman <rob@codeweavers.com> - Remove unused thread handle entry from the apartment structure. - Implement IMarshal on proxies so that we don't end up with proxies to proxies, causing potential deadlock issues and performance problems. - Add a test for this situation and remove the todo_wine from another test that now succeeds. - Add stub for CoAllowSetForegroundWindow. Vincent Beron <vberon@mecano.gme.usherb.ca> - Remove local declarations already in included public headers. - Correct mismatches between spec files and comments about export number. Alexandre Julliard <julliard@winehq.org> - Uncomment the typedef in the DECLARE_INTERFACE macro, and get rid of duplicate typedefs. - Use the proper WOW functions everywhere instead of the K32WOW variant. - Don't prefix the functions DllCanUnloadNow, DllGetClassObject and Dll(Un)RegisterServer with the dll name so that the compiler can check the prototypes. - Remove duplicate definition of FILE_BEGIN. - Replace the _ICOM_THIS_From macros by inline functions the way it's already done in shelllink.c. Mike McCormack <mike@codeweavers.com> - Warning fixes for gcc 4.0. - Fix some gcc 4.0 warnings. - return a precomputed result for a NULL string - pass strlen an LPSTR to eliminate a sign warning Marcus Meissner <marcus@jet.franken.de> - Implemented ILockBytes16 (memorystream) support for the 16bit compound storage implementation. - Added ReadClassStg, OleDoAutoConvert, GetConvertStg implementations/stubs. Marcus Meissner <meissner@suse.de> - Added CoCreateInstance16, CoGetClassObject16, OleLoad16 stubs. svn path=/trunk/; revision=17678
2005-09-05 21:56:14 +00:00
static inline StorageImpl *impl_from_IPropertySetStorage( IPropertySetStorage *iface )
{
return CONTAINING_RECORD(iface, StorageImpl, base.IPropertySetStorage_iface);
Sync to Wine-20050830: Francois Gouget <fgouget@free.fr> - Use LPSTORAGE to better match the PSDK. Document the real SEGPTR type using the standard documentation mechanisms. Fixes winapi_check warnings. Robert Shearman <rob@codeweavers.com> - Remove unused thread handle entry from the apartment structure. - Implement IMarshal on proxies so that we don't end up with proxies to proxies, causing potential deadlock issues and performance problems. - Add a test for this situation and remove the todo_wine from another test that now succeeds. - Add stub for CoAllowSetForegroundWindow. Vincent Beron <vberon@mecano.gme.usherb.ca> - Remove local declarations already in included public headers. - Correct mismatches between spec files and comments about export number. Alexandre Julliard <julliard@winehq.org> - Uncomment the typedef in the DECLARE_INTERFACE macro, and get rid of duplicate typedefs. - Use the proper WOW functions everywhere instead of the K32WOW variant. - Don't prefix the functions DllCanUnloadNow, DllGetClassObject and Dll(Un)RegisterServer with the dll name so that the compiler can check the prototypes. - Remove duplicate definition of FILE_BEGIN. - Replace the _ICOM_THIS_From macros by inline functions the way it's already done in shelllink.c. Mike McCormack <mike@codeweavers.com> - Warning fixes for gcc 4.0. - Fix some gcc 4.0 warnings. - return a precomputed result for a NULL string - pass strlen an LPSTR to eliminate a sign warning Marcus Meissner <marcus@jet.franken.de> - Implemented ILockBytes16 (memorystream) support for the 16bit compound storage implementation. - Added ReadClassStg, OleDoAutoConvert, GetConvertStg implementations/stubs. Marcus Meissner <meissner@suse.de> - Added CoCreateInstance16, CoGetClassObject16, OleLoad16 stubs. svn path=/trunk/; revision=17678
2005-09-05 21:56:14 +00:00
}
Sync to Wine-20050310: Jon Griffiths <jon_p_griffiths@yahoo.com> - Documentation spelling fixes. Mike McCormack <mike@codeweavers.com> - Implement and test IPropertySetStorage. - Fix more incorrect uses of STGM_ enumerations. - Add struct StorageBaseImpl at the start of derived structures instead of trying to keep the first members the same. - StgOpenStorage shouldn't open zero length storage files. - Shared reading of storage files requires STGM_TRANSACTED. - Test and fix grfMode handling in StgOpenDocfile. - Implement StgSetTimes. Robert Shearman <rob@codeweavers.com> - Better tracing. - Small cleanup of creation functions. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. - Move marshaling state machine into stub manager from ifstub. - Add additional needed states for table-weak marshaling, as shown by tests. - Protect external reference count from underflows/overflows. - Make COM use the RPC runtime as the backend for RPC calls. Based on a patch by Ove Ksven. - Invoke objects in STA's in the correct thread by sending messages to the hidden apartment window. - Use I_RpcGetBuffer, instead of our own buffer routines to fix an occasional test crash caused by heap corruption. - Zero the memory block passed to RpcServerRegisterIfEx so we don't pass garbage in some of the fields we don't fill in. - Return the correct error code from create_server and fix two handle leaks. - TODO update. - Remove cruft left over from previous RPC backend implementation in the apartment structure. - Don't pass an IPID by value for proxy_manager_create_ifproxy. - Disable more of RPC_UnregisterInterface to prevent the RPC runtime using freed memory. - Rename various external RPC backend functions so that they all have the same "RPC_" prefix. - Reduce the timeout of the function that connects to a local server to 30s, like native. - Make each ifproxy have its own channel buffer to fix a bug where a proxy with multiple interfaces could invoke the wrong stub buffer on the server. - The Global Interface Table should do table-strong marshaling instead of normal marshaling so that an interface can be retrieved more than one time. Mike Hearn <mh@codeweavers.com> - Avoid infinite loop when doing a typelib marshalled IUnknown::QueryInterface by only doing an extra QI if requested IID is not equal to marshalled IID. Rob Shearman <rob@codeweavers.com> Mike Hearn <mh@codeweavers.com> - Add re-entrancy tests to the test suite. - Run RPCs on a new thread client side so we can pump the message loop. Juan Lang <juan_lang@yahoo.com> - Fix the calling convention of DllCanUnloadNow. - Move vtbl to end of file and get rid of unnecessary prototypes. - Implement StgCreatePropSetStg. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Paul Vriens <Paul.Vriens@xs4all.nl> - Added some TRACE statements. svn path=/trunk/; revision=14083
2005-03-14 23:17:44 +00:00
/* These are documented in MSDN,
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
* but they don't seem to be in any header file.
*/
#define PROPSETHDR_BYTEORDER_MAGIC 0xfffe
#define PROPSETHDR_OSVER_KIND_WIN16 0
#define PROPSETHDR_OSVER_KIND_MAC 1
#define PROPSETHDR_OSVER_KIND_WIN32 2
#define CP_UNICODE 1200
Sync to Wine-20050524: Alexandre Julliard <julliard@winehq.org> - Added rules for building import libraries in the individual dll makefiles, and added support for building a .def.a static import library too. - Removed unnecessary code in the 16-bit DllEntryPoint function of some dlls, and also fixed its ordinal in a few places. - Comment out stub WEP entry points so that we can call WEP for builtin dlls too. Juan Lang <juan_lang@yahoo.com> - Obvious fixes to PropVariantClear and PropVariantCopy for vector types. - Add a comment, and a no-op cleanup. - Differentiate between version 0 and version 1 property storages. - Store property names in the code page of the property set. - maintain proper byte order - maintain PROPSETFLAG_ANSI flag based on codepage - update comments - Correct/improve error checking in IPropertyStorage. - convert strings between property storage's code page and system code page - add tests for setting code page - fix tests and behavior to match WinXP - Define and use endian conversion macros for big-endian machines. Marcus Meissner <marcus@jet.franken.de> - Move the Dll init function to compobj.c to avoid having global variables. Remove need of ole32_main.h. - Make HGLOBALStream_* functions static. - Make _xmalloc16() static. - Staticify FTMarshalImpl definition. Francois Gouget <fgouget@free.fr> - Specify the proper call convention in the PropSysFreeString() implementation. - Tweak the API documentation to silence winapi_check warnings. Robert Shearman <rob@codeweavers.com> - Add error messages on failure in file moniker load function. - Fix incorrect pointer check in both monikers. - Fix max size calculation of item moniker to match native. - Add a generic moniker marshaler that works by saving & loading monikers to & from the stream. - Use the generic moniker marshal in the file & item monikers and add a class factory for each. - Implement IROTData::GetComparisonData for file & item monikers. - Add a useful trace message. - Fix more places where custom header size was calculated exclusive of the data size member. - Optimize custom marshaling by getting size before calling the custom marshaler so we can write the header before and not use a second stream. - Change remaining blocks of code with 2-space indentation to 4-space indentation. - Make vtables const. - Remove an unnecessary memcpy and let the compiler do the work. - Write custom header up to and including size, not excluding. - Add a stub implementation of CoIsHandlerConnected. - Marshal objects & monikers into the ROT. - Test for this behaviour. Mike McCormack <mike@codeweavers.com> - Remove unnecessary declarations and make functions static. - Remove forward declarations. - Make sure a stream can't be created in read only storage. - Fix a memory leak in the ole storage implementation. - Remove function prototypes. Kevin Koltzau <kevin@plop.org> - Implement Hash function on composite moniker. Jeff Latimer <jeffl@defcen.gov.au> - Implement the IEnumMoniker interface for the ROT and provide tests to exercise the interface. Pierre d'Herbemont <stegefin@free.fr> - Big Endian specific code fixes in order to conform with NONAMELESSSTRUCT. Matthew Mastracci <matt@aclaro.com> - Replace stub entry for StgOpenStorageEx with call to StgOpenStorage. - Replace StgCreateStorageEx stub with call to StgCreateDocfile and add required STGFMT_* enumerations. svn path=/trunk/; revision=15562
2005-05-28 09:30:04 +00:00
#define MAX_VERSION_0_PROP_NAME_LENGTH 256
#define CFTAG_WINDOWS (-1L)
#define CFTAG_MACINTOSH (-2L)
#define CFTAG_FMTID (-3L)
#define CFTAG_NODATA 0L
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
typedef struct tagPROPERTYSETHEADER
{
WORD wByteOrder; /* always 0xfffe */
WORD wFormat; /* can be zero or one */
DWORD dwOSVer; /* OS version of originating system */
CLSID clsid; /* application CLSID */
DWORD reserved; /* always 1 */
} PROPERTYSETHEADER;
typedef struct tagFORMATIDOFFSET
{
FMTID fmtid;
DWORD dwOffset; /* from beginning of stream */
} FORMATIDOFFSET;
typedef struct tagPROPERTYSECTIONHEADER
{
DWORD cbSection;
DWORD cProperties;
} PROPERTYSECTIONHEADER;
typedef struct tagPROPERTYIDOFFSET
{
DWORD propid;
DWORD dwOffset; /* from beginning of section */
} PROPERTYIDOFFSET;
typedef struct tagPropertyStorage_impl PropertyStorage_impl;
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
/* Initializes the property storage from the stream (and undoes any uncommitted
* changes in the process.) Returns an error if there is an error reading or
* if the stream format doesn't match what's expected.
*/
static HRESULT PropertyStorage_ReadFromStream(PropertyStorage_impl *);
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
static HRESULT PropertyStorage_WriteToStream(PropertyStorage_impl *);
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
/* Creates the dictionaries used by the property storage. If successful, all
* the dictionaries have been created. If failed, none has been. (This makes
* it a bit easier to deal with destroying them.)
*/
static HRESULT PropertyStorage_CreateDictionaries(PropertyStorage_impl *);
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
static void PropertyStorage_DestroyDictionaries(PropertyStorage_impl *);
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
Sync to Wine-20050524: Alexandre Julliard <julliard@winehq.org> - Added rules for building import libraries in the individual dll makefiles, and added support for building a .def.a static import library too. - Removed unnecessary code in the 16-bit DllEntryPoint function of some dlls, and also fixed its ordinal in a few places. - Comment out stub WEP entry points so that we can call WEP for builtin dlls too. Juan Lang <juan_lang@yahoo.com> - Obvious fixes to PropVariantClear and PropVariantCopy for vector types. - Add a comment, and a no-op cleanup. - Differentiate between version 0 and version 1 property storages. - Store property names in the code page of the property set. - maintain proper byte order - maintain PROPSETFLAG_ANSI flag based on codepage - update comments - Correct/improve error checking in IPropertyStorage. - convert strings between property storage's code page and system code page - add tests for setting code page - fix tests and behavior to match WinXP - Define and use endian conversion macros for big-endian machines. Marcus Meissner <marcus@jet.franken.de> - Move the Dll init function to compobj.c to avoid having global variables. Remove need of ole32_main.h. - Make HGLOBALStream_* functions static. - Make _xmalloc16() static. - Staticify FTMarshalImpl definition. Francois Gouget <fgouget@free.fr> - Specify the proper call convention in the PropSysFreeString() implementation. - Tweak the API documentation to silence winapi_check warnings. Robert Shearman <rob@codeweavers.com> - Add error messages on failure in file moniker load function. - Fix incorrect pointer check in both monikers. - Fix max size calculation of item moniker to match native. - Add a generic moniker marshaler that works by saving & loading monikers to & from the stream. - Use the generic moniker marshal in the file & item monikers and add a class factory for each. - Implement IROTData::GetComparisonData for file & item monikers. - Add a useful trace message. - Fix more places where custom header size was calculated exclusive of the data size member. - Optimize custom marshaling by getting size before calling the custom marshaler so we can write the header before and not use a second stream. - Change remaining blocks of code with 2-space indentation to 4-space indentation. - Make vtables const. - Remove an unnecessary memcpy and let the compiler do the work. - Write custom header up to and including size, not excluding. - Add a stub implementation of CoIsHandlerConnected. - Marshal objects & monikers into the ROT. - Test for this behaviour. Mike McCormack <mike@codeweavers.com> - Remove unnecessary declarations and make functions static. - Remove forward declarations. - Make sure a stream can't be created in read only storage. - Fix a memory leak in the ole storage implementation. - Remove function prototypes. Kevin Koltzau <kevin@plop.org> - Implement Hash function on composite moniker. Jeff Latimer <jeffl@defcen.gov.au> - Implement the IEnumMoniker interface for the ROT and provide tests to exercise the interface. Pierre d'Herbemont <stegefin@free.fr> - Big Endian specific code fixes in order to conform with NONAMELESSSTRUCT. Matthew Mastracci <matt@aclaro.com> - Replace stub entry for StgOpenStorageEx with call to StgOpenStorage. - Replace StgCreateStorageEx stub with call to StgCreateDocfile and add required STGFMT_* enumerations. svn path=/trunk/; revision=15562
2005-05-28 09:30:04 +00:00
/* Copies from propvar to prop. If propvar's type is VT_LPSTR, copies the
* string using PropertyStorage_StringCopy.
*/
static HRESULT PropertyStorage_PropVariantCopy(PROPVARIANT *prop,
const PROPVARIANT *propvar, LCID targetCP, LCID srcCP);
/* Copies the string src, which is encoded using code page srcCP, and returns
* it in *dst, in the code page specified by targetCP. The returned string is
* allocated using CoTaskMemAlloc.
* If srcCP is CP_UNICODE, src is in fact an LPCWSTR. Similarly, if targetCP
* is CP_UNICODE, the returned string is in fact an LPWSTR.
* Returns S_OK on success, something else on failure.
*/
static HRESULT PropertyStorage_StringCopy(LPCSTR src, LCID srcCP, LPSTR *dst,
LCID targetCP);
Sync to Wine-20050628: Robert Shearman <rob@codeweavers.com> - Convert some registry helper functions to use unicode versions of CLSID & registry functions (untested). - Add registry entries for local-only OLE interfaces. - Change IUnknown to local interface. - IUnknown isn't a remotable interface so the stub manager shouldn't need a marshaller for it. - Change the RPC code to use the unicode versions of the CLSID & registry functions. - Don't disconnect proxies flagged with SORFP_NOLIFETIMEMGMT. It makes no sense and only causes trouble for proxies that depend on these proxies being available. - Change some of the registry helper functions to use the unicode versions of the CLSID & registry functions. - Reindent CoGetClassObject and output an error message if the class isn't registered. - Add tests for the touched functions. Dmitry Timoshkov <dmitry@codeweavers.com> - Make remaining OLE interface vtables const. Richard Cohen <richard@daijobu.co.uk> - Base FileMonikerImpl_Save() on XP. - Correct handling of Unicode strings & multibyte locales. - More error checking. - Change ERR to WARN. - Match Windows quick & dirty estimate for GetSizeMax(). Stefan Huehner <stefan@huehner.org> - Fix some more -Wstrict-prototypes warnings. Mike Hearn <mike@navi.cx> - Add some tracing to the IRemUnknown RpcProxyBuffer implementation. Eric Pouech <pouech-eric@wanadoo.fr> - Const correctness fixes. Richard Cohen <richard@daijobu.co.uk> - IEnum::Clone shouldn't do a Reset. Marcus Meissner <marcus@jet.franken.de> - Removed CLSID_CompositeMoniker (conflicting with static definition). Alexandre Julliard <julliard@winehq.org> - Sort entry points alphabetically. svn path=/trunk/; revision=17036
2005-08-03 22:31:39 +00:00
static const IPropertyStorageVtbl IPropertyStorage_Vtbl;
static const IEnumSTATPROPSETSTGVtbl IEnumSTATPROPSETSTG_Vtbl;
static const IEnumSTATPROPSTGVtbl IEnumSTATPROPSTG_Vtbl;
static HRESULT create_EnumSTATPROPSETSTG(StorageImpl *, IEnumSTATPROPSETSTG**);
static HRESULT create_EnumSTATPROPSTG(PropertyStorage_impl *, IEnumSTATPROPSTG**);
Sync to Wine-20050310: Jon Griffiths <jon_p_griffiths@yahoo.com> - Documentation spelling fixes. Mike McCormack <mike@codeweavers.com> - Implement and test IPropertySetStorage. - Fix more incorrect uses of STGM_ enumerations. - Add struct StorageBaseImpl at the start of derived structures instead of trying to keep the first members the same. - StgOpenStorage shouldn't open zero length storage files. - Shared reading of storage files requires STGM_TRANSACTED. - Test and fix grfMode handling in StgOpenDocfile. - Implement StgSetTimes. Robert Shearman <rob@codeweavers.com> - Better tracing. - Small cleanup of creation functions. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. - Move marshaling state machine into stub manager from ifstub. - Add additional needed states for table-weak marshaling, as shown by tests. - Protect external reference count from underflows/overflows. - Make COM use the RPC runtime as the backend for RPC calls. Based on a patch by Ove Ksven. - Invoke objects in STA's in the correct thread by sending messages to the hidden apartment window. - Use I_RpcGetBuffer, instead of our own buffer routines to fix an occasional test crash caused by heap corruption. - Zero the memory block passed to RpcServerRegisterIfEx so we don't pass garbage in some of the fields we don't fill in. - Return the correct error code from create_server and fix two handle leaks. - TODO update. - Remove cruft left over from previous RPC backend implementation in the apartment structure. - Don't pass an IPID by value for proxy_manager_create_ifproxy. - Disable more of RPC_UnregisterInterface to prevent the RPC runtime using freed memory. - Rename various external RPC backend functions so that they all have the same "RPC_" prefix. - Reduce the timeout of the function that connects to a local server to 30s, like native. - Make each ifproxy have its own channel buffer to fix a bug where a proxy with multiple interfaces could invoke the wrong stub buffer on the server. - The Global Interface Table should do table-strong marshaling instead of normal marshaling so that an interface can be retrieved more than one time. Mike Hearn <mh@codeweavers.com> - Avoid infinite loop when doing a typelib marshalled IUnknown::QueryInterface by only doing an extra QI if requested IID is not equal to marshalled IID. Rob Shearman <rob@codeweavers.com> Mike Hearn <mh@codeweavers.com> - Add re-entrancy tests to the test suite. - Run RPCs on a new thread client side so we can pump the message loop. Juan Lang <juan_lang@yahoo.com> - Fix the calling convention of DllCanUnloadNow. - Move vtbl to end of file and get rid of unnecessary prototypes. - Implement StgCreatePropSetStg. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Paul Vriens <Paul.Vriens@xs4all.nl> - Added some TRACE statements. svn path=/trunk/; revision=14083
2005-03-14 23:17:44 +00:00
/***********************************************************************
* Implementation of IPropertyStorage
*/
struct tagPropertyStorage_impl
Sync to Wine-20050310: Jon Griffiths <jon_p_griffiths@yahoo.com> - Documentation spelling fixes. Mike McCormack <mike@codeweavers.com> - Implement and test IPropertySetStorage. - Fix more incorrect uses of STGM_ enumerations. - Add struct StorageBaseImpl at the start of derived structures instead of trying to keep the first members the same. - StgOpenStorage shouldn't open zero length storage files. - Shared reading of storage files requires STGM_TRANSACTED. - Test and fix grfMode handling in StgOpenDocfile. - Implement StgSetTimes. Robert Shearman <rob@codeweavers.com> - Better tracing. - Small cleanup of creation functions. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. - Move marshaling state machine into stub manager from ifstub. - Add additional needed states for table-weak marshaling, as shown by tests. - Protect external reference count from underflows/overflows. - Make COM use the RPC runtime as the backend for RPC calls. Based on a patch by Ove Ksven. - Invoke objects in STA's in the correct thread by sending messages to the hidden apartment window. - Use I_RpcGetBuffer, instead of our own buffer routines to fix an occasional test crash caused by heap corruption. - Zero the memory block passed to RpcServerRegisterIfEx so we don't pass garbage in some of the fields we don't fill in. - Return the correct error code from create_server and fix two handle leaks. - TODO update. - Remove cruft left over from previous RPC backend implementation in the apartment structure. - Don't pass an IPID by value for proxy_manager_create_ifproxy. - Disable more of RPC_UnregisterInterface to prevent the RPC runtime using freed memory. - Rename various external RPC backend functions so that they all have the same "RPC_" prefix. - Reduce the timeout of the function that connects to a local server to 30s, like native. - Make each ifproxy have its own channel buffer to fix a bug where a proxy with multiple interfaces could invoke the wrong stub buffer on the server. - The Global Interface Table should do table-strong marshaling instead of normal marshaling so that an interface can be retrieved more than one time. Mike Hearn <mh@codeweavers.com> - Avoid infinite loop when doing a typelib marshalled IUnknown::QueryInterface by only doing an extra QI if requested IID is not equal to marshalled IID. Rob Shearman <rob@codeweavers.com> Mike Hearn <mh@codeweavers.com> - Add re-entrancy tests to the test suite. - Run RPCs on a new thread client side so we can pump the message loop. Juan Lang <juan_lang@yahoo.com> - Fix the calling convention of DllCanUnloadNow. - Move vtbl to end of file and get rid of unnecessary prototypes. - Implement StgCreatePropSetStg. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Paul Vriens <Paul.Vriens@xs4all.nl> - Added some TRACE statements. svn path=/trunk/; revision=14083
2005-03-14 23:17:44 +00:00
{
IPropertyStorage IPropertyStorage_iface;
Sync to Wine-20050725: Robert Shearman <rob@codeweavers.com> - Marshal return value from IRemUnknown_RemQueryInterface. - We should be starting with 1 reference. - IRpcStubBuffer_Disconnect can be called more than once. - Silence now noisy error messages caused by changes in the way we call ipid_to_stubmanager. Move the error message to the one place it is needed. - By-pass the RPC runtime if possible when calling an STA by posting a message directly to the apartment window for it to process. Fixes a deadlock in InstallShield caused by having to create a thread when freeing an object that comes from an STA apartment. Added tests that fail without this fix. - Hack around broken state management so InstallShield works. - Delete the stub manager outside of the apartment critical section because the deletion may require the object to re-enter the apartment. - Always query for the correct stub interface, otherwise we will be pointing to the completely wrong object when a proxy does a queryinterface. - Remove assumption that the stub buffer will handle the lifetime of the object. Alex Villacis Lasso <a_villacis@palosanto.com> - Initialize RegisteredClass properly in CoRegisterClassObject to prevent crash in CoRevokeClassObject when accessing (uninitialized) pMarshalledData. Mike McCormack <mike@codeweavers.com> - Fix gcc 4.0 -Wpointer-sign warnings. Vitaly Lipatov <lav@etersoft.ru> - Added some documentation. Stefan Huehner <stefan@huehner.org> - Fix some missing-declarations warnings. Marcus Meissner <meissner@suse.de> - 16bit interfaces are cdecl, so drop the WINAPI. - 16bit COM interfaces are cdecl, not WINAPI. - OleInitializeWOW gets 2 arguments. - Added OleSetMenuDescriptor16 stub. Marcus Meissner <marcus@jet.franken.de> - Implemented IsValidInterface16, CoMemAlloc. Added debug to HGLOBALLockBytes16_QueryInterface. svn path=/trunk/; revision=17332
2005-08-12 17:19:46 +00:00
LONG ref;
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
CRITICAL_SECTION cs;
Sync to Wine-20050310: Jon Griffiths <jon_p_griffiths@yahoo.com> - Documentation spelling fixes. Mike McCormack <mike@codeweavers.com> - Implement and test IPropertySetStorage. - Fix more incorrect uses of STGM_ enumerations. - Add struct StorageBaseImpl at the start of derived structures instead of trying to keep the first members the same. - StgOpenStorage shouldn't open zero length storage files. - Shared reading of storage files requires STGM_TRANSACTED. - Test and fix grfMode handling in StgOpenDocfile. - Implement StgSetTimes. Robert Shearman <rob@codeweavers.com> - Better tracing. - Small cleanup of creation functions. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. - Move marshaling state machine into stub manager from ifstub. - Add additional needed states for table-weak marshaling, as shown by tests. - Protect external reference count from underflows/overflows. - Make COM use the RPC runtime as the backend for RPC calls. Based on a patch by Ove Ksven. - Invoke objects in STA's in the correct thread by sending messages to the hidden apartment window. - Use I_RpcGetBuffer, instead of our own buffer routines to fix an occasional test crash caused by heap corruption. - Zero the memory block passed to RpcServerRegisterIfEx so we don't pass garbage in some of the fields we don't fill in. - Return the correct error code from create_server and fix two handle leaks. - TODO update. - Remove cruft left over from previous RPC backend implementation in the apartment structure. - Don't pass an IPID by value for proxy_manager_create_ifproxy. - Disable more of RPC_UnregisterInterface to prevent the RPC runtime using freed memory. - Rename various external RPC backend functions so that they all have the same "RPC_" prefix. - Reduce the timeout of the function that connects to a local server to 30s, like native. - Make each ifproxy have its own channel buffer to fix a bug where a proxy with multiple interfaces could invoke the wrong stub buffer on the server. - The Global Interface Table should do table-strong marshaling instead of normal marshaling so that an interface can be retrieved more than one time. Mike Hearn <mh@codeweavers.com> - Avoid infinite loop when doing a typelib marshalled IUnknown::QueryInterface by only doing an extra QI if requested IID is not equal to marshalled IID. Rob Shearman <rob@codeweavers.com> Mike Hearn <mh@codeweavers.com> - Add re-entrancy tests to the test suite. - Run RPCs on a new thread client side so we can pump the message loop. Juan Lang <juan_lang@yahoo.com> - Fix the calling convention of DllCanUnloadNow. - Move vtbl to end of file and get rid of unnecessary prototypes. - Implement StgCreatePropSetStg. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Paul Vriens <Paul.Vriens@xs4all.nl> - Added some TRACE statements. svn path=/trunk/; revision=14083
2005-03-14 23:17:44 +00:00
IStream *stm;
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
BOOL dirty;
FMTID fmtid;
CLSID clsid;
Sync to Wine-20050524: Alexandre Julliard <julliard@winehq.org> - Added rules for building import libraries in the individual dll makefiles, and added support for building a .def.a static import library too. - Removed unnecessary code in the 16-bit DllEntryPoint function of some dlls, and also fixed its ordinal in a few places. - Comment out stub WEP entry points so that we can call WEP for builtin dlls too. Juan Lang <juan_lang@yahoo.com> - Obvious fixes to PropVariantClear and PropVariantCopy for vector types. - Add a comment, and a no-op cleanup. - Differentiate between version 0 and version 1 property storages. - Store property names in the code page of the property set. - maintain proper byte order - maintain PROPSETFLAG_ANSI flag based on codepage - update comments - Correct/improve error checking in IPropertyStorage. - convert strings between property storage's code page and system code page - add tests for setting code page - fix tests and behavior to match WinXP - Define and use endian conversion macros for big-endian machines. Marcus Meissner <marcus@jet.franken.de> - Move the Dll init function to compobj.c to avoid having global variables. Remove need of ole32_main.h. - Make HGLOBALStream_* functions static. - Make _xmalloc16() static. - Staticify FTMarshalImpl definition. Francois Gouget <fgouget@free.fr> - Specify the proper call convention in the PropSysFreeString() implementation. - Tweak the API documentation to silence winapi_check warnings. Robert Shearman <rob@codeweavers.com> - Add error messages on failure in file moniker load function. - Fix incorrect pointer check in both monikers. - Fix max size calculation of item moniker to match native. - Add a generic moniker marshaler that works by saving & loading monikers to & from the stream. - Use the generic moniker marshal in the file & item monikers and add a class factory for each. - Implement IROTData::GetComparisonData for file & item monikers. - Add a useful trace message. - Fix more places where custom header size was calculated exclusive of the data size member. - Optimize custom marshaling by getting size before calling the custom marshaler so we can write the header before and not use a second stream. - Change remaining blocks of code with 2-space indentation to 4-space indentation. - Make vtables const. - Remove an unnecessary memcpy and let the compiler do the work. - Write custom header up to and including size, not excluding. - Add a stub implementation of CoIsHandlerConnected. - Marshal objects & monikers into the ROT. - Test for this behaviour. Mike McCormack <mike@codeweavers.com> - Remove unnecessary declarations and make functions static. - Remove forward declarations. - Make sure a stream can't be created in read only storage. - Fix a memory leak in the ole storage implementation. - Remove function prototypes. Kevin Koltzau <kevin@plop.org> - Implement Hash function on composite moniker. Jeff Latimer <jeffl@defcen.gov.au> - Implement the IEnumMoniker interface for the ROT and provide tests to exercise the interface. Pierre d'Herbemont <stegefin@free.fr> - Big Endian specific code fixes in order to conform with NONAMELESSSTRUCT. Matthew Mastracci <matt@aclaro.com> - Replace stub entry for StgOpenStorageEx with call to StgOpenStorage. - Replace StgCreateStorageEx stub with call to StgCreateDocfile and add required STGFMT_* enumerations. svn path=/trunk/; revision=15562
2005-05-28 09:30:04 +00:00
WORD format;
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
DWORD originatorOS;
DWORD grfFlags;
DWORD grfMode;
UINT codePage;
LCID locale;
PROPID highestProp;
struct dictionary *name_to_propid;
struct dictionary *propid_to_name;
struct dictionary *propid_to_prop;
};
Sync to Wine-20050310: Jon Griffiths <jon_p_griffiths@yahoo.com> - Documentation spelling fixes. Mike McCormack <mike@codeweavers.com> - Implement and test IPropertySetStorage. - Fix more incorrect uses of STGM_ enumerations. - Add struct StorageBaseImpl at the start of derived structures instead of trying to keep the first members the same. - StgOpenStorage shouldn't open zero length storage files. - Shared reading of storage files requires STGM_TRANSACTED. - Test and fix grfMode handling in StgOpenDocfile. - Implement StgSetTimes. Robert Shearman <rob@codeweavers.com> - Better tracing. - Small cleanup of creation functions. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. - Move marshaling state machine into stub manager from ifstub. - Add additional needed states for table-weak marshaling, as shown by tests. - Protect external reference count from underflows/overflows. - Make COM use the RPC runtime as the backend for RPC calls. Based on a patch by Ove Ksven. - Invoke objects in STA's in the correct thread by sending messages to the hidden apartment window. - Use I_RpcGetBuffer, instead of our own buffer routines to fix an occasional test crash caused by heap corruption. - Zero the memory block passed to RpcServerRegisterIfEx so we don't pass garbage in some of the fields we don't fill in. - Return the correct error code from create_server and fix two handle leaks. - TODO update. - Remove cruft left over from previous RPC backend implementation in the apartment structure. - Don't pass an IPID by value for proxy_manager_create_ifproxy. - Disable more of RPC_UnregisterInterface to prevent the RPC runtime using freed memory. - Rename various external RPC backend functions so that they all have the same "RPC_" prefix. - Reduce the timeout of the function that connects to a local server to 30s, like native. - Make each ifproxy have its own channel buffer to fix a bug where a proxy with multiple interfaces could invoke the wrong stub buffer on the server. - The Global Interface Table should do table-strong marshaling instead of normal marshaling so that an interface can be retrieved more than one time. Mike Hearn <mh@codeweavers.com> - Avoid infinite loop when doing a typelib marshalled IUnknown::QueryInterface by only doing an extra QI if requested IID is not equal to marshalled IID. Rob Shearman <rob@codeweavers.com> Mike Hearn <mh@codeweavers.com> - Add re-entrancy tests to the test suite. - Run RPCs on a new thread client side so we can pump the message loop. Juan Lang <juan_lang@yahoo.com> - Fix the calling convention of DllCanUnloadNow. - Move vtbl to end of file and get rid of unnecessary prototypes. - Implement StgCreatePropSetStg. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Paul Vriens <Paul.Vriens@xs4all.nl> - Added some TRACE statements. svn path=/trunk/; revision=14083
2005-03-14 23:17:44 +00:00
static inline PropertyStorage_impl *impl_from_IPropertyStorage(IPropertyStorage *iface)
{
return CONTAINING_RECORD(iface, PropertyStorage_impl, IPropertyStorage_iface);
}
Sync to Wine-20050310: Jon Griffiths <jon_p_griffiths@yahoo.com> - Documentation spelling fixes. Mike McCormack <mike@codeweavers.com> - Implement and test IPropertySetStorage. - Fix more incorrect uses of STGM_ enumerations. - Add struct StorageBaseImpl at the start of derived structures instead of trying to keep the first members the same. - StgOpenStorage shouldn't open zero length storage files. - Shared reading of storage files requires STGM_TRANSACTED. - Test and fix grfMode handling in StgOpenDocfile. - Implement StgSetTimes. Robert Shearman <rob@codeweavers.com> - Better tracing. - Small cleanup of creation functions. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. - Move marshaling state machine into stub manager from ifstub. - Add additional needed states for table-weak marshaling, as shown by tests. - Protect external reference count from underflows/overflows. - Make COM use the RPC runtime as the backend for RPC calls. Based on a patch by Ove Ksven. - Invoke objects in STA's in the correct thread by sending messages to the hidden apartment window. - Use I_RpcGetBuffer, instead of our own buffer routines to fix an occasional test crash caused by heap corruption. - Zero the memory block passed to RpcServerRegisterIfEx so we don't pass garbage in some of the fields we don't fill in. - Return the correct error code from create_server and fix two handle leaks. - TODO update. - Remove cruft left over from previous RPC backend implementation in the apartment structure. - Don't pass an IPID by value for proxy_manager_create_ifproxy. - Disable more of RPC_UnregisterInterface to prevent the RPC runtime using freed memory. - Rename various external RPC backend functions so that they all have the same "RPC_" prefix. - Reduce the timeout of the function that connects to a local server to 30s, like native. - Make each ifproxy have its own channel buffer to fix a bug where a proxy with multiple interfaces could invoke the wrong stub buffer on the server. - The Global Interface Table should do table-strong marshaling instead of normal marshaling so that an interface can be retrieved more than one time. Mike Hearn <mh@codeweavers.com> - Avoid infinite loop when doing a typelib marshalled IUnknown::QueryInterface by only doing an extra QI if requested IID is not equal to marshalled IID. Rob Shearman <rob@codeweavers.com> Mike Hearn <mh@codeweavers.com> - Add re-entrancy tests to the test suite. - Run RPCs on a new thread client side so we can pump the message loop. Juan Lang <juan_lang@yahoo.com> - Fix the calling convention of DllCanUnloadNow. - Move vtbl to end of file and get rid of unnecessary prototypes. - Implement StgCreatePropSetStg. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Paul Vriens <Paul.Vriens@xs4all.nl> - Added some TRACE statements. svn path=/trunk/; revision=14083
2005-03-14 23:17:44 +00:00
/************************************************************************
* IPropertyStorage_fnQueryInterface (IPropertyStorage)
*/
static HRESULT WINAPI IPropertyStorage_fnQueryInterface(
IPropertyStorage *iface,
REFIID riid,
void** ppvObject)
{
PropertyStorage_impl *This = impl_from_IPropertyStorage(iface);
Sync to Wine-20050310: Jon Griffiths <jon_p_griffiths@yahoo.com> - Documentation spelling fixes. Mike McCormack <mike@codeweavers.com> - Implement and test IPropertySetStorage. - Fix more incorrect uses of STGM_ enumerations. - Add struct StorageBaseImpl at the start of derived structures instead of trying to keep the first members the same. - StgOpenStorage shouldn't open zero length storage files. - Shared reading of storage files requires STGM_TRANSACTED. - Test and fix grfMode handling in StgOpenDocfile. - Implement StgSetTimes. Robert Shearman <rob@codeweavers.com> - Better tracing. - Small cleanup of creation functions. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. - Move marshaling state machine into stub manager from ifstub. - Add additional needed states for table-weak marshaling, as shown by tests. - Protect external reference count from underflows/overflows. - Make COM use the RPC runtime as the backend for RPC calls. Based on a patch by Ove Ksven. - Invoke objects in STA's in the correct thread by sending messages to the hidden apartment window. - Use I_RpcGetBuffer, instead of our own buffer routines to fix an occasional test crash caused by heap corruption. - Zero the memory block passed to RpcServerRegisterIfEx so we don't pass garbage in some of the fields we don't fill in. - Return the correct error code from create_server and fix two handle leaks. - TODO update. - Remove cruft left over from previous RPC backend implementation in the apartment structure. - Don't pass an IPID by value for proxy_manager_create_ifproxy. - Disable more of RPC_UnregisterInterface to prevent the RPC runtime using freed memory. - Rename various external RPC backend functions so that they all have the same "RPC_" prefix. - Reduce the timeout of the function that connects to a local server to 30s, like native. - Make each ifproxy have its own channel buffer to fix a bug where a proxy with multiple interfaces could invoke the wrong stub buffer on the server. - The Global Interface Table should do table-strong marshaling instead of normal marshaling so that an interface can be retrieved more than one time. Mike Hearn <mh@codeweavers.com> - Avoid infinite loop when doing a typelib marshalled IUnknown::QueryInterface by only doing an extra QI if requested IID is not equal to marshalled IID. Rob Shearman <rob@codeweavers.com> Mike Hearn <mh@codeweavers.com> - Add re-entrancy tests to the test suite. - Run RPCs on a new thread client side so we can pump the message loop. Juan Lang <juan_lang@yahoo.com> - Fix the calling convention of DllCanUnloadNow. - Move vtbl to end of file and get rid of unnecessary prototypes. - Implement StgCreatePropSetStg. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Paul Vriens <Paul.Vriens@xs4all.nl> - Added some TRACE statements. svn path=/trunk/; revision=14083
2005-03-14 23:17:44 +00:00
TRACE("(%p, %s, %p)\n", This, debugstr_guid(riid), ppvObject);
if (!ppvObject)
Sync to Wine-20050310: Jon Griffiths <jon_p_griffiths@yahoo.com> - Documentation spelling fixes. Mike McCormack <mike@codeweavers.com> - Implement and test IPropertySetStorage. - Fix more incorrect uses of STGM_ enumerations. - Add struct StorageBaseImpl at the start of derived structures instead of trying to keep the first members the same. - StgOpenStorage shouldn't open zero length storage files. - Shared reading of storage files requires STGM_TRANSACTED. - Test and fix grfMode handling in StgOpenDocfile. - Implement StgSetTimes. Robert Shearman <rob@codeweavers.com> - Better tracing. - Small cleanup of creation functions. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. - Move marshaling state machine into stub manager from ifstub. - Add additional needed states for table-weak marshaling, as shown by tests. - Protect external reference count from underflows/overflows. - Make COM use the RPC runtime as the backend for RPC calls. Based on a patch by Ove Ksven. - Invoke objects in STA's in the correct thread by sending messages to the hidden apartment window. - Use I_RpcGetBuffer, instead of our own buffer routines to fix an occasional test crash caused by heap corruption. - Zero the memory block passed to RpcServerRegisterIfEx so we don't pass garbage in some of the fields we don't fill in. - Return the correct error code from create_server and fix two handle leaks. - TODO update. - Remove cruft left over from previous RPC backend implementation in the apartment structure. - Don't pass an IPID by value for proxy_manager_create_ifproxy. - Disable more of RPC_UnregisterInterface to prevent the RPC runtime using freed memory. - Rename various external RPC backend functions so that they all have the same "RPC_" prefix. - Reduce the timeout of the function that connects to a local server to 30s, like native. - Make each ifproxy have its own channel buffer to fix a bug where a proxy with multiple interfaces could invoke the wrong stub buffer on the server. - The Global Interface Table should do table-strong marshaling instead of normal marshaling so that an interface can be retrieved more than one time. Mike Hearn <mh@codeweavers.com> - Avoid infinite loop when doing a typelib marshalled IUnknown::QueryInterface by only doing an extra QI if requested IID is not equal to marshalled IID. Rob Shearman <rob@codeweavers.com> Mike Hearn <mh@codeweavers.com> - Add re-entrancy tests to the test suite. - Run RPCs on a new thread client side so we can pump the message loop. Juan Lang <juan_lang@yahoo.com> - Fix the calling convention of DllCanUnloadNow. - Move vtbl to end of file and get rid of unnecessary prototypes. - Implement StgCreatePropSetStg. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Paul Vriens <Paul.Vriens@xs4all.nl> - Added some TRACE statements. svn path=/trunk/; revision=14083
2005-03-14 23:17:44 +00:00
return E_INVALIDARG;
*ppvObject = 0;
if (IsEqualGUID(&IID_IUnknown, riid) ||
IsEqualGUID(&IID_IPropertyStorage, riid))
{
IPropertyStorage_AddRef(iface);
*ppvObject = iface;
Sync to Wine-20050310: Jon Griffiths <jon_p_griffiths@yahoo.com> - Documentation spelling fixes. Mike McCormack <mike@codeweavers.com> - Implement and test IPropertySetStorage. - Fix more incorrect uses of STGM_ enumerations. - Add struct StorageBaseImpl at the start of derived structures instead of trying to keep the first members the same. - StgOpenStorage shouldn't open zero length storage files. - Shared reading of storage files requires STGM_TRANSACTED. - Test and fix grfMode handling in StgOpenDocfile. - Implement StgSetTimes. Robert Shearman <rob@codeweavers.com> - Better tracing. - Small cleanup of creation functions. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. - Move marshaling state machine into stub manager from ifstub. - Add additional needed states for table-weak marshaling, as shown by tests. - Protect external reference count from underflows/overflows. - Make COM use the RPC runtime as the backend for RPC calls. Based on a patch by Ove Ksven. - Invoke objects in STA's in the correct thread by sending messages to the hidden apartment window. - Use I_RpcGetBuffer, instead of our own buffer routines to fix an occasional test crash caused by heap corruption. - Zero the memory block passed to RpcServerRegisterIfEx so we don't pass garbage in some of the fields we don't fill in. - Return the correct error code from create_server and fix two handle leaks. - TODO update. - Remove cruft left over from previous RPC backend implementation in the apartment structure. - Don't pass an IPID by value for proxy_manager_create_ifproxy. - Disable more of RPC_UnregisterInterface to prevent the RPC runtime using freed memory. - Rename various external RPC backend functions so that they all have the same "RPC_" prefix. - Reduce the timeout of the function that connects to a local server to 30s, like native. - Make each ifproxy have its own channel buffer to fix a bug where a proxy with multiple interfaces could invoke the wrong stub buffer on the server. - The Global Interface Table should do table-strong marshaling instead of normal marshaling so that an interface can be retrieved more than one time. Mike Hearn <mh@codeweavers.com> - Avoid infinite loop when doing a typelib marshalled IUnknown::QueryInterface by only doing an extra QI if requested IID is not equal to marshalled IID. Rob Shearman <rob@codeweavers.com> Mike Hearn <mh@codeweavers.com> - Add re-entrancy tests to the test suite. - Run RPCs on a new thread client side so we can pump the message loop. Juan Lang <juan_lang@yahoo.com> - Fix the calling convention of DllCanUnloadNow. - Move vtbl to end of file and get rid of unnecessary prototypes. - Implement StgCreatePropSetStg. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Paul Vriens <Paul.Vriens@xs4all.nl> - Added some TRACE statements. svn path=/trunk/; revision=14083
2005-03-14 23:17:44 +00:00
return S_OK;
}
return E_NOINTERFACE;
}
/************************************************************************
* IPropertyStorage_fnAddRef (IPropertyStorage)
*/
static ULONG WINAPI IPropertyStorage_fnAddRef(
IPropertyStorage *iface)
{
PropertyStorage_impl *This = impl_from_IPropertyStorage(iface);
Sync to Wine-20050310: Jon Griffiths <jon_p_griffiths@yahoo.com> - Documentation spelling fixes. Mike McCormack <mike@codeweavers.com> - Implement and test IPropertySetStorage. - Fix more incorrect uses of STGM_ enumerations. - Add struct StorageBaseImpl at the start of derived structures instead of trying to keep the first members the same. - StgOpenStorage shouldn't open zero length storage files. - Shared reading of storage files requires STGM_TRANSACTED. - Test and fix grfMode handling in StgOpenDocfile. - Implement StgSetTimes. Robert Shearman <rob@codeweavers.com> - Better tracing. - Small cleanup of creation functions. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. - Move marshaling state machine into stub manager from ifstub. - Add additional needed states for table-weak marshaling, as shown by tests. - Protect external reference count from underflows/overflows. - Make COM use the RPC runtime as the backend for RPC calls. Based on a patch by Ove Ksven. - Invoke objects in STA's in the correct thread by sending messages to the hidden apartment window. - Use I_RpcGetBuffer, instead of our own buffer routines to fix an occasional test crash caused by heap corruption. - Zero the memory block passed to RpcServerRegisterIfEx so we don't pass garbage in some of the fields we don't fill in. - Return the correct error code from create_server and fix two handle leaks. - TODO update. - Remove cruft left over from previous RPC backend implementation in the apartment structure. - Don't pass an IPID by value for proxy_manager_create_ifproxy. - Disable more of RPC_UnregisterInterface to prevent the RPC runtime using freed memory. - Rename various external RPC backend functions so that they all have the same "RPC_" prefix. - Reduce the timeout of the function that connects to a local server to 30s, like native. - Make each ifproxy have its own channel buffer to fix a bug where a proxy with multiple interfaces could invoke the wrong stub buffer on the server. - The Global Interface Table should do table-strong marshaling instead of normal marshaling so that an interface can be retrieved more than one time. Mike Hearn <mh@codeweavers.com> - Avoid infinite loop when doing a typelib marshalled IUnknown::QueryInterface by only doing an extra QI if requested IID is not equal to marshalled IID. Rob Shearman <rob@codeweavers.com> Mike Hearn <mh@codeweavers.com> - Add re-entrancy tests to the test suite. - Run RPCs on a new thread client side so we can pump the message loop. Juan Lang <juan_lang@yahoo.com> - Fix the calling convention of DllCanUnloadNow. - Move vtbl to end of file and get rid of unnecessary prototypes. - Implement StgCreatePropSetStg. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Paul Vriens <Paul.Vriens@xs4all.nl> - Added some TRACE statements. svn path=/trunk/; revision=14083
2005-03-14 23:17:44 +00:00
return InterlockedIncrement(&This->ref);
}
/************************************************************************
* IPropertyStorage_fnRelease (IPropertyStorage)
*/
static ULONG WINAPI IPropertyStorage_fnRelease(
IPropertyStorage *iface)
{
PropertyStorage_impl *This = impl_from_IPropertyStorage(iface);
Sync to Wine-20050310: Jon Griffiths <jon_p_griffiths@yahoo.com> - Documentation spelling fixes. Mike McCormack <mike@codeweavers.com> - Implement and test IPropertySetStorage. - Fix more incorrect uses of STGM_ enumerations. - Add struct StorageBaseImpl at the start of derived structures instead of trying to keep the first members the same. - StgOpenStorage shouldn't open zero length storage files. - Shared reading of storage files requires STGM_TRANSACTED. - Test and fix grfMode handling in StgOpenDocfile. - Implement StgSetTimes. Robert Shearman <rob@codeweavers.com> - Better tracing. - Small cleanup of creation functions. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. - Move marshaling state machine into stub manager from ifstub. - Add additional needed states for table-weak marshaling, as shown by tests. - Protect external reference count from underflows/overflows. - Make COM use the RPC runtime as the backend for RPC calls. Based on a patch by Ove Ksven. - Invoke objects in STA's in the correct thread by sending messages to the hidden apartment window. - Use I_RpcGetBuffer, instead of our own buffer routines to fix an occasional test crash caused by heap corruption. - Zero the memory block passed to RpcServerRegisterIfEx so we don't pass garbage in some of the fields we don't fill in. - Return the correct error code from create_server and fix two handle leaks. - TODO update. - Remove cruft left over from previous RPC backend implementation in the apartment structure. - Don't pass an IPID by value for proxy_manager_create_ifproxy. - Disable more of RPC_UnregisterInterface to prevent the RPC runtime using freed memory. - Rename various external RPC backend functions so that they all have the same "RPC_" prefix. - Reduce the timeout of the function that connects to a local server to 30s, like native. - Make each ifproxy have its own channel buffer to fix a bug where a proxy with multiple interfaces could invoke the wrong stub buffer on the server. - The Global Interface Table should do table-strong marshaling instead of normal marshaling so that an interface can be retrieved more than one time. Mike Hearn <mh@codeweavers.com> - Avoid infinite loop when doing a typelib marshalled IUnknown::QueryInterface by only doing an extra QI if requested IID is not equal to marshalled IID. Rob Shearman <rob@codeweavers.com> Mike Hearn <mh@codeweavers.com> - Add re-entrancy tests to the test suite. - Run RPCs on a new thread client side so we can pump the message loop. Juan Lang <juan_lang@yahoo.com> - Fix the calling convention of DllCanUnloadNow. - Move vtbl to end of file and get rid of unnecessary prototypes. - Implement StgCreatePropSetStg. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Paul Vriens <Paul.Vriens@xs4all.nl> - Added some TRACE statements. svn path=/trunk/; revision=14083
2005-03-14 23:17:44 +00:00
ULONG ref;
ref = InterlockedDecrement(&This->ref);
if (ref == 0)
{
TRACE("Destroying %p\n", This);
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
if (This->dirty)
IPropertyStorage_Commit(iface, STGC_DEFAULT);
Sync to Wine-20050310: Jon Griffiths <jon_p_griffiths@yahoo.com> - Documentation spelling fixes. Mike McCormack <mike@codeweavers.com> - Implement and test IPropertySetStorage. - Fix more incorrect uses of STGM_ enumerations. - Add struct StorageBaseImpl at the start of derived structures instead of trying to keep the first members the same. - StgOpenStorage shouldn't open zero length storage files. - Shared reading of storage files requires STGM_TRANSACTED. - Test and fix grfMode handling in StgOpenDocfile. - Implement StgSetTimes. Robert Shearman <rob@codeweavers.com> - Better tracing. - Small cleanup of creation functions. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. - Move marshaling state machine into stub manager from ifstub. - Add additional needed states for table-weak marshaling, as shown by tests. - Protect external reference count from underflows/overflows. - Make COM use the RPC runtime as the backend for RPC calls. Based on a patch by Ove Ksven. - Invoke objects in STA's in the correct thread by sending messages to the hidden apartment window. - Use I_RpcGetBuffer, instead of our own buffer routines to fix an occasional test crash caused by heap corruption. - Zero the memory block passed to RpcServerRegisterIfEx so we don't pass garbage in some of the fields we don't fill in. - Return the correct error code from create_server and fix two handle leaks. - TODO update. - Remove cruft left over from previous RPC backend implementation in the apartment structure. - Don't pass an IPID by value for proxy_manager_create_ifproxy. - Disable more of RPC_UnregisterInterface to prevent the RPC runtime using freed memory. - Rename various external RPC backend functions so that they all have the same "RPC_" prefix. - Reduce the timeout of the function that connects to a local server to 30s, like native. - Make each ifproxy have its own channel buffer to fix a bug where a proxy with multiple interfaces could invoke the wrong stub buffer on the server. - The Global Interface Table should do table-strong marshaling instead of normal marshaling so that an interface can be retrieved more than one time. Mike Hearn <mh@codeweavers.com> - Avoid infinite loop when doing a typelib marshalled IUnknown::QueryInterface by only doing an extra QI if requested IID is not equal to marshalled IID. Rob Shearman <rob@codeweavers.com> Mike Hearn <mh@codeweavers.com> - Add re-entrancy tests to the test suite. - Run RPCs on a new thread client side so we can pump the message loop. Juan Lang <juan_lang@yahoo.com> - Fix the calling convention of DllCanUnloadNow. - Move vtbl to end of file and get rid of unnecessary prototypes. - Implement StgCreatePropSetStg. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Paul Vriens <Paul.Vriens@xs4all.nl> - Added some TRACE statements. svn path=/trunk/; revision=14083
2005-03-14 23:17:44 +00:00
IStream_Release(This->stm);
This->cs.DebugInfo->Spare[0] = 0;
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
DeleteCriticalSection(&This->cs);
PropertyStorage_DestroyDictionaries(This);
Sync to Wine-20050310: Jon Griffiths <jon_p_griffiths@yahoo.com> - Documentation spelling fixes. Mike McCormack <mike@codeweavers.com> - Implement and test IPropertySetStorage. - Fix more incorrect uses of STGM_ enumerations. - Add struct StorageBaseImpl at the start of derived structures instead of trying to keep the first members the same. - StgOpenStorage shouldn't open zero length storage files. - Shared reading of storage files requires STGM_TRANSACTED. - Test and fix grfMode handling in StgOpenDocfile. - Implement StgSetTimes. Robert Shearman <rob@codeweavers.com> - Better tracing. - Small cleanup of creation functions. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. - Move marshaling state machine into stub manager from ifstub. - Add additional needed states for table-weak marshaling, as shown by tests. - Protect external reference count from underflows/overflows. - Make COM use the RPC runtime as the backend for RPC calls. Based on a patch by Ove Ksven. - Invoke objects in STA's in the correct thread by sending messages to the hidden apartment window. - Use I_RpcGetBuffer, instead of our own buffer routines to fix an occasional test crash caused by heap corruption. - Zero the memory block passed to RpcServerRegisterIfEx so we don't pass garbage in some of the fields we don't fill in. - Return the correct error code from create_server and fix two handle leaks. - TODO update. - Remove cruft left over from previous RPC backend implementation in the apartment structure. - Don't pass an IPID by value for proxy_manager_create_ifproxy. - Disable more of RPC_UnregisterInterface to prevent the RPC runtime using freed memory. - Rename various external RPC backend functions so that they all have the same "RPC_" prefix. - Reduce the timeout of the function that connects to a local server to 30s, like native. - Make each ifproxy have its own channel buffer to fix a bug where a proxy with multiple interfaces could invoke the wrong stub buffer on the server. - The Global Interface Table should do table-strong marshaling instead of normal marshaling so that an interface can be retrieved more than one time. Mike Hearn <mh@codeweavers.com> - Avoid infinite loop when doing a typelib marshalled IUnknown::QueryInterface by only doing an extra QI if requested IID is not equal to marshalled IID. Rob Shearman <rob@codeweavers.com> Mike Hearn <mh@codeweavers.com> - Add re-entrancy tests to the test suite. - Run RPCs on a new thread client side so we can pump the message loop. Juan Lang <juan_lang@yahoo.com> - Fix the calling convention of DllCanUnloadNow. - Move vtbl to end of file and get rid of unnecessary prototypes. - Implement StgCreatePropSetStg. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Paul Vriens <Paul.Vriens@xs4all.nl> - Added some TRACE statements. svn path=/trunk/; revision=14083
2005-03-14 23:17:44 +00:00
HeapFree(GetProcessHeap(), 0, This);
}
return ref;
}
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
static PROPVARIANT *PropertyStorage_FindProperty(PropertyStorage_impl *This,
DWORD propid)
{
PROPVARIANT *ret = NULL;
dictionary_find(This->propid_to_prop, UlongToPtr(propid), (void **)&ret);
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
TRACE("returning %p\n", ret);
return ret;
}
/* Returns NULL if name is NULL. */
static PROPVARIANT *PropertyStorage_FindPropertyByName(
PropertyStorage_impl *This, LPCWSTR name)
{
PROPVARIANT *ret = NULL;
void *propid;
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
if (!name)
return NULL;
Sync to Wine-20050524: Alexandre Julliard <julliard@winehq.org> - Added rules for building import libraries in the individual dll makefiles, and added support for building a .def.a static import library too. - Removed unnecessary code in the 16-bit DllEntryPoint function of some dlls, and also fixed its ordinal in a few places. - Comment out stub WEP entry points so that we can call WEP for builtin dlls too. Juan Lang <juan_lang@yahoo.com> - Obvious fixes to PropVariantClear and PropVariantCopy for vector types. - Add a comment, and a no-op cleanup. - Differentiate between version 0 and version 1 property storages. - Store property names in the code page of the property set. - maintain proper byte order - maintain PROPSETFLAG_ANSI flag based on codepage - update comments - Correct/improve error checking in IPropertyStorage. - convert strings between property storage's code page and system code page - add tests for setting code page - fix tests and behavior to match WinXP - Define and use endian conversion macros for big-endian machines. Marcus Meissner <marcus@jet.franken.de> - Move the Dll init function to compobj.c to avoid having global variables. Remove need of ole32_main.h. - Make HGLOBALStream_* functions static. - Make _xmalloc16() static. - Staticify FTMarshalImpl definition. Francois Gouget <fgouget@free.fr> - Specify the proper call convention in the PropSysFreeString() implementation. - Tweak the API documentation to silence winapi_check warnings. Robert Shearman <rob@codeweavers.com> - Add error messages on failure in file moniker load function. - Fix incorrect pointer check in both monikers. - Fix max size calculation of item moniker to match native. - Add a generic moniker marshaler that works by saving & loading monikers to & from the stream. - Use the generic moniker marshal in the file & item monikers and add a class factory for each. - Implement IROTData::GetComparisonData for file & item monikers. - Add a useful trace message. - Fix more places where custom header size was calculated exclusive of the data size member. - Optimize custom marshaling by getting size before calling the custom marshaler so we can write the header before and not use a second stream. - Change remaining blocks of code with 2-space indentation to 4-space indentation. - Make vtables const. - Remove an unnecessary memcpy and let the compiler do the work. - Write custom header up to and including size, not excluding. - Add a stub implementation of CoIsHandlerConnected. - Marshal objects & monikers into the ROT. - Test for this behaviour. Mike McCormack <mike@codeweavers.com> - Remove unnecessary declarations and make functions static. - Remove forward declarations. - Make sure a stream can't be created in read only storage. - Fix a memory leak in the ole storage implementation. - Remove function prototypes. Kevin Koltzau <kevin@plop.org> - Implement Hash function on composite moniker. Jeff Latimer <jeffl@defcen.gov.au> - Implement the IEnumMoniker interface for the ROT and provide tests to exercise the interface. Pierre d'Herbemont <stegefin@free.fr> - Big Endian specific code fixes in order to conform with NONAMELESSSTRUCT. Matthew Mastracci <matt@aclaro.com> - Replace stub entry for StgOpenStorageEx with call to StgOpenStorage. - Replace StgCreateStorageEx stub with call to StgCreateDocfile and add required STGFMT_* enumerations. svn path=/trunk/; revision=15562
2005-05-28 09:30:04 +00:00
if (This->codePage == CP_UNICODE)
{
if (dictionary_find(This->name_to_propid, name, &propid))
ret = PropertyStorage_FindProperty(This, PtrToUlong(propid));
Sync to Wine-20050524: Alexandre Julliard <julliard@winehq.org> - Added rules for building import libraries in the individual dll makefiles, and added support for building a .def.a static import library too. - Removed unnecessary code in the 16-bit DllEntryPoint function of some dlls, and also fixed its ordinal in a few places. - Comment out stub WEP entry points so that we can call WEP for builtin dlls too. Juan Lang <juan_lang@yahoo.com> - Obvious fixes to PropVariantClear and PropVariantCopy for vector types. - Add a comment, and a no-op cleanup. - Differentiate between version 0 and version 1 property storages. - Store property names in the code page of the property set. - maintain proper byte order - maintain PROPSETFLAG_ANSI flag based on codepage - update comments - Correct/improve error checking in IPropertyStorage. - convert strings between property storage's code page and system code page - add tests for setting code page - fix tests and behavior to match WinXP - Define and use endian conversion macros for big-endian machines. Marcus Meissner <marcus@jet.franken.de> - Move the Dll init function to compobj.c to avoid having global variables. Remove need of ole32_main.h. - Make HGLOBALStream_* functions static. - Make _xmalloc16() static. - Staticify FTMarshalImpl definition. Francois Gouget <fgouget@free.fr> - Specify the proper call convention in the PropSysFreeString() implementation. - Tweak the API documentation to silence winapi_check warnings. Robert Shearman <rob@codeweavers.com> - Add error messages on failure in file moniker load function. - Fix incorrect pointer check in both monikers. - Fix max size calculation of item moniker to match native. - Add a generic moniker marshaler that works by saving & loading monikers to & from the stream. - Use the generic moniker marshal in the file & item monikers and add a class factory for each. - Implement IROTData::GetComparisonData for file & item monikers. - Add a useful trace message. - Fix more places where custom header size was calculated exclusive of the data size member. - Optimize custom marshaling by getting size before calling the custom marshaler so we can write the header before and not use a second stream. - Change remaining blocks of code with 2-space indentation to 4-space indentation. - Make vtables const. - Remove an unnecessary memcpy and let the compiler do the work. - Write custom header up to and including size, not excluding. - Add a stub implementation of CoIsHandlerConnected. - Marshal objects & monikers into the ROT. - Test for this behaviour. Mike McCormack <mike@codeweavers.com> - Remove unnecessary declarations and make functions static. - Remove forward declarations. - Make sure a stream can't be created in read only storage. - Fix a memory leak in the ole storage implementation. - Remove function prototypes. Kevin Koltzau <kevin@plop.org> - Implement Hash function on composite moniker. Jeff Latimer <jeffl@defcen.gov.au> - Implement the IEnumMoniker interface for the ROT and provide tests to exercise the interface. Pierre d'Herbemont <stegefin@free.fr> - Big Endian specific code fixes in order to conform with NONAMELESSSTRUCT. Matthew Mastracci <matt@aclaro.com> - Replace stub entry for StgOpenStorageEx with call to StgOpenStorage. - Replace StgCreateStorageEx stub with call to StgCreateDocfile and add required STGFMT_* enumerations. svn path=/trunk/; revision=15562
2005-05-28 09:30:04 +00:00
}
else
{
LPSTR ansiName;
HRESULT hr = PropertyStorage_StringCopy((LPCSTR)name, CP_UNICODE,
&ansiName, This->codePage);
if (SUCCEEDED(hr))
{
if (dictionary_find(This->name_to_propid, ansiName, &propid))
ret = PropertyStorage_FindProperty(This, PtrToUlong(propid));
Sync to Wine-20050524: Alexandre Julliard <julliard@winehq.org> - Added rules for building import libraries in the individual dll makefiles, and added support for building a .def.a static import library too. - Removed unnecessary code in the 16-bit DllEntryPoint function of some dlls, and also fixed its ordinal in a few places. - Comment out stub WEP entry points so that we can call WEP for builtin dlls too. Juan Lang <juan_lang@yahoo.com> - Obvious fixes to PropVariantClear and PropVariantCopy for vector types. - Add a comment, and a no-op cleanup. - Differentiate between version 0 and version 1 property storages. - Store property names in the code page of the property set. - maintain proper byte order - maintain PROPSETFLAG_ANSI flag based on codepage - update comments - Correct/improve error checking in IPropertyStorage. - convert strings between property storage's code page and system code page - add tests for setting code page - fix tests and behavior to match WinXP - Define and use endian conversion macros for big-endian machines. Marcus Meissner <marcus@jet.franken.de> - Move the Dll init function to compobj.c to avoid having global variables. Remove need of ole32_main.h. - Make HGLOBALStream_* functions static. - Make _xmalloc16() static. - Staticify FTMarshalImpl definition. Francois Gouget <fgouget@free.fr> - Specify the proper call convention in the PropSysFreeString() implementation. - Tweak the API documentation to silence winapi_check warnings. Robert Shearman <rob@codeweavers.com> - Add error messages on failure in file moniker load function. - Fix incorrect pointer check in both monikers. - Fix max size calculation of item moniker to match native. - Add a generic moniker marshaler that works by saving & loading monikers to & from the stream. - Use the generic moniker marshal in the file & item monikers and add a class factory for each. - Implement IROTData::GetComparisonData for file & item monikers. - Add a useful trace message. - Fix more places where custom header size was calculated exclusive of the data size member. - Optimize custom marshaling by getting size before calling the custom marshaler so we can write the header before and not use a second stream. - Change remaining blocks of code with 2-space indentation to 4-space indentation. - Make vtables const. - Remove an unnecessary memcpy and let the compiler do the work. - Write custom header up to and including size, not excluding. - Add a stub implementation of CoIsHandlerConnected. - Marshal objects & monikers into the ROT. - Test for this behaviour. Mike McCormack <mike@codeweavers.com> - Remove unnecessary declarations and make functions static. - Remove forward declarations. - Make sure a stream can't be created in read only storage. - Fix a memory leak in the ole storage implementation. - Remove function prototypes. Kevin Koltzau <kevin@plop.org> - Implement Hash function on composite moniker. Jeff Latimer <jeffl@defcen.gov.au> - Implement the IEnumMoniker interface for the ROT and provide tests to exercise the interface. Pierre d'Herbemont <stegefin@free.fr> - Big Endian specific code fixes in order to conform with NONAMELESSSTRUCT. Matthew Mastracci <matt@aclaro.com> - Replace stub entry for StgOpenStorageEx with call to StgOpenStorage. - Replace StgCreateStorageEx stub with call to StgCreateDocfile and add required STGFMT_* enumerations. svn path=/trunk/; revision=15562
2005-05-28 09:30:04 +00:00
CoTaskMemFree(ansiName);
}
}
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
TRACE("returning %p\n", ret);
return ret;
}
static LPWSTR PropertyStorage_FindPropertyNameById(PropertyStorage_impl *This,
DWORD propid)
{
LPWSTR ret = NULL;
dictionary_find(This->propid_to_name, UlongToPtr(propid), (void **)&ret);
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
TRACE("returning %p\n", ret);
return ret;
}
Sync to Wine-20050310: Jon Griffiths <jon_p_griffiths@yahoo.com> - Documentation spelling fixes. Mike McCormack <mike@codeweavers.com> - Implement and test IPropertySetStorage. - Fix more incorrect uses of STGM_ enumerations. - Add struct StorageBaseImpl at the start of derived structures instead of trying to keep the first members the same. - StgOpenStorage shouldn't open zero length storage files. - Shared reading of storage files requires STGM_TRANSACTED. - Test and fix grfMode handling in StgOpenDocfile. - Implement StgSetTimes. Robert Shearman <rob@codeweavers.com> - Better tracing. - Small cleanup of creation functions. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. - Move marshaling state machine into stub manager from ifstub. - Add additional needed states for table-weak marshaling, as shown by tests. - Protect external reference count from underflows/overflows. - Make COM use the RPC runtime as the backend for RPC calls. Based on a patch by Ove Ksven. - Invoke objects in STA's in the correct thread by sending messages to the hidden apartment window. - Use I_RpcGetBuffer, instead of our own buffer routines to fix an occasional test crash caused by heap corruption. - Zero the memory block passed to RpcServerRegisterIfEx so we don't pass garbage in some of the fields we don't fill in. - Return the correct error code from create_server and fix two handle leaks. - TODO update. - Remove cruft left over from previous RPC backend implementation in the apartment structure. - Don't pass an IPID by value for proxy_manager_create_ifproxy. - Disable more of RPC_UnregisterInterface to prevent the RPC runtime using freed memory. - Rename various external RPC backend functions so that they all have the same "RPC_" prefix. - Reduce the timeout of the function that connects to a local server to 30s, like native. - Make each ifproxy have its own channel buffer to fix a bug where a proxy with multiple interfaces could invoke the wrong stub buffer on the server. - The Global Interface Table should do table-strong marshaling instead of normal marshaling so that an interface can be retrieved more than one time. Mike Hearn <mh@codeweavers.com> - Avoid infinite loop when doing a typelib marshalled IUnknown::QueryInterface by only doing an extra QI if requested IID is not equal to marshalled IID. Rob Shearman <rob@codeweavers.com> Mike Hearn <mh@codeweavers.com> - Add re-entrancy tests to the test suite. - Run RPCs on a new thread client side so we can pump the message loop. Juan Lang <juan_lang@yahoo.com> - Fix the calling convention of DllCanUnloadNow. - Move vtbl to end of file and get rid of unnecessary prototypes. - Implement StgCreatePropSetStg. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Paul Vriens <Paul.Vriens@xs4all.nl> - Added some TRACE statements. svn path=/trunk/; revision=14083
2005-03-14 23:17:44 +00:00
/************************************************************************
* IPropertyStorage_fnReadMultiple (IPropertyStorage)
*/
static HRESULT WINAPI IPropertyStorage_fnReadMultiple(
IPropertyStorage* iface,
ULONG cpspec,
const PROPSPEC rgpspec[],
PROPVARIANT rgpropvar[])
{
PropertyStorage_impl *This = impl_from_IPropertyStorage(iface);
HRESULT hr = S_OK;
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
ULONG i;
TRACE("(%p, %d, %p, %p)\n", iface, cpspec, rgpspec, rgpropvar);
if (!cpspec)
return S_FALSE;
if (!rgpspec || !rgpropvar)
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
return E_INVALIDARG;
EnterCriticalSection(&This->cs);
for (i = 0; i < cpspec; i++)
{
PropVariantInit(&rgpropvar[i]);
if (rgpspec[i].ulKind == PRSPEC_LPWSTR)
{
PROPVARIANT *prop = PropertyStorage_FindPropertyByName(This,
rgpspec[i].u.lpwstr);
if (prop)
Sync to Wine-20050524: Alexandre Julliard <julliard@winehq.org> - Added rules for building import libraries in the individual dll makefiles, and added support for building a .def.a static import library too. - Removed unnecessary code in the 16-bit DllEntryPoint function of some dlls, and also fixed its ordinal in a few places. - Comment out stub WEP entry points so that we can call WEP for builtin dlls too. Juan Lang <juan_lang@yahoo.com> - Obvious fixes to PropVariantClear and PropVariantCopy for vector types. - Add a comment, and a no-op cleanup. - Differentiate between version 0 and version 1 property storages. - Store property names in the code page of the property set. - maintain proper byte order - maintain PROPSETFLAG_ANSI flag based on codepage - update comments - Correct/improve error checking in IPropertyStorage. - convert strings between property storage's code page and system code page - add tests for setting code page - fix tests and behavior to match WinXP - Define and use endian conversion macros for big-endian machines. Marcus Meissner <marcus@jet.franken.de> - Move the Dll init function to compobj.c to avoid having global variables. Remove need of ole32_main.h. - Make HGLOBALStream_* functions static. - Make _xmalloc16() static. - Staticify FTMarshalImpl definition. Francois Gouget <fgouget@free.fr> - Specify the proper call convention in the PropSysFreeString() implementation. - Tweak the API documentation to silence winapi_check warnings. Robert Shearman <rob@codeweavers.com> - Add error messages on failure in file moniker load function. - Fix incorrect pointer check in both monikers. - Fix max size calculation of item moniker to match native. - Add a generic moniker marshaler that works by saving & loading monikers to & from the stream. - Use the generic moniker marshal in the file & item monikers and add a class factory for each. - Implement IROTData::GetComparisonData for file & item monikers. - Add a useful trace message. - Fix more places where custom header size was calculated exclusive of the data size member. - Optimize custom marshaling by getting size before calling the custom marshaler so we can write the header before and not use a second stream. - Change remaining blocks of code with 2-space indentation to 4-space indentation. - Make vtables const. - Remove an unnecessary memcpy and let the compiler do the work. - Write custom header up to and including size, not excluding. - Add a stub implementation of CoIsHandlerConnected. - Marshal objects & monikers into the ROT. - Test for this behaviour. Mike McCormack <mike@codeweavers.com> - Remove unnecessary declarations and make functions static. - Remove forward declarations. - Make sure a stream can't be created in read only storage. - Fix a memory leak in the ole storage implementation. - Remove function prototypes. Kevin Koltzau <kevin@plop.org> - Implement Hash function on composite moniker. Jeff Latimer <jeffl@defcen.gov.au> - Implement the IEnumMoniker interface for the ROT and provide tests to exercise the interface. Pierre d'Herbemont <stegefin@free.fr> - Big Endian specific code fixes in order to conform with NONAMELESSSTRUCT. Matthew Mastracci <matt@aclaro.com> - Replace stub entry for StgOpenStorageEx with call to StgOpenStorage. - Replace StgCreateStorageEx stub with call to StgCreateDocfile and add required STGFMT_* enumerations. svn path=/trunk/; revision=15562
2005-05-28 09:30:04 +00:00
PropertyStorage_PropVariantCopy(&rgpropvar[i], prop, GetACP(),
This->codePage);
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
}
else
{
Sync to Wine-20050524: Alexandre Julliard <julliard@winehq.org> - Added rules for building import libraries in the individual dll makefiles, and added support for building a .def.a static import library too. - Removed unnecessary code in the 16-bit DllEntryPoint function of some dlls, and also fixed its ordinal in a few places. - Comment out stub WEP entry points so that we can call WEP for builtin dlls too. Juan Lang <juan_lang@yahoo.com> - Obvious fixes to PropVariantClear and PropVariantCopy for vector types. - Add a comment, and a no-op cleanup. - Differentiate between version 0 and version 1 property storages. - Store property names in the code page of the property set. - maintain proper byte order - maintain PROPSETFLAG_ANSI flag based on codepage - update comments - Correct/improve error checking in IPropertyStorage. - convert strings between property storage's code page and system code page - add tests for setting code page - fix tests and behavior to match WinXP - Define and use endian conversion macros for big-endian machines. Marcus Meissner <marcus@jet.franken.de> - Move the Dll init function to compobj.c to avoid having global variables. Remove need of ole32_main.h. - Make HGLOBALStream_* functions static. - Make _xmalloc16() static. - Staticify FTMarshalImpl definition. Francois Gouget <fgouget@free.fr> - Specify the proper call convention in the PropSysFreeString() implementation. - Tweak the API documentation to silence winapi_check warnings. Robert Shearman <rob@codeweavers.com> - Add error messages on failure in file moniker load function. - Fix incorrect pointer check in both monikers. - Fix max size calculation of item moniker to match native. - Add a generic moniker marshaler that works by saving & loading monikers to & from the stream. - Use the generic moniker marshal in the file & item monikers and add a class factory for each. - Implement IROTData::GetComparisonData for file & item monikers. - Add a useful trace message. - Fix more places where custom header size was calculated exclusive of the data size member. - Optimize custom marshaling by getting size before calling the custom marshaler so we can write the header before and not use a second stream. - Change remaining blocks of code with 2-space indentation to 4-space indentation. - Make vtables const. - Remove an unnecessary memcpy and let the compiler do the work. - Write custom header up to and including size, not excluding. - Add a stub implementation of CoIsHandlerConnected. - Marshal objects & monikers into the ROT. - Test for this behaviour. Mike McCormack <mike@codeweavers.com> - Remove unnecessary declarations and make functions static. - Remove forward declarations. - Make sure a stream can't be created in read only storage. - Fix a memory leak in the ole storage implementation. - Remove function prototypes. Kevin Koltzau <kevin@plop.org> - Implement Hash function on composite moniker. Jeff Latimer <jeffl@defcen.gov.au> - Implement the IEnumMoniker interface for the ROT and provide tests to exercise the interface. Pierre d'Herbemont <stegefin@free.fr> - Big Endian specific code fixes in order to conform with NONAMELESSSTRUCT. Matthew Mastracci <matt@aclaro.com> - Replace stub entry for StgOpenStorageEx with call to StgOpenStorage. - Replace StgCreateStorageEx stub with call to StgCreateDocfile and add required STGFMT_* enumerations. svn path=/trunk/; revision=15562
2005-05-28 09:30:04 +00:00
switch (rgpspec[i].u.propid)
{
case PID_CODEPAGE:
rgpropvar[i].vt = VT_I2;
rgpropvar[i].u.iVal = This->codePage;
break;
case PID_LOCALE:
rgpropvar[i].vt = VT_I4;
rgpropvar[i].u.lVal = This->locale;
break;
default:
{
PROPVARIANT *prop = PropertyStorage_FindProperty(This,
rgpspec[i].u.propid);
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
Sync to Wine-20050524: Alexandre Julliard <julliard@winehq.org> - Added rules for building import libraries in the individual dll makefiles, and added support for building a .def.a static import library too. - Removed unnecessary code in the 16-bit DllEntryPoint function of some dlls, and also fixed its ordinal in a few places. - Comment out stub WEP entry points so that we can call WEP for builtin dlls too. Juan Lang <juan_lang@yahoo.com> - Obvious fixes to PropVariantClear and PropVariantCopy for vector types. - Add a comment, and a no-op cleanup. - Differentiate between version 0 and version 1 property storages. - Store property names in the code page of the property set. - maintain proper byte order - maintain PROPSETFLAG_ANSI flag based on codepage - update comments - Correct/improve error checking in IPropertyStorage. - convert strings between property storage's code page and system code page - add tests for setting code page - fix tests and behavior to match WinXP - Define and use endian conversion macros for big-endian machines. Marcus Meissner <marcus@jet.franken.de> - Move the Dll init function to compobj.c to avoid having global variables. Remove need of ole32_main.h. - Make HGLOBALStream_* functions static. - Make _xmalloc16() static. - Staticify FTMarshalImpl definition. Francois Gouget <fgouget@free.fr> - Specify the proper call convention in the PropSysFreeString() implementation. - Tweak the API documentation to silence winapi_check warnings. Robert Shearman <rob@codeweavers.com> - Add error messages on failure in file moniker load function. - Fix incorrect pointer check in both monikers. - Fix max size calculation of item moniker to match native. - Add a generic moniker marshaler that works by saving & loading monikers to & from the stream. - Use the generic moniker marshal in the file & item monikers and add a class factory for each. - Implement IROTData::GetComparisonData for file & item monikers. - Add a useful trace message. - Fix more places where custom header size was calculated exclusive of the data size member. - Optimize custom marshaling by getting size before calling the custom marshaler so we can write the header before and not use a second stream. - Change remaining blocks of code with 2-space indentation to 4-space indentation. - Make vtables const. - Remove an unnecessary memcpy and let the compiler do the work. - Write custom header up to and including size, not excluding. - Add a stub implementation of CoIsHandlerConnected. - Marshal objects & monikers into the ROT. - Test for this behaviour. Mike McCormack <mike@codeweavers.com> - Remove unnecessary declarations and make functions static. - Remove forward declarations. - Make sure a stream can't be created in read only storage. - Fix a memory leak in the ole storage implementation. - Remove function prototypes. Kevin Koltzau <kevin@plop.org> - Implement Hash function on composite moniker. Jeff Latimer <jeffl@defcen.gov.au> - Implement the IEnumMoniker interface for the ROT and provide tests to exercise the interface. Pierre d'Herbemont <stegefin@free.fr> - Big Endian specific code fixes in order to conform with NONAMELESSSTRUCT. Matthew Mastracci <matt@aclaro.com> - Replace stub entry for StgOpenStorageEx with call to StgOpenStorage. - Replace StgCreateStorageEx stub with call to StgCreateDocfile and add required STGFMT_* enumerations. svn path=/trunk/; revision=15562
2005-05-28 09:30:04 +00:00
if (prop)
PropertyStorage_PropVariantCopy(&rgpropvar[i], prop,
GetACP(), This->codePage);
else
hr = S_FALSE;
Sync to Wine-20050524: Alexandre Julliard <julliard@winehq.org> - Added rules for building import libraries in the individual dll makefiles, and added support for building a .def.a static import library too. - Removed unnecessary code in the 16-bit DllEntryPoint function of some dlls, and also fixed its ordinal in a few places. - Comment out stub WEP entry points so that we can call WEP for builtin dlls too. Juan Lang <juan_lang@yahoo.com> - Obvious fixes to PropVariantClear and PropVariantCopy for vector types. - Add a comment, and a no-op cleanup. - Differentiate between version 0 and version 1 property storages. - Store property names in the code page of the property set. - maintain proper byte order - maintain PROPSETFLAG_ANSI flag based on codepage - update comments - Correct/improve error checking in IPropertyStorage. - convert strings between property storage's code page and system code page - add tests for setting code page - fix tests and behavior to match WinXP - Define and use endian conversion macros for big-endian machines. Marcus Meissner <marcus@jet.franken.de> - Move the Dll init function to compobj.c to avoid having global variables. Remove need of ole32_main.h. - Make HGLOBALStream_* functions static. - Make _xmalloc16() static. - Staticify FTMarshalImpl definition. Francois Gouget <fgouget@free.fr> - Specify the proper call convention in the PropSysFreeString() implementation. - Tweak the API documentation to silence winapi_check warnings. Robert Shearman <rob@codeweavers.com> - Add error messages on failure in file moniker load function. - Fix incorrect pointer check in both monikers. - Fix max size calculation of item moniker to match native. - Add a generic moniker marshaler that works by saving & loading monikers to & from the stream. - Use the generic moniker marshal in the file & item monikers and add a class factory for each. - Implement IROTData::GetComparisonData for file & item monikers. - Add a useful trace message. - Fix more places where custom header size was calculated exclusive of the data size member. - Optimize custom marshaling by getting size before calling the custom marshaler so we can write the header before and not use a second stream. - Change remaining blocks of code with 2-space indentation to 4-space indentation. - Make vtables const. - Remove an unnecessary memcpy and let the compiler do the work. - Write custom header up to and including size, not excluding. - Add a stub implementation of CoIsHandlerConnected. - Marshal objects & monikers into the ROT. - Test for this behaviour. Mike McCormack <mike@codeweavers.com> - Remove unnecessary declarations and make functions static. - Remove forward declarations. - Make sure a stream can't be created in read only storage. - Fix a memory leak in the ole storage implementation. - Remove function prototypes. Kevin Koltzau <kevin@plop.org> - Implement Hash function on composite moniker. Jeff Latimer <jeffl@defcen.gov.au> - Implement the IEnumMoniker interface for the ROT and provide tests to exercise the interface. Pierre d'Herbemont <stegefin@free.fr> - Big Endian specific code fixes in order to conform with NONAMELESSSTRUCT. Matthew Mastracci <matt@aclaro.com> - Replace stub entry for StgOpenStorageEx with call to StgOpenStorage. - Replace StgCreateStorageEx stub with call to StgCreateDocfile and add required STGFMT_* enumerations. svn path=/trunk/; revision=15562
2005-05-28 09:30:04 +00:00
}
}
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
}
}
LeaveCriticalSection(&This->cs);
return hr;
}
Sync to Wine-20050524: Alexandre Julliard <julliard@winehq.org> - Added rules for building import libraries in the individual dll makefiles, and added support for building a .def.a static import library too. - Removed unnecessary code in the 16-bit DllEntryPoint function of some dlls, and also fixed its ordinal in a few places. - Comment out stub WEP entry points so that we can call WEP for builtin dlls too. Juan Lang <juan_lang@yahoo.com> - Obvious fixes to PropVariantClear and PropVariantCopy for vector types. - Add a comment, and a no-op cleanup. - Differentiate between version 0 and version 1 property storages. - Store property names in the code page of the property set. - maintain proper byte order - maintain PROPSETFLAG_ANSI flag based on codepage - update comments - Correct/improve error checking in IPropertyStorage. - convert strings between property storage's code page and system code page - add tests for setting code page - fix tests and behavior to match WinXP - Define and use endian conversion macros for big-endian machines. Marcus Meissner <marcus@jet.franken.de> - Move the Dll init function to compobj.c to avoid having global variables. Remove need of ole32_main.h. - Make HGLOBALStream_* functions static. - Make _xmalloc16() static. - Staticify FTMarshalImpl definition. Francois Gouget <fgouget@free.fr> - Specify the proper call convention in the PropSysFreeString() implementation. - Tweak the API documentation to silence winapi_check warnings. Robert Shearman <rob@codeweavers.com> - Add error messages on failure in file moniker load function. - Fix incorrect pointer check in both monikers. - Fix max size calculation of item moniker to match native. - Add a generic moniker marshaler that works by saving & loading monikers to & from the stream. - Use the generic moniker marshal in the file & item monikers and add a class factory for each. - Implement IROTData::GetComparisonData for file & item monikers. - Add a useful trace message. - Fix more places where custom header size was calculated exclusive of the data size member. - Optimize custom marshaling by getting size before calling the custom marshaler so we can write the header before and not use a second stream. - Change remaining blocks of code with 2-space indentation to 4-space indentation. - Make vtables const. - Remove an unnecessary memcpy and let the compiler do the work. - Write custom header up to and including size, not excluding. - Add a stub implementation of CoIsHandlerConnected. - Marshal objects & monikers into the ROT. - Test for this behaviour. Mike McCormack <mike@codeweavers.com> - Remove unnecessary declarations and make functions static. - Remove forward declarations. - Make sure a stream can't be created in read only storage. - Fix a memory leak in the ole storage implementation. - Remove function prototypes. Kevin Koltzau <kevin@plop.org> - Implement Hash function on composite moniker. Jeff Latimer <jeffl@defcen.gov.au> - Implement the IEnumMoniker interface for the ROT and provide tests to exercise the interface. Pierre d'Herbemont <stegefin@free.fr> - Big Endian specific code fixes in order to conform with NONAMELESSSTRUCT. Matthew Mastracci <matt@aclaro.com> - Replace stub entry for StgOpenStorageEx with call to StgOpenStorage. - Replace StgCreateStorageEx stub with call to StgCreateDocfile and add required STGFMT_* enumerations. svn path=/trunk/; revision=15562
2005-05-28 09:30:04 +00:00
static HRESULT PropertyStorage_StringCopy(LPCSTR src, LCID srcCP, LPSTR *dst,
LCID dstCP)
{
HRESULT hr = S_OK;
int len;
TRACE("%s, %p, %d, %d\n",
Sync to Wine-20050524: Alexandre Julliard <julliard@winehq.org> - Added rules for building import libraries in the individual dll makefiles, and added support for building a .def.a static import library too. - Removed unnecessary code in the 16-bit DllEntryPoint function of some dlls, and also fixed its ordinal in a few places. - Comment out stub WEP entry points so that we can call WEP for builtin dlls too. Juan Lang <juan_lang@yahoo.com> - Obvious fixes to PropVariantClear and PropVariantCopy for vector types. - Add a comment, and a no-op cleanup. - Differentiate between version 0 and version 1 property storages. - Store property names in the code page of the property set. - maintain proper byte order - maintain PROPSETFLAG_ANSI flag based on codepage - update comments - Correct/improve error checking in IPropertyStorage. - convert strings between property storage's code page and system code page - add tests for setting code page - fix tests and behavior to match WinXP - Define and use endian conversion macros for big-endian machines. Marcus Meissner <marcus@jet.franken.de> - Move the Dll init function to compobj.c to avoid having global variables. Remove need of ole32_main.h. - Make HGLOBALStream_* functions static. - Make _xmalloc16() static. - Staticify FTMarshalImpl definition. Francois Gouget <fgouget@free.fr> - Specify the proper call convention in the PropSysFreeString() implementation. - Tweak the API documentation to silence winapi_check warnings. Robert Shearman <rob@codeweavers.com> - Add error messages on failure in file moniker load function. - Fix incorrect pointer check in both monikers. - Fix max size calculation of item moniker to match native. - Add a generic moniker marshaler that works by saving & loading monikers to & from the stream. - Use the generic moniker marshal in the file & item monikers and add a class factory for each. - Implement IROTData::GetComparisonData for file & item monikers. - Add a useful trace message. - Fix more places where custom header size was calculated exclusive of the data size member. - Optimize custom marshaling by getting size before calling the custom marshaler so we can write the header before and not use a second stream. - Change remaining blocks of code with 2-space indentation to 4-space indentation. - Make vtables const. - Remove an unnecessary memcpy and let the compiler do the work. - Write custom header up to and including size, not excluding. - Add a stub implementation of CoIsHandlerConnected. - Marshal objects & monikers into the ROT. - Test for this behaviour. Mike McCormack <mike@codeweavers.com> - Remove unnecessary declarations and make functions static. - Remove forward declarations. - Make sure a stream can't be created in read only storage. - Fix a memory leak in the ole storage implementation. - Remove function prototypes. Kevin Koltzau <kevin@plop.org> - Implement Hash function on composite moniker. Jeff Latimer <jeffl@defcen.gov.au> - Implement the IEnumMoniker interface for the ROT and provide tests to exercise the interface. Pierre d'Herbemont <stegefin@free.fr> - Big Endian specific code fixes in order to conform with NONAMELESSSTRUCT. Matthew Mastracci <matt@aclaro.com> - Replace stub entry for StgOpenStorageEx with call to StgOpenStorage. - Replace StgCreateStorageEx stub with call to StgCreateDocfile and add required STGFMT_* enumerations. svn path=/trunk/; revision=15562
2005-05-28 09:30:04 +00:00
srcCP == CP_UNICODE ? debugstr_w((LPCWSTR)src) : debugstr_a(src), dst,
dstCP, srcCP);
assert(src);
assert(dst);
*dst = NULL;
if (dstCP == srcCP)
{
size_t len;
if (dstCP == CP_UNICODE)
len = (strlenW((LPCWSTR)src) + 1) * sizeof(WCHAR);
else
len = strlen(src) + 1;
*dst = CoTaskMemAlloc(len * sizeof(WCHAR));
if (!*dst)
hr = STG_E_INSUFFICIENTMEMORY;
else
memcpy(*dst, src, len);
}
else
{
if (dstCP == CP_UNICODE)
{
len = MultiByteToWideChar(srcCP, 0, src, -1, NULL, 0);
*dst = CoTaskMemAlloc(len * sizeof(WCHAR));
if (!*dst)
hr = STG_E_INSUFFICIENTMEMORY;
else
MultiByteToWideChar(srcCP, 0, src, -1, (LPWSTR)*dst, len);
}
else
{
LPCWSTR wideStr = NULL;
LPWSTR wideStr_tmp = NULL;
Sync to Wine-20050524: Alexandre Julliard <julliard@winehq.org> - Added rules for building import libraries in the individual dll makefiles, and added support for building a .def.a static import library too. - Removed unnecessary code in the 16-bit DllEntryPoint function of some dlls, and also fixed its ordinal in a few places. - Comment out stub WEP entry points so that we can call WEP for builtin dlls too. Juan Lang <juan_lang@yahoo.com> - Obvious fixes to PropVariantClear and PropVariantCopy for vector types. - Add a comment, and a no-op cleanup. - Differentiate between version 0 and version 1 property storages. - Store property names in the code page of the property set. - maintain proper byte order - maintain PROPSETFLAG_ANSI flag based on codepage - update comments - Correct/improve error checking in IPropertyStorage. - convert strings between property storage's code page and system code page - add tests for setting code page - fix tests and behavior to match WinXP - Define and use endian conversion macros for big-endian machines. Marcus Meissner <marcus@jet.franken.de> - Move the Dll init function to compobj.c to avoid having global variables. Remove need of ole32_main.h. - Make HGLOBALStream_* functions static. - Make _xmalloc16() static. - Staticify FTMarshalImpl definition. Francois Gouget <fgouget@free.fr> - Specify the proper call convention in the PropSysFreeString() implementation. - Tweak the API documentation to silence winapi_check warnings. Robert Shearman <rob@codeweavers.com> - Add error messages on failure in file moniker load function. - Fix incorrect pointer check in both monikers. - Fix max size calculation of item moniker to match native. - Add a generic moniker marshaler that works by saving & loading monikers to & from the stream. - Use the generic moniker marshal in the file & item monikers and add a class factory for each. - Implement IROTData::GetComparisonData for file & item monikers. - Add a useful trace message. - Fix more places where custom header size was calculated exclusive of the data size member. - Optimize custom marshaling by getting size before calling the custom marshaler so we can write the header before and not use a second stream. - Change remaining blocks of code with 2-space indentation to 4-space indentation. - Make vtables const. - Remove an unnecessary memcpy and let the compiler do the work. - Write custom header up to and including size, not excluding. - Add a stub implementation of CoIsHandlerConnected. - Marshal objects & monikers into the ROT. - Test for this behaviour. Mike McCormack <mike@codeweavers.com> - Remove unnecessary declarations and make functions static. - Remove forward declarations. - Make sure a stream can't be created in read only storage. - Fix a memory leak in the ole storage implementation. - Remove function prototypes. Kevin Koltzau <kevin@plop.org> - Implement Hash function on composite moniker. Jeff Latimer <jeffl@defcen.gov.au> - Implement the IEnumMoniker interface for the ROT and provide tests to exercise the interface. Pierre d'Herbemont <stegefin@free.fr> - Big Endian specific code fixes in order to conform with NONAMELESSSTRUCT. Matthew Mastracci <matt@aclaro.com> - Replace stub entry for StgOpenStorageEx with call to StgOpenStorage. - Replace StgCreateStorageEx stub with call to StgCreateDocfile and add required STGFMT_* enumerations. svn path=/trunk/; revision=15562
2005-05-28 09:30:04 +00:00
if (srcCP == CP_UNICODE)
wideStr = (LPCWSTR)src;
Sync to Wine-20050524: Alexandre Julliard <julliard@winehq.org> - Added rules for building import libraries in the individual dll makefiles, and added support for building a .def.a static import library too. - Removed unnecessary code in the 16-bit DllEntryPoint function of some dlls, and also fixed its ordinal in a few places. - Comment out stub WEP entry points so that we can call WEP for builtin dlls too. Juan Lang <juan_lang@yahoo.com> - Obvious fixes to PropVariantClear and PropVariantCopy for vector types. - Add a comment, and a no-op cleanup. - Differentiate between version 0 and version 1 property storages. - Store property names in the code page of the property set. - maintain proper byte order - maintain PROPSETFLAG_ANSI flag based on codepage - update comments - Correct/improve error checking in IPropertyStorage. - convert strings between property storage's code page and system code page - add tests for setting code page - fix tests and behavior to match WinXP - Define and use endian conversion macros for big-endian machines. Marcus Meissner <marcus@jet.franken.de> - Move the Dll init function to compobj.c to avoid having global variables. Remove need of ole32_main.h. - Make HGLOBALStream_* functions static. - Make _xmalloc16() static. - Staticify FTMarshalImpl definition. Francois Gouget <fgouget@free.fr> - Specify the proper call convention in the PropSysFreeString() implementation. - Tweak the API documentation to silence winapi_check warnings. Robert Shearman <rob@codeweavers.com> - Add error messages on failure in file moniker load function. - Fix incorrect pointer check in both monikers. - Fix max size calculation of item moniker to match native. - Add a generic moniker marshaler that works by saving & loading monikers to & from the stream. - Use the generic moniker marshal in the file & item monikers and add a class factory for each. - Implement IROTData::GetComparisonData for file & item monikers. - Add a useful trace message. - Fix more places where custom header size was calculated exclusive of the data size member. - Optimize custom marshaling by getting size before calling the custom marshaler so we can write the header before and not use a second stream. - Change remaining blocks of code with 2-space indentation to 4-space indentation. - Make vtables const. - Remove an unnecessary memcpy and let the compiler do the work. - Write custom header up to and including size, not excluding. - Add a stub implementation of CoIsHandlerConnected. - Marshal objects & monikers into the ROT. - Test for this behaviour. Mike McCormack <mike@codeweavers.com> - Remove unnecessary declarations and make functions static. - Remove forward declarations. - Make sure a stream can't be created in read only storage. - Fix a memory leak in the ole storage implementation. - Remove function prototypes. Kevin Koltzau <kevin@plop.org> - Implement Hash function on composite moniker. Jeff Latimer <jeffl@defcen.gov.au> - Implement the IEnumMoniker interface for the ROT and provide tests to exercise the interface. Pierre d'Herbemont <stegefin@free.fr> - Big Endian specific code fixes in order to conform with NONAMELESSSTRUCT. Matthew Mastracci <matt@aclaro.com> - Replace stub entry for StgOpenStorageEx with call to StgOpenStorage. - Replace StgCreateStorageEx stub with call to StgCreateDocfile and add required STGFMT_* enumerations. svn path=/trunk/; revision=15562
2005-05-28 09:30:04 +00:00
else
{
len = MultiByteToWideChar(srcCP, 0, src, -1, NULL, 0);
wideStr_tmp = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
if (wideStr_tmp)
{
MultiByteToWideChar(srcCP, 0, src, -1, wideStr_tmp, len);
wideStr = wideStr_tmp;
}
Sync to Wine-20050524: Alexandre Julliard <julliard@winehq.org> - Added rules for building import libraries in the individual dll makefiles, and added support for building a .def.a static import library too. - Removed unnecessary code in the 16-bit DllEntryPoint function of some dlls, and also fixed its ordinal in a few places. - Comment out stub WEP entry points so that we can call WEP for builtin dlls too. Juan Lang <juan_lang@yahoo.com> - Obvious fixes to PropVariantClear and PropVariantCopy for vector types. - Add a comment, and a no-op cleanup. - Differentiate between version 0 and version 1 property storages. - Store property names in the code page of the property set. - maintain proper byte order - maintain PROPSETFLAG_ANSI flag based on codepage - update comments - Correct/improve error checking in IPropertyStorage. - convert strings between property storage's code page and system code page - add tests for setting code page - fix tests and behavior to match WinXP - Define and use endian conversion macros for big-endian machines. Marcus Meissner <marcus@jet.franken.de> - Move the Dll init function to compobj.c to avoid having global variables. Remove need of ole32_main.h. - Make HGLOBALStream_* functions static. - Make _xmalloc16() static. - Staticify FTMarshalImpl definition. Francois Gouget <fgouget@free.fr> - Specify the proper call convention in the PropSysFreeString() implementation. - Tweak the API documentation to silence winapi_check warnings. Robert Shearman <rob@codeweavers.com> - Add error messages on failure in file moniker load function. - Fix incorrect pointer check in both monikers. - Fix max size calculation of item moniker to match native. - Add a generic moniker marshaler that works by saving & loading monikers to & from the stream. - Use the generic moniker marshal in the file & item monikers and add a class factory for each. - Implement IROTData::GetComparisonData for file & item monikers. - Add a useful trace message. - Fix more places where custom header size was calculated exclusive of the data size member. - Optimize custom marshaling by getting size before calling the custom marshaler so we can write the header before and not use a second stream. - Change remaining blocks of code with 2-space indentation to 4-space indentation. - Make vtables const. - Remove an unnecessary memcpy and let the compiler do the work. - Write custom header up to and including size, not excluding. - Add a stub implementation of CoIsHandlerConnected. - Marshal objects & monikers into the ROT. - Test for this behaviour. Mike McCormack <mike@codeweavers.com> - Remove unnecessary declarations and make functions static. - Remove forward declarations. - Make sure a stream can't be created in read only storage. - Fix a memory leak in the ole storage implementation. - Remove function prototypes. Kevin Koltzau <kevin@plop.org> - Implement Hash function on composite moniker. Jeff Latimer <jeffl@defcen.gov.au> - Implement the IEnumMoniker interface for the ROT and provide tests to exercise the interface. Pierre d'Herbemont <stegefin@free.fr> - Big Endian specific code fixes in order to conform with NONAMELESSSTRUCT. Matthew Mastracci <matt@aclaro.com> - Replace stub entry for StgOpenStorageEx with call to StgOpenStorage. - Replace StgCreateStorageEx stub with call to StgCreateDocfile and add required STGFMT_* enumerations. svn path=/trunk/; revision=15562
2005-05-28 09:30:04 +00:00
else
hr = STG_E_INSUFFICIENTMEMORY;
}
if (SUCCEEDED(hr))
{
len = WideCharToMultiByte(dstCP, 0, wideStr, -1, NULL, 0,
NULL, NULL);
*dst = CoTaskMemAlloc(len);
if (!*dst)
hr = STG_E_INSUFFICIENTMEMORY;
else
{
BOOL defCharUsed = FALSE;
if (WideCharToMultiByte(dstCP, 0, wideStr, -1, *dst, len,
NULL, &defCharUsed) == 0 || defCharUsed)
{
CoTaskMemFree(*dst);
*dst = NULL;
hr = HRESULT_FROM_WIN32(ERROR_NO_UNICODE_TRANSLATION);
}
}
}
HeapFree(GetProcessHeap(), 0, wideStr_tmp);
Sync to Wine-20050524: Alexandre Julliard <julliard@winehq.org> - Added rules for building import libraries in the individual dll makefiles, and added support for building a .def.a static import library too. - Removed unnecessary code in the 16-bit DllEntryPoint function of some dlls, and also fixed its ordinal in a few places. - Comment out stub WEP entry points so that we can call WEP for builtin dlls too. Juan Lang <juan_lang@yahoo.com> - Obvious fixes to PropVariantClear and PropVariantCopy for vector types. - Add a comment, and a no-op cleanup. - Differentiate between version 0 and version 1 property storages. - Store property names in the code page of the property set. - maintain proper byte order - maintain PROPSETFLAG_ANSI flag based on codepage - update comments - Correct/improve error checking in IPropertyStorage. - convert strings between property storage's code page and system code page - add tests for setting code page - fix tests and behavior to match WinXP - Define and use endian conversion macros for big-endian machines. Marcus Meissner <marcus@jet.franken.de> - Move the Dll init function to compobj.c to avoid having global variables. Remove need of ole32_main.h. - Make HGLOBALStream_* functions static. - Make _xmalloc16() static. - Staticify FTMarshalImpl definition. Francois Gouget <fgouget@free.fr> - Specify the proper call convention in the PropSysFreeString() implementation. - Tweak the API documentation to silence winapi_check warnings. Robert Shearman <rob@codeweavers.com> - Add error messages on failure in file moniker load function. - Fix incorrect pointer check in both monikers. - Fix max size calculation of item moniker to match native. - Add a generic moniker marshaler that works by saving & loading monikers to & from the stream. - Use the generic moniker marshal in the file & item monikers and add a class factory for each. - Implement IROTData::GetComparisonData for file & item monikers. - Add a useful trace message. - Fix more places where custom header size was calculated exclusive of the data size member. - Optimize custom marshaling by getting size before calling the custom marshaler so we can write the header before and not use a second stream. - Change remaining blocks of code with 2-space indentation to 4-space indentation. - Make vtables const. - Remove an unnecessary memcpy and let the compiler do the work. - Write custom header up to and including size, not excluding. - Add a stub implementation of CoIsHandlerConnected. - Marshal objects & monikers into the ROT. - Test for this behaviour. Mike McCormack <mike@codeweavers.com> - Remove unnecessary declarations and make functions static. - Remove forward declarations. - Make sure a stream can't be created in read only storage. - Fix a memory leak in the ole storage implementation. - Remove function prototypes. Kevin Koltzau <kevin@plop.org> - Implement Hash function on composite moniker. Jeff Latimer <jeffl@defcen.gov.au> - Implement the IEnumMoniker interface for the ROT and provide tests to exercise the interface. Pierre d'Herbemont <stegefin@free.fr> - Big Endian specific code fixes in order to conform with NONAMELESSSTRUCT. Matthew Mastracci <matt@aclaro.com> - Replace stub entry for StgOpenStorageEx with call to StgOpenStorage. - Replace StgCreateStorageEx stub with call to StgCreateDocfile and add required STGFMT_* enumerations. svn path=/trunk/; revision=15562
2005-05-28 09:30:04 +00:00
}
}
TRACE("returning 0x%08x (%s)\n", hr,
Sync to Wine-20050524: Alexandre Julliard <julliard@winehq.org> - Added rules for building import libraries in the individual dll makefiles, and added support for building a .def.a static import library too. - Removed unnecessary code in the 16-bit DllEntryPoint function of some dlls, and also fixed its ordinal in a few places. - Comment out stub WEP entry points so that we can call WEP for builtin dlls too. Juan Lang <juan_lang@yahoo.com> - Obvious fixes to PropVariantClear and PropVariantCopy for vector types. - Add a comment, and a no-op cleanup. - Differentiate between version 0 and version 1 property storages. - Store property names in the code page of the property set. - maintain proper byte order - maintain PROPSETFLAG_ANSI flag based on codepage - update comments - Correct/improve error checking in IPropertyStorage. - convert strings between property storage's code page and system code page - add tests for setting code page - fix tests and behavior to match WinXP - Define and use endian conversion macros for big-endian machines. Marcus Meissner <marcus@jet.franken.de> - Move the Dll init function to compobj.c to avoid having global variables. Remove need of ole32_main.h. - Make HGLOBALStream_* functions static. - Make _xmalloc16() static. - Staticify FTMarshalImpl definition. Francois Gouget <fgouget@free.fr> - Specify the proper call convention in the PropSysFreeString() implementation. - Tweak the API documentation to silence winapi_check warnings. Robert Shearman <rob@codeweavers.com> - Add error messages on failure in file moniker load function. - Fix incorrect pointer check in both monikers. - Fix max size calculation of item moniker to match native. - Add a generic moniker marshaler that works by saving & loading monikers to & from the stream. - Use the generic moniker marshal in the file & item monikers and add a class factory for each. - Implement IROTData::GetComparisonData for file & item monikers. - Add a useful trace message. - Fix more places where custom header size was calculated exclusive of the data size member. - Optimize custom marshaling by getting size before calling the custom marshaler so we can write the header before and not use a second stream. - Change remaining blocks of code with 2-space indentation to 4-space indentation. - Make vtables const. - Remove an unnecessary memcpy and let the compiler do the work. - Write custom header up to and including size, not excluding. - Add a stub implementation of CoIsHandlerConnected. - Marshal objects & monikers into the ROT. - Test for this behaviour. Mike McCormack <mike@codeweavers.com> - Remove unnecessary declarations and make functions static. - Remove forward declarations. - Make sure a stream can't be created in read only storage. - Fix a memory leak in the ole storage implementation. - Remove function prototypes. Kevin Koltzau <kevin@plop.org> - Implement Hash function on composite moniker. Jeff Latimer <jeffl@defcen.gov.au> - Implement the IEnumMoniker interface for the ROT and provide tests to exercise the interface. Pierre d'Herbemont <stegefin@free.fr> - Big Endian specific code fixes in order to conform with NONAMELESSSTRUCT. Matthew Mastracci <matt@aclaro.com> - Replace stub entry for StgOpenStorageEx with call to StgOpenStorage. - Replace StgCreateStorageEx stub with call to StgCreateDocfile and add required STGFMT_* enumerations. svn path=/trunk/; revision=15562
2005-05-28 09:30:04 +00:00
dstCP == CP_UNICODE ? debugstr_w((LPCWSTR)*dst) : debugstr_a(*dst));
return hr;
}
static HRESULT PropertyStorage_PropVariantCopy(PROPVARIANT *prop,
const PROPVARIANT *propvar, LCID targetCP, LCID srcCP)
{
HRESULT hr = S_OK;
assert(prop);
assert(propvar);
if (propvar->vt == VT_LPSTR)
{
hr = PropertyStorage_StringCopy(propvar->u.pszVal, srcCP,
&prop->u.pszVal, targetCP);
if (SUCCEEDED(hr))
prop->vt = VT_LPSTR;
}
else
PropVariantCopy(prop, propvar);
return hr;
}
/* Stores the property with id propid and value propvar into this property
* storage. lcid is ignored if propvar's type is not VT_LPSTR. If propvar's
* type is VT_LPSTR, converts the string using lcid as the source code page
* and This->codePage as the target code page before storing.
* As a side effect, may change This->format to 1 if the type of propvar is
* a version 1-only property.
*/
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
static HRESULT PropertyStorage_StorePropWithId(PropertyStorage_impl *This,
Sync to Wine-20050524: Alexandre Julliard <julliard@winehq.org> - Added rules for building import libraries in the individual dll makefiles, and added support for building a .def.a static import library too. - Removed unnecessary code in the 16-bit DllEntryPoint function of some dlls, and also fixed its ordinal in a few places. - Comment out stub WEP entry points so that we can call WEP for builtin dlls too. Juan Lang <juan_lang@yahoo.com> - Obvious fixes to PropVariantClear and PropVariantCopy for vector types. - Add a comment, and a no-op cleanup. - Differentiate between version 0 and version 1 property storages. - Store property names in the code page of the property set. - maintain proper byte order - maintain PROPSETFLAG_ANSI flag based on codepage - update comments - Correct/improve error checking in IPropertyStorage. - convert strings between property storage's code page and system code page - add tests for setting code page - fix tests and behavior to match WinXP - Define and use endian conversion macros for big-endian machines. Marcus Meissner <marcus@jet.franken.de> - Move the Dll init function to compobj.c to avoid having global variables. Remove need of ole32_main.h. - Make HGLOBALStream_* functions static. - Make _xmalloc16() static. - Staticify FTMarshalImpl definition. Francois Gouget <fgouget@free.fr> - Specify the proper call convention in the PropSysFreeString() implementation. - Tweak the API documentation to silence winapi_check warnings. Robert Shearman <rob@codeweavers.com> - Add error messages on failure in file moniker load function. - Fix incorrect pointer check in both monikers. - Fix max size calculation of item moniker to match native. - Add a generic moniker marshaler that works by saving & loading monikers to & from the stream. - Use the generic moniker marshal in the file & item monikers and add a class factory for each. - Implement IROTData::GetComparisonData for file & item monikers. - Add a useful trace message. - Fix more places where custom header size was calculated exclusive of the data size member. - Optimize custom marshaling by getting size before calling the custom marshaler so we can write the header before and not use a second stream. - Change remaining blocks of code with 2-space indentation to 4-space indentation. - Make vtables const. - Remove an unnecessary memcpy and let the compiler do the work. - Write custom header up to and including size, not excluding. - Add a stub implementation of CoIsHandlerConnected. - Marshal objects & monikers into the ROT. - Test for this behaviour. Mike McCormack <mike@codeweavers.com> - Remove unnecessary declarations and make functions static. - Remove forward declarations. - Make sure a stream can't be created in read only storage. - Fix a memory leak in the ole storage implementation. - Remove function prototypes. Kevin Koltzau <kevin@plop.org> - Implement Hash function on composite moniker. Jeff Latimer <jeffl@defcen.gov.au> - Implement the IEnumMoniker interface for the ROT and provide tests to exercise the interface. Pierre d'Herbemont <stegefin@free.fr> - Big Endian specific code fixes in order to conform with NONAMELESSSTRUCT. Matthew Mastracci <matt@aclaro.com> - Replace stub entry for StgOpenStorageEx with call to StgOpenStorage. - Replace StgCreateStorageEx stub with call to StgCreateDocfile and add required STGFMT_* enumerations. svn path=/trunk/; revision=15562
2005-05-28 09:30:04 +00:00
PROPID propid, const PROPVARIANT *propvar, LCID lcid)
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
{
HRESULT hr = S_OK;
PROPVARIANT *prop = PropertyStorage_FindProperty(This, propid);
assert(propvar);
Sync to Wine-20050524: Alexandre Julliard <julliard@winehq.org> - Added rules for building import libraries in the individual dll makefiles, and added support for building a .def.a static import library too. - Removed unnecessary code in the 16-bit DllEntryPoint function of some dlls, and also fixed its ordinal in a few places. - Comment out stub WEP entry points so that we can call WEP for builtin dlls too. Juan Lang <juan_lang@yahoo.com> - Obvious fixes to PropVariantClear and PropVariantCopy for vector types. - Add a comment, and a no-op cleanup. - Differentiate between version 0 and version 1 property storages. - Store property names in the code page of the property set. - maintain proper byte order - maintain PROPSETFLAG_ANSI flag based on codepage - update comments - Correct/improve error checking in IPropertyStorage. - convert strings between property storage's code page and system code page - add tests for setting code page - fix tests and behavior to match WinXP - Define and use endian conversion macros for big-endian machines. Marcus Meissner <marcus@jet.franken.de> - Move the Dll init function to compobj.c to avoid having global variables. Remove need of ole32_main.h. - Make HGLOBALStream_* functions static. - Make _xmalloc16() static. - Staticify FTMarshalImpl definition. Francois Gouget <fgouget@free.fr> - Specify the proper call convention in the PropSysFreeString() implementation. - Tweak the API documentation to silence winapi_check warnings. Robert Shearman <rob@codeweavers.com> - Add error messages on failure in file moniker load function. - Fix incorrect pointer check in both monikers. - Fix max size calculation of item moniker to match native. - Add a generic moniker marshaler that works by saving & loading monikers to & from the stream. - Use the generic moniker marshal in the file & item monikers and add a class factory for each. - Implement IROTData::GetComparisonData for file & item monikers. - Add a useful trace message. - Fix more places where custom header size was calculated exclusive of the data size member. - Optimize custom marshaling by getting size before calling the custom marshaler so we can write the header before and not use a second stream. - Change remaining blocks of code with 2-space indentation to 4-space indentation. - Make vtables const. - Remove an unnecessary memcpy and let the compiler do the work. - Write custom header up to and including size, not excluding. - Add a stub implementation of CoIsHandlerConnected. - Marshal objects & monikers into the ROT. - Test for this behaviour. Mike McCormack <mike@codeweavers.com> - Remove unnecessary declarations and make functions static. - Remove forward declarations. - Make sure a stream can't be created in read only storage. - Fix a memory leak in the ole storage implementation. - Remove function prototypes. Kevin Koltzau <kevin@plop.org> - Implement Hash function on composite moniker. Jeff Latimer <jeffl@defcen.gov.au> - Implement the IEnumMoniker interface for the ROT and provide tests to exercise the interface. Pierre d'Herbemont <stegefin@free.fr> - Big Endian specific code fixes in order to conform with NONAMELESSSTRUCT. Matthew Mastracci <matt@aclaro.com> - Replace stub entry for StgOpenStorageEx with call to StgOpenStorage. - Replace StgCreateStorageEx stub with call to StgCreateDocfile and add required STGFMT_* enumerations. svn path=/trunk/; revision=15562
2005-05-28 09:30:04 +00:00
if (propvar->vt & VT_BYREF || propvar->vt & VT_ARRAY)
This->format = 1;
switch (propvar->vt)
{
case VT_DECIMAL:
case VT_I1:
case VT_INT:
case VT_UINT:
case VT_VECTOR|VT_I1:
This->format = 1;
}
TRACE("Setting 0x%08x to type %d\n", propid, propvar->vt);
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
if (prop)
{
PropVariantClear(prop);
Sync to Wine-20050524: Alexandre Julliard <julliard@winehq.org> - Added rules for building import libraries in the individual dll makefiles, and added support for building a .def.a static import library too. - Removed unnecessary code in the 16-bit DllEntryPoint function of some dlls, and also fixed its ordinal in a few places. - Comment out stub WEP entry points so that we can call WEP for builtin dlls too. Juan Lang <juan_lang@yahoo.com> - Obvious fixes to PropVariantClear and PropVariantCopy for vector types. - Add a comment, and a no-op cleanup. - Differentiate between version 0 and version 1 property storages. - Store property names in the code page of the property set. - maintain proper byte order - maintain PROPSETFLAG_ANSI flag based on codepage - update comments - Correct/improve error checking in IPropertyStorage. - convert strings between property storage's code page and system code page - add tests for setting code page - fix tests and behavior to match WinXP - Define and use endian conversion macros for big-endian machines. Marcus Meissner <marcus@jet.franken.de> - Move the Dll init function to compobj.c to avoid having global variables. Remove need of ole32_main.h. - Make HGLOBALStream_* functions static. - Make _xmalloc16() static. - Staticify FTMarshalImpl definition. Francois Gouget <fgouget@free.fr> - Specify the proper call convention in the PropSysFreeString() implementation. - Tweak the API documentation to silence winapi_check warnings. Robert Shearman <rob@codeweavers.com> - Add error messages on failure in file moniker load function. - Fix incorrect pointer check in both monikers. - Fix max size calculation of item moniker to match native. - Add a generic moniker marshaler that works by saving & loading monikers to & from the stream. - Use the generic moniker marshal in the file & item monikers and add a class factory for each. - Implement IROTData::GetComparisonData for file & item monikers. - Add a useful trace message. - Fix more places where custom header size was calculated exclusive of the data size member. - Optimize custom marshaling by getting size before calling the custom marshaler so we can write the header before and not use a second stream. - Change remaining blocks of code with 2-space indentation to 4-space indentation. - Make vtables const. - Remove an unnecessary memcpy and let the compiler do the work. - Write custom header up to and including size, not excluding. - Add a stub implementation of CoIsHandlerConnected. - Marshal objects & monikers into the ROT. - Test for this behaviour. Mike McCormack <mike@codeweavers.com> - Remove unnecessary declarations and make functions static. - Remove forward declarations. - Make sure a stream can't be created in read only storage. - Fix a memory leak in the ole storage implementation. - Remove function prototypes. Kevin Koltzau <kevin@plop.org> - Implement Hash function on composite moniker. Jeff Latimer <jeffl@defcen.gov.au> - Implement the IEnumMoniker interface for the ROT and provide tests to exercise the interface. Pierre d'Herbemont <stegefin@free.fr> - Big Endian specific code fixes in order to conform with NONAMELESSSTRUCT. Matthew Mastracci <matt@aclaro.com> - Replace stub entry for StgOpenStorageEx with call to StgOpenStorage. - Replace StgCreateStorageEx stub with call to StgCreateDocfile and add required STGFMT_* enumerations. svn path=/trunk/; revision=15562
2005-05-28 09:30:04 +00:00
hr = PropertyStorage_PropVariantCopy(prop, propvar, This->codePage,
lcid);
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
}
else
{
prop = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
sizeof(PROPVARIANT));
if (prop)
{
Sync to Wine-20050524: Alexandre Julliard <julliard@winehq.org> - Added rules for building import libraries in the individual dll makefiles, and added support for building a .def.a static import library too. - Removed unnecessary code in the 16-bit DllEntryPoint function of some dlls, and also fixed its ordinal in a few places. - Comment out stub WEP entry points so that we can call WEP for builtin dlls too. Juan Lang <juan_lang@yahoo.com> - Obvious fixes to PropVariantClear and PropVariantCopy for vector types. - Add a comment, and a no-op cleanup. - Differentiate between version 0 and version 1 property storages. - Store property names in the code page of the property set. - maintain proper byte order - maintain PROPSETFLAG_ANSI flag based on codepage - update comments - Correct/improve error checking in IPropertyStorage. - convert strings between property storage's code page and system code page - add tests for setting code page - fix tests and behavior to match WinXP - Define and use endian conversion macros for big-endian machines. Marcus Meissner <marcus@jet.franken.de> - Move the Dll init function to compobj.c to avoid having global variables. Remove need of ole32_main.h. - Make HGLOBALStream_* functions static. - Make _xmalloc16() static. - Staticify FTMarshalImpl definition. Francois Gouget <fgouget@free.fr> - Specify the proper call convention in the PropSysFreeString() implementation. - Tweak the API documentation to silence winapi_check warnings. Robert Shearman <rob@codeweavers.com> - Add error messages on failure in file moniker load function. - Fix incorrect pointer check in both monikers. - Fix max size calculation of item moniker to match native. - Add a generic moniker marshaler that works by saving & loading monikers to & from the stream. - Use the generic moniker marshal in the file & item monikers and add a class factory for each. - Implement IROTData::GetComparisonData for file & item monikers. - Add a useful trace message. - Fix more places where custom header size was calculated exclusive of the data size member. - Optimize custom marshaling by getting size before calling the custom marshaler so we can write the header before and not use a second stream. - Change remaining blocks of code with 2-space indentation to 4-space indentation. - Make vtables const. - Remove an unnecessary memcpy and let the compiler do the work. - Write custom header up to and including size, not excluding. - Add a stub implementation of CoIsHandlerConnected. - Marshal objects & monikers into the ROT. - Test for this behaviour. Mike McCormack <mike@codeweavers.com> - Remove unnecessary declarations and make functions static. - Remove forward declarations. - Make sure a stream can't be created in read only storage. - Fix a memory leak in the ole storage implementation. - Remove function prototypes. Kevin Koltzau <kevin@plop.org> - Implement Hash function on composite moniker. Jeff Latimer <jeffl@defcen.gov.au> - Implement the IEnumMoniker interface for the ROT and provide tests to exercise the interface. Pierre d'Herbemont <stegefin@free.fr> - Big Endian specific code fixes in order to conform with NONAMELESSSTRUCT. Matthew Mastracci <matt@aclaro.com> - Replace stub entry for StgOpenStorageEx with call to StgOpenStorage. - Replace StgCreateStorageEx stub with call to StgCreateDocfile and add required STGFMT_* enumerations. svn path=/trunk/; revision=15562
2005-05-28 09:30:04 +00:00
hr = PropertyStorage_PropVariantCopy(prop, propvar, This->codePage,
lcid);
if (SUCCEEDED(hr))
{
dictionary_insert(This->propid_to_prop, UlongToPtr(propid), prop);
Sync to Wine-20050524: Alexandre Julliard <julliard@winehq.org> - Added rules for building import libraries in the individual dll makefiles, and added support for building a .def.a static import library too. - Removed unnecessary code in the 16-bit DllEntryPoint function of some dlls, and also fixed its ordinal in a few places. - Comment out stub WEP entry points so that we can call WEP for builtin dlls too. Juan Lang <juan_lang@yahoo.com> - Obvious fixes to PropVariantClear and PropVariantCopy for vector types. - Add a comment, and a no-op cleanup. - Differentiate between version 0 and version 1 property storages. - Store property names in the code page of the property set. - maintain proper byte order - maintain PROPSETFLAG_ANSI flag based on codepage - update comments - Correct/improve error checking in IPropertyStorage. - convert strings between property storage's code page and system code page - add tests for setting code page - fix tests and behavior to match WinXP - Define and use endian conversion macros for big-endian machines. Marcus Meissner <marcus@jet.franken.de> - Move the Dll init function to compobj.c to avoid having global variables. Remove need of ole32_main.h. - Make HGLOBALStream_* functions static. - Make _xmalloc16() static. - Staticify FTMarshalImpl definition. Francois Gouget <fgouget@free.fr> - Specify the proper call convention in the PropSysFreeString() implementation. - Tweak the API documentation to silence winapi_check warnings. Robert Shearman <rob@codeweavers.com> - Add error messages on failure in file moniker load function. - Fix incorrect pointer check in both monikers. - Fix max size calculation of item moniker to match native. - Add a generic moniker marshaler that works by saving & loading monikers to & from the stream. - Use the generic moniker marshal in the file & item monikers and add a class factory for each. - Implement IROTData::GetComparisonData for file & item monikers. - Add a useful trace message. - Fix more places where custom header size was calculated exclusive of the data size member. - Optimize custom marshaling by getting size before calling the custom marshaler so we can write the header before and not use a second stream. - Change remaining blocks of code with 2-space indentation to 4-space indentation. - Make vtables const. - Remove an unnecessary memcpy and let the compiler do the work. - Write custom header up to and including size, not excluding. - Add a stub implementation of CoIsHandlerConnected. - Marshal objects & monikers into the ROT. - Test for this behaviour. Mike McCormack <mike@codeweavers.com> - Remove unnecessary declarations and make functions static. - Remove forward declarations. - Make sure a stream can't be created in read only storage. - Fix a memory leak in the ole storage implementation. - Remove function prototypes. Kevin Koltzau <kevin@plop.org> - Implement Hash function on composite moniker. Jeff Latimer <jeffl@defcen.gov.au> - Implement the IEnumMoniker interface for the ROT and provide tests to exercise the interface. Pierre d'Herbemont <stegefin@free.fr> - Big Endian specific code fixes in order to conform with NONAMELESSSTRUCT. Matthew Mastracci <matt@aclaro.com> - Replace stub entry for StgOpenStorageEx with call to StgOpenStorage. - Replace StgCreateStorageEx stub with call to StgCreateDocfile and add required STGFMT_* enumerations. svn path=/trunk/; revision=15562
2005-05-28 09:30:04 +00:00
if (propid > This->highestProp)
This->highestProp = propid;
}
else
HeapFree(GetProcessHeap(), 0, prop);
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
}
else
hr = STG_E_INSUFFICIENTMEMORY;
}
return hr;
Sync to Wine-20050310: Jon Griffiths <jon_p_griffiths@yahoo.com> - Documentation spelling fixes. Mike McCormack <mike@codeweavers.com> - Implement and test IPropertySetStorage. - Fix more incorrect uses of STGM_ enumerations. - Add struct StorageBaseImpl at the start of derived structures instead of trying to keep the first members the same. - StgOpenStorage shouldn't open zero length storage files. - Shared reading of storage files requires STGM_TRANSACTED. - Test and fix grfMode handling in StgOpenDocfile. - Implement StgSetTimes. Robert Shearman <rob@codeweavers.com> - Better tracing. - Small cleanup of creation functions. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. - Move marshaling state machine into stub manager from ifstub. - Add additional needed states for table-weak marshaling, as shown by tests. - Protect external reference count from underflows/overflows. - Make COM use the RPC runtime as the backend for RPC calls. Based on a patch by Ove Ksven. - Invoke objects in STA's in the correct thread by sending messages to the hidden apartment window. - Use I_RpcGetBuffer, instead of our own buffer routines to fix an occasional test crash caused by heap corruption. - Zero the memory block passed to RpcServerRegisterIfEx so we don't pass garbage in some of the fields we don't fill in. - Return the correct error code from create_server and fix two handle leaks. - TODO update. - Remove cruft left over from previous RPC backend implementation in the apartment structure. - Don't pass an IPID by value for proxy_manager_create_ifproxy. - Disable more of RPC_UnregisterInterface to prevent the RPC runtime using freed memory. - Rename various external RPC backend functions so that they all have the same "RPC_" prefix. - Reduce the timeout of the function that connects to a local server to 30s, like native. - Make each ifproxy have its own channel buffer to fix a bug where a proxy with multiple interfaces could invoke the wrong stub buffer on the server. - The Global Interface Table should do table-strong marshaling instead of normal marshaling so that an interface can be retrieved more than one time. Mike Hearn <mh@codeweavers.com> - Avoid infinite loop when doing a typelib marshalled IUnknown::QueryInterface by only doing an extra QI if requested IID is not equal to marshalled IID. Rob Shearman <rob@codeweavers.com> Mike Hearn <mh@codeweavers.com> - Add re-entrancy tests to the test suite. - Run RPCs on a new thread client side so we can pump the message loop. Juan Lang <juan_lang@yahoo.com> - Fix the calling convention of DllCanUnloadNow. - Move vtbl to end of file and get rid of unnecessary prototypes. - Implement StgCreatePropSetStg. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Paul Vriens <Paul.Vriens@xs4all.nl> - Added some TRACE statements. svn path=/trunk/; revision=14083
2005-03-14 23:17:44 +00:00
}
Sync to Wine-20050524: Alexandre Julliard <julliard@winehq.org> - Added rules for building import libraries in the individual dll makefiles, and added support for building a .def.a static import library too. - Removed unnecessary code in the 16-bit DllEntryPoint function of some dlls, and also fixed its ordinal in a few places. - Comment out stub WEP entry points so that we can call WEP for builtin dlls too. Juan Lang <juan_lang@yahoo.com> - Obvious fixes to PropVariantClear and PropVariantCopy for vector types. - Add a comment, and a no-op cleanup. - Differentiate between version 0 and version 1 property storages. - Store property names in the code page of the property set. - maintain proper byte order - maintain PROPSETFLAG_ANSI flag based on codepage - update comments - Correct/improve error checking in IPropertyStorage. - convert strings between property storage's code page and system code page - add tests for setting code page - fix tests and behavior to match WinXP - Define and use endian conversion macros for big-endian machines. Marcus Meissner <marcus@jet.franken.de> - Move the Dll init function to compobj.c to avoid having global variables. Remove need of ole32_main.h. - Make HGLOBALStream_* functions static. - Make _xmalloc16() static. - Staticify FTMarshalImpl definition. Francois Gouget <fgouget@free.fr> - Specify the proper call convention in the PropSysFreeString() implementation. - Tweak the API documentation to silence winapi_check warnings. Robert Shearman <rob@codeweavers.com> - Add error messages on failure in file moniker load function. - Fix incorrect pointer check in both monikers. - Fix max size calculation of item moniker to match native. - Add a generic moniker marshaler that works by saving & loading monikers to & from the stream. - Use the generic moniker marshal in the file & item monikers and add a class factory for each. - Implement IROTData::GetComparisonData for file & item monikers. - Add a useful trace message. - Fix more places where custom header size was calculated exclusive of the data size member. - Optimize custom marshaling by getting size before calling the custom marshaler so we can write the header before and not use a second stream. - Change remaining blocks of code with 2-space indentation to 4-space indentation. - Make vtables const. - Remove an unnecessary memcpy and let the compiler do the work. - Write custom header up to and including size, not excluding. - Add a stub implementation of CoIsHandlerConnected. - Marshal objects & monikers into the ROT. - Test for this behaviour. Mike McCormack <mike@codeweavers.com> - Remove unnecessary declarations and make functions static. - Remove forward declarations. - Make sure a stream can't be created in read only storage. - Fix a memory leak in the ole storage implementation. - Remove function prototypes. Kevin Koltzau <kevin@plop.org> - Implement Hash function on composite moniker. Jeff Latimer <jeffl@defcen.gov.au> - Implement the IEnumMoniker interface for the ROT and provide tests to exercise the interface. Pierre d'Herbemont <stegefin@free.fr> - Big Endian specific code fixes in order to conform with NONAMELESSSTRUCT. Matthew Mastracci <matt@aclaro.com> - Replace stub entry for StgOpenStorageEx with call to StgOpenStorage. - Replace StgCreateStorageEx stub with call to StgCreateDocfile and add required STGFMT_* enumerations. svn path=/trunk/; revision=15562
2005-05-28 09:30:04 +00:00
/* Adds the name srcName to the name dictionaries, mapped to property ID id.
* srcName is encoded in code page cp, and is converted to This->codePage.
* If cp is CP_UNICODE, srcName is actually a unicode string.
* As a side effect, may change This->format to 1 if srcName is too long for
* a version 0 property storage.
* Doesn't validate id.
*/
static HRESULT PropertyStorage_StoreNameWithId(PropertyStorage_impl *This,
LPCSTR srcName, LCID cp, PROPID id)
{
LPSTR name;
HRESULT hr;
assert(srcName);
hr = PropertyStorage_StringCopy(srcName, cp, &name, This->codePage);
Sync to Wine-20050524: Alexandre Julliard <julliard@winehq.org> - Added rules for building import libraries in the individual dll makefiles, and added support for building a .def.a static import library too. - Removed unnecessary code in the 16-bit DllEntryPoint function of some dlls, and also fixed its ordinal in a few places. - Comment out stub WEP entry points so that we can call WEP for builtin dlls too. Juan Lang <juan_lang@yahoo.com> - Obvious fixes to PropVariantClear and PropVariantCopy for vector types. - Add a comment, and a no-op cleanup. - Differentiate between version 0 and version 1 property storages. - Store property names in the code page of the property set. - maintain proper byte order - maintain PROPSETFLAG_ANSI flag based on codepage - update comments - Correct/improve error checking in IPropertyStorage. - convert strings between property storage's code page and system code page - add tests for setting code page - fix tests and behavior to match WinXP - Define and use endian conversion macros for big-endian machines. Marcus Meissner <marcus@jet.franken.de> - Move the Dll init function to compobj.c to avoid having global variables. Remove need of ole32_main.h. - Make HGLOBALStream_* functions static. - Make _xmalloc16() static. - Staticify FTMarshalImpl definition. Francois Gouget <fgouget@free.fr> - Specify the proper call convention in the PropSysFreeString() implementation. - Tweak the API documentation to silence winapi_check warnings. Robert Shearman <rob@codeweavers.com> - Add error messages on failure in file moniker load function. - Fix incorrect pointer check in both monikers. - Fix max size calculation of item moniker to match native. - Add a generic moniker marshaler that works by saving & loading monikers to & from the stream. - Use the generic moniker marshal in the file & item monikers and add a class factory for each. - Implement IROTData::GetComparisonData for file & item monikers. - Add a useful trace message. - Fix more places where custom header size was calculated exclusive of the data size member. - Optimize custom marshaling by getting size before calling the custom marshaler so we can write the header before and not use a second stream. - Change remaining blocks of code with 2-space indentation to 4-space indentation. - Make vtables const. - Remove an unnecessary memcpy and let the compiler do the work. - Write custom header up to and including size, not excluding. - Add a stub implementation of CoIsHandlerConnected. - Marshal objects & monikers into the ROT. - Test for this behaviour. Mike McCormack <mike@codeweavers.com> - Remove unnecessary declarations and make functions static. - Remove forward declarations. - Make sure a stream can't be created in read only storage. - Fix a memory leak in the ole storage implementation. - Remove function prototypes. Kevin Koltzau <kevin@plop.org> - Implement Hash function on composite moniker. Jeff Latimer <jeffl@defcen.gov.au> - Implement the IEnumMoniker interface for the ROT and provide tests to exercise the interface. Pierre d'Herbemont <stegefin@free.fr> - Big Endian specific code fixes in order to conform with NONAMELESSSTRUCT. Matthew Mastracci <matt@aclaro.com> - Replace stub entry for StgOpenStorageEx with call to StgOpenStorage. - Replace StgCreateStorageEx stub with call to StgCreateDocfile and add required STGFMT_* enumerations. svn path=/trunk/; revision=15562
2005-05-28 09:30:04 +00:00
if (SUCCEEDED(hr))
{
if (This->codePage == CP_UNICODE)
{
if (lstrlenW((LPWSTR)name) >= MAX_VERSION_0_PROP_NAME_LENGTH)
This->format = 1;
}
else
{
if (strlen(name) >= MAX_VERSION_0_PROP_NAME_LENGTH)
This->format = 1;
}
TRACE("Adding prop name %s, propid %d\n",
Sync to Wine-20050524: Alexandre Julliard <julliard@winehq.org> - Added rules for building import libraries in the individual dll makefiles, and added support for building a .def.a static import library too. - Removed unnecessary code in the 16-bit DllEntryPoint function of some dlls, and also fixed its ordinal in a few places. - Comment out stub WEP entry points so that we can call WEP for builtin dlls too. Juan Lang <juan_lang@yahoo.com> - Obvious fixes to PropVariantClear and PropVariantCopy for vector types. - Add a comment, and a no-op cleanup. - Differentiate between version 0 and version 1 property storages. - Store property names in the code page of the property set. - maintain proper byte order - maintain PROPSETFLAG_ANSI flag based on codepage - update comments - Correct/improve error checking in IPropertyStorage. - convert strings between property storage's code page and system code page - add tests for setting code page - fix tests and behavior to match WinXP - Define and use endian conversion macros for big-endian machines. Marcus Meissner <marcus@jet.franken.de> - Move the Dll init function to compobj.c to avoid having global variables. Remove need of ole32_main.h. - Make HGLOBALStream_* functions static. - Make _xmalloc16() static. - Staticify FTMarshalImpl definition. Francois Gouget <fgouget@free.fr> - Specify the proper call convention in the PropSysFreeString() implementation. - Tweak the API documentation to silence winapi_check warnings. Robert Shearman <rob@codeweavers.com> - Add error messages on failure in file moniker load function. - Fix incorrect pointer check in both monikers. - Fix max size calculation of item moniker to match native. - Add a generic moniker marshaler that works by saving & loading monikers to & from the stream. - Use the generic moniker marshal in the file & item monikers and add a class factory for each. - Implement IROTData::GetComparisonData for file & item monikers. - Add a useful trace message. - Fix more places where custom header size was calculated exclusive of the data size member. - Optimize custom marshaling by getting size before calling the custom marshaler so we can write the header before and not use a second stream. - Change remaining blocks of code with 2-space indentation to 4-space indentation. - Make vtables const. - Remove an unnecessary memcpy and let the compiler do the work. - Write custom header up to and including size, not excluding. - Add a stub implementation of CoIsHandlerConnected. - Marshal objects & monikers into the ROT. - Test for this behaviour. Mike McCormack <mike@codeweavers.com> - Remove unnecessary declarations and make functions static. - Remove forward declarations. - Make sure a stream can't be created in read only storage. - Fix a memory leak in the ole storage implementation. - Remove function prototypes. Kevin Koltzau <kevin@plop.org> - Implement Hash function on composite moniker. Jeff Latimer <jeffl@defcen.gov.au> - Implement the IEnumMoniker interface for the ROT and provide tests to exercise the interface. Pierre d'Herbemont <stegefin@free.fr> - Big Endian specific code fixes in order to conform with NONAMELESSSTRUCT. Matthew Mastracci <matt@aclaro.com> - Replace stub entry for StgOpenStorageEx with call to StgOpenStorage. - Replace StgCreateStorageEx stub with call to StgCreateDocfile and add required STGFMT_* enumerations. svn path=/trunk/; revision=15562
2005-05-28 09:30:04 +00:00
This->codePage == CP_UNICODE ? debugstr_w((LPCWSTR)name) :
debugstr_a(name), id);
dictionary_insert(This->name_to_propid, name, UlongToPtr(id));
dictionary_insert(This->propid_to_name, UlongToPtr(id), name);
Sync to Wine-20050524: Alexandre Julliard <julliard@winehq.org> - Added rules for building import libraries in the individual dll makefiles, and added support for building a .def.a static import library too. - Removed unnecessary code in the 16-bit DllEntryPoint function of some dlls, and also fixed its ordinal in a few places. - Comment out stub WEP entry points so that we can call WEP for builtin dlls too. Juan Lang <juan_lang@yahoo.com> - Obvious fixes to PropVariantClear and PropVariantCopy for vector types. - Add a comment, and a no-op cleanup. - Differentiate between version 0 and version 1 property storages. - Store property names in the code page of the property set. - maintain proper byte order - maintain PROPSETFLAG_ANSI flag based on codepage - update comments - Correct/improve error checking in IPropertyStorage. - convert strings between property storage's code page and system code page - add tests for setting code page - fix tests and behavior to match WinXP - Define and use endian conversion macros for big-endian machines. Marcus Meissner <marcus@jet.franken.de> - Move the Dll init function to compobj.c to avoid having global variables. Remove need of ole32_main.h. - Make HGLOBALStream_* functions static. - Make _xmalloc16() static. - Staticify FTMarshalImpl definition. Francois Gouget <fgouget@free.fr> - Specify the proper call convention in the PropSysFreeString() implementation. - Tweak the API documentation to silence winapi_check warnings. Robert Shearman <rob@codeweavers.com> - Add error messages on failure in file moniker load function. - Fix incorrect pointer check in both monikers. - Fix max size calculation of item moniker to match native. - Add a generic moniker marshaler that works by saving & loading monikers to & from the stream. - Use the generic moniker marshal in the file & item monikers and add a class factory for each. - Implement IROTData::GetComparisonData for file & item monikers. - Add a useful trace message. - Fix more places where custom header size was calculated exclusive of the data size member. - Optimize custom marshaling by getting size before calling the custom marshaler so we can write the header before and not use a second stream. - Change remaining blocks of code with 2-space indentation to 4-space indentation. - Make vtables const. - Remove an unnecessary memcpy and let the compiler do the work. - Write custom header up to and including size, not excluding. - Add a stub implementation of CoIsHandlerConnected. - Marshal objects & monikers into the ROT. - Test for this behaviour. Mike McCormack <mike@codeweavers.com> - Remove unnecessary declarations and make functions static. - Remove forward declarations. - Make sure a stream can't be created in read only storage. - Fix a memory leak in the ole storage implementation. - Remove function prototypes. Kevin Koltzau <kevin@plop.org> - Implement Hash function on composite moniker. Jeff Latimer <jeffl@defcen.gov.au> - Implement the IEnumMoniker interface for the ROT and provide tests to exercise the interface. Pierre d'Herbemont <stegefin@free.fr> - Big Endian specific code fixes in order to conform with NONAMELESSSTRUCT. Matthew Mastracci <matt@aclaro.com> - Replace stub entry for StgOpenStorageEx with call to StgOpenStorage. - Replace StgCreateStorageEx stub with call to StgCreateDocfile and add required STGFMT_* enumerations. svn path=/trunk/; revision=15562
2005-05-28 09:30:04 +00:00
}
return hr;
}
Sync to Wine-20050310: Jon Griffiths <jon_p_griffiths@yahoo.com> - Documentation spelling fixes. Mike McCormack <mike@codeweavers.com> - Implement and test IPropertySetStorage. - Fix more incorrect uses of STGM_ enumerations. - Add struct StorageBaseImpl at the start of derived structures instead of trying to keep the first members the same. - StgOpenStorage shouldn't open zero length storage files. - Shared reading of storage files requires STGM_TRANSACTED. - Test and fix grfMode handling in StgOpenDocfile. - Implement StgSetTimes. Robert Shearman <rob@codeweavers.com> - Better tracing. - Small cleanup of creation functions. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. - Move marshaling state machine into stub manager from ifstub. - Add additional needed states for table-weak marshaling, as shown by tests. - Protect external reference count from underflows/overflows. - Make COM use the RPC runtime as the backend for RPC calls. Based on a patch by Ove Ksven. - Invoke objects in STA's in the correct thread by sending messages to the hidden apartment window. - Use I_RpcGetBuffer, instead of our own buffer routines to fix an occasional test crash caused by heap corruption. - Zero the memory block passed to RpcServerRegisterIfEx so we don't pass garbage in some of the fields we don't fill in. - Return the correct error code from create_server and fix two handle leaks. - TODO update. - Remove cruft left over from previous RPC backend implementation in the apartment structure. - Don't pass an IPID by value for proxy_manager_create_ifproxy. - Disable more of RPC_UnregisterInterface to prevent the RPC runtime using freed memory. - Rename various external RPC backend functions so that they all have the same "RPC_" prefix. - Reduce the timeout of the function that connects to a local server to 30s, like native. - Make each ifproxy have its own channel buffer to fix a bug where a proxy with multiple interfaces could invoke the wrong stub buffer on the server. - The Global Interface Table should do table-strong marshaling instead of normal marshaling so that an interface can be retrieved more than one time. Mike Hearn <mh@codeweavers.com> - Avoid infinite loop when doing a typelib marshalled IUnknown::QueryInterface by only doing an extra QI if requested IID is not equal to marshalled IID. Rob Shearman <rob@codeweavers.com> Mike Hearn <mh@codeweavers.com> - Add re-entrancy tests to the test suite. - Run RPCs on a new thread client side so we can pump the message loop. Juan Lang <juan_lang@yahoo.com> - Fix the calling convention of DllCanUnloadNow. - Move vtbl to end of file and get rid of unnecessary prototypes. - Implement StgCreatePropSetStg. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Paul Vriens <Paul.Vriens@xs4all.nl> - Added some TRACE statements. svn path=/trunk/; revision=14083
2005-03-14 23:17:44 +00:00
/************************************************************************
* IPropertyStorage_fnWriteMultiple (IPropertyStorage)
*/
static HRESULT WINAPI IPropertyStorage_fnWriteMultiple(
IPropertyStorage* iface,
ULONG cpspec,
const PROPSPEC rgpspec[],
const PROPVARIANT rgpropvar[],
PROPID propidNameFirst)
{
PropertyStorage_impl *This = impl_from_IPropertyStorage(iface);
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
HRESULT hr = S_OK;
ULONG i;
TRACE("(%p, %d, %p, %p)\n", iface, cpspec, rgpspec, rgpropvar);
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
if (cpspec && (!rgpspec || !rgpropvar))
return E_INVALIDARG;
if (!(This->grfMode & STGM_READWRITE))
return STG_E_ACCESSDENIED;
EnterCriticalSection(&This->cs);
This->dirty = TRUE;
This->originatorOS = (DWORD)MAKELONG(LOWORD(GetVersion()),
PROPSETHDR_OSVER_KIND_WIN32) ;
for (i = 0; i < cpspec; i++)
{
if (rgpspec[i].ulKind == PRSPEC_LPWSTR)
{
PROPVARIANT *prop = PropertyStorage_FindPropertyByName(This,
rgpspec[i].u.lpwstr);
if (prop)
PropVariantCopy(prop, &rgpropvar[i]);
else
{
/* Note that I don't do the special cases here that I do below,
* because naming the special PIDs isn't supported.
*/
if (propidNameFirst < PID_FIRST_USABLE ||
propidNameFirst >= PID_MIN_READONLY)
hr = STG_E_INVALIDPARAMETER;
else
{
PROPID nextId = max(propidNameFirst, This->highestProp + 1);
Sync to Wine-20050524: Alexandre Julliard <julliard@winehq.org> - Added rules for building import libraries in the individual dll makefiles, and added support for building a .def.a static import library too. - Removed unnecessary code in the 16-bit DllEntryPoint function of some dlls, and also fixed its ordinal in a few places. - Comment out stub WEP entry points so that we can call WEP for builtin dlls too. Juan Lang <juan_lang@yahoo.com> - Obvious fixes to PropVariantClear and PropVariantCopy for vector types. - Add a comment, and a no-op cleanup. - Differentiate between version 0 and version 1 property storages. - Store property names in the code page of the property set. - maintain proper byte order - maintain PROPSETFLAG_ANSI flag based on codepage - update comments - Correct/improve error checking in IPropertyStorage. - convert strings between property storage's code page and system code page - add tests for setting code page - fix tests and behavior to match WinXP - Define and use endian conversion macros for big-endian machines. Marcus Meissner <marcus@jet.franken.de> - Move the Dll init function to compobj.c to avoid having global variables. Remove need of ole32_main.h. - Make HGLOBALStream_* functions static. - Make _xmalloc16() static. - Staticify FTMarshalImpl definition. Francois Gouget <fgouget@free.fr> - Specify the proper call convention in the PropSysFreeString() implementation. - Tweak the API documentation to silence winapi_check warnings. Robert Shearman <rob@codeweavers.com> - Add error messages on failure in file moniker load function. - Fix incorrect pointer check in both monikers. - Fix max size calculation of item moniker to match native. - Add a generic moniker marshaler that works by saving & loading monikers to & from the stream. - Use the generic moniker marshal in the file & item monikers and add a class factory for each. - Implement IROTData::GetComparisonData for file & item monikers. - Add a useful trace message. - Fix more places where custom header size was calculated exclusive of the data size member. - Optimize custom marshaling by getting size before calling the custom marshaler so we can write the header before and not use a second stream. - Change remaining blocks of code with 2-space indentation to 4-space indentation. - Make vtables const. - Remove an unnecessary memcpy and let the compiler do the work. - Write custom header up to and including size, not excluding. - Add a stub implementation of CoIsHandlerConnected. - Marshal objects & monikers into the ROT. - Test for this behaviour. Mike McCormack <mike@codeweavers.com> - Remove unnecessary declarations and make functions static. - Remove forward declarations. - Make sure a stream can't be created in read only storage. - Fix a memory leak in the ole storage implementation. - Remove function prototypes. Kevin Koltzau <kevin@plop.org> - Implement Hash function on composite moniker. Jeff Latimer <jeffl@defcen.gov.au> - Implement the IEnumMoniker interface for the ROT and provide tests to exercise the interface. Pierre d'Herbemont <stegefin@free.fr> - Big Endian specific code fixes in order to conform with NONAMELESSSTRUCT. Matthew Mastracci <matt@aclaro.com> - Replace stub entry for StgOpenStorageEx with call to StgOpenStorage. - Replace StgCreateStorageEx stub with call to StgCreateDocfile and add required STGFMT_* enumerations. svn path=/trunk/; revision=15562
2005-05-28 09:30:04 +00:00
hr = PropertyStorage_StoreNameWithId(This,
(LPCSTR)rgpspec[i].u.lpwstr, CP_UNICODE, nextId);
if (SUCCEEDED(hr))
hr = PropertyStorage_StorePropWithId(This, nextId,
&rgpropvar[i], GetACP());
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
}
}
}
else
{
switch (rgpspec[i].u.propid)
{
case PID_DICTIONARY:
/* Can't set the dictionary */
hr = STG_E_INVALIDPARAMETER;
break;
case PID_CODEPAGE:
/* Can only set the code page if nothing else has been set */
if (dictionary_num_entries(This->propid_to_prop) == 0 &&
rgpropvar[i].vt == VT_I2)
Sync to Wine-20050524: Alexandre Julliard <julliard@winehq.org> - Added rules for building import libraries in the individual dll makefiles, and added support for building a .def.a static import library too. - Removed unnecessary code in the 16-bit DllEntryPoint function of some dlls, and also fixed its ordinal in a few places. - Comment out stub WEP entry points so that we can call WEP for builtin dlls too. Juan Lang <juan_lang@yahoo.com> - Obvious fixes to PropVariantClear and PropVariantCopy for vector types. - Add a comment, and a no-op cleanup. - Differentiate between version 0 and version 1 property storages. - Store property names in the code page of the property set. - maintain proper byte order - maintain PROPSETFLAG_ANSI flag based on codepage - update comments - Correct/improve error checking in IPropertyStorage. - convert strings between property storage's code page and system code page - add tests for setting code page - fix tests and behavior to match WinXP - Define and use endian conversion macros for big-endian machines. Marcus Meissner <marcus@jet.franken.de> - Move the Dll init function to compobj.c to avoid having global variables. Remove need of ole32_main.h. - Make HGLOBALStream_* functions static. - Make _xmalloc16() static. - Staticify FTMarshalImpl definition. Francois Gouget <fgouget@free.fr> - Specify the proper call convention in the PropSysFreeString() implementation. - Tweak the API documentation to silence winapi_check warnings. Robert Shearman <rob@codeweavers.com> - Add error messages on failure in file moniker load function. - Fix incorrect pointer check in both monikers. - Fix max size calculation of item moniker to match native. - Add a generic moniker marshaler that works by saving & loading monikers to & from the stream. - Use the generic moniker marshal in the file & item monikers and add a class factory for each. - Implement IROTData::GetComparisonData for file & item monikers. - Add a useful trace message. - Fix more places where custom header size was calculated exclusive of the data size member. - Optimize custom marshaling by getting size before calling the custom marshaler so we can write the header before and not use a second stream. - Change remaining blocks of code with 2-space indentation to 4-space indentation. - Make vtables const. - Remove an unnecessary memcpy and let the compiler do the work. - Write custom header up to and including size, not excluding. - Add a stub implementation of CoIsHandlerConnected. - Marshal objects & monikers into the ROT. - Test for this behaviour. Mike McCormack <mike@codeweavers.com> - Remove unnecessary declarations and make functions static. - Remove forward declarations. - Make sure a stream can't be created in read only storage. - Fix a memory leak in the ole storage implementation. - Remove function prototypes. Kevin Koltzau <kevin@plop.org> - Implement Hash function on composite moniker. Jeff Latimer <jeffl@defcen.gov.au> - Implement the IEnumMoniker interface for the ROT and provide tests to exercise the interface. Pierre d'Herbemont <stegefin@free.fr> - Big Endian specific code fixes in order to conform with NONAMELESSSTRUCT. Matthew Mastracci <matt@aclaro.com> - Replace stub entry for StgOpenStorageEx with call to StgOpenStorage. - Replace StgCreateStorageEx stub with call to StgCreateDocfile and add required STGFMT_* enumerations. svn path=/trunk/; revision=15562
2005-05-28 09:30:04 +00:00
{
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
This->codePage = rgpropvar[i].u.iVal;
Sync to Wine-20050524: Alexandre Julliard <julliard@winehq.org> - Added rules for building import libraries in the individual dll makefiles, and added support for building a .def.a static import library too. - Removed unnecessary code in the 16-bit DllEntryPoint function of some dlls, and also fixed its ordinal in a few places. - Comment out stub WEP entry points so that we can call WEP for builtin dlls too. Juan Lang <juan_lang@yahoo.com> - Obvious fixes to PropVariantClear and PropVariantCopy for vector types. - Add a comment, and a no-op cleanup. - Differentiate between version 0 and version 1 property storages. - Store property names in the code page of the property set. - maintain proper byte order - maintain PROPSETFLAG_ANSI flag based on codepage - update comments - Correct/improve error checking in IPropertyStorage. - convert strings between property storage's code page and system code page - add tests for setting code page - fix tests and behavior to match WinXP - Define and use endian conversion macros for big-endian machines. Marcus Meissner <marcus@jet.franken.de> - Move the Dll init function to compobj.c to avoid having global variables. Remove need of ole32_main.h. - Make HGLOBALStream_* functions static. - Make _xmalloc16() static. - Staticify FTMarshalImpl definition. Francois Gouget <fgouget@free.fr> - Specify the proper call convention in the PropSysFreeString() implementation. - Tweak the API documentation to silence winapi_check warnings. Robert Shearman <rob@codeweavers.com> - Add error messages on failure in file moniker load function. - Fix incorrect pointer check in both monikers. - Fix max size calculation of item moniker to match native. - Add a generic moniker marshaler that works by saving & loading monikers to & from the stream. - Use the generic moniker marshal in the file & item monikers and add a class factory for each. - Implement IROTData::GetComparisonData for file & item monikers. - Add a useful trace message. - Fix more places where custom header size was calculated exclusive of the data size member. - Optimize custom marshaling by getting size before calling the custom marshaler so we can write the header before and not use a second stream. - Change remaining blocks of code with 2-space indentation to 4-space indentation. - Make vtables const. - Remove an unnecessary memcpy and let the compiler do the work. - Write custom header up to and including size, not excluding. - Add a stub implementation of CoIsHandlerConnected. - Marshal objects & monikers into the ROT. - Test for this behaviour. Mike McCormack <mike@codeweavers.com> - Remove unnecessary declarations and make functions static. - Remove forward declarations. - Make sure a stream can't be created in read only storage. - Fix a memory leak in the ole storage implementation. - Remove function prototypes. Kevin Koltzau <kevin@plop.org> - Implement Hash function on composite moniker. Jeff Latimer <jeffl@defcen.gov.au> - Implement the IEnumMoniker interface for the ROT and provide tests to exercise the interface. Pierre d'Herbemont <stegefin@free.fr> - Big Endian specific code fixes in order to conform with NONAMELESSSTRUCT. Matthew Mastracci <matt@aclaro.com> - Replace stub entry for StgOpenStorageEx with call to StgOpenStorage. - Replace StgCreateStorageEx stub with call to StgCreateDocfile and add required STGFMT_* enumerations. svn path=/trunk/; revision=15562
2005-05-28 09:30:04 +00:00
if (This->codePage == CP_UNICODE)
This->grfFlags &= ~PROPSETFLAG_ANSI;
else
This->grfFlags |= PROPSETFLAG_ANSI;
}
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
else
hr = STG_E_INVALIDPARAMETER;
break;
case PID_LOCALE:
/* Can only set the locale if nothing else has been set */
if (dictionary_num_entries(This->propid_to_prop) == 0 &&
rgpropvar[i].vt == VT_I4)
This->locale = rgpropvar[i].u.lVal;
else
hr = STG_E_INVALIDPARAMETER;
break;
case PID_ILLEGAL:
/* silently ignore like MSDN says */
break;
default:
if (rgpspec[i].u.propid >= PID_MIN_READONLY)
hr = STG_E_INVALIDPARAMETER;
else
hr = PropertyStorage_StorePropWithId(This,
Sync to Wine-20050524: Alexandre Julliard <julliard@winehq.org> - Added rules for building import libraries in the individual dll makefiles, and added support for building a .def.a static import library too. - Removed unnecessary code in the 16-bit DllEntryPoint function of some dlls, and also fixed its ordinal in a few places. - Comment out stub WEP entry points so that we can call WEP for builtin dlls too. Juan Lang <juan_lang@yahoo.com> - Obvious fixes to PropVariantClear and PropVariantCopy for vector types. - Add a comment, and a no-op cleanup. - Differentiate between version 0 and version 1 property storages. - Store property names in the code page of the property set. - maintain proper byte order - maintain PROPSETFLAG_ANSI flag based on codepage - update comments - Correct/improve error checking in IPropertyStorage. - convert strings between property storage's code page and system code page - add tests for setting code page - fix tests and behavior to match WinXP - Define and use endian conversion macros for big-endian machines. Marcus Meissner <marcus@jet.franken.de> - Move the Dll init function to compobj.c to avoid having global variables. Remove need of ole32_main.h. - Make HGLOBALStream_* functions static. - Make _xmalloc16() static. - Staticify FTMarshalImpl definition. Francois Gouget <fgouget@free.fr> - Specify the proper call convention in the PropSysFreeString() implementation. - Tweak the API documentation to silence winapi_check warnings. Robert Shearman <rob@codeweavers.com> - Add error messages on failure in file moniker load function. - Fix incorrect pointer check in both monikers. - Fix max size calculation of item moniker to match native. - Add a generic moniker marshaler that works by saving & loading monikers to & from the stream. - Use the generic moniker marshal in the file & item monikers and add a class factory for each. - Implement IROTData::GetComparisonData for file & item monikers. - Add a useful trace message. - Fix more places where custom header size was calculated exclusive of the data size member. - Optimize custom marshaling by getting size before calling the custom marshaler so we can write the header before and not use a second stream. - Change remaining blocks of code with 2-space indentation to 4-space indentation. - Make vtables const. - Remove an unnecessary memcpy and let the compiler do the work. - Write custom header up to and including size, not excluding. - Add a stub implementation of CoIsHandlerConnected. - Marshal objects & monikers into the ROT. - Test for this behaviour. Mike McCormack <mike@codeweavers.com> - Remove unnecessary declarations and make functions static. - Remove forward declarations. - Make sure a stream can't be created in read only storage. - Fix a memory leak in the ole storage implementation. - Remove function prototypes. Kevin Koltzau <kevin@plop.org> - Implement Hash function on composite moniker. Jeff Latimer <jeffl@defcen.gov.au> - Implement the IEnumMoniker interface for the ROT and provide tests to exercise the interface. Pierre d'Herbemont <stegefin@free.fr> - Big Endian specific code fixes in order to conform with NONAMELESSSTRUCT. Matthew Mastracci <matt@aclaro.com> - Replace stub entry for StgOpenStorageEx with call to StgOpenStorage. - Replace StgCreateStorageEx stub with call to StgCreateDocfile and add required STGFMT_* enumerations. svn path=/trunk/; revision=15562
2005-05-28 09:30:04 +00:00
rgpspec[i].u.propid, &rgpropvar[i], GetACP());
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
}
}
}
if (This->grfFlags & PROPSETFLAG_UNBUFFERED)
IPropertyStorage_Commit(iface, STGC_DEFAULT);
LeaveCriticalSection(&This->cs);
return hr;
Sync to Wine-20050310: Jon Griffiths <jon_p_griffiths@yahoo.com> - Documentation spelling fixes. Mike McCormack <mike@codeweavers.com> - Implement and test IPropertySetStorage. - Fix more incorrect uses of STGM_ enumerations. - Add struct StorageBaseImpl at the start of derived structures instead of trying to keep the first members the same. - StgOpenStorage shouldn't open zero length storage files. - Shared reading of storage files requires STGM_TRANSACTED. - Test and fix grfMode handling in StgOpenDocfile. - Implement StgSetTimes. Robert Shearman <rob@codeweavers.com> - Better tracing. - Small cleanup of creation functions. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. - Move marshaling state machine into stub manager from ifstub. - Add additional needed states for table-weak marshaling, as shown by tests. - Protect external reference count from underflows/overflows. - Make COM use the RPC runtime as the backend for RPC calls. Based on a patch by Ove Ksven. - Invoke objects in STA's in the correct thread by sending messages to the hidden apartment window. - Use I_RpcGetBuffer, instead of our own buffer routines to fix an occasional test crash caused by heap corruption. - Zero the memory block passed to RpcServerRegisterIfEx so we don't pass garbage in some of the fields we don't fill in. - Return the correct error code from create_server and fix two handle leaks. - TODO update. - Remove cruft left over from previous RPC backend implementation in the apartment structure. - Don't pass an IPID by value for proxy_manager_create_ifproxy. - Disable more of RPC_UnregisterInterface to prevent the RPC runtime using freed memory. - Rename various external RPC backend functions so that they all have the same "RPC_" prefix. - Reduce the timeout of the function that connects to a local server to 30s, like native. - Make each ifproxy have its own channel buffer to fix a bug where a proxy with multiple interfaces could invoke the wrong stub buffer on the server. - The Global Interface Table should do table-strong marshaling instead of normal marshaling so that an interface can be retrieved more than one time. Mike Hearn <mh@codeweavers.com> - Avoid infinite loop when doing a typelib marshalled IUnknown::QueryInterface by only doing an extra QI if requested IID is not equal to marshalled IID. Rob Shearman <rob@codeweavers.com> Mike Hearn <mh@codeweavers.com> - Add re-entrancy tests to the test suite. - Run RPCs on a new thread client side so we can pump the message loop. Juan Lang <juan_lang@yahoo.com> - Fix the calling convention of DllCanUnloadNow. - Move vtbl to end of file and get rid of unnecessary prototypes. - Implement StgCreatePropSetStg. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Paul Vriens <Paul.Vriens@xs4all.nl> - Added some TRACE statements. svn path=/trunk/; revision=14083
2005-03-14 23:17:44 +00:00
}
/************************************************************************
* IPropertyStorage_fnDeleteMultiple (IPropertyStorage)
*/
static HRESULT WINAPI IPropertyStorage_fnDeleteMultiple(
IPropertyStorage* iface,
ULONG cpspec,
const PROPSPEC rgpspec[])
{
PropertyStorage_impl *This = impl_from_IPropertyStorage(iface);
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
ULONG i;
HRESULT hr;
TRACE("(%p, %d, %p)\n", iface, cpspec, rgpspec);
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
if (cpspec && !rgpspec)
return E_INVALIDARG;
if (!(This->grfMode & STGM_READWRITE))
return STG_E_ACCESSDENIED;
hr = S_OK;
EnterCriticalSection(&This->cs);
This->dirty = TRUE;
for (i = 0; i < cpspec; i++)
{
if (rgpspec[i].ulKind == PRSPEC_LPWSTR)
{
void *propid;
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
if (dictionary_find(This->name_to_propid, rgpspec[i].u.lpwstr, &propid))
dictionary_remove(This->propid_to_prop, propid);
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
}
else
{
if (rgpspec[i].u.propid >= PID_FIRST_USABLE &&
rgpspec[i].u.propid < PID_MIN_READONLY)
dictionary_remove(This->propid_to_prop, UlongToPtr(rgpspec[i].u.propid));
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
else
hr = STG_E_INVALIDPARAMETER;
}
}
if (This->grfFlags & PROPSETFLAG_UNBUFFERED)
IPropertyStorage_Commit(iface, STGC_DEFAULT);
LeaveCriticalSection(&This->cs);
return hr;
Sync to Wine-20050310: Jon Griffiths <jon_p_griffiths@yahoo.com> - Documentation spelling fixes. Mike McCormack <mike@codeweavers.com> - Implement and test IPropertySetStorage. - Fix more incorrect uses of STGM_ enumerations. - Add struct StorageBaseImpl at the start of derived structures instead of trying to keep the first members the same. - StgOpenStorage shouldn't open zero length storage files. - Shared reading of storage files requires STGM_TRANSACTED. - Test and fix grfMode handling in StgOpenDocfile. - Implement StgSetTimes. Robert Shearman <rob@codeweavers.com> - Better tracing. - Small cleanup of creation functions. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. - Move marshaling state machine into stub manager from ifstub. - Add additional needed states for table-weak marshaling, as shown by tests. - Protect external reference count from underflows/overflows. - Make COM use the RPC runtime as the backend for RPC calls. Based on a patch by Ove Ksven. - Invoke objects in STA's in the correct thread by sending messages to the hidden apartment window. - Use I_RpcGetBuffer, instead of our own buffer routines to fix an occasional test crash caused by heap corruption. - Zero the memory block passed to RpcServerRegisterIfEx so we don't pass garbage in some of the fields we don't fill in. - Return the correct error code from create_server and fix two handle leaks. - TODO update. - Remove cruft left over from previous RPC backend implementation in the apartment structure. - Don't pass an IPID by value for proxy_manager_create_ifproxy. - Disable more of RPC_UnregisterInterface to prevent the RPC runtime using freed memory. - Rename various external RPC backend functions so that they all have the same "RPC_" prefix. - Reduce the timeout of the function that connects to a local server to 30s, like native. - Make each ifproxy have its own channel buffer to fix a bug where a proxy with multiple interfaces could invoke the wrong stub buffer on the server. - The Global Interface Table should do table-strong marshaling instead of normal marshaling so that an interface can be retrieved more than one time. Mike Hearn <mh@codeweavers.com> - Avoid infinite loop when doing a typelib marshalled IUnknown::QueryInterface by only doing an extra QI if requested IID is not equal to marshalled IID. Rob Shearman <rob@codeweavers.com> Mike Hearn <mh@codeweavers.com> - Add re-entrancy tests to the test suite. - Run RPCs on a new thread client side so we can pump the message loop. Juan Lang <juan_lang@yahoo.com> - Fix the calling convention of DllCanUnloadNow. - Move vtbl to end of file and get rid of unnecessary prototypes. - Implement StgCreatePropSetStg. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Paul Vriens <Paul.Vriens@xs4all.nl> - Added some TRACE statements. svn path=/trunk/; revision=14083
2005-03-14 23:17:44 +00:00
}
/************************************************************************
* IPropertyStorage_fnReadPropertyNames (IPropertyStorage)
*/
static HRESULT WINAPI IPropertyStorage_fnReadPropertyNames(
IPropertyStorage* iface,
ULONG cpropid,
const PROPID rgpropid[],
LPOLESTR rglpwstrName[])
{
PropertyStorage_impl *This = impl_from_IPropertyStorage(iface);
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
ULONG i;
HRESULT hr = S_FALSE;
TRACE("(%p, %d, %p, %p)\n", iface, cpropid, rgpropid, rglpwstrName);
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
if (cpropid && (!rgpropid || !rglpwstrName))
return E_INVALIDARG;
EnterCriticalSection(&This->cs);
for (i = 0; i < cpropid && SUCCEEDED(hr); i++)
{
LPWSTR name = PropertyStorage_FindPropertyNameById(This, rgpropid[i]);
if (name)
{
size_t len = lstrlenW(name);
hr = S_OK;
rglpwstrName[i] = CoTaskMemAlloc((len + 1) * sizeof(WCHAR));
if (rglpwstrName[i])
memcpy(rglpwstrName[i], name, (len + 1) * sizeof(WCHAR));
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
else
hr = STG_E_INSUFFICIENTMEMORY;
}
else
rglpwstrName[i] = NULL;
}
LeaveCriticalSection(&This->cs);
return hr;
Sync to Wine-20050310: Jon Griffiths <jon_p_griffiths@yahoo.com> - Documentation spelling fixes. Mike McCormack <mike@codeweavers.com> - Implement and test IPropertySetStorage. - Fix more incorrect uses of STGM_ enumerations. - Add struct StorageBaseImpl at the start of derived structures instead of trying to keep the first members the same. - StgOpenStorage shouldn't open zero length storage files. - Shared reading of storage files requires STGM_TRANSACTED. - Test and fix grfMode handling in StgOpenDocfile. - Implement StgSetTimes. Robert Shearman <rob@codeweavers.com> - Better tracing. - Small cleanup of creation functions. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. - Move marshaling state machine into stub manager from ifstub. - Add additional needed states for table-weak marshaling, as shown by tests. - Protect external reference count from underflows/overflows. - Make COM use the RPC runtime as the backend for RPC calls. Based on a patch by Ove Ksven. - Invoke objects in STA's in the correct thread by sending messages to the hidden apartment window. - Use I_RpcGetBuffer, instead of our own buffer routines to fix an occasional test crash caused by heap corruption. - Zero the memory block passed to RpcServerRegisterIfEx so we don't pass garbage in some of the fields we don't fill in. - Return the correct error code from create_server and fix two handle leaks. - TODO update. - Remove cruft left over from previous RPC backend implementation in the apartment structure. - Don't pass an IPID by value for proxy_manager_create_ifproxy. - Disable more of RPC_UnregisterInterface to prevent the RPC runtime using freed memory. - Rename various external RPC backend functions so that they all have the same "RPC_" prefix. - Reduce the timeout of the function that connects to a local server to 30s, like native. - Make each ifproxy have its own channel buffer to fix a bug where a proxy with multiple interfaces could invoke the wrong stub buffer on the server. - The Global Interface Table should do table-strong marshaling instead of normal marshaling so that an interface can be retrieved more than one time. Mike Hearn <mh@codeweavers.com> - Avoid infinite loop when doing a typelib marshalled IUnknown::QueryInterface by only doing an extra QI if requested IID is not equal to marshalled IID. Rob Shearman <rob@codeweavers.com> Mike Hearn <mh@codeweavers.com> - Add re-entrancy tests to the test suite. - Run RPCs on a new thread client side so we can pump the message loop. Juan Lang <juan_lang@yahoo.com> - Fix the calling convention of DllCanUnloadNow. - Move vtbl to end of file and get rid of unnecessary prototypes. - Implement StgCreatePropSetStg. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Paul Vriens <Paul.Vriens@xs4all.nl> - Added some TRACE statements. svn path=/trunk/; revision=14083
2005-03-14 23:17:44 +00:00
}
/************************************************************************
* IPropertyStorage_fnWritePropertyNames (IPropertyStorage)
*/
static HRESULT WINAPI IPropertyStorage_fnWritePropertyNames(
IPropertyStorage* iface,
ULONG cpropid,
const PROPID rgpropid[],
const LPOLESTR rglpwstrName[])
{
PropertyStorage_impl *This = impl_from_IPropertyStorage(iface);
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
ULONG i;
HRESULT hr;
TRACE("(%p, %d, %p, %p)\n", iface, cpropid, rgpropid, rglpwstrName);
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
if (cpropid && (!rgpropid || !rglpwstrName))
return E_INVALIDARG;
if (!(This->grfMode & STGM_READWRITE))
return STG_E_ACCESSDENIED;
hr = S_OK;
EnterCriticalSection(&This->cs);
This->dirty = TRUE;
Sync to Wine-20050524: Alexandre Julliard <julliard@winehq.org> - Added rules for building import libraries in the individual dll makefiles, and added support for building a .def.a static import library too. - Removed unnecessary code in the 16-bit DllEntryPoint function of some dlls, and also fixed its ordinal in a few places. - Comment out stub WEP entry points so that we can call WEP for builtin dlls too. Juan Lang <juan_lang@yahoo.com> - Obvious fixes to PropVariantClear and PropVariantCopy for vector types. - Add a comment, and a no-op cleanup. - Differentiate between version 0 and version 1 property storages. - Store property names in the code page of the property set. - maintain proper byte order - maintain PROPSETFLAG_ANSI flag based on codepage - update comments - Correct/improve error checking in IPropertyStorage. - convert strings between property storage's code page and system code page - add tests for setting code page - fix tests and behavior to match WinXP - Define and use endian conversion macros for big-endian machines. Marcus Meissner <marcus@jet.franken.de> - Move the Dll init function to compobj.c to avoid having global variables. Remove need of ole32_main.h. - Make HGLOBALStream_* functions static. - Make _xmalloc16() static. - Staticify FTMarshalImpl definition. Francois Gouget <fgouget@free.fr> - Specify the proper call convention in the PropSysFreeString() implementation. - Tweak the API documentation to silence winapi_check warnings. Robert Shearman <rob@codeweavers.com> - Add error messages on failure in file moniker load function. - Fix incorrect pointer check in both monikers. - Fix max size calculation of item moniker to match native. - Add a generic moniker marshaler that works by saving & loading monikers to & from the stream. - Use the generic moniker marshal in the file & item monikers and add a class factory for each. - Implement IROTData::GetComparisonData for file & item monikers. - Add a useful trace message. - Fix more places where custom header size was calculated exclusive of the data size member. - Optimize custom marshaling by getting size before calling the custom marshaler so we can write the header before and not use a second stream. - Change remaining blocks of code with 2-space indentation to 4-space indentation. - Make vtables const. - Remove an unnecessary memcpy and let the compiler do the work. - Write custom header up to and including size, not excluding. - Add a stub implementation of CoIsHandlerConnected. - Marshal objects & monikers into the ROT. - Test for this behaviour. Mike McCormack <mike@codeweavers.com> - Remove unnecessary declarations and make functions static. - Remove forward declarations. - Make sure a stream can't be created in read only storage. - Fix a memory leak in the ole storage implementation. - Remove function prototypes. Kevin Koltzau <kevin@plop.org> - Implement Hash function on composite moniker. Jeff Latimer <jeffl@defcen.gov.au> - Implement the IEnumMoniker interface for the ROT and provide tests to exercise the interface. Pierre d'Herbemont <stegefin@free.fr> - Big Endian specific code fixes in order to conform with NONAMELESSSTRUCT. Matthew Mastracci <matt@aclaro.com> - Replace stub entry for StgOpenStorageEx with call to StgOpenStorage. - Replace StgCreateStorageEx stub with call to StgCreateDocfile and add required STGFMT_* enumerations. svn path=/trunk/; revision=15562
2005-05-28 09:30:04 +00:00
for (i = 0; SUCCEEDED(hr) && i < cpropid; i++)
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
{
if (rgpropid[i] != PID_ILLEGAL)
Sync to Wine-20050524: Alexandre Julliard <julliard@winehq.org> - Added rules for building import libraries in the individual dll makefiles, and added support for building a .def.a static import library too. - Removed unnecessary code in the 16-bit DllEntryPoint function of some dlls, and also fixed its ordinal in a few places. - Comment out stub WEP entry points so that we can call WEP for builtin dlls too. Juan Lang <juan_lang@yahoo.com> - Obvious fixes to PropVariantClear and PropVariantCopy for vector types. - Add a comment, and a no-op cleanup. - Differentiate between version 0 and version 1 property storages. - Store property names in the code page of the property set. - maintain proper byte order - maintain PROPSETFLAG_ANSI flag based on codepage - update comments - Correct/improve error checking in IPropertyStorage. - convert strings between property storage's code page and system code page - add tests for setting code page - fix tests and behavior to match WinXP - Define and use endian conversion macros for big-endian machines. Marcus Meissner <marcus@jet.franken.de> - Move the Dll init function to compobj.c to avoid having global variables. Remove need of ole32_main.h. - Make HGLOBALStream_* functions static. - Make _xmalloc16() static. - Staticify FTMarshalImpl definition. Francois Gouget <fgouget@free.fr> - Specify the proper call convention in the PropSysFreeString() implementation. - Tweak the API documentation to silence winapi_check warnings. Robert Shearman <rob@codeweavers.com> - Add error messages on failure in file moniker load function. - Fix incorrect pointer check in both monikers. - Fix max size calculation of item moniker to match native. - Add a generic moniker marshaler that works by saving & loading monikers to & from the stream. - Use the generic moniker marshal in the file & item monikers and add a class factory for each. - Implement IROTData::GetComparisonData for file & item monikers. - Add a useful trace message. - Fix more places where custom header size was calculated exclusive of the data size member. - Optimize custom marshaling by getting size before calling the custom marshaler so we can write the header before and not use a second stream. - Change remaining blocks of code with 2-space indentation to 4-space indentation. - Make vtables const. - Remove an unnecessary memcpy and let the compiler do the work. - Write custom header up to and including size, not excluding. - Add a stub implementation of CoIsHandlerConnected. - Marshal objects & monikers into the ROT. - Test for this behaviour. Mike McCormack <mike@codeweavers.com> - Remove unnecessary declarations and make functions static. - Remove forward declarations. - Make sure a stream can't be created in read only storage. - Fix a memory leak in the ole storage implementation. - Remove function prototypes. Kevin Koltzau <kevin@plop.org> - Implement Hash function on composite moniker. Jeff Latimer <jeffl@defcen.gov.au> - Implement the IEnumMoniker interface for the ROT and provide tests to exercise the interface. Pierre d'Herbemont <stegefin@free.fr> - Big Endian specific code fixes in order to conform with NONAMELESSSTRUCT. Matthew Mastracci <matt@aclaro.com> - Replace stub entry for StgOpenStorageEx with call to StgOpenStorage. - Replace StgCreateStorageEx stub with call to StgCreateDocfile and add required STGFMT_* enumerations. svn path=/trunk/; revision=15562
2005-05-28 09:30:04 +00:00
hr = PropertyStorage_StoreNameWithId(This, (LPCSTR)rglpwstrName[i],
CP_UNICODE, rgpropid[i]);
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
}
if (This->grfFlags & PROPSETFLAG_UNBUFFERED)
IPropertyStorage_Commit(iface, STGC_DEFAULT);
LeaveCriticalSection(&This->cs);
return hr;
Sync to Wine-20050310: Jon Griffiths <jon_p_griffiths@yahoo.com> - Documentation spelling fixes. Mike McCormack <mike@codeweavers.com> - Implement and test IPropertySetStorage. - Fix more incorrect uses of STGM_ enumerations. - Add struct StorageBaseImpl at the start of derived structures instead of trying to keep the first members the same. - StgOpenStorage shouldn't open zero length storage files. - Shared reading of storage files requires STGM_TRANSACTED. - Test and fix grfMode handling in StgOpenDocfile. - Implement StgSetTimes. Robert Shearman <rob@codeweavers.com> - Better tracing. - Small cleanup of creation functions. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. - Move marshaling state machine into stub manager from ifstub. - Add additional needed states for table-weak marshaling, as shown by tests. - Protect external reference count from underflows/overflows. - Make COM use the RPC runtime as the backend for RPC calls. Based on a patch by Ove Ksven. - Invoke objects in STA's in the correct thread by sending messages to the hidden apartment window. - Use I_RpcGetBuffer, instead of our own buffer routines to fix an occasional test crash caused by heap corruption. - Zero the memory block passed to RpcServerRegisterIfEx so we don't pass garbage in some of the fields we don't fill in. - Return the correct error code from create_server and fix two handle leaks. - TODO update. - Remove cruft left over from previous RPC backend implementation in the apartment structure. - Don't pass an IPID by value for proxy_manager_create_ifproxy. - Disable more of RPC_UnregisterInterface to prevent the RPC runtime using freed memory. - Rename various external RPC backend functions so that they all have the same "RPC_" prefix. - Reduce the timeout of the function that connects to a local server to 30s, like native. - Make each ifproxy have its own channel buffer to fix a bug where a proxy with multiple interfaces could invoke the wrong stub buffer on the server. - The Global Interface Table should do table-strong marshaling instead of normal marshaling so that an interface can be retrieved more than one time. Mike Hearn <mh@codeweavers.com> - Avoid infinite loop when doing a typelib marshalled IUnknown::QueryInterface by only doing an extra QI if requested IID is not equal to marshalled IID. Rob Shearman <rob@codeweavers.com> Mike Hearn <mh@codeweavers.com> - Add re-entrancy tests to the test suite. - Run RPCs on a new thread client side so we can pump the message loop. Juan Lang <juan_lang@yahoo.com> - Fix the calling convention of DllCanUnloadNow. - Move vtbl to end of file and get rid of unnecessary prototypes. - Implement StgCreatePropSetStg. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Paul Vriens <Paul.Vriens@xs4all.nl> - Added some TRACE statements. svn path=/trunk/; revision=14083
2005-03-14 23:17:44 +00:00
}
/************************************************************************
* IPropertyStorage_fnDeletePropertyNames (IPropertyStorage)
*/
static HRESULT WINAPI IPropertyStorage_fnDeletePropertyNames(
IPropertyStorage* iface,
ULONG cpropid,
const PROPID rgpropid[])
{
PropertyStorage_impl *This = impl_from_IPropertyStorage(iface);
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
ULONG i;
HRESULT hr;
TRACE("(%p, %d, %p)\n", iface, cpropid, rgpropid);
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
if (cpropid && !rgpropid)
return E_INVALIDARG;
if (!(This->grfMode & STGM_READWRITE))
return STG_E_ACCESSDENIED;
hr = S_OK;
EnterCriticalSection(&This->cs);
This->dirty = TRUE;
for (i = 0; i < cpropid; i++)
{
LPWSTR name = NULL;
if (dictionary_find(This->propid_to_name, UlongToPtr(rgpropid[i]), (void **)&name))
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
{
dictionary_remove(This->propid_to_name, UlongToPtr(rgpropid[i]));
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
dictionary_remove(This->name_to_propid, name);
}
}
if (This->grfFlags & PROPSETFLAG_UNBUFFERED)
IPropertyStorage_Commit(iface, STGC_DEFAULT);
LeaveCriticalSection(&This->cs);
return hr;
Sync to Wine-20050310: Jon Griffiths <jon_p_griffiths@yahoo.com> - Documentation spelling fixes. Mike McCormack <mike@codeweavers.com> - Implement and test IPropertySetStorage. - Fix more incorrect uses of STGM_ enumerations. - Add struct StorageBaseImpl at the start of derived structures instead of trying to keep the first members the same. - StgOpenStorage shouldn't open zero length storage files. - Shared reading of storage files requires STGM_TRANSACTED. - Test and fix grfMode handling in StgOpenDocfile. - Implement StgSetTimes. Robert Shearman <rob@codeweavers.com> - Better tracing. - Small cleanup of creation functions. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. - Move marshaling state machine into stub manager from ifstub. - Add additional needed states for table-weak marshaling, as shown by tests. - Protect external reference count from underflows/overflows. - Make COM use the RPC runtime as the backend for RPC calls. Based on a patch by Ove Ksven. - Invoke objects in STA's in the correct thread by sending messages to the hidden apartment window. - Use I_RpcGetBuffer, instead of our own buffer routines to fix an occasional test crash caused by heap corruption. - Zero the memory block passed to RpcServerRegisterIfEx so we don't pass garbage in some of the fields we don't fill in. - Return the correct error code from create_server and fix two handle leaks. - TODO update. - Remove cruft left over from previous RPC backend implementation in the apartment structure. - Don't pass an IPID by value for proxy_manager_create_ifproxy. - Disable more of RPC_UnregisterInterface to prevent the RPC runtime using freed memory. - Rename various external RPC backend functions so that they all have the same "RPC_" prefix. - Reduce the timeout of the function that connects to a local server to 30s, like native. - Make each ifproxy have its own channel buffer to fix a bug where a proxy with multiple interfaces could invoke the wrong stub buffer on the server. - The Global Interface Table should do table-strong marshaling instead of normal marshaling so that an interface can be retrieved more than one time. Mike Hearn <mh@codeweavers.com> - Avoid infinite loop when doing a typelib marshalled IUnknown::QueryInterface by only doing an extra QI if requested IID is not equal to marshalled IID. Rob Shearman <rob@codeweavers.com> Mike Hearn <mh@codeweavers.com> - Add re-entrancy tests to the test suite. - Run RPCs on a new thread client side so we can pump the message loop. Juan Lang <juan_lang@yahoo.com> - Fix the calling convention of DllCanUnloadNow. - Move vtbl to end of file and get rid of unnecessary prototypes. - Implement StgCreatePropSetStg. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Paul Vriens <Paul.Vriens@xs4all.nl> - Added some TRACE statements. svn path=/trunk/; revision=14083
2005-03-14 23:17:44 +00:00
}
/************************************************************************
* IPropertyStorage_fnCommit (IPropertyStorage)
*/
static HRESULT WINAPI IPropertyStorage_fnCommit(
IPropertyStorage* iface,
DWORD grfCommitFlags)
{
PropertyStorage_impl *This = impl_from_IPropertyStorage(iface);
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
HRESULT hr;
TRACE("(%p, 0x%08x)\n", iface, grfCommitFlags);
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
if (!(This->grfMode & STGM_READWRITE))
return STG_E_ACCESSDENIED;
EnterCriticalSection(&This->cs);
if (This->dirty)
hr = PropertyStorage_WriteToStream(This);
else
hr = S_OK;
LeaveCriticalSection(&This->cs);
return hr;
Sync to Wine-20050310: Jon Griffiths <jon_p_griffiths@yahoo.com> - Documentation spelling fixes. Mike McCormack <mike@codeweavers.com> - Implement and test IPropertySetStorage. - Fix more incorrect uses of STGM_ enumerations. - Add struct StorageBaseImpl at the start of derived structures instead of trying to keep the first members the same. - StgOpenStorage shouldn't open zero length storage files. - Shared reading of storage files requires STGM_TRANSACTED. - Test and fix grfMode handling in StgOpenDocfile. - Implement StgSetTimes. Robert Shearman <rob@codeweavers.com> - Better tracing. - Small cleanup of creation functions. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. - Move marshaling state machine into stub manager from ifstub. - Add additional needed states for table-weak marshaling, as shown by tests. - Protect external reference count from underflows/overflows. - Make COM use the RPC runtime as the backend for RPC calls. Based on a patch by Ove Ksven. - Invoke objects in STA's in the correct thread by sending messages to the hidden apartment window. - Use I_RpcGetBuffer, instead of our own buffer routines to fix an occasional test crash caused by heap corruption. - Zero the memory block passed to RpcServerRegisterIfEx so we don't pass garbage in some of the fields we don't fill in. - Return the correct error code from create_server and fix two handle leaks. - TODO update. - Remove cruft left over from previous RPC backend implementation in the apartment structure. - Don't pass an IPID by value for proxy_manager_create_ifproxy. - Disable more of RPC_UnregisterInterface to prevent the RPC runtime using freed memory. - Rename various external RPC backend functions so that they all have the same "RPC_" prefix. - Reduce the timeout of the function that connects to a local server to 30s, like native. - Make each ifproxy have its own channel buffer to fix a bug where a proxy with multiple interfaces could invoke the wrong stub buffer on the server. - The Global Interface Table should do table-strong marshaling instead of normal marshaling so that an interface can be retrieved more than one time. Mike Hearn <mh@codeweavers.com> - Avoid infinite loop when doing a typelib marshalled IUnknown::QueryInterface by only doing an extra QI if requested IID is not equal to marshalled IID. Rob Shearman <rob@codeweavers.com> Mike Hearn <mh@codeweavers.com> - Add re-entrancy tests to the test suite. - Run RPCs on a new thread client side so we can pump the message loop. Juan Lang <juan_lang@yahoo.com> - Fix the calling convention of DllCanUnloadNow. - Move vtbl to end of file and get rid of unnecessary prototypes. - Implement StgCreatePropSetStg. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Paul Vriens <Paul.Vriens@xs4all.nl> - Added some TRACE statements. svn path=/trunk/; revision=14083
2005-03-14 23:17:44 +00:00
}
/************************************************************************
* IPropertyStorage_fnRevert (IPropertyStorage)
*/
static HRESULT WINAPI IPropertyStorage_fnRevert(
IPropertyStorage* iface)
{
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
HRESULT hr;
PropertyStorage_impl *This = impl_from_IPropertyStorage(iface);
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
TRACE("%p\n", iface);
EnterCriticalSection(&This->cs);
if (This->dirty)
{
PropertyStorage_DestroyDictionaries(This);
hr = PropertyStorage_CreateDictionaries(This);
if (SUCCEEDED(hr))
hr = PropertyStorage_ReadFromStream(This);
}
else
hr = S_OK;
LeaveCriticalSection(&This->cs);
return hr;
Sync to Wine-20050310: Jon Griffiths <jon_p_griffiths@yahoo.com> - Documentation spelling fixes. Mike McCormack <mike@codeweavers.com> - Implement and test IPropertySetStorage. - Fix more incorrect uses of STGM_ enumerations. - Add struct StorageBaseImpl at the start of derived structures instead of trying to keep the first members the same. - StgOpenStorage shouldn't open zero length storage files. - Shared reading of storage files requires STGM_TRANSACTED. - Test and fix grfMode handling in StgOpenDocfile. - Implement StgSetTimes. Robert Shearman <rob@codeweavers.com> - Better tracing. - Small cleanup of creation functions. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. - Move marshaling state machine into stub manager from ifstub. - Add additional needed states for table-weak marshaling, as shown by tests. - Protect external reference count from underflows/overflows. - Make COM use the RPC runtime as the backend for RPC calls. Based on a patch by Ove Ksven. - Invoke objects in STA's in the correct thread by sending messages to the hidden apartment window. - Use I_RpcGetBuffer, instead of our own buffer routines to fix an occasional test crash caused by heap corruption. - Zero the memory block passed to RpcServerRegisterIfEx so we don't pass garbage in some of the fields we don't fill in. - Return the correct error code from create_server and fix two handle leaks. - TODO update. - Remove cruft left over from previous RPC backend implementation in the apartment structure. - Don't pass an IPID by value for proxy_manager_create_ifproxy. - Disable more of RPC_UnregisterInterface to prevent the RPC runtime using freed memory. - Rename various external RPC backend functions so that they all have the same "RPC_" prefix. - Reduce the timeout of the function that connects to a local server to 30s, like native. - Make each ifproxy have its own channel buffer to fix a bug where a proxy with multiple interfaces could invoke the wrong stub buffer on the server. - The Global Interface Table should do table-strong marshaling instead of normal marshaling so that an interface can be retrieved more than one time. Mike Hearn <mh@codeweavers.com> - Avoid infinite loop when doing a typelib marshalled IUnknown::QueryInterface by only doing an extra QI if requested IID is not equal to marshalled IID. Rob Shearman <rob@codeweavers.com> Mike Hearn <mh@codeweavers.com> - Add re-entrancy tests to the test suite. - Run RPCs on a new thread client side so we can pump the message loop. Juan Lang <juan_lang@yahoo.com> - Fix the calling convention of DllCanUnloadNow. - Move vtbl to end of file and get rid of unnecessary prototypes. - Implement StgCreatePropSetStg. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Paul Vriens <Paul.Vriens@xs4all.nl> - Added some TRACE statements. svn path=/trunk/; revision=14083
2005-03-14 23:17:44 +00:00
}
/************************************************************************
* IPropertyStorage_fnEnum (IPropertyStorage)
*/
static HRESULT WINAPI IPropertyStorage_fnEnum(
IPropertyStorage* iface,
IEnumSTATPROPSTG** ppenum)
{
PropertyStorage_impl *This = impl_from_IPropertyStorage(iface);
return create_EnumSTATPROPSTG(This, ppenum);
Sync to Wine-20050310: Jon Griffiths <jon_p_griffiths@yahoo.com> - Documentation spelling fixes. Mike McCormack <mike@codeweavers.com> - Implement and test IPropertySetStorage. - Fix more incorrect uses of STGM_ enumerations. - Add struct StorageBaseImpl at the start of derived structures instead of trying to keep the first members the same. - StgOpenStorage shouldn't open zero length storage files. - Shared reading of storage files requires STGM_TRANSACTED. - Test and fix grfMode handling in StgOpenDocfile. - Implement StgSetTimes. Robert Shearman <rob@codeweavers.com> - Better tracing. - Small cleanup of creation functions. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. - Move marshaling state machine into stub manager from ifstub. - Add additional needed states for table-weak marshaling, as shown by tests. - Protect external reference count from underflows/overflows. - Make COM use the RPC runtime as the backend for RPC calls. Based on a patch by Ove Ksven. - Invoke objects in STA's in the correct thread by sending messages to the hidden apartment window. - Use I_RpcGetBuffer, instead of our own buffer routines to fix an occasional test crash caused by heap corruption. - Zero the memory block passed to RpcServerRegisterIfEx so we don't pass garbage in some of the fields we don't fill in. - Return the correct error code from create_server and fix two handle leaks. - TODO update. - Remove cruft left over from previous RPC backend implementation in the apartment structure. - Don't pass an IPID by value for proxy_manager_create_ifproxy. - Disable more of RPC_UnregisterInterface to prevent the RPC runtime using freed memory. - Rename various external RPC backend functions so that they all have the same "RPC_" prefix. - Reduce the timeout of the function that connects to a local server to 30s, like native. - Make each ifproxy have its own channel buffer to fix a bug where a proxy with multiple interfaces could invoke the wrong stub buffer on the server. - The Global Interface Table should do table-strong marshaling instead of normal marshaling so that an interface can be retrieved more than one time. Mike Hearn <mh@codeweavers.com> - Avoid infinite loop when doing a typelib marshalled IUnknown::QueryInterface by only doing an extra QI if requested IID is not equal to marshalled IID. Rob Shearman <rob@codeweavers.com> Mike Hearn <mh@codeweavers.com> - Add re-entrancy tests to the test suite. - Run RPCs on a new thread client side so we can pump the message loop. Juan Lang <juan_lang@yahoo.com> - Fix the calling convention of DllCanUnloadNow. - Move vtbl to end of file and get rid of unnecessary prototypes. - Implement StgCreatePropSetStg. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Paul Vriens <Paul.Vriens@xs4all.nl> - Added some TRACE statements. svn path=/trunk/; revision=14083
2005-03-14 23:17:44 +00:00
}
/************************************************************************
* IPropertyStorage_fnSetTimes (IPropertyStorage)
*/
static HRESULT WINAPI IPropertyStorage_fnSetTimes(
IPropertyStorage* iface,
const FILETIME* pctime,
const FILETIME* patime,
const FILETIME* pmtime)
{
FIXME("\n");
return E_NOTIMPL;
}
/************************************************************************
* IPropertyStorage_fnSetClass (IPropertyStorage)
*/
static HRESULT WINAPI IPropertyStorage_fnSetClass(
IPropertyStorage* iface,
REFCLSID clsid)
{
PropertyStorage_impl *This = impl_from_IPropertyStorage(iface);
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
TRACE("%p, %s\n", iface, debugstr_guid(clsid));
if (!clsid)
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
return E_INVALIDARG;
if (!(This->grfMode & STGM_READWRITE))
return STG_E_ACCESSDENIED;
This->clsid = *clsid;
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
This->dirty = TRUE;
if (This->grfFlags & PROPSETFLAG_UNBUFFERED)
IPropertyStorage_Commit(iface, STGC_DEFAULT);
return S_OK;
Sync to Wine-20050310: Jon Griffiths <jon_p_griffiths@yahoo.com> - Documentation spelling fixes. Mike McCormack <mike@codeweavers.com> - Implement and test IPropertySetStorage. - Fix more incorrect uses of STGM_ enumerations. - Add struct StorageBaseImpl at the start of derived structures instead of trying to keep the first members the same. - StgOpenStorage shouldn't open zero length storage files. - Shared reading of storage files requires STGM_TRANSACTED. - Test and fix grfMode handling in StgOpenDocfile. - Implement StgSetTimes. Robert Shearman <rob@codeweavers.com> - Better tracing. - Small cleanup of creation functions. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. - Move marshaling state machine into stub manager from ifstub. - Add additional needed states for table-weak marshaling, as shown by tests. - Protect external reference count from underflows/overflows. - Make COM use the RPC runtime as the backend for RPC calls. Based on a patch by Ove Ksven. - Invoke objects in STA's in the correct thread by sending messages to the hidden apartment window. - Use I_RpcGetBuffer, instead of our own buffer routines to fix an occasional test crash caused by heap corruption. - Zero the memory block passed to RpcServerRegisterIfEx so we don't pass garbage in some of the fields we don't fill in. - Return the correct error code from create_server and fix two handle leaks. - TODO update. - Remove cruft left over from previous RPC backend implementation in the apartment structure. - Don't pass an IPID by value for proxy_manager_create_ifproxy. - Disable more of RPC_UnregisterInterface to prevent the RPC runtime using freed memory. - Rename various external RPC backend functions so that they all have the same "RPC_" prefix. - Reduce the timeout of the function that connects to a local server to 30s, like native. - Make each ifproxy have its own channel buffer to fix a bug where a proxy with multiple interfaces could invoke the wrong stub buffer on the server. - The Global Interface Table should do table-strong marshaling instead of normal marshaling so that an interface can be retrieved more than one time. Mike Hearn <mh@codeweavers.com> - Avoid infinite loop when doing a typelib marshalled IUnknown::QueryInterface by only doing an extra QI if requested IID is not equal to marshalled IID. Rob Shearman <rob@codeweavers.com> Mike Hearn <mh@codeweavers.com> - Add re-entrancy tests to the test suite. - Run RPCs on a new thread client side so we can pump the message loop. Juan Lang <juan_lang@yahoo.com> - Fix the calling convention of DllCanUnloadNow. - Move vtbl to end of file and get rid of unnecessary prototypes. - Implement StgCreatePropSetStg. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Paul Vriens <Paul.Vriens@xs4all.nl> - Added some TRACE statements. svn path=/trunk/; revision=14083
2005-03-14 23:17:44 +00:00
}
/************************************************************************
* IPropertyStorage_fnStat (IPropertyStorage)
*/
static HRESULT WINAPI IPropertyStorage_fnStat(
IPropertyStorage* iface,
STATPROPSETSTG* statpsstg)
{
PropertyStorage_impl *This = impl_from_IPropertyStorage(iface);
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
STATSTG stat;
HRESULT hr;
TRACE("%p, %p\n", iface, statpsstg);
if (!statpsstg)
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
return E_INVALIDARG;
hr = IStream_Stat(This->stm, &stat, STATFLAG_NONAME);
if (SUCCEEDED(hr))
{
statpsstg->fmtid = This->fmtid;
statpsstg->clsid = This->clsid;
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
statpsstg->grfFlags = This->grfFlags;
statpsstg->mtime = stat.mtime;
statpsstg->ctime = stat.ctime;
statpsstg->atime = stat.atime;
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
statpsstg->dwOSVersion = This->originatorOS;
}
return hr;
Sync to Wine-20050310: Jon Griffiths <jon_p_griffiths@yahoo.com> - Documentation spelling fixes. Mike McCormack <mike@codeweavers.com> - Implement and test IPropertySetStorage. - Fix more incorrect uses of STGM_ enumerations. - Add struct StorageBaseImpl at the start of derived structures instead of trying to keep the first members the same. - StgOpenStorage shouldn't open zero length storage files. - Shared reading of storage files requires STGM_TRANSACTED. - Test and fix grfMode handling in StgOpenDocfile. - Implement StgSetTimes. Robert Shearman <rob@codeweavers.com> - Better tracing. - Small cleanup of creation functions. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. - Move marshaling state machine into stub manager from ifstub. - Add additional needed states for table-weak marshaling, as shown by tests. - Protect external reference count from underflows/overflows. - Make COM use the RPC runtime as the backend for RPC calls. Based on a patch by Ove Ksven. - Invoke objects in STA's in the correct thread by sending messages to the hidden apartment window. - Use I_RpcGetBuffer, instead of our own buffer routines to fix an occasional test crash caused by heap corruption. - Zero the memory block passed to RpcServerRegisterIfEx so we don't pass garbage in some of the fields we don't fill in. - Return the correct error code from create_server and fix two handle leaks. - TODO update. - Remove cruft left over from previous RPC backend implementation in the apartment structure. - Don't pass an IPID by value for proxy_manager_create_ifproxy. - Disable more of RPC_UnregisterInterface to prevent the RPC runtime using freed memory. - Rename various external RPC backend functions so that they all have the same "RPC_" prefix. - Reduce the timeout of the function that connects to a local server to 30s, like native. - Make each ifproxy have its own channel buffer to fix a bug where a proxy with multiple interfaces could invoke the wrong stub buffer on the server. - The Global Interface Table should do table-strong marshaling instead of normal marshaling so that an interface can be retrieved more than one time. Mike Hearn <mh@codeweavers.com> - Avoid infinite loop when doing a typelib marshalled IUnknown::QueryInterface by only doing an extra QI if requested IID is not equal to marshalled IID. Rob Shearman <rob@codeweavers.com> Mike Hearn <mh@codeweavers.com> - Add re-entrancy tests to the test suite. - Run RPCs on a new thread client side so we can pump the message loop. Juan Lang <juan_lang@yahoo.com> - Fix the calling convention of DllCanUnloadNow. - Move vtbl to end of file and get rid of unnecessary prototypes. - Implement StgCreatePropSetStg. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Paul Vriens <Paul.Vriens@xs4all.nl> - Added some TRACE statements. svn path=/trunk/; revision=14083
2005-03-14 23:17:44 +00:00
}
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
static int PropertyStorage_PropNameCompare(const void *a, const void *b,
void *extra)
{
PropertyStorage_impl *This = extra;
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
Sync to Wine-20050524: Alexandre Julliard <julliard@winehq.org> - Added rules for building import libraries in the individual dll makefiles, and added support for building a .def.a static import library too. - Removed unnecessary code in the 16-bit DllEntryPoint function of some dlls, and also fixed its ordinal in a few places. - Comment out stub WEP entry points so that we can call WEP for builtin dlls too. Juan Lang <juan_lang@yahoo.com> - Obvious fixes to PropVariantClear and PropVariantCopy for vector types. - Add a comment, and a no-op cleanup. - Differentiate between version 0 and version 1 property storages. - Store property names in the code page of the property set. - maintain proper byte order - maintain PROPSETFLAG_ANSI flag based on codepage - update comments - Correct/improve error checking in IPropertyStorage. - convert strings between property storage's code page and system code page - add tests for setting code page - fix tests and behavior to match WinXP - Define and use endian conversion macros for big-endian machines. Marcus Meissner <marcus@jet.franken.de> - Move the Dll init function to compobj.c to avoid having global variables. Remove need of ole32_main.h. - Make HGLOBALStream_* functions static. - Make _xmalloc16() static. - Staticify FTMarshalImpl definition. Francois Gouget <fgouget@free.fr> - Specify the proper call convention in the PropSysFreeString() implementation. - Tweak the API documentation to silence winapi_check warnings. Robert Shearman <rob@codeweavers.com> - Add error messages on failure in file moniker load function. - Fix incorrect pointer check in both monikers. - Fix max size calculation of item moniker to match native. - Add a generic moniker marshaler that works by saving & loading monikers to & from the stream. - Use the generic moniker marshal in the file & item monikers and add a class factory for each. - Implement IROTData::GetComparisonData for file & item monikers. - Add a useful trace message. - Fix more places where custom header size was calculated exclusive of the data size member. - Optimize custom marshaling by getting size before calling the custom marshaler so we can write the header before and not use a second stream. - Change remaining blocks of code with 2-space indentation to 4-space indentation. - Make vtables const. - Remove an unnecessary memcpy and let the compiler do the work. - Write custom header up to and including size, not excluding. - Add a stub implementation of CoIsHandlerConnected. - Marshal objects & monikers into the ROT. - Test for this behaviour. Mike McCormack <mike@codeweavers.com> - Remove unnecessary declarations and make functions static. - Remove forward declarations. - Make sure a stream can't be created in read only storage. - Fix a memory leak in the ole storage implementation. - Remove function prototypes. Kevin Koltzau <kevin@plop.org> - Implement Hash function on composite moniker. Jeff Latimer <jeffl@defcen.gov.au> - Implement the IEnumMoniker interface for the ROT and provide tests to exercise the interface. Pierre d'Herbemont <stegefin@free.fr> - Big Endian specific code fixes in order to conform with NONAMELESSSTRUCT. Matthew Mastracci <matt@aclaro.com> - Replace stub entry for StgOpenStorageEx with call to StgOpenStorage. - Replace StgCreateStorageEx stub with call to StgCreateDocfile and add required STGFMT_* enumerations. svn path=/trunk/; revision=15562
2005-05-28 09:30:04 +00:00
if (This->codePage == CP_UNICODE)
{
TRACE("(%s, %s)\n", debugstr_w(a), debugstr_w(b));
if (This->grfFlags & PROPSETFLAG_CASE_SENSITIVE)
return lstrcmpW(a, b);
Sync to Wine-20050524: Alexandre Julliard <julliard@winehq.org> - Added rules for building import libraries in the individual dll makefiles, and added support for building a .def.a static import library too. - Removed unnecessary code in the 16-bit DllEntryPoint function of some dlls, and also fixed its ordinal in a few places. - Comment out stub WEP entry points so that we can call WEP for builtin dlls too. Juan Lang <juan_lang@yahoo.com> - Obvious fixes to PropVariantClear and PropVariantCopy for vector types. - Add a comment, and a no-op cleanup. - Differentiate between version 0 and version 1 property storages. - Store property names in the code page of the property set. - maintain proper byte order - maintain PROPSETFLAG_ANSI flag based on codepage - update comments - Correct/improve error checking in IPropertyStorage. - convert strings between property storage's code page and system code page - add tests for setting code page - fix tests and behavior to match WinXP - Define and use endian conversion macros for big-endian machines. Marcus Meissner <marcus@jet.franken.de> - Move the Dll init function to compobj.c to avoid having global variables. Remove need of ole32_main.h. - Make HGLOBALStream_* functions static. - Make _xmalloc16() static. - Staticify FTMarshalImpl definition. Francois Gouget <fgouget@free.fr> - Specify the proper call convention in the PropSysFreeString() implementation. - Tweak the API documentation to silence winapi_check warnings. Robert Shearman <rob@codeweavers.com> - Add error messages on failure in file moniker load function. - Fix incorrect pointer check in both monikers. - Fix max size calculation of item moniker to match native. - Add a generic moniker marshaler that works by saving & loading monikers to & from the stream. - Use the generic moniker marshal in the file & item monikers and add a class factory for each. - Implement IROTData::GetComparisonData for file & item monikers. - Add a useful trace message. - Fix more places where custom header size was calculated exclusive of the data size member. - Optimize custom marshaling by getting size before calling the custom marshaler so we can write the header before and not use a second stream. - Change remaining blocks of code with 2-space indentation to 4-space indentation. - Make vtables const. - Remove an unnecessary memcpy and let the compiler do the work. - Write custom header up to and including size, not excluding. - Add a stub implementation of CoIsHandlerConnected. - Marshal objects & monikers into the ROT. - Test for this behaviour. Mike McCormack <mike@codeweavers.com> - Remove unnecessary declarations and make functions static. - Remove forward declarations. - Make sure a stream can't be created in read only storage. - Fix a memory leak in the ole storage implementation. - Remove function prototypes. Kevin Koltzau <kevin@plop.org> - Implement Hash function on composite moniker. Jeff Latimer <jeffl@defcen.gov.au> - Implement the IEnumMoniker interface for the ROT and provide tests to exercise the interface. Pierre d'Herbemont <stegefin@free.fr> - Big Endian specific code fixes in order to conform with NONAMELESSSTRUCT. Matthew Mastracci <matt@aclaro.com> - Replace stub entry for StgOpenStorageEx with call to StgOpenStorage. - Replace StgCreateStorageEx stub with call to StgCreateDocfile and add required STGFMT_* enumerations. svn path=/trunk/; revision=15562
2005-05-28 09:30:04 +00:00
else
return lstrcmpiW(a, b);
Sync to Wine-20050524: Alexandre Julliard <julliard@winehq.org> - Added rules for building import libraries in the individual dll makefiles, and added support for building a .def.a static import library too. - Removed unnecessary code in the 16-bit DllEntryPoint function of some dlls, and also fixed its ordinal in a few places. - Comment out stub WEP entry points so that we can call WEP for builtin dlls too. Juan Lang <juan_lang@yahoo.com> - Obvious fixes to PropVariantClear and PropVariantCopy for vector types. - Add a comment, and a no-op cleanup. - Differentiate between version 0 and version 1 property storages. - Store property names in the code page of the property set. - maintain proper byte order - maintain PROPSETFLAG_ANSI flag based on codepage - update comments - Correct/improve error checking in IPropertyStorage. - convert strings between property storage's code page and system code page - add tests for setting code page - fix tests and behavior to match WinXP - Define and use endian conversion macros for big-endian machines. Marcus Meissner <marcus@jet.franken.de> - Move the Dll init function to compobj.c to avoid having global variables. Remove need of ole32_main.h. - Make HGLOBALStream_* functions static. - Make _xmalloc16() static. - Staticify FTMarshalImpl definition. Francois Gouget <fgouget@free.fr> - Specify the proper call convention in the PropSysFreeString() implementation. - Tweak the API documentation to silence winapi_check warnings. Robert Shearman <rob@codeweavers.com> - Add error messages on failure in file moniker load function. - Fix incorrect pointer check in both monikers. - Fix max size calculation of item moniker to match native. - Add a generic moniker marshaler that works by saving & loading monikers to & from the stream. - Use the generic moniker marshal in the file & item monikers and add a class factory for each. - Implement IROTData::GetComparisonData for file & item monikers. - Add a useful trace message. - Fix more places where custom header size was calculated exclusive of the data size member. - Optimize custom marshaling by getting size before calling the custom marshaler so we can write the header before and not use a second stream. - Change remaining blocks of code with 2-space indentation to 4-space indentation. - Make vtables const. - Remove an unnecessary memcpy and let the compiler do the work. - Write custom header up to and including size, not excluding. - Add a stub implementation of CoIsHandlerConnected. - Marshal objects & monikers into the ROT. - Test for this behaviour. Mike McCormack <mike@codeweavers.com> - Remove unnecessary declarations and make functions static. - Remove forward declarations. - Make sure a stream can't be created in read only storage. - Fix a memory leak in the ole storage implementation. - Remove function prototypes. Kevin Koltzau <kevin@plop.org> - Implement Hash function on composite moniker. Jeff Latimer <jeffl@defcen.gov.au> - Implement the IEnumMoniker interface for the ROT and provide tests to exercise the interface. Pierre d'Herbemont <stegefin@free.fr> - Big Endian specific code fixes in order to conform with NONAMELESSSTRUCT. Matthew Mastracci <matt@aclaro.com> - Replace stub entry for StgOpenStorageEx with call to StgOpenStorage. - Replace StgCreateStorageEx stub with call to StgCreateDocfile and add required STGFMT_* enumerations. svn path=/trunk/; revision=15562
2005-05-28 09:30:04 +00:00
}
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
else
Sync to Wine-20050524: Alexandre Julliard <julliard@winehq.org> - Added rules for building import libraries in the individual dll makefiles, and added support for building a .def.a static import library too. - Removed unnecessary code in the 16-bit DllEntryPoint function of some dlls, and also fixed its ordinal in a few places. - Comment out stub WEP entry points so that we can call WEP for builtin dlls too. Juan Lang <juan_lang@yahoo.com> - Obvious fixes to PropVariantClear and PropVariantCopy for vector types. - Add a comment, and a no-op cleanup. - Differentiate between version 0 and version 1 property storages. - Store property names in the code page of the property set. - maintain proper byte order - maintain PROPSETFLAG_ANSI flag based on codepage - update comments - Correct/improve error checking in IPropertyStorage. - convert strings between property storage's code page and system code page - add tests for setting code page - fix tests and behavior to match WinXP - Define and use endian conversion macros for big-endian machines. Marcus Meissner <marcus@jet.franken.de> - Move the Dll init function to compobj.c to avoid having global variables. Remove need of ole32_main.h. - Make HGLOBALStream_* functions static. - Make _xmalloc16() static. - Staticify FTMarshalImpl definition. Francois Gouget <fgouget@free.fr> - Specify the proper call convention in the PropSysFreeString() implementation. - Tweak the API documentation to silence winapi_check warnings. Robert Shearman <rob@codeweavers.com> - Add error messages on failure in file moniker load function. - Fix incorrect pointer check in both monikers. - Fix max size calculation of item moniker to match native. - Add a generic moniker marshaler that works by saving & loading monikers to & from the stream. - Use the generic moniker marshal in the file & item monikers and add a class factory for each. - Implement IROTData::GetComparisonData for file & item monikers. - Add a useful trace message. - Fix more places where custom header size was calculated exclusive of the data size member. - Optimize custom marshaling by getting size before calling the custom marshaler so we can write the header before and not use a second stream. - Change remaining blocks of code with 2-space indentation to 4-space indentation. - Make vtables const. - Remove an unnecessary memcpy and let the compiler do the work. - Write custom header up to and including size, not excluding. - Add a stub implementation of CoIsHandlerConnected. - Marshal objects & monikers into the ROT. - Test for this behaviour. Mike McCormack <mike@codeweavers.com> - Remove unnecessary declarations and make functions static. - Remove forward declarations. - Make sure a stream can't be created in read only storage. - Fix a memory leak in the ole storage implementation. - Remove function prototypes. Kevin Koltzau <kevin@plop.org> - Implement Hash function on composite moniker. Jeff Latimer <jeffl@defcen.gov.au> - Implement the IEnumMoniker interface for the ROT and provide tests to exercise the interface. Pierre d'Herbemont <stegefin@free.fr> - Big Endian specific code fixes in order to conform with NONAMELESSSTRUCT. Matthew Mastracci <matt@aclaro.com> - Replace stub entry for StgOpenStorageEx with call to StgOpenStorage. - Replace StgCreateStorageEx stub with call to StgCreateDocfile and add required STGFMT_* enumerations. svn path=/trunk/; revision=15562
2005-05-28 09:30:04 +00:00
{
TRACE("(%s, %s)\n", debugstr_a(a), debugstr_a(b));
if (This->grfFlags & PROPSETFLAG_CASE_SENSITIVE)
return lstrcmpA(a, b);
Sync to Wine-20050524: Alexandre Julliard <julliard@winehq.org> - Added rules for building import libraries in the individual dll makefiles, and added support for building a .def.a static import library too. - Removed unnecessary code in the 16-bit DllEntryPoint function of some dlls, and also fixed its ordinal in a few places. - Comment out stub WEP entry points so that we can call WEP for builtin dlls too. Juan Lang <juan_lang@yahoo.com> - Obvious fixes to PropVariantClear and PropVariantCopy for vector types. - Add a comment, and a no-op cleanup. - Differentiate between version 0 and version 1 property storages. - Store property names in the code page of the property set. - maintain proper byte order - maintain PROPSETFLAG_ANSI flag based on codepage - update comments - Correct/improve error checking in IPropertyStorage. - convert strings between property storage's code page and system code page - add tests for setting code page - fix tests and behavior to match WinXP - Define and use endian conversion macros for big-endian machines. Marcus Meissner <marcus@jet.franken.de> - Move the Dll init function to compobj.c to avoid having global variables. Remove need of ole32_main.h. - Make HGLOBALStream_* functions static. - Make _xmalloc16() static. - Staticify FTMarshalImpl definition. Francois Gouget <fgouget@free.fr> - Specify the proper call convention in the PropSysFreeString() implementation. - Tweak the API documentation to silence winapi_check warnings. Robert Shearman <rob@codeweavers.com> - Add error messages on failure in file moniker load function. - Fix incorrect pointer check in both monikers. - Fix max size calculation of item moniker to match native. - Add a generic moniker marshaler that works by saving & loading monikers to & from the stream. - Use the generic moniker marshal in the file & item monikers and add a class factory for each. - Implement IROTData::GetComparisonData for file & item monikers. - Add a useful trace message. - Fix more places where custom header size was calculated exclusive of the data size member. - Optimize custom marshaling by getting size before calling the custom marshaler so we can write the header before and not use a second stream. - Change remaining blocks of code with 2-space indentation to 4-space indentation. - Make vtables const. - Remove an unnecessary memcpy and let the compiler do the work. - Write custom header up to and including size, not excluding. - Add a stub implementation of CoIsHandlerConnected. - Marshal objects & monikers into the ROT. - Test for this behaviour. Mike McCormack <mike@codeweavers.com> - Remove unnecessary declarations and make functions static. - Remove forward declarations. - Make sure a stream can't be created in read only storage. - Fix a memory leak in the ole storage implementation. - Remove function prototypes. Kevin Koltzau <kevin@plop.org> - Implement Hash function on composite moniker. Jeff Latimer <jeffl@defcen.gov.au> - Implement the IEnumMoniker interface for the ROT and provide tests to exercise the interface. Pierre d'Herbemont <stegefin@free.fr> - Big Endian specific code fixes in order to conform with NONAMELESSSTRUCT. Matthew Mastracci <matt@aclaro.com> - Replace stub entry for StgOpenStorageEx with call to StgOpenStorage. - Replace StgCreateStorageEx stub with call to StgCreateDocfile and add required STGFMT_* enumerations. svn path=/trunk/; revision=15562
2005-05-28 09:30:04 +00:00
else
return lstrcmpiA(a, b);
Sync to Wine-20050524: Alexandre Julliard <julliard@winehq.org> - Added rules for building import libraries in the individual dll makefiles, and added support for building a .def.a static import library too. - Removed unnecessary code in the 16-bit DllEntryPoint function of some dlls, and also fixed its ordinal in a few places. - Comment out stub WEP entry points so that we can call WEP for builtin dlls too. Juan Lang <juan_lang@yahoo.com> - Obvious fixes to PropVariantClear and PropVariantCopy for vector types. - Add a comment, and a no-op cleanup. - Differentiate between version 0 and version 1 property storages. - Store property names in the code page of the property set. - maintain proper byte order - maintain PROPSETFLAG_ANSI flag based on codepage - update comments - Correct/improve error checking in IPropertyStorage. - convert strings between property storage's code page and system code page - add tests for setting code page - fix tests and behavior to match WinXP - Define and use endian conversion macros for big-endian machines. Marcus Meissner <marcus@jet.franken.de> - Move the Dll init function to compobj.c to avoid having global variables. Remove need of ole32_main.h. - Make HGLOBALStream_* functions static. - Make _xmalloc16() static. - Staticify FTMarshalImpl definition. Francois Gouget <fgouget@free.fr> - Specify the proper call convention in the PropSysFreeString() implementation. - Tweak the API documentation to silence winapi_check warnings. Robert Shearman <rob@codeweavers.com> - Add error messages on failure in file moniker load function. - Fix incorrect pointer check in both monikers. - Fix max size calculation of item moniker to match native. - Add a generic moniker marshaler that works by saving & loading monikers to & from the stream. - Use the generic moniker marshal in the file & item monikers and add a class factory for each. - Implement IROTData::GetComparisonData for file & item monikers. - Add a useful trace message. - Fix more places where custom header size was calculated exclusive of the data size member. - Optimize custom marshaling by getting size before calling the custom marshaler so we can write the header before and not use a second stream. - Change remaining blocks of code with 2-space indentation to 4-space indentation. - Make vtables const. - Remove an unnecessary memcpy and let the compiler do the work. - Write custom header up to and including size, not excluding. - Add a stub implementation of CoIsHandlerConnected. - Marshal objects & monikers into the ROT. - Test for this behaviour. Mike McCormack <mike@codeweavers.com> - Remove unnecessary declarations and make functions static. - Remove forward declarations. - Make sure a stream can't be created in read only storage. - Fix a memory leak in the ole storage implementation. - Remove function prototypes. Kevin Koltzau <kevin@plop.org> - Implement Hash function on composite moniker. Jeff Latimer <jeffl@defcen.gov.au> - Implement the IEnumMoniker interface for the ROT and provide tests to exercise the interface. Pierre d'Herbemont <stegefin@free.fr> - Big Endian specific code fixes in order to conform with NONAMELESSSTRUCT. Matthew Mastracci <matt@aclaro.com> - Replace stub entry for StgOpenStorageEx with call to StgOpenStorage. - Replace StgCreateStorageEx stub with call to StgCreateDocfile and add required STGFMT_* enumerations. svn path=/trunk/; revision=15562
2005-05-28 09:30:04 +00:00
}
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
}
static void PropertyStorage_PropNameDestroy(void *k, void *d, void *extra)
{
Sync to Wine-20050524: Alexandre Julliard <julliard@winehq.org> - Added rules for building import libraries in the individual dll makefiles, and added support for building a .def.a static import library too. - Removed unnecessary code in the 16-bit DllEntryPoint function of some dlls, and also fixed its ordinal in a few places. - Comment out stub WEP entry points so that we can call WEP for builtin dlls too. Juan Lang <juan_lang@yahoo.com> - Obvious fixes to PropVariantClear and PropVariantCopy for vector types. - Add a comment, and a no-op cleanup. - Differentiate between version 0 and version 1 property storages. - Store property names in the code page of the property set. - maintain proper byte order - maintain PROPSETFLAG_ANSI flag based on codepage - update comments - Correct/improve error checking in IPropertyStorage. - convert strings between property storage's code page and system code page - add tests for setting code page - fix tests and behavior to match WinXP - Define and use endian conversion macros for big-endian machines. Marcus Meissner <marcus@jet.franken.de> - Move the Dll init function to compobj.c to avoid having global variables. Remove need of ole32_main.h. - Make HGLOBALStream_* functions static. - Make _xmalloc16() static. - Staticify FTMarshalImpl definition. Francois Gouget <fgouget@free.fr> - Specify the proper call convention in the PropSysFreeString() implementation. - Tweak the API documentation to silence winapi_check warnings. Robert Shearman <rob@codeweavers.com> - Add error messages on failure in file moniker load function. - Fix incorrect pointer check in both monikers. - Fix max size calculation of item moniker to match native. - Add a generic moniker marshaler that works by saving & loading monikers to & from the stream. - Use the generic moniker marshal in the file & item monikers and add a class factory for each. - Implement IROTData::GetComparisonData for file & item monikers. - Add a useful trace message. - Fix more places where custom header size was calculated exclusive of the data size member. - Optimize custom marshaling by getting size before calling the custom marshaler so we can write the header before and not use a second stream. - Change remaining blocks of code with 2-space indentation to 4-space indentation. - Make vtables const. - Remove an unnecessary memcpy and let the compiler do the work. - Write custom header up to and including size, not excluding. - Add a stub implementation of CoIsHandlerConnected. - Marshal objects & monikers into the ROT. - Test for this behaviour. Mike McCormack <mike@codeweavers.com> - Remove unnecessary declarations and make functions static. - Remove forward declarations. - Make sure a stream can't be created in read only storage. - Fix a memory leak in the ole storage implementation. - Remove function prototypes. Kevin Koltzau <kevin@plop.org> - Implement Hash function on composite moniker. Jeff Latimer <jeffl@defcen.gov.au> - Implement the IEnumMoniker interface for the ROT and provide tests to exercise the interface. Pierre d'Herbemont <stegefin@free.fr> - Big Endian specific code fixes in order to conform with NONAMELESSSTRUCT. Matthew Mastracci <matt@aclaro.com> - Replace stub entry for StgOpenStorageEx with call to StgOpenStorage. - Replace StgCreateStorageEx stub with call to StgCreateDocfile and add required STGFMT_* enumerations. svn path=/trunk/; revision=15562
2005-05-28 09:30:04 +00:00
CoTaskMemFree(k);
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
}
static int PropertyStorage_PropCompare(const void *a, const void *b,
void *extra)
{
TRACE("(%d, %d)\n", PtrToUlong(a), PtrToUlong(b));
return PtrToUlong(a) - PtrToUlong(b);
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
}
static void PropertyStorage_PropertyDestroy(void *k, void *d, void *extra)
{
PropVariantClear(d);
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
HeapFree(GetProcessHeap(), 0, d);
}
Sync to Wine-20050524: Alexandre Julliard <julliard@winehq.org> - Added rules for building import libraries in the individual dll makefiles, and added support for building a .def.a static import library too. - Removed unnecessary code in the 16-bit DllEntryPoint function of some dlls, and also fixed its ordinal in a few places. - Comment out stub WEP entry points so that we can call WEP for builtin dlls too. Juan Lang <juan_lang@yahoo.com> - Obvious fixes to PropVariantClear and PropVariantCopy for vector types. - Add a comment, and a no-op cleanup. - Differentiate between version 0 and version 1 property storages. - Store property names in the code page of the property set. - maintain proper byte order - maintain PROPSETFLAG_ANSI flag based on codepage - update comments - Correct/improve error checking in IPropertyStorage. - convert strings between property storage's code page and system code page - add tests for setting code page - fix tests and behavior to match WinXP - Define and use endian conversion macros for big-endian machines. Marcus Meissner <marcus@jet.franken.de> - Move the Dll init function to compobj.c to avoid having global variables. Remove need of ole32_main.h. - Make HGLOBALStream_* functions static. - Make _xmalloc16() static. - Staticify FTMarshalImpl definition. Francois Gouget <fgouget@free.fr> - Specify the proper call convention in the PropSysFreeString() implementation. - Tweak the API documentation to silence winapi_check warnings. Robert Shearman <rob@codeweavers.com> - Add error messages on failure in file moniker load function. - Fix incorrect pointer check in both monikers. - Fix max size calculation of item moniker to match native. - Add a generic moniker marshaler that works by saving & loading monikers to & from the stream. - Use the generic moniker marshal in the file & item monikers and add a class factory for each. - Implement IROTData::GetComparisonData for file & item monikers. - Add a useful trace message. - Fix more places where custom header size was calculated exclusive of the data size member. - Optimize custom marshaling by getting size before calling the custom marshaler so we can write the header before and not use a second stream. - Change remaining blocks of code with 2-space indentation to 4-space indentation. - Make vtables const. - Remove an unnecessary memcpy and let the compiler do the work. - Write custom header up to and including size, not excluding. - Add a stub implementation of CoIsHandlerConnected. - Marshal objects & monikers into the ROT. - Test for this behaviour. Mike McCormack <mike@codeweavers.com> - Remove unnecessary declarations and make functions static. - Remove forward declarations. - Make sure a stream can't be created in read only storage. - Fix a memory leak in the ole storage implementation. - Remove function prototypes. Kevin Koltzau <kevin@plop.org> - Implement Hash function on composite moniker. Jeff Latimer <jeffl@defcen.gov.au> - Implement the IEnumMoniker interface for the ROT and provide tests to exercise the interface. Pierre d'Herbemont <stegefin@free.fr> - Big Endian specific code fixes in order to conform with NONAMELESSSTRUCT. Matthew Mastracci <matt@aclaro.com> - Replace stub entry for StgOpenStorageEx with call to StgOpenStorage. - Replace StgCreateStorageEx stub with call to StgCreateDocfile and add required STGFMT_* enumerations. svn path=/trunk/; revision=15562
2005-05-28 09:30:04 +00:00
#ifdef WORDS_BIGENDIAN
/* Swaps each character in str to or from little endian; assumes the conversion
* is symmetric, that is, that lendian16toh is equivalent to htole16.
Sync to Wine-20050524: Alexandre Julliard <julliard@winehq.org> - Added rules for building import libraries in the individual dll makefiles, and added support for building a .def.a static import library too. - Removed unnecessary code in the 16-bit DllEntryPoint function of some dlls, and also fixed its ordinal in a few places. - Comment out stub WEP entry points so that we can call WEP for builtin dlls too. Juan Lang <juan_lang@yahoo.com> - Obvious fixes to PropVariantClear and PropVariantCopy for vector types. - Add a comment, and a no-op cleanup. - Differentiate between version 0 and version 1 property storages. - Store property names in the code page of the property set. - maintain proper byte order - maintain PROPSETFLAG_ANSI flag based on codepage - update comments - Correct/improve error checking in IPropertyStorage. - convert strings between property storage's code page and system code page - add tests for setting code page - fix tests and behavior to match WinXP - Define and use endian conversion macros for big-endian machines. Marcus Meissner <marcus@jet.franken.de> - Move the Dll init function to compobj.c to avoid having global variables. Remove need of ole32_main.h. - Make HGLOBALStream_* functions static. - Make _xmalloc16() static. - Staticify FTMarshalImpl definition. Francois Gouget <fgouget@free.fr> - Specify the proper call convention in the PropSysFreeString() implementation. - Tweak the API documentation to silence winapi_check warnings. Robert Shearman <rob@codeweavers.com> - Add error messages on failure in file moniker load function. - Fix incorrect pointer check in both monikers. - Fix max size calculation of item moniker to match native. - Add a generic moniker marshaler that works by saving & loading monikers to & from the stream. - Use the generic moniker marshal in the file & item monikers and add a class factory for each. - Implement IROTData::GetComparisonData for file & item monikers. - Add a useful trace message. - Fix more places where custom header size was calculated exclusive of the data size member. - Optimize custom marshaling by getting size before calling the custom marshaler so we can write the header before and not use a second stream. - Change remaining blocks of code with 2-space indentation to 4-space indentation. - Make vtables const. - Remove an unnecessary memcpy and let the compiler do the work. - Write custom header up to and including size, not excluding. - Add a stub implementation of CoIsHandlerConnected. - Marshal objects & monikers into the ROT. - Test for this behaviour. Mike McCormack <mike@codeweavers.com> - Remove unnecessary declarations and make functions static. - Remove forward declarations. - Make sure a stream can't be created in read only storage. - Fix a memory leak in the ole storage implementation. - Remove function prototypes. Kevin Koltzau <kevin@plop.org> - Implement Hash function on composite moniker. Jeff Latimer <jeffl@defcen.gov.au> - Implement the IEnumMoniker interface for the ROT and provide tests to exercise the interface. Pierre d'Herbemont <stegefin@free.fr> - Big Endian specific code fixes in order to conform with NONAMELESSSTRUCT. Matthew Mastracci <matt@aclaro.com> - Replace stub entry for StgOpenStorageEx with call to StgOpenStorage. - Replace StgCreateStorageEx stub with call to StgCreateDocfile and add required STGFMT_* enumerations. svn path=/trunk/; revision=15562
2005-05-28 09:30:04 +00:00
*/
static void PropertyStorage_ByteSwapString(LPWSTR str, size_t len)
{
DWORD i;
/* Swap characters to host order.
* FIXME: alignment?
*/
for (i = 0; i < len; i++)
str[i] = lendian16toh(str[i]);
Sync to Wine-20050524: Alexandre Julliard <julliard@winehq.org> - Added rules for building import libraries in the individual dll makefiles, and added support for building a .def.a static import library too. - Removed unnecessary code in the 16-bit DllEntryPoint function of some dlls, and also fixed its ordinal in a few places. - Comment out stub WEP entry points so that we can call WEP for builtin dlls too. Juan Lang <juan_lang@yahoo.com> - Obvious fixes to PropVariantClear and PropVariantCopy for vector types. - Add a comment, and a no-op cleanup. - Differentiate between version 0 and version 1 property storages. - Store property names in the code page of the property set. - maintain proper byte order - maintain PROPSETFLAG_ANSI flag based on codepage - update comments - Correct/improve error checking in IPropertyStorage. - convert strings between property storage's code page and system code page - add tests for setting code page - fix tests and behavior to match WinXP - Define and use endian conversion macros for big-endian machines. Marcus Meissner <marcus@jet.franken.de> - Move the Dll init function to compobj.c to avoid having global variables. Remove need of ole32_main.h. - Make HGLOBALStream_* functions static. - Make _xmalloc16() static. - Staticify FTMarshalImpl definition. Francois Gouget <fgouget@free.fr> - Specify the proper call convention in the PropSysFreeString() implementation. - Tweak the API documentation to silence winapi_check warnings. Robert Shearman <rob@codeweavers.com> - Add error messages on failure in file moniker load function. - Fix incorrect pointer check in both monikers. - Fix max size calculation of item moniker to match native. - Add a generic moniker marshaler that works by saving & loading monikers to & from the stream. - Use the generic moniker marshal in the file & item monikers and add a class factory for each. - Implement IROTData::GetComparisonData for file & item monikers. - Add a useful trace message. - Fix more places where custom header size was calculated exclusive of the data size member. - Optimize custom marshaling by getting size before calling the custom marshaler so we can write the header before and not use a second stream. - Change remaining blocks of code with 2-space indentation to 4-space indentation. - Make vtables const. - Remove an unnecessary memcpy and let the compiler do the work. - Write custom header up to and including size, not excluding. - Add a stub implementation of CoIsHandlerConnected. - Marshal objects & monikers into the ROT. - Test for this behaviour. Mike McCormack <mike@codeweavers.com> - Remove unnecessary declarations and make functions static. - Remove forward declarations. - Make sure a stream can't be created in read only storage. - Fix a memory leak in the ole storage implementation. - Remove function prototypes. Kevin Koltzau <kevin@plop.org> - Implement Hash function on composite moniker. Jeff Latimer <jeffl@defcen.gov.au> - Implement the IEnumMoniker interface for the ROT and provide tests to exercise the interface. Pierre d'Herbemont <stegefin@free.fr> - Big Endian specific code fixes in order to conform with NONAMELESSSTRUCT. Matthew Mastracci <matt@aclaro.com> - Replace stub entry for StgOpenStorageEx with call to StgOpenStorage. - Replace StgCreateStorageEx stub with call to StgCreateDocfile and add required STGFMT_* enumerations. svn path=/trunk/; revision=15562
2005-05-28 09:30:04 +00:00
}
#else
#define PropertyStorage_ByteSwapString(s, l)
#endif
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
/* Reads the dictionary from the memory buffer beginning at ptr. Interprets
* the entries according to the values of This->codePage and This->locale.
* FIXME: there isn't any checking whether the read property extends past the
* end of the buffer.
Sync to Wine-20050310: Jon Griffiths <jon_p_griffiths@yahoo.com> - Documentation spelling fixes. Mike McCormack <mike@codeweavers.com> - Implement and test IPropertySetStorage. - Fix more incorrect uses of STGM_ enumerations. - Add struct StorageBaseImpl at the start of derived structures instead of trying to keep the first members the same. - StgOpenStorage shouldn't open zero length storage files. - Shared reading of storage files requires STGM_TRANSACTED. - Test and fix grfMode handling in StgOpenDocfile. - Implement StgSetTimes. Robert Shearman <rob@codeweavers.com> - Better tracing. - Small cleanup of creation functions. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. - Move marshaling state machine into stub manager from ifstub. - Add additional needed states for table-weak marshaling, as shown by tests. - Protect external reference count from underflows/overflows. - Make COM use the RPC runtime as the backend for RPC calls. Based on a patch by Ove Ksven. - Invoke objects in STA's in the correct thread by sending messages to the hidden apartment window. - Use I_RpcGetBuffer, instead of our own buffer routines to fix an occasional test crash caused by heap corruption. - Zero the memory block passed to RpcServerRegisterIfEx so we don't pass garbage in some of the fields we don't fill in. - Return the correct error code from create_server and fix two handle leaks. - TODO update. - Remove cruft left over from previous RPC backend implementation in the apartment structure. - Don't pass an IPID by value for proxy_manager_create_ifproxy. - Disable more of RPC_UnregisterInterface to prevent the RPC runtime using freed memory. - Rename various external RPC backend functions so that they all have the same "RPC_" prefix. - Reduce the timeout of the function that connects to a local server to 30s, like native. - Make each ifproxy have its own channel buffer to fix a bug where a proxy with multiple interfaces could invoke the wrong stub buffer on the server. - The Global Interface Table should do table-strong marshaling instead of normal marshaling so that an interface can be retrieved more than one time. Mike Hearn <mh@codeweavers.com> - Avoid infinite loop when doing a typelib marshalled IUnknown::QueryInterface by only doing an extra QI if requested IID is not equal to marshalled IID. Rob Shearman <rob@codeweavers.com> Mike Hearn <mh@codeweavers.com> - Add re-entrancy tests to the test suite. - Run RPCs on a new thread client side so we can pump the message loop. Juan Lang <juan_lang@yahoo.com> - Fix the calling convention of DllCanUnloadNow. - Move vtbl to end of file and get rid of unnecessary prototypes. - Implement StgCreatePropSetStg. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Paul Vriens <Paul.Vriens@xs4all.nl> - Added some TRACE statements. svn path=/trunk/; revision=14083
2005-03-14 23:17:44 +00:00
*/
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
static HRESULT PropertyStorage_ReadDictionary(PropertyStorage_impl *This,
BYTE *ptr)
Sync to Wine-20050310: Jon Griffiths <jon_p_griffiths@yahoo.com> - Documentation spelling fixes. Mike McCormack <mike@codeweavers.com> - Implement and test IPropertySetStorage. - Fix more incorrect uses of STGM_ enumerations. - Add struct StorageBaseImpl at the start of derived structures instead of trying to keep the first members the same. - StgOpenStorage shouldn't open zero length storage files. - Shared reading of storage files requires STGM_TRANSACTED. - Test and fix grfMode handling in StgOpenDocfile. - Implement StgSetTimes. Robert Shearman <rob@codeweavers.com> - Better tracing. - Small cleanup of creation functions. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. - Move marshaling state machine into stub manager from ifstub. - Add additional needed states for table-weak marshaling, as shown by tests. - Protect external reference count from underflows/overflows. - Make COM use the RPC runtime as the backend for RPC calls. Based on a patch by Ove Ksven. - Invoke objects in STA's in the correct thread by sending messages to the hidden apartment window. - Use I_RpcGetBuffer, instead of our own buffer routines to fix an occasional test crash caused by heap corruption. - Zero the memory block passed to RpcServerRegisterIfEx so we don't pass garbage in some of the fields we don't fill in. - Return the correct error code from create_server and fix two handle leaks. - TODO update. - Remove cruft left over from previous RPC backend implementation in the apartment structure. - Don't pass an IPID by value for proxy_manager_create_ifproxy. - Disable more of RPC_UnregisterInterface to prevent the RPC runtime using freed memory. - Rename various external RPC backend functions so that they all have the same "RPC_" prefix. - Reduce the timeout of the function that connects to a local server to 30s, like native. - Make each ifproxy have its own channel buffer to fix a bug where a proxy with multiple interfaces could invoke the wrong stub buffer on the server. - The Global Interface Table should do table-strong marshaling instead of normal marshaling so that an interface can be retrieved more than one time. Mike Hearn <mh@codeweavers.com> - Avoid infinite loop when doing a typelib marshalled IUnknown::QueryInterface by only doing an extra QI if requested IID is not equal to marshalled IID. Rob Shearman <rob@codeweavers.com> Mike Hearn <mh@codeweavers.com> - Add re-entrancy tests to the test suite. - Run RPCs on a new thread client side so we can pump the message loop. Juan Lang <juan_lang@yahoo.com> - Fix the calling convention of DllCanUnloadNow. - Move vtbl to end of file and get rid of unnecessary prototypes. - Implement StgCreatePropSetStg. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Paul Vriens <Paul.Vriens@xs4all.nl> - Added some TRACE statements. svn path=/trunk/; revision=14083
2005-03-14 23:17:44 +00:00
{
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
DWORD numEntries, i;
HRESULT hr = S_OK;
Sync to Wine-20050310: Jon Griffiths <jon_p_griffiths@yahoo.com> - Documentation spelling fixes. Mike McCormack <mike@codeweavers.com> - Implement and test IPropertySetStorage. - Fix more incorrect uses of STGM_ enumerations. - Add struct StorageBaseImpl at the start of derived structures instead of trying to keep the first members the same. - StgOpenStorage shouldn't open zero length storage files. - Shared reading of storage files requires STGM_TRANSACTED. - Test and fix grfMode handling in StgOpenDocfile. - Implement StgSetTimes. Robert Shearman <rob@codeweavers.com> - Better tracing. - Small cleanup of creation functions. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. - Move marshaling state machine into stub manager from ifstub. - Add additional needed states for table-weak marshaling, as shown by tests. - Protect external reference count from underflows/overflows. - Make COM use the RPC runtime as the backend for RPC calls. Based on a patch by Ove Ksven. - Invoke objects in STA's in the correct thread by sending messages to the hidden apartment window. - Use I_RpcGetBuffer, instead of our own buffer routines to fix an occasional test crash caused by heap corruption. - Zero the memory block passed to RpcServerRegisterIfEx so we don't pass garbage in some of the fields we don't fill in. - Return the correct error code from create_server and fix two handle leaks. - TODO update. - Remove cruft left over from previous RPC backend implementation in the apartment structure. - Don't pass an IPID by value for proxy_manager_create_ifproxy. - Disable more of RPC_UnregisterInterface to prevent the RPC runtime using freed memory. - Rename various external RPC backend functions so that they all have the same "RPC_" prefix. - Reduce the timeout of the function that connects to a local server to 30s, like native. - Make each ifproxy have its own channel buffer to fix a bug where a proxy with multiple interfaces could invoke the wrong stub buffer on the server. - The Global Interface Table should do table-strong marshaling instead of normal marshaling so that an interface can be retrieved more than one time. Mike Hearn <mh@codeweavers.com> - Avoid infinite loop when doing a typelib marshalled IUnknown::QueryInterface by only doing an extra QI if requested IID is not equal to marshalled IID. Rob Shearman <rob@codeweavers.com> Mike Hearn <mh@codeweavers.com> - Add re-entrancy tests to the test suite. - Run RPCs on a new thread client side so we can pump the message loop. Juan Lang <juan_lang@yahoo.com> - Fix the calling convention of DllCanUnloadNow. - Move vtbl to end of file and get rid of unnecessary prototypes. - Implement StgCreatePropSetStg. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Paul Vriens <Paul.Vriens@xs4all.nl> - Added some TRACE statements. svn path=/trunk/; revision=14083
2005-03-14 23:17:44 +00:00
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
assert(This->name_to_propid);
assert(This->propid_to_name);
StorageUtl_ReadDWord(ptr, 0, &numEntries);
TRACE("Reading %d entries:\n", numEntries);
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
ptr += sizeof(DWORD);
for (i = 0; SUCCEEDED(hr) && i < numEntries; i++)
{
PROPID propid;
DWORD cbEntry;
StorageUtl_ReadDWord(ptr, 0, &propid);
ptr += sizeof(PROPID);
StorageUtl_ReadDWord(ptr, 0, &cbEntry);
ptr += sizeof(DWORD);
TRACE("Reading entry with ID 0x%08x, %d bytes\n", propid, cbEntry);
Sync to Wine-20050524: Alexandre Julliard <julliard@winehq.org> - Added rules for building import libraries in the individual dll makefiles, and added support for building a .def.a static import library too. - Removed unnecessary code in the 16-bit DllEntryPoint function of some dlls, and also fixed its ordinal in a few places. - Comment out stub WEP entry points so that we can call WEP for builtin dlls too. Juan Lang <juan_lang@yahoo.com> - Obvious fixes to PropVariantClear and PropVariantCopy for vector types. - Add a comment, and a no-op cleanup. - Differentiate between version 0 and version 1 property storages. - Store property names in the code page of the property set. - maintain proper byte order - maintain PROPSETFLAG_ANSI flag based on codepage - update comments - Correct/improve error checking in IPropertyStorage. - convert strings between property storage's code page and system code page - add tests for setting code page - fix tests and behavior to match WinXP - Define and use endian conversion macros for big-endian machines. Marcus Meissner <marcus@jet.franken.de> - Move the Dll init function to compobj.c to avoid having global variables. Remove need of ole32_main.h. - Make HGLOBALStream_* functions static. - Make _xmalloc16() static. - Staticify FTMarshalImpl definition. Francois Gouget <fgouget@free.fr> - Specify the proper call convention in the PropSysFreeString() implementation. - Tweak the API documentation to silence winapi_check warnings. Robert Shearman <rob@codeweavers.com> - Add error messages on failure in file moniker load function. - Fix incorrect pointer check in both monikers. - Fix max size calculation of item moniker to match native. - Add a generic moniker marshaler that works by saving & loading monikers to & from the stream. - Use the generic moniker marshal in the file & item monikers and add a class factory for each. - Implement IROTData::GetComparisonData for file & item monikers. - Add a useful trace message. - Fix more places where custom header size was calculated exclusive of the data size member. - Optimize custom marshaling by getting size before calling the custom marshaler so we can write the header before and not use a second stream. - Change remaining blocks of code with 2-space indentation to 4-space indentation. - Make vtables const. - Remove an unnecessary memcpy and let the compiler do the work. - Write custom header up to and including size, not excluding. - Add a stub implementation of CoIsHandlerConnected. - Marshal objects & monikers into the ROT. - Test for this behaviour. Mike McCormack <mike@codeweavers.com> - Remove unnecessary declarations and make functions static. - Remove forward declarations. - Make sure a stream can't be created in read only storage. - Fix a memory leak in the ole storage implementation. - Remove function prototypes. Kevin Koltzau <kevin@plop.org> - Implement Hash function on composite moniker. Jeff Latimer <jeffl@defcen.gov.au> - Implement the IEnumMoniker interface for the ROT and provide tests to exercise the interface. Pierre d'Herbemont <stegefin@free.fr> - Big Endian specific code fixes in order to conform with NONAMELESSSTRUCT. Matthew Mastracci <matt@aclaro.com> - Replace stub entry for StgOpenStorageEx with call to StgOpenStorage. - Replace StgCreateStorageEx stub with call to StgCreateDocfile and add required STGFMT_* enumerations. svn path=/trunk/; revision=15562
2005-05-28 09:30:04 +00:00
/* Make sure the source string is NULL-terminated */
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
if (This->codePage != CP_UNICODE)
Sync to Wine-20050524: Alexandre Julliard <julliard@winehq.org> - Added rules for building import libraries in the individual dll makefiles, and added support for building a .def.a static import library too. - Removed unnecessary code in the 16-bit DllEntryPoint function of some dlls, and also fixed its ordinal in a few places. - Comment out stub WEP entry points so that we can call WEP for builtin dlls too. Juan Lang <juan_lang@yahoo.com> - Obvious fixes to PropVariantClear and PropVariantCopy for vector types. - Add a comment, and a no-op cleanup. - Differentiate between version 0 and version 1 property storages. - Store property names in the code page of the property set. - maintain proper byte order - maintain PROPSETFLAG_ANSI flag based on codepage - update comments - Correct/improve error checking in IPropertyStorage. - convert strings between property storage's code page and system code page - add tests for setting code page - fix tests and behavior to match WinXP - Define and use endian conversion macros for big-endian machines. Marcus Meissner <marcus@jet.franken.de> - Move the Dll init function to compobj.c to avoid having global variables. Remove need of ole32_main.h. - Make HGLOBALStream_* functions static. - Make _xmalloc16() static. - Staticify FTMarshalImpl definition. Francois Gouget <fgouget@free.fr> - Specify the proper call convention in the PropSysFreeString() implementation. - Tweak the API documentation to silence winapi_check warnings. Robert Shearman <rob@codeweavers.com> - Add error messages on failure in file moniker load function. - Fix incorrect pointer check in both monikers. - Fix max size calculation of item moniker to match native. - Add a generic moniker marshaler that works by saving & loading monikers to & from the stream. - Use the generic moniker marshal in the file & item monikers and add a class factory for each. - Implement IROTData::GetComparisonData for file & item monikers. - Add a useful trace message. - Fix more places where custom header size was calculated exclusive of the data size member. - Optimize custom marshaling by getting size before calling the custom marshaler so we can write the header before and not use a second stream. - Change remaining blocks of code with 2-space indentation to 4-space indentation. - Make vtables const. - Remove an unnecessary memcpy and let the compiler do the work. - Write custom header up to and including size, not excluding. - Add a stub implementation of CoIsHandlerConnected. - Marshal objects & monikers into the ROT. - Test for this behaviour. Mike McCormack <mike@codeweavers.com> - Remove unnecessary declarations and make functions static. - Remove forward declarations. - Make sure a stream can't be created in read only storage. - Fix a memory leak in the ole storage implementation. - Remove function prototypes. Kevin Koltzau <kevin@plop.org> - Implement Hash function on composite moniker. Jeff Latimer <jeffl@defcen.gov.au> - Implement the IEnumMoniker interface for the ROT and provide tests to exercise the interface. Pierre d'Herbemont <stegefin@free.fr> - Big Endian specific code fixes in order to conform with NONAMELESSSTRUCT. Matthew Mastracci <matt@aclaro.com> - Replace stub entry for StgOpenStorageEx with call to StgOpenStorage. - Replace StgCreateStorageEx stub with call to StgCreateDocfile and add required STGFMT_* enumerations. svn path=/trunk/; revision=15562
2005-05-28 09:30:04 +00:00
ptr[cbEntry - 1] = '\0';
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
else
((LPWSTR)ptr)[cbEntry - 1] = 0;
Sync to Wine-20050830: Francois Gouget <fgouget@free.fr> - Use LPSTORAGE to better match the PSDK. Document the real SEGPTR type using the standard documentation mechanisms. Fixes winapi_check warnings. Robert Shearman <rob@codeweavers.com> - Remove unused thread handle entry from the apartment structure. - Implement IMarshal on proxies so that we don't end up with proxies to proxies, causing potential deadlock issues and performance problems. - Add a test for this situation and remove the todo_wine from another test that now succeeds. - Add stub for CoAllowSetForegroundWindow. Vincent Beron <vberon@mecano.gme.usherb.ca> - Remove local declarations already in included public headers. - Correct mismatches between spec files and comments about export number. Alexandre Julliard <julliard@winehq.org> - Uncomment the typedef in the DECLARE_INTERFACE macro, and get rid of duplicate typedefs. - Use the proper WOW functions everywhere instead of the K32WOW variant. - Don't prefix the functions DllCanUnloadNow, DllGetClassObject and Dll(Un)RegisterServer with the dll name so that the compiler can check the prototypes. - Remove duplicate definition of FILE_BEGIN. - Replace the _ICOM_THIS_From macros by inline functions the way it's already done in shelllink.c. Mike McCormack <mike@codeweavers.com> - Warning fixes for gcc 4.0. - Fix some gcc 4.0 warnings. - return a precomputed result for a NULL string - pass strlen an LPSTR to eliminate a sign warning Marcus Meissner <marcus@jet.franken.de> - Implemented ILockBytes16 (memorystream) support for the 16bit compound storage implementation. - Added ReadClassStg, OleDoAutoConvert, GetConvertStg implementations/stubs. Marcus Meissner <meissner@suse.de> - Added CoCreateInstance16, CoGetClassObject16, OleLoad16 stubs. svn path=/trunk/; revision=17678
2005-09-05 21:56:14 +00:00
hr = PropertyStorage_StoreNameWithId(This, (char*)ptr, This->codePage, propid);
Sync to Wine-20050524: Alexandre Julliard <julliard@winehq.org> - Added rules for building import libraries in the individual dll makefiles, and added support for building a .def.a static import library too. - Removed unnecessary code in the 16-bit DllEntryPoint function of some dlls, and also fixed its ordinal in a few places. - Comment out stub WEP entry points so that we can call WEP for builtin dlls too. Juan Lang <juan_lang@yahoo.com> - Obvious fixes to PropVariantClear and PropVariantCopy for vector types. - Add a comment, and a no-op cleanup. - Differentiate between version 0 and version 1 property storages. - Store property names in the code page of the property set. - maintain proper byte order - maintain PROPSETFLAG_ANSI flag based on codepage - update comments - Correct/improve error checking in IPropertyStorage. - convert strings between property storage's code page and system code page - add tests for setting code page - fix tests and behavior to match WinXP - Define and use endian conversion macros for big-endian machines. Marcus Meissner <marcus@jet.franken.de> - Move the Dll init function to compobj.c to avoid having global variables. Remove need of ole32_main.h. - Make HGLOBALStream_* functions static. - Make _xmalloc16() static. - Staticify FTMarshalImpl definition. Francois Gouget <fgouget@free.fr> - Specify the proper call convention in the PropSysFreeString() implementation. - Tweak the API documentation to silence winapi_check warnings. Robert Shearman <rob@codeweavers.com> - Add error messages on failure in file moniker load function. - Fix incorrect pointer check in both monikers. - Fix max size calculation of item moniker to match native. - Add a generic moniker marshaler that works by saving & loading monikers to & from the stream. - Use the generic moniker marshal in the file & item monikers and add a class factory for each. - Implement IROTData::GetComparisonData for file & item monikers. - Add a useful trace message. - Fix more places where custom header size was calculated exclusive of the data size member. - Optimize custom marshaling by getting size before calling the custom marshaler so we can write the header before and not use a second stream. - Change remaining blocks of code with 2-space indentation to 4-space indentation. - Make vtables const. - Remove an unnecessary memcpy and let the compiler do the work. - Write custom header up to and including size, not excluding. - Add a stub implementation of CoIsHandlerConnected. - Marshal objects & monikers into the ROT. - Test for this behaviour. Mike McCormack <mike@codeweavers.com> - Remove unnecessary declarations and make functions static. - Remove forward declarations. - Make sure a stream can't be created in read only storage. - Fix a memory leak in the ole storage implementation. - Remove function prototypes. Kevin Koltzau <kevin@plop.org> - Implement Hash function on composite moniker. Jeff Latimer <jeffl@defcen.gov.au> - Implement the IEnumMoniker interface for the ROT and provide tests to exercise the interface. Pierre d'Herbemont <stegefin@free.fr> - Big Endian specific code fixes in order to conform with NONAMELESSSTRUCT. Matthew Mastracci <matt@aclaro.com> - Replace stub entry for StgOpenStorageEx with call to StgOpenStorage. - Replace StgCreateStorageEx stub with call to StgCreateDocfile and add required STGFMT_* enumerations. svn path=/trunk/; revision=15562
2005-05-28 09:30:04 +00:00
if (This->codePage == CP_UNICODE)
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
{
/* cbEntry is the number of characters */
cbEntry *= 2;
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
/* Unicode entries are padded to DWORD boundaries */
if (cbEntry % sizeof(DWORD))
ptr += sizeof(DWORD) - (cbEntry % sizeof(DWORD));
}
ptr += cbEntry;
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
}
return hr;
}
Sync to Wine-20050310: Jon Griffiths <jon_p_griffiths@yahoo.com> - Documentation spelling fixes. Mike McCormack <mike@codeweavers.com> - Implement and test IPropertySetStorage. - Fix more incorrect uses of STGM_ enumerations. - Add struct StorageBaseImpl at the start of derived structures instead of trying to keep the first members the same. - StgOpenStorage shouldn't open zero length storage files. - Shared reading of storage files requires STGM_TRANSACTED. - Test and fix grfMode handling in StgOpenDocfile. - Implement StgSetTimes. Robert Shearman <rob@codeweavers.com> - Better tracing. - Small cleanup of creation functions. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. - Move marshaling state machine into stub manager from ifstub. - Add additional needed states for table-weak marshaling, as shown by tests. - Protect external reference count from underflows/overflows. - Make COM use the RPC runtime as the backend for RPC calls. Based on a patch by Ove Ksven. - Invoke objects in STA's in the correct thread by sending messages to the hidden apartment window. - Use I_RpcGetBuffer, instead of our own buffer routines to fix an occasional test crash caused by heap corruption. - Zero the memory block passed to RpcServerRegisterIfEx so we don't pass garbage in some of the fields we don't fill in. - Return the correct error code from create_server and fix two handle leaks. - TODO update. - Remove cruft left over from previous RPC backend implementation in the apartment structure. - Don't pass an IPID by value for proxy_manager_create_ifproxy. - Disable more of RPC_UnregisterInterface to prevent the RPC runtime using freed memory. - Rename various external RPC backend functions so that they all have the same "RPC_" prefix. - Reduce the timeout of the function that connects to a local server to 30s, like native. - Make each ifproxy have its own channel buffer to fix a bug where a proxy with multiple interfaces could invoke the wrong stub buffer on the server. - The Global Interface Table should do table-strong marshaling instead of normal marshaling so that an interface can be retrieved more than one time. Mike Hearn <mh@codeweavers.com> - Avoid infinite loop when doing a typelib marshalled IUnknown::QueryInterface by only doing an extra QI if requested IID is not equal to marshalled IID. Rob Shearman <rob@codeweavers.com> Mike Hearn <mh@codeweavers.com> - Add re-entrancy tests to the test suite. - Run RPCs on a new thread client side so we can pump the message loop. Juan Lang <juan_lang@yahoo.com> - Fix the calling convention of DllCanUnloadNow. - Move vtbl to end of file and get rid of unnecessary prototypes. - Implement StgCreatePropSetStg. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Paul Vriens <Paul.Vriens@xs4all.nl> - Added some TRACE statements. svn path=/trunk/; revision=14083
2005-03-14 23:17:44 +00:00
#ifdef __i386__
#define __thiscall_wrapper __stdcall
#else
#define __thiscall_wrapper __cdecl
#endif
static void* __thiscall_wrapper Allocate_CoTaskMemAlloc(void *this, ULONG size)
{
return CoTaskMemAlloc(size);
}
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
/* FIXME: there isn't any checking whether the read property extends past the
* end of the buffer.
*/
static HRESULT PropertyStorage_ReadProperty(PROPVARIANT *prop, const BYTE *data,
UINT codepage, void* (__thiscall_wrapper *allocate)(void *this, ULONG size), void *allocate_data)
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
{
HRESULT hr = S_OK;
DWORD vt;
Sync to Wine-20050310: Jon Griffiths <jon_p_griffiths@yahoo.com> - Documentation spelling fixes. Mike McCormack <mike@codeweavers.com> - Implement and test IPropertySetStorage. - Fix more incorrect uses of STGM_ enumerations. - Add struct StorageBaseImpl at the start of derived structures instead of trying to keep the first members the same. - StgOpenStorage shouldn't open zero length storage files. - Shared reading of storage files requires STGM_TRANSACTED. - Test and fix grfMode handling in StgOpenDocfile. - Implement StgSetTimes. Robert Shearman <rob@codeweavers.com> - Better tracing. - Small cleanup of creation functions. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. - Move marshaling state machine into stub manager from ifstub. - Add additional needed states for table-weak marshaling, as shown by tests. - Protect external reference count from underflows/overflows. - Make COM use the RPC runtime as the backend for RPC calls. Based on a patch by Ove Ksven. - Invoke objects in STA's in the correct thread by sending messages to the hidden apartment window. - Use I_RpcGetBuffer, instead of our own buffer routines to fix an occasional test crash caused by heap corruption. - Zero the memory block passed to RpcServerRegisterIfEx so we don't pass garbage in some of the fields we don't fill in. - Return the correct error code from create_server and fix two handle leaks. - TODO update. - Remove cruft left over from previous RPC backend implementation in the apartment structure. - Don't pass an IPID by value for proxy_manager_create_ifproxy. - Disable more of RPC_UnregisterInterface to prevent the RPC runtime using freed memory. - Rename various external RPC backend functions so that they all have the same "RPC_" prefix. - Reduce the timeout of the function that connects to a local server to 30s, like native. - Make each ifproxy have its own channel buffer to fix a bug where a proxy with multiple interfaces could invoke the wrong stub buffer on the server. - The Global Interface Table should do table-strong marshaling instead of normal marshaling so that an interface can be retrieved more than one time. Mike Hearn <mh@codeweavers.com> - Avoid infinite loop when doing a typelib marshalled IUnknown::QueryInterface by only doing an extra QI if requested IID is not equal to marshalled IID. Rob Shearman <rob@codeweavers.com> Mike Hearn <mh@codeweavers.com> - Add re-entrancy tests to the test suite. - Run RPCs on a new thread client side so we can pump the message loop. Juan Lang <juan_lang@yahoo.com> - Fix the calling convention of DllCanUnloadNow. - Move vtbl to end of file and get rid of unnecessary prototypes. - Implement StgCreatePropSetStg. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Paul Vriens <Paul.Vriens@xs4all.nl> - Added some TRACE statements. svn path=/trunk/; revision=14083
2005-03-14 23:17:44 +00:00
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
assert(prop);
assert(data);
StorageUtl_ReadDWord(data, 0, &vt);
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
data += sizeof(DWORD);
prop->vt = vt;
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
switch (prop->vt)
{
case VT_EMPTY:
case VT_NULL:
break;
case VT_I1:
prop->u.cVal = *(const char *)data;
TRACE("Read char 0x%x ('%c')\n", prop->u.cVal, prop->u.cVal);
break;
case VT_UI1:
prop->u.bVal = *data;
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
TRACE("Read byte 0x%x\n", prop->u.bVal);
break;
case VT_BOOL:
StorageUtl_ReadWord(data, 0, (WORD*)&prop->u.boolVal);
TRACE("Read bool %d\n", prop->u.boolVal);
break;
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
case VT_I2:
Sync to Wine-20050830: Francois Gouget <fgouget@free.fr> - Use LPSTORAGE to better match the PSDK. Document the real SEGPTR type using the standard documentation mechanisms. Fixes winapi_check warnings. Robert Shearman <rob@codeweavers.com> - Remove unused thread handle entry from the apartment structure. - Implement IMarshal on proxies so that we don't end up with proxies to proxies, causing potential deadlock issues and performance problems. - Add a test for this situation and remove the todo_wine from another test that now succeeds. - Add stub for CoAllowSetForegroundWindow. Vincent Beron <vberon@mecano.gme.usherb.ca> - Remove local declarations already in included public headers. - Correct mismatches between spec files and comments about export number. Alexandre Julliard <julliard@winehq.org> - Uncomment the typedef in the DECLARE_INTERFACE macro, and get rid of duplicate typedefs. - Use the proper WOW functions everywhere instead of the K32WOW variant. - Don't prefix the functions DllCanUnloadNow, DllGetClassObject and Dll(Un)RegisterServer with the dll name so that the compiler can check the prototypes. - Remove duplicate definition of FILE_BEGIN. - Replace the _ICOM_THIS_From macros by inline functions the way it's already done in shelllink.c. Mike McCormack <mike@codeweavers.com> - Warning fixes for gcc 4.0. - Fix some gcc 4.0 warnings. - return a precomputed result for a NULL string - pass strlen an LPSTR to eliminate a sign warning Marcus Meissner <marcus@jet.franken.de> - Implemented ILockBytes16 (memorystream) support for the 16bit compound storage implementation. - Added ReadClassStg, OleDoAutoConvert, GetConvertStg implementations/stubs. Marcus Meissner <meissner@suse.de> - Added CoCreateInstance16, CoGetClassObject16, OleLoad16 stubs. svn path=/trunk/; revision=17678
2005-09-05 21:56:14 +00:00
StorageUtl_ReadWord(data, 0, (WORD*)&prop->u.iVal);
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
TRACE("Read short %d\n", prop->u.iVal);
break;
case VT_UI2:
StorageUtl_ReadWord(data, 0, &prop->u.uiVal);
TRACE("Read ushort %d\n", prop->u.uiVal);
break;
Sync to Wine-20050524: Alexandre Julliard <julliard@winehq.org> - Added rules for building import libraries in the individual dll makefiles, and added support for building a .def.a static import library too. - Removed unnecessary code in the 16-bit DllEntryPoint function of some dlls, and also fixed its ordinal in a few places. - Comment out stub WEP entry points so that we can call WEP for builtin dlls too. Juan Lang <juan_lang@yahoo.com> - Obvious fixes to PropVariantClear and PropVariantCopy for vector types. - Add a comment, and a no-op cleanup. - Differentiate between version 0 and version 1 property storages. - Store property names in the code page of the property set. - maintain proper byte order - maintain PROPSETFLAG_ANSI flag based on codepage - update comments - Correct/improve error checking in IPropertyStorage. - convert strings between property storage's code page and system code page - add tests for setting code page - fix tests and behavior to match WinXP - Define and use endian conversion macros for big-endian machines. Marcus Meissner <marcus@jet.franken.de> - Move the Dll init function to compobj.c to avoid having global variables. Remove need of ole32_main.h. - Make HGLOBALStream_* functions static. - Make _xmalloc16() static. - Staticify FTMarshalImpl definition. Francois Gouget <fgouget@free.fr> - Specify the proper call convention in the PropSysFreeString() implementation. - Tweak the API documentation to silence winapi_check warnings. Robert Shearman <rob@codeweavers.com> - Add error messages on failure in file moniker load function. - Fix incorrect pointer check in both monikers. - Fix max size calculation of item moniker to match native. - Add a generic moniker marshaler that works by saving & loading monikers to & from the stream. - Use the generic moniker marshal in the file & item monikers and add a class factory for each. - Implement IROTData::GetComparisonData for file & item monikers. - Add a useful trace message. - Fix more places where custom header size was calculated exclusive of the data size member. - Optimize custom marshaling by getting size before calling the custom marshaler so we can write the header before and not use a second stream. - Change remaining blocks of code with 2-space indentation to 4-space indentation. - Make vtables const. - Remove an unnecessary memcpy and let the compiler do the work. - Write custom header up to and including size, not excluding. - Add a stub implementation of CoIsHandlerConnected. - Marshal objects & monikers into the ROT. - Test for this behaviour. Mike McCormack <mike@codeweavers.com> - Remove unnecessary declarations and make functions static. - Remove forward declarations. - Make sure a stream can't be created in read only storage. - Fix a memory leak in the ole storage implementation. - Remove function prototypes. Kevin Koltzau <kevin@plop.org> - Implement Hash function on composite moniker. Jeff Latimer <jeffl@defcen.gov.au> - Implement the IEnumMoniker interface for the ROT and provide tests to exercise the interface. Pierre d'Herbemont <stegefin@free.fr> - Big Endian specific code fixes in order to conform with NONAMELESSSTRUCT. Matthew Mastracci <matt@aclaro.com> - Replace stub entry for StgOpenStorageEx with call to StgOpenStorage. - Replace StgCreateStorageEx stub with call to StgCreateDocfile and add required STGFMT_* enumerations. svn path=/trunk/; revision=15562
2005-05-28 09:30:04 +00:00
case VT_INT:
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
case VT_I4:
Sync to Wine-20050830: Francois Gouget <fgouget@free.fr> - Use LPSTORAGE to better match the PSDK. Document the real SEGPTR type using the standard documentation mechanisms. Fixes winapi_check warnings. Robert Shearman <rob@codeweavers.com> - Remove unused thread handle entry from the apartment structure. - Implement IMarshal on proxies so that we don't end up with proxies to proxies, causing potential deadlock issues and performance problems. - Add a test for this situation and remove the todo_wine from another test that now succeeds. - Add stub for CoAllowSetForegroundWindow. Vincent Beron <vberon@mecano.gme.usherb.ca> - Remove local declarations already in included public headers. - Correct mismatches between spec files and comments about export number. Alexandre Julliard <julliard@winehq.org> - Uncomment the typedef in the DECLARE_INTERFACE macro, and get rid of duplicate typedefs. - Use the proper WOW functions everywhere instead of the K32WOW variant. - Don't prefix the functions DllCanUnloadNow, DllGetClassObject and Dll(Un)RegisterServer with the dll name so that the compiler can check the prototypes. - Remove duplicate definition of FILE_BEGIN. - Replace the _ICOM_THIS_From macros by inline functions the way it's already done in shelllink.c. Mike McCormack <mike@codeweavers.com> - Warning fixes for gcc 4.0. - Fix some gcc 4.0 warnings. - return a precomputed result for a NULL string - pass strlen an LPSTR to eliminate a sign warning Marcus Meissner <marcus@jet.franken.de> - Implemented ILockBytes16 (memorystream) support for the 16bit compound storage implementation. - Added ReadClassStg, OleDoAutoConvert, GetConvertStg implementations/stubs. Marcus Meissner <meissner@suse.de> - Added CoCreateInstance16, CoGetClassObject16, OleLoad16 stubs. svn path=/trunk/; revision=17678
2005-09-05 21:56:14 +00:00
StorageUtl_ReadDWord(data, 0, (DWORD*)&prop->u.lVal);
TRACE("Read long %d\n", prop->u.lVal);
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
break;
Sync to Wine-20050524: Alexandre Julliard <julliard@winehq.org> - Added rules for building import libraries in the individual dll makefiles, and added support for building a .def.a static import library too. - Removed unnecessary code in the 16-bit DllEntryPoint function of some dlls, and also fixed its ordinal in a few places. - Comment out stub WEP entry points so that we can call WEP for builtin dlls too. Juan Lang <juan_lang@yahoo.com> - Obvious fixes to PropVariantClear and PropVariantCopy for vector types. - Add a comment, and a no-op cleanup. - Differentiate between version 0 and version 1 property storages. - Store property names in the code page of the property set. - maintain proper byte order - maintain PROPSETFLAG_ANSI flag based on codepage - update comments - Correct/improve error checking in IPropertyStorage. - convert strings between property storage's code page and system code page - add tests for setting code page - fix tests and behavior to match WinXP - Define and use endian conversion macros for big-endian machines. Marcus Meissner <marcus@jet.franken.de> - Move the Dll init function to compobj.c to avoid having global variables. Remove need of ole32_main.h. - Make HGLOBALStream_* functions static. - Make _xmalloc16() static. - Staticify FTMarshalImpl definition. Francois Gouget <fgouget@free.fr> - Specify the proper call convention in the PropSysFreeString() implementation. - Tweak the API documentation to silence winapi_check warnings. Robert Shearman <rob@codeweavers.com> - Add error messages on failure in file moniker load function. - Fix incorrect pointer check in both monikers. - Fix max size calculation of item moniker to match native. - Add a generic moniker marshaler that works by saving & loading monikers to & from the stream. - Use the generic moniker marshal in the file & item monikers and add a class factory for each. - Implement IROTData::GetComparisonData for file & item monikers. - Add a useful trace message. - Fix more places where custom header size was calculated exclusive of the data size member. - Optimize custom marshaling by getting size before calling the custom marshaler so we can write the header before and not use a second stream. - Change remaining blocks of code with 2-space indentation to 4-space indentation. - Make vtables const. - Remove an unnecessary memcpy and let the compiler do the work. - Write custom header up to and including size, not excluding. - Add a stub implementation of CoIsHandlerConnected. - Marshal objects & monikers into the ROT. - Test for this behaviour. Mike McCormack <mike@codeweavers.com> - Remove unnecessary declarations and make functions static. - Remove forward declarations. - Make sure a stream can't be created in read only storage. - Fix a memory leak in the ole storage implementation. - Remove function prototypes. Kevin Koltzau <kevin@plop.org> - Implement Hash function on composite moniker. Jeff Latimer <jeffl@defcen.gov.au> - Implement the IEnumMoniker interface for the ROT and provide tests to exercise the interface. Pierre d'Herbemont <stegefin@free.fr> - Big Endian specific code fixes in order to conform with NONAMELESSSTRUCT. Matthew Mastracci <matt@aclaro.com> - Replace stub entry for StgOpenStorageEx with call to StgOpenStorage. - Replace StgCreateStorageEx stub with call to StgCreateDocfile and add required STGFMT_* enumerations. svn path=/trunk/; revision=15562
2005-05-28 09:30:04 +00:00
case VT_UINT:
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
case VT_UI4:
StorageUtl_ReadDWord(data, 0, &prop->u.ulVal);
TRACE("Read ulong %d\n", prop->u.ulVal);
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
break;
case VT_I8:
StorageUtl_ReadULargeInteger(data, 0, (ULARGE_INTEGER *)&prop->u.hVal);
TRACE("Read long long %s\n", wine_dbgstr_longlong(prop->u.hVal.QuadPart));
break;
case VT_UI8:
StorageUtl_ReadULargeInteger(data, 0, &prop->u.uhVal);
TRACE("Read ulong long %s\n", wine_dbgstr_longlong(prop->u.uhVal.QuadPart));
break;
case VT_R8:
memcpy(&prop->u.dblVal, data, sizeof(double));
TRACE("Read double %f\n", prop->u.dblVal);
break;
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
case VT_LPSTR:
{
DWORD count;
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
StorageUtl_ReadDWord(data, 0, &count);
if (codepage == CP_UNICODE && count % 2)
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
{
Sync to Wine-20050524: Alexandre Julliard <julliard@winehq.org> - Added rules for building import libraries in the individual dll makefiles, and added support for building a .def.a static import library too. - Removed unnecessary code in the 16-bit DllEntryPoint function of some dlls, and also fixed its ordinal in a few places. - Comment out stub WEP entry points so that we can call WEP for builtin dlls too. Juan Lang <juan_lang@yahoo.com> - Obvious fixes to PropVariantClear and PropVariantCopy for vector types. - Add a comment, and a no-op cleanup. - Differentiate between version 0 and version 1 property storages. - Store property names in the code page of the property set. - maintain proper byte order - maintain PROPSETFLAG_ANSI flag based on codepage - update comments - Correct/improve error checking in IPropertyStorage. - convert strings between property storage's code page and system code page - add tests for setting code page - fix tests and behavior to match WinXP - Define and use endian conversion macros for big-endian machines. Marcus Meissner <marcus@jet.franken.de> - Move the Dll init function to compobj.c to avoid having global variables. Remove need of ole32_main.h. - Make HGLOBALStream_* functions static. - Make _xmalloc16() static. - Staticify FTMarshalImpl definition. Francois Gouget <fgouget@free.fr> - Specify the proper call convention in the PropSysFreeString() implementation. - Tweak the API documentation to silence winapi_check warnings. Robert Shearman <rob@codeweavers.com> - Add error messages on failure in file moniker load function. - Fix incorrect pointer check in both monikers. - Fix max size calculation of item moniker to match native. - Add a generic moniker marshaler that works by saving & loading monikers to & from the stream. - Use the generic moniker marshal in the file & item monikers and add a class factory for each. - Implement IROTData::GetComparisonData for file & item monikers. - Add a useful trace message. - Fix more places where custom header size was calculated exclusive of the data size member. - Optimize custom marshaling by getting size before calling the custom marshaler so we can write the header before and not use a second stream. - Change remaining blocks of code with 2-space indentation to 4-space indentation. - Make vtables const. - Remove an unnecessary memcpy and let the compiler do the work. - Write custom header up to and including size, not excluding. - Add a stub implementation of CoIsHandlerConnected. - Marshal objects & monikers into the ROT. - Test for this behaviour. Mike McCormack <mike@codeweavers.com> - Remove unnecessary declarations and make functions static. - Remove forward declarations. - Make sure a stream can't be created in read only storage. - Fix a memory leak in the ole storage implementation. - Remove function prototypes. Kevin Koltzau <kevin@plop.org> - Implement Hash function on composite moniker. Jeff Latimer <jeffl@defcen.gov.au> - Implement the IEnumMoniker interface for the ROT and provide tests to exercise the interface. Pierre d'Herbemont <stegefin@free.fr> - Big Endian specific code fixes in order to conform with NONAMELESSSTRUCT. Matthew Mastracci <matt@aclaro.com> - Replace stub entry for StgOpenStorageEx with call to StgOpenStorage. - Replace StgCreateStorageEx stub with call to StgCreateDocfile and add required STGFMT_* enumerations. svn path=/trunk/; revision=15562
2005-05-28 09:30:04 +00:00
WARN("Unicode string has odd number of bytes\n");
hr = STG_E_INVALIDHEADER;
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
}
else
Sync to Wine-20050524: Alexandre Julliard <julliard@winehq.org> - Added rules for building import libraries in the individual dll makefiles, and added support for building a .def.a static import library too. - Removed unnecessary code in the 16-bit DllEntryPoint function of some dlls, and also fixed its ordinal in a few places. - Comment out stub WEP entry points so that we can call WEP for builtin dlls too. Juan Lang <juan_lang@yahoo.com> - Obvious fixes to PropVariantClear and PropVariantCopy for vector types. - Add a comment, and a no-op cleanup. - Differentiate between version 0 and version 1 property storages. - Store property names in the code page of the property set. - maintain proper byte order - maintain PROPSETFLAG_ANSI flag based on codepage - update comments - Correct/improve error checking in IPropertyStorage. - convert strings between property storage's code page and system code page - add tests for setting code page - fix tests and behavior to match WinXP - Define and use endian conversion macros for big-endian machines. Marcus Meissner <marcus@jet.franken.de> - Move the Dll init function to compobj.c to avoid having global variables. Remove need of ole32_main.h. - Make HGLOBALStream_* functions static. - Make _xmalloc16() static. - Staticify FTMarshalImpl definition. Francois Gouget <fgouget@free.fr> - Specify the proper call convention in the PropSysFreeString() implementation. - Tweak the API documentation to silence winapi_check warnings. Robert Shearman <rob@codeweavers.com> - Add error messages on failure in file moniker load function. - Fix incorrect pointer check in both monikers. - Fix max size calculation of item moniker to match native. - Add a generic moniker marshaler that works by saving & loading monikers to & from the stream. - Use the generic moniker marshal in the file & item monikers and add a class factory for each. - Implement IROTData::GetComparisonData for file & item monikers. - Add a useful trace message. - Fix more places where custom header size was calculated exclusive of the data size member. - Optimize custom marshaling by getting size before calling the custom marshaler so we can write the header before and not use a second stream. - Change remaining blocks of code with 2-space indentation to 4-space indentation. - Make vtables const. - Remove an unnecessary memcpy and let the compiler do the work. - Write custom header up to and including size, not excluding. - Add a stub implementation of CoIsHandlerConnected. - Marshal objects & monikers into the ROT. - Test for this behaviour. Mike McCormack <mike@codeweavers.com> - Remove unnecessary declarations and make functions static. - Remove forward declarations. - Make sure a stream can't be created in read only storage. - Fix a memory leak in the ole storage implementation. - Remove function prototypes. Kevin Koltzau <kevin@plop.org> - Implement Hash function on composite moniker. Jeff Latimer <jeffl@defcen.gov.au> - Implement the IEnumMoniker interface for the ROT and provide tests to exercise the interface. Pierre d'Herbemont <stegefin@free.fr> - Big Endian specific code fixes in order to conform with NONAMELESSSTRUCT. Matthew Mastracci <matt@aclaro.com> - Replace stub entry for StgOpenStorageEx with call to StgOpenStorage. - Replace StgCreateStorageEx stub with call to StgCreateDocfile and add required STGFMT_* enumerations. svn path=/trunk/; revision=15562
2005-05-28 09:30:04 +00:00
{
prop->u.pszVal = allocate(allocate_data, count);
Sync to Wine-20050524: Alexandre Julliard <julliard@winehq.org> - Added rules for building import libraries in the individual dll makefiles, and added support for building a .def.a static import library too. - Removed unnecessary code in the 16-bit DllEntryPoint function of some dlls, and also fixed its ordinal in a few places. - Comment out stub WEP entry points so that we can call WEP for builtin dlls too. Juan Lang <juan_lang@yahoo.com> - Obvious fixes to PropVariantClear and PropVariantCopy for vector types. - Add a comment, and a no-op cleanup. - Differentiate between version 0 and version 1 property storages. - Store property names in the code page of the property set. - maintain proper byte order - maintain PROPSETFLAG_ANSI flag based on codepage - update comments - Correct/improve error checking in IPropertyStorage. - convert strings between property storage's code page and system code page - add tests for setting code page - fix tests and behavior to match WinXP - Define and use endian conversion macros for big-endian machines. Marcus Meissner <marcus@jet.franken.de> - Move the Dll init function to compobj.c to avoid having global variables. Remove need of ole32_main.h. - Make HGLOBALStream_* functions static. - Make _xmalloc16() static. - Staticify FTMarshalImpl definition. Francois Gouget <fgouget@free.fr> - Specify the proper call convention in the PropSysFreeString() implementation. - Tweak the API documentation to silence winapi_check warnings. Robert Shearman <rob@codeweavers.com> - Add error messages on failure in file moniker load function. - Fix incorrect pointer check in both monikers. - Fix max size calculation of item moniker to match native. - Add a generic moniker marshaler that works by saving & loading monikers to & from the stream. - Use the generic moniker marshal in the file & item monikers and add a class factory for each. - Implement IROTData::GetComparisonData for file & item monikers. - Add a useful trace message. - Fix more places where custom header size was calculated exclusive of the data size member. - Optimize custom marshaling by getting size before calling the custom marshaler so we can write the header before and not use a second stream. - Change remaining blocks of code with 2-space indentation to 4-space indentation. - Make vtables const. - Remove an unnecessary memcpy and let the compiler do the work. - Write custom header up to and including size, not excluding. - Add a stub implementation of CoIsHandlerConnected. - Marshal objects & monikers into the ROT. - Test for this behaviour. Mike McCormack <mike@codeweavers.com> - Remove unnecessary declarations and make functions static. - Remove forward declarations. - Make sure a stream can't be created in read only storage. - Fix a memory leak in the ole storage implementation. - Remove function prototypes. Kevin Koltzau <kevin@plop.org> - Implement Hash function on composite moniker. Jeff Latimer <jeffl@defcen.gov.au> - Implement the IEnumMoniker interface for the ROT and provide tests to exercise the interface. Pierre d'Herbemont <stegefin@free.fr> - Big Endian specific code fixes in order to conform with NONAMELESSSTRUCT. Matthew Mastracci <matt@aclaro.com> - Replace stub entry for StgOpenStorageEx with call to StgOpenStorage. - Replace StgCreateStorageEx stub with call to StgCreateDocfile and add required STGFMT_* enumerations. svn path=/trunk/; revision=15562
2005-05-28 09:30:04 +00:00
if (prop->u.pszVal)
{
memcpy(prop->u.pszVal, data + sizeof(DWORD), count);
/* This is stored in the code page specified in codepage.
Sync to Wine-20050524: Alexandre Julliard <julliard@winehq.org> - Added rules for building import libraries in the individual dll makefiles, and added support for building a .def.a static import library too. - Removed unnecessary code in the 16-bit DllEntryPoint function of some dlls, and also fixed its ordinal in a few places. - Comment out stub WEP entry points so that we can call WEP for builtin dlls too. Juan Lang <juan_lang@yahoo.com> - Obvious fixes to PropVariantClear and PropVariantCopy for vector types. - Add a comment, and a no-op cleanup. - Differentiate between version 0 and version 1 property storages. - Store property names in the code page of the property set. - maintain proper byte order - maintain PROPSETFLAG_ANSI flag based on codepage - update comments - Correct/improve error checking in IPropertyStorage. - convert strings between property storage's code page and system code page - add tests for setting code page - fix tests and behavior to match WinXP - Define and use endian conversion macros for big-endian machines. Marcus Meissner <marcus@jet.franken.de> - Move the Dll init function to compobj.c to avoid having global variables. Remove need of ole32_main.h. - Make HGLOBALStream_* functions static. - Make _xmalloc16() static. - Staticify FTMarshalImpl definition. Francois Gouget <fgouget@free.fr> - Specify the proper call convention in the PropSysFreeString() implementation. - Tweak the API documentation to silence winapi_check warnings. Robert Shearman <rob@codeweavers.com> - Add error messages on failure in file moniker load function. - Fix incorrect pointer check in both monikers. - Fix max size calculation of item moniker to match native. - Add a generic moniker marshaler that works by saving & loading monikers to & from the stream. - Use the generic moniker marshal in the file & item monikers and add a class factory for each. - Implement IROTData::GetComparisonData for file & item monikers. - Add a useful trace message. - Fix more places where custom header size was calculated exclusive of the data size member. - Optimize custom marshaling by getting size before calling the custom marshaler so we can write the header before and not use a second stream. - Change remaining blocks of code with 2-space indentation to 4-space indentation. - Make vtables const. - Remove an unnecessary memcpy and let the compiler do the work. - Write custom header up to and including size, not excluding. - Add a stub implementation of CoIsHandlerConnected. - Marshal objects & monikers into the ROT. - Test for this behaviour. Mike McCormack <mike@codeweavers.com> - Remove unnecessary declarations and make functions static. - Remove forward declarations. - Make sure a stream can't be created in read only storage. - Fix a memory leak in the ole storage implementation. - Remove function prototypes. Kevin Koltzau <kevin@plop.org> - Implement Hash function on composite moniker. Jeff Latimer <jeffl@defcen.gov.au> - Implement the IEnumMoniker interface for the ROT and provide tests to exercise the interface. Pierre d'Herbemont <stegefin@free.fr> - Big Endian specific code fixes in order to conform with NONAMELESSSTRUCT. Matthew Mastracci <matt@aclaro.com> - Replace stub entry for StgOpenStorageEx with call to StgOpenStorage. - Replace StgCreateStorageEx stub with call to StgCreateDocfile and add required STGFMT_* enumerations. svn path=/trunk/; revision=15562
2005-05-28 09:30:04 +00:00
* Don't convert it, the caller will just store it as-is.
*/
if (codepage == CP_UNICODE)
Sync to Wine-20050524: Alexandre Julliard <julliard@winehq.org> - Added rules for building import libraries in the individual dll makefiles, and added support for building a .def.a static import library too. - Removed unnecessary code in the 16-bit DllEntryPoint function of some dlls, and also fixed its ordinal in a few places. - Comment out stub WEP entry points so that we can call WEP for builtin dlls too. Juan Lang <juan_lang@yahoo.com> - Obvious fixes to PropVariantClear and PropVariantCopy for vector types. - Add a comment, and a no-op cleanup. - Differentiate between version 0 and version 1 property storages. - Store property names in the code page of the property set. - maintain proper byte order - maintain PROPSETFLAG_ANSI flag based on codepage - update comments - Correct/improve error checking in IPropertyStorage. - convert strings between property storage's code page and system code page - add tests for setting code page - fix tests and behavior to match WinXP - Define and use endian conversion macros for big-endian machines. Marcus Meissner <marcus@jet.franken.de> - Move the Dll init function to compobj.c to avoid having global variables. Remove need of ole32_main.h. - Make HGLOBALStream_* functions static. - Make _xmalloc16() static. - Staticify FTMarshalImpl definition. Francois Gouget <fgouget@free.fr> - Specify the proper call convention in the PropSysFreeString() implementation. - Tweak the API documentation to silence winapi_check warnings. Robert Shearman <rob@codeweavers.com> - Add error messages on failure in file moniker load function. - Fix incorrect pointer check in both monikers. - Fix max size calculation of item moniker to match native. - Add a generic moniker marshaler that works by saving & loading monikers to & from the stream. - Use the generic moniker marshal in the file & item monikers and add a class factory for each. - Implement IROTData::GetComparisonData for file & item monikers. - Add a useful trace message. - Fix more places where custom header size was calculated exclusive of the data size member. - Optimize custom marshaling by getting size before calling the custom marshaler so we can write the header before and not use a second stream. - Change remaining blocks of code with 2-space indentation to 4-space indentation. - Make vtables const. - Remove an unnecessary memcpy and let the compiler do the work. - Write custom header up to and including size, not excluding. - Add a stub implementation of CoIsHandlerConnected. - Marshal objects & monikers into the ROT. - Test for this behaviour. Mike McCormack <mike@codeweavers.com> - Remove unnecessary declarations and make functions static. - Remove forward declarations. - Make sure a stream can't be created in read only storage. - Fix a memory leak in the ole storage implementation. - Remove function prototypes. Kevin Koltzau <kevin@plop.org> - Implement Hash function on composite moniker. Jeff Latimer <jeffl@defcen.gov.au> - Implement the IEnumMoniker interface for the ROT and provide tests to exercise the interface. Pierre d'Herbemont <stegefin@free.fr> - Big Endian specific code fixes in order to conform with NONAMELESSSTRUCT. Matthew Mastracci <matt@aclaro.com> - Replace stub entry for StgOpenStorageEx with call to StgOpenStorage. - Replace StgCreateStorageEx stub with call to StgCreateDocfile and add required STGFMT_* enumerations. svn path=/trunk/; revision=15562
2005-05-28 09:30:04 +00:00
{
/* Make sure it's NULL-terminated */
prop->u.pszVal[count / sizeof(WCHAR) - 1] = '\0';
TRACE("Read string value %s\n",
debugstr_w(prop->u.pwszVal));
}
else
{
/* Make sure it's NULL-terminated */
prop->u.pszVal[count - 1] = '\0';
TRACE("Read string value %s\n", debugstr_a(prop->u.pszVal));
}
}
else
hr = STG_E_INSUFFICIENTMEMORY;
}
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
break;
}
case VT_BSTR:
{
DWORD count, wcount;
StorageUtl_ReadDWord(data, 0, &count);
if (codepage == CP_UNICODE && count % 2)
{
WARN("Unicode string has odd number of bytes\n");
hr = STG_E_INVALIDHEADER;
}
else
{
if (codepage == CP_UNICODE)
wcount = count / 2;
else
wcount = MultiByteToWideChar(codepage, 0, (LPCSTR)(data + sizeof(DWORD)), count, NULL, 0);
prop->u.bstrVal = SysAllocStringLen(NULL, wcount); /* FIXME: use allocator? */
if (prop->u.bstrVal)
{
if (codepage == CP_UNICODE)
memcpy(prop->u.bstrVal, data + sizeof(DWORD), count);
else
MultiByteToWideChar(codepage, 0, (LPCSTR)(data + sizeof(DWORD)), count, prop->u.bstrVal, wcount);
prop->u.bstrVal[wcount - 1] = '\0';
TRACE("Read string value %s\n", debugstr_w(prop->u.bstrVal));
}
else
hr = STG_E_INSUFFICIENTMEMORY;
}
break;
}
case VT_BLOB:
{
DWORD count;
StorageUtl_ReadDWord(data, 0, &count);
prop->u.blob.cbSize = count;
prop->u.blob.pBlobData = allocate(allocate_data, count);
if (prop->u.blob.pBlobData)
{
memcpy(prop->u.blob.pBlobData, data + sizeof(DWORD), count);
TRACE("Read blob value of size %d\n", count);
}
else
hr = STG_E_INSUFFICIENTMEMORY;
break;
}
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
case VT_LPWSTR:
{
DWORD count;
StorageUtl_ReadDWord(data, 0, &count);
prop->u.pwszVal = allocate(allocate_data, count * sizeof(WCHAR));
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
if (prop->u.pwszVal)
{
memcpy(prop->u.pwszVal, data + sizeof(DWORD),
count * sizeof(WCHAR));
Sync to Wine-20050524: Alexandre Julliard <julliard@winehq.org> - Added rules for building import libraries in the individual dll makefiles, and added support for building a .def.a static import library too. - Removed unnecessary code in the 16-bit DllEntryPoint function of some dlls, and also fixed its ordinal in a few places. - Comment out stub WEP entry points so that we can call WEP for builtin dlls too. Juan Lang <juan_lang@yahoo.com> - Obvious fixes to PropVariantClear and PropVariantCopy for vector types. - Add a comment, and a no-op cleanup. - Differentiate between version 0 and version 1 property storages. - Store property names in the code page of the property set. - maintain proper byte order - maintain PROPSETFLAG_ANSI flag based on codepage - update comments - Correct/improve error checking in IPropertyStorage. - convert strings between property storage's code page and system code page - add tests for setting code page - fix tests and behavior to match WinXP - Define and use endian conversion macros for big-endian machines. Marcus Meissner <marcus@jet.franken.de> - Move the Dll init function to compobj.c to avoid having global variables. Remove need of ole32_main.h. - Make HGLOBALStream_* functions static. - Make _xmalloc16() static. - Staticify FTMarshalImpl definition. Francois Gouget <fgouget@free.fr> - Specify the proper call convention in the PropSysFreeString() implementation. - Tweak the API documentation to silence winapi_check warnings. Robert Shearman <rob@codeweavers.com> - Add error messages on failure in file moniker load function. - Fix incorrect pointer check in both monikers. - Fix max size calculation of item moniker to match native. - Add a generic moniker marshaler that works by saving & loading monikers to & from the stream. - Use the generic moniker marshal in the file & item monikers and add a class factory for each. - Implement IROTData::GetComparisonData for file & item monikers. - Add a useful trace message. - Fix more places where custom header size was calculated exclusive of the data size member. - Optimize custom marshaling by getting size before calling the custom marshaler so we can write the header before and not use a second stream. - Change remaining blocks of code with 2-space indentation to 4-space indentation. - Make vtables const. - Remove an unnecessary memcpy and let the compiler do the work. - Write custom header up to and including size, not excluding. - Add a stub implementation of CoIsHandlerConnected. - Marshal objects & monikers into the ROT. - Test for this behaviour. Mike McCormack <mike@codeweavers.com> - Remove unnecessary declarations and make functions static. - Remove forward declarations. - Make sure a stream can't be created in read only storage. - Fix a memory leak in the ole storage implementation. - Remove function prototypes. Kevin Koltzau <kevin@plop.org> - Implement Hash function on composite moniker. Jeff Latimer <jeffl@defcen.gov.au> - Implement the IEnumMoniker interface for the ROT and provide tests to exercise the interface. Pierre d'Herbemont <stegefin@free.fr> - Big Endian specific code fixes in order to conform with NONAMELESSSTRUCT. Matthew Mastracci <matt@aclaro.com> - Replace stub entry for StgOpenStorageEx with call to StgOpenStorage. - Replace StgCreateStorageEx stub with call to StgCreateDocfile and add required STGFMT_* enumerations. svn path=/trunk/; revision=15562
2005-05-28 09:30:04 +00:00
/* make sure string is NULL-terminated */
prop->u.pwszVal[count - 1] = '\0';
PropertyStorage_ByteSwapString(prop->u.pwszVal, count);
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
TRACE("Read string value %s\n", debugstr_w(prop->u.pwszVal));
}
else
hr = STG_E_INSUFFICIENTMEMORY;
break;
}
case VT_FILETIME:
Sync to Wine-20050524: Alexandre Julliard <julliard@winehq.org> - Added rules for building import libraries in the individual dll makefiles, and added support for building a .def.a static import library too. - Removed unnecessary code in the 16-bit DllEntryPoint function of some dlls, and also fixed its ordinal in a few places. - Comment out stub WEP entry points so that we can call WEP for builtin dlls too. Juan Lang <juan_lang@yahoo.com> - Obvious fixes to PropVariantClear and PropVariantCopy for vector types. - Add a comment, and a no-op cleanup. - Differentiate between version 0 and version 1 property storages. - Store property names in the code page of the property set. - maintain proper byte order - maintain PROPSETFLAG_ANSI flag based on codepage - update comments - Correct/improve error checking in IPropertyStorage. - convert strings between property storage's code page and system code page - add tests for setting code page - fix tests and behavior to match WinXP - Define and use endian conversion macros for big-endian machines. Marcus Meissner <marcus@jet.franken.de> - Move the Dll init function to compobj.c to avoid having global variables. Remove need of ole32_main.h. - Make HGLOBALStream_* functions static. - Make _xmalloc16() static. - Staticify FTMarshalImpl definition. Francois Gouget <fgouget@free.fr> - Specify the proper call convention in the PropSysFreeString() implementation. - Tweak the API documentation to silence winapi_check warnings. Robert Shearman <rob@codeweavers.com> - Add error messages on failure in file moniker load function. - Fix incorrect pointer check in both monikers. - Fix max size calculation of item moniker to match native. - Add a generic moniker marshaler that works by saving & loading monikers to & from the stream. - Use the generic moniker marshal in the file & item monikers and add a class factory for each. - Implement IROTData::GetComparisonData for file & item monikers. - Add a useful trace message. - Fix more places where custom header size was calculated exclusive of the data size member. - Optimize custom marshaling by getting size before calling the custom marshaler so we can write the header before and not use a second stream. - Change remaining blocks of code with 2-space indentation to 4-space indentation. - Make vtables const. - Remove an unnecessary memcpy and let the compiler do the work. - Write custom header up to and including size, not excluding. - Add a stub implementation of CoIsHandlerConnected. - Marshal objects & monikers into the ROT. - Test for this behaviour. Mike McCormack <mike@codeweavers.com> - Remove unnecessary declarations and make functions static. - Remove forward declarations. - Make sure a stream can't be created in read only storage. - Fix a memory leak in the ole storage implementation. - Remove function prototypes. Kevin Koltzau <kevin@plop.org> - Implement Hash function on composite moniker. Jeff Latimer <jeffl@defcen.gov.au> - Implement the IEnumMoniker interface for the ROT and provide tests to exercise the interface. Pierre d'Herbemont <stegefin@free.fr> - Big Endian specific code fixes in order to conform with NONAMELESSSTRUCT. Matthew Mastracci <matt@aclaro.com> - Replace stub entry for StgOpenStorageEx with call to StgOpenStorage. - Replace StgCreateStorageEx stub with call to StgCreateDocfile and add required STGFMT_* enumerations. svn path=/trunk/; revision=15562
2005-05-28 09:30:04 +00:00
StorageUtl_ReadULargeInteger(data, 0,
(ULARGE_INTEGER *)&prop->u.filetime);
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
break;
case VT_CF:
{
DWORD len = 0, tag = 0;
StorageUtl_ReadDWord(data, 0, &len);
StorageUtl_ReadDWord(data, 4, &tag);
if (len > 8)
{
len -= 8;
prop->u.pclipdata = allocate(allocate_data, sizeof (CLIPDATA));
prop->u.pclipdata->cbSize = len;
prop->u.pclipdata->ulClipFmt = tag;
prop->u.pclipdata->pClipData = allocate(allocate_data, len - sizeof(prop->u.pclipdata->ulClipFmt));
memcpy(prop->u.pclipdata->pClipData, data+8, len - sizeof(prop->u.pclipdata->ulClipFmt));
}
else
hr = STG_E_INVALIDPARAMETER;
}
break;
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
default:
FIXME("unsupported type %d\n", prop->vt);
hr = STG_E_INVALIDPARAMETER;
}
return hr;
}
Sync to Wine-20050310: Jon Griffiths <jon_p_griffiths@yahoo.com> - Documentation spelling fixes. Mike McCormack <mike@codeweavers.com> - Implement and test IPropertySetStorage. - Fix more incorrect uses of STGM_ enumerations. - Add struct StorageBaseImpl at the start of derived structures instead of trying to keep the first members the same. - StgOpenStorage shouldn't open zero length storage files. - Shared reading of storage files requires STGM_TRANSACTED. - Test and fix grfMode handling in StgOpenDocfile. - Implement StgSetTimes. Robert Shearman <rob@codeweavers.com> - Better tracing. - Small cleanup of creation functions. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. - Move marshaling state machine into stub manager from ifstub. - Add additional needed states for table-weak marshaling, as shown by tests. - Protect external reference count from underflows/overflows. - Make COM use the RPC runtime as the backend for RPC calls. Based on a patch by Ove Ksven. - Invoke objects in STA's in the correct thread by sending messages to the hidden apartment window. - Use I_RpcGetBuffer, instead of our own buffer routines to fix an occasional test crash caused by heap corruption. - Zero the memory block passed to RpcServerRegisterIfEx so we don't pass garbage in some of the fields we don't fill in. - Return the correct error code from create_server and fix two handle leaks. - TODO update. - Remove cruft left over from previous RPC backend implementation in the apartment structure. - Don't pass an IPID by value for proxy_manager_create_ifproxy. - Disable more of RPC_UnregisterInterface to prevent the RPC runtime using freed memory. - Rename various external RPC backend functions so that they all have the same "RPC_" prefix. - Reduce the timeout of the function that connects to a local server to 30s, like native. - Make each ifproxy have its own channel buffer to fix a bug where a proxy with multiple interfaces could invoke the wrong stub buffer on the server. - The Global Interface Table should do table-strong marshaling instead of normal marshaling so that an interface can be retrieved more than one time. Mike Hearn <mh@codeweavers.com> - Avoid infinite loop when doing a typelib marshalled IUnknown::QueryInterface by only doing an extra QI if requested IID is not equal to marshalled IID. Rob Shearman <rob@codeweavers.com> Mike Hearn <mh@codeweavers.com> - Add re-entrancy tests to the test suite. - Run RPCs on a new thread client side so we can pump the message loop. Juan Lang <juan_lang@yahoo.com> - Fix the calling convention of DllCanUnloadNow. - Move vtbl to end of file and get rid of unnecessary prototypes. - Implement StgCreatePropSetStg. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Paul Vriens <Paul.Vriens@xs4all.nl> - Added some TRACE statements. svn path=/trunk/; revision=14083
2005-03-14 23:17:44 +00:00
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
static HRESULT PropertyStorage_ReadHeaderFromStream(IStream *stm,
PROPERTYSETHEADER *hdr)
{
BYTE buf[sizeof(PROPERTYSETHEADER)];
ULONG count = 0;
HRESULT hr;
assert(stm);
assert(hdr);
hr = IStream_Read(stm, buf, sizeof(buf), &count);
if (SUCCEEDED(hr))
{
if (count != sizeof(buf))
{
WARN("read only %d\n", count);
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
hr = STG_E_INVALIDHEADER;
}
else
{
StorageUtl_ReadWord(buf, offsetof(PROPERTYSETHEADER, wByteOrder),
&hdr->wByteOrder);
StorageUtl_ReadWord(buf, offsetof(PROPERTYSETHEADER, wFormat),
&hdr->wFormat);
StorageUtl_ReadDWord(buf, offsetof(PROPERTYSETHEADER, dwOSVer),
&hdr->dwOSVer);
StorageUtl_ReadGUID(buf, offsetof(PROPERTYSETHEADER, clsid),
&hdr->clsid);
StorageUtl_ReadDWord(buf, offsetof(PROPERTYSETHEADER, reserved),
&hdr->reserved);
}
}
TRACE("returning 0x%08x\n", hr);
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
return hr;
}
Sync to Wine-20050310: Jon Griffiths <jon_p_griffiths@yahoo.com> - Documentation spelling fixes. Mike McCormack <mike@codeweavers.com> - Implement and test IPropertySetStorage. - Fix more incorrect uses of STGM_ enumerations. - Add struct StorageBaseImpl at the start of derived structures instead of trying to keep the first members the same. - StgOpenStorage shouldn't open zero length storage files. - Shared reading of storage files requires STGM_TRANSACTED. - Test and fix grfMode handling in StgOpenDocfile. - Implement StgSetTimes. Robert Shearman <rob@codeweavers.com> - Better tracing. - Small cleanup of creation functions. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. - Move marshaling state machine into stub manager from ifstub. - Add additional needed states for table-weak marshaling, as shown by tests. - Protect external reference count from underflows/overflows. - Make COM use the RPC runtime as the backend for RPC calls. Based on a patch by Ove Ksven. - Invoke objects in STA's in the correct thread by sending messages to the hidden apartment window. - Use I_RpcGetBuffer, instead of our own buffer routines to fix an occasional test crash caused by heap corruption. - Zero the memory block passed to RpcServerRegisterIfEx so we don't pass garbage in some of the fields we don't fill in. - Return the correct error code from create_server and fix two handle leaks. - TODO update. - Remove cruft left over from previous RPC backend implementation in the apartment structure. - Don't pass an IPID by value for proxy_manager_create_ifproxy. - Disable more of RPC_UnregisterInterface to prevent the RPC runtime using freed memory. - Rename various external RPC backend functions so that they all have the same "RPC_" prefix. - Reduce the timeout of the function that connects to a local server to 30s, like native. - Make each ifproxy have its own channel buffer to fix a bug where a proxy with multiple interfaces could invoke the wrong stub buffer on the server. - The Global Interface Table should do table-strong marshaling instead of normal marshaling so that an interface can be retrieved more than one time. Mike Hearn <mh@codeweavers.com> - Avoid infinite loop when doing a typelib marshalled IUnknown::QueryInterface by only doing an extra QI if requested IID is not equal to marshalled IID. Rob Shearman <rob@codeweavers.com> Mike Hearn <mh@codeweavers.com> - Add re-entrancy tests to the test suite. - Run RPCs on a new thread client side so we can pump the message loop. Juan Lang <juan_lang@yahoo.com> - Fix the calling convention of DllCanUnloadNow. - Move vtbl to end of file and get rid of unnecessary prototypes. - Implement StgCreatePropSetStg. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Paul Vriens <Paul.Vriens@xs4all.nl> - Added some TRACE statements. svn path=/trunk/; revision=14083
2005-03-14 23:17:44 +00:00
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
static HRESULT PropertyStorage_ReadFmtIdOffsetFromStream(IStream *stm,
FORMATIDOFFSET *fmt)
{
BYTE buf[sizeof(FORMATIDOFFSET)];
ULONG count = 0;
HRESULT hr;
assert(stm);
assert(fmt);
hr = IStream_Read(stm, buf, sizeof(buf), &count);
if (SUCCEEDED(hr))
{
if (count != sizeof(buf))
{
WARN("read only %d\n", count);
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
hr = STG_E_INVALIDHEADER;
}
else
{
StorageUtl_ReadGUID(buf, offsetof(FORMATIDOFFSET, fmtid),
&fmt->fmtid);
StorageUtl_ReadDWord(buf, offsetof(FORMATIDOFFSET, dwOffset),
&fmt->dwOffset);
}
}
TRACE("returning 0x%08x\n", hr);
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
return hr;
}
static HRESULT PropertyStorage_ReadSectionHeaderFromStream(IStream *stm,
PROPERTYSECTIONHEADER *hdr)
{
BYTE buf[sizeof(PROPERTYSECTIONHEADER)];
ULONG count = 0;
HRESULT hr;
assert(stm);
assert(hdr);
hr = IStream_Read(stm, buf, sizeof(buf), &count);
if (SUCCEEDED(hr))
{
if (count != sizeof(buf))
{
WARN("read only %d\n", count);
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
hr = STG_E_INVALIDHEADER;
}
else
{
StorageUtl_ReadDWord(buf, offsetof(PROPERTYSECTIONHEADER,
cbSection), &hdr->cbSection);
StorageUtl_ReadDWord(buf, offsetof(PROPERTYSECTIONHEADER,
cProperties), &hdr->cProperties);
}
}
TRACE("returning 0x%08x\n", hr);
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
return hr;
}
static HRESULT PropertyStorage_ReadFromStream(PropertyStorage_impl *This)
{
PROPERTYSETHEADER hdr;
FORMATIDOFFSET fmtOffset;
PROPERTYSECTIONHEADER sectionHdr;
LARGE_INTEGER seek;
ULONG i;
STATSTG stat;
HRESULT hr;
BYTE *buf = NULL;
ULONG count = 0;
DWORD dictOffset = 0;
This->dirty = FALSE;
This->highestProp = 0;
hr = IStream_Stat(This->stm, &stat, STATFLAG_NONAME);
if (FAILED(hr))
goto end;
if (stat.cbSize.u.HighPart)
{
WARN("stream too big\n");
/* maximum size varies, but it can't be this big */
hr = STG_E_INVALIDHEADER;
goto end;
}
if (stat.cbSize.u.LowPart == 0)
{
/* empty stream is okay */
hr = S_OK;
goto end;
}
else if (stat.cbSize.u.LowPart < sizeof(PROPERTYSETHEADER) +
sizeof(FORMATIDOFFSET))
{
WARN("stream too small\n");
hr = STG_E_INVALIDHEADER;
goto end;
}
seek.QuadPart = 0;
hr = IStream_Seek(This->stm, seek, STREAM_SEEK_SET, NULL);
if (FAILED(hr))
goto end;
hr = PropertyStorage_ReadHeaderFromStream(This->stm, &hdr);
/* I've only seen reserved == 1, but the article says I shouldn't disallow
* higher values.
*/
if (hdr.wByteOrder != PROPSETHDR_BYTEORDER_MAGIC || hdr.reserved < 1)
{
WARN("bad magic in prop set header\n");
hr = STG_E_INVALIDHEADER;
goto end;
}
if (hdr.wFormat != 0 && hdr.wFormat != 1)
{
WARN("bad format version %d\n", hdr.wFormat);
hr = STG_E_INVALIDHEADER;
goto end;
}
Sync to Wine-20050524: Alexandre Julliard <julliard@winehq.org> - Added rules for building import libraries in the individual dll makefiles, and added support for building a .def.a static import library too. - Removed unnecessary code in the 16-bit DllEntryPoint function of some dlls, and also fixed its ordinal in a few places. - Comment out stub WEP entry points so that we can call WEP for builtin dlls too. Juan Lang <juan_lang@yahoo.com> - Obvious fixes to PropVariantClear and PropVariantCopy for vector types. - Add a comment, and a no-op cleanup. - Differentiate between version 0 and version 1 property storages. - Store property names in the code page of the property set. - maintain proper byte order - maintain PROPSETFLAG_ANSI flag based on codepage - update comments - Correct/improve error checking in IPropertyStorage. - convert strings between property storage's code page and system code page - add tests for setting code page - fix tests and behavior to match WinXP - Define and use endian conversion macros for big-endian machines. Marcus Meissner <marcus@jet.franken.de> - Move the Dll init function to compobj.c to avoid having global variables. Remove need of ole32_main.h. - Make HGLOBALStream_* functions static. - Make _xmalloc16() static. - Staticify FTMarshalImpl definition. Francois Gouget <fgouget@free.fr> - Specify the proper call convention in the PropSysFreeString() implementation. - Tweak the API documentation to silence winapi_check warnings. Robert Shearman <rob@codeweavers.com> - Add error messages on failure in file moniker load function. - Fix incorrect pointer check in both monikers. - Fix max size calculation of item moniker to match native. - Add a generic moniker marshaler that works by saving & loading monikers to & from the stream. - Use the generic moniker marshal in the file & item monikers and add a class factory for each. - Implement IROTData::GetComparisonData for file & item monikers. - Add a useful trace message. - Fix more places where custom header size was calculated exclusive of the data size member. - Optimize custom marshaling by getting size before calling the custom marshaler so we can write the header before and not use a second stream. - Change remaining blocks of code with 2-space indentation to 4-space indentation. - Make vtables const. - Remove an unnecessary memcpy and let the compiler do the work. - Write custom header up to and including size, not excluding. - Add a stub implementation of CoIsHandlerConnected. - Marshal objects & monikers into the ROT. - Test for this behaviour. Mike McCormack <mike@codeweavers.com> - Remove unnecessary declarations and make functions static. - Remove forward declarations. - Make sure a stream can't be created in read only storage. - Fix a memory leak in the ole storage implementation. - Remove function prototypes. Kevin Koltzau <kevin@plop.org> - Implement Hash function on composite moniker. Jeff Latimer <jeffl@defcen.gov.au> - Implement the IEnumMoniker interface for the ROT and provide tests to exercise the interface. Pierre d'Herbemont <stegefin@free.fr> - Big Endian specific code fixes in order to conform with NONAMELESSSTRUCT. Matthew Mastracci <matt@aclaro.com> - Replace stub entry for StgOpenStorageEx with call to StgOpenStorage. - Replace StgCreateStorageEx stub with call to StgCreateDocfile and add required STGFMT_* enumerations. svn path=/trunk/; revision=15562
2005-05-28 09:30:04 +00:00
This->format = hdr.wFormat;
This->clsid = hdr.clsid;
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
This->originatorOS = hdr.dwOSVer;
if (PROPSETHDR_OSVER_KIND(hdr.dwOSVer) == PROPSETHDR_OSVER_KIND_MAC)
WARN("File comes from a Mac, strings will probably be screwed up\n");
hr = PropertyStorage_ReadFmtIdOffsetFromStream(This->stm, &fmtOffset);
if (FAILED(hr))
goto end;
if (fmtOffset.dwOffset > stat.cbSize.u.LowPart)
{
WARN("invalid offset %d (stream length is %d)\n", fmtOffset.dwOffset,
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
stat.cbSize.u.LowPart);
hr = STG_E_INVALIDHEADER;
goto end;
}
/* wackiness alert: if the format ID is FMTID_DocSummaryInformation, there
* follows not one, but two sections. The first contains the standard properties
* for the document summary information, and the second consists of user-defined
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
* properties. This is the only case in which multiple sections are
* allowed.
* Reading the second stream isn't implemented yet.
*/
hr = PropertyStorage_ReadSectionHeaderFromStream(This->stm, &sectionHdr);
if (FAILED(hr))
goto end;
/* The section size includes the section header, so check it */
if (sectionHdr.cbSection < sizeof(PROPERTYSECTIONHEADER))
{
WARN("section header too small, got %d\n", sectionHdr.cbSection);
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
hr = STG_E_INVALIDHEADER;
goto end;
}
buf = HeapAlloc(GetProcessHeap(), 0, sectionHdr.cbSection -
sizeof(PROPERTYSECTIONHEADER));
if (!buf)
{
hr = STG_E_INSUFFICIENTMEMORY;
goto end;
}
hr = IStream_Read(This->stm, buf, sectionHdr.cbSection -
sizeof(PROPERTYSECTIONHEADER), &count);
if (FAILED(hr))
goto end;
TRACE("Reading %d properties:\n", sectionHdr.cProperties);
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
for (i = 0; SUCCEEDED(hr) && i < sectionHdr.cProperties; i++)
{
PROPERTYIDOFFSET *idOffset = (PROPERTYIDOFFSET *)(buf +
i * sizeof(PROPERTYIDOFFSET));
if (idOffset->dwOffset < sizeof(PROPERTYSECTIONHEADER) ||
idOffset->dwOffset > sectionHdr.cbSection - sizeof(DWORD))
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
hr = STG_E_INVALIDPOINTER;
else
{
if (idOffset->propid >= PID_FIRST_USABLE &&
idOffset->propid < PID_MIN_READONLY && idOffset->propid >
This->highestProp)
This->highestProp = idOffset->propid;
if (idOffset->propid == PID_DICTIONARY)
{
/* Don't read the dictionary yet, its entries depend on the
* code page. Just store the offset so we know to read it
* later.
*/
dictOffset = idOffset->dwOffset;
TRACE("Dictionary offset is %d\n", dictOffset);
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
}
else
{
PROPVARIANT prop;
PropVariantInit(&prop);
if (SUCCEEDED(PropertyStorage_ReadProperty(&prop,
buf + idOffset->dwOffset - sizeof(PROPERTYSECTIONHEADER),
This->codePage, Allocate_CoTaskMemAlloc, NULL)))
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
{
TRACE("Read property with ID 0x%08x, type %d\n",
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
idOffset->propid, prop.vt);
switch(idOffset->propid)
{
case PID_CODEPAGE:
if (prop.vt == VT_I2)
This->codePage = (UINT)prop.u.iVal;
break;
case PID_LOCALE:
if (prop.vt == VT_I4)
This->locale = (LCID)prop.u.lVal;
break;
case PID_BEHAVIOR:
if (prop.vt == VT_I4 && prop.u.lVal)
This->grfFlags |= PROPSETFLAG_CASE_SENSITIVE;
Sync to Wine-20050524: Alexandre Julliard <julliard@winehq.org> - Added rules for building import libraries in the individual dll makefiles, and added support for building a .def.a static import library too. - Removed unnecessary code in the 16-bit DllEntryPoint function of some dlls, and also fixed its ordinal in a few places. - Comment out stub WEP entry points so that we can call WEP for builtin dlls too. Juan Lang <juan_lang@yahoo.com> - Obvious fixes to PropVariantClear and PropVariantCopy for vector types. - Add a comment, and a no-op cleanup. - Differentiate between version 0 and version 1 property storages. - Store property names in the code page of the property set. - maintain proper byte order - maintain PROPSETFLAG_ANSI flag based on codepage - update comments - Correct/improve error checking in IPropertyStorage. - convert strings between property storage's code page and system code page - add tests for setting code page - fix tests and behavior to match WinXP - Define and use endian conversion macros for big-endian machines. Marcus Meissner <marcus@jet.franken.de> - Move the Dll init function to compobj.c to avoid having global variables. Remove need of ole32_main.h. - Make HGLOBALStream_* functions static. - Make _xmalloc16() static. - Staticify FTMarshalImpl definition. Francois Gouget <fgouget@free.fr> - Specify the proper call convention in the PropSysFreeString() implementation. - Tweak the API documentation to silence winapi_check warnings. Robert Shearman <rob@codeweavers.com> - Add error messages on failure in file moniker load function. - Fix incorrect pointer check in both monikers. - Fix max size calculation of item moniker to match native. - Add a generic moniker marshaler that works by saving & loading monikers to & from the stream. - Use the generic moniker marshal in the file & item monikers and add a class factory for each. - Implement IROTData::GetComparisonData for file & item monikers. - Add a useful trace message. - Fix more places where custom header size was calculated exclusive of the data size member. - Optimize custom marshaling by getting size before calling the custom marshaler so we can write the header before and not use a second stream. - Change remaining blocks of code with 2-space indentation to 4-space indentation. - Make vtables const. - Remove an unnecessary memcpy and let the compiler do the work. - Write custom header up to and including size, not excluding. - Add a stub implementation of CoIsHandlerConnected. - Marshal objects & monikers into the ROT. - Test for this behaviour. Mike McCormack <mike@codeweavers.com> - Remove unnecessary declarations and make functions static. - Remove forward declarations. - Make sure a stream can't be created in read only storage. - Fix a memory leak in the ole storage implementation. - Remove function prototypes. Kevin Koltzau <kevin@plop.org> - Implement Hash function on composite moniker. Jeff Latimer <jeffl@defcen.gov.au> - Implement the IEnumMoniker interface for the ROT and provide tests to exercise the interface. Pierre d'Herbemont <stegefin@free.fr> - Big Endian specific code fixes in order to conform with NONAMELESSSTRUCT. Matthew Mastracci <matt@aclaro.com> - Replace stub entry for StgOpenStorageEx with call to StgOpenStorage. - Replace StgCreateStorageEx stub with call to StgCreateDocfile and add required STGFMT_* enumerations. svn path=/trunk/; revision=15562
2005-05-28 09:30:04 +00:00
/* The format should already be 1, but just in case */
This->format = 1;
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
break;
default:
hr = PropertyStorage_StorePropWithId(This,
Sync to Wine-20050524: Alexandre Julliard <julliard@winehq.org> - Added rules for building import libraries in the individual dll makefiles, and added support for building a .def.a static import library too. - Removed unnecessary code in the 16-bit DllEntryPoint function of some dlls, and also fixed its ordinal in a few places. - Comment out stub WEP entry points so that we can call WEP for builtin dlls too. Juan Lang <juan_lang@yahoo.com> - Obvious fixes to PropVariantClear and PropVariantCopy for vector types. - Add a comment, and a no-op cleanup. - Differentiate between version 0 and version 1 property storages. - Store property names in the code page of the property set. - maintain proper byte order - maintain PROPSETFLAG_ANSI flag based on codepage - update comments - Correct/improve error checking in IPropertyStorage. - convert strings between property storage's code page and system code page - add tests for setting code page - fix tests and behavior to match WinXP - Define and use endian conversion macros for big-endian machines. Marcus Meissner <marcus@jet.franken.de> - Move the Dll init function to compobj.c to avoid having global variables. Remove need of ole32_main.h. - Make HGLOBALStream_* functions static. - Make _xmalloc16() static. - Staticify FTMarshalImpl definition. Francois Gouget <fgouget@free.fr> - Specify the proper call convention in the PropSysFreeString() implementation. - Tweak the API documentation to silence winapi_check warnings. Robert Shearman <rob@codeweavers.com> - Add error messages on failure in file moniker load function. - Fix incorrect pointer check in both monikers. - Fix max size calculation of item moniker to match native. - Add a generic moniker marshaler that works by saving & loading monikers to & from the stream. - Use the generic moniker marshal in the file & item monikers and add a class factory for each. - Implement IROTData::GetComparisonData for file & item monikers. - Add a useful trace message. - Fix more places where custom header size was calculated exclusive of the data size member. - Optimize custom marshaling by getting size before calling the custom marshaler so we can write the header before and not use a second stream. - Change remaining blocks of code with 2-space indentation to 4-space indentation. - Make vtables const. - Remove an unnecessary memcpy and let the compiler do the work. - Write custom header up to and including size, not excluding. - Add a stub implementation of CoIsHandlerConnected. - Marshal objects & monikers into the ROT. - Test for this behaviour. Mike McCormack <mike@codeweavers.com> - Remove unnecessary declarations and make functions static. - Remove forward declarations. - Make sure a stream can't be created in read only storage. - Fix a memory leak in the ole storage implementation. - Remove function prototypes. Kevin Koltzau <kevin@plop.org> - Implement Hash function on composite moniker. Jeff Latimer <jeffl@defcen.gov.au> - Implement the IEnumMoniker interface for the ROT and provide tests to exercise the interface. Pierre d'Herbemont <stegefin@free.fr> - Big Endian specific code fixes in order to conform with NONAMELESSSTRUCT. Matthew Mastracci <matt@aclaro.com> - Replace stub entry for StgOpenStorageEx with call to StgOpenStorage. - Replace StgCreateStorageEx stub with call to StgCreateDocfile and add required STGFMT_* enumerations. svn path=/trunk/; revision=15562
2005-05-28 09:30:04 +00:00
idOffset->propid, &prop, This->codePage);
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
}
}
PropVariantClear(&prop);
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
}
}
}
if (!This->codePage)
{
/* default to Unicode unless told not to, as specified on msdn */
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
if (This->grfFlags & PROPSETFLAG_ANSI)
This->codePage = GetACP();
else
This->codePage = CP_UNICODE;
}
if (!This->locale)
This->locale = LOCALE_SYSTEM_DEFAULT;
TRACE("Code page is %d, locale is %d\n", This->codePage, This->locale);
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
if (dictOffset)
hr = PropertyStorage_ReadDictionary(This,
buf + dictOffset - sizeof(PROPERTYSECTIONHEADER));
end:
HeapFree(GetProcessHeap(), 0, buf);
if (FAILED(hr))
{
dictionary_destroy(This->name_to_propid);
This->name_to_propid = NULL;
dictionary_destroy(This->propid_to_name);
This->propid_to_name = NULL;
dictionary_destroy(This->propid_to_prop);
This->propid_to_prop = NULL;
}
return hr;
}
static void PropertyStorage_MakeHeader(PropertyStorage_impl *This,
PROPERTYSETHEADER *hdr)
{
assert(hdr);
StorageUtl_WriteWord((BYTE *)&hdr->wByteOrder, 0,
PROPSETHDR_BYTEORDER_MAGIC);
Sync to Wine-20050524: Alexandre Julliard <julliard@winehq.org> - Added rules for building import libraries in the individual dll makefiles, and added support for building a .def.a static import library too. - Removed unnecessary code in the 16-bit DllEntryPoint function of some dlls, and also fixed its ordinal in a few places. - Comment out stub WEP entry points so that we can call WEP for builtin dlls too. Juan Lang <juan_lang@yahoo.com> - Obvious fixes to PropVariantClear and PropVariantCopy for vector types. - Add a comment, and a no-op cleanup. - Differentiate between version 0 and version 1 property storages. - Store property names in the code page of the property set. - maintain proper byte order - maintain PROPSETFLAG_ANSI flag based on codepage - update comments - Correct/improve error checking in IPropertyStorage. - convert strings between property storage's code page and system code page - add tests for setting code page - fix tests and behavior to match WinXP - Define and use endian conversion macros for big-endian machines. Marcus Meissner <marcus@jet.franken.de> - Move the Dll init function to compobj.c to avoid having global variables. Remove need of ole32_main.h. - Make HGLOBALStream_* functions static. - Make _xmalloc16() static. - Staticify FTMarshalImpl definition. Francois Gouget <fgouget@free.fr> - Specify the proper call convention in the PropSysFreeString() implementation. - Tweak the API documentation to silence winapi_check warnings. Robert Shearman <rob@codeweavers.com> - Add error messages on failure in file moniker load function. - Fix incorrect pointer check in both monikers. - Fix max size calculation of item moniker to match native. - Add a generic moniker marshaler that works by saving & loading monikers to & from the stream. - Use the generic moniker marshal in the file & item monikers and add a class factory for each. - Implement IROTData::GetComparisonData for file & item monikers. - Add a useful trace message. - Fix more places where custom header size was calculated exclusive of the data size member. - Optimize custom marshaling by getting size before calling the custom marshaler so we can write the header before and not use a second stream. - Change remaining blocks of code with 2-space indentation to 4-space indentation. - Make vtables const. - Remove an unnecessary memcpy and let the compiler do the work. - Write custom header up to and including size, not excluding. - Add a stub implementation of CoIsHandlerConnected. - Marshal objects & monikers into the ROT. - Test for this behaviour. Mike McCormack <mike@codeweavers.com> - Remove unnecessary declarations and make functions static. - Remove forward declarations. - Make sure a stream can't be created in read only storage. - Fix a memory leak in the ole storage implementation. - Remove function prototypes. Kevin Koltzau <kevin@plop.org> - Implement Hash function on composite moniker. Jeff Latimer <jeffl@defcen.gov.au> - Implement the IEnumMoniker interface for the ROT and provide tests to exercise the interface. Pierre d'Herbemont <stegefin@free.fr> - Big Endian specific code fixes in order to conform with NONAMELESSSTRUCT. Matthew Mastracci <matt@aclaro.com> - Replace stub entry for StgOpenStorageEx with call to StgOpenStorage. - Replace StgCreateStorageEx stub with call to StgCreateDocfile and add required STGFMT_* enumerations. svn path=/trunk/; revision=15562
2005-05-28 09:30:04 +00:00
StorageUtl_WriteWord((BYTE *)&hdr->wFormat, 0, This->format);
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
StorageUtl_WriteDWord((BYTE *)&hdr->dwOSVer, 0, This->originatorOS);
StorageUtl_WriteGUID((BYTE *)&hdr->clsid, 0, &This->clsid);
StorageUtl_WriteDWord((BYTE *)&hdr->reserved, 0, 1);
}
static void PropertyStorage_MakeFmtIdOffset(PropertyStorage_impl *This,
FORMATIDOFFSET *fmtOffset)
{
assert(fmtOffset);
StorageUtl_WriteGUID((BYTE *)fmtOffset, 0, &This->fmtid);
StorageUtl_WriteDWord((BYTE *)fmtOffset, offsetof(FORMATIDOFFSET, dwOffset),
sizeof(PROPERTYSETHEADER) + sizeof(FORMATIDOFFSET));
}
static void PropertyStorage_MakeSectionHdr(DWORD cbSection, DWORD numProps,
PROPERTYSECTIONHEADER *hdr)
{
assert(hdr);
StorageUtl_WriteDWord((BYTE *)hdr, 0, cbSection);
StorageUtl_WriteDWord((BYTE *)hdr,
offsetof(PROPERTYSECTIONHEADER, cProperties), numProps);
}
static void PropertyStorage_MakePropertyIdOffset(DWORD propid, DWORD dwOffset,
PROPERTYIDOFFSET *propIdOffset)
{
assert(propIdOffset);
StorageUtl_WriteDWord((BYTE *)propIdOffset, 0, propid);
StorageUtl_WriteDWord((BYTE *)propIdOffset,
offsetof(PROPERTYIDOFFSET, dwOffset), dwOffset);
}
static inline HRESULT PropertStorage_WriteWStringToStream(IStream *stm,
LPCWSTR str, DWORD len, DWORD *written)
{
#ifdef WORDS_BIGENDIAN
WCHAR *leStr = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
HRESULT hr;
if (!leStr)
return E_OUTOFMEMORY;
memcpy(leStr, str, len * sizeof(WCHAR));
PropertyStorage_ByteSwapString(leStr, len);
hr = IStream_Write(stm, leStr, len, written);
HeapFree(GetProcessHeap(), 0, leStr);
return hr;
#else
return IStream_Write(stm, str, len, written);
#endif
}
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
struct DictionaryClosure
{
HRESULT hr;
DWORD bytesWritten;
};
static BOOL PropertyStorage_DictionaryWriter(const void *key,
const void *value, void *extra, void *closure)
{
PropertyStorage_impl *This = extra;
struct DictionaryClosure *c = closure;
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
DWORD propid;
ULONG count;
assert(key);
assert(closure);
StorageUtl_WriteDWord((LPBYTE)&propid, 0, PtrToUlong(value));
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
c->hr = IStream_Write(This->stm, &propid, sizeof(propid), &count);
if (FAILED(c->hr))
goto end;
c->bytesWritten += sizeof(DWORD);
if (This->codePage == CP_UNICODE)
{
DWORD keyLen, pad = 0;
StorageUtl_WriteDWord((LPBYTE)&keyLen, 0,
(lstrlenW((LPCWSTR)key) + 1) * sizeof(WCHAR));
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
c->hr = IStream_Write(This->stm, &keyLen, sizeof(keyLen), &count);
if (FAILED(c->hr))
goto end;
c->bytesWritten += sizeof(DWORD);
c->hr = PropertStorage_WriteWStringToStream(This->stm, key, keyLen,
&count);
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
if (FAILED(c->hr))
goto end;
c->bytesWritten += keyLen * sizeof(WCHAR);
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
if (keyLen % sizeof(DWORD))
{
c->hr = IStream_Write(This->stm, &pad,
sizeof(DWORD) - keyLen % sizeof(DWORD), &count);
if (FAILED(c->hr))
goto end;
c->bytesWritten += sizeof(DWORD) - keyLen % sizeof(DWORD);
}
}
else
{
Sync to Wine-20050524: Alexandre Julliard <julliard@winehq.org> - Added rules for building import libraries in the individual dll makefiles, and added support for building a .def.a static import library too. - Removed unnecessary code in the 16-bit DllEntryPoint function of some dlls, and also fixed its ordinal in a few places. - Comment out stub WEP entry points so that we can call WEP for builtin dlls too. Juan Lang <juan_lang@yahoo.com> - Obvious fixes to PropVariantClear and PropVariantCopy for vector types. - Add a comment, and a no-op cleanup. - Differentiate between version 0 and version 1 property storages. - Store property names in the code page of the property set. - maintain proper byte order - maintain PROPSETFLAG_ANSI flag based on codepage - update comments - Correct/improve error checking in IPropertyStorage. - convert strings between property storage's code page and system code page - add tests for setting code page - fix tests and behavior to match WinXP - Define and use endian conversion macros for big-endian machines. Marcus Meissner <marcus@jet.franken.de> - Move the Dll init function to compobj.c to avoid having global variables. Remove need of ole32_main.h. - Make HGLOBALStream_* functions static. - Make _xmalloc16() static. - Staticify FTMarshalImpl definition. Francois Gouget <fgouget@free.fr> - Specify the proper call convention in the PropSysFreeString() implementation. - Tweak the API documentation to silence winapi_check warnings. Robert Shearman <rob@codeweavers.com> - Add error messages on failure in file moniker load function. - Fix incorrect pointer check in both monikers. - Fix max size calculation of item moniker to match native. - Add a generic moniker marshaler that works by saving & loading monikers to & from the stream. - Use the generic moniker marshal in the file & item monikers and add a class factory for each. - Implement IROTData::GetComparisonData for file & item monikers. - Add a useful trace message. - Fix more places where custom header size was calculated exclusive of the data size member. - Optimize custom marshaling by getting size before calling the custom marshaler so we can write the header before and not use a second stream. - Change remaining blocks of code with 2-space indentation to 4-space indentation. - Make vtables const. - Remove an unnecessary memcpy and let the compiler do the work. - Write custom header up to and including size, not excluding. - Add a stub implementation of CoIsHandlerConnected. - Marshal objects & monikers into the ROT. - Test for this behaviour. Mike McCormack <mike@codeweavers.com> - Remove unnecessary declarations and make functions static. - Remove forward declarations. - Make sure a stream can't be created in read only storage. - Fix a memory leak in the ole storage implementation. - Remove function prototypes. Kevin Koltzau <kevin@plop.org> - Implement Hash function on composite moniker. Jeff Latimer <jeffl@defcen.gov.au> - Implement the IEnumMoniker interface for the ROT and provide tests to exercise the interface. Pierre d'Herbemont <stegefin@free.fr> - Big Endian specific code fixes in order to conform with NONAMELESSSTRUCT. Matthew Mastracci <matt@aclaro.com> - Replace stub entry for StgOpenStorageEx with call to StgOpenStorage. - Replace StgCreateStorageEx stub with call to StgCreateDocfile and add required STGFMT_* enumerations. svn path=/trunk/; revision=15562
2005-05-28 09:30:04 +00:00
DWORD keyLen;
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
Sync to Wine-20050524: Alexandre Julliard <julliard@winehq.org> - Added rules for building import libraries in the individual dll makefiles, and added support for building a .def.a static import library too. - Removed unnecessary code in the 16-bit DllEntryPoint function of some dlls, and also fixed its ordinal in a few places. - Comment out stub WEP entry points so that we can call WEP for builtin dlls too. Juan Lang <juan_lang@yahoo.com> - Obvious fixes to PropVariantClear and PropVariantCopy for vector types. - Add a comment, and a no-op cleanup. - Differentiate between version 0 and version 1 property storages. - Store property names in the code page of the property set. - maintain proper byte order - maintain PROPSETFLAG_ANSI flag based on codepage - update comments - Correct/improve error checking in IPropertyStorage. - convert strings between property storage's code page and system code page - add tests for setting code page - fix tests and behavior to match WinXP - Define and use endian conversion macros for big-endian machines. Marcus Meissner <marcus@jet.franken.de> - Move the Dll init function to compobj.c to avoid having global variables. Remove need of ole32_main.h. - Make HGLOBALStream_* functions static. - Make _xmalloc16() static. - Staticify FTMarshalImpl definition. Francois Gouget <fgouget@free.fr> - Specify the proper call convention in the PropSysFreeString() implementation. - Tweak the API documentation to silence winapi_check warnings. Robert Shearman <rob@codeweavers.com> - Add error messages on failure in file moniker load function. - Fix incorrect pointer check in both monikers. - Fix max size calculation of item moniker to match native. - Add a generic moniker marshaler that works by saving & loading monikers to & from the stream. - Use the generic moniker marshal in the file & item monikers and add a class factory for each. - Implement IROTData::GetComparisonData for file & item monikers. - Add a useful trace message. - Fix more places where custom header size was calculated exclusive of the data size member. - Optimize custom marshaling by getting size before calling the custom marshaler so we can write the header before and not use a second stream. - Change remaining blocks of code with 2-space indentation to 4-space indentation. - Make vtables const. - Remove an unnecessary memcpy and let the compiler do the work. - Write custom header up to and including size, not excluding. - Add a stub implementation of CoIsHandlerConnected. - Marshal objects & monikers into the ROT. - Test for this behaviour. Mike McCormack <mike@codeweavers.com> - Remove unnecessary declarations and make functions static. - Remove forward declarations. - Make sure a stream can't be created in read only storage. - Fix a memory leak in the ole storage implementation. - Remove function prototypes. Kevin Koltzau <kevin@plop.org> - Implement Hash function on composite moniker. Jeff Latimer <jeffl@defcen.gov.au> - Implement the IEnumMoniker interface for the ROT and provide tests to exercise the interface. Pierre d'Herbemont <stegefin@free.fr> - Big Endian specific code fixes in order to conform with NONAMELESSSTRUCT. Matthew Mastracci <matt@aclaro.com> - Replace stub entry for StgOpenStorageEx with call to StgOpenStorage. - Replace StgCreateStorageEx stub with call to StgCreateDocfile and add required STGFMT_* enumerations. svn path=/trunk/; revision=15562
2005-05-28 09:30:04 +00:00
StorageUtl_WriteDWord((LPBYTE)&keyLen, 0, strlen((LPCSTR)key) + 1);
c->hr = IStream_Write(This->stm, &keyLen, sizeof(keyLen), &count);
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
if (FAILED(c->hr))
goto end;
c->bytesWritten += sizeof(DWORD);
Sync to Wine-20050524: Alexandre Julliard <julliard@winehq.org> - Added rules for building import libraries in the individual dll makefiles, and added support for building a .def.a static import library too. - Removed unnecessary code in the 16-bit DllEntryPoint function of some dlls, and also fixed its ordinal in a few places. - Comment out stub WEP entry points so that we can call WEP for builtin dlls too. Juan Lang <juan_lang@yahoo.com> - Obvious fixes to PropVariantClear and PropVariantCopy for vector types. - Add a comment, and a no-op cleanup. - Differentiate between version 0 and version 1 property storages. - Store property names in the code page of the property set. - maintain proper byte order - maintain PROPSETFLAG_ANSI flag based on codepage - update comments - Correct/improve error checking in IPropertyStorage. - convert strings between property storage's code page and system code page - add tests for setting code page - fix tests and behavior to match WinXP - Define and use endian conversion macros for big-endian machines. Marcus Meissner <marcus@jet.franken.de> - Move the Dll init function to compobj.c to avoid having global variables. Remove need of ole32_main.h. - Make HGLOBALStream_* functions static. - Make _xmalloc16() static. - Staticify FTMarshalImpl definition. Francois Gouget <fgouget@free.fr> - Specify the proper call convention in the PropSysFreeString() implementation. - Tweak the API documentation to silence winapi_check warnings. Robert Shearman <rob@codeweavers.com> - Add error messages on failure in file moniker load function. - Fix incorrect pointer check in both monikers. - Fix max size calculation of item moniker to match native. - Add a generic moniker marshaler that works by saving & loading monikers to & from the stream. - Use the generic moniker marshal in the file & item monikers and add a class factory for each. - Implement IROTData::GetComparisonData for file & item monikers. - Add a useful trace message. - Fix more places where custom header size was calculated exclusive of the data size member. - Optimize custom marshaling by getting size before calling the custom marshaler so we can write the header before and not use a second stream. - Change remaining blocks of code with 2-space indentation to 4-space indentation. - Make vtables const. - Remove an unnecessary memcpy and let the compiler do the work. - Write custom header up to and including size, not excluding. - Add a stub implementation of CoIsHandlerConnected. - Marshal objects & monikers into the ROT. - Test for this behaviour. Mike McCormack <mike@codeweavers.com> - Remove unnecessary declarations and make functions static. - Remove forward declarations. - Make sure a stream can't be created in read only storage. - Fix a memory leak in the ole storage implementation. - Remove function prototypes. Kevin Koltzau <kevin@plop.org> - Implement Hash function on composite moniker. Jeff Latimer <jeffl@defcen.gov.au> - Implement the IEnumMoniker interface for the ROT and provide tests to exercise the interface. Pierre d'Herbemont <stegefin@free.fr> - Big Endian specific code fixes in order to conform with NONAMELESSSTRUCT. Matthew Mastracci <matt@aclaro.com> - Replace stub entry for StgOpenStorageEx with call to StgOpenStorage. - Replace StgCreateStorageEx stub with call to StgCreateDocfile and add required STGFMT_* enumerations. svn path=/trunk/; revision=15562
2005-05-28 09:30:04 +00:00
c->hr = IStream_Write(This->stm, key, keyLen, &count);
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
if (FAILED(c->hr))
goto end;
Sync to Wine-20050524: Alexandre Julliard <julliard@winehq.org> - Added rules for building import libraries in the individual dll makefiles, and added support for building a .def.a static import library too. - Removed unnecessary code in the 16-bit DllEntryPoint function of some dlls, and also fixed its ordinal in a few places. - Comment out stub WEP entry points so that we can call WEP for builtin dlls too. Juan Lang <juan_lang@yahoo.com> - Obvious fixes to PropVariantClear and PropVariantCopy for vector types. - Add a comment, and a no-op cleanup. - Differentiate between version 0 and version 1 property storages. - Store property names in the code page of the property set. - maintain proper byte order - maintain PROPSETFLAG_ANSI flag based on codepage - update comments - Correct/improve error checking in IPropertyStorage. - convert strings between property storage's code page and system code page - add tests for setting code page - fix tests and behavior to match WinXP - Define and use endian conversion macros for big-endian machines. Marcus Meissner <marcus@jet.franken.de> - Move the Dll init function to compobj.c to avoid having global variables. Remove need of ole32_main.h. - Make HGLOBALStream_* functions static. - Make _xmalloc16() static. - Staticify FTMarshalImpl definition. Francois Gouget <fgouget@free.fr> - Specify the proper call convention in the PropSysFreeString() implementation. - Tweak the API documentation to silence winapi_check warnings. Robert Shearman <rob@codeweavers.com> - Add error messages on failure in file moniker load function. - Fix incorrect pointer check in both monikers. - Fix max size calculation of item moniker to match native. - Add a generic moniker marshaler that works by saving & loading monikers to & from the stream. - Use the generic moniker marshal in the file & item monikers and add a class factory for each. - Implement IROTData::GetComparisonData for file & item monikers. - Add a useful trace message. - Fix more places where custom header size was calculated exclusive of the data size member. - Optimize custom marshaling by getting size before calling the custom marshaler so we can write the header before and not use a second stream. - Change remaining blocks of code with 2-space indentation to 4-space indentation. - Make vtables const. - Remove an unnecessary memcpy and let the compiler do the work. - Write custom header up to and including size, not excluding. - Add a stub implementation of CoIsHandlerConnected. - Marshal objects & monikers into the ROT. - Test for this behaviour. Mike McCormack <mike@codeweavers.com> - Remove unnecessary declarations and make functions static. - Remove forward declarations. - Make sure a stream can't be created in read only storage. - Fix a memory leak in the ole storage implementation. - Remove function prototypes. Kevin Koltzau <kevin@plop.org> - Implement Hash function on composite moniker. Jeff Latimer <jeffl@defcen.gov.au> - Implement the IEnumMoniker interface for the ROT and provide tests to exercise the interface. Pierre d'Herbemont <stegefin@free.fr> - Big Endian specific code fixes in order to conform with NONAMELESSSTRUCT. Matthew Mastracci <matt@aclaro.com> - Replace stub entry for StgOpenStorageEx with call to StgOpenStorage. - Replace StgCreateStorageEx stub with call to StgCreateDocfile and add required STGFMT_* enumerations. svn path=/trunk/; revision=15562
2005-05-28 09:30:04 +00:00
c->bytesWritten += keyLen;
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
}
end:
return SUCCEEDED(c->hr);
}
#define SECTIONHEADER_OFFSET sizeof(PROPERTYSETHEADER) + sizeof(FORMATIDOFFSET)
/* Writes the dictionary to the stream. Assumes without checking that the
* dictionary isn't empty.
*/
static HRESULT PropertyStorage_WriteDictionaryToStream(
PropertyStorage_impl *This, DWORD *sectionOffset)
{
HRESULT hr;
LARGE_INTEGER seek;
PROPERTYIDOFFSET propIdOffset;
ULONG count;
DWORD dwTemp;
struct DictionaryClosure closure;
assert(sectionOffset);
/* The dictionary's always the first property written, so seek to its
* spot.
*/
seek.QuadPart = SECTIONHEADER_OFFSET + sizeof(PROPERTYSECTIONHEADER);
hr = IStream_Seek(This->stm, seek, STREAM_SEEK_SET, NULL);
if (FAILED(hr))
goto end;
PropertyStorage_MakePropertyIdOffset(PID_DICTIONARY, *sectionOffset,
&propIdOffset);
hr = IStream_Write(This->stm, &propIdOffset, sizeof(propIdOffset), &count);
if (FAILED(hr))
goto end;
seek.QuadPart = SECTIONHEADER_OFFSET + *sectionOffset;
hr = IStream_Seek(This->stm, seek, STREAM_SEEK_SET, NULL);
if (FAILED(hr))
goto end;
StorageUtl_WriteDWord((LPBYTE)&dwTemp, 0,
dictionary_num_entries(This->name_to_propid));
hr = IStream_Write(This->stm, &dwTemp, sizeof(dwTemp), &count);
if (FAILED(hr))
goto end;
*sectionOffset += sizeof(dwTemp);
closure.hr = S_OK;
closure.bytesWritten = 0;
dictionary_enumerate(This->name_to_propid, PropertyStorage_DictionaryWriter,
&closure);
hr = closure.hr;
if (FAILED(hr))
goto end;
*sectionOffset += closure.bytesWritten;
if (closure.bytesWritten % sizeof(DWORD))
{
DWORD padding = sizeof(DWORD) - closure.bytesWritten % sizeof(DWORD);
TRACE("adding %d bytes of padding\n", padding);
*sectionOffset += padding;
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
}
end:
return hr;
Sync to Wine-20050310: Jon Griffiths <jon_p_griffiths@yahoo.com> - Documentation spelling fixes. Mike McCormack <mike@codeweavers.com> - Implement and test IPropertySetStorage. - Fix more incorrect uses of STGM_ enumerations. - Add struct StorageBaseImpl at the start of derived structures instead of trying to keep the first members the same. - StgOpenStorage shouldn't open zero length storage files. - Shared reading of storage files requires STGM_TRANSACTED. - Test and fix grfMode handling in StgOpenDocfile. - Implement StgSetTimes. Robert Shearman <rob@codeweavers.com> - Better tracing. - Small cleanup of creation functions. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. - Move marshaling state machine into stub manager from ifstub. - Add additional needed states for table-weak marshaling, as shown by tests. - Protect external reference count from underflows/overflows. - Make COM use the RPC runtime as the backend for RPC calls. Based on a patch by Ove Ksven. - Invoke objects in STA's in the correct thread by sending messages to the hidden apartment window. - Use I_RpcGetBuffer, instead of our own buffer routines to fix an occasional test crash caused by heap corruption. - Zero the memory block passed to RpcServerRegisterIfEx so we don't pass garbage in some of the fields we don't fill in. - Return the correct error code from create_server and fix two handle leaks. - TODO update. - Remove cruft left over from previous RPC backend implementation in the apartment structure. - Don't pass an IPID by value for proxy_manager_create_ifproxy. - Disable more of RPC_UnregisterInterface to prevent the RPC runtime using freed memory. - Rename various external RPC backend functions so that they all have the same "RPC_" prefix. - Reduce the timeout of the function that connects to a local server to 30s, like native. - Make each ifproxy have its own channel buffer to fix a bug where a proxy with multiple interfaces could invoke the wrong stub buffer on the server. - The Global Interface Table should do table-strong marshaling instead of normal marshaling so that an interface can be retrieved more than one time. Mike Hearn <mh@codeweavers.com> - Avoid infinite loop when doing a typelib marshalled IUnknown::QueryInterface by only doing an extra QI if requested IID is not equal to marshalled IID. Rob Shearman <rob@codeweavers.com> Mike Hearn <mh@codeweavers.com> - Add re-entrancy tests to the test suite. - Run RPCs on a new thread client side so we can pump the message loop. Juan Lang <juan_lang@yahoo.com> - Fix the calling convention of DllCanUnloadNow. - Move vtbl to end of file and get rid of unnecessary prototypes. - Implement StgCreatePropSetStg. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Paul Vriens <Paul.Vriens@xs4all.nl> - Added some TRACE statements. svn path=/trunk/; revision=14083
2005-03-14 23:17:44 +00:00
}
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
static HRESULT PropertyStorage_WritePropertyToStream(PropertyStorage_impl *This,
DWORD propNum, DWORD propid, const PROPVARIANT *var, DWORD *sectionOffset)
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
{
HRESULT hr;
LARGE_INTEGER seek;
PROPERTYIDOFFSET propIdOffset;
ULONG count;
DWORD dwType, bytesWritten;
assert(var);
assert(sectionOffset);
TRACE("%p, %d, 0x%08x, (%d), (%d)\n", This, propNum, propid, var->vt,
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
*sectionOffset);
seek.QuadPart = SECTIONHEADER_OFFSET + sizeof(PROPERTYSECTIONHEADER) +
propNum * sizeof(PROPERTYIDOFFSET);
hr = IStream_Seek(This->stm, seek, STREAM_SEEK_SET, NULL);
if (FAILED(hr))
goto end;
PropertyStorage_MakePropertyIdOffset(propid, *sectionOffset, &propIdOffset);
hr = IStream_Write(This->stm, &propIdOffset, sizeof(propIdOffset), &count);
if (FAILED(hr))
goto end;
seek.QuadPart = SECTIONHEADER_OFFSET + *sectionOffset;
hr = IStream_Seek(This->stm, seek, STREAM_SEEK_SET, NULL);
if (FAILED(hr))
goto end;
StorageUtl_WriteDWord((LPBYTE)&dwType, 0, var->vt);
hr = IStream_Write(This->stm, &dwType, sizeof(dwType), &count);
if (FAILED(hr))
goto end;
*sectionOffset += sizeof(dwType);
switch (var->vt)
{
case VT_EMPTY:
case VT_NULL:
bytesWritten = 0;
break;
case VT_I1:
case VT_UI1:
hr = IStream_Write(This->stm, &var->u.cVal, sizeof(var->u.cVal),
&count);
bytesWritten = count;
break;
case VT_I2:
case VT_UI2:
{
WORD wTemp;
StorageUtl_WriteWord((LPBYTE)&wTemp, 0, var->u.iVal);
hr = IStream_Write(This->stm, &wTemp, sizeof(wTemp), &count);
bytesWritten = count;
break;
}
case VT_I4:
case VT_UI4:
{
DWORD dwTemp;
StorageUtl_WriteDWord((LPBYTE)&dwTemp, 0, var->u.lVal);
hr = IStream_Write(This->stm, &dwTemp, sizeof(dwTemp), &count);
bytesWritten = count;
break;
}
case VT_LPSTR:
{
DWORD len, dwTemp;
if (This->codePage == CP_UNICODE)
len = (lstrlenW(var->u.pwszVal) + 1) * sizeof(WCHAR);
else
len = lstrlenA(var->u.pszVal) + 1;
StorageUtl_WriteDWord((LPBYTE)&dwTemp, 0, len);
hr = IStream_Write(This->stm, &dwTemp, sizeof(dwTemp), &count);
if (FAILED(hr))
goto end;
hr = IStream_Write(This->stm, var->u.pszVal, len, &count);
bytesWritten = count + sizeof(DWORD);
break;
}
case VT_LPWSTR:
{
DWORD len = lstrlenW(var->u.pwszVal) + 1, dwTemp;
StorageUtl_WriteDWord((LPBYTE)&dwTemp, 0, len);
hr = IStream_Write(This->stm, &dwTemp, sizeof(dwTemp), &count);
if (FAILED(hr))
goto end;
hr = IStream_Write(This->stm, var->u.pwszVal, len * sizeof(WCHAR),
&count);
bytesWritten = count + sizeof(DWORD);
break;
}
Sync to Wine-20050524: Alexandre Julliard <julliard@winehq.org> - Added rules for building import libraries in the individual dll makefiles, and added support for building a .def.a static import library too. - Removed unnecessary code in the 16-bit DllEntryPoint function of some dlls, and also fixed its ordinal in a few places. - Comment out stub WEP entry points so that we can call WEP for builtin dlls too. Juan Lang <juan_lang@yahoo.com> - Obvious fixes to PropVariantClear and PropVariantCopy for vector types. - Add a comment, and a no-op cleanup. - Differentiate between version 0 and version 1 property storages. - Store property names in the code page of the property set. - maintain proper byte order - maintain PROPSETFLAG_ANSI flag based on codepage - update comments - Correct/improve error checking in IPropertyStorage. - convert strings between property storage's code page and system code page - add tests for setting code page - fix tests and behavior to match WinXP - Define and use endian conversion macros for big-endian machines. Marcus Meissner <marcus@jet.franken.de> - Move the Dll init function to compobj.c to avoid having global variables. Remove need of ole32_main.h. - Make HGLOBALStream_* functions static. - Make _xmalloc16() static. - Staticify FTMarshalImpl definition. Francois Gouget <fgouget@free.fr> - Specify the proper call convention in the PropSysFreeString() implementation. - Tweak the API documentation to silence winapi_check warnings. Robert Shearman <rob@codeweavers.com> - Add error messages on failure in file moniker load function. - Fix incorrect pointer check in both monikers. - Fix max size calculation of item moniker to match native. - Add a generic moniker marshaler that works by saving & loading monikers to & from the stream. - Use the generic moniker marshal in the file & item monikers and add a class factory for each. - Implement IROTData::GetComparisonData for file & item monikers. - Add a useful trace message. - Fix more places where custom header size was calculated exclusive of the data size member. - Optimize custom marshaling by getting size before calling the custom marshaler so we can write the header before and not use a second stream. - Change remaining blocks of code with 2-space indentation to 4-space indentation. - Make vtables const. - Remove an unnecessary memcpy and let the compiler do the work. - Write custom header up to and including size, not excluding. - Add a stub implementation of CoIsHandlerConnected. - Marshal objects & monikers into the ROT. - Test for this behaviour. Mike McCormack <mike@codeweavers.com> - Remove unnecessary declarations and make functions static. - Remove forward declarations. - Make sure a stream can't be created in read only storage. - Fix a memory leak in the ole storage implementation. - Remove function prototypes. Kevin Koltzau <kevin@plop.org> - Implement Hash function on composite moniker. Jeff Latimer <jeffl@defcen.gov.au> - Implement the IEnumMoniker interface for the ROT and provide tests to exercise the interface. Pierre d'Herbemont <stegefin@free.fr> - Big Endian specific code fixes in order to conform with NONAMELESSSTRUCT. Matthew Mastracci <matt@aclaro.com> - Replace stub entry for StgOpenStorageEx with call to StgOpenStorage. - Replace StgCreateStorageEx stub with call to StgCreateDocfile and add required STGFMT_* enumerations. svn path=/trunk/; revision=15562
2005-05-28 09:30:04 +00:00
case VT_FILETIME:
{
FILETIME temp;
StorageUtl_WriteULargeInteger((BYTE *)&temp, 0,
(const ULARGE_INTEGER *)&var->u.filetime);
Sync to Wine-20050524: Alexandre Julliard <julliard@winehq.org> - Added rules for building import libraries in the individual dll makefiles, and added support for building a .def.a static import library too. - Removed unnecessary code in the 16-bit DllEntryPoint function of some dlls, and also fixed its ordinal in a few places. - Comment out stub WEP entry points so that we can call WEP for builtin dlls too. Juan Lang <juan_lang@yahoo.com> - Obvious fixes to PropVariantClear and PropVariantCopy for vector types. - Add a comment, and a no-op cleanup. - Differentiate between version 0 and version 1 property storages. - Store property names in the code page of the property set. - maintain proper byte order - maintain PROPSETFLAG_ANSI flag based on codepage - update comments - Correct/improve error checking in IPropertyStorage. - convert strings between property storage's code page and system code page - add tests for setting code page - fix tests and behavior to match WinXP - Define and use endian conversion macros for big-endian machines. Marcus Meissner <marcus@jet.franken.de> - Move the Dll init function to compobj.c to avoid having global variables. Remove need of ole32_main.h. - Make HGLOBALStream_* functions static. - Make _xmalloc16() static. - Staticify FTMarshalImpl definition. Francois Gouget <fgouget@free.fr> - Specify the proper call convention in the PropSysFreeString() implementation. - Tweak the API documentation to silence winapi_check warnings. Robert Shearman <rob@codeweavers.com> - Add error messages on failure in file moniker load function. - Fix incorrect pointer check in both monikers. - Fix max size calculation of item moniker to match native. - Add a generic moniker marshaler that works by saving & loading monikers to & from the stream. - Use the generic moniker marshal in the file & item monikers and add a class factory for each. - Implement IROTData::GetComparisonData for file & item monikers. - Add a useful trace message. - Fix more places where custom header size was calculated exclusive of the data size member. - Optimize custom marshaling by getting size before calling the custom marshaler so we can write the header before and not use a second stream. - Change remaining blocks of code with 2-space indentation to 4-space indentation. - Make vtables const. - Remove an unnecessary memcpy and let the compiler do the work. - Write custom header up to and including size, not excluding. - Add a stub implementation of CoIsHandlerConnected. - Marshal objects & monikers into the ROT. - Test for this behaviour. Mike McCormack <mike@codeweavers.com> - Remove unnecessary declarations and make functions static. - Remove forward declarations. - Make sure a stream can't be created in read only storage. - Fix a memory leak in the ole storage implementation. - Remove function prototypes. Kevin Koltzau <kevin@plop.org> - Implement Hash function on composite moniker. Jeff Latimer <jeffl@defcen.gov.au> - Implement the IEnumMoniker interface for the ROT and provide tests to exercise the interface. Pierre d'Herbemont <stegefin@free.fr> - Big Endian specific code fixes in order to conform with NONAMELESSSTRUCT. Matthew Mastracci <matt@aclaro.com> - Replace stub entry for StgOpenStorageEx with call to StgOpenStorage. - Replace StgCreateStorageEx stub with call to StgCreateDocfile and add required STGFMT_* enumerations. svn path=/trunk/; revision=15562
2005-05-28 09:30:04 +00:00
hr = IStream_Write(This->stm, &temp, sizeof(FILETIME), &count);
bytesWritten = count;
break;
}
case VT_CF:
{
DWORD cf_hdr[2], len;
len = var->u.pclipdata->cbSize;
StorageUtl_WriteDWord((LPBYTE)&cf_hdr[0], 0, len + 8);
StorageUtl_WriteDWord((LPBYTE)&cf_hdr[1], 0, var->u.pclipdata->ulClipFmt);
hr = IStream_Write(This->stm, cf_hdr, sizeof(cf_hdr), &count);
if (FAILED(hr))
goto end;
hr = IStream_Write(This->stm, var->u.pclipdata->pClipData,
len - sizeof(var->u.pclipdata->ulClipFmt), &count);
if (FAILED(hr))
goto end;
bytesWritten = count + sizeof cf_hdr;
break;
}
case VT_CLSID:
{
CLSID temp;
StorageUtl_WriteGUID((BYTE *)&temp, 0, var->u.puuid);
hr = IStream_Write(This->stm, &temp, sizeof(temp), &count);
bytesWritten = count;
break;
}
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
default:
FIXME("unsupported type: %d\n", var->vt);
return STG_E_INVALIDPARAMETER;
}
if (SUCCEEDED(hr))
{
*sectionOffset += bytesWritten;
if (bytesWritten % sizeof(DWORD))
{
DWORD padding = sizeof(DWORD) - bytesWritten % sizeof(DWORD);
TRACE("adding %d bytes of padding\n", padding);
*sectionOffset += padding;
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
}
}
end:
return hr;
}
struct PropertyClosure
{
HRESULT hr;
DWORD propNum;
DWORD *sectionOffset;
};
static BOOL PropertyStorage_PropertiesWriter(const void *key, const void *value,
void *extra, void *closure)
{
PropertyStorage_impl *This = extra;
struct PropertyClosure *c = closure;
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
assert(key);
assert(value);
assert(extra);
assert(closure);
c->hr = PropertyStorage_WritePropertyToStream(This, c->propNum++,
PtrToUlong(key), value, c->sectionOffset);
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
return SUCCEEDED(c->hr);
}
static HRESULT PropertyStorage_WritePropertiesToStream(
PropertyStorage_impl *This, DWORD startingPropNum, DWORD *sectionOffset)
{
struct PropertyClosure closure;
assert(sectionOffset);
closure.hr = S_OK;
closure.propNum = startingPropNum;
closure.sectionOffset = sectionOffset;
dictionary_enumerate(This->propid_to_prop, PropertyStorage_PropertiesWriter,
&closure);
return closure.hr;
}
static HRESULT PropertyStorage_WriteHeadersToStream(PropertyStorage_impl *This)
{
HRESULT hr;
ULONG count = 0;
LARGE_INTEGER seek = { {0} };
PROPERTYSETHEADER hdr;
FORMATIDOFFSET fmtOffset;
hr = IStream_Seek(This->stm, seek, STREAM_SEEK_SET, NULL);
if (FAILED(hr))
goto end;
PropertyStorage_MakeHeader(This, &hdr);
hr = IStream_Write(This->stm, &hdr, sizeof(hdr), &count);
if (FAILED(hr))
goto end;
if (count != sizeof(hdr))
{
hr = STG_E_WRITEFAULT;
goto end;
}
PropertyStorage_MakeFmtIdOffset(This, &fmtOffset);
hr = IStream_Write(This->stm, &fmtOffset, sizeof(fmtOffset), &count);
if (FAILED(hr))
goto end;
if (count != sizeof(fmtOffset))
{
hr = STG_E_WRITEFAULT;
goto end;
}
hr = S_OK;
end:
return hr;
}
static HRESULT PropertyStorage_WriteToStream(PropertyStorage_impl *This)
{
PROPERTYSECTIONHEADER sectionHdr;
HRESULT hr;
ULONG count;
LARGE_INTEGER seek;
DWORD numProps, prop, sectionOffset, dwTemp;
PROPVARIANT var;
PropertyStorage_WriteHeadersToStream(This);
/* Count properties. Always at least one property, the code page */
numProps = 1;
if (dictionary_num_entries(This->name_to_propid))
numProps++;
if (This->locale != LOCALE_SYSTEM_DEFAULT)
numProps++;
if (This->grfFlags & PROPSETFLAG_CASE_SENSITIVE)
numProps++;
numProps += dictionary_num_entries(This->propid_to_prop);
/* Write section header with 0 bytes right now, I'll adjust it after
* writing properties.
*/
PropertyStorage_MakeSectionHdr(0, numProps, &sectionHdr);
seek.QuadPart = SECTIONHEADER_OFFSET;
hr = IStream_Seek(This->stm, seek, STREAM_SEEK_SET, NULL);
if (FAILED(hr))
goto end;
hr = IStream_Write(This->stm, &sectionHdr, sizeof(sectionHdr), &count);
if (FAILED(hr))
goto end;
prop = 0;
sectionOffset = sizeof(PROPERTYSECTIONHEADER) +
numProps * sizeof(PROPERTYIDOFFSET);
if (dictionary_num_entries(This->name_to_propid))
{
prop++;
hr = PropertyStorage_WriteDictionaryToStream(This, &sectionOffset);
if (FAILED(hr))
goto end;
}
PropVariantInit(&var);
var.vt = VT_I2;
var.u.iVal = This->codePage;
hr = PropertyStorage_WritePropertyToStream(This, prop++, PID_CODEPAGE,
&var, &sectionOffset);
if (FAILED(hr))
goto end;
if (This->locale != LOCALE_SYSTEM_DEFAULT)
{
var.vt = VT_I4;
var.u.lVal = This->locale;
hr = PropertyStorage_WritePropertyToStream(This, prop++, PID_LOCALE,
&var, &sectionOffset);
if (FAILED(hr))
goto end;
}
if (This->grfFlags & PROPSETFLAG_CASE_SENSITIVE)
{
var.vt = VT_I4;
var.u.lVal = 1;
hr = PropertyStorage_WritePropertyToStream(This, prop++, PID_BEHAVIOR,
&var, &sectionOffset);
if (FAILED(hr))
goto end;
}
hr = PropertyStorage_WritePropertiesToStream(This, prop, &sectionOffset);
if (FAILED(hr))
goto end;
/* Now write the byte count of the section */
seek.QuadPart = SECTIONHEADER_OFFSET;
hr = IStream_Seek(This->stm, seek, STREAM_SEEK_SET, NULL);
if (FAILED(hr))
goto end;
StorageUtl_WriteDWord((LPBYTE)&dwTemp, 0, sectionOffset);
hr = IStream_Write(This->stm, &dwTemp, sizeof(dwTemp), &count);
end:
return hr;
}
Sync to Wine-20050310: Jon Griffiths <jon_p_griffiths@yahoo.com> - Documentation spelling fixes. Mike McCormack <mike@codeweavers.com> - Implement and test IPropertySetStorage. - Fix more incorrect uses of STGM_ enumerations. - Add struct StorageBaseImpl at the start of derived structures instead of trying to keep the first members the same. - StgOpenStorage shouldn't open zero length storage files. - Shared reading of storage files requires STGM_TRANSACTED. - Test and fix grfMode handling in StgOpenDocfile. - Implement StgSetTimes. Robert Shearman <rob@codeweavers.com> - Better tracing. - Small cleanup of creation functions. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. - Move marshaling state machine into stub manager from ifstub. - Add additional needed states for table-weak marshaling, as shown by tests. - Protect external reference count from underflows/overflows. - Make COM use the RPC runtime as the backend for RPC calls. Based on a patch by Ove Ksven. - Invoke objects in STA's in the correct thread by sending messages to the hidden apartment window. - Use I_RpcGetBuffer, instead of our own buffer routines to fix an occasional test crash caused by heap corruption. - Zero the memory block passed to RpcServerRegisterIfEx so we don't pass garbage in some of the fields we don't fill in. - Return the correct error code from create_server and fix two handle leaks. - TODO update. - Remove cruft left over from previous RPC backend implementation in the apartment structure. - Don't pass an IPID by value for proxy_manager_create_ifproxy. - Disable more of RPC_UnregisterInterface to prevent the RPC runtime using freed memory. - Rename various external RPC backend functions so that they all have the same "RPC_" prefix. - Reduce the timeout of the function that connects to a local server to 30s, like native. - Make each ifproxy have its own channel buffer to fix a bug where a proxy with multiple interfaces could invoke the wrong stub buffer on the server. - The Global Interface Table should do table-strong marshaling instead of normal marshaling so that an interface can be retrieved more than one time. Mike Hearn <mh@codeweavers.com> - Avoid infinite loop when doing a typelib marshalled IUnknown::QueryInterface by only doing an extra QI if requested IID is not equal to marshalled IID. Rob Shearman <rob@codeweavers.com> Mike Hearn <mh@codeweavers.com> - Add re-entrancy tests to the test suite. - Run RPCs on a new thread client side so we can pump the message loop. Juan Lang <juan_lang@yahoo.com> - Fix the calling convention of DllCanUnloadNow. - Move vtbl to end of file and get rid of unnecessary prototypes. - Implement StgCreatePropSetStg. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Paul Vriens <Paul.Vriens@xs4all.nl> - Added some TRACE statements. svn path=/trunk/; revision=14083
2005-03-14 23:17:44 +00:00
/***********************************************************************
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
* PropertyStorage_Construct
Sync to Wine-20050310: Jon Griffiths <jon_p_griffiths@yahoo.com> - Documentation spelling fixes. Mike McCormack <mike@codeweavers.com> - Implement and test IPropertySetStorage. - Fix more incorrect uses of STGM_ enumerations. - Add struct StorageBaseImpl at the start of derived structures instead of trying to keep the first members the same. - StgOpenStorage shouldn't open zero length storage files. - Shared reading of storage files requires STGM_TRANSACTED. - Test and fix grfMode handling in StgOpenDocfile. - Implement StgSetTimes. Robert Shearman <rob@codeweavers.com> - Better tracing. - Small cleanup of creation functions. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. - Move marshaling state machine into stub manager from ifstub. - Add additional needed states for table-weak marshaling, as shown by tests. - Protect external reference count from underflows/overflows. - Make COM use the RPC runtime as the backend for RPC calls. Based on a patch by Ove Ksven. - Invoke objects in STA's in the correct thread by sending messages to the hidden apartment window. - Use I_RpcGetBuffer, instead of our own buffer routines to fix an occasional test crash caused by heap corruption. - Zero the memory block passed to RpcServerRegisterIfEx so we don't pass garbage in some of the fields we don't fill in. - Return the correct error code from create_server and fix two handle leaks. - TODO update. - Remove cruft left over from previous RPC backend implementation in the apartment structure. - Don't pass an IPID by value for proxy_manager_create_ifproxy. - Disable more of RPC_UnregisterInterface to prevent the RPC runtime using freed memory. - Rename various external RPC backend functions so that they all have the same "RPC_" prefix. - Reduce the timeout of the function that connects to a local server to 30s, like native. - Make each ifproxy have its own channel buffer to fix a bug where a proxy with multiple interfaces could invoke the wrong stub buffer on the server. - The Global Interface Table should do table-strong marshaling instead of normal marshaling so that an interface can be retrieved more than one time. Mike Hearn <mh@codeweavers.com> - Avoid infinite loop when doing a typelib marshalled IUnknown::QueryInterface by only doing an extra QI if requested IID is not equal to marshalled IID. Rob Shearman <rob@codeweavers.com> Mike Hearn <mh@codeweavers.com> - Add re-entrancy tests to the test suite. - Run RPCs on a new thread client side so we can pump the message loop. Juan Lang <juan_lang@yahoo.com> - Fix the calling convention of DllCanUnloadNow. - Move vtbl to end of file and get rid of unnecessary prototypes. - Implement StgCreatePropSetStg. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Paul Vriens <Paul.Vriens@xs4all.nl> - Added some TRACE statements. svn path=/trunk/; revision=14083
2005-03-14 23:17:44 +00:00
*/
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
static void PropertyStorage_DestroyDictionaries(PropertyStorage_impl *This)
{
dictionary_destroy(This->name_to_propid);
This->name_to_propid = NULL;
dictionary_destroy(This->propid_to_name);
This->propid_to_name = NULL;
dictionary_destroy(This->propid_to_prop);
This->propid_to_prop = NULL;
}
Sync to Wine-20050310: Jon Griffiths <jon_p_griffiths@yahoo.com> - Documentation spelling fixes. Mike McCormack <mike@codeweavers.com> - Implement and test IPropertySetStorage. - Fix more incorrect uses of STGM_ enumerations. - Add struct StorageBaseImpl at the start of derived structures instead of trying to keep the first members the same. - StgOpenStorage shouldn't open zero length storage files. - Shared reading of storage files requires STGM_TRANSACTED. - Test and fix grfMode handling in StgOpenDocfile. - Implement StgSetTimes. Robert Shearman <rob@codeweavers.com> - Better tracing. - Small cleanup of creation functions. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. - Move marshaling state machine into stub manager from ifstub. - Add additional needed states for table-weak marshaling, as shown by tests. - Protect external reference count from underflows/overflows. - Make COM use the RPC runtime as the backend for RPC calls. Based on a patch by Ove Ksven. - Invoke objects in STA's in the correct thread by sending messages to the hidden apartment window. - Use I_RpcGetBuffer, instead of our own buffer routines to fix an occasional test crash caused by heap corruption. - Zero the memory block passed to RpcServerRegisterIfEx so we don't pass garbage in some of the fields we don't fill in. - Return the correct error code from create_server and fix two handle leaks. - TODO update. - Remove cruft left over from previous RPC backend implementation in the apartment structure. - Don't pass an IPID by value for proxy_manager_create_ifproxy. - Disable more of RPC_UnregisterInterface to prevent the RPC runtime using freed memory. - Rename various external RPC backend functions so that they all have the same "RPC_" prefix. - Reduce the timeout of the function that connects to a local server to 30s, like native. - Make each ifproxy have its own channel buffer to fix a bug where a proxy with multiple interfaces could invoke the wrong stub buffer on the server. - The Global Interface Table should do table-strong marshaling instead of normal marshaling so that an interface can be retrieved more than one time. Mike Hearn <mh@codeweavers.com> - Avoid infinite loop when doing a typelib marshalled IUnknown::QueryInterface by only doing an extra QI if requested IID is not equal to marshalled IID. Rob Shearman <rob@codeweavers.com> Mike Hearn <mh@codeweavers.com> - Add re-entrancy tests to the test suite. - Run RPCs on a new thread client side so we can pump the message loop. Juan Lang <juan_lang@yahoo.com> - Fix the calling convention of DllCanUnloadNow. - Move vtbl to end of file and get rid of unnecessary prototypes. - Implement StgCreatePropSetStg. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Paul Vriens <Paul.Vriens@xs4all.nl> - Added some TRACE statements. svn path=/trunk/; revision=14083
2005-03-14 23:17:44 +00:00
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
static HRESULT PropertyStorage_CreateDictionaries(PropertyStorage_impl *This)
Sync to Wine-20050310: Jon Griffiths <jon_p_griffiths@yahoo.com> - Documentation spelling fixes. Mike McCormack <mike@codeweavers.com> - Implement and test IPropertySetStorage. - Fix more incorrect uses of STGM_ enumerations. - Add struct StorageBaseImpl at the start of derived structures instead of trying to keep the first members the same. - StgOpenStorage shouldn't open zero length storage files. - Shared reading of storage files requires STGM_TRANSACTED. - Test and fix grfMode handling in StgOpenDocfile. - Implement StgSetTimes. Robert Shearman <rob@codeweavers.com> - Better tracing. - Small cleanup of creation functions. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. - Move marshaling state machine into stub manager from ifstub. - Add additional needed states for table-weak marshaling, as shown by tests. - Protect external reference count from underflows/overflows. - Make COM use the RPC runtime as the backend for RPC calls. Based on a patch by Ove Ksven. - Invoke objects in STA's in the correct thread by sending messages to the hidden apartment window. - Use I_RpcGetBuffer, instead of our own buffer routines to fix an occasional test crash caused by heap corruption. - Zero the memory block passed to RpcServerRegisterIfEx so we don't pass garbage in some of the fields we don't fill in. - Return the correct error code from create_server and fix two handle leaks. - TODO update. - Remove cruft left over from previous RPC backend implementation in the apartment structure. - Don't pass an IPID by value for proxy_manager_create_ifproxy. - Disable more of RPC_UnregisterInterface to prevent the RPC runtime using freed memory. - Rename various external RPC backend functions so that they all have the same "RPC_" prefix. - Reduce the timeout of the function that connects to a local server to 30s, like native. - Make each ifproxy have its own channel buffer to fix a bug where a proxy with multiple interfaces could invoke the wrong stub buffer on the server. - The Global Interface Table should do table-strong marshaling instead of normal marshaling so that an interface can be retrieved more than one time. Mike Hearn <mh@codeweavers.com> - Avoid infinite loop when doing a typelib marshalled IUnknown::QueryInterface by only doing an extra QI if requested IID is not equal to marshalled IID. Rob Shearman <rob@codeweavers.com> Mike Hearn <mh@codeweavers.com> - Add re-entrancy tests to the test suite. - Run RPCs on a new thread client side so we can pump the message loop. Juan Lang <juan_lang@yahoo.com> - Fix the calling convention of DllCanUnloadNow. - Move vtbl to end of file and get rid of unnecessary prototypes. - Implement StgCreatePropSetStg. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Paul Vriens <Paul.Vriens@xs4all.nl> - Added some TRACE statements. svn path=/trunk/; revision=14083
2005-03-14 23:17:44 +00:00
{
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
HRESULT hr = S_OK;
Sync to Wine-20050310: Jon Griffiths <jon_p_griffiths@yahoo.com> - Documentation spelling fixes. Mike McCormack <mike@codeweavers.com> - Implement and test IPropertySetStorage. - Fix more incorrect uses of STGM_ enumerations. - Add struct StorageBaseImpl at the start of derived structures instead of trying to keep the first members the same. - StgOpenStorage shouldn't open zero length storage files. - Shared reading of storage files requires STGM_TRANSACTED. - Test and fix grfMode handling in StgOpenDocfile. - Implement StgSetTimes. Robert Shearman <rob@codeweavers.com> - Better tracing. - Small cleanup of creation functions. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. - Move marshaling state machine into stub manager from ifstub. - Add additional needed states for table-weak marshaling, as shown by tests. - Protect external reference count from underflows/overflows. - Make COM use the RPC runtime as the backend for RPC calls. Based on a patch by Ove Ksven. - Invoke objects in STA's in the correct thread by sending messages to the hidden apartment window. - Use I_RpcGetBuffer, instead of our own buffer routines to fix an occasional test crash caused by heap corruption. - Zero the memory block passed to RpcServerRegisterIfEx so we don't pass garbage in some of the fields we don't fill in. - Return the correct error code from create_server and fix two handle leaks. - TODO update. - Remove cruft left over from previous RPC backend implementation in the apartment structure. - Don't pass an IPID by value for proxy_manager_create_ifproxy. - Disable more of RPC_UnregisterInterface to prevent the RPC runtime using freed memory. - Rename various external RPC backend functions so that they all have the same "RPC_" prefix. - Reduce the timeout of the function that connects to a local server to 30s, like native. - Make each ifproxy have its own channel buffer to fix a bug where a proxy with multiple interfaces could invoke the wrong stub buffer on the server. - The Global Interface Table should do table-strong marshaling instead of normal marshaling so that an interface can be retrieved more than one time. Mike Hearn <mh@codeweavers.com> - Avoid infinite loop when doing a typelib marshalled IUnknown::QueryInterface by only doing an extra QI if requested IID is not equal to marshalled IID. Rob Shearman <rob@codeweavers.com> Mike Hearn <mh@codeweavers.com> - Add re-entrancy tests to the test suite. - Run RPCs on a new thread client side so we can pump the message loop. Juan Lang <juan_lang@yahoo.com> - Fix the calling convention of DllCanUnloadNow. - Move vtbl to end of file and get rid of unnecessary prototypes. - Implement StgCreatePropSetStg. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Paul Vriens <Paul.Vriens@xs4all.nl> - Added some TRACE statements. svn path=/trunk/; revision=14083
2005-03-14 23:17:44 +00:00
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
This->name_to_propid = dictionary_create(
PropertyStorage_PropNameCompare, PropertyStorage_PropNameDestroy,
This);
if (!This->name_to_propid)
{
hr = STG_E_INSUFFICIENTMEMORY;
goto end;
}
This->propid_to_name = dictionary_create(PropertyStorage_PropCompare,
NULL, This);
if (!This->propid_to_name)
{
hr = STG_E_INSUFFICIENTMEMORY;
goto end;
}
This->propid_to_prop = dictionary_create(PropertyStorage_PropCompare,
PropertyStorage_PropertyDestroy, This);
if (!This->propid_to_prop)
{
hr = STG_E_INSUFFICIENTMEMORY;
goto end;
}
end:
if (FAILED(hr))
PropertyStorage_DestroyDictionaries(This);
return hr;
}
static HRESULT PropertyStorage_BaseConstruct(IStream *stm,
REFFMTID rfmtid, DWORD grfMode, PropertyStorage_impl **pps)
{
HRESULT hr = S_OK;
assert(pps);
assert(rfmtid);
*pps = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof **pps);
Sync to Wine-20050524: Alexandre Julliard <julliard@winehq.org> - Added rules for building import libraries in the individual dll makefiles, and added support for building a .def.a static import library too. - Removed unnecessary code in the 16-bit DllEntryPoint function of some dlls, and also fixed its ordinal in a few places. - Comment out stub WEP entry points so that we can call WEP for builtin dlls too. Juan Lang <juan_lang@yahoo.com> - Obvious fixes to PropVariantClear and PropVariantCopy for vector types. - Add a comment, and a no-op cleanup. - Differentiate between version 0 and version 1 property storages. - Store property names in the code page of the property set. - maintain proper byte order - maintain PROPSETFLAG_ANSI flag based on codepage - update comments - Correct/improve error checking in IPropertyStorage. - convert strings between property storage's code page and system code page - add tests for setting code page - fix tests and behavior to match WinXP - Define and use endian conversion macros for big-endian machines. Marcus Meissner <marcus@jet.franken.de> - Move the Dll init function to compobj.c to avoid having global variables. Remove need of ole32_main.h. - Make HGLOBALStream_* functions static. - Make _xmalloc16() static. - Staticify FTMarshalImpl definition. Francois Gouget <fgouget@free.fr> - Specify the proper call convention in the PropSysFreeString() implementation. - Tweak the API documentation to silence winapi_check warnings. Robert Shearman <rob@codeweavers.com> - Add error messages on failure in file moniker load function. - Fix incorrect pointer check in both monikers. - Fix max size calculation of item moniker to match native. - Add a generic moniker marshaler that works by saving & loading monikers to & from the stream. - Use the generic moniker marshal in the file & item monikers and add a class factory for each. - Implement IROTData::GetComparisonData for file & item monikers. - Add a useful trace message. - Fix more places where custom header size was calculated exclusive of the data size member. - Optimize custom marshaling by getting size before calling the custom marshaler so we can write the header before and not use a second stream. - Change remaining blocks of code with 2-space indentation to 4-space indentation. - Make vtables const. - Remove an unnecessary memcpy and let the compiler do the work. - Write custom header up to and including size, not excluding. - Add a stub implementation of CoIsHandlerConnected. - Marshal objects & monikers into the ROT. - Test for this behaviour. Mike McCormack <mike@codeweavers.com> - Remove unnecessary declarations and make functions static. - Remove forward declarations. - Make sure a stream can't be created in read only storage. - Fix a memory leak in the ole storage implementation. - Remove function prototypes. Kevin Koltzau <kevin@plop.org> - Implement Hash function on composite moniker. Jeff Latimer <jeffl@defcen.gov.au> - Implement the IEnumMoniker interface for the ROT and provide tests to exercise the interface. Pierre d'Herbemont <stegefin@free.fr> - Big Endian specific code fixes in order to conform with NONAMELESSSTRUCT. Matthew Mastracci <matt@aclaro.com> - Replace stub entry for StgOpenStorageEx with call to StgOpenStorage. - Replace StgCreateStorageEx stub with call to StgCreateDocfile and add required STGFMT_* enumerations. svn path=/trunk/; revision=15562
2005-05-28 09:30:04 +00:00
if (!*pps)
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
return E_OUTOFMEMORY;
(*pps)->IPropertyStorage_iface.lpVtbl = &IPropertyStorage_Vtbl;
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
(*pps)->ref = 1;
InitializeCriticalSection(&(*pps)->cs);
(*pps)->cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": PropertyStorage_impl.cs");
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
(*pps)->stm = stm;
(*pps)->fmtid = *rfmtid;
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
(*pps)->grfMode = grfMode;
hr = PropertyStorage_CreateDictionaries(*pps);
Sync to Wine-20050524: Alexandre Julliard <julliard@winehq.org> - Added rules for building import libraries in the individual dll makefiles, and added support for building a .def.a static import library too. - Removed unnecessary code in the 16-bit DllEntryPoint function of some dlls, and also fixed its ordinal in a few places. - Comment out stub WEP entry points so that we can call WEP for builtin dlls too. Juan Lang <juan_lang@yahoo.com> - Obvious fixes to PropVariantClear and PropVariantCopy for vector types. - Add a comment, and a no-op cleanup. - Differentiate between version 0 and version 1 property storages. - Store property names in the code page of the property set. - maintain proper byte order - maintain PROPSETFLAG_ANSI flag based on codepage - update comments - Correct/improve error checking in IPropertyStorage. - convert strings between property storage's code page and system code page - add tests for setting code page - fix tests and behavior to match WinXP - Define and use endian conversion macros for big-endian machines. Marcus Meissner <marcus@jet.franken.de> - Move the Dll init function to compobj.c to avoid having global variables. Remove need of ole32_main.h. - Make HGLOBALStream_* functions static. - Make _xmalloc16() static. - Staticify FTMarshalImpl definition. Francois Gouget <fgouget@free.fr> - Specify the proper call convention in the PropSysFreeString() implementation. - Tweak the API documentation to silence winapi_check warnings. Robert Shearman <rob@codeweavers.com> - Add error messages on failure in file moniker load function. - Fix incorrect pointer check in both monikers. - Fix max size calculation of item moniker to match native. - Add a generic moniker marshaler that works by saving & loading monikers to & from the stream. - Use the generic moniker marshal in the file & item monikers and add a class factory for each. - Implement IROTData::GetComparisonData for file & item monikers. - Add a useful trace message. - Fix more places where custom header size was calculated exclusive of the data size member. - Optimize custom marshaling by getting size before calling the custom marshaler so we can write the header before and not use a second stream. - Change remaining blocks of code with 2-space indentation to 4-space indentation. - Make vtables const. - Remove an unnecessary memcpy and let the compiler do the work. - Write custom header up to and including size, not excluding. - Add a stub implementation of CoIsHandlerConnected. - Marshal objects & monikers into the ROT. - Test for this behaviour. Mike McCormack <mike@codeweavers.com> - Remove unnecessary declarations and make functions static. - Remove forward declarations. - Make sure a stream can't be created in read only storage. - Fix a memory leak in the ole storage implementation. - Remove function prototypes. Kevin Koltzau <kevin@plop.org> - Implement Hash function on composite moniker. Jeff Latimer <jeffl@defcen.gov.au> - Implement the IEnumMoniker interface for the ROT and provide tests to exercise the interface. Pierre d'Herbemont <stegefin@free.fr> - Big Endian specific code fixes in order to conform with NONAMELESSSTRUCT. Matthew Mastracci <matt@aclaro.com> - Replace stub entry for StgOpenStorageEx with call to StgOpenStorage. - Replace StgCreateStorageEx stub with call to StgCreateDocfile and add required STGFMT_* enumerations. svn path=/trunk/; revision=15562
2005-05-28 09:30:04 +00:00
if (FAILED(hr))
{
(*pps)->cs.DebugInfo->Spare[0] = 0;
Sync to Wine-20050524: Alexandre Julliard <julliard@winehq.org> - Added rules for building import libraries in the individual dll makefiles, and added support for building a .def.a static import library too. - Removed unnecessary code in the 16-bit DllEntryPoint function of some dlls, and also fixed its ordinal in a few places. - Comment out stub WEP entry points so that we can call WEP for builtin dlls too. Juan Lang <juan_lang@yahoo.com> - Obvious fixes to PropVariantClear and PropVariantCopy for vector types. - Add a comment, and a no-op cleanup. - Differentiate between version 0 and version 1 property storages. - Store property names in the code page of the property set. - maintain proper byte order - maintain PROPSETFLAG_ANSI flag based on codepage - update comments - Correct/improve error checking in IPropertyStorage. - convert strings between property storage's code page and system code page - add tests for setting code page - fix tests and behavior to match WinXP - Define and use endian conversion macros for big-endian machines. Marcus Meissner <marcus@jet.franken.de> - Move the Dll init function to compobj.c to avoid having global variables. Remove need of ole32_main.h. - Make HGLOBALStream_* functions static. - Make _xmalloc16() static. - Staticify FTMarshalImpl definition. Francois Gouget <fgouget@free.fr> - Specify the proper call convention in the PropSysFreeString() implementation. - Tweak the API documentation to silence winapi_check warnings. Robert Shearman <rob@codeweavers.com> - Add error messages on failure in file moniker load function. - Fix incorrect pointer check in both monikers. - Fix max size calculation of item moniker to match native. - Add a generic moniker marshaler that works by saving & loading monikers to & from the stream. - Use the generic moniker marshal in the file & item monikers and add a class factory for each. - Implement IROTData::GetComparisonData for file & item monikers. - Add a useful trace message. - Fix more places where custom header size was calculated exclusive of the data size member. - Optimize custom marshaling by getting size before calling the custom marshaler so we can write the header before and not use a second stream. - Change remaining blocks of code with 2-space indentation to 4-space indentation. - Make vtables const. - Remove an unnecessary memcpy and let the compiler do the work. - Write custom header up to and including size, not excluding. - Add a stub implementation of CoIsHandlerConnected. - Marshal objects & monikers into the ROT. - Test for this behaviour. Mike McCormack <mike@codeweavers.com> - Remove unnecessary declarations and make functions static. - Remove forward declarations. - Make sure a stream can't be created in read only storage. - Fix a memory leak in the ole storage implementation. - Remove function prototypes. Kevin Koltzau <kevin@plop.org> - Implement Hash function on composite moniker. Jeff Latimer <jeffl@defcen.gov.au> - Implement the IEnumMoniker interface for the ROT and provide tests to exercise the interface. Pierre d'Herbemont <stegefin@free.fr> - Big Endian specific code fixes in order to conform with NONAMELESSSTRUCT. Matthew Mastracci <matt@aclaro.com> - Replace stub entry for StgOpenStorageEx with call to StgOpenStorage. - Replace StgCreateStorageEx stub with call to StgCreateDocfile and add required STGFMT_* enumerations. svn path=/trunk/; revision=15562
2005-05-28 09:30:04 +00:00
DeleteCriticalSection(&(*pps)->cs);
HeapFree(GetProcessHeap(), 0, *pps);
*pps = NULL;
}
else IStream_AddRef( stm );
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
return hr;
Sync to Wine-20050310: Jon Griffiths <jon_p_griffiths@yahoo.com> - Documentation spelling fixes. Mike McCormack <mike@codeweavers.com> - Implement and test IPropertySetStorage. - Fix more incorrect uses of STGM_ enumerations. - Add struct StorageBaseImpl at the start of derived structures instead of trying to keep the first members the same. - StgOpenStorage shouldn't open zero length storage files. - Shared reading of storage files requires STGM_TRANSACTED. - Test and fix grfMode handling in StgOpenDocfile. - Implement StgSetTimes. Robert Shearman <rob@codeweavers.com> - Better tracing. - Small cleanup of creation functions. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. - Move marshaling state machine into stub manager from ifstub. - Add additional needed states for table-weak marshaling, as shown by tests. - Protect external reference count from underflows/overflows. - Make COM use the RPC runtime as the backend for RPC calls. Based on a patch by Ove Ksven. - Invoke objects in STA's in the correct thread by sending messages to the hidden apartment window. - Use I_RpcGetBuffer, instead of our own buffer routines to fix an occasional test crash caused by heap corruption. - Zero the memory block passed to RpcServerRegisterIfEx so we don't pass garbage in some of the fields we don't fill in. - Return the correct error code from create_server and fix two handle leaks. - TODO update. - Remove cruft left over from previous RPC backend implementation in the apartment structure. - Don't pass an IPID by value for proxy_manager_create_ifproxy. - Disable more of RPC_UnregisterInterface to prevent the RPC runtime using freed memory. - Rename various external RPC backend functions so that they all have the same "RPC_" prefix. - Reduce the timeout of the function that connects to a local server to 30s, like native. - Make each ifproxy have its own channel buffer to fix a bug where a proxy with multiple interfaces could invoke the wrong stub buffer on the server. - The Global Interface Table should do table-strong marshaling instead of normal marshaling so that an interface can be retrieved more than one time. Mike Hearn <mh@codeweavers.com> - Avoid infinite loop when doing a typelib marshalled IUnknown::QueryInterface by only doing an extra QI if requested IID is not equal to marshalled IID. Rob Shearman <rob@codeweavers.com> Mike Hearn <mh@codeweavers.com> - Add re-entrancy tests to the test suite. - Run RPCs on a new thread client side so we can pump the message loop. Juan Lang <juan_lang@yahoo.com> - Fix the calling convention of DllCanUnloadNow. - Move vtbl to end of file and get rid of unnecessary prototypes. - Implement StgCreatePropSetStg. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Paul Vriens <Paul.Vriens@xs4all.nl> - Added some TRACE statements. svn path=/trunk/; revision=14083
2005-03-14 23:17:44 +00:00
}
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
static HRESULT PropertyStorage_ConstructFromStream(IStream *stm,
REFFMTID rfmtid, DWORD grfMode, IPropertyStorage** pps)
{
PropertyStorage_impl *ps;
HRESULT hr;
assert(pps);
hr = PropertyStorage_BaseConstruct(stm, rfmtid, grfMode, &ps);
if (SUCCEEDED(hr))
{
hr = PropertyStorage_ReadFromStream(ps);
if (SUCCEEDED(hr))
{
*pps = &ps->IPropertyStorage_iface;
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
TRACE("PropertyStorage %p constructed\n", ps);
hr = S_OK;
}
else IPropertyStorage_Release( &ps->IPropertyStorage_iface );
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
}
return hr;
}
static HRESULT PropertyStorage_ConstructEmpty(IStream *stm,
REFFMTID rfmtid, DWORD grfFlags, DWORD grfMode, IPropertyStorage** pps)
{
PropertyStorage_impl *ps;
HRESULT hr;
assert(pps);
hr = PropertyStorage_BaseConstruct(stm, rfmtid, grfMode, &ps);
if (SUCCEEDED(hr))
{
Sync to Wine-20050524: Alexandre Julliard <julliard@winehq.org> - Added rules for building import libraries in the individual dll makefiles, and added support for building a .def.a static import library too. - Removed unnecessary code in the 16-bit DllEntryPoint function of some dlls, and also fixed its ordinal in a few places. - Comment out stub WEP entry points so that we can call WEP for builtin dlls too. Juan Lang <juan_lang@yahoo.com> - Obvious fixes to PropVariantClear and PropVariantCopy for vector types. - Add a comment, and a no-op cleanup. - Differentiate between version 0 and version 1 property storages. - Store property names in the code page of the property set. - maintain proper byte order - maintain PROPSETFLAG_ANSI flag based on codepage - update comments - Correct/improve error checking in IPropertyStorage. - convert strings between property storage's code page and system code page - add tests for setting code page - fix tests and behavior to match WinXP - Define and use endian conversion macros for big-endian machines. Marcus Meissner <marcus@jet.franken.de> - Move the Dll init function to compobj.c to avoid having global variables. Remove need of ole32_main.h. - Make HGLOBALStream_* functions static. - Make _xmalloc16() static. - Staticify FTMarshalImpl definition. Francois Gouget <fgouget@free.fr> - Specify the proper call convention in the PropSysFreeString() implementation. - Tweak the API documentation to silence winapi_check warnings. Robert Shearman <rob@codeweavers.com> - Add error messages on failure in file moniker load function. - Fix incorrect pointer check in both monikers. - Fix max size calculation of item moniker to match native. - Add a generic moniker marshaler that works by saving & loading monikers to & from the stream. - Use the generic moniker marshal in the file & item monikers and add a class factory for each. - Implement IROTData::GetComparisonData for file & item monikers. - Add a useful trace message. - Fix more places where custom header size was calculated exclusive of the data size member. - Optimize custom marshaling by getting size before calling the custom marshaler so we can write the header before and not use a second stream. - Change remaining blocks of code with 2-space indentation to 4-space indentation. - Make vtables const. - Remove an unnecessary memcpy and let the compiler do the work. - Write custom header up to and including size, not excluding. - Add a stub implementation of CoIsHandlerConnected. - Marshal objects & monikers into the ROT. - Test for this behaviour. Mike McCormack <mike@codeweavers.com> - Remove unnecessary declarations and make functions static. - Remove forward declarations. - Make sure a stream can't be created in read only storage. - Fix a memory leak in the ole storage implementation. - Remove function prototypes. Kevin Koltzau <kevin@plop.org> - Implement Hash function on composite moniker. Jeff Latimer <jeffl@defcen.gov.au> - Implement the IEnumMoniker interface for the ROT and provide tests to exercise the interface. Pierre d'Herbemont <stegefin@free.fr> - Big Endian specific code fixes in order to conform with NONAMELESSSTRUCT. Matthew Mastracci <matt@aclaro.com> - Replace stub entry for StgOpenStorageEx with call to StgOpenStorage. - Replace StgCreateStorageEx stub with call to StgCreateDocfile and add required STGFMT_* enumerations. svn path=/trunk/; revision=15562
2005-05-28 09:30:04 +00:00
ps->format = 0;
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
ps->grfFlags = grfFlags;
Sync to Wine-20050524: Alexandre Julliard <julliard@winehq.org> - Added rules for building import libraries in the individual dll makefiles, and added support for building a .def.a static import library too. - Removed unnecessary code in the 16-bit DllEntryPoint function of some dlls, and also fixed its ordinal in a few places. - Comment out stub WEP entry points so that we can call WEP for builtin dlls too. Juan Lang <juan_lang@yahoo.com> - Obvious fixes to PropVariantClear and PropVariantCopy for vector types. - Add a comment, and a no-op cleanup. - Differentiate between version 0 and version 1 property storages. - Store property names in the code page of the property set. - maintain proper byte order - maintain PROPSETFLAG_ANSI flag based on codepage - update comments - Correct/improve error checking in IPropertyStorage. - convert strings between property storage's code page and system code page - add tests for setting code page - fix tests and behavior to match WinXP - Define and use endian conversion macros for big-endian machines. Marcus Meissner <marcus@jet.franken.de> - Move the Dll init function to compobj.c to avoid having global variables. Remove need of ole32_main.h. - Make HGLOBALStream_* functions static. - Make _xmalloc16() static. - Staticify FTMarshalImpl definition. Francois Gouget <fgouget@free.fr> - Specify the proper call convention in the PropSysFreeString() implementation. - Tweak the API documentation to silence winapi_check warnings. Robert Shearman <rob@codeweavers.com> - Add error messages on failure in file moniker load function. - Fix incorrect pointer check in both monikers. - Fix max size calculation of item moniker to match native. - Add a generic moniker marshaler that works by saving & loading monikers to & from the stream. - Use the generic moniker marshal in the file & item monikers and add a class factory for each. - Implement IROTData::GetComparisonData for file & item monikers. - Add a useful trace message. - Fix more places where custom header size was calculated exclusive of the data size member. - Optimize custom marshaling by getting size before calling the custom marshaler so we can write the header before and not use a second stream. - Change remaining blocks of code with 2-space indentation to 4-space indentation. - Make vtables const. - Remove an unnecessary memcpy and let the compiler do the work. - Write custom header up to and including size, not excluding. - Add a stub implementation of CoIsHandlerConnected. - Marshal objects & monikers into the ROT. - Test for this behaviour. Mike McCormack <mike@codeweavers.com> - Remove unnecessary declarations and make functions static. - Remove forward declarations. - Make sure a stream can't be created in read only storage. - Fix a memory leak in the ole storage implementation. - Remove function prototypes. Kevin Koltzau <kevin@plop.org> - Implement Hash function on composite moniker. Jeff Latimer <jeffl@defcen.gov.au> - Implement the IEnumMoniker interface for the ROT and provide tests to exercise the interface. Pierre d'Herbemont <stegefin@free.fr> - Big Endian specific code fixes in order to conform with NONAMELESSSTRUCT. Matthew Mastracci <matt@aclaro.com> - Replace stub entry for StgOpenStorageEx with call to StgOpenStorage. - Replace StgCreateStorageEx stub with call to StgCreateDocfile and add required STGFMT_* enumerations. svn path=/trunk/; revision=15562
2005-05-28 09:30:04 +00:00
if (ps->grfFlags & PROPSETFLAG_CASE_SENSITIVE)
ps->format = 1;
/* default to Unicode unless told not to, as specified on msdn */
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
if (ps->grfFlags & PROPSETFLAG_ANSI)
ps->codePage = GetACP();
else
ps->codePage = CP_UNICODE;
ps->locale = LOCALE_SYSTEM_DEFAULT;
TRACE("Code page is %d, locale is %d\n", ps->codePage, ps->locale);
*pps = &ps->IPropertyStorage_iface;
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
TRACE("PropertyStorage %p constructed\n", ps);
hr = S_OK;
}
return hr;
}
/***********************************************************************
* Implementation of IPropertySetStorage
*/
Sync to Wine-20050310: Jon Griffiths <jon_p_griffiths@yahoo.com> - Documentation spelling fixes. Mike McCormack <mike@codeweavers.com> - Implement and test IPropertySetStorage. - Fix more incorrect uses of STGM_ enumerations. - Add struct StorageBaseImpl at the start of derived structures instead of trying to keep the first members the same. - StgOpenStorage shouldn't open zero length storage files. - Shared reading of storage files requires STGM_TRANSACTED. - Test and fix grfMode handling in StgOpenDocfile. - Implement StgSetTimes. Robert Shearman <rob@codeweavers.com> - Better tracing. - Small cleanup of creation functions. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. - Move marshaling state machine into stub manager from ifstub. - Add additional needed states for table-weak marshaling, as shown by tests. - Protect external reference count from underflows/overflows. - Make COM use the RPC runtime as the backend for RPC calls. Based on a patch by Ove Ksven. - Invoke objects in STA's in the correct thread by sending messages to the hidden apartment window. - Use I_RpcGetBuffer, instead of our own buffer routines to fix an occasional test crash caused by heap corruption. - Zero the memory block passed to RpcServerRegisterIfEx so we don't pass garbage in some of the fields we don't fill in. - Return the correct error code from create_server and fix two handle leaks. - TODO update. - Remove cruft left over from previous RPC backend implementation in the apartment structure. - Don't pass an IPID by value for proxy_manager_create_ifproxy. - Disable more of RPC_UnregisterInterface to prevent the RPC runtime using freed memory. - Rename various external RPC backend functions so that they all have the same "RPC_" prefix. - Reduce the timeout of the function that connects to a local server to 30s, like native. - Make each ifproxy have its own channel buffer to fix a bug where a proxy with multiple interfaces could invoke the wrong stub buffer on the server. - The Global Interface Table should do table-strong marshaling instead of normal marshaling so that an interface can be retrieved more than one time. Mike Hearn <mh@codeweavers.com> - Avoid infinite loop when doing a typelib marshalled IUnknown::QueryInterface by only doing an extra QI if requested IID is not equal to marshalled IID. Rob Shearman <rob@codeweavers.com> Mike Hearn <mh@codeweavers.com> - Add re-entrancy tests to the test suite. - Run RPCs on a new thread client side so we can pump the message loop. Juan Lang <juan_lang@yahoo.com> - Fix the calling convention of DllCanUnloadNow. - Move vtbl to end of file and get rid of unnecessary prototypes. - Implement StgCreatePropSetStg. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Paul Vriens <Paul.Vriens@xs4all.nl> - Added some TRACE statements. svn path=/trunk/; revision=14083
2005-03-14 23:17:44 +00:00
/************************************************************************
* IPropertySetStorage_fnQueryInterface (IUnknown)
*
* This method forwards to the common QueryInterface implementation
*/
static HRESULT WINAPI IPropertySetStorage_fnQueryInterface(
IPropertySetStorage *ppstg,
REFIID riid,
void** ppvObject)
{
Sync to Wine-20050830: Francois Gouget <fgouget@free.fr> - Use LPSTORAGE to better match the PSDK. Document the real SEGPTR type using the standard documentation mechanisms. Fixes winapi_check warnings. Robert Shearman <rob@codeweavers.com> - Remove unused thread handle entry from the apartment structure. - Implement IMarshal on proxies so that we don't end up with proxies to proxies, causing potential deadlock issues and performance problems. - Add a test for this situation and remove the todo_wine from another test that now succeeds. - Add stub for CoAllowSetForegroundWindow. Vincent Beron <vberon@mecano.gme.usherb.ca> - Remove local declarations already in included public headers. - Correct mismatches between spec files and comments about export number. Alexandre Julliard <julliard@winehq.org> - Uncomment the typedef in the DECLARE_INTERFACE macro, and get rid of duplicate typedefs. - Use the proper WOW functions everywhere instead of the K32WOW variant. - Don't prefix the functions DllCanUnloadNow, DllGetClassObject and Dll(Un)RegisterServer with the dll name so that the compiler can check the prototypes. - Remove duplicate definition of FILE_BEGIN. - Replace the _ICOM_THIS_From macros by inline functions the way it's already done in shelllink.c. Mike McCormack <mike@codeweavers.com> - Warning fixes for gcc 4.0. - Fix some gcc 4.0 warnings. - return a precomputed result for a NULL string - pass strlen an LPSTR to eliminate a sign warning Marcus Meissner <marcus@jet.franken.de> - Implemented ILockBytes16 (memorystream) support for the 16bit compound storage implementation. - Added ReadClassStg, OleDoAutoConvert, GetConvertStg implementations/stubs. Marcus Meissner <meissner@suse.de> - Added CoCreateInstance16, CoGetClassObject16, OleLoad16 stubs. svn path=/trunk/; revision=17678
2005-09-05 21:56:14 +00:00
StorageImpl *This = impl_from_IPropertySetStorage(ppstg);
return IStorage_QueryInterface( &This->base.IStorage_iface, riid, ppvObject );
Sync to Wine-20050310: Jon Griffiths <jon_p_griffiths@yahoo.com> - Documentation spelling fixes. Mike McCormack <mike@codeweavers.com> - Implement and test IPropertySetStorage. - Fix more incorrect uses of STGM_ enumerations. - Add struct StorageBaseImpl at the start of derived structures instead of trying to keep the first members the same. - StgOpenStorage shouldn't open zero length storage files. - Shared reading of storage files requires STGM_TRANSACTED. - Test and fix grfMode handling in StgOpenDocfile. - Implement StgSetTimes. Robert Shearman <rob@codeweavers.com> - Better tracing. - Small cleanup of creation functions. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. - Move marshaling state machine into stub manager from ifstub. - Add additional needed states for table-weak marshaling, as shown by tests. - Protect external reference count from underflows/overflows. - Make COM use the RPC runtime as the backend for RPC calls. Based on a patch by Ove Ksven. - Invoke objects in STA's in the correct thread by sending messages to the hidden apartment window. - Use I_RpcGetBuffer, instead of our own buffer routines to fix an occasional test crash caused by heap corruption. - Zero the memory block passed to RpcServerRegisterIfEx so we don't pass garbage in some of the fields we don't fill in. - Return the correct error code from create_server and fix two handle leaks. - TODO update. - Remove cruft left over from previous RPC backend implementation in the apartment structure. - Don't pass an IPID by value for proxy_manager_create_ifproxy. - Disable more of RPC_UnregisterInterface to prevent the RPC runtime using freed memory. - Rename various external RPC backend functions so that they all have the same "RPC_" prefix. - Reduce the timeout of the function that connects to a local server to 30s, like native. - Make each ifproxy have its own channel buffer to fix a bug where a proxy with multiple interfaces could invoke the wrong stub buffer on the server. - The Global Interface Table should do table-strong marshaling instead of normal marshaling so that an interface can be retrieved more than one time. Mike Hearn <mh@codeweavers.com> - Avoid infinite loop when doing a typelib marshalled IUnknown::QueryInterface by only doing an extra QI if requested IID is not equal to marshalled IID. Rob Shearman <rob@codeweavers.com> Mike Hearn <mh@codeweavers.com> - Add re-entrancy tests to the test suite. - Run RPCs on a new thread client side so we can pump the message loop. Juan Lang <juan_lang@yahoo.com> - Fix the calling convention of DllCanUnloadNow. - Move vtbl to end of file and get rid of unnecessary prototypes. - Implement StgCreatePropSetStg. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Paul Vriens <Paul.Vriens@xs4all.nl> - Added some TRACE statements. svn path=/trunk/; revision=14083
2005-03-14 23:17:44 +00:00
}
/************************************************************************
* IPropertySetStorage_fnAddRef (IUnknown)
*
* This method forwards to the common AddRef implementation
*/
static ULONG WINAPI IPropertySetStorage_fnAddRef(
IPropertySetStorage *ppstg)
{
Sync to Wine-20050830: Francois Gouget <fgouget@free.fr> - Use LPSTORAGE to better match the PSDK. Document the real SEGPTR type using the standard documentation mechanisms. Fixes winapi_check warnings. Robert Shearman <rob@codeweavers.com> - Remove unused thread handle entry from the apartment structure. - Implement IMarshal on proxies so that we don't end up with proxies to proxies, causing potential deadlock issues and performance problems. - Add a test for this situation and remove the todo_wine from another test that now succeeds. - Add stub for CoAllowSetForegroundWindow. Vincent Beron <vberon@mecano.gme.usherb.ca> - Remove local declarations already in included public headers. - Correct mismatches between spec files and comments about export number. Alexandre Julliard <julliard@winehq.org> - Uncomment the typedef in the DECLARE_INTERFACE macro, and get rid of duplicate typedefs. - Use the proper WOW functions everywhere instead of the K32WOW variant. - Don't prefix the functions DllCanUnloadNow, DllGetClassObject and Dll(Un)RegisterServer with the dll name so that the compiler can check the prototypes. - Remove duplicate definition of FILE_BEGIN. - Replace the _ICOM_THIS_From macros by inline functions the way it's already done in shelllink.c. Mike McCormack <mike@codeweavers.com> - Warning fixes for gcc 4.0. - Fix some gcc 4.0 warnings. - return a precomputed result for a NULL string - pass strlen an LPSTR to eliminate a sign warning Marcus Meissner <marcus@jet.franken.de> - Implemented ILockBytes16 (memorystream) support for the 16bit compound storage implementation. - Added ReadClassStg, OleDoAutoConvert, GetConvertStg implementations/stubs. Marcus Meissner <meissner@suse.de> - Added CoCreateInstance16, CoGetClassObject16, OleLoad16 stubs. svn path=/trunk/; revision=17678
2005-09-05 21:56:14 +00:00
StorageImpl *This = impl_from_IPropertySetStorage(ppstg);
return IStorage_AddRef( &This->base.IStorage_iface );
Sync to Wine-20050310: Jon Griffiths <jon_p_griffiths@yahoo.com> - Documentation spelling fixes. Mike McCormack <mike@codeweavers.com> - Implement and test IPropertySetStorage. - Fix more incorrect uses of STGM_ enumerations. - Add struct StorageBaseImpl at the start of derived structures instead of trying to keep the first members the same. - StgOpenStorage shouldn't open zero length storage files. - Shared reading of storage files requires STGM_TRANSACTED. - Test and fix grfMode handling in StgOpenDocfile. - Implement StgSetTimes. Robert Shearman <rob@codeweavers.com> - Better tracing. - Small cleanup of creation functions. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. - Move marshaling state machine into stub manager from ifstub. - Add additional needed states for table-weak marshaling, as shown by tests. - Protect external reference count from underflows/overflows. - Make COM use the RPC runtime as the backend for RPC calls. Based on a patch by Ove Ksven. - Invoke objects in STA's in the correct thread by sending messages to the hidden apartment window. - Use I_RpcGetBuffer, instead of our own buffer routines to fix an occasional test crash caused by heap corruption. - Zero the memory block passed to RpcServerRegisterIfEx so we don't pass garbage in some of the fields we don't fill in. - Return the correct error code from create_server and fix two handle leaks. - TODO update. - Remove cruft left over from previous RPC backend implementation in the apartment structure. - Don't pass an IPID by value for proxy_manager_create_ifproxy. - Disable more of RPC_UnregisterInterface to prevent the RPC runtime using freed memory. - Rename various external RPC backend functions so that they all have the same "RPC_" prefix. - Reduce the timeout of the function that connects to a local server to 30s, like native. - Make each ifproxy have its own channel buffer to fix a bug where a proxy with multiple interfaces could invoke the wrong stub buffer on the server. - The Global Interface Table should do table-strong marshaling instead of normal marshaling so that an interface can be retrieved more than one time. Mike Hearn <mh@codeweavers.com> - Avoid infinite loop when doing a typelib marshalled IUnknown::QueryInterface by only doing an extra QI if requested IID is not equal to marshalled IID. Rob Shearman <rob@codeweavers.com> Mike Hearn <mh@codeweavers.com> - Add re-entrancy tests to the test suite. - Run RPCs on a new thread client side so we can pump the message loop. Juan Lang <juan_lang@yahoo.com> - Fix the calling convention of DllCanUnloadNow. - Move vtbl to end of file and get rid of unnecessary prototypes. - Implement StgCreatePropSetStg. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Paul Vriens <Paul.Vriens@xs4all.nl> - Added some TRACE statements. svn path=/trunk/; revision=14083
2005-03-14 23:17:44 +00:00
}
/************************************************************************
* IPropertySetStorage_fnRelease (IUnknown)
*
* This method forwards to the common Release implementation
*/
static ULONG WINAPI IPropertySetStorage_fnRelease(
IPropertySetStorage *ppstg)
{
Sync to Wine-20050830: Francois Gouget <fgouget@free.fr> - Use LPSTORAGE to better match the PSDK. Document the real SEGPTR type using the standard documentation mechanisms. Fixes winapi_check warnings. Robert Shearman <rob@codeweavers.com> - Remove unused thread handle entry from the apartment structure. - Implement IMarshal on proxies so that we don't end up with proxies to proxies, causing potential deadlock issues and performance problems. - Add a test for this situation and remove the todo_wine from another test that now succeeds. - Add stub for CoAllowSetForegroundWindow. Vincent Beron <vberon@mecano.gme.usherb.ca> - Remove local declarations already in included public headers. - Correct mismatches between spec files and comments about export number. Alexandre Julliard <julliard@winehq.org> - Uncomment the typedef in the DECLARE_INTERFACE macro, and get rid of duplicate typedefs. - Use the proper WOW functions everywhere instead of the K32WOW variant. - Don't prefix the functions DllCanUnloadNow, DllGetClassObject and Dll(Un)RegisterServer with the dll name so that the compiler can check the prototypes. - Remove duplicate definition of FILE_BEGIN. - Replace the _ICOM_THIS_From macros by inline functions the way it's already done in shelllink.c. Mike McCormack <mike@codeweavers.com> - Warning fixes for gcc 4.0. - Fix some gcc 4.0 warnings. - return a precomputed result for a NULL string - pass strlen an LPSTR to eliminate a sign warning Marcus Meissner <marcus@jet.franken.de> - Implemented ILockBytes16 (memorystream) support for the 16bit compound storage implementation. - Added ReadClassStg, OleDoAutoConvert, GetConvertStg implementations/stubs. Marcus Meissner <meissner@suse.de> - Added CoCreateInstance16, CoGetClassObject16, OleLoad16 stubs. svn path=/trunk/; revision=17678
2005-09-05 21:56:14 +00:00
StorageImpl *This = impl_from_IPropertySetStorage(ppstg);
return IStorage_Release( &This->base.IStorage_iface );
Sync to Wine-20050310: Jon Griffiths <jon_p_griffiths@yahoo.com> - Documentation spelling fixes. Mike McCormack <mike@codeweavers.com> - Implement and test IPropertySetStorage. - Fix more incorrect uses of STGM_ enumerations. - Add struct StorageBaseImpl at the start of derived structures instead of trying to keep the first members the same. - StgOpenStorage shouldn't open zero length storage files. - Shared reading of storage files requires STGM_TRANSACTED. - Test and fix grfMode handling in StgOpenDocfile. - Implement StgSetTimes. Robert Shearman <rob@codeweavers.com> - Better tracing. - Small cleanup of creation functions. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. - Move marshaling state machine into stub manager from ifstub. - Add additional needed states for table-weak marshaling, as shown by tests. - Protect external reference count from underflows/overflows. - Make COM use the RPC runtime as the backend for RPC calls. Based on a patch by Ove Ksven. - Invoke objects in STA's in the correct thread by sending messages to the hidden apartment window. - Use I_RpcGetBuffer, instead of our own buffer routines to fix an occasional test crash caused by heap corruption. - Zero the memory block passed to RpcServerRegisterIfEx so we don't pass garbage in some of the fields we don't fill in. - Return the correct error code from create_server and fix two handle leaks. - TODO update. - Remove cruft left over from previous RPC backend implementation in the apartment structure. - Don't pass an IPID by value for proxy_manager_create_ifproxy. - Disable more of RPC_UnregisterInterface to prevent the RPC runtime using freed memory. - Rename various external RPC backend functions so that they all have the same "RPC_" prefix. - Reduce the timeout of the function that connects to a local server to 30s, like native. - Make each ifproxy have its own channel buffer to fix a bug where a proxy with multiple interfaces could invoke the wrong stub buffer on the server. - The Global Interface Table should do table-strong marshaling instead of normal marshaling so that an interface can be retrieved more than one time. Mike Hearn <mh@codeweavers.com> - Avoid infinite loop when doing a typelib marshalled IUnknown::QueryInterface by only doing an extra QI if requested IID is not equal to marshalled IID. Rob Shearman <rob@codeweavers.com> Mike Hearn <mh@codeweavers.com> - Add re-entrancy tests to the test suite. - Run RPCs on a new thread client side so we can pump the message loop. Juan Lang <juan_lang@yahoo.com> - Fix the calling convention of DllCanUnloadNow. - Move vtbl to end of file and get rid of unnecessary prototypes. - Implement StgCreatePropSetStg. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Paul Vriens <Paul.Vriens@xs4all.nl> - Added some TRACE statements. svn path=/trunk/; revision=14083
2005-03-14 23:17:44 +00:00
}
/************************************************************************
* IPropertySetStorage_fnCreate (IPropertySetStorage)
*/
static HRESULT WINAPI IPropertySetStorage_fnCreate(
IPropertySetStorage *ppstg,
REFFMTID rfmtid,
const CLSID* pclsid,
DWORD grfFlags,
DWORD grfMode,
IPropertyStorage** ppprstg)
{
Sync to Wine-20050830: Francois Gouget <fgouget@free.fr> - Use LPSTORAGE to better match the PSDK. Document the real SEGPTR type using the standard documentation mechanisms. Fixes winapi_check warnings. Robert Shearman <rob@codeweavers.com> - Remove unused thread handle entry from the apartment structure. - Implement IMarshal on proxies so that we don't end up with proxies to proxies, causing potential deadlock issues and performance problems. - Add a test for this situation and remove the todo_wine from another test that now succeeds. - Add stub for CoAllowSetForegroundWindow. Vincent Beron <vberon@mecano.gme.usherb.ca> - Remove local declarations already in included public headers. - Correct mismatches between spec files and comments about export number. Alexandre Julliard <julliard@winehq.org> - Uncomment the typedef in the DECLARE_INTERFACE macro, and get rid of duplicate typedefs. - Use the proper WOW functions everywhere instead of the K32WOW variant. - Don't prefix the functions DllCanUnloadNow, DllGetClassObject and Dll(Un)RegisterServer with the dll name so that the compiler can check the prototypes. - Remove duplicate definition of FILE_BEGIN. - Replace the _ICOM_THIS_From macros by inline functions the way it's already done in shelllink.c. Mike McCormack <mike@codeweavers.com> - Warning fixes for gcc 4.0. - Fix some gcc 4.0 warnings. - return a precomputed result for a NULL string - pass strlen an LPSTR to eliminate a sign warning Marcus Meissner <marcus@jet.franken.de> - Implemented ILockBytes16 (memorystream) support for the 16bit compound storage implementation. - Added ReadClassStg, OleDoAutoConvert, GetConvertStg implementations/stubs. Marcus Meissner <meissner@suse.de> - Added CoCreateInstance16, CoGetClassObject16, OleLoad16 stubs. svn path=/trunk/; revision=17678
2005-09-05 21:56:14 +00:00
StorageImpl *This = impl_from_IPropertySetStorage(ppstg);
WCHAR name[CCH_MAX_PROPSTG_NAME + 1];
Sync to Wine-20050310: Jon Griffiths <jon_p_griffiths@yahoo.com> - Documentation spelling fixes. Mike McCormack <mike@codeweavers.com> - Implement and test IPropertySetStorage. - Fix more incorrect uses of STGM_ enumerations. - Add struct StorageBaseImpl at the start of derived structures instead of trying to keep the first members the same. - StgOpenStorage shouldn't open zero length storage files. - Shared reading of storage files requires STGM_TRANSACTED. - Test and fix grfMode handling in StgOpenDocfile. - Implement StgSetTimes. Robert Shearman <rob@codeweavers.com> - Better tracing. - Small cleanup of creation functions. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. - Move marshaling state machine into stub manager from ifstub. - Add additional needed states for table-weak marshaling, as shown by tests. - Protect external reference count from underflows/overflows. - Make COM use the RPC runtime as the backend for RPC calls. Based on a patch by Ove Ksven. - Invoke objects in STA's in the correct thread by sending messages to the hidden apartment window. - Use I_RpcGetBuffer, instead of our own buffer routines to fix an occasional test crash caused by heap corruption. - Zero the memory block passed to RpcServerRegisterIfEx so we don't pass garbage in some of the fields we don't fill in. - Return the correct error code from create_server and fix two handle leaks. - TODO update. - Remove cruft left over from previous RPC backend implementation in the apartment structure. - Don't pass an IPID by value for proxy_manager_create_ifproxy. - Disable more of RPC_UnregisterInterface to prevent the RPC runtime using freed memory. - Rename various external RPC backend functions so that they all have the same "RPC_" prefix. - Reduce the timeout of the function that connects to a local server to 30s, like native. - Make each ifproxy have its own channel buffer to fix a bug where a proxy with multiple interfaces could invoke the wrong stub buffer on the server. - The Global Interface Table should do table-strong marshaling instead of normal marshaling so that an interface can be retrieved more than one time. Mike Hearn <mh@codeweavers.com> - Avoid infinite loop when doing a typelib marshalled IUnknown::QueryInterface by only doing an extra QI if requested IID is not equal to marshalled IID. Rob Shearman <rob@codeweavers.com> Mike Hearn <mh@codeweavers.com> - Add re-entrancy tests to the test suite. - Run RPCs on a new thread client side so we can pump the message loop. Juan Lang <juan_lang@yahoo.com> - Fix the calling convention of DllCanUnloadNow. - Move vtbl to end of file and get rid of unnecessary prototypes. - Implement StgCreatePropSetStg. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Paul Vriens <Paul.Vriens@xs4all.nl> - Added some TRACE statements. svn path=/trunk/; revision=14083
2005-03-14 23:17:44 +00:00
IStream *stm = NULL;
HRESULT r;
TRACE("%p %s %08x %08x %p\n", This, debugstr_guid(rfmtid), grfFlags,
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
grfMode, ppprstg);
Sync to Wine-20050310: Jon Griffiths <jon_p_griffiths@yahoo.com> - Documentation spelling fixes. Mike McCormack <mike@codeweavers.com> - Implement and test IPropertySetStorage. - Fix more incorrect uses of STGM_ enumerations. - Add struct StorageBaseImpl at the start of derived structures instead of trying to keep the first members the same. - StgOpenStorage shouldn't open zero length storage files. - Shared reading of storage files requires STGM_TRANSACTED. - Test and fix grfMode handling in StgOpenDocfile. - Implement StgSetTimes. Robert Shearman <rob@codeweavers.com> - Better tracing. - Small cleanup of creation functions. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. - Move marshaling state machine into stub manager from ifstub. - Add additional needed states for table-weak marshaling, as shown by tests. - Protect external reference count from underflows/overflows. - Make COM use the RPC runtime as the backend for RPC calls. Based on a patch by Ove Ksven. - Invoke objects in STA's in the correct thread by sending messages to the hidden apartment window. - Use I_RpcGetBuffer, instead of our own buffer routines to fix an occasional test crash caused by heap corruption. - Zero the memory block passed to RpcServerRegisterIfEx so we don't pass garbage in some of the fields we don't fill in. - Return the correct error code from create_server and fix two handle leaks. - TODO update. - Remove cruft left over from previous RPC backend implementation in the apartment structure. - Don't pass an IPID by value for proxy_manager_create_ifproxy. - Disable more of RPC_UnregisterInterface to prevent the RPC runtime using freed memory. - Rename various external RPC backend functions so that they all have the same "RPC_" prefix. - Reduce the timeout of the function that connects to a local server to 30s, like native. - Make each ifproxy have its own channel buffer to fix a bug where a proxy with multiple interfaces could invoke the wrong stub buffer on the server. - The Global Interface Table should do table-strong marshaling instead of normal marshaling so that an interface can be retrieved more than one time. Mike Hearn <mh@codeweavers.com> - Avoid infinite loop when doing a typelib marshalled IUnknown::QueryInterface by only doing an extra QI if requested IID is not equal to marshalled IID. Rob Shearman <rob@codeweavers.com> Mike Hearn <mh@codeweavers.com> - Add re-entrancy tests to the test suite. - Run RPCs on a new thread client side so we can pump the message loop. Juan Lang <juan_lang@yahoo.com> - Fix the calling convention of DllCanUnloadNow. - Move vtbl to end of file and get rid of unnecessary prototypes. - Implement StgCreatePropSetStg. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Paul Vriens <Paul.Vriens@xs4all.nl> - Added some TRACE statements. svn path=/trunk/; revision=14083
2005-03-14 23:17:44 +00:00
/* be picky */
if (grfMode != (STGM_CREATE|STGM_READWRITE|STGM_SHARE_EXCLUSIVE))
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
{
r = STG_E_INVALIDFLAG;
goto end;
}
Sync to Wine-20050310: Jon Griffiths <jon_p_griffiths@yahoo.com> - Documentation spelling fixes. Mike McCormack <mike@codeweavers.com> - Implement and test IPropertySetStorage. - Fix more incorrect uses of STGM_ enumerations. - Add struct StorageBaseImpl at the start of derived structures instead of trying to keep the first members the same. - StgOpenStorage shouldn't open zero length storage files. - Shared reading of storage files requires STGM_TRANSACTED. - Test and fix grfMode handling in StgOpenDocfile. - Implement StgSetTimes. Robert Shearman <rob@codeweavers.com> - Better tracing. - Small cleanup of creation functions. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. - Move marshaling state machine into stub manager from ifstub. - Add additional needed states for table-weak marshaling, as shown by tests. - Protect external reference count from underflows/overflows. - Make COM use the RPC runtime as the backend for RPC calls. Based on a patch by Ove Ksven. - Invoke objects in STA's in the correct thread by sending messages to the hidden apartment window. - Use I_RpcGetBuffer, instead of our own buffer routines to fix an occasional test crash caused by heap corruption. - Zero the memory block passed to RpcServerRegisterIfEx so we don't pass garbage in some of the fields we don't fill in. - Return the correct error code from create_server and fix two handle leaks. - TODO update. - Remove cruft left over from previous RPC backend implementation in the apartment structure. - Don't pass an IPID by value for proxy_manager_create_ifproxy. - Disable more of RPC_UnregisterInterface to prevent the RPC runtime using freed memory. - Rename various external RPC backend functions so that they all have the same "RPC_" prefix. - Reduce the timeout of the function that connects to a local server to 30s, like native. - Make each ifproxy have its own channel buffer to fix a bug where a proxy with multiple interfaces could invoke the wrong stub buffer on the server. - The Global Interface Table should do table-strong marshaling instead of normal marshaling so that an interface can be retrieved more than one time. Mike Hearn <mh@codeweavers.com> - Avoid infinite loop when doing a typelib marshalled IUnknown::QueryInterface by only doing an extra QI if requested IID is not equal to marshalled IID. Rob Shearman <rob@codeweavers.com> Mike Hearn <mh@codeweavers.com> - Add re-entrancy tests to the test suite. - Run RPCs on a new thread client side so we can pump the message loop. Juan Lang <juan_lang@yahoo.com> - Fix the calling convention of DllCanUnloadNow. - Move vtbl to end of file and get rid of unnecessary prototypes. - Implement StgCreatePropSetStg. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Paul Vriens <Paul.Vriens@xs4all.nl> - Added some TRACE statements. svn path=/trunk/; revision=14083
2005-03-14 23:17:44 +00:00
if (!rfmtid)
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
{
r = E_INVALIDARG;
goto end;
}
Sync to Wine-20050310: Jon Griffiths <jon_p_griffiths@yahoo.com> - Documentation spelling fixes. Mike McCormack <mike@codeweavers.com> - Implement and test IPropertySetStorage. - Fix more incorrect uses of STGM_ enumerations. - Add struct StorageBaseImpl at the start of derived structures instead of trying to keep the first members the same. - StgOpenStorage shouldn't open zero length storage files. - Shared reading of storage files requires STGM_TRANSACTED. - Test and fix grfMode handling in StgOpenDocfile. - Implement StgSetTimes. Robert Shearman <rob@codeweavers.com> - Better tracing. - Small cleanup of creation functions. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. - Move marshaling state machine into stub manager from ifstub. - Add additional needed states for table-weak marshaling, as shown by tests. - Protect external reference count from underflows/overflows. - Make COM use the RPC runtime as the backend for RPC calls. Based on a patch by Ove Ksven. - Invoke objects in STA's in the correct thread by sending messages to the hidden apartment window. - Use I_RpcGetBuffer, instead of our own buffer routines to fix an occasional test crash caused by heap corruption. - Zero the memory block passed to RpcServerRegisterIfEx so we don't pass garbage in some of the fields we don't fill in. - Return the correct error code from create_server and fix two handle leaks. - TODO update. - Remove cruft left over from previous RPC backend implementation in the apartment structure. - Don't pass an IPID by value for proxy_manager_create_ifproxy. - Disable more of RPC_UnregisterInterface to prevent the RPC runtime using freed memory. - Rename various external RPC backend functions so that they all have the same "RPC_" prefix. - Reduce the timeout of the function that connects to a local server to 30s, like native. - Make each ifproxy have its own channel buffer to fix a bug where a proxy with multiple interfaces could invoke the wrong stub buffer on the server. - The Global Interface Table should do table-strong marshaling instead of normal marshaling so that an interface can be retrieved more than one time. Mike Hearn <mh@codeweavers.com> - Avoid infinite loop when doing a typelib marshalled IUnknown::QueryInterface by only doing an extra QI if requested IID is not equal to marshalled IID. Rob Shearman <rob@codeweavers.com> Mike Hearn <mh@codeweavers.com> - Add re-entrancy tests to the test suite. - Run RPCs on a new thread client side so we can pump the message loop. Juan Lang <juan_lang@yahoo.com> - Fix the calling convention of DllCanUnloadNow. - Move vtbl to end of file and get rid of unnecessary prototypes. - Implement StgCreatePropSetStg. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Paul Vriens <Paul.Vriens@xs4all.nl> - Added some TRACE statements. svn path=/trunk/; revision=14083
2005-03-14 23:17:44 +00:00
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
/* FIXME: if (grfFlags & PROPSETFLAG_NONSIMPLE), we need to create a
* storage, not a stream. For now, disallow it.
*/
if (grfFlags & PROPSETFLAG_NONSIMPLE)
{
FIXME("PROPSETFLAG_NONSIMPLE not supported\n");
r = STG_E_INVALIDFLAG;
goto end;
}
r = FmtIdToPropStgName(rfmtid, name);
if (FAILED(r))
goto end;
Sync to Wine-20050310: Jon Griffiths <jon_p_griffiths@yahoo.com> - Documentation spelling fixes. Mike McCormack <mike@codeweavers.com> - Implement and test IPropertySetStorage. - Fix more incorrect uses of STGM_ enumerations. - Add struct StorageBaseImpl at the start of derived structures instead of trying to keep the first members the same. - StgOpenStorage shouldn't open zero length storage files. - Shared reading of storage files requires STGM_TRANSACTED. - Test and fix grfMode handling in StgOpenDocfile. - Implement StgSetTimes. Robert Shearman <rob@codeweavers.com> - Better tracing. - Small cleanup of creation functions. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. - Move marshaling state machine into stub manager from ifstub. - Add additional needed states for table-weak marshaling, as shown by tests. - Protect external reference count from underflows/overflows. - Make COM use the RPC runtime as the backend for RPC calls. Based on a patch by Ove Ksven. - Invoke objects in STA's in the correct thread by sending messages to the hidden apartment window. - Use I_RpcGetBuffer, instead of our own buffer routines to fix an occasional test crash caused by heap corruption. - Zero the memory block passed to RpcServerRegisterIfEx so we don't pass garbage in some of the fields we don't fill in. - Return the correct error code from create_server and fix two handle leaks. - TODO update. - Remove cruft left over from previous RPC backend implementation in the apartment structure. - Don't pass an IPID by value for proxy_manager_create_ifproxy. - Disable more of RPC_UnregisterInterface to prevent the RPC runtime using freed memory. - Rename various external RPC backend functions so that they all have the same "RPC_" prefix. - Reduce the timeout of the function that connects to a local server to 30s, like native. - Make each ifproxy have its own channel buffer to fix a bug where a proxy with multiple interfaces could invoke the wrong stub buffer on the server. - The Global Interface Table should do table-strong marshaling instead of normal marshaling so that an interface can be retrieved more than one time. Mike Hearn <mh@codeweavers.com> - Avoid infinite loop when doing a typelib marshalled IUnknown::QueryInterface by only doing an extra QI if requested IID is not equal to marshalled IID. Rob Shearman <rob@codeweavers.com> Mike Hearn <mh@codeweavers.com> - Add re-entrancy tests to the test suite. - Run RPCs on a new thread client side so we can pump the message loop. Juan Lang <juan_lang@yahoo.com> - Fix the calling convention of DllCanUnloadNow. - Move vtbl to end of file and get rid of unnecessary prototypes. - Implement StgCreatePropSetStg. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Paul Vriens <Paul.Vriens@xs4all.nl> - Added some TRACE statements. svn path=/trunk/; revision=14083
2005-03-14 23:17:44 +00:00
r = IStorage_CreateStream( &This->base.IStorage_iface, name, grfMode, 0, 0, &stm );
Sync to Wine-20050310: Jon Griffiths <jon_p_griffiths@yahoo.com> - Documentation spelling fixes. Mike McCormack <mike@codeweavers.com> - Implement and test IPropertySetStorage. - Fix more incorrect uses of STGM_ enumerations. - Add struct StorageBaseImpl at the start of derived structures instead of trying to keep the first members the same. - StgOpenStorage shouldn't open zero length storage files. - Shared reading of storage files requires STGM_TRANSACTED. - Test and fix grfMode handling in StgOpenDocfile. - Implement StgSetTimes. Robert Shearman <rob@codeweavers.com> - Better tracing. - Small cleanup of creation functions. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. - Move marshaling state machine into stub manager from ifstub. - Add additional needed states for table-weak marshaling, as shown by tests. - Protect external reference count from underflows/overflows. - Make COM use the RPC runtime as the backend for RPC calls. Based on a patch by Ove Ksven. - Invoke objects in STA's in the correct thread by sending messages to the hidden apartment window. - Use I_RpcGetBuffer, instead of our own buffer routines to fix an occasional test crash caused by heap corruption. - Zero the memory block passed to RpcServerRegisterIfEx so we don't pass garbage in some of the fields we don't fill in. - Return the correct error code from create_server and fix two handle leaks. - TODO update. - Remove cruft left over from previous RPC backend implementation in the apartment structure. - Don't pass an IPID by value for proxy_manager_create_ifproxy. - Disable more of RPC_UnregisterInterface to prevent the RPC runtime using freed memory. - Rename various external RPC backend functions so that they all have the same "RPC_" prefix. - Reduce the timeout of the function that connects to a local server to 30s, like native. - Make each ifproxy have its own channel buffer to fix a bug where a proxy with multiple interfaces could invoke the wrong stub buffer on the server. - The Global Interface Table should do table-strong marshaling instead of normal marshaling so that an interface can be retrieved more than one time. Mike Hearn <mh@codeweavers.com> - Avoid infinite loop when doing a typelib marshalled IUnknown::QueryInterface by only doing an extra QI if requested IID is not equal to marshalled IID. Rob Shearman <rob@codeweavers.com> Mike Hearn <mh@codeweavers.com> - Add re-entrancy tests to the test suite. - Run RPCs on a new thread client side so we can pump the message loop. Juan Lang <juan_lang@yahoo.com> - Fix the calling convention of DllCanUnloadNow. - Move vtbl to end of file and get rid of unnecessary prototypes. - Implement StgCreatePropSetStg. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Paul Vriens <Paul.Vriens@xs4all.nl> - Added some TRACE statements. svn path=/trunk/; revision=14083
2005-03-14 23:17:44 +00:00
if (FAILED(r))
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
goto end;
r = PropertyStorage_ConstructEmpty(stm, rfmtid, grfFlags, grfMode, ppprstg);
Sync to Wine-20050310: Jon Griffiths <jon_p_griffiths@yahoo.com> - Documentation spelling fixes. Mike McCormack <mike@codeweavers.com> - Implement and test IPropertySetStorage. - Fix more incorrect uses of STGM_ enumerations. - Add struct StorageBaseImpl at the start of derived structures instead of trying to keep the first members the same. - StgOpenStorage shouldn't open zero length storage files. - Shared reading of storage files requires STGM_TRANSACTED. - Test and fix grfMode handling in StgOpenDocfile. - Implement StgSetTimes. Robert Shearman <rob@codeweavers.com> - Better tracing. - Small cleanup of creation functions. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. - Move marshaling state machine into stub manager from ifstub. - Add additional needed states for table-weak marshaling, as shown by tests. - Protect external reference count from underflows/overflows. - Make COM use the RPC runtime as the backend for RPC calls. Based on a patch by Ove Ksven. - Invoke objects in STA's in the correct thread by sending messages to the hidden apartment window. - Use I_RpcGetBuffer, instead of our own buffer routines to fix an occasional test crash caused by heap corruption. - Zero the memory block passed to RpcServerRegisterIfEx so we don't pass garbage in some of the fields we don't fill in. - Return the correct error code from create_server and fix two handle leaks. - TODO update. - Remove cruft left over from previous RPC backend implementation in the apartment structure. - Don't pass an IPID by value for proxy_manager_create_ifproxy. - Disable more of RPC_UnregisterInterface to prevent the RPC runtime using freed memory. - Rename various external RPC backend functions so that they all have the same "RPC_" prefix. - Reduce the timeout of the function that connects to a local server to 30s, like native. - Make each ifproxy have its own channel buffer to fix a bug where a proxy with multiple interfaces could invoke the wrong stub buffer on the server. - The Global Interface Table should do table-strong marshaling instead of normal marshaling so that an interface can be retrieved more than one time. Mike Hearn <mh@codeweavers.com> - Avoid infinite loop when doing a typelib marshalled IUnknown::QueryInterface by only doing an extra QI if requested IID is not equal to marshalled IID. Rob Shearman <rob@codeweavers.com> Mike Hearn <mh@codeweavers.com> - Add re-entrancy tests to the test suite. - Run RPCs on a new thread client side so we can pump the message loop. Juan Lang <juan_lang@yahoo.com> - Fix the calling convention of DllCanUnloadNow. - Move vtbl to end of file and get rid of unnecessary prototypes. - Implement StgCreatePropSetStg. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Paul Vriens <Paul.Vriens@xs4all.nl> - Added some TRACE statements. svn path=/trunk/; revision=14083
2005-03-14 23:17:44 +00:00
IStream_Release( stm );
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
end:
TRACE("returning 0x%08x\n", r);
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
return r;
Sync to Wine-20050310: Jon Griffiths <jon_p_griffiths@yahoo.com> - Documentation spelling fixes. Mike McCormack <mike@codeweavers.com> - Implement and test IPropertySetStorage. - Fix more incorrect uses of STGM_ enumerations. - Add struct StorageBaseImpl at the start of derived structures instead of trying to keep the first members the same. - StgOpenStorage shouldn't open zero length storage files. - Shared reading of storage files requires STGM_TRANSACTED. - Test and fix grfMode handling in StgOpenDocfile. - Implement StgSetTimes. Robert Shearman <rob@codeweavers.com> - Better tracing. - Small cleanup of creation functions. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. - Move marshaling state machine into stub manager from ifstub. - Add additional needed states for table-weak marshaling, as shown by tests. - Protect external reference count from underflows/overflows. - Make COM use the RPC runtime as the backend for RPC calls. Based on a patch by Ove Ksven. - Invoke objects in STA's in the correct thread by sending messages to the hidden apartment window. - Use I_RpcGetBuffer, instead of our own buffer routines to fix an occasional test crash caused by heap corruption. - Zero the memory block passed to RpcServerRegisterIfEx so we don't pass garbage in some of the fields we don't fill in. - Return the correct error code from create_server and fix two handle leaks. - TODO update. - Remove cruft left over from previous RPC backend implementation in the apartment structure. - Don't pass an IPID by value for proxy_manager_create_ifproxy. - Disable more of RPC_UnregisterInterface to prevent the RPC runtime using freed memory. - Rename various external RPC backend functions so that they all have the same "RPC_" prefix. - Reduce the timeout of the function that connects to a local server to 30s, like native. - Make each ifproxy have its own channel buffer to fix a bug where a proxy with multiple interfaces could invoke the wrong stub buffer on the server. - The Global Interface Table should do table-strong marshaling instead of normal marshaling so that an interface can be retrieved more than one time. Mike Hearn <mh@codeweavers.com> - Avoid infinite loop when doing a typelib marshalled IUnknown::QueryInterface by only doing an extra QI if requested IID is not equal to marshalled IID. Rob Shearman <rob@codeweavers.com> Mike Hearn <mh@codeweavers.com> - Add re-entrancy tests to the test suite. - Run RPCs on a new thread client side so we can pump the message loop. Juan Lang <juan_lang@yahoo.com> - Fix the calling convention of DllCanUnloadNow. - Move vtbl to end of file and get rid of unnecessary prototypes. - Implement StgCreatePropSetStg. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Paul Vriens <Paul.Vriens@xs4all.nl> - Added some TRACE statements. svn path=/trunk/; revision=14083
2005-03-14 23:17:44 +00:00
}
/************************************************************************
* IPropertySetStorage_fnOpen (IPropertySetStorage)
*/
static HRESULT WINAPI IPropertySetStorage_fnOpen(
IPropertySetStorage *ppstg,
REFFMTID rfmtid,
DWORD grfMode,
IPropertyStorage** ppprstg)
{
Sync to Wine-20050830: Francois Gouget <fgouget@free.fr> - Use LPSTORAGE to better match the PSDK. Document the real SEGPTR type using the standard documentation mechanisms. Fixes winapi_check warnings. Robert Shearman <rob@codeweavers.com> - Remove unused thread handle entry from the apartment structure. - Implement IMarshal on proxies so that we don't end up with proxies to proxies, causing potential deadlock issues and performance problems. - Add a test for this situation and remove the todo_wine from another test that now succeeds. - Add stub for CoAllowSetForegroundWindow. Vincent Beron <vberon@mecano.gme.usherb.ca> - Remove local declarations already in included public headers. - Correct mismatches between spec files and comments about export number. Alexandre Julliard <julliard@winehq.org> - Uncomment the typedef in the DECLARE_INTERFACE macro, and get rid of duplicate typedefs. - Use the proper WOW functions everywhere instead of the K32WOW variant. - Don't prefix the functions DllCanUnloadNow, DllGetClassObject and Dll(Un)RegisterServer with the dll name so that the compiler can check the prototypes. - Remove duplicate definition of FILE_BEGIN. - Replace the _ICOM_THIS_From macros by inline functions the way it's already done in shelllink.c. Mike McCormack <mike@codeweavers.com> - Warning fixes for gcc 4.0. - Fix some gcc 4.0 warnings. - return a precomputed result for a NULL string - pass strlen an LPSTR to eliminate a sign warning Marcus Meissner <marcus@jet.franken.de> - Implemented ILockBytes16 (memorystream) support for the 16bit compound storage implementation. - Added ReadClassStg, OleDoAutoConvert, GetConvertStg implementations/stubs. Marcus Meissner <meissner@suse.de> - Added CoCreateInstance16, CoGetClassObject16, OleLoad16 stubs. svn path=/trunk/; revision=17678
2005-09-05 21:56:14 +00:00
StorageImpl *This = impl_from_IPropertySetStorage(ppstg);
Sync to Wine-20050310: Jon Griffiths <jon_p_griffiths@yahoo.com> - Documentation spelling fixes. Mike McCormack <mike@codeweavers.com> - Implement and test IPropertySetStorage. - Fix more incorrect uses of STGM_ enumerations. - Add struct StorageBaseImpl at the start of derived structures instead of trying to keep the first members the same. - StgOpenStorage shouldn't open zero length storage files. - Shared reading of storage files requires STGM_TRANSACTED. - Test and fix grfMode handling in StgOpenDocfile. - Implement StgSetTimes. Robert Shearman <rob@codeweavers.com> - Better tracing. - Small cleanup of creation functions. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. - Move marshaling state machine into stub manager from ifstub. - Add additional needed states for table-weak marshaling, as shown by tests. - Protect external reference count from underflows/overflows. - Make COM use the RPC runtime as the backend for RPC calls. Based on a patch by Ove Ksven. - Invoke objects in STA's in the correct thread by sending messages to the hidden apartment window. - Use I_RpcGetBuffer, instead of our own buffer routines to fix an occasional test crash caused by heap corruption. - Zero the memory block passed to RpcServerRegisterIfEx so we don't pass garbage in some of the fields we don't fill in. - Return the correct error code from create_server and fix two handle leaks. - TODO update. - Remove cruft left over from previous RPC backend implementation in the apartment structure. - Don't pass an IPID by value for proxy_manager_create_ifproxy. - Disable more of RPC_UnregisterInterface to prevent the RPC runtime using freed memory. - Rename various external RPC backend functions so that they all have the same "RPC_" prefix. - Reduce the timeout of the function that connects to a local server to 30s, like native. - Make each ifproxy have its own channel buffer to fix a bug where a proxy with multiple interfaces could invoke the wrong stub buffer on the server. - The Global Interface Table should do table-strong marshaling instead of normal marshaling so that an interface can be retrieved more than one time. Mike Hearn <mh@codeweavers.com> - Avoid infinite loop when doing a typelib marshalled IUnknown::QueryInterface by only doing an extra QI if requested IID is not equal to marshalled IID. Rob Shearman <rob@codeweavers.com> Mike Hearn <mh@codeweavers.com> - Add re-entrancy tests to the test suite. - Run RPCs on a new thread client side so we can pump the message loop. Juan Lang <juan_lang@yahoo.com> - Fix the calling convention of DllCanUnloadNow. - Move vtbl to end of file and get rid of unnecessary prototypes. - Implement StgCreatePropSetStg. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Paul Vriens <Paul.Vriens@xs4all.nl> - Added some TRACE statements. svn path=/trunk/; revision=14083
2005-03-14 23:17:44 +00:00
IStream *stm = NULL;
WCHAR name[CCH_MAX_PROPSTG_NAME + 1];
Sync to Wine-20050310: Jon Griffiths <jon_p_griffiths@yahoo.com> - Documentation spelling fixes. Mike McCormack <mike@codeweavers.com> - Implement and test IPropertySetStorage. - Fix more incorrect uses of STGM_ enumerations. - Add struct StorageBaseImpl at the start of derived structures instead of trying to keep the first members the same. - StgOpenStorage shouldn't open zero length storage files. - Shared reading of storage files requires STGM_TRANSACTED. - Test and fix grfMode handling in StgOpenDocfile. - Implement StgSetTimes. Robert Shearman <rob@codeweavers.com> - Better tracing. - Small cleanup of creation functions. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. - Move marshaling state machine into stub manager from ifstub. - Add additional needed states for table-weak marshaling, as shown by tests. - Protect external reference count from underflows/overflows. - Make COM use the RPC runtime as the backend for RPC calls. Based on a patch by Ove Ksven. - Invoke objects in STA's in the correct thread by sending messages to the hidden apartment window. - Use I_RpcGetBuffer, instead of our own buffer routines to fix an occasional test crash caused by heap corruption. - Zero the memory block passed to RpcServerRegisterIfEx so we don't pass garbage in some of the fields we don't fill in. - Return the correct error code from create_server and fix two handle leaks. - TODO update. - Remove cruft left over from previous RPC backend implementation in the apartment structure. - Don't pass an IPID by value for proxy_manager_create_ifproxy. - Disable more of RPC_UnregisterInterface to prevent the RPC runtime using freed memory. - Rename various external RPC backend functions so that they all have the same "RPC_" prefix. - Reduce the timeout of the function that connects to a local server to 30s, like native. - Make each ifproxy have its own channel buffer to fix a bug where a proxy with multiple interfaces could invoke the wrong stub buffer on the server. - The Global Interface Table should do table-strong marshaling instead of normal marshaling so that an interface can be retrieved more than one time. Mike Hearn <mh@codeweavers.com> - Avoid infinite loop when doing a typelib marshalled IUnknown::QueryInterface by only doing an extra QI if requested IID is not equal to marshalled IID. Rob Shearman <rob@codeweavers.com> Mike Hearn <mh@codeweavers.com> - Add re-entrancy tests to the test suite. - Run RPCs on a new thread client side so we can pump the message loop. Juan Lang <juan_lang@yahoo.com> - Fix the calling convention of DllCanUnloadNow. - Move vtbl to end of file and get rid of unnecessary prototypes. - Implement StgCreatePropSetStg. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Paul Vriens <Paul.Vriens@xs4all.nl> - Added some TRACE statements. svn path=/trunk/; revision=14083
2005-03-14 23:17:44 +00:00
HRESULT r;
TRACE("%p %s %08x %p\n", This, debugstr_guid(rfmtid), grfMode, ppprstg);
Sync to Wine-20050310: Jon Griffiths <jon_p_griffiths@yahoo.com> - Documentation spelling fixes. Mike McCormack <mike@codeweavers.com> - Implement and test IPropertySetStorage. - Fix more incorrect uses of STGM_ enumerations. - Add struct StorageBaseImpl at the start of derived structures instead of trying to keep the first members the same. - StgOpenStorage shouldn't open zero length storage files. - Shared reading of storage files requires STGM_TRANSACTED. - Test and fix grfMode handling in StgOpenDocfile. - Implement StgSetTimes. Robert Shearman <rob@codeweavers.com> - Better tracing. - Small cleanup of creation functions. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. - Move marshaling state machine into stub manager from ifstub. - Add additional needed states for table-weak marshaling, as shown by tests. - Protect external reference count from underflows/overflows. - Make COM use the RPC runtime as the backend for RPC calls. Based on a patch by Ove Ksven. - Invoke objects in STA's in the correct thread by sending messages to the hidden apartment window. - Use I_RpcGetBuffer, instead of our own buffer routines to fix an occasional test crash caused by heap corruption. - Zero the memory block passed to RpcServerRegisterIfEx so we don't pass garbage in some of the fields we don't fill in. - Return the correct error code from create_server and fix two handle leaks. - TODO update. - Remove cruft left over from previous RPC backend implementation in the apartment structure. - Don't pass an IPID by value for proxy_manager_create_ifproxy. - Disable more of RPC_UnregisterInterface to prevent the RPC runtime using freed memory. - Rename various external RPC backend functions so that they all have the same "RPC_" prefix. - Reduce the timeout of the function that connects to a local server to 30s, like native. - Make each ifproxy have its own channel buffer to fix a bug where a proxy with multiple interfaces could invoke the wrong stub buffer on the server. - The Global Interface Table should do table-strong marshaling instead of normal marshaling so that an interface can be retrieved more than one time. Mike Hearn <mh@codeweavers.com> - Avoid infinite loop when doing a typelib marshalled IUnknown::QueryInterface by only doing an extra QI if requested IID is not equal to marshalled IID. Rob Shearman <rob@codeweavers.com> Mike Hearn <mh@codeweavers.com> - Add re-entrancy tests to the test suite. - Run RPCs on a new thread client side so we can pump the message loop. Juan Lang <juan_lang@yahoo.com> - Fix the calling convention of DllCanUnloadNow. - Move vtbl to end of file and get rid of unnecessary prototypes. - Implement StgCreatePropSetStg. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Paul Vriens <Paul.Vriens@xs4all.nl> - Added some TRACE statements. svn path=/trunk/; revision=14083
2005-03-14 23:17:44 +00:00
/* be picky */
if (grfMode != (STGM_READWRITE|STGM_SHARE_EXCLUSIVE) &&
grfMode != (STGM_READ|STGM_SHARE_EXCLUSIVE))
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
{
r = STG_E_INVALIDFLAG;
goto end;
}
Sync to Wine-20050310: Jon Griffiths <jon_p_griffiths@yahoo.com> - Documentation spelling fixes. Mike McCormack <mike@codeweavers.com> - Implement and test IPropertySetStorage. - Fix more incorrect uses of STGM_ enumerations. - Add struct StorageBaseImpl at the start of derived structures instead of trying to keep the first members the same. - StgOpenStorage shouldn't open zero length storage files. - Shared reading of storage files requires STGM_TRANSACTED. - Test and fix grfMode handling in StgOpenDocfile. - Implement StgSetTimes. Robert Shearman <rob@codeweavers.com> - Better tracing. - Small cleanup of creation functions. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. - Move marshaling state machine into stub manager from ifstub. - Add additional needed states for table-weak marshaling, as shown by tests. - Protect external reference count from underflows/overflows. - Make COM use the RPC runtime as the backend for RPC calls. Based on a patch by Ove Ksven. - Invoke objects in STA's in the correct thread by sending messages to the hidden apartment window. - Use I_RpcGetBuffer, instead of our own buffer routines to fix an occasional test crash caused by heap corruption. - Zero the memory block passed to RpcServerRegisterIfEx so we don't pass garbage in some of the fields we don't fill in. - Return the correct error code from create_server and fix two handle leaks. - TODO update. - Remove cruft left over from previous RPC backend implementation in the apartment structure. - Don't pass an IPID by value for proxy_manager_create_ifproxy. - Disable more of RPC_UnregisterInterface to prevent the RPC runtime using freed memory. - Rename various external RPC backend functions so that they all have the same "RPC_" prefix. - Reduce the timeout of the function that connects to a local server to 30s, like native. - Make each ifproxy have its own channel buffer to fix a bug where a proxy with multiple interfaces could invoke the wrong stub buffer on the server. - The Global Interface Table should do table-strong marshaling instead of normal marshaling so that an interface can be retrieved more than one time. Mike Hearn <mh@codeweavers.com> - Avoid infinite loop when doing a typelib marshalled IUnknown::QueryInterface by only doing an extra QI if requested IID is not equal to marshalled IID. Rob Shearman <rob@codeweavers.com> Mike Hearn <mh@codeweavers.com> - Add re-entrancy tests to the test suite. - Run RPCs on a new thread client side so we can pump the message loop. Juan Lang <juan_lang@yahoo.com> - Fix the calling convention of DllCanUnloadNow. - Move vtbl to end of file and get rid of unnecessary prototypes. - Implement StgCreatePropSetStg. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Paul Vriens <Paul.Vriens@xs4all.nl> - Added some TRACE statements. svn path=/trunk/; revision=14083
2005-03-14 23:17:44 +00:00
if (!rfmtid)
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
{
r = E_INVALIDARG;
goto end;
}
Sync to Wine-20050310: Jon Griffiths <jon_p_griffiths@yahoo.com> - Documentation spelling fixes. Mike McCormack <mike@codeweavers.com> - Implement and test IPropertySetStorage. - Fix more incorrect uses of STGM_ enumerations. - Add struct StorageBaseImpl at the start of derived structures instead of trying to keep the first members the same. - StgOpenStorage shouldn't open zero length storage files. - Shared reading of storage files requires STGM_TRANSACTED. - Test and fix grfMode handling in StgOpenDocfile. - Implement StgSetTimes. Robert Shearman <rob@codeweavers.com> - Better tracing. - Small cleanup of creation functions. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. - Move marshaling state machine into stub manager from ifstub. - Add additional needed states for table-weak marshaling, as shown by tests. - Protect external reference count from underflows/overflows. - Make COM use the RPC runtime as the backend for RPC calls. Based on a patch by Ove Ksven. - Invoke objects in STA's in the correct thread by sending messages to the hidden apartment window. - Use I_RpcGetBuffer, instead of our own buffer routines to fix an occasional test crash caused by heap corruption. - Zero the memory block passed to RpcServerRegisterIfEx so we don't pass garbage in some of the fields we don't fill in. - Return the correct error code from create_server and fix two handle leaks. - TODO update. - Remove cruft left over from previous RPC backend implementation in the apartment structure. - Don't pass an IPID by value for proxy_manager_create_ifproxy. - Disable more of RPC_UnregisterInterface to prevent the RPC runtime using freed memory. - Rename various external RPC backend functions so that they all have the same "RPC_" prefix. - Reduce the timeout of the function that connects to a local server to 30s, like native. - Make each ifproxy have its own channel buffer to fix a bug where a proxy with multiple interfaces could invoke the wrong stub buffer on the server. - The Global Interface Table should do table-strong marshaling instead of normal marshaling so that an interface can be retrieved more than one time. Mike Hearn <mh@codeweavers.com> - Avoid infinite loop when doing a typelib marshalled IUnknown::QueryInterface by only doing an extra QI if requested IID is not equal to marshalled IID. Rob Shearman <rob@codeweavers.com> Mike Hearn <mh@codeweavers.com> - Add re-entrancy tests to the test suite. - Run RPCs on a new thread client side so we can pump the message loop. Juan Lang <juan_lang@yahoo.com> - Fix the calling convention of DllCanUnloadNow. - Move vtbl to end of file and get rid of unnecessary prototypes. - Implement StgCreatePropSetStg. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Paul Vriens <Paul.Vriens@xs4all.nl> - Added some TRACE statements. svn path=/trunk/; revision=14083
2005-03-14 23:17:44 +00:00
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
r = FmtIdToPropStgName(rfmtid, name);
if (FAILED(r))
goto end;
Sync to Wine-20050310: Jon Griffiths <jon_p_griffiths@yahoo.com> - Documentation spelling fixes. Mike McCormack <mike@codeweavers.com> - Implement and test IPropertySetStorage. - Fix more incorrect uses of STGM_ enumerations. - Add struct StorageBaseImpl at the start of derived structures instead of trying to keep the first members the same. - StgOpenStorage shouldn't open zero length storage files. - Shared reading of storage files requires STGM_TRANSACTED. - Test and fix grfMode handling in StgOpenDocfile. - Implement StgSetTimes. Robert Shearman <rob@codeweavers.com> - Better tracing. - Small cleanup of creation functions. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. - Move marshaling state machine into stub manager from ifstub. - Add additional needed states for table-weak marshaling, as shown by tests. - Protect external reference count from underflows/overflows. - Make COM use the RPC runtime as the backend for RPC calls. Based on a patch by Ove Ksven. - Invoke objects in STA's in the correct thread by sending messages to the hidden apartment window. - Use I_RpcGetBuffer, instead of our own buffer routines to fix an occasional test crash caused by heap corruption. - Zero the memory block passed to RpcServerRegisterIfEx so we don't pass garbage in some of the fields we don't fill in. - Return the correct error code from create_server and fix two handle leaks. - TODO update. - Remove cruft left over from previous RPC backend implementation in the apartment structure. - Don't pass an IPID by value for proxy_manager_create_ifproxy. - Disable more of RPC_UnregisterInterface to prevent the RPC runtime using freed memory. - Rename various external RPC backend functions so that they all have the same "RPC_" prefix. - Reduce the timeout of the function that connects to a local server to 30s, like native. - Make each ifproxy have its own channel buffer to fix a bug where a proxy with multiple interfaces could invoke the wrong stub buffer on the server. - The Global Interface Table should do table-strong marshaling instead of normal marshaling so that an interface can be retrieved more than one time. Mike Hearn <mh@codeweavers.com> - Avoid infinite loop when doing a typelib marshalled IUnknown::QueryInterface by only doing an extra QI if requested IID is not equal to marshalled IID. Rob Shearman <rob@codeweavers.com> Mike Hearn <mh@codeweavers.com> - Add re-entrancy tests to the test suite. - Run RPCs on a new thread client side so we can pump the message loop. Juan Lang <juan_lang@yahoo.com> - Fix the calling convention of DllCanUnloadNow. - Move vtbl to end of file and get rid of unnecessary prototypes. - Implement StgCreatePropSetStg. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Paul Vriens <Paul.Vriens@xs4all.nl> - Added some TRACE statements. svn path=/trunk/; revision=14083
2005-03-14 23:17:44 +00:00
r = IStorage_OpenStream( &This->base.IStorage_iface, name, 0, grfMode, 0, &stm );
Sync to Wine-20050310: Jon Griffiths <jon_p_griffiths@yahoo.com> - Documentation spelling fixes. Mike McCormack <mike@codeweavers.com> - Implement and test IPropertySetStorage. - Fix more incorrect uses of STGM_ enumerations. - Add struct StorageBaseImpl at the start of derived structures instead of trying to keep the first members the same. - StgOpenStorage shouldn't open zero length storage files. - Shared reading of storage files requires STGM_TRANSACTED. - Test and fix grfMode handling in StgOpenDocfile. - Implement StgSetTimes. Robert Shearman <rob@codeweavers.com> - Better tracing. - Small cleanup of creation functions. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. - Move marshaling state machine into stub manager from ifstub. - Add additional needed states for table-weak marshaling, as shown by tests. - Protect external reference count from underflows/overflows. - Make COM use the RPC runtime as the backend for RPC calls. Based on a patch by Ove Ksven. - Invoke objects in STA's in the correct thread by sending messages to the hidden apartment window. - Use I_RpcGetBuffer, instead of our own buffer routines to fix an occasional test crash caused by heap corruption. - Zero the memory block passed to RpcServerRegisterIfEx so we don't pass garbage in some of the fields we don't fill in. - Return the correct error code from create_server and fix two handle leaks. - TODO update. - Remove cruft left over from previous RPC backend implementation in the apartment structure. - Don't pass an IPID by value for proxy_manager_create_ifproxy. - Disable more of RPC_UnregisterInterface to prevent the RPC runtime using freed memory. - Rename various external RPC backend functions so that they all have the same "RPC_" prefix. - Reduce the timeout of the function that connects to a local server to 30s, like native. - Make each ifproxy have its own channel buffer to fix a bug where a proxy with multiple interfaces could invoke the wrong stub buffer on the server. - The Global Interface Table should do table-strong marshaling instead of normal marshaling so that an interface can be retrieved more than one time. Mike Hearn <mh@codeweavers.com> - Avoid infinite loop when doing a typelib marshalled IUnknown::QueryInterface by only doing an extra QI if requested IID is not equal to marshalled IID. Rob Shearman <rob@codeweavers.com> Mike Hearn <mh@codeweavers.com> - Add re-entrancy tests to the test suite. - Run RPCs on a new thread client side so we can pump the message loop. Juan Lang <juan_lang@yahoo.com> - Fix the calling convention of DllCanUnloadNow. - Move vtbl to end of file and get rid of unnecessary prototypes. - Implement StgCreatePropSetStg. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Paul Vriens <Paul.Vriens@xs4all.nl> - Added some TRACE statements. svn path=/trunk/; revision=14083
2005-03-14 23:17:44 +00:00
if (FAILED(r))
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
goto end;
Sync to Wine-20050310: Jon Griffiths <jon_p_griffiths@yahoo.com> - Documentation spelling fixes. Mike McCormack <mike@codeweavers.com> - Implement and test IPropertySetStorage. - Fix more incorrect uses of STGM_ enumerations. - Add struct StorageBaseImpl at the start of derived structures instead of trying to keep the first members the same. - StgOpenStorage shouldn't open zero length storage files. - Shared reading of storage files requires STGM_TRANSACTED. - Test and fix grfMode handling in StgOpenDocfile. - Implement StgSetTimes. Robert Shearman <rob@codeweavers.com> - Better tracing. - Small cleanup of creation functions. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. - Move marshaling state machine into stub manager from ifstub. - Add additional needed states for table-weak marshaling, as shown by tests. - Protect external reference count from underflows/overflows. - Make COM use the RPC runtime as the backend for RPC calls. Based on a patch by Ove Ksven. - Invoke objects in STA's in the correct thread by sending messages to the hidden apartment window. - Use I_RpcGetBuffer, instead of our own buffer routines to fix an occasional test crash caused by heap corruption. - Zero the memory block passed to RpcServerRegisterIfEx so we don't pass garbage in some of the fields we don't fill in. - Return the correct error code from create_server and fix two handle leaks. - TODO update. - Remove cruft left over from previous RPC backend implementation in the apartment structure. - Don't pass an IPID by value for proxy_manager_create_ifproxy. - Disable more of RPC_UnregisterInterface to prevent the RPC runtime using freed memory. - Rename various external RPC backend functions so that they all have the same "RPC_" prefix. - Reduce the timeout of the function that connects to a local server to 30s, like native. - Make each ifproxy have its own channel buffer to fix a bug where a proxy with multiple interfaces could invoke the wrong stub buffer on the server. - The Global Interface Table should do table-strong marshaling instead of normal marshaling so that an interface can be retrieved more than one time. Mike Hearn <mh@codeweavers.com> - Avoid infinite loop when doing a typelib marshalled IUnknown::QueryInterface by only doing an extra QI if requested IID is not equal to marshalled IID. Rob Shearman <rob@codeweavers.com> Mike Hearn <mh@codeweavers.com> - Add re-entrancy tests to the test suite. - Run RPCs on a new thread client side so we can pump the message loop. Juan Lang <juan_lang@yahoo.com> - Fix the calling convention of DllCanUnloadNow. - Move vtbl to end of file and get rid of unnecessary prototypes. - Implement StgCreatePropSetStg. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Paul Vriens <Paul.Vriens@xs4all.nl> - Added some TRACE statements. svn path=/trunk/; revision=14083
2005-03-14 23:17:44 +00:00
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
r = PropertyStorage_ConstructFromStream(stm, rfmtid, grfMode, ppprstg);
IStream_Release( stm );
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
end:
TRACE("returning 0x%08x\n", r);
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
return r;
Sync to Wine-20050310: Jon Griffiths <jon_p_griffiths@yahoo.com> - Documentation spelling fixes. Mike McCormack <mike@codeweavers.com> - Implement and test IPropertySetStorage. - Fix more incorrect uses of STGM_ enumerations. - Add struct StorageBaseImpl at the start of derived structures instead of trying to keep the first members the same. - StgOpenStorage shouldn't open zero length storage files. - Shared reading of storage files requires STGM_TRANSACTED. - Test and fix grfMode handling in StgOpenDocfile. - Implement StgSetTimes. Robert Shearman <rob@codeweavers.com> - Better tracing. - Small cleanup of creation functions. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. - Move marshaling state machine into stub manager from ifstub. - Add additional needed states for table-weak marshaling, as shown by tests. - Protect external reference count from underflows/overflows. - Make COM use the RPC runtime as the backend for RPC calls. Based on a patch by Ove Ksven. - Invoke objects in STA's in the correct thread by sending messages to the hidden apartment window. - Use I_RpcGetBuffer, instead of our own buffer routines to fix an occasional test crash caused by heap corruption. - Zero the memory block passed to RpcServerRegisterIfEx so we don't pass garbage in some of the fields we don't fill in. - Return the correct error code from create_server and fix two handle leaks. - TODO update. - Remove cruft left over from previous RPC backend implementation in the apartment structure. - Don't pass an IPID by value for proxy_manager_create_ifproxy. - Disable more of RPC_UnregisterInterface to prevent the RPC runtime using freed memory. - Rename various external RPC backend functions so that they all have the same "RPC_" prefix. - Reduce the timeout of the function that connects to a local server to 30s, like native. - Make each ifproxy have its own channel buffer to fix a bug where a proxy with multiple interfaces could invoke the wrong stub buffer on the server. - The Global Interface Table should do table-strong marshaling instead of normal marshaling so that an interface can be retrieved more than one time. Mike Hearn <mh@codeweavers.com> - Avoid infinite loop when doing a typelib marshalled IUnknown::QueryInterface by only doing an extra QI if requested IID is not equal to marshalled IID. Rob Shearman <rob@codeweavers.com> Mike Hearn <mh@codeweavers.com> - Add re-entrancy tests to the test suite. - Run RPCs on a new thread client side so we can pump the message loop. Juan Lang <juan_lang@yahoo.com> - Fix the calling convention of DllCanUnloadNow. - Move vtbl to end of file and get rid of unnecessary prototypes. - Implement StgCreatePropSetStg. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Paul Vriens <Paul.Vriens@xs4all.nl> - Added some TRACE statements. svn path=/trunk/; revision=14083
2005-03-14 23:17:44 +00:00
}
/************************************************************************
* IPropertySetStorage_fnDelete (IPropertySetStorage)
*/
static HRESULT WINAPI IPropertySetStorage_fnDelete(
IPropertySetStorage *ppstg,
REFFMTID rfmtid)
{
Sync to Wine-20050830: Francois Gouget <fgouget@free.fr> - Use LPSTORAGE to better match the PSDK. Document the real SEGPTR type using the standard documentation mechanisms. Fixes winapi_check warnings. Robert Shearman <rob@codeweavers.com> - Remove unused thread handle entry from the apartment structure. - Implement IMarshal on proxies so that we don't end up with proxies to proxies, causing potential deadlock issues and performance problems. - Add a test for this situation and remove the todo_wine from another test that now succeeds. - Add stub for CoAllowSetForegroundWindow. Vincent Beron <vberon@mecano.gme.usherb.ca> - Remove local declarations already in included public headers. - Correct mismatches between spec files and comments about export number. Alexandre Julliard <julliard@winehq.org> - Uncomment the typedef in the DECLARE_INTERFACE macro, and get rid of duplicate typedefs. - Use the proper WOW functions everywhere instead of the K32WOW variant. - Don't prefix the functions DllCanUnloadNow, DllGetClassObject and Dll(Un)RegisterServer with the dll name so that the compiler can check the prototypes. - Remove duplicate definition of FILE_BEGIN. - Replace the _ICOM_THIS_From macros by inline functions the way it's already done in shelllink.c. Mike McCormack <mike@codeweavers.com> - Warning fixes for gcc 4.0. - Fix some gcc 4.0 warnings. - return a precomputed result for a NULL string - pass strlen an LPSTR to eliminate a sign warning Marcus Meissner <marcus@jet.franken.de> - Implemented ILockBytes16 (memorystream) support for the 16bit compound storage implementation. - Added ReadClassStg, OleDoAutoConvert, GetConvertStg implementations/stubs. Marcus Meissner <meissner@suse.de> - Added CoCreateInstance16, CoGetClassObject16, OleLoad16 stubs. svn path=/trunk/; revision=17678
2005-09-05 21:56:14 +00:00
StorageImpl *This = impl_from_IPropertySetStorage(ppstg);
WCHAR name[CCH_MAX_PROPSTG_NAME + 1];
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
HRESULT r;
Sync to Wine-20050310: Jon Griffiths <jon_p_griffiths@yahoo.com> - Documentation spelling fixes. Mike McCormack <mike@codeweavers.com> - Implement and test IPropertySetStorage. - Fix more incorrect uses of STGM_ enumerations. - Add struct StorageBaseImpl at the start of derived structures instead of trying to keep the first members the same. - StgOpenStorage shouldn't open zero length storage files. - Shared reading of storage files requires STGM_TRANSACTED. - Test and fix grfMode handling in StgOpenDocfile. - Implement StgSetTimes. Robert Shearman <rob@codeweavers.com> - Better tracing. - Small cleanup of creation functions. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. - Move marshaling state machine into stub manager from ifstub. - Add additional needed states for table-weak marshaling, as shown by tests. - Protect external reference count from underflows/overflows. - Make COM use the RPC runtime as the backend for RPC calls. Based on a patch by Ove Ksven. - Invoke objects in STA's in the correct thread by sending messages to the hidden apartment window. - Use I_RpcGetBuffer, instead of our own buffer routines to fix an occasional test crash caused by heap corruption. - Zero the memory block passed to RpcServerRegisterIfEx so we don't pass garbage in some of the fields we don't fill in. - Return the correct error code from create_server and fix two handle leaks. - TODO update. - Remove cruft left over from previous RPC backend implementation in the apartment structure. - Don't pass an IPID by value for proxy_manager_create_ifproxy. - Disable more of RPC_UnregisterInterface to prevent the RPC runtime using freed memory. - Rename various external RPC backend functions so that they all have the same "RPC_" prefix. - Reduce the timeout of the function that connects to a local server to 30s, like native. - Make each ifproxy have its own channel buffer to fix a bug where a proxy with multiple interfaces could invoke the wrong stub buffer on the server. - The Global Interface Table should do table-strong marshaling instead of normal marshaling so that an interface can be retrieved more than one time. Mike Hearn <mh@codeweavers.com> - Avoid infinite loop when doing a typelib marshalled IUnknown::QueryInterface by only doing an extra QI if requested IID is not equal to marshalled IID. Rob Shearman <rob@codeweavers.com> Mike Hearn <mh@codeweavers.com> - Add re-entrancy tests to the test suite. - Run RPCs on a new thread client side so we can pump the message loop. Juan Lang <juan_lang@yahoo.com> - Fix the calling convention of DllCanUnloadNow. - Move vtbl to end of file and get rid of unnecessary prototypes. - Implement StgCreatePropSetStg. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Paul Vriens <Paul.Vriens@xs4all.nl> - Added some TRACE statements. svn path=/trunk/; revision=14083
2005-03-14 23:17:44 +00:00
TRACE("%p %s\n", This, debugstr_guid(rfmtid));
if (!rfmtid)
return E_INVALIDARG;
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
r = FmtIdToPropStgName(rfmtid, name);
if (FAILED(r))
return r;
Sync to Wine-20050310: Jon Griffiths <jon_p_griffiths@yahoo.com> - Documentation spelling fixes. Mike McCormack <mike@codeweavers.com> - Implement and test IPropertySetStorage. - Fix more incorrect uses of STGM_ enumerations. - Add struct StorageBaseImpl at the start of derived structures instead of trying to keep the first members the same. - StgOpenStorage shouldn't open zero length storage files. - Shared reading of storage files requires STGM_TRANSACTED. - Test and fix grfMode handling in StgOpenDocfile. - Implement StgSetTimes. Robert Shearman <rob@codeweavers.com> - Better tracing. - Small cleanup of creation functions. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. - Move marshaling state machine into stub manager from ifstub. - Add additional needed states for table-weak marshaling, as shown by tests. - Protect external reference count from underflows/overflows. - Make COM use the RPC runtime as the backend for RPC calls. Based on a patch by Ove Ksven. - Invoke objects in STA's in the correct thread by sending messages to the hidden apartment window. - Use I_RpcGetBuffer, instead of our own buffer routines to fix an occasional test crash caused by heap corruption. - Zero the memory block passed to RpcServerRegisterIfEx so we don't pass garbage in some of the fields we don't fill in. - Return the correct error code from create_server and fix two handle leaks. - TODO update. - Remove cruft left over from previous RPC backend implementation in the apartment structure. - Don't pass an IPID by value for proxy_manager_create_ifproxy. - Disable more of RPC_UnregisterInterface to prevent the RPC runtime using freed memory. - Rename various external RPC backend functions so that they all have the same "RPC_" prefix. - Reduce the timeout of the function that connects to a local server to 30s, like native. - Make each ifproxy have its own channel buffer to fix a bug where a proxy with multiple interfaces could invoke the wrong stub buffer on the server. - The Global Interface Table should do table-strong marshaling instead of normal marshaling so that an interface can be retrieved more than one time. Mike Hearn <mh@codeweavers.com> - Avoid infinite loop when doing a typelib marshalled IUnknown::QueryInterface by only doing an extra QI if requested IID is not equal to marshalled IID. Rob Shearman <rob@codeweavers.com> Mike Hearn <mh@codeweavers.com> - Add re-entrancy tests to the test suite. - Run RPCs on a new thread client side so we can pump the message loop. Juan Lang <juan_lang@yahoo.com> - Fix the calling convention of DllCanUnloadNow. - Move vtbl to end of file and get rid of unnecessary prototypes. - Implement StgCreatePropSetStg. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Paul Vriens <Paul.Vriens@xs4all.nl> - Added some TRACE statements. svn path=/trunk/; revision=14083
2005-03-14 23:17:44 +00:00
return IStorage_DestroyElement(&This->base.IStorage_iface, name);
Sync to Wine-20050310: Jon Griffiths <jon_p_griffiths@yahoo.com> - Documentation spelling fixes. Mike McCormack <mike@codeweavers.com> - Implement and test IPropertySetStorage. - Fix more incorrect uses of STGM_ enumerations. - Add struct StorageBaseImpl at the start of derived structures instead of trying to keep the first members the same. - StgOpenStorage shouldn't open zero length storage files. - Shared reading of storage files requires STGM_TRANSACTED. - Test and fix grfMode handling in StgOpenDocfile. - Implement StgSetTimes. Robert Shearman <rob@codeweavers.com> - Better tracing. - Small cleanup of creation functions. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. - Move marshaling state machine into stub manager from ifstub. - Add additional needed states for table-weak marshaling, as shown by tests. - Protect external reference count from underflows/overflows. - Make COM use the RPC runtime as the backend for RPC calls. Based on a patch by Ove Ksven. - Invoke objects in STA's in the correct thread by sending messages to the hidden apartment window. - Use I_RpcGetBuffer, instead of our own buffer routines to fix an occasional test crash caused by heap corruption. - Zero the memory block passed to RpcServerRegisterIfEx so we don't pass garbage in some of the fields we don't fill in. - Return the correct error code from create_server and fix two handle leaks. - TODO update. - Remove cruft left over from previous RPC backend implementation in the apartment structure. - Don't pass an IPID by value for proxy_manager_create_ifproxy. - Disable more of RPC_UnregisterInterface to prevent the RPC runtime using freed memory. - Rename various external RPC backend functions so that they all have the same "RPC_" prefix. - Reduce the timeout of the function that connects to a local server to 30s, like native. - Make each ifproxy have its own channel buffer to fix a bug where a proxy with multiple interfaces could invoke the wrong stub buffer on the server. - The Global Interface Table should do table-strong marshaling instead of normal marshaling so that an interface can be retrieved more than one time. Mike Hearn <mh@codeweavers.com> - Avoid infinite loop when doing a typelib marshalled IUnknown::QueryInterface by only doing an extra QI if requested IID is not equal to marshalled IID. Rob Shearman <rob@codeweavers.com> Mike Hearn <mh@codeweavers.com> - Add re-entrancy tests to the test suite. - Run RPCs on a new thread client side so we can pump the message loop. Juan Lang <juan_lang@yahoo.com> - Fix the calling convention of DllCanUnloadNow. - Move vtbl to end of file and get rid of unnecessary prototypes. - Implement StgCreatePropSetStg. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Paul Vriens <Paul.Vriens@xs4all.nl> - Added some TRACE statements. svn path=/trunk/; revision=14083
2005-03-14 23:17:44 +00:00
}
/************************************************************************
* IPropertySetStorage_fnEnum (IPropertySetStorage)
*/
static HRESULT WINAPI IPropertySetStorage_fnEnum(
IPropertySetStorage *ppstg,
IEnumSTATPROPSETSTG** ppenum)
{
Sync to Wine-20050830: Francois Gouget <fgouget@free.fr> - Use LPSTORAGE to better match the PSDK. Document the real SEGPTR type using the standard documentation mechanisms. Fixes winapi_check warnings. Robert Shearman <rob@codeweavers.com> - Remove unused thread handle entry from the apartment structure. - Implement IMarshal on proxies so that we don't end up with proxies to proxies, causing potential deadlock issues and performance problems. - Add a test for this situation and remove the todo_wine from another test that now succeeds. - Add stub for CoAllowSetForegroundWindow. Vincent Beron <vberon@mecano.gme.usherb.ca> - Remove local declarations already in included public headers. - Correct mismatches between spec files and comments about export number. Alexandre Julliard <julliard@winehq.org> - Uncomment the typedef in the DECLARE_INTERFACE macro, and get rid of duplicate typedefs. - Use the proper WOW functions everywhere instead of the K32WOW variant. - Don't prefix the functions DllCanUnloadNow, DllGetClassObject and Dll(Un)RegisterServer with the dll name so that the compiler can check the prototypes. - Remove duplicate definition of FILE_BEGIN. - Replace the _ICOM_THIS_From macros by inline functions the way it's already done in shelllink.c. Mike McCormack <mike@codeweavers.com> - Warning fixes for gcc 4.0. - Fix some gcc 4.0 warnings. - return a precomputed result for a NULL string - pass strlen an LPSTR to eliminate a sign warning Marcus Meissner <marcus@jet.franken.de> - Implemented ILockBytes16 (memorystream) support for the 16bit compound storage implementation. - Added ReadClassStg, OleDoAutoConvert, GetConvertStg implementations/stubs. Marcus Meissner <meissner@suse.de> - Added CoCreateInstance16, CoGetClassObject16, OleLoad16 stubs. svn path=/trunk/; revision=17678
2005-09-05 21:56:14 +00:00
StorageImpl *This = impl_from_IPropertySetStorage(ppstg);
return create_EnumSTATPROPSETSTG(This, ppenum);
}
/************************************************************************
* Implement IEnumSTATPROPSETSTG using enumx
*/
static HRESULT WINAPI IEnumSTATPROPSETSTG_fnQueryInterface(
IEnumSTATPROPSETSTG *iface,
REFIID riid,
void** ppvObject)
{
return enumx_QueryInterface((enumx_impl*)iface, riid, ppvObject);
}
static ULONG WINAPI IEnumSTATPROPSETSTG_fnAddRef(
IEnumSTATPROPSETSTG *iface)
{
return enumx_AddRef((enumx_impl*)iface);
}
static ULONG WINAPI IEnumSTATPROPSETSTG_fnRelease(
IEnumSTATPROPSETSTG *iface)
{
return enumx_Release((enumx_impl*)iface);
}
static HRESULT WINAPI IEnumSTATPROPSETSTG_fnNext(
IEnumSTATPROPSETSTG *iface,
ULONG celt,
STATPROPSETSTG *rgelt,
ULONG *pceltFetched)
{
return enumx_Next((enumx_impl*)iface, celt, rgelt, pceltFetched);
}
static HRESULT WINAPI IEnumSTATPROPSETSTG_fnSkip(
IEnumSTATPROPSETSTG *iface,
ULONG celt)
{
return enumx_Skip((enumx_impl*)iface, celt);
}
static HRESULT WINAPI IEnumSTATPROPSETSTG_fnReset(
IEnumSTATPROPSETSTG *iface)
{
return enumx_Reset((enumx_impl*)iface);
}
static HRESULT WINAPI IEnumSTATPROPSETSTG_fnClone(
IEnumSTATPROPSETSTG *iface,
IEnumSTATPROPSETSTG **ppenum)
{
return enumx_Clone((enumx_impl*)iface, (enumx_impl**)ppenum);
}
static HRESULT create_EnumSTATPROPSETSTG(
StorageImpl *This,
IEnumSTATPROPSETSTG** ppenum)
{
IStorage *stg = &This->base.IStorage_iface;
IEnumSTATSTG *penum = NULL;
STATSTG stat;
ULONG count;
HRESULT r;
STATPROPSETSTG statpss;
enumx_impl *enumx;
TRACE("%p %p\n", This, ppenum);
enumx = enumx_allocate(&IID_IEnumSTATPROPSETSTG,
&IEnumSTATPROPSETSTG_Vtbl,
sizeof (STATPROPSETSTG),
(IUnknown*)&This->base.IStorage_iface,
NULL);
/* add all the property set elements into a list */
r = IStorage_EnumElements(stg, 0, NULL, 0, &penum);
if (FAILED(r))
{
enumx_Release(enumx);
return E_OUTOFMEMORY;
}
while (1)
{
count = 0;
r = IEnumSTATSTG_Next(penum, 1, &stat, &count);
if (FAILED(r))
break;
if (!count)
break;
if (!stat.pwcsName)
continue;
if (stat.pwcsName[0] == 5 && stat.type == STGTY_STREAM)
{
PropStgNameToFmtId(stat.pwcsName, &statpss.fmtid);
TRACE("adding %s (%s)\n", debugstr_w(stat.pwcsName),
debugstr_guid(&statpss.fmtid));
statpss.mtime = stat.mtime;
statpss.atime = stat.atime;
statpss.ctime = stat.ctime;
statpss.grfFlags = stat.grfMode;
statpss.clsid = stat.clsid;
enumx_add_element(enumx, &statpss);
}
CoTaskMemFree(stat.pwcsName);
}
IEnumSTATSTG_Release(penum);
*ppenum = (IEnumSTATPROPSETSTG*) enumx;
return S_OK;
}
/************************************************************************
* Implement IEnumSTATPROPSTG using enumx
*/
static HRESULT WINAPI IEnumSTATPROPSTG_fnQueryInterface(
IEnumSTATPROPSTG *iface,
REFIID riid,
void** ppvObject)
{
return enumx_QueryInterface((enumx_impl*)iface, riid, ppvObject);
}
static ULONG WINAPI IEnumSTATPROPSTG_fnAddRef(
IEnumSTATPROPSTG *iface)
{
return enumx_AddRef((enumx_impl*)iface);
}
static ULONG WINAPI IEnumSTATPROPSTG_fnRelease(
IEnumSTATPROPSTG *iface)
{
return enumx_Release((enumx_impl*)iface);
}
static HRESULT WINAPI IEnumSTATPROPSTG_fnNext(
IEnumSTATPROPSTG *iface,
ULONG celt,
STATPROPSTG *rgelt,
ULONG *pceltFetched)
{
return enumx_Next((enumx_impl*)iface, celt, rgelt, pceltFetched);
}
static HRESULT WINAPI IEnumSTATPROPSTG_fnSkip(
IEnumSTATPROPSTG *iface,
ULONG celt)
{
return enumx_Skip((enumx_impl*)iface, celt);
}
static HRESULT WINAPI IEnumSTATPROPSTG_fnReset(
IEnumSTATPROPSTG *iface)
{
return enumx_Reset((enumx_impl*)iface);
}
static HRESULT WINAPI IEnumSTATPROPSTG_fnClone(
IEnumSTATPROPSTG *iface,
IEnumSTATPROPSTG **ppenum)
{
return enumx_Clone((enumx_impl*)iface, (enumx_impl**)ppenum);
}
static void prop_enum_copy_cb(IUnknown *parent, void *orig, void *dest)
{
PropertyStorage_impl *storage = impl_from_IPropertyStorage((IPropertyStorage*)parent);
STATPROPSTG *src_prop = orig;
STATPROPSTG *dest_prop = dest;
LPWSTR name;
dest_prop->propid = src_prop->propid;
dest_prop->vt = src_prop->vt;
dest_prop->lpwstrName = NULL;
if (dictionary_find(storage->propid_to_name, UlongToPtr(src_prop->propid), (void**)&name))
{
DWORD size = (strlenW(name) + 1) * sizeof(WCHAR);
dest_prop->lpwstrName = CoTaskMemAlloc(size);
if (!dest_prop->lpwstrName) return;
memcpy(dest_prop->lpwstrName, name, size);
}
}
static BOOL prop_enum_stat(const void *k, const void *v, void *extra, void *arg)
{
enumx_impl *enumx = arg;
PROPID propid = PtrToUlong(k);
const PROPVARIANT *prop = v;
STATPROPSTG stat;
stat.lpwstrName = NULL;
stat.propid = propid;
stat.vt = prop->vt;
enumx_add_element(enumx, &stat);
return TRUE;
}
static HRESULT create_EnumSTATPROPSTG(
PropertyStorage_impl *This,
IEnumSTATPROPSTG** ppenum)
{
enumx_impl *enumx;
TRACE("%p %p\n", This, ppenum);
enumx = enumx_allocate(&IID_IEnumSTATPROPSTG,
&IEnumSTATPROPSTG_Vtbl,
sizeof (STATPROPSTG),
(IUnknown*)&This->IPropertyStorage_iface,
prop_enum_copy_cb);
dictionary_enumerate(This->propid_to_prop, prop_enum_stat, enumx);
*ppenum = (IEnumSTATPROPSTG*) enumx;
return S_OK;
}
Sync to Wine-20050310: Jon Griffiths <jon_p_griffiths@yahoo.com> - Documentation spelling fixes. Mike McCormack <mike@codeweavers.com> - Implement and test IPropertySetStorage. - Fix more incorrect uses of STGM_ enumerations. - Add struct StorageBaseImpl at the start of derived structures instead of trying to keep the first members the same. - StgOpenStorage shouldn't open zero length storage files. - Shared reading of storage files requires STGM_TRANSACTED. - Test and fix grfMode handling in StgOpenDocfile. - Implement StgSetTimes. Robert Shearman <rob@codeweavers.com> - Better tracing. - Small cleanup of creation functions. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. - Move marshaling state machine into stub manager from ifstub. - Add additional needed states for table-weak marshaling, as shown by tests. - Protect external reference count from underflows/overflows. - Make COM use the RPC runtime as the backend for RPC calls. Based on a patch by Ove Ksven. - Invoke objects in STA's in the correct thread by sending messages to the hidden apartment window. - Use I_RpcGetBuffer, instead of our own buffer routines to fix an occasional test crash caused by heap corruption. - Zero the memory block passed to RpcServerRegisterIfEx so we don't pass garbage in some of the fields we don't fill in. - Return the correct error code from create_server and fix two handle leaks. - TODO update. - Remove cruft left over from previous RPC backend implementation in the apartment structure. - Don't pass an IPID by value for proxy_manager_create_ifproxy. - Disable more of RPC_UnregisterInterface to prevent the RPC runtime using freed memory. - Rename various external RPC backend functions so that they all have the same "RPC_" prefix. - Reduce the timeout of the function that connects to a local server to 30s, like native. - Make each ifproxy have its own channel buffer to fix a bug where a proxy with multiple interfaces could invoke the wrong stub buffer on the server. - The Global Interface Table should do table-strong marshaling instead of normal marshaling so that an interface can be retrieved more than one time. Mike Hearn <mh@codeweavers.com> - Avoid infinite loop when doing a typelib marshalled IUnknown::QueryInterface by only doing an extra QI if requested IID is not equal to marshalled IID. Rob Shearman <rob@codeweavers.com> Mike Hearn <mh@codeweavers.com> - Add re-entrancy tests to the test suite. - Run RPCs on a new thread client side so we can pump the message loop. Juan Lang <juan_lang@yahoo.com> - Fix the calling convention of DllCanUnloadNow. - Move vtbl to end of file and get rid of unnecessary prototypes. - Implement StgCreatePropSetStg. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Paul Vriens <Paul.Vriens@xs4all.nl> - Added some TRACE statements. svn path=/trunk/; revision=14083
2005-03-14 23:17:44 +00:00
/***********************************************************************
* vtables
*/
Sync to Wine-20050628: Robert Shearman <rob@codeweavers.com> - Convert some registry helper functions to use unicode versions of CLSID & registry functions (untested). - Add registry entries for local-only OLE interfaces. - Change IUnknown to local interface. - IUnknown isn't a remotable interface so the stub manager shouldn't need a marshaller for it. - Change the RPC code to use the unicode versions of the CLSID & registry functions. - Don't disconnect proxies flagged with SORFP_NOLIFETIMEMGMT. It makes no sense and only causes trouble for proxies that depend on these proxies being available. - Change some of the registry helper functions to use the unicode versions of the CLSID & registry functions. - Reindent CoGetClassObject and output an error message if the class isn't registered. - Add tests for the touched functions. Dmitry Timoshkov <dmitry@codeweavers.com> - Make remaining OLE interface vtables const. Richard Cohen <richard@daijobu.co.uk> - Base FileMonikerImpl_Save() on XP. - Correct handling of Unicode strings & multibyte locales. - More error checking. - Change ERR to WARN. - Match Windows quick & dirty estimate for GetSizeMax(). Stefan Huehner <stefan@huehner.org> - Fix some more -Wstrict-prototypes warnings. Mike Hearn <mike@navi.cx> - Add some tracing to the IRemUnknown RpcProxyBuffer implementation. Eric Pouech <pouech-eric@wanadoo.fr> - Const correctness fixes. Richard Cohen <richard@daijobu.co.uk> - IEnum::Clone shouldn't do a Reset. Marcus Meissner <marcus@jet.franken.de> - Removed CLSID_CompositeMoniker (conflicting with static definition). Alexandre Julliard <julliard@winehq.org> - Sort entry points alphabetically. svn path=/trunk/; revision=17036
2005-08-03 22:31:39 +00:00
const IPropertySetStorageVtbl IPropertySetStorage_Vtbl =
Sync to Wine-20050310: Jon Griffiths <jon_p_griffiths@yahoo.com> - Documentation spelling fixes. Mike McCormack <mike@codeweavers.com> - Implement and test IPropertySetStorage. - Fix more incorrect uses of STGM_ enumerations. - Add struct StorageBaseImpl at the start of derived structures instead of trying to keep the first members the same. - StgOpenStorage shouldn't open zero length storage files. - Shared reading of storage files requires STGM_TRANSACTED. - Test and fix grfMode handling in StgOpenDocfile. - Implement StgSetTimes. Robert Shearman <rob@codeweavers.com> - Better tracing. - Small cleanup of creation functions. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. - Move marshaling state machine into stub manager from ifstub. - Add additional needed states for table-weak marshaling, as shown by tests. - Protect external reference count from underflows/overflows. - Make COM use the RPC runtime as the backend for RPC calls. Based on a patch by Ove Ksven. - Invoke objects in STA's in the correct thread by sending messages to the hidden apartment window. - Use I_RpcGetBuffer, instead of our own buffer routines to fix an occasional test crash caused by heap corruption. - Zero the memory block passed to RpcServerRegisterIfEx so we don't pass garbage in some of the fields we don't fill in. - Return the correct error code from create_server and fix two handle leaks. - TODO update. - Remove cruft left over from previous RPC backend implementation in the apartment structure. - Don't pass an IPID by value for proxy_manager_create_ifproxy. - Disable more of RPC_UnregisterInterface to prevent the RPC runtime using freed memory. - Rename various external RPC backend functions so that they all have the same "RPC_" prefix. - Reduce the timeout of the function that connects to a local server to 30s, like native. - Make each ifproxy have its own channel buffer to fix a bug where a proxy with multiple interfaces could invoke the wrong stub buffer on the server. - The Global Interface Table should do table-strong marshaling instead of normal marshaling so that an interface can be retrieved more than one time. Mike Hearn <mh@codeweavers.com> - Avoid infinite loop when doing a typelib marshalled IUnknown::QueryInterface by only doing an extra QI if requested IID is not equal to marshalled IID. Rob Shearman <rob@codeweavers.com> Mike Hearn <mh@codeweavers.com> - Add re-entrancy tests to the test suite. - Run RPCs on a new thread client side so we can pump the message loop. Juan Lang <juan_lang@yahoo.com> - Fix the calling convention of DllCanUnloadNow. - Move vtbl to end of file and get rid of unnecessary prototypes. - Implement StgCreatePropSetStg. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Paul Vriens <Paul.Vriens@xs4all.nl> - Added some TRACE statements. svn path=/trunk/; revision=14083
2005-03-14 23:17:44 +00:00
{
IPropertySetStorage_fnQueryInterface,
IPropertySetStorage_fnAddRef,
IPropertySetStorage_fnRelease,
IPropertySetStorage_fnCreate,
IPropertySetStorage_fnOpen,
IPropertySetStorage_fnDelete,
IPropertySetStorage_fnEnum
};
Sync to Wine-20050628: Robert Shearman <rob@codeweavers.com> - Convert some registry helper functions to use unicode versions of CLSID & registry functions (untested). - Add registry entries for local-only OLE interfaces. - Change IUnknown to local interface. - IUnknown isn't a remotable interface so the stub manager shouldn't need a marshaller for it. - Change the RPC code to use the unicode versions of the CLSID & registry functions. - Don't disconnect proxies flagged with SORFP_NOLIFETIMEMGMT. It makes no sense and only causes trouble for proxies that depend on these proxies being available. - Change some of the registry helper functions to use the unicode versions of the CLSID & registry functions. - Reindent CoGetClassObject and output an error message if the class isn't registered. - Add tests for the touched functions. Dmitry Timoshkov <dmitry@codeweavers.com> - Make remaining OLE interface vtables const. Richard Cohen <richard@daijobu.co.uk> - Base FileMonikerImpl_Save() on XP. - Correct handling of Unicode strings & multibyte locales. - More error checking. - Change ERR to WARN. - Match Windows quick & dirty estimate for GetSizeMax(). Stefan Huehner <stefan@huehner.org> - Fix some more -Wstrict-prototypes warnings. Mike Hearn <mike@navi.cx> - Add some tracing to the IRemUnknown RpcProxyBuffer implementation. Eric Pouech <pouech-eric@wanadoo.fr> - Const correctness fixes. Richard Cohen <richard@daijobu.co.uk> - IEnum::Clone shouldn't do a Reset. Marcus Meissner <marcus@jet.franken.de> - Removed CLSID_CompositeMoniker (conflicting with static definition). Alexandre Julliard <julliard@winehq.org> - Sort entry points alphabetically. svn path=/trunk/; revision=17036
2005-08-03 22:31:39 +00:00
static const IPropertyStorageVtbl IPropertyStorage_Vtbl =
Sync to Wine-20050310: Jon Griffiths <jon_p_griffiths@yahoo.com> - Documentation spelling fixes. Mike McCormack <mike@codeweavers.com> - Implement and test IPropertySetStorage. - Fix more incorrect uses of STGM_ enumerations. - Add struct StorageBaseImpl at the start of derived structures instead of trying to keep the first members the same. - StgOpenStorage shouldn't open zero length storage files. - Shared reading of storage files requires STGM_TRANSACTED. - Test and fix grfMode handling in StgOpenDocfile. - Implement StgSetTimes. Robert Shearman <rob@codeweavers.com> - Better tracing. - Small cleanup of creation functions. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. - Move marshaling state machine into stub manager from ifstub. - Add additional needed states for table-weak marshaling, as shown by tests. - Protect external reference count from underflows/overflows. - Make COM use the RPC runtime as the backend for RPC calls. Based on a patch by Ove Ksven. - Invoke objects in STA's in the correct thread by sending messages to the hidden apartment window. - Use I_RpcGetBuffer, instead of our own buffer routines to fix an occasional test crash caused by heap corruption. - Zero the memory block passed to RpcServerRegisterIfEx so we don't pass garbage in some of the fields we don't fill in. - Return the correct error code from create_server and fix two handle leaks. - TODO update. - Remove cruft left over from previous RPC backend implementation in the apartment structure. - Don't pass an IPID by value for proxy_manager_create_ifproxy. - Disable more of RPC_UnregisterInterface to prevent the RPC runtime using freed memory. - Rename various external RPC backend functions so that they all have the same "RPC_" prefix. - Reduce the timeout of the function that connects to a local server to 30s, like native. - Make each ifproxy have its own channel buffer to fix a bug where a proxy with multiple interfaces could invoke the wrong stub buffer on the server. - The Global Interface Table should do table-strong marshaling instead of normal marshaling so that an interface can be retrieved more than one time. Mike Hearn <mh@codeweavers.com> - Avoid infinite loop when doing a typelib marshalled IUnknown::QueryInterface by only doing an extra QI if requested IID is not equal to marshalled IID. Rob Shearman <rob@codeweavers.com> Mike Hearn <mh@codeweavers.com> - Add re-entrancy tests to the test suite. - Run RPCs on a new thread client side so we can pump the message loop. Juan Lang <juan_lang@yahoo.com> - Fix the calling convention of DllCanUnloadNow. - Move vtbl to end of file and get rid of unnecessary prototypes. - Implement StgCreatePropSetStg. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Paul Vriens <Paul.Vriens@xs4all.nl> - Added some TRACE statements. svn path=/trunk/; revision=14083
2005-03-14 23:17:44 +00:00
{
IPropertyStorage_fnQueryInterface,
IPropertyStorage_fnAddRef,
IPropertyStorage_fnRelease,
IPropertyStorage_fnReadMultiple,
IPropertyStorage_fnWriteMultiple,
IPropertyStorage_fnDeleteMultiple,
IPropertyStorage_fnReadPropertyNames,
IPropertyStorage_fnWritePropertyNames,
IPropertyStorage_fnDeletePropertyNames,
IPropertyStorage_fnCommit,
IPropertyStorage_fnRevert,
IPropertyStorage_fnEnum,
IPropertyStorage_fnSetTimes,
IPropertyStorage_fnSetClass,
IPropertyStorage_fnStat,
};
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
static const IEnumSTATPROPSETSTGVtbl IEnumSTATPROPSETSTG_Vtbl =
{
IEnumSTATPROPSETSTG_fnQueryInterface,
IEnumSTATPROPSETSTG_fnAddRef,
IEnumSTATPROPSETSTG_fnRelease,
IEnumSTATPROPSETSTG_fnNext,
IEnumSTATPROPSETSTG_fnSkip,
IEnumSTATPROPSETSTG_fnReset,
IEnumSTATPROPSETSTG_fnClone,
};
static const IEnumSTATPROPSTGVtbl IEnumSTATPROPSTG_Vtbl =
{
IEnumSTATPROPSTG_fnQueryInterface,
IEnumSTATPROPSTG_fnAddRef,
IEnumSTATPROPSTG_fnRelease,
IEnumSTATPROPSTG_fnNext,
IEnumSTATPROPSTG_fnSkip,
IEnumSTATPROPSTG_fnReset,
IEnumSTATPROPSTG_fnClone,
};
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
/***********************************************************************
* Format ID <-> name conversion
*/
static const WCHAR szSummaryInfo[] = { 5,'S','u','m','m','a','r','y',
'I','n','f','o','r','m','a','t','i','o','n',0 };
static const WCHAR szDocSummaryInfo[] = { 5,'D','o','c','u','m','e','n','t',
'S','u','m','m','a','r','y','I','n','f','o','r','m','a','t','i','o','n',0 };
#define BITS_PER_BYTE 8
#define CHARMASK 0x1f
#define BITS_IN_CHARMASK 5
#define NUM_ALPHA_CHARS 26
/***********************************************************************
* FmtIdToPropStgName [ole32.@]
* Returns the storage name of the format ID rfmtid.
* PARAMS
* rfmtid [I] Format ID for which to return a storage name
* str [O] Storage name associated with rfmtid.
*
* RETURNS
* E_INVALIDARG if rfmtid or str i NULL, S_OK otherwise.
*
* NOTES
* str must be at least CCH_MAX_PROPSTG_NAME characters in length.
*/
HRESULT WINAPI FmtIdToPropStgName(const FMTID *rfmtid, LPOLESTR str)
{
static const char fmtMap[] = "abcdefghijklmnopqrstuvwxyz012345";
TRACE("%s, %p\n", debugstr_guid(rfmtid), str);
if (!rfmtid) return E_INVALIDARG;
if (!str) return E_INVALIDARG;
if (IsEqualGUID(&FMTID_SummaryInformation, rfmtid))
lstrcpyW(str, szSummaryInfo);
else if (IsEqualGUID(&FMTID_DocSummaryInformation, rfmtid))
lstrcpyW(str, szDocSummaryInfo);
else if (IsEqualGUID(&FMTID_UserDefinedProperties, rfmtid))
lstrcpyW(str, szDocSummaryInfo);
else
{
const BYTE *fmtptr;
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
WCHAR *pstr = str;
ULONG bitsRemaining = BITS_PER_BYTE;
*pstr++ = 5;
for (fmtptr = (const BYTE *)rfmtid; fmtptr < (const BYTE *)rfmtid + sizeof(FMTID); )
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
{
ULONG i = *fmtptr >> (BITS_PER_BYTE - bitsRemaining);
if (bitsRemaining >= BITS_IN_CHARMASK)
{
*pstr = (WCHAR)(fmtMap[i & CHARMASK]);
if (bitsRemaining == BITS_PER_BYTE && *pstr >= 'a' &&
*pstr <= 'z')
*pstr += 'A' - 'a';
pstr++;
bitsRemaining -= BITS_IN_CHARMASK;
if (bitsRemaining == 0)
{
fmtptr++;
bitsRemaining = BITS_PER_BYTE;
}
}
else
{
Sync to Wine-20050628: Robert Shearman <rob@codeweavers.com> - Convert some registry helper functions to use unicode versions of CLSID & registry functions (untested). - Add registry entries for local-only OLE interfaces. - Change IUnknown to local interface. - IUnknown isn't a remotable interface so the stub manager shouldn't need a marshaller for it. - Change the RPC code to use the unicode versions of the CLSID & registry functions. - Don't disconnect proxies flagged with SORFP_NOLIFETIMEMGMT. It makes no sense and only causes trouble for proxies that depend on these proxies being available. - Change some of the registry helper functions to use the unicode versions of the CLSID & registry functions. - Reindent CoGetClassObject and output an error message if the class isn't registered. - Add tests for the touched functions. Dmitry Timoshkov <dmitry@codeweavers.com> - Make remaining OLE interface vtables const. Richard Cohen <richard@daijobu.co.uk> - Base FileMonikerImpl_Save() on XP. - Correct handling of Unicode strings & multibyte locales. - More error checking. - Change ERR to WARN. - Match Windows quick & dirty estimate for GetSizeMax(). Stefan Huehner <stefan@huehner.org> - Fix some more -Wstrict-prototypes warnings. Mike Hearn <mike@navi.cx> - Add some tracing to the IRemUnknown RpcProxyBuffer implementation. Eric Pouech <pouech-eric@wanadoo.fr> - Const correctness fixes. Richard Cohen <richard@daijobu.co.uk> - IEnum::Clone shouldn't do a Reset. Marcus Meissner <marcus@jet.franken.de> - Removed CLSID_CompositeMoniker (conflicting with static definition). Alexandre Julliard <julliard@winehq.org> - Sort entry points alphabetically. svn path=/trunk/; revision=17036
2005-08-03 22:31:39 +00:00
if (++fmtptr < (const BYTE *)rfmtid + sizeof(FMTID))
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
i |= *fmtptr << bitsRemaining;
*pstr++ = (WCHAR)(fmtMap[i & CHARMASK]);
bitsRemaining += BITS_PER_BYTE - BITS_IN_CHARMASK;
}
}
*pstr = 0;
}
TRACE("returning %s\n", debugstr_w(str));
return S_OK;
}
/***********************************************************************
* PropStgNameToFmtId [ole32.@]
* Returns the format ID corresponding to the given name.
* PARAMS
* str [I] Storage name to convert to a format ID.
* rfmtid [O] Format ID corresponding to str.
*
* RETURNS
* E_INVALIDARG if rfmtid or str is NULL or if str can't be converted to
* a format ID, S_OK otherwise.
*/
HRESULT WINAPI PropStgNameToFmtId(const LPOLESTR str, FMTID *rfmtid)
{
Sync to Wine-20050524: Alexandre Julliard <julliard@winehq.org> - Added rules for building import libraries in the individual dll makefiles, and added support for building a .def.a static import library too. - Removed unnecessary code in the 16-bit DllEntryPoint function of some dlls, and also fixed its ordinal in a few places. - Comment out stub WEP entry points so that we can call WEP for builtin dlls too. Juan Lang <juan_lang@yahoo.com> - Obvious fixes to PropVariantClear and PropVariantCopy for vector types. - Add a comment, and a no-op cleanup. - Differentiate between version 0 and version 1 property storages. - Store property names in the code page of the property set. - maintain proper byte order - maintain PROPSETFLAG_ANSI flag based on codepage - update comments - Correct/improve error checking in IPropertyStorage. - convert strings between property storage's code page and system code page - add tests for setting code page - fix tests and behavior to match WinXP - Define and use endian conversion macros for big-endian machines. Marcus Meissner <marcus@jet.franken.de> - Move the Dll init function to compobj.c to avoid having global variables. Remove need of ole32_main.h. - Make HGLOBALStream_* functions static. - Make _xmalloc16() static. - Staticify FTMarshalImpl definition. Francois Gouget <fgouget@free.fr> - Specify the proper call convention in the PropSysFreeString() implementation. - Tweak the API documentation to silence winapi_check warnings. Robert Shearman <rob@codeweavers.com> - Add error messages on failure in file moniker load function. - Fix incorrect pointer check in both monikers. - Fix max size calculation of item moniker to match native. - Add a generic moniker marshaler that works by saving & loading monikers to & from the stream. - Use the generic moniker marshal in the file & item monikers and add a class factory for each. - Implement IROTData::GetComparisonData for file & item monikers. - Add a useful trace message. - Fix more places where custom header size was calculated exclusive of the data size member. - Optimize custom marshaling by getting size before calling the custom marshaler so we can write the header before and not use a second stream. - Change remaining blocks of code with 2-space indentation to 4-space indentation. - Make vtables const. - Remove an unnecessary memcpy and let the compiler do the work. - Write custom header up to and including size, not excluding. - Add a stub implementation of CoIsHandlerConnected. - Marshal objects & monikers into the ROT. - Test for this behaviour. Mike McCormack <mike@codeweavers.com> - Remove unnecessary declarations and make functions static. - Remove forward declarations. - Make sure a stream can't be created in read only storage. - Fix a memory leak in the ole storage implementation. - Remove function prototypes. Kevin Koltzau <kevin@plop.org> - Implement Hash function on composite moniker. Jeff Latimer <jeffl@defcen.gov.au> - Implement the IEnumMoniker interface for the ROT and provide tests to exercise the interface. Pierre d'Herbemont <stegefin@free.fr> - Big Endian specific code fixes in order to conform with NONAMELESSSTRUCT. Matthew Mastracci <matt@aclaro.com> - Replace stub entry for StgOpenStorageEx with call to StgOpenStorage. - Replace StgCreateStorageEx stub with call to StgCreateDocfile and add required STGFMT_* enumerations. svn path=/trunk/; revision=15562
2005-05-28 09:30:04 +00:00
HRESULT hr = STG_E_INVALIDNAME;
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
TRACE("%s, %p\n", debugstr_w(str), rfmtid);
if (!rfmtid) return E_INVALIDARG;
Sync to Wine-20050524: Alexandre Julliard <julliard@winehq.org> - Added rules for building import libraries in the individual dll makefiles, and added support for building a .def.a static import library too. - Removed unnecessary code in the 16-bit DllEntryPoint function of some dlls, and also fixed its ordinal in a few places. - Comment out stub WEP entry points so that we can call WEP for builtin dlls too. Juan Lang <juan_lang@yahoo.com> - Obvious fixes to PropVariantClear and PropVariantCopy for vector types. - Add a comment, and a no-op cleanup. - Differentiate between version 0 and version 1 property storages. - Store property names in the code page of the property set. - maintain proper byte order - maintain PROPSETFLAG_ANSI flag based on codepage - update comments - Correct/improve error checking in IPropertyStorage. - convert strings between property storage's code page and system code page - add tests for setting code page - fix tests and behavior to match WinXP - Define and use endian conversion macros for big-endian machines. Marcus Meissner <marcus@jet.franken.de> - Move the Dll init function to compobj.c to avoid having global variables. Remove need of ole32_main.h. - Make HGLOBALStream_* functions static. - Make _xmalloc16() static. - Staticify FTMarshalImpl definition. Francois Gouget <fgouget@free.fr> - Specify the proper call convention in the PropSysFreeString() implementation. - Tweak the API documentation to silence winapi_check warnings. Robert Shearman <rob@codeweavers.com> - Add error messages on failure in file moniker load function. - Fix incorrect pointer check in both monikers. - Fix max size calculation of item moniker to match native. - Add a generic moniker marshaler that works by saving & loading monikers to & from the stream. - Use the generic moniker marshal in the file & item monikers and add a class factory for each. - Implement IROTData::GetComparisonData for file & item monikers. - Add a useful trace message. - Fix more places where custom header size was calculated exclusive of the data size member. - Optimize custom marshaling by getting size before calling the custom marshaler so we can write the header before and not use a second stream. - Change remaining blocks of code with 2-space indentation to 4-space indentation. - Make vtables const. - Remove an unnecessary memcpy and let the compiler do the work. - Write custom header up to and including size, not excluding. - Add a stub implementation of CoIsHandlerConnected. - Marshal objects & monikers into the ROT. - Test for this behaviour. Mike McCormack <mike@codeweavers.com> - Remove unnecessary declarations and make functions static. - Remove forward declarations. - Make sure a stream can't be created in read only storage. - Fix a memory leak in the ole storage implementation. - Remove function prototypes. Kevin Koltzau <kevin@plop.org> - Implement Hash function on composite moniker. Jeff Latimer <jeffl@defcen.gov.au> - Implement the IEnumMoniker interface for the ROT and provide tests to exercise the interface. Pierre d'Herbemont <stegefin@free.fr> - Big Endian specific code fixes in order to conform with NONAMELESSSTRUCT. Matthew Mastracci <matt@aclaro.com> - Replace stub entry for StgOpenStorageEx with call to StgOpenStorage. - Replace StgCreateStorageEx stub with call to StgCreateDocfile and add required STGFMT_* enumerations. svn path=/trunk/; revision=15562
2005-05-28 09:30:04 +00:00
if (!str) return STG_E_INVALIDNAME;
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
if (!lstrcmpiW(str, szDocSummaryInfo))
{
*rfmtid = FMTID_DocSummaryInformation;
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
hr = S_OK;
}
else if (!lstrcmpiW(str, szSummaryInfo))
{
*rfmtid = FMTID_SummaryInformation;
Sync to Wine-20050419: Juan Lang <juan_lang@yahoo.com> - Implement PropSys{Alloc|Free}String, and support BSTRs in PropVariant{Clear|Copy} using them. - Begin implementing IPropertyStorage. - Add traces, add unit tests for IPropertyStorage, and fix the problems they caught. - Implement FmtIdToPropStgName & PropStgNameToFmtId, with tests. - add write support to IPropertyStorage, with tests - misc. cleanups the tests turned up - Add a comment about byte order, change types to reduce casting and not cast away constness. Vincent Beron <vberon@mecano.gme.usherb.ca> - Change prototypes so gcc with some warnings doesn't bark. - Correct and complete some api documentation. Mike McCormack <mike@codeweavers.com> - Eliminate forward declarations, make functions static. - Eliminate casts of the return value of HeapAlloc. - Remove function prototypes, make functions static. - StgOpenStorage shouldn't open zero length storage files. - Remove unnecessary function prototypes. Robert Shearman <rob@codeweavers.com> - Add critsec debugging info. - Move the modal loop called during RPCs into CoWaitForMultipleHandles. - Use a mutex for long remoting calls to IRemUnknown methods. - Remove locking in apartment_disconnectproxies as it is not needed. - Use PostMessage instead of SendMessage so we can run the message loop or not as appropriate. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - Don't close reg key if the open failed. - WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's unclear when (if at all) this gets written. Alexandre Julliard <julliard@winehq.org> - Fixed a buffer overflow. Joris Huizer <jorishuizer@planet.nl> - A few memory checks avoiding memory leaks. Dmitry Timoshkov <dmitry@codeweavers.com> - Zero out an invalidated runningObjectTableInstance pointer. Dimitrie O. Paun <dpaun@rogers.com> - Remove the need for the non-standard (Close|Delete)MetaFile16(). Troy Rollo <wine@troy.rollo.name> - ix test for STGM_SHARE_EXCLUSIVE on nameless DocFiles. svn path=/trunk/; revision=15010
2005-05-05 18:16:09 +00:00
hr = S_OK;
}
else
{
ULONG bits;
BYTE *fmtptr = (BYTE *)rfmtid - 1;
const WCHAR *pstr = str;
memset(rfmtid, 0, sizeof(*rfmtid));
for (bits = 0; bits < sizeof(FMTID) * BITS_PER_BYTE;
bits += BITS_IN_CHARMASK)
{
ULONG bitsUsed = bits % BITS_PER_BYTE, bitsStored;
WCHAR wc;
if (bitsUsed == 0)
fmtptr++;
wc = *++pstr - 'A';
if (wc > NUM_ALPHA_CHARS)
{
wc += 'A' - 'a';
if (wc > NUM_ALPHA_CHARS)
{
wc += 'a' - '0' + NUM_ALPHA_CHARS;
if (wc > CHARMASK)
{
WARN("invalid character (%d)\n", *pstr);
goto end;
}
}
}
*fmtptr |= wc << bitsUsed;
bitsStored = min(BITS_PER_BYTE - bitsUsed, BITS_IN_CHARMASK);
if (bitsStored < BITS_IN_CHARMASK)
{
wc >>= BITS_PER_BYTE - bitsUsed;
if (bits + bitsStored == sizeof(FMTID) * BITS_PER_BYTE)
{
if (wc != 0)
{
WARN("extra bits\n");
goto end;
}
break;
}
fmtptr++;
*fmtptr |= (BYTE)wc;
}
}
hr = S_OK;
}
end:
return hr;
}
#ifdef __i386__ /* thiscall functions are i386-specific */
#define DEFINE_STDCALL_WRAPPER(num,func,args) \
__ASM_STDCALL_FUNC(func, args, \
"popl %eax\n\t" \
"popl %ecx\n\t" \
"pushl %eax\n\t" \
"movl (%ecx), %eax\n\t" \
"jmp *(4*(" #num "))(%eax)" )
DEFINE_STDCALL_WRAPPER(0,Allocate_PMemoryAllocator,8)
extern void* __stdcall Allocate_PMemoryAllocator(void *this, ULONG cbSize);
#else
static void* __cdecl Allocate_PMemoryAllocator(void *this, ULONG cbSize)
{
void* (__cdecl *fn)(void*,ULONG) = **(void***)this;
return fn(this, cbSize);
}
#endif
BOOLEAN WINAPI StgConvertPropertyToVariant(const SERIALIZEDPROPERTYVALUE* prop,
USHORT CodePage, PROPVARIANT* pvar, void* pma)
{
HRESULT hr;
hr = PropertyStorage_ReadProperty(pvar, (const BYTE*)prop, CodePage, Allocate_PMemoryAllocator, pma);
if (FAILED(hr))
{
FIXME("should raise C++ exception on failure\n");
PropVariantInit(pvar);
}
return FALSE;
}
SERIALIZEDPROPERTYVALUE* WINAPI StgConvertVariantToProperty(const PROPVARIANT *pvar,
USHORT CodePage, SERIALIZEDPROPERTYVALUE *pprop, ULONG *pcb, PROPID pid,
BOOLEAN fReserved, ULONG *pcIndirect)
{
FIXME("%p,%d,%p,%p,%d,%d,%p\n", pvar, CodePage, pprop, pcb, pid, fReserved, pcIndirect);
return NULL;
}
HRESULT WINAPI StgCreatePropStg(IUnknown *unk, REFFMTID fmt, const CLSID *clsid,
DWORD flags, DWORD reserved, IPropertyStorage **prop_stg)
{
IStorage *stg;
IStream *stm;
HRESULT r;
TRACE("%p %s %s %08x %d %p\n", unk, debugstr_guid(fmt), debugstr_guid(clsid), flags, reserved, prop_stg);
if (!fmt || reserved)
{
r = E_INVALIDARG;
goto end;
}
if (flags & PROPSETFLAG_NONSIMPLE)
{
r = IUnknown_QueryInterface(unk, &IID_IStorage, (void **)&stg);
if (FAILED(r))
goto end;
/* FIXME: if (flags & PROPSETFLAG_NONSIMPLE), we need to create a
* storage, not a stream. For now, disallow it.
*/
FIXME("PROPSETFLAG_NONSIMPLE not supported\n");
IStorage_Release(stg);
r = STG_E_INVALIDFLAG;
}
else
{
r = IUnknown_QueryInterface(unk, &IID_IStream, (void **)&stm);
if (FAILED(r))
goto end;
r = PropertyStorage_ConstructEmpty(stm, fmt, flags,
STGM_CREATE|STGM_READWRITE|STGM_SHARE_EXCLUSIVE, prop_stg);
IStream_Release( stm );
}
end:
TRACE("returning 0x%08x\n", r);
return r;
}
HRESULT WINAPI StgOpenPropStg(IUnknown *unk, REFFMTID fmt, DWORD flags,
DWORD reserved, IPropertyStorage **prop_stg)
{
IStorage *stg;
IStream *stm;
HRESULT r;
TRACE("%p %s %08x %d %p\n", unk, debugstr_guid(fmt), flags, reserved, prop_stg);
if (!fmt || reserved)
{
r = E_INVALIDARG;
goto end;
}
if (flags & PROPSETFLAG_NONSIMPLE)
{
r = IUnknown_QueryInterface(unk, &IID_IStorage, (void **)&stg);
if (FAILED(r))
goto end;
/* FIXME: if (flags & PROPSETFLAG_NONSIMPLE), we need to open a
* storage, not a stream. For now, disallow it.
*/
FIXME("PROPSETFLAG_NONSIMPLE not supported\n");
IStorage_Release(stg);
r = STG_E_INVALIDFLAG;
}
else
{
r = IUnknown_QueryInterface(unk, &IID_IStream, (void **)&stm);
if (FAILED(r))
goto end;
r = PropertyStorage_ConstructFromStream(stm, fmt,
STGM_READWRITE|STGM_SHARE_EXCLUSIVE, prop_stg);
IStream_Release( stm );
}
end:
TRACE("returning 0x%08x\n", r);
return r;
}