Re: oleaut32: Handle TKIND_COCLASS subtype for VT_PTR/VT_USERDEFINED.

2010-09-07 Thread Dmitry Timoshkov
Jan Ohlsen  wrote:

> + case TKIND_COCLASS: {
> + ITypeInfo   *pSubTypeInfo = NULL;
> + TYPEATTR*tattr2 = NULL;
> + GUID*iid = &(tattr->guid);

Once you set tab size to 8 in your editor, or better will not use tabs
at all, you will notice that your formatting doesn't match the surrounding
code.

P.S.
Patches should be sent to wine-patches.

-- 
Dmitry.




Re: oleaut32: Handle TKIND_COCLASS subtype for VT_PTR/VT_USERDEFINED.

2010-09-07 Thread Jan Ohlsen
On Mon, Sep 6, 2010 at 6:18 PM, Vincent Povirk wrote:

> +   // Use IID of the coclass' default
> interface
>
> Don't use C++ comments.
>
> On Mon, Sep 6, 2010 at 10:31 AM, Jan Ohlsen 
> wrote:
> >
> > ---
> >  dlls/oleaut32/tmarshal.c |   69
> > ++
> >  1 files changed, 69 insertions(+), 0 deletions(-)
> >
> >
> >
> >
> >
>
From ef0e7fac6b2675f6a3a5031abc05521fefc9adab Mon Sep 17 00:00:00 2001
From: Jan T. Ohlsen 
Date: Mon, 6 Sep 2010 01:36:04 +0100
Subject: oleaut32: Handle TKIND_COCLASS subtype for VT_PTR/VT_USERDEFINED.
   (May resolve #19016.)

---
 dlls/oleaut32/tmarshal.c |   69 ++
 1 files changed, 69 insertions(+), 0 deletions(-)

diff --git a/dlls/oleaut32/tmarshal.c b/dlls/oleaut32/tmarshal.c
index 26babdb..3264b42 100644
--- a/dlls/oleaut32/tmarshal.c
+++ b/dlls/oleaut32/tmarshal.c
@@ -724,6 +724,7 @@ serialize_param(
break;
case TKIND_DISPATCH:/* will be done in VT_USERDEFINED case 
*/
case TKIND_INTERFACE:   /* will be done in VT_USERDEFINED case 
*/
+   case TKIND_COCLASS: /* will be done in VT_USERDEFINED case 
*/
derefhere=FALSE;
break;
default:
@@ -785,6 +786,41 @@ serialize_param(
if (dealloc)
IUnknown_Release((LPUNKNOWN)arg);
break;
+   case TKIND_COCLASS: {
+   ITypeInfo   *pSubTypeInfo = NULL;
+   TYPEATTR*tattr2 = NULL;
+   GUID*iid = &(tattr->guid);
+
+   if (tattr->cImplTypes > 0) {
+   /* Use IID of the coclass' default interface */
+   HREFTYPE href;
+   HRESULT hr;
+
+   hr = ITypeInfo_GetRefTypeOfImplType(tinfo2, 0, &href);
+   if (!hr) {
+   hr = ITypeInfo_GetRefTypeInfo(tinfo2, href, 
&pSubTypeInfo);
+   if (!hr) {
+   hr = 
ITypeInfo_GetTypeAttr(pSubTypeInfo, &tattr2);
+   if (!hr)
+   iid = &tattr2->guid;
+   }
+   }
+   }
+
+   if (writeit)
+   hres=_marshal_interface(buf,iid,(LPUNKNOWN)arg);
+
+   if (tattr2)
+   ITypeInfo_ReleaseTypeAttr(pSubTypeInfo, tattr2);
+
+   if (pSubTypeInfo)
+   ITypeInfo_Release(pSubTypeInfo);
+
+   if (dealloc)
+   IUnknown_Release((LPUNKNOWN)arg);
+
+   break;
+   }
case TKIND_RECORD: {
int i;
if (debugout) TRACE_(olerelay)("{");
@@ -1000,6 +1036,7 @@ deserialize_param(
break;
case TKIND_DISPATCH:/* will be done in VT_USERDEFINED case 
*/
case TKIND_INTERFACE:   /* will be done in VT_USERDEFINED case 
*/
+   case TKIND_COCLASS: /* will be done in VT_USERDEFINED case 
*/
derefhere=FALSE;
break;
default:
@@ -1074,6 +,38 @@ deserialize_param(
if (readit)
hres = 
_unmarshal_interface(buf,&(tattr->guid),(LPUNKNOWN*)arg);
break;
+   case TKIND_COCLASS: {
+   ITypeInfo   *pSubTypeInfo = NULL;
+   TYPEATTR*tattr2 = NULL;
+   GUID*iid = &(tattr->guid);
+
+   if (tattr->cImplTypes > 0) {
+   /* Use IID of the coclass' default interface */
+   HREFTYPE href;
+   HRESULT hr;
+
+   hr = ITypeInfo_GetRefTypeOfImplType(tinfo2, 0, 
&href);
+   if (!hr) {
+   hr = ITypeInfo_GetRefTypeInfo(tinfo2, 
href, &pSubTypeInfo);
+   if (!hr) {
+   hr = 
ITypeInfo_GetTypeAttr(pSubTypeInfo, &tattr2);
+   if (!hr)
+   iid = &tattr2->guid;
+   }
+   }
+   }
+
+   if (readit)
+   hres = 
_unmarshal_interface(buf,iid,(LPUNKNOWN*)arg);
+
+   if (tattr2)
+   ITypeInfo_ReleaseTypeAttr(pSubTypeInfo, tattr2);
+
+ 

Re: oleaut32: Handle TKIND_COCLASS subtype for VT_PTR/VT_USERDEFINED.

2010-09-06 Thread Vincent Povirk
+   // Use IID of the coclass' default interface

Don't use C++ comments.

On Mon, Sep 6, 2010 at 10:31 AM, Jan Ohlsen  wrote:
>
> ---
>  dlls/oleaut32/tmarshal.c |   69
> ++
>  1 files changed, 69 insertions(+), 0 deletions(-)
>
>
>
>
>