Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
583dca9d
Commit
583dca9d
authored
Mar 31, 2019
by
Zebediah Figura
Committed by
Alexandre Julliard
Apr 01, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rpcrt4: Improve struct type detection.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
81745dfd
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
72 additions
and
14 deletions
+72
-14
ndr_typelib.c
dlls/rpcrt4/ndr_typelib.c
+72
-14
No files found.
dlls/rpcrt4/ndr_typelib.c
View file @
583dca9d
...
@@ -231,34 +231,92 @@ static BOOL type_pointer_is_iface(ITypeInfo *typeinfo, TYPEDESC *tdesc)
...
@@ -231,34 +231,92 @@ static BOOL type_pointer_is_iface(ITypeInfo *typeinfo, TYPEDESC *tdesc)
}
}
static
unsigned
char
get_array_fc
(
ITypeInfo
*
typeinfo
,
TYPEDESC
*
desc
);
static
unsigned
char
get_array_fc
(
ITypeInfo
*
typeinfo
,
TYPEDESC
*
desc
);
static
unsigned
char
get_struct_fc
(
ITypeInfo
*
typeinfo
,
TYPEATTR
*
attr
);
static
unsigned
char
get_struct_
fc
(
ITypeInfo
*
typeinfo
,
TYPEATTR
*
attr
)
static
unsigned
char
get_struct_
member_fc
(
ITypeInfo
*
typeinfo
,
TYPEDESC
*
tdesc
)
{
{
unsigned
char
fc
=
FC_STRUCT
;
unsigned
char
fc
;
VARDESC
*
desc
;
ITypeInfo
*
refinfo
;
VARTYPE
vt
;
TYPEATTR
*
attr
;
WORD
i
;
for
(
i
=
0
;
i
<
attr
->
cVars
;
i
++
)
switch
(
tdesc
->
vt
)
{
{
ITypeInfo_GetVarDesc
(
typeinfo
,
i
,
&
desc
);
case
VT_BSTR
:
vt
=
desc
->
elemdescVar
.
tdesc
.
vt
;
case
VT_SAFEARRAY
:
return
(
sizeof
(
void
*
)
==
4
)
?
FC_PSTRUCT
:
FC_BOGUS_STRUCT
;
case
VT_CY
:
return
FC_STRUCT
;
case
VT_UNKNOWN
:
case
VT_DISPATCH
:
return
FC_BOGUS_STRUCT
;
case
VT_CARRAY
:
if
(
get_array_fc
(
typeinfo
,
&
tdesc
->
lpadesc
->
tdescElem
)
==
FC_BOGUS_ARRAY
)
return
FC_BOGUS_STRUCT
;
return
FC_STRUCT
;
case
VT_PTR
:
if
(
type_pointer_is_iface
(
typeinfo
,
tdesc
))
fc
=
FC_BOGUS_STRUCT
;
else
fc
=
(
sizeof
(
void
*
)
==
4
)
?
FC_PSTRUCT
:
FC_BOGUS_STRUCT
;
break
;
case
VT_USERDEFINED
:
ITypeInfo_GetRefTypeInfo
(
typeinfo
,
tdesc
->
hreftype
,
&
refinfo
);
ITypeInfo_GetTypeAttr
(
refinfo
,
&
attr
);
switch
(
vt
)
switch
(
attr
->
typekind
)
{
{
case
VT_CARRAY
:
case
TKIND_ENUM
:
if
(
get_array_fc
(
typeinfo
,
&
desc
->
elemdescVar
.
tdesc
.
lpadesc
->
tdescElem
)
==
FC_BOGUS_ARRAY
)
fc
=
FC_STRUCT
;
break
;
case
TKIND_RECORD
:
fc
=
get_struct_fc
(
refinfo
,
attr
);
break
;
case
TKIND_INTERFACE
:
case
TKIND_DISPATCH
:
case
TKIND_COCLASS
:
fc
=
FC_BOGUS_STRUCT
;
fc
=
FC_BOGUS_STRUCT
;
break
;
break
;
case
TKIND_ALIAS
:
fc
=
get_struct_member_fc
(
refinfo
,
&
attr
->
tdescAlias
);
break
;
default:
default:
if
(
!
get_basetype
(
typeinfo
,
&
desc
->
elemdescVar
.
tdesc
))
FIXME
(
"Unhandled kind %#x.
\n
"
,
attr
->
typekind
);
{
FIXME
(
"unhandled type %u
\n
"
,
vt
);
fc
=
FC_BOGUS_STRUCT
;
fc
=
FC_BOGUS_STRUCT
;
break
;
}
}
ITypeInfo_ReleaseTypeAttr
(
refinfo
,
attr
);
ITypeInfo_Release
(
refinfo
);
break
;
break
;
default:
if
(
get_basetype
(
typeinfo
,
tdesc
))
return
FC_STRUCT
;
else
{
FIXME
(
"Unhandled type %u.
\n
"
,
tdesc
->
vt
);
return
FC_BOGUS_STRUCT
;
}
}
}
return
fc
;
}
static
unsigned
char
get_struct_fc
(
ITypeInfo
*
typeinfo
,
TYPEATTR
*
attr
)
{
unsigned
char
fc
=
FC_STRUCT
,
member_fc
;
VARDESC
*
desc
;
WORD
i
;
for
(
i
=
0
;
i
<
attr
->
cVars
;
i
++
)
{
ITypeInfo_GetVarDesc
(
typeinfo
,
i
,
&
desc
);
member_fc
=
get_struct_member_fc
(
typeinfo
,
&
desc
->
elemdescVar
.
tdesc
);
if
(
member_fc
==
FC_BOGUS_STRUCT
)
fc
=
FC_BOGUS_STRUCT
;
else
if
(
member_fc
==
FC_PSTRUCT
&&
fc
!=
FC_BOGUS_STRUCT
)
fc
=
FC_PSTRUCT
;
ITypeInfo_ReleaseVarDesc
(
typeinfo
,
desc
);
ITypeInfo_ReleaseVarDesc
(
typeinfo
,
desc
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment