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
ca736551
Commit
ca736551
authored
Aug 21, 2008
by
Roy Shea
Committed by
Alexandre Julliard
Aug 21, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mstask: Implemented (Set|Get)ApplicationName.
parent
67631163
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
77 additions
and
22 deletions
+77
-22
Makefile.in
dlls/mstask/Makefile.in
+1
-1
mstask_private.h
dlls/mstask/mstask_private.h
+1
-0
task.c
dlls/mstask/task.c
+58
-4
task.c
dlls/mstask/tests/task.c
+17
-17
No files found.
dlls/mstask/Makefile.in
View file @
ca736551
...
...
@@ -3,7 +3,7 @@ TOPOBJDIR = ../..
SRCDIR
=
@srcdir@
VPATH
=
@srcdir@
MODULE
=
mstask.dll
IMPORTS
=
uuid kernel32
IMPORTS
=
uuid
ole32
kernel32
C_SRCS
=
\
factory.c
\
...
...
dlls/mstask/mstask_private.h
View file @
ca736551
...
...
@@ -58,6 +58,7 @@ typedef struct
const
IPersistFileVtbl
*
persistVtbl
;
LONG
ref
;
LPWSTR
taskName
;
LPWSTR
applicationName
;
}
TaskImpl
;
extern
HRESULT
TaskConstructor
(
LPCWSTR
pwszTaskName
,
LPVOID
*
ppObj
);
...
...
dlls/mstask/task.c
View file @
ca736551
...
...
@@ -323,16 +323,69 @@ static HRESULT WINAPI MSTASK_ITask_SetApplicationName(
ITask
*
iface
,
LPCWSTR
pwszApplicationName
)
{
FIXME
(
"(%p, %s): stub
\n
"
,
iface
,
debugstr_w
(
pwszApplicationName
));
return
E_NOTIMPL
;
DWORD
n
;
TaskImpl
*
This
=
(
TaskImpl
*
)
iface
;
LPWSTR
tmp_name
;
TRACE
(
"(%p, %s)
\n
"
,
iface
,
debugstr_w
(
pwszApplicationName
));
/* Empty application name */
if
(
pwszApplicationName
[
0
]
==
0
)
{
HeapFree
(
GetProcessHeap
(),
0
,
This
->
applicationName
);
This
->
applicationName
=
NULL
;
return
S_OK
;
}
/* Attempt to set pwszApplicationName to a path resolved application name */
n
=
SearchPathW
(
NULL
,
pwszApplicationName
,
NULL
,
0
,
NULL
,
NULL
);
if
(
n
)
{
tmp_name
=
HeapAlloc
(
GetProcessHeap
(),
0
,
n
*
sizeof
(
WCHAR
));
if
(
!
tmp_name
)
return
E_OUTOFMEMORY
;
n
=
SearchPathW
(
NULL
,
pwszApplicationName
,
NULL
,
n
,
tmp_name
,
NULL
);
if
(
n
)
{
HeapFree
(
GetProcessHeap
(),
0
,
This
->
applicationName
);
This
->
applicationName
=
tmp_name
;
return
S_OK
;
}
else
HeapFree
(
GetProcessHeap
(),
0
,
tmp_name
);
}
/* If unable to path resolve name, simply set to pwszApplicationName */
n
=
(
lstrlenW
(
pwszApplicationName
)
+
1
);
tmp_name
=
HeapAlloc
(
GetProcessHeap
(),
0
,
n
*
sizeof
(
WCHAR
));
if
(
!
tmp_name
)
return
E_OUTOFMEMORY
;
lstrcpyW
(
tmp_name
,
pwszApplicationName
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
applicationName
);
This
->
applicationName
=
tmp_name
;
return
S_OK
;
}
static
HRESULT
WINAPI
MSTASK_ITask_GetApplicationName
(
ITask
*
iface
,
LPWSTR
*
ppwszApplicationName
)
{
FIXME
(
"(%p, %p): stub
\n
"
,
iface
,
ppwszApplicationName
);
return
E_NOTIMPL
;
DWORD
n
;
TaskImpl
*
This
=
(
TaskImpl
*
)
iface
;
TRACE
(
"(%p, %p)
\n
"
,
iface
,
ppwszApplicationName
);
n
=
This
->
applicationName
?
lstrlenW
(
This
->
applicationName
)
+
1
:
1
;
*
ppwszApplicationName
=
CoTaskMemAlloc
(
n
*
sizeof
(
WCHAR
));
if
(
!*
ppwszApplicationName
)
return
E_OUTOFMEMORY
;
if
(
!
This
->
applicationName
)
*
ppwszApplicationName
[
0
]
=
0
;
else
lstrcpyW
(
*
ppwszApplicationName
,
This
->
applicationName
);
return
S_OK
;
}
static
HRESULT
WINAPI
MSTASK_ITask_SetParameters
(
...
...
@@ -571,6 +624,7 @@ HRESULT TaskConstructor(LPCWSTR pwszTaskName, LPVOID *ppObj)
return
E_OUTOFMEMORY
;
}
lstrcpyW
(
This
->
taskName
,
pwszTaskName
);
This
->
applicationName
=
NULL
;
*
ppObj
=
&
This
->
lpVtbl
;
InterlockedIncrement
(
&
dll_ref
);
...
...
dlls/mstask/tests/task.c
View file @
ca736551
...
...
@@ -118,10 +118,10 @@ static void test_SetApplicationName_GetApplicationName(void)
/* Attempt getting before setting application name */
hres
=
ITask_GetApplicationName
(
test_task
,
&
stored_name
);
todo_wine
ok
(
hres
==
S_OK
,
"GetApplicationName failed: %08x
\n
"
,
hres
);
ok
(
hres
==
S_OK
,
"GetApplicationName failed: %08x
\n
"
,
hres
);
if
(
hres
==
S_OK
)
{
todo_wine
ok
(
!
lstrcmpW
(
stored_name
,
empty
),
ok
(
!
lstrcmpW
(
stored_name
,
empty
),
"Got %s, expected empty string
\n
"
,
dbgstr_w
(
stored_name
));
CoTaskMemFree
(
stored_name
);
}
...
...
@@ -129,14 +129,14 @@ static void test_SetApplicationName_GetApplicationName(void)
/* Set application name to a non-existent application and then get
* the application name that is actually stored */
hres
=
ITask_SetApplicationName
(
test_task
,
non_application_name
);
todo_wine
ok
(
hres
==
S_OK
,
"Failed setting name %s: %08x
\n
"
,
ok
(
hres
==
S_OK
,
"Failed setting name %s: %08x
\n
"
,
dbgstr_w
(
non_application_name
),
hres
);
hres
=
ITask_GetApplicationName
(
test_task
,
&
stored_name
);
todo_wine
ok
(
hres
==
S_OK
,
"GetApplicationName failed: %08x
\n
"
,
hres
);
ok
(
hres
==
S_OK
,
"GetApplicationName failed: %08x
\n
"
,
hres
);
if
(
hres
==
S_OK
)
{
full_name
=
path_resolve_name
(
non_application_name
);
todo_wine
ok
(
!
lstrcmpW
(
stored_name
,
full_name
),
"Got %s, expected %s
\n
"
,
ok
(
!
lstrcmpW
(
stored_name
,
full_name
),
"Got %s, expected %s
\n
"
,
dbgstr_w
(
stored_name
),
dbgstr_w
(
full_name
));
CoTaskMemFree
(
stored_name
);
}
...
...
@@ -144,14 +144,14 @@ static void test_SetApplicationName_GetApplicationName(void)
/* Set a valid application name with program type extension and then
* get the stored name */
hres
=
ITask_SetApplicationName
(
test_task
,
notepad_exe
);
todo_wine
ok
(
hres
==
S_OK
,
"Failed setting name %s: %08x
\n
"
,
ok
(
hres
==
S_OK
,
"Failed setting name %s: %08x
\n
"
,
dbgstr_w
(
notepad_exe
),
hres
);
hres
=
ITask_GetApplicationName
(
test_task
,
&
stored_name
);
todo_wine
ok
(
hres
==
S_OK
,
"GetApplicationName failed: %08x
\n
"
,
hres
);
ok
(
hres
==
S_OK
,
"GetApplicationName failed: %08x
\n
"
,
hres
);
if
(
hres
==
S_OK
)
{
full_name
=
path_resolve_name
(
notepad_exe
);
todo_wine
ok
(
!
lstrcmpW
(
stored_name
,
full_name
),
"Got %s, expected %s
\n
"
,
ok
(
!
lstrcmpW
(
stored_name
,
full_name
),
"Got %s, expected %s
\n
"
,
dbgstr_w
(
stored_name
),
dbgstr_w
(
full_name
));
CoTaskMemFree
(
stored_name
);
}
...
...
@@ -159,13 +159,13 @@ static void test_SetApplicationName_GetApplicationName(void)
/* Set a valid application name without program type extension and
* then get the stored name */
hres
=
ITask_SetApplicationName
(
test_task
,
notepad
);
todo_wine
ok
(
hres
==
S_OK
,
"Failed setting name %s: %08x
\n
"
,
dbgstr_w
(
notepad
),
hres
);
ok
(
hres
==
S_OK
,
"Failed setting name %s: %08x
\n
"
,
dbgstr_w
(
notepad
),
hres
);
hres
=
ITask_GetApplicationName
(
test_task
,
&
stored_name
);
todo_wine
ok
(
hres
==
S_OK
,
"GetApplicationName failed: %08x
\n
"
,
hres
);
ok
(
hres
==
S_OK
,
"GetApplicationName failed: %08x
\n
"
,
hres
);
if
(
hres
==
S_OK
)
{
full_name
=
path_resolve_name
(
notepad
);
todo_wine
ok
(
!
lstrcmpW
(
stored_name
,
full_name
),
"Got %s, expected %s
\n
"
,
ok
(
!
lstrcmpW
(
stored_name
,
full_name
),
"Got %s, expected %s
\n
"
,
dbgstr_w
(
stored_name
),
dbgstr_w
(
full_name
));
CoTaskMemFree
(
stored_name
);
}
...
...
@@ -174,26 +174,26 @@ static void test_SetApplicationName_GetApplicationName(void)
* to a non-existant application and then get the name that is
* actually stored */
hres
=
ITask_SetApplicationName
(
test_task
,
non_application_name
);
todo_wine
ok
(
hres
==
S_OK
,
"Failed setting name %s: %08x
\n
"
,
ok
(
hres
==
S_OK
,
"Failed setting name %s: %08x
\n
"
,
dbgstr_w
(
non_application_name
),
hres
);
hres
=
ITask_GetApplicationName
(
test_task
,
&
stored_name
);
todo_wine
ok
(
hres
==
S_OK
,
"GetApplicationName failed: %08x
\n
"
,
hres
);
ok
(
hres
==
S_OK
,
"GetApplicationName failed: %08x
\n
"
,
hres
);
if
(
hres
==
S_OK
)
{
full_name
=
path_resolve_name
(
non_application_name
);
todo_wine
ok
(
!
lstrcmpW
(
stored_name
,
full_name
),
"Got %s, expected %s
\n
"
,
ok
(
!
lstrcmpW
(
stored_name
,
full_name
),
"Got %s, expected %s
\n
"
,
dbgstr_w
(
stored_name
),
dbgstr_w
(
full_name
));
CoTaskMemFree
(
stored_name
);
}
/* Clear application name */
hres
=
ITask_SetApplicationName
(
test_task
,
empty
);
todo_wine
ok
(
hres
==
S_OK
,
"Failed setting name %s: %08x
\n
"
,
dbgstr_w
(
empty
),
hres
);
ok
(
hres
==
S_OK
,
"Failed setting name %s: %08x
\n
"
,
dbgstr_w
(
empty
),
hres
);
hres
=
ITask_GetApplicationName
(
test_task
,
&
stored_name
);
todo_wine
ok
(
hres
==
S_OK
,
"GetApplicationName failed: %08x
\n
"
,
hres
);
ok
(
hres
==
S_OK
,
"GetApplicationName failed: %08x
\n
"
,
hres
);
if
(
hres
==
S_OK
)
{
todo_wine
ok
(
!
lstrcmpW
(
stored_name
,
empty
),
ok
(
!
lstrcmpW
(
stored_name
,
empty
),
"Got %s, expected empty string
\n
"
,
dbgstr_w
(
stored_name
));
CoTaskMemFree
(
stored_name
);
}
...
...
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