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
cad2e5e8
Commit
cad2e5e8
authored
Mar 30, 2018
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Mar 30, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mstask: Implement setting and getting parameters using IExecAction.
Signed-off-by:
Dmitry Timoshkov
<
dmitry@baikal.ru
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
b9ebac70
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
37 deletions
+25
-37
task.c
dlls/mstask/task.c
+25
-37
No files found.
dlls/mstask/task.c
View file @
cad2e5e8
...
...
@@ -39,7 +39,6 @@ typedef struct
ITaskDefinition
*
task
;
IExecAction
*
action
;
LPWSTR
task_name
;
LPWSTR
parameters
;
LPWSTR
comment
;
DWORD
maxRunTime
;
LPWSTR
accountName
;
...
...
@@ -64,7 +63,6 @@ static void TaskDestructor(TaskImpl *This)
HeapFree
(
GetProcessHeap
(),
0
,
This
->
task_name
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
accountName
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
comment
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
parameters
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
InterlockedDecrement
(
&
dll_ref
);
}
...
...
@@ -493,55 +491,46 @@ static HRESULT WINAPI MSTASK_ITask_GetApplicationName(ITask *iface, LPWSTR *appn
return
hr
;
}
static
HRESULT
WINAPI
MSTASK_ITask_SetParameters
(
ITask
*
iface
,
LPCWSTR
pwszParameters
)
static
HRESULT
WINAPI
MSTASK_ITask_SetParameters
(
ITask
*
iface
,
LPCWSTR
params
)
{
DWORD
n
;
TaskImpl
*
This
=
impl_from_ITask
(
iface
);
LPWSTR
tmp_parameters
;
TRACE
(
"(%p, %s)
\n
"
,
iface
,
debugstr_w
(
p
wszParameter
s
));
TRACE
(
"(%p, %s)
\n
"
,
iface
,
debugstr_w
(
p
aram
s
));
/* Empty parameter list */
if
(
pwszParameters
[
0
]
==
0
)
{
HeapFree
(
GetProcessHeap
(),
0
,
This
->
parameters
);
This
->
parameters
=
NULL
;
return
S_OK
;
}
if
(
!
params
||
!
params
[
0
])
params
=
NULL
;
/* Set to pwszParameters */
n
=
(
lstrlenW
(
pwszParameters
)
+
1
);
tmp_parameters
=
HeapAlloc
(
GetProcessHeap
(),
0
,
n
*
sizeof
(
WCHAR
));
if
(
!
tmp_parameters
)
return
E_OUTOFMEMORY
;
lstrcpyW
(
tmp_parameters
,
pwszParameters
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
parameters
);
This
->
parameters
=
tmp_parameters
;
return
S_OK
;
return
IExecAction_put_Arguments
(
This
->
action
,
(
BSTR
)
params
);
}
static
HRESULT
WINAPI
MSTASK_ITask_GetParameters
(
ITask
*
iface
,
LPWSTR
*
ppwszParameters
)
static
HRESULT
WINAPI
MSTASK_ITask_GetParameters
(
ITask
*
iface
,
LPWSTR
*
params
)
{
DWORD
n
;
TaskImpl
*
This
=
impl_from_ITask
(
iface
);
HRESULT
hr
;
BSTR
args
;
DWORD
len
;
TRACE
(
"(%p, %p)
\n
"
,
iface
,
p
pwszParameter
s
);
TRACE
(
"(%p, %p)
\n
"
,
iface
,
p
aram
s
);
n
=
This
->
parameters
?
lstrlenW
(
This
->
parameters
)
+
1
:
1
;
*
ppwszParameters
=
CoTaskMemAlloc
(
n
*
sizeof
(
WCHAR
));
if
(
!*
ppwszParameters
)
return
E_OUTOFMEMORY
;
hr
=
IExecAction_get_Arguments
(
This
->
action
,
&
args
);
if
(
hr
!=
S_OK
)
return
hr
;
if
(
!
This
->
parameters
)
*
ppwszParameters
[
0
]
=
0
;
len
=
args
?
lstrlenW
(
args
)
+
1
:
1
;
*
params
=
CoTaskMemAlloc
(
len
*
sizeof
(
WCHAR
));
if
(
*
params
)
{
if
(
!
args
)
*
params
[
0
]
=
0
;
else
lstrcpyW
(
*
params
,
args
);
hr
=
S_OK
;
}
else
lstrcpyW
(
*
ppwszParameters
,
This
->
parameters
)
;
hr
=
E_OUTOFMEMORY
;
return
S_OK
;
SysFreeString
(
args
);
return
hr
;
}
static
HRESULT
WINAPI
MSTASK_ITask_SetWorkingDirectory
(
...
...
@@ -784,7 +773,6 @@ HRESULT TaskConstructor(ITaskService *service, const WCHAR *task_name, ITask **t
This
->
ref
=
1
;
This
->
task
=
taskdef
;
This
->
task_name
=
heap_strdupW
(
task_name
);
This
->
parameters
=
NULL
;
This
->
comment
=
NULL
;
This
->
accountName
=
NULL
;
...
...
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