forked from Mirrors/wine-wine
Handle the COORD <-> DWORD conversion the canonical way.
parent
24677dd4d9
commit
5163752e8e
|
@ -796,10 +796,13 @@ DWORD WINAPI GetConsoleTitleW(LPWSTR title, DWORD size)
|
||||||
#undef GetLargestConsoleWindowSize
|
#undef GetLargestConsoleWindowSize
|
||||||
DWORD WINAPI GetLargestConsoleWindowSize(HANDLE hConsoleOutput)
|
DWORD WINAPI GetLargestConsoleWindowSize(HANDLE hConsoleOutput)
|
||||||
{
|
{
|
||||||
COORD c;
|
union {
|
||||||
c.X = 80;
|
COORD c;
|
||||||
c.Y = 24;
|
DWORD w;
|
||||||
return *(DWORD *)&c;
|
} x;
|
||||||
|
x.c.X = 80;
|
||||||
|
x.c.Y = 24;
|
||||||
|
return x.w;
|
||||||
}
|
}
|
||||||
#endif /* defined(__i386__) */
|
#endif /* defined(__i386__) */
|
||||||
|
|
||||||
|
|
|
@ -180,12 +180,12 @@ DWORD WINAPI GetLargestConsoleWindowSize(HANDLE);
|
||||||
|
|
||||||
inline static COORD __wine_GetLargestConsoleWindowSize_wrapper(HANDLE h)
|
inline static COORD __wine_GetLargestConsoleWindowSize_wrapper(HANDLE h)
|
||||||
{
|
{
|
||||||
COORD c;
|
union {
|
||||||
DWORD dw = GetLargestConsoleWindowSize(h);
|
COORD c;
|
||||||
|
DWORD dw;
|
||||||
c.X = LOWORD(dw);
|
} u;
|
||||||
c.Y = HIWORD(dw);
|
u.dw = GetLargestConsoleWindowSize(h);
|
||||||
return c;
|
return u.c;
|
||||||
}
|
}
|
||||||
#define GetLargestConsoleWindowSize(h) __wine_GetLargestConsoleWindowSize_wrapper(h)
|
#define GetLargestConsoleWindowSize(h) __wine_GetLargestConsoleWindowSize_wrapper(h)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue