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
e7957d6b
Commit
e7957d6b
authored
Nov 10, 1999
by
Ulrich Weigand
Committed by
Alexandre Julliard
Nov 10, 1999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Determine expected_version of PE buddies from the SubsystemVersion.
parent
ae8342df
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
23 additions
and
19 deletions
+23
-19
module.h
include/module.h
+1
-1
pe_image.h
include/pe_image.h
+1
-1
module.c
loader/dos/module.c
+1
-1
main.c
loader/main.c
+1
-1
module.c
loader/module.c
+3
-3
module.c
loader/ne/module.c
+3
-5
pe_image.c
loader/pe_image.c
+11
-5
builtin32.c
relay32/builtin32.c
+1
-1
build.c
tools/build.c
+1
-1
No files found.
include/module.h
View file @
e7957d6b
...
...
@@ -183,7 +183,7 @@ extern void MODULE_DllThreadDetach( LPVOID lpReserved );
extern
WINE_MODREF
*
MODULE_LoadLibraryExA
(
LPCSTR
libname
,
HFILE
hfile
,
DWORD
flags
);
extern
BOOL
MODULE_FreeLibrary
(
WINE_MODREF
*
wm
);
extern
WINE_MODREF
*
MODULE_FindModule
(
LPCSTR
path
);
extern
HMODULE
MODULE_CreateDummyModule
(
const
OFSTRUCT
*
ofs
,
LPCSTR
modName
);
extern
HMODULE
MODULE_CreateDummyModule
(
const
OFSTRUCT
*
ofs
,
LPCSTR
modName
,
WORD
version
);
extern
FARPROC16
WINAPI
WIN32_GetProcAddress16
(
HMODULE
hmodule
,
LPCSTR
name
);
extern
SEGPTR
WINAPI
HasGPHandler16
(
SEGPTR
address
);
extern
void
MODULE_WalkModref
(
DWORD
id
);
...
...
include/pe_image.h
View file @
e7957d6b
...
...
@@ -28,7 +28,7 @@ extern DWORD PE_SizeofResource(HMODULE,HRSRC);
extern
struct
_wine_modref
*
PE_LoadLibraryExA
(
LPCSTR
,
DWORD
,
DWORD
*
);
extern
void
PE_UnloadLibrary
(
struct
_wine_modref
*
);
extern
HGLOBAL
PE_LoadResource
(
struct
_wine_modref
*
wm
,
HRSRC
);
extern
HMODULE
PE_LoadImage
(
HFILE
hFile
,
OFSTRUCT
*
ofs
,
LPCSTR
*
modName
);
extern
HMODULE
PE_LoadImage
(
HFILE
hFile
,
OFSTRUCT
*
ofs
,
LPCSTR
*
modName
,
WORD
*
version
);
extern
struct
_wine_modref
*
PE_CreateModule
(
HMODULE
hModule
,
OFSTRUCT
*
ofs
,
DWORD
flags
,
BOOL
builtin
);
extern
BOOL
PE_CreateProcess
(
HFILE
hFile
,
OFSTRUCT
*
ofs
,
LPCSTR
cmd_line
,
LPCSTR
env
,
...
...
loader/dos/module.c
View file @
e7957d6b
...
...
@@ -469,7 +469,7 @@ BOOL MZ_CreateProcess( HFILE hFile, OFSTRUCT *ofs, LPCSTR cmdline, LPCSTR env,
if
((
!
env
)
&&
pdb
)
env
=
pdb
->
env_db
->
environ
;
if
(
alloc
)
{
if
((
hModule
=
MODULE_CreateDummyModule
(
ofs
,
NULL
))
<
32
)
{
if
((
hModule
=
MODULE_CreateDummyModule
(
ofs
,
NULL
,
0
))
<
32
)
{
SetLastError
(
hModule
);
return
FALSE
;
}
...
...
loader/main.c
View file @
e7957d6b
...
...
@@ -304,7 +304,7 @@ HINSTANCE MAIN_WinelibInit( int *argc, char *argv[] )
PROCESS_Current
()
->
exe_modref
=
wm
;
strcpy
(
ofs
.
szPathName
,
wm
->
modname
);
if
((
hModule
=
MODULE_CreateDummyModule
(
&
ofs
,
NULL
))
<
32
)
return
0
;
if
((
hModule
=
MODULE_CreateDummyModule
(
&
ofs
,
NULL
,
0
))
<
32
)
return
0
;
pModule
=
(
NE_MODULE
*
)
GlobalLock16
(
hModule
);
pModule
->
flags
=
NE_FFLAGS_WIN32
;
pModule
->
module32
=
wm
->
module
;
...
...
loader/module.c
View file @
e7957d6b
...
...
@@ -333,7 +333,7 @@ BOOL WINAPI DisableThreadLibraryCalls( HMODULE hModule )
*
* Create a dummy NE module for Win32 or Winelib.
*/
HMODULE
MODULE_CreateDummyModule
(
const
OFSTRUCT
*
ofs
,
LPCSTR
modName
)
HMODULE
MODULE_CreateDummyModule
(
const
OFSTRUCT
*
ofs
,
LPCSTR
modName
,
WORD
version
)
{
HMODULE
hModule
;
NE_MODULE
*
pModule
;
...
...
@@ -375,7 +375,7 @@ HMODULE MODULE_CreateDummyModule( const OFSTRUCT *ofs, LPCSTR modName )
pModule
->
nrname_size
=
0
;
pModule
->
fileinfo
=
sizeof
(
NE_MODULE
);
pModule
->
os_flags
=
NE_OSFLAGS_WINDOWS
;
pModule
->
expected_version
=
0x030a
;
pModule
->
expected_version
=
version
;
pModule
->
self
=
hModule
;
/* Set loaded file information */
...
...
@@ -1470,7 +1470,7 @@ WINE_MODREF *MODULE_LoadLibraryExA( LPCSTR libname, HFILE hfile, DWORD flags )
break
;
}
ERR
_
(
module
)(
"Failed to load module '%s'; error=0x%08lx,
\n
"
,
libname
,
err
);
WARN
_
(
module
)(
"Failed to load module '%s'; error=0x%08lx,
\n
"
,
libname
,
err
);
SetLastError
(
err
);
LeaveCriticalSection
(
&
PROCESS_Current
()
->
crit_section
);
return
NULL
;
...
...
loader/ne/module.c
View file @
e7957d6b
...
...
@@ -1377,17 +1377,15 @@ WORD WINAPI GetExpWinVer16( HMODULE16 hModule )
/*
* For built-in modules, fake the expected version the module should
* have according to the Windows version emulated by Wine
*
* FIXME: Should we really do this for Win32 dummy modules as well?
*/
if
(
(
pModule
->
flags
&
NE_FFLAGS_BUILTIN
)
||
(
pModule
->
flags
&
NE_FFLAGS_WIN32
)
)
if
(
!
pModule
->
expected_version
)
{
OSVERSIONINFOA
versionInfo
;
versionInfo
.
dwOSVersionInfoSize
=
sizeof
(
versionInfo
);
if
(
GetVersionExA
(
&
versionInfo
)
)
return
(
versionInfo
.
dwMajorVersion
&
0xff
)
<<
8
pModule
->
expected_version
=
(
versionInfo
.
dwMajorVersion
&
0xff
)
<<
8
|
(
versionInfo
.
dwMinorVersion
&
0xff
);
}
...
...
loader/pe_image.c
View file @
e7957d6b
...
...
@@ -459,7 +459,7 @@ static void do_relocations( unsigned int load_addr, IMAGE_BASE_RELOCATION *r )
* BUT we have to map the whole image anyway, for Win32 programs sometimes
* want to access them. (HMODULE32 point to the start of it)
*/
HMODULE
PE_LoadImage
(
HFILE
hFile
,
OFSTRUCT
*
ofs
,
LPCSTR
*
modName
)
HMODULE
PE_LoadImage
(
HFILE
hFile
,
OFSTRUCT
*
ofs
,
LPCSTR
*
modName
,
WORD
*
version
)
{
HMODULE
hModule
;
HANDLE
mapping
;
...
...
@@ -663,6 +663,10 @@ HMODULE PE_LoadImage( HFILE hFile, OFSTRUCT *ofs, LPCSTR *modName )
if
(
dir
->
Size
)
*
modName
=
(
LPCSTR
)
RVA
(((
PIMAGE_EXPORT_DIRECTORY
)
RVA
(
dir
->
VirtualAddress
))
->
Name
);
/* Get expected OS / Subsystem version */
*
version
=
(
(
nt
->
OptionalHeader
.
MajorSubsystemVersion
&
0xff
)
<<
8
)
|
(
nt
->
OptionalHeader
.
MinorSubsystemVersion
&
0xff
);
/* We don't need the orignal mapping any more */
UnmapViewOfFile
(
(
LPVOID
)
hModule
);
return
(
HMODULE
)
load_addr
;
...
...
@@ -882,6 +886,7 @@ WINE_MODREF *PE_LoadLibraryExA (LPCSTR name, DWORD flags, DWORD *err)
WINE_MODREF
*
wm
;
char
dllname
[
256
],
*
p
;
HFILE
hFile
;
WORD
version
=
0
;
/* Append .DLL to name if no extension present */
strcpy
(
dllname
,
name
);
...
...
@@ -892,7 +897,7 @@ WINE_MODREF *PE_LoadLibraryExA (LPCSTR name, DWORD flags, DWORD *err)
hFile
=
OpenFile
(
dllname
,
&
ofs
,
OF_READ
|
OF_SHARE_DENY_WRITE
);
if
(
hFile
!=
HFILE_ERROR
)
{
hModule32
=
PE_LoadImage
(
hFile
,
&
ofs
,
&
modName
);
hModule32
=
PE_LoadImage
(
hFile
,
&
ofs
,
&
modName
,
&
version
);
CloseHandle
(
hFile
);
if
(
!
hModule32
)
{
...
...
@@ -907,7 +912,7 @@ WINE_MODREF *PE_LoadLibraryExA (LPCSTR name, DWORD flags, DWORD *err)
}
/* Create 16-bit dummy module */
if
((
hModule16
=
MODULE_CreateDummyModule
(
&
ofs
,
modName
))
<
32
)
if
((
hModule16
=
MODULE_CreateDummyModule
(
&
ofs
,
modName
,
version
))
<
32
)
{
*
err
=
(
DWORD
)
hModule16
;
/* This should give the correct error */
return
NULL
;
...
...
@@ -954,12 +959,13 @@ BOOL PE_CreateProcess( HFILE hFile, OFSTRUCT *ofs, LPCSTR cmd_line, LPCSTR env,
LPPROCESS_INFORMATION
info
)
{
LPCSTR
modName
=
NULL
;
WORD
version
=
0
;
HMODULE16
hModule16
;
HMODULE
hModule32
;
NE_MODULE
*
pModule
;
/* Load file */
if
(
(
hModule32
=
PE_LoadImage
(
hFile
,
ofs
,
&
modName
))
<
32
)
if
(
(
hModule32
=
PE_LoadImage
(
hFile
,
ofs
,
&
modName
,
&
version
))
<
32
)
{
SetLastError
(
hModule32
);
return
FALSE
;
...
...
@@ -973,7 +979,7 @@ BOOL PE_CreateProcess( HFILE hFile, OFSTRUCT *ofs, LPCSTR cmd_line, LPCSTR env,
#endif
/* Create 16-bit dummy module */
if
(
(
hModule16
=
MODULE_CreateDummyModule
(
ofs
,
modName
))
<
32
)
if
(
(
hModule16
=
MODULE_CreateDummyModule
(
ofs
,
modName
,
version
))
<
32
)
{
SetLastError
(
hModule16
);
return
FALSE
;
...
...
relay32/builtin32.c
View file @
e7957d6b
...
...
@@ -487,7 +487,7 @@ WINE_MODREF *BUILTIN32_LoadLibraryExA(LPCSTR path, DWORD flags, DWORD *err)
}
/* Create 16-bit dummy module */
if
((
hModule16
=
MODULE_CreateDummyModule
(
&
ofs
,
modName
))
<
32
)
if
((
hModule16
=
MODULE_CreateDummyModule
(
&
ofs
,
modName
,
0
))
<
32
)
{
*
err
=
(
DWORD
)
hModule16
;
return
NULL
;
/* FIXME: Should unload the builtin module */
...
...
tools/build.c
View file @
e7957d6b
...
...
@@ -873,7 +873,7 @@ static int BuildModule16( FILE *outfile, int max_code_offset,
pModule
->
dlls_to_init
=
0
;
pModule
->
nrname_handle
=
0
;
pModule
->
min_swap_area
=
0
;
pModule
->
expected_version
=
0
x030a
;
pModule
->
expected_version
=
0
;
pModule
->
module32
=
0
;
pModule
->
self
=
0
;
pModule
->
self_loading_sel
=
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