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
7aa2e9a9
Commit
7aa2e9a9
authored
Mar 20, 2015
by
Nikolay Sivov
Committed by
Alexandre Julliard
Mar 20, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mstask: Added IEnumWorkItems stub.
parent
63dd502c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
139 additions
and
3 deletions
+139
-3
task_scheduler.c
dlls/mstask/task_scheduler.c
+117
-3
task_scheduler.c
dlls/mstask/tests/task_scheduler.c
+22
-0
No files found.
dlls/mstask/task_scheduler.c
View file @
7aa2e9a9
...
...
@@ -28,11 +28,22 @@ typedef struct
LONG
ref
;
}
TaskSchedulerImpl
;
typedef
struct
{
IEnumWorkItems
IEnumWorkItems_iface
;
LONG
ref
;
}
EnumWorkItemsImpl
;
static
inline
TaskSchedulerImpl
*
impl_from_ITaskScheduler
(
ITaskScheduler
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
TaskSchedulerImpl
,
ITaskScheduler_iface
);
}
static
inline
EnumWorkItemsImpl
*
impl_from_IEnumWorkItems
(
IEnumWorkItems
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
EnumWorkItemsImpl
,
IEnumWorkItems_iface
);
}
static
void
TaskSchedulerDestructor
(
TaskSchedulerImpl
*
This
)
{
TRACE
(
"%p
\n
"
,
This
);
...
...
@@ -40,6 +51,103 @@ static void TaskSchedulerDestructor(TaskSchedulerImpl *This)
InterlockedDecrement
(
&
dll_ref
);
}
static
HRESULT
WINAPI
EnumWorkItems_QueryInterface
(
IEnumWorkItems
*
iface
,
REFIID
riid
,
void
**
obj
)
{
EnumWorkItemsImpl
*
This
=
impl_from_IEnumWorkItems
(
iface
);
TRACE
(
"(%p)->(%s %p)
\n
"
,
This
,
debugstr_guid
(
riid
),
obj
);
if
(
IsEqualGUID
(
riid
,
&
IID_IEnumWorkItems
)
||
IsEqualGUID
(
riid
,
&
IID_IUnknown
))
{
*
obj
=
&
This
->
IEnumWorkItems_iface
;
IEnumWorkItems_AddRef
(
iface
);
return
S_OK
;
}
*
obj
=
NULL
;
return
E_NOINTERFACE
;
}
static
ULONG
WINAPI
EnumWorkItems_AddRef
(
IEnumWorkItems
*
iface
)
{
EnumWorkItemsImpl
*
This
=
impl_from_IEnumWorkItems
(
iface
);
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"(%p)->(%u)
\n
"
,
This
,
ref
);
return
ref
;
}
static
ULONG
WINAPI
EnumWorkItems_Release
(
IEnumWorkItems
*
iface
)
{
EnumWorkItemsImpl
*
This
=
impl_from_IEnumWorkItems
(
iface
);
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p)->(%u)
\n
"
,
This
,
ref
);
if
(
ref
==
0
)
{
HeapFree
(
GetProcessHeap
(),
0
,
This
);
InterlockedDecrement
(
&
dll_ref
);
}
return
ref
;
}
static
HRESULT
WINAPI
EnumWorkItems_Next
(
IEnumWorkItems
*
iface
,
ULONG
count
,
LPWSTR
**
names
,
ULONG
*
fetched
)
{
EnumWorkItemsImpl
*
This
=
impl_from_IEnumWorkItems
(
iface
);
FIXME
(
"(%p)->(%u %p %p): stub
\n
"
,
This
,
count
,
names
,
fetched
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
EnumWorkItems_Skip
(
IEnumWorkItems
*
iface
,
ULONG
count
)
{
EnumWorkItemsImpl
*
This
=
impl_from_IEnumWorkItems
(
iface
);
FIXME
(
"(%p)->(%u): stub
\n
"
,
This
,
count
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
EnumWorkItems_Reset
(
IEnumWorkItems
*
iface
)
{
EnumWorkItemsImpl
*
This
=
impl_from_IEnumWorkItems
(
iface
);
FIXME
(
"(%p): stub
\n
"
,
This
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
EnumWorkItems_Clone
(
IEnumWorkItems
*
iface
,
IEnumWorkItems
**
cloned
)
{
EnumWorkItemsImpl
*
This
=
impl_from_IEnumWorkItems
(
iface
);
FIXME
(
"(%p)->(%p): stub
\n
"
,
This
,
cloned
);
return
E_NOTIMPL
;
}
static
const
IEnumWorkItemsVtbl
EnumWorkItemsVtbl
=
{
EnumWorkItems_QueryInterface
,
EnumWorkItems_AddRef
,
EnumWorkItems_Release
,
EnumWorkItems_Next
,
EnumWorkItems_Skip
,
EnumWorkItems_Reset
,
EnumWorkItems_Clone
};
static
HRESULT
create_task_enum
(
IEnumWorkItems
**
ret
)
{
EnumWorkItemsImpl
*
tasks
;
*
ret
=
NULL
;
tasks
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
tasks
));
if
(
!
tasks
)
return
E_OUTOFMEMORY
;
tasks
->
IEnumWorkItems_iface
.
lpVtbl
=
&
EnumWorkItemsVtbl
;
tasks
->
ref
=
1
;
*
ret
=
&
tasks
->
IEnumWorkItems_iface
;
InterlockedIncrement
(
&
dll_ref
);
return
S_OK
;
}
static
HRESULT
WINAPI
MSTASK_ITaskScheduler_QueryInterface
(
ITaskScheduler
*
iface
,
REFIID
riid
,
...
...
@@ -140,10 +248,16 @@ static HRESULT WINAPI MSTASK_ITaskScheduler_GetTargetComputer(
static
HRESULT
WINAPI
MSTASK_ITaskScheduler_Enum
(
ITaskScheduler
*
iface
,
IEnumWorkItems
**
ppEnumT
asks
)
IEnumWorkItems
**
t
asks
)
{
FIXME
(
"%p, %p: stub
\n
"
,
iface
,
ppEnumTasks
);
return
E_NOTIMPL
;
TaskSchedulerImpl
*
This
=
impl_from_ITaskScheduler
(
iface
);
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
tasks
);
if
(
!
tasks
)
return
E_INVALIDARG
;
return
create_task_enum
(
tasks
);
}
static
HRESULT
WINAPI
MSTASK_ITaskScheduler_Activate
(
...
...
dlls/mstask/tests/task_scheduler.c
View file @
7aa2e9a9
...
...
@@ -203,6 +203,27 @@ static void test_SetTargetComputer(void)
return
;
}
static
void
test_Enum
(
void
)
{
ITaskScheduler
*
scheduler
;
IEnumWorkItems
*
tasks
;
HRESULT
hr
;
hr
=
CoCreateInstance
(
&
CLSID_CTaskScheduler
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_ITaskScheduler
,
(
void
**
)
&
scheduler
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
if
(
0
)
{
/* crashes on win2k */
hr
=
ITaskScheduler_Enum
(
scheduler
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08x
\n
"
,
hr
);
}
hr
=
ITaskScheduler_Enum
(
scheduler
,
&
tasks
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
IEnumWorkItems_Release
(
tasks
);
ITaskScheduler_Release
(
scheduler
);
}
START_TEST
(
task_scheduler
)
{
...
...
@@ -211,5 +232,6 @@ START_TEST(task_scheduler)
test_Activate
();
test_GetTargetComputer
();
test_SetTargetComputer
();
test_Enum
();
CoUninitialize
();
}
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