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
77da201e
Commit
77da201e
authored
Nov 21, 2005
by
Mike McCormack
Committed by
Alexandre Julliard
Nov 21, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Loop around calling RegQueryValue until we have a big enough string
for both the name and the value.
parent
5c4eee13
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
29 deletions
+46
-29
registry.c
dlls/msi/registry.c
+46
-29
No files found.
dlls/msi/registry.c
View file @
77da201e
...
...
@@ -773,7 +773,7 @@ UINT WINAPI MSI_EnumComponentQualifiers( LPCWSTR szComponent, DWORD iIndex,
awstring
*
lpQualBuf
,
DWORD
*
pcchQual
,
awstring
*
lpAppBuf
,
DWORD
*
pcchAppBuf
)
{
DWORD
name_sz
,
val_sz
,
type
,
ofs
;
DWORD
name_sz
,
val_sz
,
name_max
,
val_max
,
type
,
ofs
;
LPWSTR
name
=
NULL
,
val
=
NULL
;
UINT
r
,
r2
;
HKEY
key
;
...
...
@@ -789,40 +789,57 @@ UINT WINAPI MSI_EnumComponentQualifiers( LPCWSTR szComponent, DWORD iIndex,
return
ERROR_UNKNOWN_COMPONENT
;
/* figure out how big the name is we want to return */
name_sz
=
0
;
if
(
pcchQual
)
{
r
=
ERROR_OUTOFMEMORY
;
name_sz
=
*
pcchQual
*
4
;
name
=
msi_alloc
(
name_sz
*
sizeof
(
WCHAR
)
);
if
(
!
name
)
goto
end
;
}
/* figure out how big the value is */
type
=
0
;
val_sz
=
0
;
r
=
RegEnumValueW
(
key
,
iIndex
,
NULL
,
NULL
,
NULL
,
&
type
,
NULL
,
&
val_sz
);
if
(
r
!=
ERROR_SUCCESS
)
name_max
=
0x10
;
r
=
ERROR_OUTOFMEMORY
;
name
=
msi_alloc
(
name_max
*
sizeof
(
WCHAR
)
);
if
(
!
name
)
goto
end
;
if
(
type
!=
REG_MULTI_SZ
)
{
ERR
(
"component data has wrong type (%ld)
\n
"
,
type
);
goto
end
;
}
/* the value size is in bytes */
val_sz
+=
sizeof
(
WCHAR
);
val
=
msi_alloc
(
val_sz
);
val_max
=
0x10
;
r
=
ERROR_OUTOFMEMORY
;
val
=
msi_alloc
(
val_max
);
if
(
!
val
)
goto
end
;
r
=
RegEnumValueW
(
key
,
iIndex
,
name
,
&
name_sz
,
NULL
,
&
type
,
(
LPBYTE
)
val
,
&
val_sz
);
if
(
r
!=
ERROR_SUCCESS
)
/* loop until we allocate enough memory */
while
(
1
)
{
name_sz
=
name_max
;
val_sz
=
val_max
;
r
=
RegEnumValueW
(
key
,
iIndex
,
name
,
&
name_sz
,
NULL
,
&
type
,
(
LPBYTE
)
val
,
&
val_sz
);
if
(
r
==
ERROR_SUCCESS
)
break
;
if
(
r
!=
ERROR_MORE_DATA
)
goto
end
;
if
(
type
!=
REG_MULTI_SZ
)
{
ERR
(
"component data has wrong type (%ld)
\n
"
,
type
);
goto
end
;
}
r
=
ERROR_OUTOFMEMORY
;
if
((
name_sz
+
1
)
>=
name_max
)
{
name_max
*=
2
;
msi_free
(
name
);
name
=
msi_alloc
(
name_max
*
sizeof
(
WCHAR
)
);
if
(
!
name
)
goto
end
;
continue
;
}
if
(
val_sz
>
val_max
)
{
val_max
=
val_sz
+
sizeof
(
WCHAR
);
val
=
msi_alloc
(
val_max
*
sizeof
(
WCHAR
)
);
if
(
!
val
)
goto
end
;
continue
;
}
ERR
(
"should be enough data, but isn't %ld %ld
\n
"
,
name_sz
,
val_sz
);
goto
end
;
}
ofs
=
0
;
r
=
MsiDecomposeDescriptorW
(
val
,
NULL
,
NULL
,
NULL
,
&
ofs
);
...
...
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