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
989960f7
Commit
989960f7
authored
Jan 11, 2005
by
Huw Davies
Committed by
Alexandre Julliard
Jan 11, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add help* attributes for typeinfos and functions.
parent
b44b2cc8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
61 additions
and
14 deletions
+61
-14
typelib_struct.h
tools/widl/typelib_struct.h
+9
-5
write_msft.c
tools/widl/write_msft.c
+52
-9
No files found.
tools/widl/typelib_struct.h
View file @
989960f7
...
@@ -47,16 +47,20 @@
...
@@ -47,16 +47,20 @@
*
*
*/
*/
typedef
struct
tagMSFT_Header
{
typedef
struct
tagMSFT_Header
{
/*0x00*/
INT
magic1
;
/* 0x5446534D "MSFT" */
/*0x00*/
INT
magic1
;
/* 0x5446534D "MSFT" */
INT
magic2
;
/* 0x00010002 version nr? */
INT
magic2
;
/* 0x00010002 version nr? */
INT
posguid
;
/* position of libid in guid table */
INT
posguid
;
/* position of libid in guid table */
/* (should be, else -1) */
/* (should be, else -1) */
INT
lcid
;
/* locale id */
INT
lcid
;
/* locale id */
/*0x10*/
INT
lcid2
;
/*0x10*/
INT
lcid2
;
INT
varflags
;
/* (largely) unknown flags ,seems to be always 41 */
INT
varflags
;
/* (largely) unknown flags */
/* becomes 0x51 with a helpfile defined */
/* the lower nibble is syskind */
/* if help dll defined it's 0x151 */
/* 0x40 always seems to be set */
/* update : the lower nibble is syskind */
/* 0x10 set with a helpfile defined */
/* 0x100 set with a helpstringdll defined - in this
case the offset to the name in the stringtable
appears right after this struct, before the
typeinfo offsets */
INT
version
;
/* set with SetVersion() */
INT
version
;
/* set with SetVersion() */
INT
flags
;
/* set with SetFlags() */
INT
flags
;
/* set with SetFlags() */
/*0x20*/
INT
nrtypeinfos
;
/* number of typeinfo's (till so far) */
/*0x20*/
INT
nrtypeinfos
;
/* number of typeinfo's (till so far) */
...
...
tools/widl/write_msft.c
View file @
989960f7
...
@@ -974,12 +974,13 @@ static HRESULT add_func_desc(msft_typeinfo_t* typeinfo, func_t *func)
...
@@ -974,12 +974,13 @@ static HRESULT add_func_desc(msft_typeinfo_t* typeinfo, func_t *func)
int
offset
;
int
offset
;
int
*
typedata
;
int
*
typedata
;
int
i
,
index
=
func
->
idx
,
id
;
int
i
,
index
=
func
->
idx
,
id
;
int
decoded_size
;
int
decoded_size
,
extra_attr
=
0
;
int
num_params
=
0
,
num_defaults
=
0
;
int
num_params
=
0
,
num_defaults
=
0
;
var_t
*
arg
,
*
last_arg
=
NULL
;
var_t
*
arg
,
*
last_arg
=
NULL
;
char
*
namedata
;
char
*
namedata
;
attr_t
*
attr
;
attr_t
*
attr
;
unsigned
int
funcflags
=
0
,
callconv
=
4
;
unsigned
int
funcflags
=
0
,
callconv
=
4
;
int
help_context
=
0
,
help_string_context
=
0
,
help_string_offset
=
-
1
;
id
=
((
0x6000
|
typeinfo
->
typeinfo
->
cImplTypes
)
<<
16
)
|
index
;
id
=
((
0x6000
|
typeinfo
->
typeinfo
->
cImplTypes
)
<<
16
)
|
index
;
...
@@ -1004,13 +1005,23 @@ static HRESULT add_func_desc(msft_typeinfo_t* typeinfo, func_t *func)
...
@@ -1004,13 +1005,23 @@ static HRESULT add_func_desc(msft_typeinfo_t* typeinfo, func_t *func)
chat
(
"num of params %d
\n
"
,
num_params
);
chat
(
"num of params %d
\n
"
,
num_params
);
for
(
attr
=
func
->
def
->
attrs
;
attr
;
attr
=
NEXT_LINK
(
attr
))
{
for
(
attr
=
func
->
def
->
attrs
;
attr
;
attr
=
NEXT_LINK
(
attr
))
{
expr_t
*
expr
=
attr
->
u
.
pval
;
switch
(
attr
->
type
)
{
switch
(
attr
->
type
)
{
case
ATTR_ID
:
case
ATTR_ID
:
{
expr_t
*
expr
=
attr
->
u
.
pval
;
id
=
expr
->
u
.
lval
;
id
=
expr
->
u
.
lval
;
break
;
break
;
}
case
ATTR_HELPCONTEXT
:
extra_attr
=
1
;
help_context
=
expr
->
u
.
lval
;
break
;
case
ATTR_HELPSTRING
:
extra_attr
=
2
;
help_string_offset
=
ctl2_alloc_string
(
typeinfo
->
typelib
,
attr
->
u
.
pval
);
break
;
case
ATTR_HELPSTRINGCONTEXT
:
extra_attr
=
6
;
help_string_context
=
expr
->
u
.
lval
;
break
;
case
ATTR_OUT
:
case
ATTR_OUT
:
break
;
break
;
...
@@ -1021,11 +1032,11 @@ static HRESULT add_func_desc(msft_typeinfo_t* typeinfo, func_t *func)
...
@@ -1021,11 +1032,11 @@ static HRESULT add_func_desc(msft_typeinfo_t* typeinfo, func_t *func)
}
}
/* allocate type data space for us */
/* allocate type data space for us */
offset
=
typeinfo
->
typedata
[
0
];
offset
=
typeinfo
->
typedata
[
0
];
typeinfo
->
typedata
[
0
]
+=
0x18
+
(
num_params
*
(
num_defaults
?
16
:
12
));
typeinfo
->
typedata
[
0
]
+=
0x18
+
extra_attr
*
sizeof
(
int
)
+
(
num_params
*
(
num_defaults
?
16
:
12
));
typedata
=
typeinfo
->
typedata
+
(
offset
>>
2
)
+
1
;
typedata
=
typeinfo
->
typedata
+
(
offset
>>
2
)
+
1
;
/* fill out the basic type information */
/* fill out the basic type information */
typedata
[
0
]
=
(
0x18
+
(
num_params
*
(
num_defaults
?
16
:
12
)))
|
(
index
<<
16
);
typedata
[
0
]
=
(
0x18
+
extra_attr
*
sizeof
(
int
)
+
(
num_params
*
(
num_defaults
?
16
:
12
)))
|
(
index
<<
16
);
ctl2_encode_type
(
typeinfo
->
typelib
,
func
->
def
->
type
,
func
->
def
->
ptr_level
,
func
->
def
->
array
,
&
typedata
[
1
],
NULL
,
NULL
,
&
decoded_size
);
ctl2_encode_type
(
typeinfo
->
typelib
,
func
->
def
->
type
,
func
->
def
->
ptr_level
,
func
->
def
->
array
,
&
typedata
[
1
],
NULL
,
NULL
,
&
decoded_size
);
typedata
[
2
]
=
funcflags
;
typedata
[
2
]
=
funcflags
;
typedata
[
3
]
=
((
52
/*sizeof(FUNCDESC)*/
+
decoded_size
)
<<
16
)
|
typeinfo
->
typeinfo
->
cbSizeVft
;
typedata
[
3
]
=
((
52
/*sizeof(FUNCDESC)*/
+
decoded_size
)
<<
16
)
|
typeinfo
->
typeinfo
->
cbSizeVft
;
...
@@ -1038,11 +1049,24 @@ static HRESULT add_func_desc(msft_typeinfo_t* typeinfo, func_t *func)
...
@@ -1038,11 +1049,24 @@ static HRESULT add_func_desc(msft_typeinfo_t* typeinfo, func_t *func)
typedata
[
3
]
+=
(
16
/*sizeof(ELEMDESC)*/
*
num_params
)
<<
16
;
typedata
[
3
]
+=
(
16
/*sizeof(ELEMDESC)*/
*
num_params
)
<<
16
;
typedata
[
3
]
+=
(
24
/*sizeof(PARAMDESCEX)*/
*
num_defaults
)
<<
16
;
typedata
[
3
]
+=
(
24
/*sizeof(PARAMDESCEX)*/
*
num_defaults
)
<<
16
;
switch
(
extra_attr
)
{
case
6
:
typedata
[
11
]
=
help_string_context
;
case
5
:
typedata
[
10
]
=
-
1
;
case
4
:
typedata
[
9
]
=
-
1
;
case
3
:
typedata
[
8
]
=
-
1
;
case
2
:
typedata
[
7
]
=
help_string_offset
;
case
1
:
typedata
[
6
]
=
help_context
;
case
0
:
break
;
default:
warning
(
"unknown number of optional attrs
\n
"
);
}
for
(
arg
=
last_arg
,
i
=
0
;
arg
;
arg
=
PREV_LINK
(
arg
),
i
++
)
{
for
(
arg
=
last_arg
,
i
=
0
;
arg
;
arg
=
PREV_LINK
(
arg
),
i
++
)
{
attr_t
*
attr
;
attr_t
*
attr
;
int
paramflags
=
0
;
int
paramflags
=
0
;
int
*
paramdata
=
typedata
+
6
+
(
num_defaults
?
num_params
:
0
)
+
i
*
3
;
int
*
paramdata
=
typedata
+
6
+
extra_attr
+
(
num_defaults
?
num_params
:
0
)
+
i
*
3
;
int
*
defaultdata
=
num_defaults
?
typedata
+
6
+
i
:
NULL
;
int
*
defaultdata
=
num_defaults
?
typedata
+
6
+
extra_attr
+
i
:
NULL
;
if
(
defaultdata
)
*
defaultdata
=
-
1
;
if
(
defaultdata
)
*
defaultdata
=
-
1
;
...
@@ -1122,7 +1146,7 @@ static HRESULT add_func_desc(msft_typeinfo_t* typeinfo, func_t *func)
...
@@ -1122,7 +1146,7 @@ static HRESULT add_func_desc(msft_typeinfo_t* typeinfo, func_t *func)
for
(
arg
=
last_arg
,
i
=
0
;
arg
;
arg
=
PREV_LINK
(
arg
),
i
++
)
{
for
(
arg
=
last_arg
,
i
=
0
;
arg
;
arg
=
PREV_LINK
(
arg
),
i
++
)
{
/* FIXME: Almost certainly easy to break */
/* FIXME: Almost certainly easy to break */
int
*
paramdata
=
&
typeinfo
->
typedata
[
typeinfo
->
offsets
[
index
]
>>
2
];
int
*
paramdata
=
&
typeinfo
->
typedata
[
typeinfo
->
offsets
[
index
]
>>
2
];
paramdata
+=
7
+
(
num_defaults
?
num_params
:
0
)
+
i
*
3
;
paramdata
+=
7
+
extra_attr
+
(
num_defaults
?
num_params
:
0
)
+
i
*
3
;
offset
=
ctl2_alloc_name
(
typeinfo
->
typelib
,
arg
->
name
);
offset
=
ctl2_alloc_name
(
typeinfo
->
typelib
,
arg
->
name
);
paramdata
[
1
]
=
offset
;
paramdata
[
1
]
=
offset
;
chat
(
"param %d name %s offset %d
\n
"
,
i
,
arg
->
name
,
offset
);
chat
(
"param %d name %s offset %d
\n
"
,
i
,
arg
->
name
,
offset
);
...
@@ -1356,6 +1380,25 @@ static msft_typeinfo_t *create_msft_typeinfo(msft_typelib_t *typelib, typelib_en
...
@@ -1356,6 +1380,25 @@ static msft_typeinfo_t *create_msft_typeinfo(msft_typelib_t *typelib, typelib_en
for
(
;
attr
;
attr
=
NEXT_LINK
(
attr
))
{
for
(
;
attr
;
attr
=
NEXT_LINK
(
attr
))
{
switch
(
attr
->
type
)
{
switch
(
attr
->
type
)
{
case
ATTR_HELPCONTEXT
:
{
expr_t
*
expr
=
(
expr_t
*
)
attr
->
u
.
pval
;
typeinfo
->
helpcontext
=
expr
->
cval
;
break
;
}
case
ATTR_HELPSTRING
:
{
int
offset
=
ctl2_alloc_string
(
typelib
,
attr
->
u
.
pval
);
if
(
offset
==
-
1
)
break
;
typeinfo
->
docstringoffs
=
offset
;
break
;
}
case
ATTR_HELPSTRINGCONTEXT
:
{
expr_t
*
expr
=
(
expr_t
*
)
attr
->
u
.
pval
;
typeinfo
->
helpstringcontext
=
expr
->
cval
;
break
;
}
case
ATTR_HIDDEN
:
case
ATTR_HIDDEN
:
typeinfo
->
flags
|=
0x10
;
/* TYPEFLAG_FHIDDEN */
typeinfo
->
flags
|=
0x10
;
/* TYPEFLAG_FHIDDEN */
break
;
break
;
...
...
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