Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
28fc1292
Commit
28fc1292
authored
Mar 11, 2011
by
Andrew Eikum
Committed by
Alexandre Julliard
Mar 14, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oleaut32: Use helper function to get CustData by GUID.
parent
3f7ad460
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
52 deletions
+49
-52
typelib.c
dlls/oleaut32/typelib.c
+49
-52
No files found.
dlls/oleaut32/typelib.c
View file @
28fc1292
...
@@ -1614,6 +1614,17 @@ static inline TLBVarDesc *TLB_get_vardesc_by_name(TLBVarDesc *vardescs,
...
@@ -1614,6 +1614,17 @@ static inline TLBVarDesc *TLB_get_vardesc_by_name(TLBVarDesc *vardescs,
return
NULL
;
return
NULL
;
}
}
static
inline
TLBCustData
*
TLB_get_custdata_by_guid
(
TLBCustData
**
custdata_list
,
REFGUID
guid
)
{
TLBCustData
*
cust_data
=
*
custdata_list
;
while
(
cust_data
){
if
(
IsEqualIID
(
&
cust_data
->
guid
,
guid
))
return
cust_data
;
cust_data
=
cust_data
->
next
;
}
return
NULL
;
}
/**********************************************************************
/**********************************************************************
*
*
* Functions for reading MSFT typelibs (those created by CreateTypeLib2)
* Functions for reading MSFT typelibs (those created by CreateTypeLib2)
...
@@ -4599,20 +4610,16 @@ static HRESULT WINAPI ITypeLib2_fnGetCustData(
...
@@ -4599,20 +4610,16 @@ static HRESULT WINAPI ITypeLib2_fnGetCustData(
ITypeLibImpl
*
This
=
(
ITypeLibImpl
*
)
iface
;
ITypeLibImpl
*
This
=
(
ITypeLibImpl
*
)
iface
;
TLBCustData
*
pCData
;
TLBCustData
*
pCData
;
for
(
pCData
=
This
->
pCustData
;
pCData
;
pCData
=
pCData
->
next
)
TRACE
(
"%p %s %p
\n
"
,
This
,
debugstr_guid
(
guid
),
pVarVal
);
{
if
(
IsEqualIID
(
guid
,
&
pCData
->
guid
))
break
;
}
TRACE
(
"(%p) guid %s %s found!x)
\n
"
,
This
,
debugstr_guid
(
guid
),
pCData
?
""
:
"NOT"
);
pCData
=
TLB_get_custdata_by_guid
(
&
This
->
pCustData
,
guid
);
if
(
!
pCData
)
return
TYPE_E_ELEMENTNOTFOUND
;
VariantInit
(
pVarVal
);
VariantCopy
(
pVarVal
,
&
pCData
->
data
);
if
(
pCData
)
{
VariantInit
(
pVarVal
);
VariantCopy
(
pVarVal
,
&
pCData
->
data
);
return
S_OK
;
return
S_OK
;
}
return
E_INVALIDARG
;
/* FIXME: correct? */
}
}
/* ITypeLib2::GetLibStatistics
/* ITypeLib2::GetLibStatistics
...
@@ -7236,10 +7243,9 @@ static HRESULT WINAPI ITypeInfo2_fnGetCustData(
...
@@ -7236,10 +7243,9 @@ static HRESULT WINAPI ITypeInfo2_fnGetCustData(
ITypeInfoImpl
*
This
=
(
ITypeInfoImpl
*
)
iface
;
ITypeInfoImpl
*
This
=
(
ITypeInfoImpl
*
)
iface
;
TLBCustData
*
pCData
;
TLBCustData
*
pCData
;
for
(
pCData
=
This
->
pCustData
;
pCData
;
pCData
=
pCData
->
next
)
TRACE
(
"%p %s %p
\n
"
,
This
,
debugstr_guid
(
guid
),
pVarVal
);
if
(
IsEqualIID
(
guid
,
&
pCData
->
guid
))
break
;
TRACE
(
"(%p) guid %s %s found!x)
\n
"
,
This
,
debugstr_guid
(
guid
),
pCData
?
""
:
"NOT"
);
pCData
=
TLB_get_custdata_by_guid
(
&
This
->
pCustData
,
guid
);
VariantInit
(
pVarVal
);
VariantInit
(
pVarVal
);
if
(
pCData
)
if
(
pCData
)
...
@@ -7260,23 +7266,22 @@ static HRESULT WINAPI ITypeInfo2_fnGetFuncCustData(
...
@@ -7260,23 +7266,22 @@ static HRESULT WINAPI ITypeInfo2_fnGetFuncCustData(
VARIANT
*
pVarVal
)
VARIANT
*
pVarVal
)
{
{
ITypeInfoImpl
*
This
=
(
ITypeInfoImpl
*
)
iface
;
ITypeInfoImpl
*
This
=
(
ITypeInfoImpl
*
)
iface
;
TLBCustData
*
pCData
=
NULL
;
TLBCustData
*
pCData
;
TLBFuncDesc
*
pFDesc
=
&
This
->
funcdescs
[
index
];
TLBFuncDesc
*
pFDesc
=
&
This
->
funcdescs
[
index
];
TRACE
(
"%p %u %s %p
\n
"
,
This
,
index
,
debugstr_guid
(
guid
),
pVarVal
);
if
(
index
>=
This
->
TypeAttr
.
cFuncs
)
if
(
index
>=
This
->
TypeAttr
.
cFuncs
)
return
TYPE_E_ELEMENTNOTFOUND
;
return
TYPE_E_ELEMENTNOTFOUND
;
for
(
pCData
=
pFDesc
->
pCustData
;
pCData
;
pCData
=
pCData
->
next
)
pCData
=
TLB_get_custdata_by_guid
(
&
pFDesc
->
pCustData
,
guid
);
if
(
IsEqualIID
(
guid
,
&
pCData
->
guid
))
break
;
if
(
!
pCData
)
return
TYPE_E_ELEMENTNOTFOUND
;
TRACE
(
"(%p) guid %s %s found!x)
\n
"
,
This
,
debugstr_guid
(
guid
),
pCData
?
""
:
"NOT"
);
VariantInit
(
pVarVal
);
VariantCopy
(
pVarVal
,
&
pCData
->
data
);
if
(
pCData
){
VariantInit
(
pVarVal
);
VariantCopy
(
pVarVal
,
&
pCData
->
data
);
return
S_OK
;
return
S_OK
;
}
return
TYPE_E_ELEMENTNOTFOUND
;
}
}
/* ITypeInfo2::GetParamCustData
/* ITypeInfo2::GetParamCustData
...
@@ -7294,25 +7299,23 @@ static HRESULT WINAPI ITypeInfo2_fnGetParamCustData(
...
@@ -7294,25 +7299,23 @@ static HRESULT WINAPI ITypeInfo2_fnGetParamCustData(
TLBCustData
*
pCData
;
TLBCustData
*
pCData
;
TLBFuncDesc
*
pFDesc
=
&
This
->
funcdescs
[
indexFunc
];
TLBFuncDesc
*
pFDesc
=
&
This
->
funcdescs
[
indexFunc
];
TRACE
(
"%p %u %u %s %p
\n
"
,
This
,
indexFunc
,
indexParam
,
debugstr_guid
(
guid
),
pVarVal
);
if
(
indexFunc
>=
This
->
TypeAttr
.
cFuncs
)
if
(
indexFunc
>=
This
->
TypeAttr
.
cFuncs
)
return
TYPE_E_ELEMENTNOTFOUND
;
return
TYPE_E_ELEMENTNOTFOUND
;
if
(
indexParam
>=
pFDesc
->
funcdesc
.
cParams
)
if
(
indexParam
>=
pFDesc
->
funcdesc
.
cParams
)
return
TYPE_E_ELEMENTNOTFOUND
;
return
TYPE_E_ELEMENTNOTFOUND
;
for
(
pCData
=
pFDesc
->
pParamDesc
[
indexParam
].
pCustData
;
pCData
;
pCData
=
TLB_get_custdata_by_guid
(
&
pFDesc
->
pParamDesc
[
indexParam
].
pCustData
,
guid
)
;
pCData
=
pCData
->
next
)
if
(
!
pCData
)
if
(
IsEqualIID
(
guid
,
&
pCData
->
guid
))
break
;
return
TYPE_E_ELEMENTNOTFOUND
;
TRACE
(
"(%p) guid %s %s found!x)
\n
"
,
This
,
debugstr_guid
(
guid
),
pCData
?
""
:
"NOT"
);
VariantInit
(
pVarVal
);
VariantCopy
(
pVarVal
,
&
pCData
->
data
);
if
(
pCData
)
{
VariantInit
(
pVarVal
);
VariantCopy
(
pVarVal
,
&
pCData
->
data
);
return
S_OK
;
return
S_OK
;
}
return
TYPE_E_ELEMENTNOTFOUND
;
}
}
/* ITypeInfo2::GetVarCustData
/* ITypeInfo2::GetVarCustData
...
@@ -7326,7 +7329,7 @@ static HRESULT WINAPI ITypeInfo2_fnGetVarCustData(
...
@@ -7326,7 +7329,7 @@ static HRESULT WINAPI ITypeInfo2_fnGetVarCustData(
VARIANT
*
pVarVal
)
VARIANT
*
pVarVal
)
{
{
ITypeInfoImpl
*
This
=
(
ITypeInfoImpl
*
)
iface
;
ITypeInfoImpl
*
This
=
(
ITypeInfoImpl
*
)
iface
;
TLBCustData
*
pCData
=
NULL
;
TLBCustData
*
pCData
;
TLBVarDesc
*
pVDesc
=
&
This
->
vardescs
[
index
];
TLBVarDesc
*
pVDesc
=
&
This
->
vardescs
[
index
];
TRACE
(
"%p %s %p
\n
"
,
This
,
debugstr_guid
(
guid
),
pVarVal
);
TRACE
(
"%p %s %p
\n
"
,
This
,
debugstr_guid
(
guid
),
pVarVal
);
...
@@ -7334,14 +7337,13 @@ static HRESULT WINAPI ITypeInfo2_fnGetVarCustData(
...
@@ -7334,14 +7337,13 @@ static HRESULT WINAPI ITypeInfo2_fnGetVarCustData(
if
(
index
>=
This
->
TypeAttr
.
cVars
)
if
(
index
>=
This
->
TypeAttr
.
cVars
)
return
TYPE_E_ELEMENTNOTFOUND
;
return
TYPE_E_ELEMENTNOTFOUND
;
for
(
pCData
=
pVDesc
->
pCustData
;
pCData
;
pCData
=
pCData
->
next
)
pCData
=
TLB_get_custdata_by_guid
(
&
pVDesc
->
pCustData
,
guid
);
if
(
IsEqualIID
(
guid
,
&
pCData
->
guid
))
break
;
if
(
!
pCData
)
if
(
!
pCData
)
return
TYPE_E_ELEMENTNOTFOUND
;
return
TYPE_E_ELEMENTNOTFOUND
;
VariantInit
(
pVarVal
);
VariantInit
(
pVarVal
);
VariantCopy
(
pVarVal
,
&
pCData
->
data
);
VariantCopy
(
pVarVal
,
&
pCData
->
data
);
return
S_OK
;
return
S_OK
;
}
}
...
@@ -7356,27 +7358,22 @@ static HRESULT WINAPI ITypeInfo2_fnGetImplTypeCustData(
...
@@ -7356,27 +7358,22 @@ static HRESULT WINAPI ITypeInfo2_fnGetImplTypeCustData(
VARIANT
*
pVarVal
)
VARIANT
*
pVarVal
)
{
{
ITypeInfoImpl
*
This
=
(
ITypeInfoImpl
*
)
iface
;
ITypeInfoImpl
*
This
=
(
ITypeInfoImpl
*
)
iface
;
TLBCustData
*
pCData
=
NULL
;
TLBCustData
*
pCData
;
TLBImplType
*
pRDesc
=
&
This
->
impltypes
[
index
];
TLBImplType
*
pRDesc
=
&
This
->
impltypes
[
index
];
TRACE
(
"%p %u %s %p
\n
"
,
This
,
index
,
debugstr_guid
(
guid
),
pVarVal
);
if
(
index
>=
This
->
TypeAttr
.
cImplTypes
)
if
(
index
>=
This
->
TypeAttr
.
cImplTypes
)
return
TYPE_E_ELEMENTNOTFOUND
;
return
TYPE_E_ELEMENTNOTFOUND
;
for
(
pCData
=
pRDesc
->
pCustData
;
pCData
;
pCData
=
pCData
->
next
)
pCData
=
TLB_get_custdata_by_guid
(
&
pRDesc
->
pCustData
,
guid
);
{
if
(
!
pCData
)
if
(
IsEqualIID
(
guid
,
&
pCData
->
guid
))
break
;
return
TYPE_E_ELEMENTNOTFOUND
;
}
TRACE
(
"(%p) guid %s %s found!x)
\n
"
,
This
,
debugstr_guid
(
guid
),
pCData
?
""
:
"NOT"
);
VariantInit
(
pVarVal
);
VariantCopy
(
pVarVal
,
&
pCData
->
data
);
if
(
pCData
)
{
VariantInit
(
pVarVal
);
VariantCopy
(
pVarVal
,
&
pCData
->
data
);
return
S_OK
;
return
S_OK
;
}
return
TYPE_E_ELEMENTNOTFOUND
;
}
}
/* ITypeInfo2::GetDocumentation2
/* ITypeInfo2::GetDocumentation2
...
...
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