Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
938f073e
Commit
938f073e
authored
Jan 14, 2014
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Jan 14, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
taskschd: Implement ITaskService::Connect.
parent
189bfa96
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
7 deletions
+46
-7
task.c
dlls/taskschd/task.c
+46
-2
scheduler.c
dlls/taskschd/tests/scheduler.c
+0
-5
No files found.
dlls/taskschd/task.c
View file @
938f073e
...
...
@@ -27,6 +27,7 @@
#include "taskschd.h"
#include "taskschd_private.h"
#include "wine/unicode.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
taskschd
);
...
...
@@ -36,6 +37,7 @@ typedef struct
ITaskService
ITaskService_iface
;
LONG
ref
;
BOOL
connected
;
WCHAR
comp_name
[
MAX_COMPUTERNAME_LENGTH
+
1
];
}
TaskService
;
static
inline
TaskService
*
impl_from_ITaskService
(
ITaskService
*
iface
)
...
...
@@ -127,11 +129,53 @@ static HRESULT WINAPI TaskService_NewTask(ITaskService *iface, DWORD flags, ITas
return
E_NOTIMPL
;
}
static
inline
BOOL
is_variant_null
(
const
VARIANT
*
var
)
{
return
V_VT
(
var
)
==
VT_EMPTY
||
V_VT
(
var
)
==
VT_NULL
;
}
static
HRESULT
WINAPI
TaskService_Connect
(
ITaskService
*
iface
,
VARIANT
server
,
VARIANT
user
,
VARIANT
domain
,
VARIANT
password
)
{
FIXME
(
"%p,%s,%s,%s,%s: stub
\n
"
,
iface
,
debugstr_variant
(
&
server
),
debugstr_variant
(
&
user
),
TaskService
*
task_svc
=
impl_from_ITaskService
(
iface
);
WCHAR
comp_name
[
MAX_COMPUTERNAME_LENGTH
+
1
];
DWORD
len
;
TRACE
(
"%p,%s,%s,%s,%s
\n
"
,
iface
,
debugstr_variant
(
&
server
),
debugstr_variant
(
&
user
),
debugstr_variant
(
&
domain
),
debugstr_variant
(
&
password
));
return
E_NOTIMPL
;
if
(
!
is_variant_null
(
&
user
)
||
!
is_variant_null
(
&
domain
)
||
!
is_variant_null
(
&
password
))
FIXME
(
"user/domain/password are ignored
\n
"
);
len
=
sizeof
(
comp_name
)
/
sizeof
(
comp_name
[
0
]);
if
(
!
GetComputerNameW
(
comp_name
,
&
len
))
return
HRESULT_FROM_WIN32
(
GetLastError
());
if
(
!
is_variant_null
(
&
server
))
{
const
WCHAR
*
server_name
;
if
(
V_VT
(
&
server
)
!=
VT_BSTR
)
{
FIXME
(
"server variant type %d is not supported
\n
"
,
V_VT
(
&
server
));
return
HRESULT_FROM_WIN32
(
ERROR_BAD_NETPATH
);
}
/* skip UNC prefix if any */
server_name
=
V_BSTR
(
&
server
);
if
(
server_name
[
0
]
==
'\\'
&&
server_name
[
1
]
==
'\\'
)
server_name
+=
2
;
if
(
strcmpiW
(
server_name
,
comp_name
))
{
FIXME
(
"connection to remote server %s is not supported
\n
"
,
debugstr_w
(
V_BSTR
(
&
server
)));
return
HRESULT_FROM_WIN32
(
ERROR_BAD_NETPATH
);
}
}
strcpyW
(
task_svc
->
comp_name
,
comp_name
);
task_svc
->
connected
=
TRUE
;
return
S_OK
;
}
static
HRESULT
WINAPI
TaskService_get_Connected
(
ITaskService
*
iface
,
VARIANT_BOOL
*
connected
)
...
...
dlls/taskschd/tests/scheduler.c
View file @
938f073e
...
...
@@ -67,30 +67,25 @@ todo_wine
V_BSTR
(
&
v_comp
)
=
SysAllocString
(
comp_name
);
hr
=
ITaskService_Connect
(
service
,
v_comp
,
v_null
,
v_null
,
v_null
);
todo_wine
ok
(
hr
==
S_OK
||
hr
==
E_ACCESSDENIED
/* not an administrator */
,
"Connect error %#x
\n
"
,
hr
);
SysFreeString
(
V_BSTR
(
&
v_comp
));
V_BSTR
(
&
v_comp
)
=
SysAllocString
(
deadbeefW
);
hr
=
ITaskService_Connect
(
service
,
v_comp
,
v_null
,
v_null
,
v_null
);
todo_wine
ok
(
hr
==
HRESULT_FROM_WIN32
(
ERROR_BAD_NETPATH
),
"expected ERROR_BAD_NETPATH, got %#x
\n
"
,
hr
);
vbool
=
0xdead
;
hr
=
ITaskService_get_Connected
(
service
,
&
vbool
);
ok
(
hr
==
S_OK
,
"get_Connected error %#x
\n
"
,
hr
);
todo_wine
ok
(
vbool
==
VARIANT_TRUE
,
"expected VARIANT_TRUE, got %d
\n
"
,
vbool
);
hr
=
ITaskService_Connect
(
service
,
v_null
,
v_null
,
v_null
,
v_null
);
todo_wine
ok
(
hr
==
S_OK
,
"Connect error %#x
\n
"
,
hr
);
vbool
=
0xdead
;
hr
=
ITaskService_get_Connected
(
service
,
&
vbool
);
ok
(
hr
==
S_OK
,
"get_Connected error %#x
\n
"
,
hr
);
todo_wine
ok
(
vbool
==
VARIANT_TRUE
,
"expected VARIANT_TRUE, got %d
\n
"
,
vbool
);
hr
=
ITaskService_get_TargetServer
(
service
,
&
bstr
);
...
...
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