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
f2080252
Commit
f2080252
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 partial stub for (Set|Get)AccountInformation.
parent
a597d9ea
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
17 deletions
+51
-17
mstask_private.h
dlls/mstask/mstask_private.h
+1
-0
task.c
dlls/mstask/task.c
+35
-4
task.c
dlls/mstask/tests/task.c
+15
-13
No files found.
dlls/mstask/mstask_private.h
View file @
f2080252
...
...
@@ -62,6 +62,7 @@ typedef struct
LPWSTR
parameters
;
LPWSTR
comment
;
DWORD
maxRunTime
;
LPWSTR
accountName
;
}
TaskImpl
;
extern
HRESULT
TaskConstructor
(
LPCWSTR
pwszTaskName
,
LPVOID
*
ppObj
);
...
...
dlls/mstask/task.c
View file @
f2080252
...
...
@@ -29,6 +29,7 @@ static inline TaskImpl *impl_from_IPersistFile( IPersistFile *iface )
static
void
TaskDestructor
(
TaskImpl
*
This
)
{
TRACE
(
"%p
\n
"
,
This
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
accountName
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
comment
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
parameters
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
taskName
);
...
...
@@ -355,17 +356,46 @@ static HRESULT WINAPI MSTASK_ITask_SetAccountInformation(
LPCWSTR
pwszAccountName
,
LPCWSTR
pwszPassword
)
{
FIXME
(
"(%p, %s, %s): stub
\n
"
,
iface
,
debugstr_w
(
pwszAccountName
),
DWORD
n
;
TaskImpl
*
This
=
(
TaskImpl
*
)
iface
;
LPWSTR
tmp_account_name
;
TRACE
(
"(%p, %s, %s): partial stub
\n
"
,
iface
,
debugstr_w
(
pwszAccountName
),
debugstr_w
(
pwszPassword
));
return
E_NOTIMPL
;
if
(
pwszPassword
)
FIXME
(
"Partial stub ignores passwords
\n
"
);
n
=
(
lstrlenW
(
pwszAccountName
)
+
1
);
tmp_account_name
=
HeapAlloc
(
GetProcessHeap
(),
0
,
n
*
sizeof
(
WCHAR
));
if
(
!
tmp_account_name
)
return
E_OUTOFMEMORY
;
lstrcpyW
(
tmp_account_name
,
pwszAccountName
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
accountName
);
This
->
accountName
=
tmp_account_name
;
return
S_OK
;
}
static
HRESULT
WINAPI
MSTASK_ITask_GetAccountInformation
(
ITask
*
iface
,
LPWSTR
*
ppwszAccountName
)
{
FIXME
(
"(%p, %p): stub
\n
"
,
iface
,
ppwszAccountName
);
return
E_NOTIMPL
;
DWORD
n
;
TaskImpl
*
This
=
(
TaskImpl
*
)
iface
;
TRACE
(
"(%p, %p): partial stub
\n
"
,
iface
,
ppwszAccountName
);
/* This implements the WinXP behavior when accountName has not yet
* set. Win2K behaves differently, returning SCHED_E_CANNOT_OPEN_TASK */
if
(
!
This
->
accountName
)
return
HRESULT_FROM_WIN32
(
ERROR_FILE_NOT_FOUND
);
n
=
(
lstrlenW
(
This
->
accountName
)
+
1
);
*
ppwszAccountName
=
CoTaskMemAlloc
(
n
*
sizeof
(
WCHAR
));
if
(
!*
ppwszAccountName
)
return
E_OUTOFMEMORY
;
lstrcpyW
(
*
ppwszAccountName
,
This
->
accountName
);
return
S_OK
;
}
static
HRESULT
WINAPI
MSTASK_ITask_SetApplicationName
(
...
...
@@ -728,6 +758,7 @@ HRESULT TaskConstructor(LPCWSTR pwszTaskName, LPVOID *ppObj)
This
->
applicationName
=
NULL
;
This
->
parameters
=
NULL
;
This
->
comment
=
NULL
;
This
->
accountName
=
NULL
;
/* Default time is 3 days = 259200000 ms */
This
->
maxRunTime
=
259200000
;
...
...
dlls/mstask/tests/task.c
View file @
f2080252
...
...
@@ -434,6 +434,8 @@ static void test_SetAccountInformation_GetAccountInformation(void)
LPWSTR
account_name
;
const
WCHAR
dummy_account_name
[]
=
{
'N'
,
'o'
,
'S'
,
'u'
,
'c'
,
'h'
,
'A'
,
'c'
,
'c'
,
'o'
,
'u'
,
'n'
,
't'
,
0
};
const
WCHAR
dummy_account_name_b
[]
=
{
'N'
,
'o'
,
'S'
,
'u'
,
'c'
,
'h'
,
'A'
,
'c'
,
'c'
,
'o'
,
'u'
,
'n'
,
't'
,
'B'
,
0
};
setup
=
setup_task
();
ok
(
setup
,
"Failed to setup test_task
\n
"
);
...
...
@@ -447,20 +449,20 @@ static void test_SetAccountInformation_GetAccountInformation(void)
hres
=
ITask_GetAccountInformation
(
test_task
,
&
account_name
);
/* WinXP returns HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND): 0x80070002 but
* Win2K returns SCHED_E_CANNOT_OPEN_TASK: 0x8004130d */
todo_wine
ok
(
hres
==
HRESULT_FROM_WIN32
(
ERROR_FILE_NOT_FOUND
)
||
ok
(
hres
==
HRESULT_FROM_WIN32
(
ERROR_FILE_NOT_FOUND
)
||
hres
==
SCHED_E_CANNOT_OPEN_TASK
,
"Unset account name generated: 0x%08x
\n
"
,
hres
);
/* Attempt to set to a dummy account without a password */
/* This test passes on WinXP but fails on Win2K */
hres
=
ITask_SetAccountInformation
(
test_task
,
dummy_account_name
,
NULL
);
todo_wine
ok
(
hres
==
S_OK
,
ok
(
hres
==
S_OK
,
"Failed setting dummy account with no password: %08x
\n
"
,
hres
);
hres
=
ITask_GetAccountInformation
(
test_task
,
&
account_name
);
todo_wine
ok
(
hres
==
S_OK
,
"GetAccountInformation failed: %08x
\n
"
,
hres
);
ok
(
hres
==
S_OK
,
"GetAccountInformation failed: %08x
\n
"
,
hres
);
if
(
hres
==
S_OK
)
{
todo_wine
ok
(
!
lstrcmpW
(
account_name
,
dummy_account_name
),
ok
(
!
lstrcmpW
(
account_name
,
dummy_account_name
),
"Got %s, expected %s
\n
"
,
dbgstr_w
(
account_name
),
dbgstr_w
(
dummy_account_name
));
CoTaskMemFree
(
account_name
);
...
...
@@ -468,28 +470,28 @@ static void test_SetAccountInformation_GetAccountInformation(void)
/* Attempt to set to a dummy account with a (invalid) password */
/* This test passes on WinXP but fails on Win2K */
hres
=
ITask_SetAccountInformation
(
test_task
,
dummy_account_name
,
dummy_account_name
);
todo_wine
ok
(
hres
==
S_OK
,
hres
=
ITask_SetAccountInformation
(
test_task
,
dummy_account_name
_b
,
dummy_account_name
_b
);
ok
(
hres
==
S_OK
,
"Failed setting dummy account with password: %08x
\n
"
,
hres
);
hres
=
ITask_GetAccountInformation
(
test_task
,
&
account_name
);
todo_wine
ok
(
hres
==
S_OK
,
"GetAccountInformation failed: %08x
\n
"
,
hres
);
ok
(
hres
==
S_OK
,
"GetAccountInformation failed: %08x
\n
"
,
hres
);
if
(
hres
==
S_OK
)
{
todo_wine
ok
(
!
lstrcmpW
(
account_name
,
dummy_account_name
),
ok
(
!
lstrcmpW
(
account_name
,
dummy_account_name_b
),
"Got %s, expected %s
\n
"
,
dbgstr_w
(
account_name
),
dbgstr_w
(
dummy_account_name
));
dbgstr_w
(
dummy_account_name
_b
));
CoTaskMemFree
(
account_name
);
}
/* Attempt to set to the local system account */
hres
=
ITask_SetAccountInformation
(
test_task
,
empty
,
NULL
);
todo_wine
ok
(
hres
==
S_OK
,
"Failed setting system account: %08x
\n
"
,
hres
);
ok
(
hres
==
S_OK
,
"Failed setting system account: %08x
\n
"
,
hres
);
hres
=
ITask_GetAccountInformation
(
test_task
,
&
account_name
);
todo_wine
ok
(
hres
==
S_OK
,
"GetAccountInformation failed: %08x
\n
"
,
hres
);
ok
(
hres
==
S_OK
,
"GetAccountInformation failed: %08x
\n
"
,
hres
);
if
(
hres
==
S_OK
)
{
todo_wine
ok
(
!
lstrcmpW
(
account_name
,
empty
),
ok
(
!
lstrcmpW
(
account_name
,
empty
),
"Got %s, expected empty string
\n
"
,
dbgstr_w
(
account_name
));
CoTaskMemFree
(
account_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