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
8b540d26
Commit
8b540d26
authored
Feb 24, 2008
by
James Hawkins
Committed by
Alexandre Julliard
Feb 25, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Fix the INSTALLPROPERTY_LASTUSEDTYPE case.
parent
737dedfc
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
73 deletions
+41
-73
source.c
dlls/msi/source.c
+20
-31
install.c
dlls/msi/tests/install.c
+3
-6
source.c
dlls/msi/tests/source.c
+18
-36
No files found.
dlls/msi/source.c
View file @
8b540d26
...
...
@@ -402,7 +402,8 @@ UINT WINAPI MsiSourceListGetInfoW( LPCWSTR szProduct, LPCWSTR szUserSid,
RegQueryValueExW
(
media
,
szProperty
,
0
,
0
,
(
LPBYTE
)
szValue
,
pcchValue
);
RegCloseKey
(
media
);
}
else
if
(
!
lstrcmpW
(
szProperty
,
INSTALLPROPERTY_LASTUSEDSOURCEW
))
else
if
(
!
lstrcmpW
(
szProperty
,
INSTALLPROPERTY_LASTUSEDSOURCEW
)
||
!
lstrcmpW
(
szProperty
,
INSTALLPROPERTY_LASTUSEDTYPEW
))
{
rc
=
RegQueryValueExW
(
sourcekey
,
INSTALLPROPERTY_LASTUSEDSOURCEW
,
0
,
0
,
NULL
,
&
size
);
...
...
@@ -423,11 +424,26 @@ UINT WINAPI MsiSourceListGetInfoW( LPCWSTR szProduct, LPCWSTR szUserSid,
return
ERROR_SUCCESS
;
}
ptr
=
strrchrW
(
source
,
';'
);
if
(
!
ptr
)
if
(
!
lstrcmpW
(
szProperty
,
INSTALLPROPERTY_LASTUSEDTYPEW
))
{
if
(
*
source
!=
'n'
&&
*
source
!=
'u'
&&
*
source
!=
'm'
)
{
msi_free
(
source
);
RegCloseKey
(
sourcekey
);
return
ERROR_SUCCESS
;
}
ptr
=
source
;
source
[
1
]
=
'\0'
;
}
else
ptr
++
;
{
ptr
=
strrchrW
(
source
,
';'
);
if
(
!
ptr
)
ptr
=
source
;
else
ptr
++
;
}
if
(
szValue
)
{
...
...
@@ -440,33 +456,6 @@ UINT WINAPI MsiSourceListGetInfoW( LPCWSTR szProduct, LPCWSTR szUserSid,
*
pcchValue
=
lstrlenW
(
ptr
);
msi_free
(
source
);
}
else
if
(
strcmpW
(
INSTALLPROPERTY_LASTUSEDTYPEW
,
szProperty
)
==
0
)
{
LPWSTR
buffer
;
DWORD
size
=
0
;
RegQueryValueExW
(
sourcekey
,
INSTALLPROPERTY_LASTUSEDSOURCEW
,
0
,
0
,
NULL
,
&
size
);
if
(
size
==
0
)
rc
=
ERROR_UNKNOWN_PROPERTY
;
else
{
buffer
=
msi_alloc
(
size
);
rc
=
RegQueryValueExW
(
sourcekey
,
INSTALLPROPERTY_LASTUSEDSOURCEW
,
0
,
0
,
(
LPBYTE
)
buffer
,
&
size
);
if
(
*
pcchValue
<
1
)
{
rc
=
ERROR_MORE_DATA
;
*
pcchValue
=
1
;
}
else
{
szValue
[
0
]
=
buffer
[
0
];
rc
=
ERROR_SUCCESS
;
}
msi_free
(
buffer
);
}
}
else
if
(
strcmpW
(
INSTALLPROPERTY_PACKAGENAMEW
,
szProperty
)
==
0
)
{
*
pcchValue
=
*
pcchValue
*
sizeof
(
WCHAR
);
...
...
dlls/msi/tests/install.c
View file @
8b540d26
...
...
@@ -3025,12 +3025,9 @@ static void test_publishsourcelist(void)
lstrcpyA
(
value
,
"aaa"
);
r
=
pMsiSourceListGetInfoA
(
prodcode
,
NULL
,
MSIINSTALLCONTEXT_USERUNMANAGED
,
MSICODE_PRODUCT
,
INSTALLPROPERTY_LASTUSEDTYPE
,
value
,
&
size
);
todo_wine
{
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
!
lstrcmpA
(
value
,
"n"
),
"Expected
\"
n
\"
, got
\"
%s
\"\n
"
,
value
);
ok
(
size
==
1
,
"Expected 1, got %d
\n
"
,
size
);
}
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
!
lstrcmpA
(
value
,
"n"
),
"Expected
\"
n
\"
, got
\"
%s
\"\n
"
,
value
);
ok
(
size
==
1
,
"Expected 1, got %d
\n
"
,
size
);
size
=
MAX_PATH
;
lstrcpyA
(
value
,
"aaa"
);
...
...
dlls/msi/tests/source.c
View file @
8b540d26
...
...
@@ -454,12 +454,9 @@ static void test_MsiSourceListGetInfo(void)
r
=
pMsiSourceListGetInfoA
(
prodcode
,
usersid
,
MSIINSTALLCONTEXT_USERUNMANAGED
,
MSICODE_PRODUCT
,
INSTALLPROPERTY_LASTUSEDTYPE
,
value
,
&
size
);
todo_wine
{
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
!
lstrcmpA
(
value
,
""
),
"Expected
\"\"
, got
\"
%s
\"\n
"
,
value
);
ok
(
size
==
0
,
"Expected 0, got %d
\n
"
,
size
);
}
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
!
lstrcmpA
(
value
,
""
),
"Expected
\"\"
, got
\"
%s
\"\n
"
,
value
);
ok
(
size
==
0
,
"Expected 0, got %d
\n
"
,
size
);
data
=
"x;y;z"
;
res
=
RegSetValueExA
(
hkey
,
"LastUsedSource"
,
0
,
REG_SZ
,
...
...
@@ -471,12 +468,9 @@ static void test_MsiSourceListGetInfo(void)
r
=
pMsiSourceListGetInfoA
(
prodcode
,
usersid
,
MSIINSTALLCONTEXT_USERUNMANAGED
,
MSICODE_PRODUCT
,
INSTALLPROPERTY_LASTUSEDTYPE
,
value
,
&
size
);
todo_wine
{
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
!
lstrcmpA
(
value
,
""
),
"Expected
\"\"
, got
\"
%s
\"\n
"
,
value
);
ok
(
size
==
0
,
"Expected 0, got %d
\n
"
,
size
);
}
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
!
lstrcmpA
(
value
,
""
),
"Expected
\"\"
, got
\"
%s
\"\n
"
,
value
);
ok
(
size
==
0
,
"Expected 0, got %d
\n
"
,
size
);
data
=
"n;y;z"
;
res
=
RegSetValueExA
(
hkey
,
"LastUsedSource"
,
0
,
REG_SZ
,
...
...
@@ -488,12 +482,9 @@ static void test_MsiSourceListGetInfo(void)
r
=
pMsiSourceListGetInfoA
(
prodcode
,
usersid
,
MSIINSTALLCONTEXT_USERUNMANAGED
,
MSICODE_PRODUCT
,
INSTALLPROPERTY_LASTUSEDTYPE
,
value
,
&
size
);
todo_wine
{
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
!
lstrcmpA
(
value
,
"n"
),
"Expected
\"
n
\"
, got
\"
%s
\"\n
"
,
value
);
ok
(
size
==
1
,
"Expected 1, got %d
\n
"
,
size
);
}
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
!
lstrcmpA
(
value
,
"n"
),
"Expected
\"
n
\"
, got
\"
%s
\"\n
"
,
value
);
ok
(
size
==
1
,
"Expected 1, got %d
\n
"
,
size
);
data
=
"negatory"
;
res
=
RegSetValueExA
(
hkey
,
"LastUsedSource"
,
0
,
REG_SZ
,
...
...
@@ -505,12 +496,9 @@ static void test_MsiSourceListGetInfo(void)
r
=
pMsiSourceListGetInfoA
(
prodcode
,
usersid
,
MSIINSTALLCONTEXT_USERUNMANAGED
,
MSICODE_PRODUCT
,
INSTALLPROPERTY_LASTUSEDTYPE
,
value
,
&
size
);
todo_wine
{
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
!
lstrcmpA
(
value
,
"n"
),
"Expected
\"
n
\"
, got
\"
%s
\"\n
"
,
value
);
ok
(
size
==
1
,
"Expected 1, got %d
\n
"
,
size
);
}
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
!
lstrcmpA
(
value
,
"n"
),
"Expected
\"
n
\"
, got
\"
%s
\"\n
"
,
value
);
ok
(
size
==
1
,
"Expected 1, got %d
\n
"
,
size
);
data
=
"megatron"
;
res
=
RegSetValueExA
(
hkey
,
"LastUsedSource"
,
0
,
REG_SZ
,
...
...
@@ -522,12 +510,9 @@ static void test_MsiSourceListGetInfo(void)
r
=
pMsiSourceListGetInfoA
(
prodcode
,
usersid
,
MSIINSTALLCONTEXT_USERUNMANAGED
,
MSICODE_PRODUCT
,
INSTALLPROPERTY_LASTUSEDTYPE
,
value
,
&
size
);
todo_wine
{
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
!
lstrcmpA
(
value
,
"m"
),
"Expected
\"
m
\"
, got
\"
%s
\"\n
"
,
value
);
ok
(
size
==
1
,
"Expected 1, got %d
\n
"
,
size
);
}
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
!
lstrcmpA
(
value
,
"m"
),
"Expected
\"
m
\"
, got
\"
%s
\"\n
"
,
value
);
ok
(
size
==
1
,
"Expected 1, got %d
\n
"
,
size
);
data
=
"useless"
;
res
=
RegSetValueExA
(
hkey
,
"LastUsedSource"
,
0
,
REG_SZ
,
...
...
@@ -539,12 +524,9 @@ static void test_MsiSourceListGetInfo(void)
r
=
pMsiSourceListGetInfoA
(
prodcode
,
usersid
,
MSIINSTALLCONTEXT_USERUNMANAGED
,
MSICODE_PRODUCT
,
INSTALLPROPERTY_LASTUSEDTYPE
,
value
,
&
size
);
todo_wine
{
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
!
lstrcmpA
(
value
,
"u"
),
"Expected
\"
u
\"
, got
\"
%s
\"\n
"
,
value
);
ok
(
size
==
1
,
"Expected 1, got %d
\n
"
,
size
);
}
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
!
lstrcmpA
(
value
,
"u"
),
"Expected
\"
u
\"
, got
\"
%s
\"\n
"
,
value
);
ok
(
size
==
1
,
"Expected 1, got %d
\n
"
,
size
);
RegDeleteValueA
(
media
,
"MediaPackage"
);
RegDeleteValueA
(
media
,
"DiskPrompt"
);
...
...
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