Set the appropriate flags supporting versions of software modules.
Fix arguments for getting desktop DC.
}
HDC FASTCALL
-UserGetDesktopDC(ULONG DcType, BOOL EmptyDC, BOOL ValidatehWnd)
+UserGetDesktopDC(ULONG DcType, BOOL bAltDc, BOOL ValidatehWnd)
{
PWND DesktopObject = 0;
HDC DesktopHDC = 0;
else
{
PMONITOR pMonitor = UserGetPrimaryMonitor();
- DesktopHDC = IntGdiCreateDisplayDC(pMonitor->hDev, DcType, EmptyDC);
+ DesktopHDC = IntGdiCreateDisplayDC(pMonitor->hDev, DcType, bAltDc);
}
UserLeave();
Cs.lpszClass = (LPCWSTR) &ClassName;
/* Use IntCreateWindow instead of co_UserCreateWindowEx because the later expects a thread with a desktop */
- pWnd = IntCreateWindow(&Cs, &WindowName, pcls, NULL, NULL, NULL, pdesk);
+ pWnd = IntCreateWindow(&Cs, &WindowName, pcls, NULL, NULL, NULL, pdesk, WINVER);
if (pWnd == NULL)
{
ERR("Failed to create desktop window for the new desktop\n");
Cs.hInstance = hModClient; // hModuleWin; // Server side winproc!
Cs.lpszName = (LPCWSTR)&WindowName;
Cs.lpszClass = (LPCWSTR)&ClassName;
- pWnd = IntCreateWindow(&Cs, &WindowName, pcls, NULL, NULL, NULL, pdesk);
+ pWnd = IntCreateWindow(&Cs, &WindowName, pcls, NULL, NULL, NULL, pdesk, WINVER);
if (pWnd == NULL)
{
ERR("Failed to create message window for the new desktop\n");
Cs.hwndParent = UserHMGetHandle(pWndOwner);
/* NOTE: In Windows, top menu popup is not owned. */
- pWndCreated = co_UserCreateWindowEx( &Cs, &ClassName, &WindowName, NULL);
+ pWndCreated = co_UserCreateWindowEx( &Cs, &ClassName, &WindowName, NULL, WINVER );
if( !pWndCreated ) return FALSE;
PWND ParentWindow,
PWND OwnerWindow,
PVOID acbiBuffer,
- PDESKTOP pdeskCreated)
+ PDESKTOP pdeskCreated,
+ DWORD dwVer )
{
PWND pWnd = NULL;
HWND hWnd;
pWnd->spwndOwner = OwnerWindow;
pWnd->fnid = 0;
pWnd->spwndLastActive = pWnd;
- pWnd->state2 |= WNDS2_WIN40COMPAT; // FIXME!!!
+ // Ramp up compatible version sets.
+ if ( dwVer >= WINVER_WIN31 )
+ {
+ pWnd->state2 |= WNDS2_WIN31COMPAT;
+ if ( dwVer >= WINVER_WINNT4 )
+ {
+ pWnd->state2 |= WNDS2_WIN40COMPAT;
+ if ( dwVer >= WINVER_WIN2K )
+ {
+ pWnd->state2 |= WNDS2_WIN50COMPAT;
+ }
+ }
+ }
pWnd->pcls = Class;
pWnd->hModule = Cs->hInstance;
pWnd->style = Cs->style & ~WS_VISIBLE;
co_UserCreateWindowEx(CREATESTRUCTW* Cs,
PUNICODE_STRING ClassName,
PLARGE_STRING WindowName,
- PVOID acbiBuffer)
+ PVOID acbiBuffer,
+ DWORD dwVer )
{
ULONG style;
PWND Window = NULL, ParentWindow = NULL, OwnerWindow;
ParentWindow,
OwnerWindow,
acbiBuffer,
- NULL);
+ NULL,
+ dwVer );
if(!Window)
{
ERR("IntCreateWindow failed!\n");
UserEnterExclusive();
/* Call the internal function */
- pwnd = co_UserCreateWindowEx(&Cs, &ustrClsVersion, plstrWindowName, acbiBuffer);
+ pwnd = co_UserCreateWindowEx(&Cs, &ustrClsVersion, plstrWindowName, acbiBuffer, dwFlags);
if(!pwnd)
{
BOOL FASTCALL IntShowOwnedPopups( PWND owner, BOOL fShow );
LRESULT FASTCALL IntDefWindowProc( PWND Window, UINT Msg, WPARAM wParam, LPARAM lParam, BOOL Ansi);
VOID FASTCALL IntNotifyWinEvent(DWORD, PWND, LONG, LONG, DWORD);
+#define WINVER_WIN2K _WIN32_WINNT_WIN2K
+#define WINVER_WINNT4 _WIN32_WINNT_NT4
+#define WINVER_WIN31 0x30A
PWND FASTCALL IntCreateWindow(CREATESTRUCTW* Cs,
PLARGE_STRING WindowName,
PCLS Class,
PWND ParentWindow,
PWND OwnerWindow,
PVOID acbiBuffer,
- PDESKTOP pdeskCreated);
+ PDESKTOP pdeskCreated,
+ DWORD dwVer );
PWND FASTCALL co_UserCreateWindowEx(CREATESTRUCTW* Cs,
PUNICODE_STRING ClassName,
PLARGE_STRING WindowName,
- PVOID acbiBuffer);
+ PVOID acbiBuffer,
+ DWORD dwVer );
BOOL FASTCALL IntEnableWindow(HWND,BOOL);
BOOL FASTCALL IntIsWindowVisible(PWND);
DWORD FASTCALL GetNCHitEx(PWND,POINT);
}
}
+DWORD
+FASTCALL
+RtlGetExpWinVer( HMODULE hModule )
+{
+ DWORD dwMajorVersion = 3; // Set default to Windows 3.10.
+ DWORD dwMinorVersion = 10;
+ PIMAGE_NT_HEADERS pinth;
+
+ if ( hModule && !((ULONG_PTR)hModule >> 16))
+ {
+ pinth = RtlImageNtHeader( hModule );
+
+ dwMajorVersion = pinth->OptionalHeader.MajorSubsystemVersion;
+
+ if ( dwMajorVersion == 1 )
+ {
+ dwMajorVersion = 3;
+ }
+ else
+ {
+ dwMinorVersion = pinth->OptionalHeader.MinorSubsystemVersion;
+ }
+ }
+ return MAKELONG(MAKEWORD(dwMinorVersion, dwMajorVersion), 0);
+}
+
HWND WINAPI
User32CreateWindowEx(DWORD dwExStyle,
LPCSTR lpClassName,
LPCWSTR lpszClsVersion;
LPCWSTR lpLibFileName = NULL;
HANDLE pCtx = NULL;
+ DWORD dwFlagsVer;
#if 0
DbgPrint("[window] User32CreateWindowEx style %d, exstyle %d, parent %d\n", dwStyle, dwExStyle, hWndParent);
#endif
+ dwFlagsVer = RtlGetExpWinVer( hInstance ? hInstance : GetModuleHandleW(NULL) );
+ TRACE("Module Version %x\n",dwFlagsVer);
+
if (!RegisterDefaultClasses)
{
TRACE("RegisterSystemControls\n");
hMenu,
hInstance,
lpParam,
- dwFlags,
- NULL);
+ dwFlagsVer,
+ pCtx );
if (Handle) break;
if (!lpLibFileName) break;
if (!ClassFound)