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
3112fd22
Commit
3112fd22
authored
Sep 29, 2000
by
Mike McCormack
Committed by
Alexandre Julliard
Sep 29, 2000
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implemented SHDeleteEmptyKeyA, SHDeleteKeyA.
parent
3b216de5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
128 additions
and
6 deletions
+128
-6
reg.c
dlls/shlwapi/reg.c
+118
-4
shlwapi.spec
dlls/shlwapi/shlwapi.spec
+2
-2
shlwapi.h
include/shlwapi.h
+8
-0
No files found.
dlls/shlwapi/reg.c
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
;
}
dlls/shlwapi/shlwapi.spec
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
...
...
include/shlwapi.h
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) */
...
...
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