Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Yoann Laissus
wine
Commits
3112fd22
Commit
3112fd22
authored
24 years ago
by
Michael McCormack
Committed by
Alexandre Julliard
24 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Implemented SHDeleteEmptyKeyA, SHDeleteKeyA.
parent
3b216de5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
dlls/shlwapi/reg.c
+118
-4
118 additions, 4 deletions
dlls/shlwapi/reg.c
dlls/shlwapi/shlwapi.spec
+2
-2
2 additions, 2 deletions
dlls/shlwapi/shlwapi.spec
include/shlwapi.h
+8
-0
8 additions, 0 deletions
include/shlwapi.h
with
128 additions
and
6 deletions
dlls/shlwapi/reg.c
+
118
−
4
View file @
3112fd22
...
...
@@ -223,17 +223,78 @@ HRESULT WINAPI SHQueryValueExW (
/*************************************************************************
* SHDeleteKeyA [SHLWAPI.@]
*
* It appears this function is made available to account for the differences
* between the Win9x and WinNT/2k RegDeleteKeyA functions.
*
* According to docs, Win9x RegDeleteKeyA will delete all subkeys, whereas
* WinNt/2k will only delete the key if empty.
*/
HRESULT
WINAPI
SHDeleteKeyA
(
HKEY
h
k
ey
,
LPCSTR
pszSubKey
)
HKEY
h
K
ey
,
LPCSTR
l
pszSubKey
)
{
FIXME
(
"hkey=0x%08x, %s
\n
"
,
hkey
,
debugstr_a
(
pszSubKey
));
return
0
;
DWORD
r
,
dwKeyCount
,
dwSize
,
i
,
dwMaxSubkeyLen
;
HKEY
hSubKey
;
LPSTR
lpszName
;
TRACE
(
"hkey=0x%08x, %s
\n
"
,
hKey
,
debugstr_a
(
lpszSubKey
));
hSubKey
=
0
;
r
=
RegOpenKeyExA
(
hKey
,
lpszSubKey
,
0
,
KEY_READ
,
&
hSubKey
);
if
(
r
!=
ERROR_SUCCESS
)
return
r
;
/* find how many subkeys there are */
dwKeyCount
=
0
;
dwMaxSubkeyLen
=
0
;
r
=
RegQueryInfoKeyA
(
hSubKey
,
NULL
,
NULL
,
NULL
,
&
dwKeyCount
,
&
dwMaxSubkeyLen
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
);
if
(
r
!=
ERROR_SUCCESS
)
{
RegCloseKey
(
hSubKey
);
return
r
;
}
/* alloc memory for the longest string terminating 0 */
dwMaxSubkeyLen
++
;
lpszName
=
HeapAlloc
(
GetProcessHeap
(),
0
,
dwMaxSubkeyLen
*
sizeof
(
CHAR
));
if
(
!
lpszName
)
{
RegCloseKey
(
hSubKey
);
return
ERROR_NOT_ENOUGH_MEMORY
;
}
/* recursively delete all the subkeys */
for
(
i
=
0
;
i
<
dwKeyCount
;
i
++
)
{
dwSize
=
dwMaxSubkeyLen
;
r
=
RegEnumKeyExA
(
hSubKey
,
i
,
lpszName
,
&
dwSize
,
NULL
,
NULL
,
NULL
,
NULL
);
if
(
r
!=
ERROR_SUCCESS
)
break
;
r
=
SHDeleteKeyA
(
hSubKey
,
lpszName
);
if
(
r
!=
ERROR_SUCCESS
)
break
;
}
HeapFree
(
GetProcessHeap
(),
0
,
lpszName
);
RegCloseKey
(
hSubKey
);
if
(
r
==
ERROR_SUCCESS
)
r
=
RegDeleteKeyA
(
hKey
,
lpszSubKey
);
return
r
;
}
/*************************************************************************
* SHDeleteKeyW [SHLWAPI.@]
*
* It appears this function is made available to account for the differences
* between the Win9x and WinNT/2k RegDeleteKeyA functions.
*
* According to docs, Win9x RegDeleteKeyA will delete all subkeys, whereas
* WinNt/2k will only delete the key if empty.
*/
HRESULT
WINAPI
SHDeleteKeyW
(
HKEY
hkey
,
...
...
@@ -242,3 +303,56 @@ HRESULT WINAPI SHDeleteKeyW(
FIXME
(
"hkey=0x%08x, %s
\n
"
,
hkey
,
debugstr_w
(
pszSubKey
));
return
0
;
}
/*************************************************************************
* SHDeleteEmptyKeyA [SHLWAPI.@]
*
* It appears this function is made available to account for the differences
* between the Win9x and WinNT/2k RegDeleteKeyA functions.
*
* According to docs, Win9x RegDeleteKeyA will delete all subkeys, whereas
* WinNt/2k will only delete the key if empty.
*/
DWORD
WINAPI
SHDeleteEmptyKeyA
(
HKEY
hKey
,
LPCSTR
lpszSubKey
)
{
DWORD
r
,
dwKeyCount
;
HKEY
hSubKey
;
TRACE
(
"hkey=0x%08x, %s
\n
"
,
hKey
,
debugstr_a
(
lpszSubKey
));
hSubKey
=
0
;
r
=
RegOpenKeyExA
(
hKey
,
lpszSubKey
,
0
,
KEY_READ
,
&
hSubKey
);
if
(
r
!=
ERROR_SUCCESS
)
return
r
;
dwKeyCount
=
0
;
r
=
RegQueryInfoKeyA
(
hSubKey
,
NULL
,
NULL
,
NULL
,
&
dwKeyCount
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
);
if
(
r
!=
ERROR_SUCCESS
)
return
r
;
RegCloseKey
(
hSubKey
);
if
(
dwKeyCount
)
return
ERROR_KEY_HAS_CHILDREN
;
r
=
RegDeleteKeyA
(
hKey
,
lpszSubKey
);
return
r
;
}
/*************************************************************************
* SHDeleteEmptyKeyW [SHLWAPI.@]
*
* It appears this function is made available to account for the differences
* between the Win9x and WinNT/2k RegDeleteKeyA functions.
*
* According to docs, Win9x RegDeleteKeyA will delete all subkeys, whereas
* WinNt/2k will only delete the key if empty.
*/
DWORD
WINAPI
SHDeleteEmptyKeyW
(
HKEY
hKey
,
LPCWSTR
lpszSubKey
)
{
FIXME
(
"hkey=0x%08x, %s
\n
"
,
hKey
,
debugstr_w
(
lpszSubKey
));
return
0
;
}
This diff is collapsed.
Click to expand it.
dlls/shlwapi/shlwapi.spec
+
2
−
2
View file @
3112fd22
...
...
@@ -558,8 +558,8 @@ import kernel32
@ stdcall PathUnquoteSpacesA (str) PathUnquoteSpacesA
@ stdcall PathUnquoteSpacesW (wstr) PathUnquoteSpacesW
@ stdcall SHCreateShellPalette(long)SHCreateShellPalette
@ st
ub
SHDeleteEmptyKeyA
@ st
ub
SHDeleteEmptyKeyW
@ st
dcall SHDeleteEmptyKeyA(long ptr)
SHDeleteEmptyKeyA
@ st
dcall SHDeleteEmptyKeyW(long ptr)
SHDeleteEmptyKeyW
@ stdcall SHDeleteKeyA(long str) SHDeleteKeyA
@ stdcall SHDeleteKeyW(long wstr) SHDeleteKeyW
@ stub SHDeleteOrphanKeyA
...
...
This diff is collapsed.
Click to expand it.
include/shlwapi.h
+
8
−
0
View file @
3112fd22
...
...
@@ -122,6 +122,14 @@ void WINAPI PathRemoveBlanksW(LPWSTR lpszPath);
#define PathRemoveBlanks WINELIB_NAME_AW(PathRemoveBlanks)
void
WINAPI
PathRemoveBlanksAW
(
LPVOID
lpszPath
);
HRESULT
WINAPI
SHDeleteKeyA
(
HKEY
hKey
,
LPCSTR
lpszSubKey
);
HRESULT
WINAPI
SHDeleteKeyW
(
HKEY
hkey
,
LPCWSTR
pszSubKey
);
#define SHDeleteKey WINELIB_NAME_AW(SHDeleteKey)
DWORD
WINAPI
SHDeleteEmptyKeyA
(
HKEY
hKey
,
LPCSTR
lpszSubKey
);
DWORD
WINAPI
SHDeleteEmptyKeyW
(
HKEY
hKey
,
LPCWSTR
lpszSubKey
);
#define SHDeleteEmptyKey WINELIB_NAME_AW(SHDeleteEmptyKey)
#ifdef __cplusplus
}
/* extern "C" */
#endif
/* defined(__cplusplus) */
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment