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
Releases
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
Johnny Cai
wine
Commits
13d00c8d
Commit
13d00c8d
authored
25 years ago
by
Huw D. M. Davies
Committed by
Alexandre Julliard
25 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Fixed a few problems with RegEnumKey*.
parent
c7cc6f12
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
misc/registry.c
+69
-76
69 additions, 76 deletions
misc/registry.c
with
69 additions
and
76 deletions
misc/registry.c
+
69
−
76
View file @
13d00c8d
...
...
@@ -3020,55 +3020,63 @@ DWORD WINAPI RegEnumKeyExW( HKEY hkey, DWORD iSubkey, LPWSTR lpszName,
LPWSTR
lpszClass
,
LPDWORD
lpcchClass
,
FILETIME
*
ft
)
{
LPKEYSTRUCT
lpkey
,
lpxkey
;
LPKEYSTRUCT
lpkey
,
lpxkey
;
TRACE_
(
reg
)(
"(%x,%ld,%p,%ld,%p,%p,%p,%p)
\n
"
,
hkey
,
iSubkey
,
lpszName
,
*
lpcchName
,
lpdwReserved
,
lpszClass
,
lpcchClass
,
ft
);
TRACE_
(
reg
)(
"(%x,%ld,%p,%p(%ld),%p,%p,%p,%p)
\n
"
,
hkey
,
iSubkey
,
lpszName
,
lpcchName
,
lpcchName
?
*
lpcchName
:
-
1
,
lpdwReserved
,
lpszClass
,
lpcchClass
,
ft
);
lpkey
=
lookup_hkey
(
hkey
);
if
(
!
lpkey
)
return
ERROR_INVALID_HANDLE
;
if
(
!
lpkey
->
nextsub
)
return
ERROR_NO_MORE_ITEMS
;
lpxkey
=
lpkey
->
nextsub
;
if
(
!
lpcchName
)
return
ERROR_INVALID_PARAMETER
;
/* Traverse the subkeys */
while
(
iSubkey
&&
lpxkey
)
{
iSubkey
--
;
lpxkey
=
lpxkey
->
next
;
}
if
(
!
lpkey
->
nextsub
)
return
ERROR_NO_MORE_ITEMS
;
lpxkey
=
lpkey
->
nextsub
;
if
(
iSubkey
||
!
lpxkey
)
return
ERROR_NO_MORE_ITEMS
;
if
(
lstrlenW
(
lpxkey
->
keyname
)
+
1
>*
lpcchName
)
{
*
lpcchName
=
lstrlenW
(
lpxkey
->
keyname
)
+
1
;
return
ERROR_MORE_DATA
;
}
memcpy
(
lpszName
,
lpxkey
->
keyname
,
lstrlenW
(
lpxkey
->
keyname
)
*
2
+
2
);
/* Traverse the subkeys */
while
(
iSubkey
&&
lpxkey
)
{
iSubkey
--
;
lpxkey
=
lpxkey
->
next
;
}
if
(
*
lpcchName
)
*
lpcchName
=
lstrlenW
(
lpszName
);
if
(
iSubkey
||
!
lpxkey
)
return
ERROR_NO_MORE_ITEMS
;
if
(
lstrlenW
(
lpxkey
->
keyname
)
+
1
>*
lpcchName
)
{
*
lpcchName
=
lstrlenW
(
lpxkey
->
keyname
);
return
ERROR_MORE_DATA
;
}
memcpy
(
lpszName
,
lpxkey
->
keyname
,
lstrlenW
(
lpxkey
->
keyname
)
*
2
+
2
);
*
lpcchName
=
lstrlenW
(
lpszName
);
if
(
lpszClass
)
{
/* FIXME: what should we write into it? */
*
lpszClass
=
0
;
*
lpcchClass
=
2
;
}
return
ERROR_SUCCESS
;
if
(
lpszClass
)
{
/* FIXME: what should we write into it? */
*
lpszClass
=
0
;
*
lpcchClass
=
2
;
}
return
ERROR_SUCCESS
;
}
/******************************************************************************
* RegEnumKey
32
W [ADVAPI32.140]
* RegEnumKeyW [ADVAPI32.140]
*/
DWORD
WINAPI
RegEnumKeyW
(
HKEY
hkey
,
DWORD
iSubkey
,
LPWSTR
lpszName
,
DWORD
lpcchName
)
{
FILETIME
ft
;
DWORD
ret
;
TRACE_
(
reg
)(
"(%x,%ld,%p,%ld)
\n
"
,
hkey
,
iSubkey
,
lpszName
,
lpcchName
);
return
RegEnumKeyExW
(
hkey
,
iSubkey
,
lpszName
,
&
lpcchName
,
NULL
,
NULL
,
NULL
,
&
ft
);
ret
=
RegEnumKeyExW
(
hkey
,
iSubkey
,
lpszName
,
&
lpcchName
,
NULL
,
NULL
,
NULL
,
NULL
);
/* If lpszName is NULL then we have a slightly different behaviour than
RegEnumKeyExW */
if
(
lpszName
==
NULL
&&
ret
==
ERROR_MORE_DATA
)
ret
=
ERROR_SUCCESS
;
return
ret
;
}
...
...
@@ -3080,64 +3088,49 @@ DWORD WINAPI RegEnumKeyExA( HKEY hkey, DWORD iSubkey, LPSTR lpszName,
LPSTR
lpszClass
,
LPDWORD
lpcchClass
,
FILETIME
*
ft
)
{
DWORD
ret
,
lpcchNameW
,
lpcchClassW
;
LPWSTR
lpszNameW
,
lpszClassW
;
DWORD
ret
;
LPWSTR
lpszNameW
,
lpszClassW
;
TRACE_
(
reg
)(
"(%x,%ld,%p,%p(%ld),%p,%p,%p,%p)
\n
"
,
hkey
,
iSubkey
,
lpszName
,
lpcchName
,
lpcchName
?
*
lpcchName
:
-
1
,
lpdwReserved
,
lpszClass
,
lpcchClass
,
ft
);
TRACE_
(
reg
)(
"(%x,%ld,%p,%ld,%p,%p,%p,%p)
\n
"
,
hkey
,
iSubkey
,
lpszName
,
*
lpcchName
,
lpdwReserved
,
lpszClass
,
lpcchClass
,
ft
);
if
(
lpszName
)
{
lpszNameW
=
(
LPWSTR
)
xmalloc
(
*
lpcchName
*
2
);
lpcchNameW
=
*
lpcchName
;
}
else
{
lpszNameW
=
NULL
;
lpcchNameW
=
0
;
}
if
(
lpszClass
)
{
lpszClassW
=
(
LPWSTR
)
xmalloc
(
*
lpcchClass
*
2
);
lpcchClassW
=
*
lpcchClass
;
}
else
{
lpszClassW
=
0
;
lpcchClassW
=
0
;
}
ret
=
RegEnumKeyExW
(
hkey
,
iSubkey
,
lpszNameW
,
&
lpcchNameW
,
lpdwReserved
,
lpszClassW
,
&
lpcchClassW
,
ft
);
if
(
ret
==
ERROR_SUCCESS
)
{
lstrcpyWtoA
(
lpszName
,
lpszNameW
);
*
lpcchName
=
strlen
(
lpszName
);
if
(
lpszClassW
)
{
lstrcpyWtoA
(
lpszClass
,
lpszClassW
);
*
lpcchClass
=
strlen
(
lpszClass
);
}
}
if
(
lpszNameW
)
free
(
lpszNameW
);
lpszNameW
=
lpszName
?
(
LPWSTR
)
xmalloc
(
*
lpcchName
*
2
)
:
NULL
;
lpszClassW
=
lpszClass
?
(
LPWSTR
)
xmalloc
(
*
lpcchClass
*
2
)
:
NULL
;
ret
=
RegEnumKeyExW
(
hkey
,
iSubkey
,
lpszNameW
,
lpcchName
,
lpdwReserved
,
lpszClassW
,
lpcchClass
,
ft
);
if
(
ret
==
ERROR_SUCCESS
)
{
lstrcpyWtoA
(
lpszName
,
lpszNameW
);
if
(
lpszClassW
)
free
(
lpszClassW
);
return
ret
;
lstrcpyWtoA
(
lpszClass
,
lpszClassW
);
}
if
(
lpszNameW
)
free
(
lpszNameW
);
if
(
lpszClassW
)
free
(
lpszClassW
);
return
ret
;
}
/******************************************************************************
* RegEnumKey
32
A [ADVAPI32.137]
* RegEnumKeyA [ADVAPI32.137]
*/
DWORD
WINAPI
RegEnumKeyA
(
HKEY
hkey
,
DWORD
iSubkey
,
LPSTR
lpszName
,
DWORD
lpcchName
)
{
FILETIME
ft
;
DWORD
ret
;
TRACE_
(
reg
)(
"(%x,%ld,%p,%ld)
\n
"
,
hkey
,
iSubkey
,
lpszName
,
lpcchName
);
return
RegEnumKeyExA
(
hkey
,
iSubkey
,
lpszName
,
&
lpcchName
,
NULL
,
NULL
,
NULL
,
&
ft
);
ret
=
RegEnumKeyExA
(
hkey
,
iSubkey
,
lpszName
,
&
lpcchName
,
NULL
,
NULL
,
NULL
,
NULL
);
/* If lpszName is NULL then we have a slightly different behaviour than
RegEnumKeyExA */
if
(
lpszName
==
NULL
&&
ret
==
ERROR_MORE_DATA
)
ret
=
ERROR_SUCCESS
;
return
ret
;
}
...
...
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