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
8d739937
Commit
8d739937
authored
Nov 30, 2017
by
Hans Leidekker
Committed by
Alexandre Julliard
Nov 30, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
taskschd: Implement IActionCollection_Create.
Signed-off-by:
Hans Leidekker
<
hans@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
759ef6a4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
192 additions
and
9 deletions
+192
-9
task.c
dlls/taskschd/task.c
+186
-2
scheduler.c
dlls/taskschd/tests/scheduler.c
+6
-7
No files found.
dlls/taskschd/task.c
View file @
8d739937
...
@@ -1636,6 +1636,181 @@ static HRESULT Principal_create(IPrincipal **obj)
...
@@ -1636,6 +1636,181 @@ static HRESULT Principal_create(IPrincipal **obj)
typedef
struct
typedef
struct
{
{
IExecAction
IExecAction_iface
;
LONG
ref
;
}
ExecAction
;
static
inline
ExecAction
*
impl_from_IExecAction
(
IExecAction
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
ExecAction
,
IExecAction_iface
);
}
static
ULONG
WINAPI
ExecAction_AddRef
(
IExecAction
*
iface
)
{
ExecAction
*
action
=
impl_from_IExecAction
(
iface
);
return
InterlockedIncrement
(
&
action
->
ref
);
}
static
ULONG
WINAPI
ExecAction_Release
(
IExecAction
*
iface
)
{
ExecAction
*
action
=
impl_from_IExecAction
(
iface
);
LONG
ref
=
InterlockedDecrement
(
&
action
->
ref
);
if
(
!
ref
)
{
TRACE
(
"destroying %p
\n
"
,
iface
);
heap_free
(
action
);
}
return
ref
;
}
static
HRESULT
WINAPI
ExecAction_QueryInterface
(
IExecAction
*
iface
,
REFIID
riid
,
void
**
obj
)
{
if
(
!
riid
||
!
obj
)
return
E_INVALIDARG
;
TRACE
(
"%p,%s,%p
\n
"
,
iface
,
debugstr_guid
(
riid
),
obj
);
if
(
IsEqualGUID
(
riid
,
&
IID_IExecAction
)
||
IsEqualGUID
(
riid
,
&
IID_IAction
)
||
IsEqualGUID
(
riid
,
&
IID_IDispatch
)
||
IsEqualGUID
(
riid
,
&
IID_IUnknown
))
{
IExecAction_AddRef
(
iface
);
*
obj
=
iface
;
return
S_OK
;
}
FIXME
(
"interface %s is not implemented
\n
"
,
debugstr_guid
(
riid
));
*
obj
=
NULL
;
return
E_NOINTERFACE
;
}
static
HRESULT
WINAPI
ExecAction_GetTypeInfoCount
(
IExecAction
*
iface
,
UINT
*
count
)
{
FIXME
(
"%p,%p: stub
\n
"
,
iface
,
count
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
ExecAction_GetTypeInfo
(
IExecAction
*
iface
,
UINT
index
,
LCID
lcid
,
ITypeInfo
**
info
)
{
FIXME
(
"%p,%u,%u,%p: stub
\n
"
,
iface
,
index
,
lcid
,
info
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
ExecAction_GetIDsOfNames
(
IExecAction
*
iface
,
REFIID
riid
,
LPOLESTR
*
names
,
UINT
count
,
LCID
lcid
,
DISPID
*
dispid
)
{
FIXME
(
"%p,%s,%p,%u,%u,%p: stub
\n
"
,
iface
,
debugstr_guid
(
riid
),
names
,
count
,
lcid
,
dispid
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
ExecAction_Invoke
(
IExecAction
*
iface
,
DISPID
dispid
,
REFIID
riid
,
LCID
lcid
,
WORD
flags
,
DISPPARAMS
*
params
,
VARIANT
*
result
,
EXCEPINFO
*
excepinfo
,
UINT
*
argerr
)
{
FIXME
(
"%p,%d,%s,%04x,%04x,%p,%p,%p,%p: stub
\n
"
,
iface
,
dispid
,
debugstr_guid
(
riid
),
lcid
,
flags
,
params
,
result
,
excepinfo
,
argerr
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
ExecAction_get_Id
(
IExecAction
*
iface
,
BSTR
*
id
)
{
FIXME
(
"%p,%p: stub
\n
"
,
iface
,
id
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
ExecAction_put_Id
(
IExecAction
*
iface
,
BSTR
id
)
{
FIXME
(
"%p,%s: stub
\n
"
,
iface
,
debugstr_w
(
id
));
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
ExecAction_get_Type
(
IExecAction
*
iface
,
TASK_ACTION_TYPE
*
type
)
{
TRACE
(
"%p,%p
\n
"
,
iface
,
type
);
if
(
!
type
)
return
E_POINTER
;
*
type
=
TASK_ACTION_EXEC
;
return
S_OK
;
}
static
HRESULT
WINAPI
ExecAction_get_Path
(
IExecAction
*
iface
,
BSTR
*
path
)
{
FIXME
(
"%p,%p: stub
\n
"
,
iface
,
path
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
ExecAction_put_Path
(
IExecAction
*
iface
,
BSTR
path
)
{
FIXME
(
"%p,%s: stub
\n
"
,
iface
,
debugstr_w
(
path
));
return
S_OK
;
}
static
HRESULT
WINAPI
ExecAction_get_Arguments
(
IExecAction
*
iface
,
BSTR
*
arguments
)
{
FIXME
(
"%p,%p: stub
\n
"
,
iface
,
arguments
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
ExecAction_put_Arguments
(
IExecAction
*
iface
,
BSTR
arguments
)
{
FIXME
(
"%p,%s: stub
\n
"
,
iface
,
debugstr_w
(
arguments
));
return
S_OK
;
}
static
HRESULT
WINAPI
ExecAction_get_WorkingDirectory
(
IExecAction
*
iface
,
BSTR
*
directory
)
{
FIXME
(
"%p,%p: stub
\n
"
,
iface
,
directory
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
ExecAction_put_WorkingDirectory
(
IExecAction
*
iface
,
BSTR
directory
)
{
FIXME
(
"%p,%s: stub
\n
"
,
iface
,
debugstr_w
(
directory
));
return
E_NOTIMPL
;
}
static
const
IExecActionVtbl
Action_vtbl
=
{
ExecAction_QueryInterface
,
ExecAction_AddRef
,
ExecAction_Release
,
ExecAction_GetTypeInfoCount
,
ExecAction_GetTypeInfo
,
ExecAction_GetIDsOfNames
,
ExecAction_Invoke
,
ExecAction_get_Id
,
ExecAction_put_Id
,
ExecAction_get_Type
,
ExecAction_get_Path
,
ExecAction_put_Path
,
ExecAction_get_Arguments
,
ExecAction_put_Arguments
,
ExecAction_get_WorkingDirectory
,
ExecAction_put_WorkingDirectory
};
static
HRESULT
ExecAction_create
(
IExecAction
**
obj
)
{
ExecAction
*
action
;
action
=
heap_alloc
(
sizeof
(
*
action
));
if
(
!
action
)
return
E_OUTOFMEMORY
;
action
->
IExecAction_iface
.
lpVtbl
=
&
Action_vtbl
;
action
->
ref
=
1
;
*
obj
=
&
action
->
IExecAction_iface
;
TRACE
(
"created %p
\n
"
,
*
obj
);
return
S_OK
;
}
typedef
struct
{
IActionCollection
IActionCollection_iface
;
IActionCollection
IActionCollection_iface
;
LONG
ref
;
LONG
ref
;
}
Actions
;
}
Actions
;
...
@@ -1744,8 +1919,17 @@ static HRESULT WINAPI Actions_put_XmlText(IActionCollection *iface, BSTR xml)
...
@@ -1744,8 +1919,17 @@ static HRESULT WINAPI Actions_put_XmlText(IActionCollection *iface, BSTR xml)
static
HRESULT
WINAPI
Actions_Create
(
IActionCollection
*
iface
,
TASK_ACTION_TYPE
type
,
IAction
**
action
)
static
HRESULT
WINAPI
Actions_Create
(
IActionCollection
*
iface
,
TASK_ACTION_TYPE
type
,
IAction
**
action
)
{
{
FIXME
(
"%p,%u,%p: stub
\n
"
,
iface
,
type
,
action
);
TRACE
(
"%p,%u,%p
\n
"
,
iface
,
type
,
action
);
return
E_NOTIMPL
;
switch
(
type
)
{
case
TASK_ACTION_EXEC
:
return
ExecAction_create
((
IExecAction
**
)
action
);
default:
FIXME
(
"unimplemented type %u
\n
"
,
type
);
return
E_NOTIMPL
;
}
}
}
static
HRESULT
WINAPI
Actions_Remove
(
IActionCollection
*
iface
,
VARIANT
index
)
static
HRESULT
WINAPI
Actions_Remove
(
IActionCollection
*
iface
,
VARIANT
index
)
...
...
dlls/taskschd/tests/scheduler.c
View file @
8d739937
...
@@ -1235,23 +1235,22 @@ static void create_action(ITaskDefinition *taskdef)
...
@@ -1235,23 +1235,22 @@ static void create_action(ITaskDefinition *taskdef)
IActionCollection
*
actions
;
IActionCollection
*
actions
;
IAction
*
action
;
IAction
*
action
;
IExecAction
*
exec_action
;
IExecAction
*
exec_action
;
TASK_ACTION_TYPE
type
;
hr
=
ITaskDefinition_get_Actions
(
taskdef
,
&
actions
);
hr
=
ITaskDefinition_get_Actions
(
taskdef
,
&
actions
);
ok
(
hr
==
S_OK
,
"get_Actions error %#x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"get_Actions error %#x
\n
"
,
hr
);
hr
=
IActionCollection_Create
(
actions
,
TASK_ACTION_EXEC
,
&
action
);
hr
=
IActionCollection_Create
(
actions
,
TASK_ACTION_EXEC
,
&
action
);
todo_wine
ok
(
hr
==
S_OK
,
"Create action error %#x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Create action error %#x
\n
"
,
hr
);
/* FIXME: Remove once implemented */
if
(
hr
!=
S_OK
)
{
IActionCollection_Release
(
actions
);
return
;
}
hr
=
IAction_QueryInterface
(
action
,
&
IID_IExecAction
,
(
void
**
)
&
exec_action
);
hr
=
IAction_QueryInterface
(
action
,
&
IID_IExecAction
,
(
void
**
)
&
exec_action
);
ok
(
hr
==
S_OK
,
"QueryInterface error %#x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"QueryInterface error %#x
\n
"
,
hr
);
type
=
0xdeadbeef
;
hr
=
IExecAction_get_Type
(
exec_action
,
&
type
);
ok
(
hr
==
S_OK
,
"get_Type error %#x
\n
"
,
hr
);
ok
(
type
==
TASK_ACTION_EXEC
,
"got %u
\n
"
,
type
);
hr
=
IExecAction_put_Path
(
exec_action
,
task1_exe
);
hr
=
IExecAction_put_Path
(
exec_action
,
task1_exe
);
ok
(
hr
==
S_OK
,
"put_Path error %#x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"put_Path error %#x
\n
"
,
hr
);
...
...
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