ole32: ignore unused flags

Robert Shearman rob at codeweavers.com
Thu Oct 6 00:30:41 CDT 2005


Juan Lang wrote:

>Index: dlls/ole32/compobj.c
>===================================================================
>RCS file: /home/wine/wine/dlls/ole32/compobj.c,v
>retrieving revision 1.165
>diff -u -r1.165 compobj.c
>--- dlls/ole32/compobj.c	3 Oct 2005 11:02:37 -0000	1.165
>+++ dlls/ole32/compobj.c	6 Oct 2005 01:41:57 -0000
>@@ -570,6 +570,8 @@
>  */
> HRESULT WINAPI CoInitializeEx(LPVOID lpReserved, DWORD dwCoInit)
> {
>+  static const DWORD IgnoredFlags = COINIT_DISABLE_OLE1DDE |
>+   COINIT_SPEED_OVER_MEMORY;
>   HRESULT hr = S_OK;
>   APARTMENT *apt;
> 
>@@ -579,6 +581,11 @@
>   {
>     ERR("(%p, %x) - Bad parameter passed-in %p, must be an old Windows Application\n", lpReserved, (int)dwCoInit, lpReserved);
>   }
>+  if (dwCoInit & IgnoredFlags)
>+  {
>+    WARN("(%lx) - Flags ignored\n", dwCoInit & IgnoredFlags);
>+    dwCoInit &= ~IgnoredFlags;
>+  }
> 
>   /*
>    * Check the lock count. If this is the first time going through the initialize
>  
>

Actually, you can ignore all flags except COINIT_APARTMENTTHREADED and 
COINIT_MULTITHREADED. These are the only two that matter for the error 
message and return value of CoInitializeEx. Just and these two flags 
with dwCoInit before comparing it with the existing apartment model.

-- 
Rob Shearman




More information about the wine-devel mailing list