mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-05 13:58:26 +00:00
Set 'expected_version' of built-in and dummy modules according to
emulated Windows version.
This commit is contained in:
parent
3967b0912e
commit
f52e109dea
|
@ -146,6 +146,7 @@ static HMODULE16 BUILTIN_DoLoadModule16( const WIN16_DESCRIPTOR *descr )
|
|||
NE_MODULE *pModule;
|
||||
int minsize;
|
||||
SEGTABLEENTRY *pSegTable;
|
||||
OSVERSIONINFOA versionInfo;
|
||||
|
||||
HMODULE16 hModule = GLOBAL_CreateBlock( GMEM_MOVEABLE, descr->module_start,
|
||||
descr->module_size, 0,
|
||||
|
@ -158,6 +159,13 @@ static HMODULE16 BUILTIN_DoLoadModule16( const WIN16_DESCRIPTOR *descr )
|
|||
pModule = (NE_MODULE *)GlobalLock16( hModule );
|
||||
pModule->self = hModule;
|
||||
|
||||
/* Set expected_version according to the emulated Windows version */
|
||||
|
||||
versionInfo.dwOSVersionInfoSize = sizeof(versionInfo);
|
||||
if ( GetVersionExA( &versionInfo ) )
|
||||
pModule->expected_version = (versionInfo.dwMajorVersion & 0xff) << 8
|
||||
| (versionInfo.dwMinorVersion & 0xff);
|
||||
|
||||
/* Allocate the code segment */
|
||||
|
||||
pSegTable = NE_SEG_TABLE( pModule );
|
||||
|
|
|
@ -341,6 +341,7 @@ HMODULE MODULE_CreateDummyModule( const OFSTRUCT *ofs, LPCSTR modName )
|
|||
char *pStr,*s;
|
||||
int len;
|
||||
const char* basename;
|
||||
OSVERSIONINFOA versionInfo;
|
||||
|
||||
INT of_size = sizeof(OFSTRUCT) - sizeof(ofs->szPathName)
|
||||
+ strlen(ofs->szPathName) + 1;
|
||||
|
@ -378,6 +379,13 @@ HMODULE MODULE_CreateDummyModule( const OFSTRUCT *ofs, LPCSTR modName )
|
|||
pModule->expected_version = 0x030a;
|
||||
pModule->self = hModule;
|
||||
|
||||
/* Set expected_version according to the emulated Windows version */
|
||||
versionInfo.dwOSVersionInfoSize = sizeof(versionInfo);
|
||||
if ( GetVersionExA( &versionInfo ) )
|
||||
pModule->expected_version = (versionInfo.dwMajorVersion & 0xff) << 8
|
||||
| (versionInfo.dwMinorVersion & 0xff);
|
||||
|
||||
|
||||
/* Set loaded file information */
|
||||
memcpy( pModule + 1, ofs, of_size );
|
||||
((OFSTRUCT *)(pModule+1))->cBytes = of_size - 1;
|
||||
|
|
Loading…
Reference in a new issue