Commit Graph

77 Commits

Author SHA1 Message Date
Robert Shearman 037bdc0dc0 IUnknown isn't a remotable interface so the stub manager shouldn't
need a marshaller for it.
2005-06-09 09:45:59 +00:00
Rob Shearman e46047e4da Don't disconnect proxies flagged with SORFP_NOLIFETIMEMGMT. It makes
no sense and only causes trouble for proxies that depend on these
proxies being available.
2005-06-05 19:19:24 +00:00
Robert Shearman 27d73d6115 - 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.
2005-05-23 10:27:23 +00:00
Robert Shearman a890293f33 - 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.
2005-05-19 12:04:58 +00:00
Robert Shearman 447ab61288 Write custom header up to and including size, not excluding. 2005-05-19 11:15:50 +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
Mike Hearn 4d49d8ca36 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.
2005-02-21 18:35:07 +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 514af6ce78 Move object-to-stub-manager mapping rule to register_ifstub. 2005-02-08 14:26:19 +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 b9aa9e0bdd - Pass the original IID to IMarshal_UnmarshalInterface and query for
the requested interface.
- Unmarshaling IID_NULL means use the IID the interface was originally
  marshaled with.
2005-02-02 19:11:23 +00:00
Robert Shearman e6afc84873 - Add code for destroying the thread-local storage data, but don't use
it yet.
- Don't release apartment on changing modes because we didn't add a
  reference anywhere.
- Quieten the RPC_E_DISCONNECTED error message as it is an expected
  return code.
- Treat IID_NULL the same as IID_IUnknown.
- Make tests compile on Win95 again.
- Fix copy+paste error where the test failure should be from the
  CoUnmarshalInterface function.
2005-02-01 14:18:10 +00:00
Robert Shearman 9b634b97ae - More tests.
- Change return code of CoGetPSClsid to match test result.
- Do a slight hack to make IRemUnknown proxies be added after the
  proxy that uses them to stop them being used after they are
  destroyed.
- Fix multiple local server connections.
2005-01-28 12:39:13 +00:00
Robert Shearman 5bef770490 Give IUnknown its own ifstub to fix ref-counting and ipid storage
issues.
2005-01-27 10:39:44 +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 963ac3f013 - Implement IRemUnknown.
- Use IRemUnknown for life-cycle management instead of the current
  hacks.
2005-01-26 20:42:30 +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 717eb8fff4 - Consolidate more stub creation details into register_ifstub.
- Replace the current wine_marshal_id structure with STDOBJREF for the
  on-the-wire format.
2005-01-20 10:35:46 +00:00
Robert Shearman 6a20b2f476 - Initialize ppv pointer in ClientIdentity_QueryInterface to NULL as
apps depend on this.
- Don't release IRpcProxyBuffer on ifproxy destruction - the caller
  will do this for us.
- Make find_proxy_manager add a reference to the proxy manager and
  make proxy_manager_construct return an object with a valid
  ref-count.
- Remove stray not operator to fix a memory leak / crash in
  proxy_manager_destroy.
- More debug messages, especially on errors.
- Fix ref-count leak in the Class Factory proxy.
- Add a test case for IClassFactory_CreateInstance.
2005-01-19 17:00:20 +00:00
Robert Shearman b5a10936bd Initialize clsid member to the marshaler clsid to fix custom
marshaling.
2005-01-17 19:32:25 +00:00
Robert Shearman 4c8d59dd91 Implement table marshaling. 2005-01-17 13:39:40 +00:00
Robert Shearman ca608933dd Make proxy shutdown test succeed by releasing the channel on
disconnect.
2005-01-14 17:20:13 +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 2891bc53ba Remove wine_marshal_data: it is unneeded and there is no equivalent in
STDOBJREF.
2005-01-12 19:48:20 +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
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 85763a1711 - Add tracing for proxy ref count functions.
- Release the channel on proxy destruction.
2005-01-04 20:33:02 +00:00
Robert Shearman 2835633789 Implement proxy manager. 2005-01-04 11:58:23 +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
Francois Gouget 6fb1a20020 Assorted spelling fixes. 2004-12-20 19:27:06 +00:00
Robert Shearman 9fdd91fdc4 - Add documentation to several functions.
- Coding style changes according to the style Mike and I have agreed
  upon for COM related files.
2004-12-14 15:31:05 +00:00
Robert Shearman 2fa9a0a6fd Remove unneeded includes and the unused COMPOBJ_hInstance32 variable. 2004-12-14 15:28:58 +00:00
Robert Shearman 40b4f7f6e6 Use OBJREF on the wire for generic marshaling functions. 2004-12-14 15:14:40 +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
Robert Shearman 3b0a5d0a06 - Add some function declarations to objbase.h.
- Add stubs for server ref counting.
- Implement HRESULT marshaling.
2004-12-01 15:33:34 +00:00
Francois Gouget 486d020c1b Don't define COBJMACROS in objbase.h.
Update the Wine sources accordingly.
2004-10-07 03:06:48 +00:00
Joris Huizer 34cffce6f9 Ref count increment/decrement cleanup. 2004-09-24 01:16:53 +00:00
Alexandre Julliard 241a4c34b1 Get rid of the non-standard ICOM_THIS macro. 2004-09-09 21:03:58 +00:00
Alexandre Julliard f714b39762 Get rid of the no longer used ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
macro.
2004-08-23 19:39:48 +00:00
Alexandre Julliard 48c4bb3c31 Get rid of the non-standard ICOM_VTABLE macro. 2004-08-12 23:00:51 +00:00
Robert Shearman 5c7c5fafb6 - Add static to non-exported marshal functions.
- Remove unused marshal functions.
- Rename several RPC functions.
2004-08-02 18:47:31 +00:00