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
630354f6
Commit
630354f6
authored
Jan 20, 2014
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Jan 27, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
taskschd: Make GetFolder check whether task folder tree exists in the registry.
parent
e12a1bdf
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
2 deletions
+38
-2
Makefile.in
dlls/taskschd/Makefile.in
+1
-1
folder.c
dlls/taskschd/folder.c
+37
-0
scheduler.c
dlls/taskschd/tests/scheduler.c
+0
-1
No files found.
dlls/taskschd/Makefile.in
View file @
630354f6
MODULE
=
taskschd.dll
IMPORTS
=
oleaut32
IMPORTS
=
advapi32
oleaut32
C_SRCS
=
\
folder.c
\
...
...
dlls/taskschd/folder.c
View file @
630354f6
...
...
@@ -22,6 +22,7 @@
#include "windef.h"
#include "winbase.h"
#include "winreg.h"
#include "objbase.h"
#include "taskschd.h"
#include "taskschd_private.h"
...
...
@@ -31,6 +32,8 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
taskschd
);
static
const
char
root
[]
=
"Software
\\
Microsoft
\\
Windows NT
\\
CurrentVersion
\\
Schedule
\\
TaskCache
\\
Tree"
;
typedef
struct
{
ITaskFolder
ITaskFolder_iface
;
...
...
@@ -116,6 +119,29 @@ static HRESULT WINAPI TaskFolder_get_Name(ITaskFolder *iface, BSTR *name)
return
E_NOTIMPL
;
}
static
HRESULT
reg_open_folder
(
const
WCHAR
*
path
,
HKEY
*
hfolder
)
{
HKEY
hroot
;
DWORD
ret
;
ret
=
RegCreateKeyA
(
HKEY_LOCAL_MACHINE
,
root
,
&
hroot
);
if
(
ret
)
return
HRESULT_FROM_WIN32
(
ret
);
while
(
*
path
==
'\\'
)
path
++
;
ret
=
RegOpenKeyExW
(
hroot
,
path
,
0
,
KEY_ALL_ACCESS
,
hfolder
);
if
(
ret
==
ERROR_FILE_NOT_FOUND
)
ret
=
ERROR_PATH_NOT_FOUND
;
RegCloseKey
(
hroot
);
return
HRESULT_FROM_WIN32
(
ret
);
}
static
inline
void
reg_close_folder
(
HKEY
hfolder
)
{
RegCloseKey
(
hfolder
);
}
static
HRESULT
WINAPI
TaskFolder_get_Path
(
ITaskFolder
*
iface
,
BSTR
*
path
)
{
TaskFolder
*
folder
=
impl_from_ITaskFolder
(
iface
);
...
...
@@ -232,6 +258,8 @@ HRESULT TaskFolder_create(const WCHAR *parent, const WCHAR *path, ITaskFolder **
TaskFolder
*
folder
;
WCHAR
*
folder_path
;
int
len
=
0
;
HRESULT
hr
;
HKEY
hfolder
;
if
(
path
)
{
...
...
@@ -260,6 +288,15 @@ HRESULT TaskFolder_create(const WCHAR *parent, const WCHAR *path, ITaskFolder **
strcatW
(
folder_path
,
path
);
}
hr
=
reg_open_folder
(
folder_path
,
&
hfolder
);
if
(
hr
)
{
HeapFree
(
GetProcessHeap
(),
0
,
folder_path
);
return
hr
;
}
reg_close_folder
(
hfolder
);
folder
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
folder
));
if
(
!
folder
)
{
...
...
dlls/taskschd/tests/scheduler.c
View file @
630354f6
...
...
@@ -203,7 +203,6 @@ todo_wine
ok
(
hr
==
HRESULT_FROM_WIN32
(
ERROR_INVALID_NAME
),
"expected ERROR_INVALID_NAME, got %#x
\n
"
,
hr
);
hr
=
ITaskService_GetFolder
(
service
,
Wine_Folder1_Folder2
,
&
subfolder
);
todo_wine
ok
(
hr
==
HRESULT_FROM_WIN32
(
ERROR_PATH_NOT_FOUND
),
"expected ERROR_PATH_NOT_FOUND, got %#x
\n
"
,
hr
);
hr
=
ITaskFolder_CreateFolder
(
folder
,
bslash
,
v_null
,
&
subfolder
);
...
...
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