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
2b1ff010
Commit
2b1ff010
authored
Feb 17, 2010
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
version: Improve detection of builtin libraries.
parent
716358c5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
17 deletions
+13
-17
info.c
dlls/version/info.c
+9
-17
resource.c
dlls/version/resource.c
+4
-0
No files found.
dlls/version/info.c
View file @
2b1ff010
...
...
@@ -238,7 +238,7 @@ typedef struct
*/
DWORD
WINAPI
GetFileVersionInfoSizeW
(
LPCWSTR
filename
,
LPDWORD
handle
)
{
DWORD
len
,
offset
,
magic
=
0
;
DWORD
len
,
offset
,
magic
=
1
;
HFILE
lzfd
;
HMODULE
hModule
;
OFSTRUCT
ofs
;
...
...
@@ -263,7 +263,8 @@ DWORD WINAPI GetFileVersionInfoSizeW( LPCWSTR filename, LPDWORD handle )
magic
=
find_version_resource
(
lzfd
,
&
len
,
&
offset
);
LZClose
(
lzfd
);
}
else
if
((
hModule
=
LoadLibraryExW
(
filename
,
0
,
LOAD_LIBRARY_AS_DATAFILE
)))
if
((
magic
==
1
)
&&
(
hModule
=
LoadLibraryExW
(
filename
,
0
,
LOAD_LIBRARY_AS_DATAFILE
)))
{
HRSRC
hRsrc
=
FindResourceW
(
hModule
,
MAKEINTRESOURCEW
(
VS_VERSION_INFO
),
MAKEINTRESOURCEW
(
VS_FILE_INFO
)
);
...
...
@@ -274,11 +275,6 @@ DWORD WINAPI GetFileVersionInfoSizeW( LPCWSTR filename, LPDWORD handle )
}
FreeLibrary
(
hModule
);
}
else
{
SetLastError
(
ofs
.
nErrCode
);
return
0
;
}
switch
(
magic
)
{
...
...
@@ -306,7 +302,7 @@ DWORD WINAPI GetFileVersionInfoSizeW( LPCWSTR filename, LPDWORD handle )
return
(
len
*
2
)
+
4
;
default:
SetLastError
(
ERROR_RESOURCE_DATA_NOT_FOUND
);
SetLastError
(
lzfd
==
HFILE_ERROR
?
ofs
.
nErrCode
:
ERROR_RESOURCE_DATA_NOT_FOUND
);
return
0
;
}
}
...
...
@@ -340,7 +336,7 @@ BOOL WINAPI GetFileVersionInfoW( LPCWSTR filename, DWORD handle,
DWORD
datasize
,
LPVOID
data
)
{
static
const
char
signature
[
4
]
=
"FE2X"
;
DWORD
len
,
offset
,
magic
=
0
;
DWORD
len
,
offset
,
magic
=
1
;
HFILE
lzfd
;
OFSTRUCT
ofs
;
HMODULE
hModule
;
...
...
@@ -357,14 +353,15 @@ BOOL WINAPI GetFileVersionInfoW( LPCWSTR filename, DWORD handle,
if
((
lzfd
=
LZOpenFileW
(
(
LPWSTR
)
filename
,
&
ofs
,
OF_READ
))
!=
HFILE_ERROR
)
{
if
((
magic
=
find_version_resource
(
lzfd
,
&
len
,
&
offset
)))
if
((
magic
=
find_version_resource
(
lzfd
,
&
len
,
&
offset
))
>
1
)
{
LZSeek
(
lzfd
,
offset
,
0
/* SEEK_SET */
);
len
=
LZRead
(
lzfd
,
data
,
min
(
len
,
datasize
)
);
}
LZClose
(
lzfd
);
}
else
if
((
hModule
=
LoadLibraryExW
(
filename
,
0
,
LOAD_LIBRARY_AS_DATAFILE
)))
if
((
magic
==
1
)
&&
(
hModule
=
LoadLibraryExW
(
filename
,
0
,
LOAD_LIBRARY_AS_DATAFILE
)))
{
HRSRC
hRsrc
=
FindResourceW
(
hModule
,
MAKEINTRESOURCEW
(
VS_VERSION_INFO
),
MAKEINTRESOURCEW
(
VS_FILE_INFO
)
);
...
...
@@ -378,11 +375,6 @@ BOOL WINAPI GetFileVersionInfoW( LPCWSTR filename, DWORD handle,
}
FreeLibrary
(
hModule
);
}
else
{
SetLastError
(
ofs
.
nErrCode
);
return
FALSE
;
}
switch
(
magic
)
{
...
...
@@ -407,7 +399,7 @@ BOOL WINAPI GetFileVersionInfoW( LPCWSTR filename, DWORD handle,
return
TRUE
;
default:
SetLastError
(
ERROR_RESOURCE_DATA_NOT_FOUND
);
SetLastError
(
lzfd
==
HFILE_ERROR
?
ofs
.
nErrCode
:
ERROR_RESOURCE_DATA_NOT_FOUND
);
return
FALSE
;
}
}
...
...
dlls/version/resource.c
View file @
2b1ff010
...
...
@@ -101,7 +101,11 @@ static int read_xx_header( HFILE lzfd )
if
(
sizeof
(
mzh
)
!=
LZRead
(
lzfd
,
(
LPSTR
)
&
mzh
,
sizeof
(
mzh
)
)
)
return
0
;
if
(
mzh
.
e_magic
!=
IMAGE_DOS_SIGNATURE
)
{
if
(
!
memcmp
(
&
mzh
,
"
\177
ELF"
,
4
))
return
1
;
/* ELF */
if
(
*
(
UINT
*
)
&
mzh
==
0xfeedface
||
*
(
UINT
*
)
&
mzh
==
0xcefaedfe
)
return
1
;
/* Mach-O */
return
0
;
}
LZSeek
(
lzfd
,
mzh
.
e_lfanew
,
SEEK_SET
);
if
(
2
!=
LZRead
(
lzfd
,
magic
,
2
)
)
...
...
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