Commit Graph

66 Commits

Author SHA1 Message Date
Robert Shearman a37a5014a2 ole: Change the Apartment Model field to a boolean.
Change the apartment model field to a boolean that just specifies
whether the apartment is multi-threaded or not and fix up all the
places where this is used.
Fixes a bug where we would return an error if the previous apartment
model passed into CoInitializeEx matches the new apartment model, but
additional optimisation flags are specified.
2006-02-20 11:15:57 +01:00
Robert Shearman cd2fafb775 ole: Defer apartment window creation until the first object is marshalled. 2006-01-10 20:41:23 +01:00
Robert Shearman fcba783fc7 ole: Add an accessor function for an apartment's window. 2006-01-10 20:41:22 +01:00
Robert Shearman a02cb3ebd6 ole: Pass a channel into IRpcStubBuffer::Invoke.
Create a server channel and store this in the ifstub.
Rename ipid_to_apt_and_stubbuffer to ipid_get_dispatch_params and make
the function return an HRESULT.
Return the channel for the ifstub in ipid_get_dispatch_params.
2006-01-10 20:41:22 +01:00
Robert Shearman b75db2d9de ole: Join the MTA if necessary when executing an RPC call.
Join the MTA if necessary when executing an RPC call to ensure that it
is executing with a valid apartment and won't fail for certain COM
calls.
2006-01-09 18:41:19 +01:00
Robert Shearman cc4669cc5f ole: Remove __CLSIDFromStringA.
Move the ANSI implementation of CLSIDFromString to ole16.c and change
CLSIDFromString to only deal with Unicode strings.
2006-01-09 18:40:17 +01:00
Robert Shearman b9d7754034 Delegate advises to the remote object to enable the client to receive
data change notifications.
2005-11-28 11:16:58 +01:00
Robert Shearman f7b65cc716 - Extend COM_OpenKeyForCLSID to open a subkey and return an HRESULT.
- Fix up the callers and reorganize CoGetClassObject to split out the
  inproc code into another function.
2005-11-09 10:29:11 +00:00
Robert Shearman 43df8b61bb Add exception handling for stubs. 2005-09-14 10:07:01 +00:00
Alexandre Julliard 20a1a203c6 Use a more portable scheme for storing the name of a critical
section.
2005-09-09 10:19:44 +00:00
Alexandre Julliard 611b5acbf8 Authors: Mike Hearn <mh@codeweavers.com>, Robert Shearman <rob@codeweavers.com>
Change stub manager to track the number of normal marshals instead of
using the state machine so that multiple marshals of the same object
and interface work correctly.
2005-09-02 11:18:45 +00:00
Robert Shearman dab603def3 - 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.
2005-08-27 09:25:16 +00:00
Robert Shearman bcb251d5b3 Remove unused thread handle entry from the apartment structure. 2005-08-25 09:50:36 +00:00
Mike McCormack c7fdb4565a Fix gcc 4.0 -Wpointer-sign warnings. 2005-07-05 11:02:54 +00:00
Robert Shearman f419880d64 - 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.
2005-06-20 10:33:17 +00:00
Marcus Meissner f3d99b2697 Move the Dll init function to compobj.c to avoid having global
variables. Remove need of ole32_main.h.
2005-05-16 14:12:53 +00:00
Mike McCormack 912ffd6a0f Remove unnecessary declarations and make functions static. 2005-05-12 09:57:21 +00:00
Robert Shearman 1b5ebabdce - 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.
2005-03-17 10:26:20 +00:00
Robert Shearman 8971f06225 - Rename apartment functions to become more object-oriented.
- Rename register_ifstub to marshal_object to more accurately describe
  what it does.
- Add new function, apartment_getoxid, to prepare for a possible
  future patch where remoting is started on demand.
2005-03-11 10:19:10 +00:00
Robert Shearman 527ef47d70 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.
2005-03-07 17:14:11 +00:00
Robert Shearman 95288f9148 - 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.
2005-02-18 20:03:23 +00:00
Robert Shearman 552cc7d5b3 - 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.
2005-02-15 15:44:25 +00:00
Robert Shearman db6db7cb4c Make COM use the RPC runtime as the backend for RPC calls. Based on a
patch by Ove Kåven.
2005-02-15 15:02:49 +00:00
Robert Shearman 2ff1711487 Invoke objects in STA's in the correct thread by sending messages to
the hidden apartment window.
2005-02-14 11:50:51 +00:00
Robert Shearman 999766d31b - Implement CoDisconnectObject.
- Change CoLockObjectExternal so that it does the correct action now
  and eliminate a fair few lines of now redundant code.
- Rename OLE32_Dll{Register,Unregister}Server to
  Dll{Register,Unregister}Server.
2005-02-08 16:51:22 +00:00
Robert Shearman f8a2edb805 - Split up apartment creation so that the long code paths that don't
need locking no longer have locking.
- Add special cases for the threads that join apartments but can't
  increase the refcount of the apartment.
- Free TLS storage on thread destruction (including releasing the
  apartment the thread is in, if any, and so making another test
  pass).
2005-02-08 13:42:15 +00:00
Alexandre Julliard 2a46702761 Authors: Mike Hearn <mh@codeweavers.com>, Robert Shearman <rob@codeweavers.com>
- Rework RPC dispatch layer to be simpler and not get confused by
  server/client duality.
- Make threads shut down at the right time and not access freed memory
  after apartment destruction.
- Rename stub_dispatch_thread to client_dispatch_thread.
- Add some more tracing
- Check return value of WaitNamedPipe.
- Change named pipe timeouts to 0.5s, which should be enough for even the slowest machines.
2005-02-08 12:55:26 +00:00
Robert Shearman 3018974ce3 - Make proxy manager use IMultiQI instead of IInternalUnknown as tests
show that IInternalUnknown isn't exposed.
- Implement IMultiQI on top of IRemUnknown calls.
- Silence some fixmes that occur during tests and don't give us any
  useful information.
- Fix typo in class factory proxy that caused us to use the wrong
  offset into the CFProxy structure, causing us to not call the
  outer_unknown properly.
2005-01-26 21:07:05 +00:00
Robert Shearman cbbf08a7e2 - Use InterlockedIncrement for the ipid counter instead of a critical
section (suggested by Mike Hearn).
- Remove a line added by a bad merge.
- Implement RemUnkStub_Disconnect.
- Remove all of the RPC disconnect code.
2005-01-26 20:53:06 +00:00
Robert Shearman ad34f3dc5e - Generate machine-local IPIDs.
- Make pipes be uniquely identified only by their IPID.
2005-01-25 10:57:24 +00:00
Robert Shearman 6b89a92215 - Add a new flag SORFP_NOLIFETIMEMGMT to tell the proxy manager not to
call any IRemUnknown functions.
- Move the low-level unmarshaling code into a new function,
  unmarshal_object, so that it can be easily reused for unmarshaling
  IRemUnknown.
2005-01-24 11:24:08 +00:00
Robert Shearman 4c8d59dd91 Implement table marshaling. 2005-01-17 13:39:40 +00:00
Robert Shearman 5ce396f9bd - Remove obsolete structs, rearrange things to group the structs
together and to group similar functions.
- Document thread-safety of members of structs.
2005-01-14 17:20:27 +00:00
Robert Shearman 6036a773e2 - The apartment reference should be held while the stub manager
reference is held.
- Fix same apartment-unmarshal detection.
2005-01-14 16:48:34 +00:00
Robert Shearman 452491bd03 - Document CoSetState & CoGetState.
- Rewrite them to only retrieve TLS info once.
- Remove trailing whitespace in COM_CurrentInfo.
2005-01-12 19:48:39 +00:00
Robert Shearman c353f85082 - Document how thread-safety is ensured for each member of the
stub_manager and ifstub structs.
- Make stub_manager ref counted to ensure it doesn't get freed whilst
  it is still being used.
- ifstubs are now freed only when the controlling stub_manager is freed.
- Rename stub_manager_ref/unref to stub_manager_ext_addref/release
  respectively and make then take an unsigned long to prevent
  malicious callers from passing in a negative value and corrupting
  the ref count.
2005-01-11 10:45:34 +00:00
Robert Shearman 86d63bbbac Rename iid in wine_marshal_id to ipid and use IPIDs instead of IIDs in
the stub manager.
2005-01-07 15:33:41 +00:00
Robert Shearman 23e390a223 - Make struct oletls ref counted so that it is only detached from the
apartment on the final CoUninitialize.
- Decrease the size of the crit sec on destroying an apartment - it is
  only needed for touching the apartment list.
- Small cleanups.
2005-01-06 19:39:07 +00:00
Mike Hearn a6a416cb4e - Make apartment access thread-safe by introducing refcounting and
wider usage of the apartment lock.
- Rework OLE TLS management to eliminate uninitialised apartments and
  parent chaining.
2005-01-05 17:14:33 +00:00
Robert Shearman 2835633789 Implement proxy manager. 2005-01-04 11:58:23 +00:00
Robert Shearman 5d7d188df5 - Move named pipe macros into rpc.c.
- Remove unneeded function.
2004-12-27 19:27:57 +00:00
Robert Shearman 2b747d4e50 Implement COM local servers using table marshaling to avoid doing the
marshaling in a child thread where COM has not been initialized.
2004-12-27 19:24:55 +00:00
Mike Hearn 5475a2e617 - Implement the COM stub manager, refactor the current stub code.
- Begin implementing interface stubs.
2004-12-27 19:21:47 +00:00
Mike Hearn 737e67b17b Propagate apartments through the intermediate threads, make listener
thread apartment scoped.
2004-12-27 16:59:28 +00:00
Eric Pouech 4056d7ef8c Fixed some errors in function prototypes. 2004-12-13 21:19:01 +00:00
Robert Shearman 2c3de6db24 - Make the wine_marshal_id structure more like the DCOM OBJREF
structure, by replacing the process id field by apartment id (OXID),
  changing the users of the process id field to use the new field and
  renaming the objectid field to oid.
- Fix StdMarshalImpl_UnmarshalInterface to invalidate and release its
  stub when doing a same apartment marshal.
2004-12-08 17:49:30 +00:00
Mike Hearn 36aee71988 Rename the STUBMGR thread to more accurately reflect its purpose. 2004-12-07 17:01:40 +00:00
Alexandre Julliard 03250ff6e7 Inline functions don't need WINE_UNUSED. 2004-09-01 04:55:52 +00:00
Alexandre Julliard 936198ce45 Moved ICOM_THIS_MULTI definition out of objbase.h and into the files
that use it.
2004-08-13 00:44:22 +00:00
Alexandre Julliard 48c4bb3c31 Get rid of the non-standard ICOM_VTABLE macro. 2004-08-12 23:00:51 +00:00