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
1ce977d6
Commit
1ce977d6
authored
Dec 03, 2006
by
Marcus Meissner
Committed by
Alexandre Julliard
Dec 04, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell32: Forward SHDeleteKeyA directly to SHDeleteKeyW.
parent
44b0b462
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
41 deletions
+6
-41
reg.c
dlls/shlwapi/reg.c
+6
-41
No files found.
dlls/shlwapi/reg.c
View file @
1ce977d6
...
@@ -1491,6 +1491,9 @@ DWORD WINAPI SHQueryValueExW(HKEY hKey, LPCWSTR lpszValue,
...
@@ -1491,6 +1491,9 @@ DWORD WINAPI SHQueryValueExW(HKEY hKey, LPCWSTR lpszValue,
*
*
* Delete a registry key and any sub keys/values present
* Delete a registry key and any sub keys/values present
*
*
* This function forwards to the unicode version directly, to avoid
* handling subkeys that are not representable in ASCII.
*
* PARAMS
* PARAMS
* hKey [I] Handle to registry key
* hKey [I] Handle to registry key
* lpszSubKey [I] Name of sub key to delete
* lpszSubKey [I] Name of sub key to delete
...
@@ -1502,48 +1505,10 @@ DWORD WINAPI SHQueryValueExW(HKEY hKey, LPCWSTR lpszValue,
...
@@ -1502,48 +1505,10 @@ DWORD WINAPI SHQueryValueExW(HKEY hKey, LPCWSTR lpszValue,
*/
*/
DWORD
WINAPI
SHDeleteKeyA
(
HKEY
hKey
,
LPCSTR
lpszSubKey
)
DWORD
WINAPI
SHDeleteKeyA
(
HKEY
hKey
,
LPCSTR
lpszSubKey
)
{
{
DWORD
dwRet
,
dwMaxSubkeyLen
=
0
,
dwSize
;
WCHAR
subkeyW
[
MAX_PATH
];
CHAR
szNameBuf
[
MAX_PATH
],
*
lpszName
=
szNameBuf
;
HKEY
hSubKey
=
0
;
TRACE
(
"(hkey=%p,%s)
\n
"
,
hKey
,
debugstr_a
(
lpszSubKey
));
dwRet
=
RegOpenKeyExA
(
hKey
,
lpszSubKey
,
0
,
KEY_READ
,
&
hSubKey
);
if
(
!
dwRet
)
{
/* Find the maximum subkey length so that we can allocate a buffer */
dwRet
=
RegQueryInfoKeyA
(
hSubKey
,
NULL
,
NULL
,
NULL
,
NULL
,
&
dwMaxSubkeyLen
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
);
if
(
!
dwRet
)
{
dwMaxSubkeyLen
++
;
if
(
dwMaxSubkeyLen
>
sizeof
(
szNameBuf
))
/* Name too big: alloc a buffer for it */
lpszName
=
HeapAlloc
(
GetProcessHeap
(),
0
,
dwMaxSubkeyLen
*
sizeof
(
CHAR
));
if
(
!
lpszName
)
dwRet
=
ERROR_NOT_ENOUGH_MEMORY
;
else
{
while
(
dwRet
==
ERROR_SUCCESS
)
{
dwSize
=
dwMaxSubkeyLen
;
dwRet
=
RegEnumKeyExA
(
hSubKey
,
0
,
lpszName
,
&
dwSize
,
NULL
,
NULL
,
NULL
,
NULL
);
if
(
dwRet
==
ERROR_SUCCESS
||
dwRet
==
ERROR_MORE_DATA
)
dwRet
=
SHDeleteKeyA
(
hSubKey
,
lpszName
);
}
if
(
dwRet
==
ERROR_NO_MORE_ITEMS
)
dwRet
=
ERROR_SUCCESS
;
if
(
lpszName
!=
szNameBuf
)
HeapFree
(
GetProcessHeap
(),
0
,
lpszName
);
/* Free buffer if allocated */
}
}
RegCloseKey
(
hSubKey
);
MultiByteToWideChar
(
CP_ACP
,
0
,
lpszSubKey
,
-
1
,
subkeyW
,
sizeof
(
subkeyW
)
/
sizeof
(
WCHAR
));
if
(
!
dwRet
)
return
SHDeleteKeyW
(
hKey
,
subkeyW
);
dwRet
=
RegDeleteKeyA
(
hKey
,
lpszSubKey
);
}
return
dwRet
;
}
}
/*************************************************************************
/*************************************************************************
...
...
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