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
03335de8
Commit
03335de8
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: Return ERROR_INVALID_PARAMETER if a string pointer is non-NULL and the size pointer is NULL.
parent
856800c8
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
10 deletions
+12
-10
msi.c
dlls/msi/msi.c
+8
-0
msi.c
dlls/msi/tests/msi.c
+4
-10
No files found.
dlls/msi/msi.c
View file @
03335de8
...
@@ -1519,6 +1519,10 @@ UINT WINAPI MsiGetFileVersionA(LPCSTR szFilePath, LPSTR lpVersionBuf,
...
@@ -1519,6 +1519,10 @@ UINT WINAPI MsiGetFileVersionA(LPCSTR szFilePath, LPSTR lpVersionBuf,
LPWSTR
szwFilePath
=
NULL
,
lpwVersionBuff
=
NULL
,
lpwLangBuff
=
NULL
;
LPWSTR
szwFilePath
=
NULL
,
lpwVersionBuff
=
NULL
,
lpwLangBuff
=
NULL
;
UINT
ret
=
ERROR_OUTOFMEMORY
;
UINT
ret
=
ERROR_OUTOFMEMORY
;
if
((
lpVersionBuf
&&
!
pcchVersionBuf
)
||
(
lpLangBuf
&&
!
pcchLangBuf
))
return
ERROR_INVALID_PARAMETER
;
if
(
szFilePath
)
if
(
szFilePath
)
{
{
szwFilePath
=
strdupAtoW
(
szFilePath
);
szwFilePath
=
strdupAtoW
(
szFilePath
);
...
@@ -1579,6 +1583,10 @@ UINT WINAPI MsiGetFileVersionW(LPCWSTR szFilePath, LPWSTR lpVersionBuf,
...
@@ -1579,6 +1583,10 @@ UINT WINAPI MsiGetFileVersionW(LPCWSTR szFilePath, LPWSTR lpVersionBuf,
lpVersionBuf
,
pcchVersionBuf
?*
pcchVersionBuf
:
0
,
lpVersionBuf
,
pcchVersionBuf
?*
pcchVersionBuf
:
0
,
lpLangBuf
,
pcchLangBuf
?*
pcchLangBuf
:
0
);
lpLangBuf
,
pcchLangBuf
?*
pcchLangBuf
:
0
);
if
((
lpVersionBuf
&&
!
pcchVersionBuf
)
||
(
lpLangBuf
&&
!
pcchLangBuf
))
return
ERROR_INVALID_PARAMETER
;
dwVerLen
=
GetFileVersionInfoSizeW
(
szFilePath
,
NULL
);
dwVerLen
=
GetFileVersionInfoSizeW
(
szFilePath
,
NULL
);
if
(
!
dwVerLen
)
if
(
!
dwVerLen
)
{
{
...
...
dlls/msi/tests/msi.c
View file @
03335de8
...
@@ -1877,17 +1877,14 @@ static void test_MsiGetFileVersion(void)
...
@@ -1877,17 +1877,14 @@ static void test_MsiGetFileVersion(void)
lstrcpyA
(
version
,
"version"
);
lstrcpyA
(
version
,
"version"
);
lstrcpyA
(
lang
,
"lang"
);
lstrcpyA
(
lang
,
"lang"
);
r
=
MsiGetFileVersionA
(
"nonexistent"
,
version
,
NULL
,
lang
,
&
langsz
);
r
=
MsiGetFileVersionA
(
"nonexistent"
,
version
,
NULL
,
lang
,
&
langsz
);
ok
(
r
==
ERROR_INVALID_PARAMETER
,
"Expected ERROR_INVALID_PARAMETER, got %d
\n
"
,
r
);
ok
(
!
lstrcmpA
(
version
,
"version"
),
ok
(
!
lstrcmpA
(
version
,
"version"
),
"Expected version to be unchanged, got %s
\n
"
,
version
);
"Expected version to be unchanged, got %s
\n
"
,
version
);
ok
(
versz
==
MAX_PATH
,
"Expected %d, got %d
\n
"
,
MAX_PATH
,
versz
);
ok
(
versz
==
MAX_PATH
,
"Expected %d, got %d
\n
"
,
MAX_PATH
,
versz
);
ok
(
!
lstrcmpA
(
lang
,
"lang"
),
ok
(
!
lstrcmpA
(
lang
,
"lang"
),
"Expected lang to be unchanged, got %s
\n
"
,
lang
);
"Expected lang to be unchanged, got %s
\n
"
,
lang
);
ok
(
langsz
==
MAX_PATH
,
"Expected %d, got %d
\n
"
,
MAX_PATH
,
langsz
);
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
);
}
/* nonexistent szFilePath, valid lpLangBuf, NULL pcchLangBuf */
/* nonexistent szFilePath, valid lpLangBuf, NULL pcchLangBuf */
versz
=
MAX_PATH
;
versz
=
MAX_PATH
;
...
@@ -1895,17 +1892,14 @@ static void test_MsiGetFileVersion(void)
...
@@ -1895,17 +1892,14 @@ static void test_MsiGetFileVersion(void)
lstrcpyA
(
version
,
"version"
);
lstrcpyA
(
version
,
"version"
);
lstrcpyA
(
lang
,
"lang"
);
lstrcpyA
(
lang
,
"lang"
);
r
=
MsiGetFileVersionA
(
"nonexistent"
,
version
,
&
versz
,
lang
,
NULL
);
r
=
MsiGetFileVersionA
(
"nonexistent"
,
version
,
&
versz
,
lang
,
NULL
);
ok
(
r
==
ERROR_INVALID_PARAMETER
,
"Expected ERROR_INVALID_PARAMETER, got %d
\n
"
,
r
);
ok
(
!
lstrcmpA
(
version
,
"version"
),
ok
(
!
lstrcmpA
(
version
,
"version"
),
"Expected version to be unchanged, got %s
\n
"
,
version
);
"Expected version to be unchanged, got %s
\n
"
,
version
);
ok
(
versz
==
MAX_PATH
,
"Expected %d, got %d
\n
"
,
MAX_PATH
,
versz
);
ok
(
versz
==
MAX_PATH
,
"Expected %d, got %d
\n
"
,
MAX_PATH
,
versz
);
ok
(
!
lstrcmpA
(
lang
,
"lang"
),
ok
(
!
lstrcmpA
(
lang
,
"lang"
),
"Expected lang to be unchanged, got %s
\n
"
,
lang
);
"Expected lang to be unchanged, got %s
\n
"
,
lang
);
ok
(
langsz
==
MAX_PATH
,
"Expected %d, got %d
\n
"
,
MAX_PATH
,
langsz
);
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
);
}
/* nonexistent szFilePath, valid lpVersionBuf, pcchVersionBuf is zero */
/* nonexistent szFilePath, valid lpVersionBuf, pcchVersionBuf is zero */
versz
=
0
;
versz
=
0
;
...
...
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