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
2f965ed6
Commit
2f965ed6
authored
Sep 20, 2019
by
Jacek Caban
Committed by
Alexandre Julliard
Sep 20, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
scrobj: Add script element parser partial implementation.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
cad4da44
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
67 additions
and
3 deletions
+67
-3
scrobj.c
dlls/scrobj/scrobj.c
+67
-3
No files found.
dlls/scrobj/scrobj.c
View file @
2f965ed6
...
...
@@ -50,6 +50,13 @@ struct method_parameter
WCHAR
*
name
;
};
struct
scriptlet_script
{
struct
list
entry
;
WCHAR
*
language
;
WCHAR
*
body
;
};
struct
scriptlet_factory
{
IClassFactory
IClassFactory_iface
;
...
...
@@ -69,6 +76,7 @@ struct scriptlet_factory
CLSID
classid
;
struct
list
members
;
struct
list
scripts
;
};
typedef
enum
tid_t
...
...
@@ -406,10 +414,51 @@ static HRESULT parse_scriptlet_public(struct scriptlet_factory *factory)
return
S_OK
;
}
static
HRESULT
parse_scriptlet_script
(
struct
scriptlet_factory
*
factory
)
static
HRESULT
parse_scriptlet_script
(
struct
scriptlet_factory
*
factory
,
struct
scriptlet_script
*
script
)
{
FIXME
(
"
\n
"
);
XmlNodeType
node_type
;
HRESULT
hres
;
for
(;;)
{
hres
=
IXmlReader_MoveToNextAttribute
(
factory
->
xml_reader
);
if
(
hres
!=
S_OK
)
break
;
if
(
is_xml_name
(
factory
,
L"language"
))
{
if
(
script
->
language
)
{
FIXME
(
"Duplicated language
\n
"
);
return
E_FAIL
;
}
hres
=
read_xml_value
(
factory
,
&
script
->
language
);
if
(
FAILED
(
hres
))
return
hres
;
}
else
{
FIXME
(
"Unexpected attribute
\n
"
);
return
E_NOTIMPL
;
}
}
if
(
!
script
->
language
)
{
FIXME
(
"Language not specified
\n
"
);
return
E_FAIL
;
}
if
(
FAILED
(
hres
=
next_xml_node
(
factory
,
&
node_type
)))
return
hres
;
if
(
node_type
!=
XmlNodeType_Text
&&
node_type
!=
XmlNodeType_CDATA
)
{
FIXME
(
"Unexpected node type %u
\n
"
,
node_type
);
return
E_FAIL
;
}
hres
=
read_xml_value
(
factory
,
&
script
->
body
);
if
(
FAILED
(
hres
))
return
hres
;
return
expect_end_element
(
factory
);
}
static
HRESULT
parse_scriptlet_file
(
struct
scriptlet_factory
*
factory
,
const
WCHAR
*
url
)
...
...
@@ -471,7 +520,13 @@ static HRESULT parse_scriptlet_file(struct scriptlet_factory *factory, const WCH
else
if
(
is_xml_name
(
factory
,
L"public"
))
hres
=
parse_scriptlet_public
(
factory
);
else
if
(
is_xml_name
(
factory
,
L"script"
))
hres
=
parse_scriptlet_script
(
factory
);
{
struct
scriptlet_script
*
script
;
if
(
!
(
script
=
heap_alloc_zero
(
sizeof
(
*
script
))))
return
E_OUTOFMEMORY
;
list_add_tail
(
&
factory
->
scripts
,
&
script
->
entry
);
hres
=
parse_scriptlet_script
(
factory
,
script
);
if
(
FAILED
(
hres
))
return
hres
;
}
else
{
FIXME
(
"Unexpected element %s
\n
"
,
debugstr_xml_name
(
factory
));
...
...
@@ -554,6 +609,14 @@ static ULONG WINAPI scriptlet_factory_Release(IClassFactory *iface)
}
heap_free
(
member
);
}
while
(
!
list_empty
(
&
This
->
scripts
))
{
struct
scriptlet_script
*
script
=
LIST_ENTRY
(
list_head
(
&
This
->
scripts
),
struct
scriptlet_script
,
entry
);
list_remove
(
&
script
->
entry
);
heap_free
(
script
->
language
);
heap_free
(
script
->
body
);
heap_free
(
script
);
}
heap_free
(
This
->
classid_str
);
heap_free
(
This
->
description
);
heap_free
(
This
->
versioned_progid
);
...
...
@@ -603,6 +666,7 @@ static HRESULT create_scriptlet_factory(const WCHAR *url, struct scriptlet_facto
factory
->
IClassFactory_iface
.
lpVtbl
=
&
scriptlet_factory_vtbl
;
factory
->
ref
=
1
;
list_init
(
&
factory
->
members
);
list_init
(
&
factory
->
scripts
);
hres
=
parse_scriptlet_file
(
factory
,
url
);
if
(
FAILED
(
hres
))
...
...
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