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
37708b1e
Commit
37708b1e
authored
Aug 21, 2008
by
Roy Shea
Committed by
Alexandre Julliard
Aug 22, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mstask: Implemented (Set|Get)Comment.
parent
2f95e512
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
54 additions
and
15 deletions
+54
-15
mstask_private.h
dlls/mstask/mstask_private.h
+1
-0
task.c
dlls/mstask/task.c
+42
-4
task.c
dlls/mstask/tests/task.c
+11
-11
No files found.
dlls/mstask/mstask_private.h
View file @
37708b1e
...
@@ -60,6 +60,7 @@ typedef struct
...
@@ -60,6 +60,7 @@ typedef struct
LPWSTR
taskName
;
LPWSTR
taskName
;
LPWSTR
applicationName
;
LPWSTR
applicationName
;
LPWSTR
parameters
;
LPWSTR
parameters
;
LPWSTR
comment
;
}
TaskImpl
;
}
TaskImpl
;
extern
HRESULT
TaskConstructor
(
LPCWSTR
pwszTaskName
,
LPVOID
*
ppObj
);
extern
HRESULT
TaskConstructor
(
LPCWSTR
pwszTaskName
,
LPVOID
*
ppObj
);
...
...
dlls/mstask/task.c
View file @
37708b1e
...
@@ -29,6 +29,7 @@ static inline TaskImpl *impl_from_IPersistFile( IPersistFile *iface )
...
@@ -29,6 +29,7 @@ static inline TaskImpl *impl_from_IPersistFile( IPersistFile *iface )
static
void
TaskDestructor
(
TaskImpl
*
This
)
static
void
TaskDestructor
(
TaskImpl
*
This
)
{
{
TRACE
(
"%p
\n
"
,
This
);
TRACE
(
"%p
\n
"
,
This
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
comment
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
parameters
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
parameters
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
taskName
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
taskName
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
...
@@ -219,16 +220,52 @@ static HRESULT WINAPI MSTASK_ITask_SetComment(
...
@@ -219,16 +220,52 @@ static HRESULT WINAPI MSTASK_ITask_SetComment(
ITask
*
iface
,
ITask
*
iface
,
LPCWSTR
pwszComment
)
LPCWSTR
pwszComment
)
{
{
FIXME
(
"(%p, %s): stub
\n
"
,
iface
,
debugstr_w
(
pwszComment
));
DWORD
n
;
return
E_NOTIMPL
;
TaskImpl
*
This
=
(
TaskImpl
*
)
iface
;
LPWSTR
tmp_comment
;
TRACE
(
"(%p, %s)
\n
"
,
iface
,
debugstr_w
(
pwszComment
));
/* Empty comment */
if
(
pwszComment
[
0
]
==
0
)
{
HeapFree
(
GetProcessHeap
(),
0
,
This
->
comment
);
This
->
comment
=
NULL
;
return
S_OK
;
}
/* Set to pwszComment */
n
=
(
lstrlenW
(
pwszComment
)
+
1
);
tmp_comment
=
HeapAlloc
(
GetProcessHeap
(),
0
,
n
*
sizeof
(
WCHAR
));
if
(
!
tmp_comment
)
return
E_OUTOFMEMORY
;
lstrcpyW
(
tmp_comment
,
pwszComment
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
comment
);
This
->
comment
=
tmp_comment
;
return
S_OK
;
}
}
static
HRESULT
WINAPI
MSTASK_ITask_GetComment
(
static
HRESULT
WINAPI
MSTASK_ITask_GetComment
(
ITask
*
iface
,
ITask
*
iface
,
LPWSTR
*
ppwszComment
)
LPWSTR
*
ppwszComment
)
{
{
FIXME
(
"(%p, %p): stub
\n
"
,
iface
,
ppwszComment
);
DWORD
n
;
return
E_NOTIMPL
;
TaskImpl
*
This
=
(
TaskImpl
*
)
iface
;
TRACE
(
"(%p, %p)
\n
"
,
iface
,
ppwszComment
);
n
=
This
->
comment
?
lstrlenW
(
This
->
comment
)
+
1
:
1
;
*
ppwszComment
=
CoTaskMemAlloc
(
n
*
sizeof
(
WCHAR
));
if
(
!*
ppwszComment
)
return
E_OUTOFMEMORY
;
if
(
!
This
->
comment
)
*
ppwszComment
[
0
]
=
0
;
else
lstrcpyW
(
*
ppwszComment
,
This
->
comment
);
return
S_OK
;
}
}
static
HRESULT
WINAPI
MSTASK_ITask_SetCreator
(
static
HRESULT
WINAPI
MSTASK_ITask_SetCreator
(
...
@@ -682,6 +719,7 @@ HRESULT TaskConstructor(LPCWSTR pwszTaskName, LPVOID *ppObj)
...
@@ -682,6 +719,7 @@ HRESULT TaskConstructor(LPCWSTR pwszTaskName, LPVOID *ppObj)
lstrcpyW
(
This
->
taskName
,
pwszTaskName
);
lstrcpyW
(
This
->
taskName
,
pwszTaskName
);
This
->
applicationName
=
NULL
;
This
->
applicationName
=
NULL
;
This
->
parameters
=
NULL
;
This
->
parameters
=
NULL
;
This
->
comment
=
NULL
;
*
ppObj
=
&
This
->
lpVtbl
;
*
ppObj
=
&
This
->
lpVtbl
;
InterlockedIncrement
(
&
dll_ref
);
InterlockedIncrement
(
&
dll_ref
);
...
...
dlls/mstask/tests/task.c
View file @
37708b1e
...
@@ -319,49 +319,49 @@ static void test_SetComment_GetComment(void)
...
@@ -319,49 +319,49 @@ static void test_SetComment_GetComment(void)
/* Get comment before setting it*/
/* Get comment before setting it*/
hres
=
ITask_GetComment
(
test_task
,
&
comment
);
hres
=
ITask_GetComment
(
test_task
,
&
comment
);
todo_wine
ok
(
hres
==
S_OK
,
"GetComment failed: %08x
\n
"
,
hres
);
ok
(
hres
==
S_OK
,
"GetComment failed: %08x
\n
"
,
hres
);
if
(
hres
==
S_OK
)
if
(
hres
==
S_OK
)
{
{
todo_wine
ok
(
!
lstrcmpW
(
comment
,
empty
),
ok
(
!
lstrcmpW
(
comment
,
empty
),
"Got %s, expected empty string
\n
"
,
dbgstr_w
(
comment
));
"Got %s, expected empty string
\n
"
,
dbgstr_w
(
comment
));
CoTaskMemFree
(
comment
);
CoTaskMemFree
(
comment
);
}
}
/* Set comment to a simple string */
/* Set comment to a simple string */
hres
=
ITask_SetComment
(
test_task
,
comment_a
);
hres
=
ITask_SetComment
(
test_task
,
comment_a
);
todo_wine
ok
(
hres
==
S_OK
,
"Failed setting comment %s: %08x
\n
"
,
ok
(
hres
==
S_OK
,
"Failed setting comment %s: %08x
\n
"
,
dbgstr_w
(
comment_a
),
hres
);
dbgstr_w
(
comment_a
),
hres
);
hres
=
ITask_GetComment
(
test_task
,
&
comment
);
hres
=
ITask_GetComment
(
test_task
,
&
comment
);
todo_wine
ok
(
hres
==
S_OK
,
"GetComment failed: %08x
\n
"
,
hres
);
ok
(
hres
==
S_OK
,
"GetComment failed: %08x
\n
"
,
hres
);
if
(
hres
==
S_OK
)
if
(
hres
==
S_OK
)
{
{
todo_wine
ok
(
!
lstrcmpW
(
comment
,
comment_a
),
"Got %s, expected %s
\n
"
,
ok
(
!
lstrcmpW
(
comment
,
comment_a
),
"Got %s, expected %s
\n
"
,
dbgstr_w
(
comment
),
dbgstr_w
(
comment_a
));
dbgstr_w
(
comment
),
dbgstr_w
(
comment_a
));
CoTaskMemFree
(
comment
);
CoTaskMemFree
(
comment
);
}
}
/* Update comment to a different simple string */
/* Update comment to a different simple string */
hres
=
ITask_SetComment
(
test_task
,
comment_b
);
hres
=
ITask_SetComment
(
test_task
,
comment_b
);
todo_wine
ok
(
hres
==
S_OK
,
"Failed setting comment %s: %08x
\n
"
,
ok
(
hres
==
S_OK
,
"Failed setting comment %s: %08x
\n
"
,
dbgstr_w
(
comment_b
),
hres
);
dbgstr_w
(
comment_b
),
hres
);
hres
=
ITask_GetComment
(
test_task
,
&
comment
);
hres
=
ITask_GetComment
(
test_task
,
&
comment
);
todo_wine
ok
(
hres
==
S_OK
,
"GetComment failed: %08x
\n
"
,
hres
);
ok
(
hres
==
S_OK
,
"GetComment failed: %08x
\n
"
,
hres
);
if
(
hres
==
S_OK
)
if
(
hres
==
S_OK
)
{
{
todo_wine
ok
(
!
lstrcmpW
(
comment
,
comment_b
),
"Got %s, expected %s
\n
"
,
ok
(
!
lstrcmpW
(
comment
,
comment_b
),
"Got %s, expected %s
\n
"
,
dbgstr_w
(
comment
),
dbgstr_w
(
comment_b
));
dbgstr_w
(
comment
),
dbgstr_w
(
comment_b
));
CoTaskMemFree
(
comment
);
CoTaskMemFree
(
comment
);
}
}
/* Clear comment */
/* Clear comment */
hres
=
ITask_SetComment
(
test_task
,
empty
);
hres
=
ITask_SetComment
(
test_task
,
empty
);
todo_wine
ok
(
hres
==
S_OK
,
"Failed setting comment %s: %08x
\n
"
,
ok
(
hres
==
S_OK
,
"Failed setting comment %s: %08x
\n
"
,
dbgstr_w
(
empty
),
hres
);
dbgstr_w
(
empty
),
hres
);
hres
=
ITask_GetComment
(
test_task
,
&
comment
);
hres
=
ITask_GetComment
(
test_task
,
&
comment
);
todo_wine
ok
(
hres
==
S_OK
,
"GetComment failed: %08x
\n
"
,
hres
);
ok
(
hres
==
S_OK
,
"GetComment failed: %08x
\n
"
,
hres
);
if
(
hres
==
S_OK
)
if
(
hres
==
S_OK
)
{
{
todo_wine
ok
(
!
lstrcmpW
(
comment
,
empty
),
ok
(
!
lstrcmpW
(
comment
,
empty
),
"Got %s, expected empty string
\n
"
,
dbgstr_w
(
comment
));
"Got %s, expected empty string
\n
"
,
dbgstr_w
(
comment
));
CoTaskMemFree
(
comment
);
CoTaskMemFree
(
comment
);
}
}
...
...
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