reactos/reactos/lib/ole32/git.c

408 lines
12 KiB
C
Raw Normal View History

/*
* Implementation of the StdGlobalInterfaceTable object
*
* The GlobalInterfaceTable (GIT) object is used to marshal interfaces between
* threading apartments (contexts). When you want to pass an interface but not
* as a parameter, it wouldn't get marshalled automatically, so you can use this
* object to insert the interface into a table, and you get back a cookie.
* Then when it's retrieved, it'll be unmarshalled into the right apartment.
*
* Copyright 2003 Mike Hearn <mike@theoretic.com>
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "config.h"
#include <assert.h>
#include <stdlib.h>
#include <stdarg.h>
#include <stdio.h>
#include <string.h>
#define COBJMACROS
#define NONAMELESSUNION
#define NONAMELESSSTRUCT
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "objbase.h"
#include "ole2.h"
#include "winerror.h"
#include "winreg.h"
#include "winternl.h"
#include "compobj_private.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(ole);
/****************************************************************************
* StdGlobalInterfaceTable definition
*
* This class implements IGlobalInterfaceTable and is a process-wide singleton
* used for marshalling interfaces between threading apartments using cookies.
*/
/* Each entry in the linked list of GIT entries */
typedef struct StdGITEntry
{
DWORD cookie;
IID iid; /* IID of the interface */
IStream* stream; /* Holds the marshalled interface */
struct StdGITEntry* next;
struct StdGITEntry* prev;
} StdGITEntry;
/* Class data */
typedef struct StdGlobalInterfaceTableImpl
{
IGlobalInterfaceTableVtbl *lpVtbl;
ULONG ref;
struct StdGITEntry* firstEntry;
struct StdGITEntry* lastEntry;
ULONG nextCookie;
} StdGlobalInterfaceTableImpl;
void* StdGlobalInterfaceTableInstance;
static CRITICAL_SECTION git_section;
static CRITICAL_SECTION_DEBUG critsect_debug =
{
0, 0, &git_section,
{ &critsect_debug.ProcessLocksList, &critsect_debug.ProcessLocksList },
0, 0, { 0, (DWORD)(__FILE__ ": global interface table") }
};
static CRITICAL_SECTION git_section = { &critsect_debug, -1, 0, 0, 0, 0 };
/** This destroys it again. It should revoke all the held interfaces first **/
void StdGlobalInterfaceTable_Destroy(void* self) {
TRACE("(%p)\n", self);
FIXME("Revoke held interfaces here\n");
HeapFree(GetProcessHeap(), 0, self);
StdGlobalInterfaceTableInstance = NULL;
}
/***
* A helper function to traverse the list and find the entry that matches the cookie.
* Returns NULL if not found
*/
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 StdGITEntry*
StdGlobalInterfaceTable_FindEntry(IGlobalInterfaceTable* iface, DWORD cookie)
{
StdGlobalInterfaceTableImpl* const self = (StdGlobalInterfaceTableImpl*) iface;
StdGITEntry* e;
TRACE("iface=%p, cookie=0x%x\n", iface, (UINT)cookie);
EnterCriticalSection(&git_section);
e = self->firstEntry;
while (e != NULL) {
if (e->cookie == cookie) {
LeaveCriticalSection(&git_section);
return e;
}
e = e->next;
}
LeaveCriticalSection(&git_section);
TRACE("Entry not found\n");
return NULL;
}
/***
* Here's the boring boilerplate stuff for IUnknown
*/
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 WINAPI
StdGlobalInterfaceTable_QueryInterface(IGlobalInterfaceTable* iface,
REFIID riid, void** ppvObject)
{
/* Make sure silly coders can't crash us */
if (ppvObject == 0) return E_INVALIDARG;
*ppvObject = 0; /* assume we don't have the interface */
/* Do we implement that interface? */
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 (IsEqualIID(&IID_IUnknown, riid) ||
IsEqualIID(&IID_IGlobalInterfaceTable, riid))
*ppvObject = iface;
else
return E_NOINTERFACE;
/* Now inc the refcount */
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
IGlobalInterfaceTable_AddRef(iface);
return S_OK;
}
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 ULONG WINAPI
StdGlobalInterfaceTable_AddRef(IGlobalInterfaceTable* iface)
{
StdGlobalInterfaceTableImpl* const self = (StdGlobalInterfaceTableImpl*) iface;
/* InterlockedIncrement(&self->ref); */
return self->ref;
}
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 ULONG WINAPI
StdGlobalInterfaceTable_Release(IGlobalInterfaceTable* iface)
{
StdGlobalInterfaceTableImpl* const self = (StdGlobalInterfaceTableImpl*) iface;
/* InterlockedDecrement(&self->ref); */
if (self->ref == 0) {
/* Hey ho, it's time to go, so long again 'till next weeks show! */
StdGlobalInterfaceTable_Destroy(self);
return 0;
}
return self->ref;
}
/***
* Now implement the actual IGlobalInterfaceTable interface
*/
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 WINAPI
StdGlobalInterfaceTable_RegisterInterfaceInGlobal(
IGlobalInterfaceTable* iface, IUnknown* pUnk,
REFIID riid, DWORD* pdwCookie)
{
StdGlobalInterfaceTableImpl* const self = (StdGlobalInterfaceTableImpl*) iface;
IStream* stream = NULL;
HRESULT hres;
StdGITEntry* entry;
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
LARGE_INTEGER zero;
TRACE("iface=%p, pUnk=%p, riid=%s, pdwCookie=0x%p\n", iface, pUnk, debugstr_guid(riid), pdwCookie);
if (pUnk == NULL) return E_INVALIDARG;
/* marshal the interface */
TRACE("About to marshal the interface\n");
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
hres = CreateStreamOnHGlobal(0, TRUE, &stream);
if (hres) return hres;
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
hres = CoMarshalInterface(stream, riid, pUnk, MSHCTX_INPROC, NULL, MSHLFLAGS_TABLESTRONG);
if (hres)
{
IStream_Release(stream);
return hres;
}
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
zero.QuadPart = 0;
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_Seek(stream, zero, SEEK_SET, NULL);
entry = HeapAlloc(GetProcessHeap(), 0, sizeof(StdGITEntry));
if (entry == NULL) return E_OUTOFMEMORY;
EnterCriticalSection(&git_section);
entry->iid = *riid;
entry->stream = stream;
entry->cookie = self->nextCookie;
self->nextCookie++; /* inc the cookie count */
/* insert the new entry at the end of the list */
entry->next = NULL;
entry->prev = self->lastEntry;
if (entry->prev) entry->prev->next = entry;
else self->firstEntry = entry;
self->lastEntry = entry;
/* and return the cookie */
*pdwCookie = entry->cookie;
LeaveCriticalSection(&git_section);
TRACE("Cookie is 0x%lx\n", entry->cookie);
return S_OK;
}
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 WINAPI
StdGlobalInterfaceTable_RevokeInterfaceFromGlobal(
IGlobalInterfaceTable* iface, DWORD dwCookie)
{
StdGlobalInterfaceTableImpl* const self = (StdGlobalInterfaceTableImpl*) iface;
StdGITEntry* entry;
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 hr;
TRACE("iface=%p, dwCookie=0x%x\n", iface, (UINT)dwCookie);
entry = StdGlobalInterfaceTable_FindEntry(iface, dwCookie);
if (entry == NULL) {
TRACE("Entry not found\n");
return E_INVALIDARG; /* not found */
}
/* Free the stream */
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
hr = CoReleaseMarshalData(entry->stream);
if (hr != S_OK)
{
WARN("Failed to release marshal data, hr = 0x%08lx\n", hr);
return hr;
}
IStream_Release(entry->stream);
/* chop entry out of the list, and free the memory */
EnterCriticalSection(&git_section);
if (entry->prev) entry->prev->next = entry->next;
else self->firstEntry = entry->next;
if (entry->next) entry->next->prev = entry->prev;
else self->lastEntry = entry->prev;
LeaveCriticalSection(&git_section);
HeapFree(GetProcessHeap(), 0, entry);
return S_OK;
}
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 WINAPI
StdGlobalInterfaceTable_GetInterfaceFromGlobal(
IGlobalInterfaceTable* iface, DWORD dwCookie,
REFIID riid, void **ppv)
{
StdGITEntry* entry;
HRESULT hres;
LARGE_INTEGER move;
LPUNKNOWN lpUnk;
TRACE("dwCookie=0x%lx, riid=%s, ppv=%p\n", dwCookie, debugstr_guid(riid), ppv);
entry = StdGlobalInterfaceTable_FindEntry(iface, dwCookie);
if (entry == NULL) return E_INVALIDARG;
if (!IsEqualIID(&entry->iid, riid)) {
WARN("entry->iid (%s) != riid\n", debugstr_guid(&entry->iid));
return E_INVALIDARG;
}
TRACE("entry=%p\n", entry);
/* unmarshal the interface */
hres = CoUnmarshalInterface(entry->stream, riid, ppv);
if (hres) {
WARN("Failed to unmarshal stream\n");
return hres;
}
/* rewind stream, in case it's used again */
move.u.LowPart = 0;
move.u.HighPart = 0;
IStream_Seek(entry->stream, move, STREAM_SEEK_SET, NULL);
/* addref it */
lpUnk = *ppv;
IUnknown_AddRef(lpUnk);
TRACE("ppv=%p\n", *ppv);
return S_OK;
}
/* Classfactory definition - despite what MSDN says, some programs need 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
static HRESULT WINAPI
GITCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid, LPVOID *ppv)
{
*ppv = 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 (IsEqualIID(riid,&IID_IUnknown) ||
IsEqualIID(riid,&IID_IGlobalInterfaceTable))
{
*ppv = (LPVOID)iface;
return S_OK;
}
return E_NOINTERFACE;
}
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 ULONG WINAPI GITCF_AddRef(LPCLASSFACTORY iface)
{
return 2;
}
static ULONG WINAPI GITCF_Release(LPCLASSFACTORY iface)
{
return 1;
}
static HRESULT WINAPI
GITCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pUnk,
REFIID riid, LPVOID *ppv)
{
if (IsEqualIID(riid,&IID_IGlobalInterfaceTable)) {
if (StdGlobalInterfaceTableInstance == NULL)
StdGlobalInterfaceTableInstance = StdGlobalInterfaceTable_Construct();
return IGlobalInterfaceTable_QueryInterface( (IGlobalInterfaceTable*) StdGlobalInterfaceTableInstance, riid, ppv);
}
FIXME("(%s), not supported.\n",debugstr_guid(riid));
return E_NOINTERFACE;
}
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 WINAPI GITCF_LockServer(LPCLASSFACTORY iface, BOOL fLock)
{
FIXME("(%d), stub!\n",fLock);
return S_OK;
}
static IClassFactoryVtbl GITClassFactoryVtbl = {
GITCF_QueryInterface,
GITCF_AddRef,
GITCF_Release,
GITCF_CreateInstance,
GITCF_LockServer
};
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 IClassFactoryVtbl *PGITClassFactoryVtbl = &GITClassFactoryVtbl;
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 StdGlobalInterfaceTable_GetFactory(LPVOID *ppv)
{
*ppv = &PGITClassFactoryVtbl;
TRACE("Returning GIT classfactory\n");
return S_OK;
}
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
/* Virtual function table */
static IGlobalInterfaceTableVtbl StdGlobalInterfaceTableImpl_Vtbl =
{
StdGlobalInterfaceTable_QueryInterface,
StdGlobalInterfaceTable_AddRef,
StdGlobalInterfaceTable_Release,
StdGlobalInterfaceTable_RegisterInterfaceInGlobal,
StdGlobalInterfaceTable_RevokeInterfaceFromGlobal,
StdGlobalInterfaceTable_GetInterfaceFromGlobal
};
/** This function constructs the GIT. It should only be called once **/
void* StdGlobalInterfaceTable_Construct()
{
StdGlobalInterfaceTableImpl* newGIT;
newGIT = HeapAlloc(GetProcessHeap(), 0, sizeof(StdGlobalInterfaceTableImpl));
if (newGIT == 0) return newGIT;
newGIT->lpVtbl = &StdGlobalInterfaceTableImpl_Vtbl;
newGIT->ref = 1; /* Initialise the reference count */
newGIT->firstEntry = NULL; /* we start with an empty table */
newGIT->lastEntry = NULL;
newGIT->nextCookie = 0xf100; /* that's where windows starts, so that's where we start */
TRACE("Created the GIT at %p\n", newGIT);
return (void*)newGIT;
}