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
6e9d3d20
Commit
6e9d3d20
authored
Jul 12, 2020
by
Zebediah Figura
Committed by
Alexandre Julliard
Jul 15, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Implement deleting mapped sections.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
d2b83336
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
64 additions
and
2 deletions
+64
-2
profile.c
dlls/kernel32/profile.c
+64
-2
No files found.
dlls/kernel32/profile.c
View file @
6e9d3d20
...
...
@@ -1263,6 +1263,68 @@ static DWORD get_section( const WCHAR *filename, const WCHAR *section,
return
ret
;
}
static
void
delete_key_values
(
HKEY
key
)
{
WCHAR
*
entry
;
while
((
entry
=
enum_key
(
key
,
0
)))
{
RegDeleteValueW
(
key
,
entry
);
HeapFree
(
GetProcessHeap
(),
0
,
entry
);
}
}
static
BOOL
delete_section
(
const
WCHAR
*
filename
,
const
WCHAR
*
section
)
{
HKEY
key
,
subkey
,
section_key
;
if
((
key
=
open_file_mapping_key
(
filename
)))
{
if
(
!
RegOpenKeyExW
(
key
,
section
,
0
,
KEY_READ
,
&
subkey
))
{
WCHAR
*
entry
,
*
path
;
HKEY
entry_key
;
DWORD
i
;
for
(
i
=
0
;
(
entry
=
enum_key
(
subkey
,
i
));
++
i
)
{
if
(
!
(
path
=
get_key_value
(
subkey
,
entry
)))
{
HeapFree
(
GetProcessHeap
(),
0
,
path
);
continue
;
}
entry_key
=
open_mapped_key
(
path
,
TRUE
);
HeapFree
(
GetProcessHeap
(),
0
,
path
);
if
(
!
entry_key
)
{
HeapFree
(
GetProcessHeap
(),
0
,
entry
);
continue
;
}
if
(
entry
[
0
])
RegDeleteValueW
(
entry_key
,
entry
);
else
delete_key_values
(
entry_key
);
HeapFree
(
GetProcessHeap
(),
0
,
entry
);
RegCloseKey
(
entry_key
);
}
RegCloseKey
(
subkey
);
}
else
if
(
get_mapped_section_key
(
filename
,
section
,
NULL
,
TRUE
,
&
section_key
))
{
delete_key_values
(
section_key
);
RegCloseKey
(
section_key
);
}
RegCloseKey
(
key
);
}
return
PROFILE_DeleteSection
(
filename
,
section
);
}
/********************* API functions **********************************/
...
...
@@ -1608,7 +1670,7 @@ BOOL WINAPI WritePrivateProfileStringW( LPCWSTR section, LPCWSTR entry,
LeaveCriticalSection
(
&
PROFILE_CritSect
);
return
FALSE
;
}
if
(
!
entry
)
return
PROFILE_DeleteS
ection
(
filename
,
section
);
if
(
!
entry
)
return
delete_s
ection
(
filename
,
section
);
if
(
get_mapped_section_key
(
filename
,
section
,
entry
,
TRUE
,
&
key
))
{
...
...
@@ -1686,7 +1748,7 @@ BOOL WINAPI WritePrivateProfileSectionW( LPCWSTR section,
LeaveCriticalSection
(
&
PROFILE_CritSect
);
return
FALSE
;
}
if
(
!
string
)
return
PROFILE_DeleteS
ection
(
filename
,
section
);
if
(
!
string
)
return
delete_s
ection
(
filename
,
section
);
if
((
key
=
open_file_mapping_key
(
filename
)))
{
...
...
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