mirror of
https://github.com/reactos/wine.git
synced 2025-02-03 18:53:17 +00:00
krnl386: Fetch version from the PEB to avoid potentially using GetVersionEx before it's initialized.
This commit is contained in:
parent
e272b31b6b
commit
5ce81a9dc2
@ -917,7 +917,6 @@ static HMODULE16 NE_DoLoadBuiltinModule( const IMAGE_DOS_HEADER *mz_header, cons
|
|||||||
NE_MODULE *pModule;
|
NE_MODULE *pModule;
|
||||||
HMODULE16 hModule;
|
HMODULE16 hModule;
|
||||||
HINSTANCE16 hInstance;
|
HINSTANCE16 hInstance;
|
||||||
OSVERSIONINFOW versionInfo;
|
|
||||||
SIZE_T mapping_size = ~0UL; /* assume builtins don't contain invalid offsets... */
|
SIZE_T mapping_size = ~0UL; /* assume builtins don't contain invalid offsets... */
|
||||||
|
|
||||||
hModule = build_module( mz_header, mapping_size, file_name );
|
hModule = build_module( mz_header, mapping_size, file_name );
|
||||||
@ -927,9 +926,8 @@ static HMODULE16 NE_DoLoadBuiltinModule( const IMAGE_DOS_HEADER *mz_header, cons
|
|||||||
pModule->owner32 = owner32;
|
pModule->owner32 = owner32;
|
||||||
|
|
||||||
/* fake the expected version the module should have according to the current Windows version */
|
/* fake the expected version the module should have according to the current Windows version */
|
||||||
versionInfo.dwOSVersionInfoSize = sizeof(versionInfo);
|
pModule->ne_expver = MAKEWORD( NtCurrentTeb()->Peb->OSMajorVersion,
|
||||||
if (GetVersionExW( &versionInfo ))
|
NtCurrentTeb()->Peb->OSMinorVersion );
|
||||||
pModule->ne_expver = MAKEWORD( versionInfo.dwMinorVersion, versionInfo.dwMajorVersion );
|
|
||||||
|
|
||||||
hInstance = NE_DoLoadModule( pModule );
|
hInstance = NE_DoLoadModule( pModule );
|
||||||
if (hInstance < 32) NE_FreeModule( hModule, 0 );
|
if (hInstance < 32) NE_FreeModule( hModule, 0 );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user