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
928104d3
Commit
928104d3
authored
Jun 25, 2019
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ver: Build with msvcrt.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
a8e5a610
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
18 deletions
+11
-18
Makefile.in
dlls/ver.dll16/Makefile.in
+1
-1
version.c
dlls/ver.dll16/version.c
+10
-17
No files found.
dlls/ver.dll16/Makefile.in
View file @
928104d3
MODULE
=
ver.dll16
IMPORTS
=
version lz32
EXTRADLLFLAGS
=
-m16
-Wb
,--main-module,version.dll
EXTRADLLFLAGS
=
-m16
-
mno-cygwin
-
Wb
,--main-module,version.dll
C_SRCS
=
version.c
dlls/ver.dll16/version.c
View file @
928104d3
...
...
@@ -32,17 +32,10 @@
#include "winternl.h"
#include "winver.h"
#include "lzexpand.h"
#include "wine/unicode.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
ver
);
#ifndef SEEK_SET
#define SEEK_SET 0
#define SEEK_CUR 1
#define SEEK_END 2
#endif
/**********************************************************************
* find_entry_by_id
*
...
...
@@ -121,7 +114,7 @@ static const IMAGE_RESOURCE_DIRECTORY *find_entry_by_name( const IMAGE_RESOURCE_
{
pos
=
(
min
+
max
)
/
2
;
str
=
(
const
IMAGE_RESOURCE_DIR_STRING_U
*
)((
const
char
*
)
root
+
entry
[
pos
].
u
.
s
.
NameOffset
);
res
=
strncmpiW
(
nameW
,
str
->
NameString
,
str
->
Length
);
res
=
wcsnicmp
(
nameW
,
str
->
NameString
,
str
->
Length
);
if
(
!
res
&&
namelen
==
str
->
Length
)
{
ret
=
(
const
IMAGE_RESOURCE_DIRECTORY
*
)((
const
char
*
)
root
+
entry
[
pos
].
u2
.
s2
.
OffsetToDirectory
);
...
...
@@ -144,17 +137,17 @@ static int read_xx_header( HFILE lzfd )
IMAGE_DOS_HEADER
mzh
;
char
magic
[
3
];
LZSeek
(
lzfd
,
0
,
SEEK_SET
);
LZSeek
(
lzfd
,
0
,
FILE_BEGIN
);
if
(
sizeof
(
mzh
)
!=
LZRead
(
lzfd
,
(
LPSTR
)
&
mzh
,
sizeof
(
mzh
)
)
)
return
0
;
if
(
mzh
.
e_magic
!=
IMAGE_DOS_SIGNATURE
)
return
0
;
LZSeek
(
lzfd
,
mzh
.
e_lfanew
,
SEEK_SET
);
LZSeek
(
lzfd
,
mzh
.
e_lfanew
,
FILE_BEGIN
);
if
(
2
!=
LZRead
(
lzfd
,
magic
,
2
)
)
return
0
;
LZSeek
(
lzfd
,
mzh
.
e_lfanew
,
SEEK_SET
);
LZSeek
(
lzfd
,
mzh
.
e_lfanew
,
FILE_BEGIN
);
if
(
magic
[
0
]
==
'N'
&&
magic
[
1
]
==
'E'
)
return
IMAGE_OS2_SIGNATURE
;
...
...
@@ -181,7 +174,7 @@ static BOOL find_ne_resource( HFILE lzfd, LPCSTR typeid, LPCSTR resid,
int
count
;
/* Read in NE header */
nehdoffset
=
LZSeek
(
lzfd
,
0
,
SEEK_CUR
);
nehdoffset
=
LZSeek
(
lzfd
,
0
,
FILE_CURRENT
);
if
(
sizeof
(
nehd
)
!=
LZRead
(
lzfd
,
(
LPSTR
)
&
nehd
,
sizeof
(
nehd
)
)
)
return
FALSE
;
resTabSize
=
nehd
.
ne_restab
-
nehd
.
ne_rsrctab
;
...
...
@@ -195,7 +188,7 @@ static BOOL find_ne_resource( HFILE lzfd, LPCSTR typeid, LPCSTR resid,
resTab
=
HeapAlloc
(
GetProcessHeap
(),
0
,
resTabSize
);
if
(
!
resTab
)
return
FALSE
;
LZSeek
(
lzfd
,
nehd
.
ne_rsrctab
+
nehdoffset
,
SEEK_SET
);
LZSeek
(
lzfd
,
nehd
.
ne_rsrctab
+
nehdoffset
,
FILE_BEGIN
);
if
(
resTabSize
!=
LZRead
(
lzfd
,
(
char
*
)
resTab
,
resTabSize
)
)
{
HeapFree
(
GetProcessHeap
(),
0
,
resTab
);
...
...
@@ -284,7 +277,7 @@ static BOOL find_pe_resource( HFILE lzfd, LPCSTR typeid, LPCSTR resid,
BOOL
ret
=
FALSE
;
/* Read in PE header */
pehdoffset
=
LZSeek
(
lzfd
,
0
,
SEEK_CUR
);
pehdoffset
=
LZSeek
(
lzfd
,
0
,
FILE_CURRENT
);
if
(
sizeof
(
pehd
)
!=
LZRead
(
lzfd
,
(
LPSTR
)
&
pehd
,
sizeof
(
pehd
)
)
)
return
FALSE
;
resDataDir
=
pehd
.
OptionalHeader
.
DataDirectory
+
IMAGE_DIRECTORY_ENTRY_RESOURCE
;
...
...
@@ -303,7 +296,7 @@ static BOOL find_pe_resource( HFILE lzfd, LPCSTR typeid, LPCSTR resid,
LZSeek
(
lzfd
,
pehdoffset
+
sizeof
(
DWORD
)
+
/* Signature */
sizeof
(
IMAGE_FILE_HEADER
)
+
pehd
.
FileHeader
.
SizeOfOptionalHeader
,
SEEK_SET
);
pehd
.
FileHeader
.
SizeOfOptionalHeader
,
FILE_BEGIN
);
if
(
nSections
*
sizeof
(
IMAGE_SECTION_HEADER
)
!=
LZRead
(
lzfd
,
(
LPSTR
)
sections
,
nSections
*
sizeof
(
IMAGE_SECTION_HEADER
)
)
)
...
...
@@ -335,7 +328,7 @@ static BOOL find_pe_resource( HFILE lzfd, LPCSTR typeid, LPCSTR resid,
return
FALSE
;
}
LZSeek
(
lzfd
,
sections
[
i
].
PointerToRawData
,
SEEK_SET
);
LZSeek
(
lzfd
,
sections
[
i
].
PointerToRawData
,
FILE_BEGIN
);
if
(
resSectionSize
!=
LZRead
(
lzfd
,
(
char
*
)
resSection
,
resSectionSize
)
)
goto
done
;
/* Find resource */
...
...
@@ -458,7 +451,7 @@ DWORD WINAPI GetFileResource16( LPCSTR lpszFileName, LPCSTR lpszResType,
}
}
LZSeek
(
lzfd
,
dwFileOffset
,
SEEK_SET
);
LZSeek
(
lzfd
,
dwFileOffset
,
FILE_BEGIN
);
reslen
=
LZRead
(
lzfd
,
lpvData
,
min
(
reslen
,
dwResLen
)
);
LZClose
(
lzfd
);
...
...
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