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
7e5bd67f
Commit
7e5bd67f
authored
Apr 07, 2014
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Apr 07, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
taskschd: Remove registry based task folder management.
parent
de8ce034
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
85 deletions
+1
-85
folder.c
dlls/taskschd/folder.c
+1
-85
No files found.
dlls/taskschd/folder.c
View file @
7e5bd67f
...
...
@@ -33,8 +33,6 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
taskschd
);
static
const
char
root
[]
=
"Software
\\
Microsoft
\\
Windows NT
\\
CurrentVersion
\\
Schedule
\\
TaskCache
\\
Tree"
;
typedef
struct
{
ITaskFolder
ITaskFolder_iface
;
...
...
@@ -136,76 +134,6 @@ static HRESULT WINAPI TaskFolder_get_Name(ITaskFolder *iface, BSTR *name)
return
S_OK
;
}
static
HRESULT
reg_create_folder
(
const
WCHAR
*
path
,
HKEY
*
hfolder
)
{
HKEY
hroot
;
DWORD
ret
,
disposition
;
ret
=
RegCreateKeyA
(
HKEY_LOCAL_MACHINE
,
root
,
&
hroot
);
if
(
ret
)
return
HRESULT_FROM_WIN32
(
ret
);
while
(
*
path
==
'\\'
)
path
++
;
ret
=
RegCreateKeyExW
(
hroot
,
path
,
0
,
NULL
,
0
,
KEY_ALL_ACCESS
,
NULL
,
hfolder
,
&
disposition
);
if
(
ret
==
ERROR_FILE_NOT_FOUND
)
ret
=
ERROR_PATH_NOT_FOUND
;
if
(
ret
==
ERROR_SUCCESS
&&
disposition
==
REG_OPENED_EXISTING_KEY
)
{
RegCloseKey
(
*
hfolder
);
ret
=
ERROR_ALREADY_EXISTS
;
}
RegCloseKey
(
hroot
);
return
HRESULT_FROM_WIN32
(
ret
);
}
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
HRESULT
reg_delete_folder
(
const
WCHAR
*
path
,
const
WCHAR
*
name
)
{
HKEY
hroot
,
hfolder
;
DWORD
ret
;
ret
=
RegCreateKeyA
(
HKEY_LOCAL_MACHINE
,
root
,
&
hroot
);
if
(
ret
)
return
HRESULT_FROM_WIN32
(
ret
);
while
(
*
path
==
'\\'
)
path
++
;
ret
=
RegOpenKeyExW
(
hroot
,
path
,
0
,
DELETE
,
&
hfolder
);
RegCloseKey
(
hroot
);
while
(
*
name
==
'\\'
)
name
++
;
if
(
ret
==
ERROR_SUCCESS
)
{
ret
=
RegDeleteKeyW
(
hfolder
,
name
);
RegCloseKey
(
hfolder
);
}
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
);
...
...
@@ -328,9 +256,7 @@ static HRESULT WINAPI TaskFolder_DeleteFolder(ITaskFolder *iface, BSTR name, LON
hr
=
SchRpcDelete
(
folder_path
,
0
);
heap_free
(
folder_path
);
if
(
hr
!=
S_OK
)
return
hr
;
return
reg_delete_folder
(
folder
->
path
,
name
);
return
hr
;
}
static
HRESULT
WINAPI
TaskFolder_GetTask
(
ITaskFolder
*
iface
,
BSTR
name
,
IRegisteredTask
**
task
)
...
...
@@ -452,7 +378,6 @@ HRESULT TaskFolder_create(const WCHAR *parent, const WCHAR *path, ITaskFolder **
TaskFolder
*
folder
;
WCHAR
*
folder_path
;
HRESULT
hr
;
HKEY
hfolder
;
if
(
path
)
{
...
...
@@ -494,15 +419,6 @@ HRESULT TaskFolder_create(const WCHAR *parent, const WCHAR *path, ITaskFolder **
return
hr
;
}
hr
=
create
?
reg_create_folder
(
folder_path
,
&
hfolder
)
:
reg_open_folder
(
folder_path
,
&
hfolder
);
if
(
hr
)
{
heap_free
(
folder_path
);
return
hr
;
}
reg_close_folder
(
hfolder
);
folder
=
heap_alloc
(
sizeof
(
*
folder
));
if
(
!
folder
)
{
...
...
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