ReactOS 0.4.16-dev-197-g92996da
image.c File Reference
#include <user32.h>
#include <wine/debug.h>
Include dependency graph for image.c:

Go to the source code of this file.

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (user32)
 
ULONG RtlGetExpWinVer (_In_ PVOID BaseAddress)
 

Function Documentation

◆ RtlGetExpWinVer()

ULONG RtlGetExpWinVer ( _In_ PVOID  BaseAddress)

Definition at line 20 of file image.c.

21{
22 ULONG dwMajorVersion = 3, dwMinorVersion = 10; /* Set default to Windows 3.10 (WINVER_WIN31) */
23 PIMAGE_NT_HEADERS pNTHeader;
24 ULONG_PTR AlignedAddress = (ULONG_PTR)BaseAddress;
25
26 TRACE("(%p)\n", BaseAddress);
27
28 /* Remove the magic flag for non-mapped images */
29 if (AlignedAddress & 1)
30 AlignedAddress = (AlignedAddress & ~1);
31
32 if (AlignedAddress && !LOWORD(AlignedAddress))
33 {
34 pNTHeader = RtlImageNtHeader((PVOID)AlignedAddress);
35 if (pNTHeader)
36 {
37 dwMajorVersion = pNTHeader->OptionalHeader.MajorSubsystemVersion;
38 if (dwMajorVersion == 1)
39 dwMajorVersion = 3;
40 else
41 dwMinorVersion = pNTHeader->OptionalHeader.MinorSubsystemVersion;
42 }
43 }
44
45 return MAKEWORD(dwMinorVersion, dwMajorVersion);
46}
#define RtlImageNtHeader
Definition: compat.h:806
#define ULONG_PTR
Definition: config.h:101
_In_ HANDLE _Outptr_result_bytebuffer_ ViewSize PVOID * BaseAddress
Definition: mmfuncs.h:404
#define LOWORD(l)
Definition: pedump.c:82
#define TRACE(s)
Definition: solgame.cpp:4
IMAGE_OPTIONAL_HEADER32 OptionalHeader
Definition: ntddk_ex.h:184
#define MAKEWORD(a, b)
Definition: typedefs.h:248
uint32_t ULONG_PTR
Definition: typedefs.h:65
uint32_t ULONG
Definition: typedefs.h:59

Referenced by InitThreadCallback(), and User32CreateWindowEx().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( user32  )