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
57c784e2
Commit
57c784e2
authored
May 17, 2010
by
Andrey Turkin
Committed by
Alexandre Julliard
May 17, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oleaut32: Implement ITypeInfo::GetDocumentation.
parent
636e35d8
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
123 additions
and
5 deletions
+123
-5
typelib.c
dlls/oleaut32/tests/typelib.c
+46
-3
typelib2.c
dlls/oleaut32/typelib2.c
+77
-2
No files found.
dlls/oleaut32/tests/typelib.c
View file @
57c784e2
...
...
@@ -973,6 +973,7 @@ if(use_midl_tlb) {
static
void
test_CreateTypeLib
(
void
)
{
static
const
WCHAR
stdoleW
[]
=
{
's'
,
't'
,
'd'
,
'o'
,
'l'
,
'e'
,
'2'
,
'.'
,
't'
,
'l'
,
'b'
,
0
};
static
OLECHAR
typelibW
[]
=
{
't'
,
'y'
,
'p'
,
'e'
,
'l'
,
'i'
,
'b'
,
0
};
static
OLECHAR
helpfileW
[]
=
{
'C'
,
':'
,
'\\'
,
'b'
,
'o'
,
'g'
,
'u'
,
's'
,
'.'
,
'h'
,
'l'
,
'p'
,
0
};
static
OLECHAR
interface1W
[]
=
{
'i'
,
'n'
,
't'
,
'e'
,
'r'
,
'f'
,
'a'
,
'c'
,
'e'
,
'1'
,
0
};
static
OLECHAR
interface2W
[]
=
{
'i'
,
'n'
,
't'
,
'e'
,
'r'
,
'f'
,
'a'
,
'c'
,
'e'
,
'2'
,
0
};
static
OLECHAR
interface3W
[]
=
{
'i'
,
'n'
,
't'
,
'e'
,
'r'
,
'f'
,
'a'
,
'c'
,
'e'
,
'3'
,
0
};
...
...
@@ -1052,16 +1053,19 @@ static void test_CreateTypeLib(void) {
hres
=
ICreateTypeLib_SetName
(
createtl
,
typelibW
);
ok
(
hres
==
S_OK
,
"got %08x
\n
"
,
hres
);
hres
=
ICreateTypeLib_SetHelpFileName
(
createtl
,
helpfileW
);
ok
(
hres
==
S_OK
,
"got %08x
\n
"
,
hres
);
hres
=
ITypeLib_GetDocumentation
(
tl
,
-
1
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
hres
==
S_OK
,
"got %08x
\n
"
,
hres
);
hres
=
ITypeLib_GetDocumentation
(
tl
,
-
1
,
&
name
,
NULL
,
NULL
,
NULL
);
hres
=
ITypeLib_GetDocumentation
(
tl
,
-
1
,
&
name
,
NULL
,
NULL
,
&
helpfile
);
ok
(
hres
==
S_OK
,
"got %08x
\n
"
,
hres
);
ok
(
!
memcmp
(
name
,
typelibW
,
sizeof
(
typelibW
)),
"name = %s
\n
"
,
wine_dbgstr_w
(
name
));
ok
(
!
memcmp
(
helpfile
,
helpfileW
,
sizeof
(
helpfileW
)),
"helpfile = %s
\n
"
,
wine_dbgstr_w
(
helpfile
));
SysFreeString
(
name
);
ITypeLib_Release
(
tl
);
SysFreeString
(
helpfile
);
hres
=
ICreateTypeLib_CreateTypeInfo
(
createtl
,
interface1W
,
TKIND_INTERFACE
,
&
createti
);
ok
(
hres
==
S_OK
,
"got %08x
\n
"
,
hres
);
...
...
@@ -1069,9 +1073,33 @@ static void test_CreateTypeLib(void) {
hres
=
ICreateTypeInfo_QueryInterface
(
createti
,
&
IID_ITypeInfo
,
(
void
**
)
&
interface1
);
ok
(
hres
==
S_OK
,
"got %08x
\n
"
,
hres
);
hres
=
ITypeLib_GetDocumentation
(
tl
,
0
,
&
name
,
NULL
,
NULL
,
NULL
);
ok
(
hres
==
S_OK
,
"got %08x
\n
"
,
hres
);
ok
(
!
memcmp
(
name
,
interface1W
,
sizeof
(
interface1W
)),
"name = %s
\n
"
,
wine_dbgstr_w
(
name
));
SysFreeString
(
name
);
ITypeLib_Release
(
tl
);
name
=
(
BSTR
)
0xdeadbeef
;
helpfile
=
(
BSTR
)
0xdeadbeef
;
hres
=
ITypeInfo_GetDocumentation
(
interface1
,
-
1
,
&
name
,
&
docstring
,
&
helpcontext
,
&
helpfile
);
ok
(
hres
==
S_OK
,
"got %08x
\n
"
,
hres
);
ok
(
!
memcmp
(
name
,
interface1W
,
sizeof
(
interface1W
)),
"name = %s
\n
"
,
wine_dbgstr_w
(
name
));
ok
(
docstring
==
NULL
,
"docstring != NULL
\n
"
);
ok
(
helpcontext
==
0
,
"helpcontext != 0
\n
"
);
ok
(
!
memcmp
(
helpfile
,
helpfileW
,
sizeof
(
helpfileW
)),
"helpfile = %s
\n
"
,
wine_dbgstr_w
(
helpfile
));
SysFreeString
(
name
);
SysFreeString
(
helpfile
);
hres
=
ITypeInfo_GetDocumentation
(
interface1
,
0
,
&
name
,
NULL
,
NULL
,
NULL
);
ok
(
hres
==
TYPE_E_ELEMENTNOTFOUND
,
"got %08x
\n
"
,
hres
);
hres
=
ITypeInfo_GetRefTypeInfo
(
interface1
,
0
,
NULL
);
ok
(
hres
==
E_INVALIDARG
,
"got %08x
\n
"
,
hres
);
hres
=
ICreateTypeInfo_LayOut
(
createti
);
ok
(
hres
==
S_OK
,
"got %08x
\n
"
,
hres
);
...
...
@@ -1212,6 +1240,15 @@ static void test_CreateTypeLib(void) {
hres
=
ICreateTypeInfo_AddFuncDesc
(
createti
,
3
,
&
funcdesc
);
ok
(
hres
==
S_OK
,
"got %08x
\n
"
,
hres
);
hres
=
ITypeInfo_GetDocumentation
(
interface1
,
0
,
&
name
,
&
docstring
,
&
helpcontext
,
&
helpfile
);
ok
(
hres
==
S_OK
,
"got %08x
\n
"
,
hres
);
ok
(
name
==
NULL
,
"name != NULL
\n
"
);
ok
(
docstring
==
NULL
,
"docstring != NULL
\n
"
);
ok
(
helpcontext
==
0x201
,
"helpcontext != 0x201
\n
"
);
ok
(
!
memcmp
(
helpfile
,
helpfileW
,
sizeof
(
helpfileW
)),
"helpfile = %s
\n
"
,
wine_dbgstr_w
(
helpfile
));
SysFreeString
(
helpfile
);
hres
=
ICreateTypeInfo_SetFuncAndParamNames
(
createti
,
1000
,
NULL
,
1
);
ok
(
hres
==
E_INVALIDARG
,
"got %08x
\n
"
,
hres
);
...
...
@@ -1227,6 +1264,12 @@ static void test_CreateTypeLib(void) {
hres
=
ICreateTypeInfo_SetFuncAndParamNames
(
createti
,
0
,
names1
,
1
);
ok
(
hres
==
S_OK
,
"got %08x
\n
"
,
hres
);
hres
=
ITypeInfo_GetDocumentation
(
interface1
,
0
,
&
name
,
NULL
,
NULL
,
NULL
);
ok
(
hres
==
S_OK
,
"got %08x
\n
"
,
hres
);
ok
(
!
memcmp
(
name
,
func1W
,
sizeof
(
func1W
)),
"name = %s
\n
"
,
wine_dbgstr_w
(
name
));
SysFreeString
(
name
);
hres
=
ICreateTypeInfo_SetFuncAndParamNames
(
createti
,
3
,
names2
,
3
);
ok
(
hres
==
S_OK
,
"got %08x
\n
"
,
hres
);
...
...
dlls/oleaut32/typelib2.c
View file @
57c784e2
...
...
@@ -3163,8 +3163,83 @@ static HRESULT WINAPI ITypeInfo2_fnGetDocumentation(
DWORD
*
pdwHelpContext
,
BSTR
*
pBstrHelpFile
)
{
FIXME
(
"(%p,%d,%p,%p,%p,%p), stub!
\n
"
,
iface
,
memid
,
pBstrName
,
pBstrDocString
,
pdwHelpContext
,
pBstrHelpFile
);
ICreateTypeInfo2Impl
*
This
=
impl_from_ITypeInfo2
(
iface
);
HRESULT
status
=
TYPE_E_ELEMENTNOTFOUND
;
INT
nameoffset
,
docstringoffset
,
helpcontext
;
TRACE
(
"(%p,%d,%p,%p,%p,%p)
\n
"
,
iface
,
memid
,
pBstrName
,
pBstrDocString
,
pdwHelpContext
,
pBstrHelpFile
);
if
(
memid
==
-
1
)
{
nameoffset
=
This
->
typeinfo
->
NameOffset
;
docstringoffset
=
This
->
typeinfo
->
docstringoffs
;
helpcontext
=
This
->
typeinfo
->
helpcontext
;
status
=
S_OK
;
}
else
{
CyclicList
*
iter
;
if
(
This
->
typedata
)
{
for
(
iter
=
This
->
typedata
->
next
->
next
;
iter
!=
This
->
typedata
->
next
;
iter
=
iter
->
next
)
{
if
(
iter
->
indice
==
memid
)
{
const
int
*
typedata
=
iter
->
u
.
data
;
int
size
=
typedata
[
0
]
-
typedata
[
5
]
*
(
typedata
[
4
]
&
0x1000
?
16
:
12
);
nameoffset
=
iter
->
name
;
/* FIXME implement this once SetFuncDocString is implemented */
docstringoffset
=
-
1
;
helpcontext
=
(
size
<
7
*
sizeof
(
int
))
?
0
:
typedata
[
6
];
status
=
S_OK
;
break
;
}
}
}
}
if
(
!
status
)
{
WCHAR
*
string
;
if
(
pBstrName
)
{
if
(
nameoffset
==
-
1
)
*
pBstrName
=
NULL
;
else
{
MSFT_NameIntro
*
name
=
(
MSFT_NameIntro
*
)
&
This
->
typelib
->
typelib_segment_data
[
MSFT_SEG_NAME
][
nameoffset
];
ctl2_decode_name
((
char
*
)
&
name
->
namelen
,
&
string
);
*
pBstrName
=
SysAllocString
(
string
);
if
(
!*
pBstrName
)
return
E_OUTOFMEMORY
;
}
}
if
(
pBstrDocString
)
{
if
(
docstringoffset
==
-
1
)
*
pBstrDocString
=
NULL
;
else
{
MSFT_NameIntro
*
name
=
(
MSFT_NameIntro
*
)
&
This
->
typelib
->
typelib_segment_data
[
MSFT_SEG_NAME
][
docstringoffset
];
ctl2_decode_name
((
char
*
)
&
name
->
namelen
,
&
string
);
*
pBstrDocString
=
SysAllocString
(
string
);
if
(
!*
pBstrDocString
)
{
if
(
pBstrName
)
SysFreeString
(
*
pBstrName
);
return
E_OUTOFMEMORY
;
}
}
}
if
(
pdwHelpContext
)
{
*
pdwHelpContext
=
helpcontext
;
}
if
(
pBstrHelpFile
)
{
status
=
ITypeLib_GetDocumentation
((
ITypeLib
*
)
&
This
->
typelib
->
lpVtblTypeLib2
,
-
1
,
NULL
,
NULL
,
NULL
,
pBstrHelpFile
);
if
(
status
)
{
if
(
pBstrName
)
SysFreeString
(
*
pBstrName
);
if
(
pBstrDocString
)
SysFreeString
(
*
pBstrDocString
);
}
}
}
return
status
;
}
/******************************************************************************
...
...
@@ -4549,7 +4624,7 @@ static HRESULT WINAPI ITypeLib2_fnGetDocumentation(
if
(
!
iter
)
return
TYPE_E_ELEMENTNOTFOUND
;
return
ITypeInfo_GetDocumentation
((
ITypeInfo
*
)
iter
->
lpVtblTypeInfo2
,
return
ITypeInfo_GetDocumentation
((
ITypeInfo
*
)
&
iter
->
lpVtblTypeInfo2
,
-
1
,
pBstrName
,
pBstrDocString
,
pdwHelpContext
,
pBstrHelpFile
);
}
...
...
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