Commit Graph

89 Commits

Author SHA1 Message Date
Jonathan Ernst 360a3f9142 Update the address of the Free Software Foundation. 2006-05-23 14:11:13 +02:00
Robert Shearman af6d97ad36 ole32: Exception handling shouldn't be needed around the call to IRpcStubBuffer_Invoke.
It should have its own exception handler to catch any exceptions that are raised.
2006-05-10 19:24:24 +02:00
Robert Shearman 714b66e945 ole: Use ncalrpc instead of ncacn_np as the RPC transport.
Use ncalrpc instead of ncacn_np as the transport as this is more similar
to how ole32 from NT works and should also be compatible with rpcrt4
from Win9x, allowing more combinations of dlls to work.
2006-03-31 17:38:43 +02:00
Robert Shearman 650ac14219 ole: Use the thread pool for executing RPC calls for better performance
(after the thread pool has been improved).
2006-03-20 12:00:50 +01:00
Robert Shearman 7406cc210b ole: Implement IRpcChannelBuffer::GetDestCtx on the client side. 2006-03-06 11:09:34 +01:00
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
Alexandre Julliard be22a96847 Include wine/port.h in files that use exceptions. 2006-02-07 16:31:21 +01:00
Robert Shearman 1b7d346d1f ole: Verify that the proxy is being used in the correct thread. 2006-01-20 16:16:08 +01:00
Robert Shearman b3041ba6ad ole: Optimisation for COM Calls.
Add an optimisation to yield and try to allow the RPC to run before
waiting for messages and RPCs to arrive.
2006-01-14 17:45:49 +01:00
Robert Shearman f431353058 ole: Fix crash in RpcChannelBuffer_SendReceive.
Initialise apt to NULL since ipid_to_apt_stubbuffer no longer does
this for us.
2006-01-12 11:53:32 +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 d175f154ba ole: Report and clean up after PostMessage failures. 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 8e5b36147d ole: Reduce the access rights required by start_local_service. 2006-01-10 20:41:22 +01:00
Robert Shearman c46386ff5c ole: Return the last error if we couldn't open the requested service.
Fix the ok/failed message.
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 1eda42ccac ole: Prefer services over servers.
Attempt to start as a local service before attempting to start as a
local server for the CLSCTX_LOCAL_SERVER case.
2006-01-09 18:40:42 +01:00
Alexandre Julliard dbc14a5cb5 ole32: Revert exception handler change.
The handler does the opposite of normal page fault handlers.
2005-12-19 17:44:56 +01:00
Alexandre Julliard ae964ac801 Take advantage of the __EXCEPT_PAGE_FAULT macro. 2005-12-16 17:17:57 +01:00
Alexandre Julliard db7920bb44 We no longer need to handle EXCEPTION_PRIV_INSTRUCTION on page faults. 2005-12-16 16:37:12 +01:00
Robert Shearman ef8ae2d763 OLE: Fix a typo where brackets were missing. 2005-12-06 10:57: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 65581b8489 We shouldn't pass the application name into CreateProcess because the
value stored in the registry could include arguments.
2005-11-08 10:56:02 +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
Robert Shearman c0d7a25a42 Silence now noisy error messages caused by changes in the way we call
ipid_to_stubmanager. Move the error message to the one place it is
needed.
2005-07-19 19:42:33 +00:00
Robert Shearman 28479ea4aa By-pass the RPC runtime if possible when calling an STA by posting a
message directly to the apartment window for it to process. Fixes a
deadlock in InstallShield caused by having to create a thread when
freeing an object that comes from an STA apartment. Added tests that
fail without this fix.
2005-07-19 19:12:47 +00:00
Mike McCormack c7fdb4565a Fix gcc 4.0 -Wpointer-sign warnings. 2005-07-05 11:02:54 +00:00
Robert Shearman 5807cb79f0 Change the RPC code to use the unicode versions of the CLSID &
registry functions.
2005-06-20 10:33:28 +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
Alexandre Julliard 53f3d4c65a Authors: 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.
2005-03-04 12:30:47 +00:00
Robert Shearman 2d2a39cc42 - 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.
2005-02-15 21:48:09 +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 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 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 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
Mike Hearn 70c1c26869 Various formatting/style changes. 2005-01-21 10:15:29 +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 ead057c4b7 - Don't use the pipe caching code because it doesn't work correctly at
the moment.
- Always write disconnect reply packet, even in failure cases.
2005-01-14 15:59:01 +00:00
Mike Hearn ba0475e738 Force context switch on chanbuf disconnect to avoid a race in the test
suite.
2005-01-14 15:11:24 +00:00
Robert Shearman 89f5c8241f The way apartments are used has changed, so fix up the hacks in the
RPC code that haven't yet been updated.
2005-01-12 19:27:22 +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 090003360f The current architecture cannot handle pipes changing address, so use
a static array. Fixes memory corruption that sometimes occurs when
using multiple pipes.
2005-01-07 15:33:26 +00:00