Commit Graph

302 Commits

Author SHA1 Message Date
Dmitry Timoshkov 3c9e7a7f33 wine: Switch to using 'long' for INT_PTR type for 64-bit compatibility. 2007-05-25 20:37:56 +02:00
Rob Shearman be55a4bbe2 ole32: Fix hosting in main apartments.
The recently introduced code had a bug where it passed the wrong
values into apartment_findfromtype to find the main apartment. Since
this is now the only way the function is used, fix this bug by
changing apartment_findfromtype to apartment_findmain, which only
finds the main apartment.
2007-05-21 12:38:54 +02:00
Rob Shearman 600143d4fa ole32: Create host apartments to enable isolation of objects of incompatible threading models.
There should be one host apartment per apartment. Existing apartments 
should not be re-used, except in the case of the main apartment.
2007-05-18 14:42:37 +02:00
Rob Shearman ed79ddab1d ole32: Don't lookup the address for the DllGetClassObject function for ole32.dll in the apartment loaded dll list.
Call the function directly for a small performance boost.
2007-05-14 14:26:22 +02:00
Rob Shearman 70e8842924 ole32: Fix CoUninitialize to only free libraries that return S_OK from DllCanUnloadNow. 2007-05-14 14:26:17 +02:00
Rob Shearman 314f9fe509 ole32: Add documentation about registered class objects only being visible in the apartment in which they were registered. 2007-05-08 13:23:57 +02:00
Rob Shearman 7d7f9a59d0 ole32: Fix CoRevokeClassObject to return RPC_E_WRONG_THREAD if it was called from a different apartment than the one that called CoRegisterClassObject. 2007-05-08 13:23:51 +02:00
Rob Shearman 23e43d886e ole32: Split CoRevokeClassObject into a separate function, COM_RevokeRegisteredClassObject, which acts on a RegisteredClass object. 2007-05-08 13:23:40 +02:00
Rob Shearman 51f85a765b ole32: COM_GetRegisteredClassObject should only retrieve objects that were registered in the current apartment. 2007-05-08 13:23:30 +02:00
Rob Shearman d76ab14479 ole32: Revoke registered class objects when the apartment they were registered in is destroyed, not when the last CoUninitialize is called. 2007-05-08 13:22:50 +02:00
Rob Shearman af2c349685 ole32: CoGetClassObject shouldn't return REGDB_E_KEYMISSING, so convert it to REGDB_E_CLASSNOTREG. 2007-05-08 13:22:23 +02:00
Rob Shearman c582136d0b ole32: Remove an unnecessary QueryInterface in CoRegisterClassObject that CoMarshalInterface will already do. 2007-05-02 15:03:28 +02:00
Rob Shearman 63ea015c65 ole32: Don't release the registered drop targets in OleUninitialize.
Do it in DLL_PROCESS_DETACH instead.
2007-04-05 13:25:18 +02:00
Rob Shearman ab7f796fcb ole32: Keep a list of the loaded dlls for each apartment.
Use it to make CoFreeUnusedLibraries per-apartment.
2007-04-04 21:28:36 +02:00
Rob Shearman 30721a88e3 ole32: Cache the address for the library's DllGetClassObject and DllCanUnloadNow in the OpenDll list entry. 2007-04-04 21:28:01 +02:00
Rob Shearman c40f1b6659 ole32: Move the handling of loading a dll and getting an in-process object from it to an apartment-specific function.
Use it to implement apartment_hostobject in a cleaner way so that it is 
guaranteed to not recurse.
2007-04-04 21:27:07 +02:00
Rob Shearman 679bfdab28 ole32: Move the in-process module loading to COMPOBJ_DllList_Add. 2007-04-04 21:26:53 +02:00
Rob Shearman 247255568c ole32: Convert the OpenDll list to a standard Wine list.
Store the library name and make it reference counted.
2007-04-04 21:26:47 +02:00
Rob Shearman f8789122aa ole32: Implement MkParseDisplayName. 2007-03-28 12:12:49 +02:00
Rob Shearman 2514c0141e ole32: Move GetClassFile to moniker.c and move OleRun to ole2.c. 2007-03-27 13:00:44 +02:00
Rob Shearman 8e0145242b ole32: Add documentation for CoGetClassObject and GetClassFile. 2007-03-27 13:00:29 +02:00
Rob Shearman 3acb0a878d ole32: The 16-bit version of CoDisconnectObject is not compatible with the 32-bit version, so create a separate stub for the former. 2007-03-21 15:55:22 +01:00
Huw Davies a8c72b76cf ole32: Only retrieve posted and paint messages in an STA message loop. 2007-03-13 11:52:41 +01:00
Rob Shearman f0189b8789 ole32: Implement CoAddRefServerProcess and CoReleaseServerProcess. 2007-03-09 21:17:47 +01:00
Rob Shearman 789f344c2b ole32: Make RegisteredClass list into a standard Wine list. 2007-03-09 21:17:42 +01:00
Rob Shearman 15a0b7fad5 ole32: Don't keep the local server named pipe open for a single-use object. 2007-03-09 21:16:44 +01:00
Rob Shearman 880542a9f8 ole32: Close the named pipe after revoking local server objects. 2007-03-09 21:16:37 +01:00
Rob Shearman c826515e55 ole32: REGCLS_MULTIPLEUSE implies CLSCTX_INPROC_SERVER in CoRegisterClassObject. 2007-03-09 21:16:31 +01:00
Rob Shearman 87155d654f ole32: Compare the class contexts in COM_GetRegisteredClassObject.
Only objects that have been registered for a class context that matches 
the requested class context should be returned.
2007-03-06 12:10:50 +01:00
Francois Gouget f5c6a71a65 ole32: Better match the PSDK types and fix the winapi_check warnings. 2007-02-20 20:29:10 +01:00
Rob Shearman ba25254d9f ole32: Remove some unneeded inclusions of headers.
Change some incorrect usages of SEEK_SET to the intended STREAM_SEEK_SET 
instead.
2007-01-10 12:08:51 +01:00
Rob Shearman 84158d6742 ole32: Remove a FIXME comment that no longer applies. 2007-01-10 12:02:24 +01:00
Rob Shearman ee99b6d743 ole32: Marshal the ORPCTHAT structure prefixed to the server data.
Unmarshal the data on the client side (during
ClientChannelBuffer_SendReceive) and call ClientNotify.
2006-12-27 14:34:15 +01:00
Rob Shearman 844037ab01 ole32: Performing a COM call from within the processing of a sent message during a wait for completion of another COM call is not allowed.
Add a test for the behaviour where RPC_E_CANTCALLOUT_ININPUTSYNCCALL is returned.
2006-12-24 13:08:02 +01:00
Rob Shearman 038c8e642a ole32: Call the MessagePending function for message filters. 2006-12-24 13:07:38 +01:00
Rob Shearman 5788ee9f05 ole32: Implement CoRegisterChannelHook and call channel hook methods on the client side. 2006-12-20 12:39:50 +01:00
Rob Shearman 7a5766346f ole32: Add some documentation for CoCreateInstance. 2006-12-07 11:51:13 +01:00
Dmitry Timoshkov 09fea0f83e ole32: Make some data const. 2006-11-28 12:36:17 +01:00
Huw Davies 241336c749 ole32: CoRegisterMessageFilter shouldn't crash on an uninitialized apartment. 2006-11-16 22:09:24 +01:00
Eric Pouech 5c0f35a2aa ole32: CoUninitialize: No longer access an object after it's been freed. 2006-10-24 11:32:38 +02:00
Francois Gouget ef998ea6cb Assorted spelling fixes. 2006-10-16 11:33:38 +02:00
Michael Stefaniuc 21ff87bf50 ole32: Win64 printf format warning fixes. 2006-10-16 10:53:28 +02:00
Robert Shearman f463b9d422 ole32: AppId is a value under the clsid key, rather than a key. 2006-08-28 17:48:45 +02:00
Robert Shearman 9038705919 ole32: Fix functions defined without specifying argument types by changing them to "(void)". 2006-08-28 17:48:40 +02:00
Robert Shearman 986027af9f ole32: Add support for main-threaded apartments.
A main-threaded apartment is the first single-threaded apartment in the 
process. It was designed to be used for legacy applications that don't 
want to think about threading at all, even if they are always called 
from the same context, as is the case for regular STAs.
2006-08-26 19:36:56 +02:00
Robert Shearman 83d24a6408 ole32: Move the opening of the AppId key for a clsid to a helper function. 2006-08-26 19:28:10 +02:00
Robert Shearman 619ba90dbe ole32: CoGetClassObject should host a single-threaded object in a
single-threaded apartment if executing in a multi-threaded apartment,
if one exists.
2006-08-26 19:27:52 +02:00
Robert Shearman c1eb2c7003 ole32: Get the threading model value for inproc classes and output a
fixme if we should create it in an apartment of another type.
2006-08-26 19:24:23 +02:00
Robert Shearman f42d61df0d ole32: Move some functions out of compobj.c that don't belong there and update the copyright statement. 2006-08-16 16:42:32 +02:00
Robert Shearman 0e99d795b7 ole32: Add some more tests for failure cases of Co* functions and make builtin ole32 pass them. 2006-08-16 16:42:01 +02:00
Robert Shearman 31726e3823 ole32: Add tests for the failure cases of CLSIDFromProgID and fix the function to conform to these. 2006-08-16 16:41:47 +02:00
Francois Gouget ce9b4baad8 Assorted spelling fixes. 2006-08-07 13:52:55 +02:00
Robert Shearman 6455b9e1a0 ole32: Fix CoLockObjectExternal to respect fLastUnlockReleases. 2006-08-03 22:23:13 +02:00
Alexandre Julliard 518ee99f6f ole32: Make some functions and variables static. 2006-08-02 13:31:26 +02:00
Robert Shearman 2308d49bcb ole32: Implement CoRegisterPSClsid. 2006-07-21 10:52:03 +02:00
Robert Shearman fac6bedda9 ole32: Improve CoRegisterMessageFilter and add tests for it. 2006-07-17 13:43:47 +02:00
Robert Shearman 69e10bf1ed ole32: Add validation of parameters to CoGetClassObject and make sure to initialise ppv to NULL. 2006-07-14 12:38:44 +02:00
Robert Shearman 11c1bcf6de ole32: Don't loop while peeking messages in CoWaitForMultipleHandles.
It increases the latency on completing the COM call and could result in 
the COM call never completing in some circumstances.
2006-07-13 16:26:25 +02:00
Robert Shearman 5f453db5cf ole32: Fix the return value of COM_RegReadPath and make it static. 2006-07-07 13:31:49 +02:00
Robert Shearman 628371021b ole32: When CoLockObjectExternal with fLock=TRUE is used on an object
that hasn't yet been marshaled then it should create a new stub
manager.
2006-06-30 20:44:02 +02:00
Robert Shearman b0efdcbdbd ole32: Implement CoGetObject. 2006-06-29 14:40:05 +02:00
Robert Shearman b5f7e818a1 ole32: Print an error if a DLL's DllGetClassObject fails as this is
usually a good indicator of a bug elsewhere in Wine.
2006-06-13 11:40:20 +02:00
Robert Shearman 51e22f42bb ole32: Implement CoQueryClientBlanket, CoImpersonateClient and
CoRevertToSelf on top of CoGetCallContext, which is a stub.
2006-06-09 21:11:02 +02:00
Robert Shearman f2bd261f12 ole32: Add a class factory for CLSID_InProcFreeMarshaler. 2006-05-25 10:43:29 +02:00
Robert Shearman 760208b2a5 uuid: Add some COM CLSIDs. 2006-05-25 10:38:57 +02:00
Jonathan Ernst 360a3f9142 Update the address of the Free Software Foundation. 2006-05-23 14:11:13 +02:00
Marcus Meissner f937f72308 ole32: Fixed typo in debug statement. 2006-05-08 14:46:58 +02:00
Robert Shearman 6814b33aa3 ole32: Remove the fixme printed if CoGetClassObject fails in CoCreateInstance.
Remove the fixme printed if CoGetClassObject fails in
CoCreateInstance, because we already print an error in all cases and
the error more accurately pin-points the source of the problem.
2006-05-07 10:03:11 +02:00
Robert Shearman 8c7706bad0 ole32: Don't process posted messages in CoWaitForMultipleHandles.
Tests with native show that during COM calls posted messages aren't
retrieved other than COM calls so change the PeekMessage parameters in
CoWaitForMultipleHandles to duplicate this.
2006-03-30 12:43:17 +02:00
Robert Shearman ff85f892c6 ole32: Try to retrieve messages that are COM calls first.
Try to retrieve messages that are COM calls first in
CoWaitForMultipleHandles before retrieving other types.
2006-03-30 12:42:50 +02:00
Robert Shearman a1548b45d8 ole32: Put the PeekMessage call of CoWaitForMultipleHandles into a separate function.
Put the PeekMessage call of CoWaitForMultipleHandles into a separate
function so that the order and type of the messages retrieved can be
customised in the future.
2006-03-30 12:42:35 +02:00
Robert Shearman 8c551796a9 ole32: Whether the message loop is entered in CoWaitForMultipleHandles,
should depend on whether the current apartment is a single threaded one.
2006-03-30 12:42:01 +02:00
Robert Shearman 3091aa5302 ole32: Pass the no yield flag to PeekMessage.
Pass the no yield flag to PeekMessage since we sleep in
MsgWaitForMultipleObjectsEx and the extra context switch is wasteful.
2006-03-30 12:41:32 +02:00
Robert Shearman f4a8ba9548 ole: Fallthrough from local activation in CoGetClassObject.
If local-server or local-service activation doesn't work in
CoGetClassObject then fallthrough instead of returning from the
function.
2006-02-24 11:23:16 +01:00
Robert Shearman 6c529a7273 ole: Make the CoCreateInstance test succeed.
Move the uninitialized apartment check after zeroing out the return
value.
2006-02-22 22:14:52 +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
Robert Shearman af7c076337 ole32: Print an error message if the apartment isn't initialised in
CoCreateInstance.
2006-02-07 16:25:25 +01:00
Huw Davies aaf7a974a9 ole: ProgIDFromCLSID sets progid to NULL on failure. 2006-01-20 19:41:56 +01:00
Robert Shearman 6e0029f83d ole: Fix WM_QUIT Handling in CoWaitForMultipleHandles.
When a WM_QUIT message in encountered in CoWaitForMultipleHandles then
it should repost the WM_QUIT message and then switch to waiting
without checking messages.
2006-01-20 16:14:23 +01:00
Robert Shearman b4fe7ea7c6 ole: Update the COM todo list. 2006-01-18 11:29:20 +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 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 45d440a219 Implement CLSCTX_INPROC_HANDLER in CoGetClassObject similar to
CLSCTX_INPROC_SERVER by looking at the InprocHandler32 registry key
instead of InprocServer32.
2005-11-12 19:11:21 +00: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
Michael Jung 2f210917ee Added tracing to CoCreateInstance. 2005-11-08 12:43:24 +00:00
Robert Shearman c23cb51d52 Pass WM_QUIT to outer modal loop. 2005-10-03 11:02:37 +00:00
Robert Shearman c86fef8844 Move all 16-bit functions to an appropriate 16-bit file. 2005-09-25 15:17:10 +00:00
Robert Shearman 044ccc40f3 Don't fail in CoRegisterClassObject if the class already exists and
the REGCLS_MULTIPLEUSE flag is specified.
2005-09-23 10:08: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
Robert Shearman c8aedf9726 Add stub for CoAllowSetForegroundWindow. 2005-08-26 08:47:09 +00:00
Robert Shearman bcb251d5b3 Remove unused thread handle entry from the apartment structure. 2005-08-25 09:50:36 +00:00
Mike McCormack 6c8527c31c - return a precomputed result for a NULL string
- pass strlen an LPSTR to eliminate a sign warning
2005-08-22 09:19:38 +00:00
Mike McCormack 61aabd66f5 Warning fixes for gcc 4.0. 2005-08-15 10:49:39 +00:00
Marcus Meissner 61b2fba9d7 Added CoCreateInstance16, CoGetClassObject16, OleLoad16 stubs. 2005-08-15 09:46:51 +00:00
Alex Villacís Lasso 0f9ebafbec Initialize RegisteredClass properly in CoRegisterClassObject to
prevent crash in CoRevokeClassObject when accessing (uninitialized)
pMarshalledData.
2005-07-19 11:40:22 +00:00
Stefan Huehner ac6f562b52 Fix more -Wstrict-prototypes warnings. 2005-06-20 14:18:03 +00:00
Robert Shearman 0a645e8cb9 Convert some registry helper functions to use unicode versions of
CLSID & registry functions (untested).
2005-06-20 13:14:22 +00:00