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
9643411c
Commit
9643411c
authored
Nov 21, 2008
by
Alistair Leslie-Hughes
Committed by
Alexandre Julliard
Nov 21, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
version: VerQueryValueA/W allow blank and NULL strings.
parent
01536b50
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
0 deletions
+21
-0
info.c
dlls/version/info.c
+7
-0
info.c
dlls/version/tests/info.c
+14
-0
No files found.
dlls/version/info.c
View file @
9643411c
...
...
@@ -777,6 +777,9 @@ BOOL WINAPI VerQueryValueA( LPCVOID pBlock, LPCSTR lpSubBlock,
if
(
!
pBlock
)
return
FALSE
;
if
(
lpSubBlock
==
NULL
||
lpSubBlock
[
0
]
==
'\0'
)
lpSubBlock
=
rootA
;
if
(
!
VersionInfoIs16
(
info
)
)
{
BOOL
ret
;
...
...
@@ -820,6 +823,7 @@ BOOL WINAPI VerQueryValueA( LPCVOID pBlock, LPCSTR lpSubBlock,
BOOL
WINAPI
VerQueryValueW
(
LPCVOID
pBlock
,
LPCWSTR
lpSubBlock
,
LPVOID
*
lplpBuffer
,
PUINT
puLen
)
{
static
const
WCHAR
nullW
[]
=
{
0
};
static
const
WCHAR
rootW
[]
=
{
'\\'
,
0
};
static
const
WCHAR
varfileinfoW
[]
=
{
'\\'
,
'V'
,
'a'
,
'r'
,
'F'
,
'i'
,
'l'
,
'e'
,
'I'
,
'n'
,
'f'
,
'o'
,
'\\'
,
'T'
,
'r'
,
'a'
,
'n'
,
's'
,
'l'
,
'a'
,
't'
,
'i'
,
'o'
,
'n'
,
0
};
...
...
@@ -832,6 +836,9 @@ BOOL WINAPI VerQueryValueW( LPCVOID pBlock, LPCWSTR lpSubBlock,
if
(
!
pBlock
)
return
FALSE
;
if
(
lpSubBlock
==
NULL
||
lpSubBlock
[
0
]
==
nullW
[
0
])
lpSubBlock
=
rootW
;
if
(
VersionInfoIs16
(
info
)
)
{
BOOL
ret
;
...
...
dlls/version/tests/info.c
View file @
9643411c
...
...
@@ -248,6 +248,13 @@ static void test_info(void)
if
(
!
boolret
)
goto
cleanup
;
boolret
=
VerQueryValueA
(
pVersionInfo
,
NULL
,
(
LPVOID
*
)
&
pFixedVersionInfo
,
&
uiLength
);
ok
(
boolret
||
GetLastError
()
==
NO_ERROR
/* Win98 */
,
"VerQueryValueA failed: GetLastError = %u
\n
"
,
GetLastError
());
boolret
=
VerQueryValueA
(
pVersionInfo
,
""
,
(
LPVOID
*
)
&
pFixedVersionInfo
,
&
uiLength
);
ok
(
boolret
,
"VerQueryValueA failed: GetLastError = %u
\n
"
,
GetLastError
());
boolret
=
VerQueryValueA
(
pVersionInfo
,
backslash
,
(
LPVOID
*
)
&
pFixedVersionInfo
,
&
uiLength
);
ok
(
boolret
,
"VerQueryValueA failed: GetLastError = %u
\n
"
,
GetLastError
());
if
(
!
boolret
)
...
...
@@ -286,6 +293,7 @@ static void test_32bit_win(void)
WCHAR
mypathW
[
MAX_PATH
];
char
rootA
[]
=
"
\\
"
;
WCHAR
rootW
[]
=
{
'\\'
,
0
};
WCHAR
emptyW
[]
=
{
0
};
char
varfileinfoA
[]
=
"
\\
VarFileInfo
\\
Translation"
;
WCHAR
varfileinfoW
[]
=
{
'\\'
,
'V'
,
'a'
,
'r'
,
'F'
,
'i'
,
'l'
,
'e'
,
'I'
,
'n'
,
'f'
,
'o'
,
'\\'
,
'T'
,
'r'
,
'a'
,
'n'
,
's'
,
'l'
,
'a'
,
't'
,
'i'
,
'o'
,
'n'
,
0
};
...
...
@@ -392,6 +400,12 @@ static void test_32bit_win(void)
if
(
is_unicode_enabled
)
{
retW
=
VerQueryValueW
(
pVersionInfoW
,
NULL
,
(
LPVOID
*
)
&
pBufW
,
&
uiLengthW
);
ok
(
retW
,
"VerQueryValueW failed: GetLastError = %u
\n
"
,
GetLastError
());
retW
=
VerQueryValueW
(
pVersionInfoW
,
emptyW
,
(
LPVOID
*
)
&
pBufW
,
&
uiLengthW
);
ok
(
retW
,
"VerQueryValueW failed: GetLastError = %u
\n
"
,
GetLastError
());
retW
=
VerQueryValueW
(
pVersionInfoW
,
rootW
,
(
LPVOID
*
)
&
pBufW
,
&
uiLengthW
);
ok
(
retW
,
"VerQueryValueW failed: GetLastError = %u
\n
"
,
GetLastError
());
ok
(
uiLengthA
==
sizeof
(
VS_FIXEDFILEINFO
),
"Size (%d) doesn't match the size of the VS_FIXEDFILEINFO struct
\n
"
,
uiLengthA
);
...
...
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