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
4a88562e
Commit
4a88562e
authored
Mar 26, 2010
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Reset the MsiEnumProductsW index on failure.
parent
a83563aa
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
22 deletions
+12
-22
registry.c
dlls/msi/registry.c
+12
-22
No files found.
dlls/msi/registry.c
View file @
4a88562e
...
@@ -1236,17 +1236,13 @@ UINT WINAPI MsiEnumProductsW(DWORD index, LPWSTR lpguid)
...
@@ -1236,17 +1236,13 @@ UINT WINAPI MsiEnumProductsW(DWORD index, LPWSTR lpguid)
if
(
index
&&
index
-
last_index
!=
1
)
if
(
index
&&
index
-
last_index
!=
1
)
return
ERROR_INVALID_PARAMETER
;
return
ERROR_INVALID_PARAMETER
;
key
=
0
;
r
=
RegCreateKeyW
(
HKEY_LOCAL_MACHINE
,
szInstaller_LocalClassesProd
,
&
key
);
r
=
RegCreateKeyW
(
HKEY_LOCAL_MACHINE
,
szInstaller_LocalClassesProd
,
&
key
);
if
(
r
!=
ERROR_SUCCESS
)
if
(
r
!=
ERROR_SUCCESS
)
goto
failed
;
return
ERROR_NO_MORE_ITEMS
;
r
=
RegQueryInfoKeyW
(
key
,
NULL
,
NULL
,
NULL
,
&
machine_count
,
NULL
,
NULL
,
r
=
RegQueryInfoKeyW
(
key
,
NULL
,
NULL
,
NULL
,
&
machine_count
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
);
NULL
,
NULL
,
NULL
,
NULL
,
NULL
);
if
(
r
!=
ERROR_SUCCESS
)
if
(
r
!=
ERROR_SUCCESS
)
goto
failed
;
{
RegCloseKey
(
key
);
return
ERROR_NO_MORE_ITEMS
;
}
if
(
machine_count
&&
index
<=
machine_count
)
if
(
machine_count
&&
index
<=
machine_count
)
{
{
...
@@ -1261,26 +1257,23 @@ UINT WINAPI MsiEnumProductsW(DWORD index, LPWSTR lpguid)
...
@@ -1261,26 +1257,23 @@ UINT WINAPI MsiEnumProductsW(DWORD index, LPWSTR lpguid)
}
}
RegCloseKey
(
key
);
RegCloseKey
(
key
);
key
=
0
;
r
=
get_user_sid
(
&
usersid
);
r
=
get_user_sid
(
&
usersid
);
if
(
r
!=
ERROR_SUCCESS
||
!
usersid
)
if
(
r
!=
ERROR_SUCCESS
||
!
usersid
)
{
{
ERR
(
"Failed to retrieve user SID: %d
\n
"
,
r
);
ERR
(
"Failed to retrieve user SID: %d
\n
"
,
r
);
last_index
=
0
;
return
r
;
return
r
;
}
}
sprintfW
(
keypath
,
szInstaller_LocalManaged_fmt
,
usersid
);
sprintfW
(
keypath
,
szInstaller_LocalManaged_fmt
,
usersid
);
LocalFree
(
usersid
);
LocalFree
(
usersid
);
r
=
RegCreateKeyW
(
HKEY_LOCAL_MACHINE
,
keypath
,
&
key
);
r
=
RegCreateKeyW
(
HKEY_LOCAL_MACHINE
,
keypath
,
&
key
);
if
(
r
!=
ERROR_SUCCESS
)
if
(
r
!=
ERROR_SUCCESS
)
goto
failed
;
return
ERROR_NO_MORE_ITEMS
;
r
=
RegQueryInfoKeyW
(
key
,
NULL
,
NULL
,
NULL
,
&
managed_count
,
NULL
,
NULL
,
r
=
RegQueryInfoKeyW
(
key
,
NULL
,
NULL
,
NULL
,
&
managed_count
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
);
NULL
,
NULL
,
NULL
,
NULL
,
NULL
);
if
(
r
!=
ERROR_SUCCESS
)
if
(
r
!=
ERROR_SUCCESS
)
goto
failed
;
{
RegCloseKey
(
key
);
return
ERROR_NO_MORE_ITEMS
;
}
if
(
managed_count
&&
index
<=
machine_count
+
managed_count
)
if
(
managed_count
&&
index
<=
machine_count
+
managed_count
)
{
{
...
@@ -1295,17 +1288,13 @@ UINT WINAPI MsiEnumProductsW(DWORD index, LPWSTR lpguid)
...
@@ -1295,17 +1288,13 @@ UINT WINAPI MsiEnumProductsW(DWORD index, LPWSTR lpguid)
}
}
RegCloseKey
(
key
);
RegCloseKey
(
key
);
key
=
0
;
r
=
RegCreateKeyW
(
HKEY_CURRENT_USER
,
szUserProduct
,
&
key
);
r
=
RegCreateKeyW
(
HKEY_CURRENT_USER
,
szUserProduct
,
&
key
);
if
(
r
!=
ERROR_SUCCESS
)
if
(
r
!=
ERROR_SUCCESS
)
goto
failed
;
return
ERROR_NO_MORE_ITEMS
;
r
=
RegQueryInfoKeyW
(
key
,
NULL
,
NULL
,
NULL
,
&
unmanaged_count
,
NULL
,
NULL
,
r
=
RegQueryInfoKeyW
(
key
,
NULL
,
NULL
,
NULL
,
&
unmanaged_count
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
);
NULL
,
NULL
,
NULL
,
NULL
,
NULL
);
if
(
r
!=
ERROR_SUCCESS
)
if
(
r
!=
ERROR_SUCCESS
)
goto
failed
;
{
RegCloseKey
(
key
);
return
ERROR_NO_MORE_ITEMS
;
}
if
(
unmanaged_count
&&
index
<=
machine_count
+
managed_count
+
unmanaged_count
)
if
(
unmanaged_count
&&
index
<=
machine_count
+
managed_count
+
unmanaged_count
)
{
{
...
@@ -1318,8 +1307,9 @@ UINT WINAPI MsiEnumProductsW(DWORD index, LPWSTR lpguid)
...
@@ -1318,8 +1307,9 @@ UINT WINAPI MsiEnumProductsW(DWORD index, LPWSTR lpguid)
return
ERROR_SUCCESS
;
return
ERROR_SUCCESS
;
}
}
}
}
failed:
RegCloseKey
(
key
);
RegCloseKey
(
key
);
last_index
=
0
;
return
ERROR_NO_MORE_ITEMS
;
return
ERROR_NO_MORE_ITEMS
;
}
}
...
...
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