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
a67565ed
Commit
a67565ed
authored
Apr 04, 2014
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Apr 04, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
schedsvc: Implement SchRpcEnumTasks.
parent
1f717504
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
108 additions
and
2 deletions
+108
-2
schedsvc.c
dlls/schedsvc/schedsvc.c
+108
-2
No files found.
dlls/schedsvc/schedsvc.c
View file @
a67565ed
...
...
@@ -350,6 +350,11 @@ static inline BOOL is_directory(const WIN32_FIND_DATAW *data)
return
FALSE
;
}
static
inline
BOOL
is_file
(
const
WIN32_FIND_DATAW
*
data
)
{
return
!
(
data
->
dwFileAttributes
&
FILE_ATTRIBUTE_DIRECTORY
);
}
HRESULT
__cdecl
SchRpcEnumFolders
(
const
WCHAR
*
path
,
DWORD
flags
,
DWORD
*
start_index
,
DWORD
n_requested
,
DWORD
*
n_names
,
TASK_NAMES
*
names
)
{
...
...
@@ -461,8 +466,109 @@ HRESULT __cdecl SchRpcEnumFolders(const WCHAR *path, DWORD flags, DWORD *start_i
HRESULT
__cdecl
SchRpcEnumTasks
(
const
WCHAR
*
path
,
DWORD
flags
,
DWORD
*
start_index
,
DWORD
n_requested
,
DWORD
*
n_names
,
TASK_NAMES
*
names
)
{
FIXME
(
"%s,%#x,%p,%u,%p,%p: stub
\n
"
,
debugstr_w
(
path
),
flags
,
start_index
,
n_requested
,
n_names
,
names
);
return
E_NOTIMPL
;
static
const
WCHAR
allW
[]
=
{
'\\'
,
'*'
,
0
};
HRESULT
hr
=
S_OK
;
WCHAR
*
full_name
;
WCHAR
pathW
[
MAX_PATH
];
WIN32_FIND_DATAW
data
;
HANDLE
handle
;
DWORD
allocated
,
count
,
index
;
TASK_NAMES
list
;
TRACE
(
"%s,%#x,%u,%u,%p,%p
\n
"
,
debugstr_w
(
path
),
flags
,
*
start_index
,
n_requested
,
n_names
,
names
);
*
n_names
=
0
;
*
names
=
NULL
;
if
(
flags
&
~
TASK_ENUM_HIDDEN
)
return
E_INVALIDARG
;
if
(
!
n_requested
)
n_requested
=
~
0u
;
full_name
=
get_full_name
(
path
,
NULL
);
if
(
!
full_name
)
return
E_OUTOFMEMORY
;
if
(
strlenW
(
full_name
)
+
2
>
MAX_PATH
)
{
heap_free
(
full_name
);
return
HRESULT_FROM_WIN32
(
ERROR_FILENAME_EXCED_RANGE
);
}
strcpyW
(
pathW
,
full_name
);
strcatW
(
pathW
,
allW
);
heap_free
(
full_name
);
allocated
=
64
;
list
=
heap_alloc
(
allocated
*
sizeof
(
list
[
0
]));
if
(
!
list
)
return
E_OUTOFMEMORY
;
index
=
count
=
0
;
handle
=
FindFirstFileW
(
pathW
,
&
data
);
if
(
handle
==
INVALID_HANDLE_VALUE
)
{
heap_free
(
list
);
if
(
GetLastError
()
==
ERROR_PATH_NOT_FOUND
)
return
HRESULT_FROM_WIN32
(
ERROR_FILE_NOT_FOUND
);
return
HRESULT_FROM_WIN32
(
GetLastError
());
}
do
{
if
(
is_file
(
&
data
)
&&
index
++
>=
*
start_index
)
{
if
(
count
>=
allocated
)
{
TASK_NAMES
new_list
;
allocated
*=
2
;
new_list
=
heap_realloc
(
list
,
allocated
*
sizeof
(
list
[
0
]));
if
(
!
new_list
)
{
hr
=
E_OUTOFMEMORY
;
break
;
}
list
=
new_list
;
}
TRACE
(
"adding %s
\n
"
,
debugstr_w
(
data
.
cFileName
));
list
[
count
]
=
heap_strdupW
(
data
.
cFileName
);
if
(
!
list
[
count
])
{
hr
=
E_OUTOFMEMORY
;
break
;
}
count
++
;
if
(
count
>=
n_requested
)
{
hr
=
S_FALSE
;
break
;
}
}
}
while
(
FindNextFileW
(
handle
,
&
data
));
FindClose
(
handle
);
if
(
FAILED
(
hr
))
{
free_list
(
list
,
count
);
return
hr
;
}
*
n_names
=
count
;
if
(
count
)
{
*
names
=
list
;
*
start_index
=
index
;
return
hr
;
}
heap_free
(
list
);
*
names
=
NULL
;
return
*
start_index
?
S_FALSE
:
S_OK
;
}
HRESULT
__cdecl
SchRpcEnumInstances
(
const
WCHAR
*
path
,
DWORD
flags
,
DWORD
*
n_guids
,
GUID
**
guids
)
...
...
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