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
eb508e5a
Commit
eb508e5a
authored
Apr 18, 2019
by
Hans Leidekker
Committed by
Alexandre Julliard
Apr 18, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Fix architecture handling in the AppSearch action.
Signed-off-by:
Hans Leidekker
<
hans@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
fcb27846
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
3 deletions
+41
-3
appsearch.c
dlls/msi/appsearch.c
+5
-2
package.c
dlls/msi/tests/package.c
+36
-1
No files found.
dlls/msi/appsearch.c
View file @
eb508e5a
...
@@ -372,6 +372,7 @@ static UINT search_reg( MSIPACKAGE *package, WCHAR **appValue, MSISIGNATURE *sig
...
@@ -372,6 +372,7 @@ static UINT search_reg( MSIPACKAGE *package, WCHAR **appValue, MSISIGNATURE *sig
const
WCHAR
*
keyPath
,
*
valueName
;
const
WCHAR
*
keyPath
,
*
valueName
;
WCHAR
*
deformatted
=
NULL
,
*
ptr
=
NULL
,
*
end
;
WCHAR
*
deformatted
=
NULL
,
*
ptr
=
NULL
,
*
end
;
int
root
,
type
;
int
root
,
type
;
REGSAM
access
=
KEY_READ
;
HKEY
rootKey
,
key
=
NULL
;
HKEY
rootKey
,
key
=
NULL
;
DWORD
sz
=
0
,
regType
;
DWORD
sz
=
0
,
regType
;
LPBYTE
value
=
NULL
;
LPBYTE
value
=
NULL
;
...
@@ -406,6 +407,8 @@ static UINT search_reg( MSIPACKAGE *package, WCHAR **appValue, MSISIGNATURE *sig
...
@@ -406,6 +407,8 @@ static UINT search_reg( MSIPACKAGE *package, WCHAR **appValue, MSISIGNATURE *sig
break
;
break
;
case
msidbRegistryRootLocalMachine
:
case
msidbRegistryRootLocalMachine
:
rootKey
=
HKEY_LOCAL_MACHINE
;
rootKey
=
HKEY_LOCAL_MACHINE
;
if
(
type
&
msidbLocatorType64bit
)
access
|=
KEY_WOW64_64KEY
;
else
access
|=
KEY_WOW64_32KEY
;
break
;
break
;
case
msidbRegistryRootUsers
:
case
msidbRegistryRootUsers
:
rootKey
=
HKEY_USERS
;
rootKey
=
HKEY_USERS
;
...
@@ -415,10 +418,10 @@ static UINT search_reg( MSIPACKAGE *package, WCHAR **appValue, MSISIGNATURE *sig
...
@@ -415,10 +418,10 @@ static UINT search_reg( MSIPACKAGE *package, WCHAR **appValue, MSISIGNATURE *sig
goto
end
;
goto
end
;
}
}
rc
=
RegOpenKey
W
(
rootKey
,
deformatted
,
&
key
);
rc
=
RegOpenKey
ExW
(
rootKey
,
deformatted
,
0
,
access
,
&
key
);
if
(
rc
)
if
(
rc
)
{
{
TRACE
(
"RegOpenKeyW returned %d
\n
"
,
rc
);
TRACE
(
"RegOpenKey
Ex
W returned %d
\n
"
,
rc
);
goto
end
;
goto
end
;
}
}
...
...
dlls/msi/tests/package.c
View file @
eb508e5a
...
@@ -4036,6 +4036,8 @@ static void test_appsearch(void)
...
@@ -4036,6 +4036,8 @@ static void test_appsearch(void)
add_appsearch_entry
(
hdb
,
"'WEBBROWSERPROG', 'NewSignature1'"
);
add_appsearch_entry
(
hdb
,
"'WEBBROWSERPROG', 'NewSignature1'"
);
add_appsearch_entry
(
hdb
,
"'NOTEPAD', 'NewSignature2'"
);
add_appsearch_entry
(
hdb
,
"'NOTEPAD', 'NewSignature2'"
);
add_appsearch_entry
(
hdb
,
"'REGEXPANDVAL', 'NewSignature3'"
);
add_appsearch_entry
(
hdb
,
"'REGEXPANDVAL', 'NewSignature3'"
);
add_appsearch_entry
(
hdb
,
"'32KEYVAL', 'NewSignature4'"
);
add_appsearch_entry
(
hdb
,
"'64KEYVAL', 'NewSignature5'"
);
create_reglocator_table
(
hdb
);
create_reglocator_table
(
hdb
);
add_reglocator_entry
(
hdb
,
"NewSignature1"
,
0
,
"htmlfile
\\
shell
\\
open
\\
command"
,
""
,
1
);
add_reglocator_entry
(
hdb
,
"NewSignature1"
,
0
,
"htmlfile
\\
shell
\\
open
\\
command"
,
""
,
1
);
...
@@ -4045,7 +4047,26 @@ static void test_appsearch(void)
...
@@ -4045,7 +4047,26 @@ static void test_appsearch(void)
r
=
RegSetValueExA
(
hkey
,
NULL
,
0
,
REG_EXPAND_SZ
,
(
const
BYTE
*
)
reg_expand_value
,
strlen
(
reg_expand_value
)
+
1
);
r
=
RegSetValueExA
(
hkey
,
NULL
,
0
,
REG_EXPAND_SZ
,
(
const
BYTE
*
)
reg_expand_value
,
strlen
(
reg_expand_value
)
+
1
);
ok
(
r
==
ERROR_SUCCESS
,
"Could not set key value: %d.
\n
"
,
r
);
ok
(
r
==
ERROR_SUCCESS
,
"Could not set key value: %d.
\n
"
,
r
);
RegCloseKey
(
hkey
);
RegCloseKey
(
hkey
);
add_reglocator_entry
(
hdb
,
"NewSignature3"
,
1
,
"Software
\\
Winetest_msi"
,
""
,
1
);
add_reglocator_entry
(
hdb
,
"NewSignature3"
,
1
,
"Software
\\
Winetest_msi"
,
""
,
msidbLocatorTypeFileName
);
r
=
RegCreateKeyExA
(
HKEY_LOCAL_MACHINE
,
"Software
\\
Winetest_msi"
,
0
,
NULL
,
0
,
KEY_ALL_ACCESS
|
KEY_WOW64_32KEY
,
NULL
,
&
hkey
,
NULL
);
ok
(
r
==
ERROR_SUCCESS
,
"Could not create key: %d.
\n
"
,
r
);
r
=
RegSetValueExA
(
hkey
,
NULL
,
0
,
REG_SZ
,
(
const
BYTE
*
)
"c:
\\
windows
\\
system32
\\
notepad.exe"
,
sizeof
(
"c:
\\
windows
\\
system32
\\
notepad.exe"
));
ok
(
r
==
ERROR_SUCCESS
,
"Could not set key value: %d.
\n
"
,
r
);
RegCloseKey
(
hkey
);
add_reglocator_entry
(
hdb
,
"NewSignature4"
,
2
,
"Software
\\
Winetest_msi"
,
""
,
msidbLocatorTypeFileName
);
r
=
RegCreateKeyExA
(
HKEY_LOCAL_MACHINE
,
"Software
\\
Winetest_msi"
,
0
,
NULL
,
0
,
KEY_ALL_ACCESS
|
KEY_WOW64_64KEY
,
NULL
,
&
hkey
,
NULL
);
ok
(
r
==
ERROR_SUCCESS
,
"Could not create key: %d.
\n
"
,
r
);
r
=
RegSetValueExA
(
hkey
,
NULL
,
0
,
REG_SZ
,
(
const
BYTE
*
)
"c:
\\
windows
\\
system32
\\
notepad.exe"
,
sizeof
(
"c:
\\
windows
\\
system32
\\
notepad.exe"
));
ok
(
r
==
ERROR_SUCCESS
,
"Could not set key value: %d.
\n
"
,
r
);
RegCloseKey
(
hkey
);
add_reglocator_entry
(
hdb
,
"NewSignature5"
,
2
,
"Software
\\
Winetest_msi"
,
""
,
msidbLocatorTypeFileName
|
msidbLocatorType64bit
);
create_drlocator_table
(
hdb
);
create_drlocator_table
(
hdb
);
add_drlocator_entry
(
hdb
,
"'NewSignature2', 0, 'c:
\\
windows
\\
system32', 0"
);
add_drlocator_entry
(
hdb
,
"'NewSignature2', 0, 'c:
\\
windows
\\
system32', 0"
);
...
@@ -4054,6 +4075,8 @@ static void test_appsearch(void)
...
@@ -4054,6 +4075,8 @@ static void test_appsearch(void)
add_signature_entry
(
hdb
,
"'NewSignature1', 'FileName', '', '', '', '', '', '', ''"
);
add_signature_entry
(
hdb
,
"'NewSignature1', 'FileName', '', '', '', '', '', '', ''"
);
add_signature_entry
(
hdb
,
"'NewSignature2', 'NOTEPAD.EXE|notepad.exe', '', '', '', '', '', '', ''"
);
add_signature_entry
(
hdb
,
"'NewSignature2', 'NOTEPAD.EXE|notepad.exe', '', '', '', '', '', '', ''"
);
add_signature_entry
(
hdb
,
"'NewSignature3', 'NOTEPAD.EXE|notepad.exe', '', '', '', '', '', '', ''"
);
add_signature_entry
(
hdb
,
"'NewSignature3', 'NOTEPAD.EXE|notepad.exe', '', '', '', '', '', '', ''"
);
add_signature_entry
(
hdb
,
"'NewSignature4', 'NOTEPAD.EXE|notepad.exe', '', '', '', '', '', '', ''"
);
add_signature_entry
(
hdb
,
"'NewSignature5', 'NOTEPAD.EXE|notepad.exe', '', '', '', '', '', '', ''"
);
r
=
package_from_db
(
hdb
,
&
hpkg
);
r
=
package_from_db
(
hdb
,
&
hpkg
);
if
(
r
==
ERROR_INSTALL_PACKAGE_REJECTED
)
if
(
r
==
ERROR_INSTALL_PACKAGE_REJECTED
)
...
@@ -4086,10 +4109,22 @@ static void test_appsearch(void)
...
@@ -4086,10 +4109,22 @@ static void test_appsearch(void)
ok
(
r
==
ERROR_SUCCESS
,
"get property failed: %d
\n
"
,
r
);
ok
(
r
==
ERROR_SUCCESS
,
"get property failed: %d
\n
"
,
r
);
ok
(
lstrlenA
(
prop
)
!=
0
,
"Expected non-zero length
\n
"
);
ok
(
lstrlenA
(
prop
)
!=
0
,
"Expected non-zero length
\n
"
);
size
=
sizeof
(
prop
);
r
=
MsiGetPropertyA
(
hpkg
,
"32KEYVAL"
,
prop
,
&
size
);
ok
(
r
==
ERROR_SUCCESS
,
"get property failed: %d
\n
"
,
r
);
ok
(
lstrlenA
(
prop
)
!=
0
,
"Expected non-zero length
\n
"
);
size
=
sizeof
(
prop
);
r
=
MsiGetPropertyA
(
hpkg
,
"64KEYVAL"
,
prop
,
&
size
);
ok
(
r
==
ERROR_SUCCESS
,
"get property failed: %d
\n
"
,
r
);
ok
(
lstrlenA
(
prop
)
!=
0
,
"Expected non-zero length
\n
"
);
done:
done:
MsiCloseHandle
(
hpkg
);
MsiCloseHandle
(
hpkg
);
DeleteFileA
(
msifile
);
DeleteFileA
(
msifile
);
RegDeleteKeyA
(
HKEY_CURRENT_USER
,
"Software
\\
Winetest_msi"
);
RegDeleteKeyA
(
HKEY_CURRENT_USER
,
"Software
\\
Winetest_msi"
);
delete_key
(
HKEY_LOCAL_MACHINE
,
"Software
\\
Winetest_msi"
,
KEY_WOW64_32KEY
);
delete_key
(
HKEY_LOCAL_MACHINE
,
"Software
\\
Winetest_msi"
,
KEY_WOW64_64KEY
);
}
}
static
void
test_appsearch_complocator
(
void
)
static
void
test_appsearch_complocator
(
void
)
...
...
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