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
5b0ab207
Commit
5b0ab207
authored
Jul 19, 2007
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Add parsing of the version in manifests (based on a patch by Jacek Caban).
parent
a5130f4e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
0 deletions
+37
-0
actctx.c
dlls/ntdll/actctx.c
+37
-0
No files found.
dlls/ntdll/actctx.c
View file @
5b0ab207
...
...
@@ -134,6 +134,7 @@ struct actctx_loader
#define MANIFESTVERSION_ATTR "manifestVersion"
#define NAME_ATTR "name"
#define TYPE_ATTR "type"
#define VERSION_ATTR "version"
#define PROCESSORARCHITECTURE_ATTR "processorArchitecture"
#define XMLNS_ATTR "xmlns"
...
...
@@ -353,6 +354,38 @@ static BOOL parse_xml_header(xmlbuf_t* xmlbuf)
return
FALSE
;
}
static
BOOL
parse_version
(
const
xmlstr_t
*
str
,
struct
version
*
version
)
{
unsigned
int
ver
[
4
];
unsigned
int
pos
;
const
char
*
curr
;
/* major.minor.build.revision */
ver
[
0
]
=
ver
[
1
]
=
ver
[
2
]
=
ver
[
3
]
=
pos
=
0
;
for
(
curr
=
str
->
ptr
;
curr
<
str
->
ptr
+
str
->
len
;
curr
++
)
{
if
(
*
curr
>=
'0'
&&
*
curr
<=
'9'
)
{
ver
[
pos
]
=
ver
[
pos
]
*
10
+
*
curr
-
'0'
;
if
(
ver
[
pos
]
>=
0x10000
)
goto
error
;
}
else
if
(
*
curr
==
'.'
)
{
if
(
++
pos
>=
4
)
goto
error
;
}
else
goto
error
;
}
version
->
major
=
ver
[
0
];
version
->
minor
=
ver
[
1
];
version
->
build
=
ver
[
2
];
version
->
revision
=
ver
[
3
];
return
TRUE
;
error:
FIXME
(
"Wrong version definition in manifest file (%s)
\n
"
,
debugstr_xmlstr
(
str
)
);
return
FALSE
;
}
static
BOOL
parse_expect_elem
(
xmlbuf_t
*
xmlbuf
,
const
char
*
name
)
{
xmlstr_t
elem
;
...
...
@@ -404,6 +437,10 @@ static BOOL parse_assembly_identity_elem(xmlbuf_t* xmlbuf, ACTIVATION_CONTEXT* a
}
ai
->
type
=
TYPE_WIN32
;
}
else
if
(
xmlstr_cmp
(
&
attr_name
,
VERSION_ATTR
))
{
if
(
!
parse_version
(
&
attr_value
,
&
ai
->
version
))
return
FALSE
;
}
else
if
(
xmlstr_cmp
(
&
attr_name
,
PROCESSORARCHITECTURE_ATTR
))
{
if
(
!
(
ai
->
arch
=
xmlstrdupW
(
&
attr_value
)))
return
FALSE
;
...
...
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