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
5d46eeac
Commit
5d46eeac
authored
Feb 04, 2008
by
James Hawkins
Committed by
Alexandre Julliard
Feb 05, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Only convert output strings if the call succeeded.
parent
8079d9f2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
38 deletions
+26
-38
msi.c
dlls/msi/msi.c
+2
-2
msi.c
dlls/msi/tests/msi.c
+24
-36
No files found.
dlls/msi/msi.c
View file @
5d46eeac
...
...
@@ -1543,10 +1543,10 @@ UINT WINAPI MsiGetFileVersionA(LPCSTR szFilePath, LPSTR lpVersionBuf,
ret
=
MsiGetFileVersionW
(
szwFilePath
,
lpwVersionBuff
,
pcchVersionBuf
,
lpwLangBuff
,
pcchLangBuf
);
if
(
lpwVersionBuff
)
if
(
(
ret
==
ERROR_SUCCESS
||
ret
==
ERROR_MORE_DATA
)
&&
lpwVersionBuff
)
WideCharToMultiByte
(
CP_ACP
,
0
,
lpwVersionBuff
,
-
1
,
lpVersionBuf
,
*
pcchVersionBuf
,
NULL
,
NULL
);
if
(
lpwLangBuff
)
if
(
(
ret
==
ERROR_SUCCESS
||
ret
==
ERROR_MORE_DATA
)
&&
lpwLangBuff
)
WideCharToMultiByte
(
CP_ACP
,
0
,
lpwLangBuff
,
-
1
,
lpLangBuf
,
*
pcchLangBuf
,
NULL
,
NULL
);
...
...
dlls/msi/tests/msi.c
View file @
5d46eeac
...
...
@@ -1834,15 +1834,12 @@ static void test_MsiGetFileVersion(void)
r
=
MsiGetFileVersionA
(
NULL
,
version
,
&
versz
,
lang
,
&
langsz
);
ok
(
r
==
ERROR_INVALID_PARAMETER
,
"Expected ERROR_INVALID_PARAMETER, got %d
\n
"
,
r
);
ok
(
!
lstrcmpA
(
version
,
"version"
),
"Expected version to be unchanged, got %s
\n
"
,
version
);
ok
(
versz
==
MAX_PATH
,
"Expected %d, got %d
\n
"
,
MAX_PATH
,
versz
);
ok
(
!
lstrcmpA
(
lang
,
"lang"
),
"Expected lang to be unchanged, got %s
\n
"
,
lang
);
ok
(
langsz
==
MAX_PATH
,
"Expected %d, got %d
\n
"
,
MAX_PATH
,
langsz
);
todo_wine
{
ok
(
!
lstrcmpA
(
version
,
"version"
),
"Expected version to be unchanged, got %s
\n
"
,
version
);
ok
(
!
lstrcmpA
(
lang
,
"lang"
),
"Expected lang to be unchanged, got %s
\n
"
,
lang
);
}
/* empty szFilePath */
versz
=
MAX_PATH
;
...
...
@@ -1850,16 +1847,16 @@ static void test_MsiGetFileVersion(void)
lstrcpyA
(
version
,
"version"
);
lstrcpyA
(
lang
,
"lang"
);
r
=
MsiGetFileVersionA
(
""
,
version
,
&
versz
,
lang
,
&
langsz
);
ok
(
!
lstrcmpA
(
version
,
"version"
),
"Expected version to be unchanged, got %s
\n
"
,
version
);
ok
(
versz
==
MAX_PATH
,
"Expected %d, got %d
\n
"
,
MAX_PATH
,
versz
);
ok
(
!
lstrcmpA
(
lang
,
"lang"
),
"Expected lang to be unchanged, got %s
\n
"
,
lang
);
ok
(
langsz
==
MAX_PATH
,
"Expected %d, got %d
\n
"
,
MAX_PATH
,
langsz
);
todo_wine
{
ok
(
r
==
ERROR_FILE_NOT_FOUND
,
"Expected ERROR_FILE_NOT_FOUND, got %d
\n
"
,
r
);
ok
(
!
lstrcmpA
(
version
,
"version"
),
"Expected version to be unchanged, got %s
\n
"
,
version
);
ok
(
!
lstrcmpA
(
lang
,
"lang"
),
"Expected lang to be unchanged, got %s
\n
"
,
lang
);
}
/* nonexistent szFilePath */
...
...
@@ -1870,15 +1867,12 @@ static void test_MsiGetFileVersion(void)
r
=
MsiGetFileVersionA
(
"nonexistent"
,
version
,
&
versz
,
lang
,
&
langsz
);
ok
(
r
==
ERROR_FILE_NOT_FOUND
,
"Expected ERROR_FILE_NOT_FOUND, got %d
\n
"
,
r
);
ok
(
!
lstrcmpA
(
version
,
"version"
),
"Expected version to be unchanged, got %s
\n
"
,
version
);
ok
(
versz
==
MAX_PATH
,
"Expected %d, got %d
\n
"
,
MAX_PATH
,
versz
);
ok
(
!
lstrcmpA
(
lang
,
"lang"
),
"Expected lang to be unchanged, got %s
\n
"
,
lang
);
ok
(
langsz
==
MAX_PATH
,
"Expected %d, got %d
\n
"
,
MAX_PATH
,
langsz
);
todo_wine
{
ok
(
!
lstrcmpA
(
version
,
"version"
),
"Expected version to be unchanged, got %s
\n
"
,
version
);
ok
(
!
lstrcmpA
(
lang
,
"lang"
),
"Expected lang to be unchanged, got %s
\n
"
,
lang
);
}
/* nonexistent szFilePath, valid lpVersionBuf, NULL pcchVersionBuf */
versz
=
MAX_PATH
;
...
...
@@ -1889,13 +1883,13 @@ static void test_MsiGetFileVersion(void)
ok
(
!
lstrcmpA
(
version
,
"version"
),
"Expected version to be unchanged, got %s
\n
"
,
version
);
ok
(
versz
==
MAX_PATH
,
"Expected %d, got %d
\n
"
,
MAX_PATH
,
versz
);
ok
(
!
lstrcmpA
(
lang
,
"lang"
),
"Expected lang to be unchanged, got %s
\n
"
,
lang
);
ok
(
langsz
==
MAX_PATH
,
"Expected %d, got %d
\n
"
,
MAX_PATH
,
langsz
);
todo_wine
{
ok
(
r
==
ERROR_INVALID_PARAMETER
,
"Expected ERROR_INVALID_PARAMETER, got %d
\n
"
,
r
);
ok
(
!
lstrcmpA
(
lang
,
"lang"
),
"Expected lang to be unchanged, got %s
\n
"
,
lang
);
}
/* nonexistent szFilePath, valid lpLangBuf, NULL pcchLangBuf */
...
...
@@ -1904,6 +1898,8 @@ static void test_MsiGetFileVersion(void)
lstrcpyA
(
version
,
"version"
);
lstrcpyA
(
lang
,
"lang"
);
r
=
MsiGetFileVersionA
(
"nonexistent"
,
version
,
&
versz
,
lang
,
NULL
);
ok
(
!
lstrcmpA
(
version
,
"version"
),
"Expected version to be unchanged, got %s
\n
"
,
version
);
ok
(
versz
==
MAX_PATH
,
"Expected %d, got %d
\n
"
,
MAX_PATH
,
versz
);
ok
(
!
lstrcmpA
(
lang
,
"lang"
),
"Expected lang to be unchanged, got %s
\n
"
,
lang
);
...
...
@@ -1912,8 +1908,6 @@ static void test_MsiGetFileVersion(void)
{
ok
(
r
==
ERROR_INVALID_PARAMETER
,
"Expected ERROR_INVALID_PARAMETER, got %d
\n
"
,
r
);
ok
(
!
lstrcmpA
(
version
,
"version"
),
"Expected version to be unchanged, got %s
\n
"
,
version
);
}
/* nonexistent szFilePath, valid lpVersionBuf, pcchVersionBuf is zero */
...
...
@@ -1927,12 +1921,9 @@ static void test_MsiGetFileVersion(void)
ok
(
!
lstrcmpA
(
version
,
"version"
),
"Expected version to be unchanged, got %s
\n
"
,
version
);
ok
(
versz
==
0
,
"Expected 0, got %d
\n
"
,
versz
);
ok
(
!
lstrcmpA
(
lang
,
"lang"
),
"Expected lang to be unchanged, got %s
\n
"
,
lang
);
ok
(
langsz
==
MAX_PATH
,
"Expected %d, got %d
\n
"
,
MAX_PATH
,
langsz
);
todo_wine
{
ok
(
!
lstrcmpA
(
lang
,
"lang"
),
"Expected lang to be unchanged, got %s
\n
"
,
lang
);
}
/* nonexistent szFilePath, valid lpLangBuf, pcchLangBuf is zero */
versz
=
MAX_PATH
;
...
...
@@ -1942,15 +1933,12 @@ static void test_MsiGetFileVersion(void)
r
=
MsiGetFileVersionA
(
"nonexistent"
,
version
,
&
versz
,
lang
,
&
langsz
);
ok
(
r
==
ERROR_FILE_NOT_FOUND
,
"Expected ERROR_FILE_NOT_FOUND, got %d
\n
"
,
r
);
ok
(
!
lstrcmpA
(
version
,
"version"
),
"Expected version to be unchanged, got %s
\n
"
,
version
);
ok
(
versz
==
MAX_PATH
,
"Expected %d, got %d
\n
"
,
MAX_PATH
,
versz
);
ok
(
!
lstrcmpA
(
lang
,
"lang"
),
"Expected lang to be unchanged, got %s
\n
"
,
lang
);
ok
(
langsz
==
0
,
"Expected 0, got %d
\n
"
,
langsz
);
todo_wine
{
ok
(
!
lstrcmpA
(
version
,
"version"
),
"Expected version to be unchanged, got %s
\n
"
,
version
);
}
/* nonexistent szFilePath, rest NULL */
r
=
MsiGetFileVersionA
(
"nonexistent"
,
NULL
,
NULL
,
NULL
,
NULL
);
...
...
@@ -1966,15 +1954,15 @@ static void test_MsiGetFileVersion(void)
lstrcpyA
(
lang
,
"lang"
);
r
=
MsiGetFileVersionA
(
"ver.txt"
,
version
,
&
versz
,
lang
,
&
langsz
);
ok
(
versz
==
MAX_PATH
,
"Expected %d, got %d
\n
"
,
MAX_PATH
,
versz
);
ok
(
!
lstrcmpA
(
version
,
"version"
),
"Expected version to be unchanged, got %s
\n
"
,
version
);
ok
(
langsz
==
MAX_PATH
,
"Expected %d, got %d
\n
"
,
MAX_PATH
,
langsz
);
ok
(
!
lstrcmpA
(
lang
,
"lang"
),
"Expected lang to be unchanged, got %s
\n
"
,
lang
);
todo_wine
{
ok
(
r
==
ERROR_FILE_INVALID
,
"Expected ERROR_FILE_INVALID, got %d
\n
"
,
r
);
ok
(
!
lstrcmpA
(
version
,
"version"
),
"Expected version to be unchanged, got %s
\n
"
,
version
);
ok
(
!
lstrcmpA
(
lang
,
"lang"
),
"Expected lang to be unchanged, got %s
\n
"
,
lang
);
}
DeleteFileA
(
"ver.txt"
);
...
...
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