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
972c61d3
Commit
972c61d3
authored
Feb 04, 2008
by
James Hawkins
Committed by
Alexandre Julliard
Feb 05, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
version: Return ERROR_RESOURCE_DATA_NOT_FOUND if the file does not have version information.
parent
ea41e863
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
0 deletions
+29
-0
info.c
dlls/version/info.c
+4
-0
info.c
dlls/version/tests/info.c
+25
-0
No files found.
dlls/version/info.c
View file @
972c61d3
...
@@ -252,6 +252,10 @@ static DWORD VERSION_GetFileVersionInfo_PE( LPCWSTR filename, DWORD datasize, LP
...
@@ -252,6 +252,10 @@ static DWORD VERSION_GetFileVersionInfo_PE( LPCWSTR filename, DWORD datasize, LP
if
(
!
hModule
)
if
(
!
hModule
)
{
{
WARN
(
"Could not load %s
\n
"
,
debugstr_w
(
filename
));
WARN
(
"Could not load %s
\n
"
,
debugstr_w
(
filename
));
if
(
GetLastError
()
==
ERROR_BAD_EXE_FORMAT
)
return
0xFFFFFFFF
;
return
0
;
return
0
;
}
}
hRsrc
=
FindResourceW
(
hModule
,
hRsrc
=
FindResourceW
(
hModule
,
...
...
dlls/version/tests/info.c
View file @
972c61d3
...
@@ -44,6 +44,18 @@
...
@@ -44,6 +44,18 @@
"ERROR_PATH_NOT_FOUND (NT4)/ERROR_FILE_NOT_FOUND (2k3)" \
"ERROR_PATH_NOT_FOUND (NT4)/ERROR_FILE_NOT_FOUND (2k3)" \
"expected, got %u\n", GetLastError());
"expected, got %u\n", GetLastError());
static
void
create_file
(
const
CHAR
*
name
)
{
HANDLE
file
;
DWORD
written
;
file
=
CreateFileA
(
name
,
GENERIC_WRITE
,
0
,
NULL
,
CREATE_ALWAYS
,
0
,
NULL
);
ok
(
file
!=
INVALID_HANDLE_VALUE
,
"Failure to open file %s
\n
"
,
name
);
WriteFile
(
file
,
name
,
strlen
(
name
),
&
written
,
NULL
);
WriteFile
(
file
,
"
\n
"
,
strlen
(
"
\n
"
),
&
written
,
NULL
);
CloseHandle
(
file
);
}
static
void
test_info_size
(
void
)
static
void
test_info_size
(
void
)
{
DWORD
hdl
,
retval
;
{
DWORD
hdl
,
retval
;
char
mypath
[
MAX_PATH
]
=
""
;
char
mypath
[
MAX_PATH
]
=
""
;
...
@@ -153,6 +165,19 @@ static void test_info_size(void)
...
@@ -153,6 +165,19 @@ static void test_info_size(void)
}
}
else
else
trace
(
"skipping GetModuleFileNameA(NULL,..) failed
\n
"
);
trace
(
"skipping GetModuleFileNameA(NULL,..) failed
\n
"
);
create_file
(
"test.txt"
);
/* no version info */
SetLastError
(
0xdeadbeef
);
hdl
=
0xcafe
;
retval
=
GetFileVersionInfoSizeA
(
"test.txt"
,
&
hdl
);
ok
(
retval
==
0
,
"Expected 0, got %d
\n
"
,
retval
);
ok
(
hdl
==
0
,
"Expected 0, got %d
\n
"
,
hdl
);
ok
(
GetLastError
()
==
ERROR_RESOURCE_DATA_NOT_FOUND
,
"Expected ERROR_RESOURCE_DATA_NOT_FOUND, got %d
\n
"
,
GetLastError
());
DeleteFileA
(
"test.txt"
);
}
}
static
void
VersionDwordLong2String
(
DWORDLONG
Version
,
LPSTR
lpszVerString
)
static
void
VersionDwordLong2String
(
DWORDLONG
Version
,
LPSTR
lpszVerString
)
...
...
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