Handle the COORD <-> DWORD conversion the canonical way.

This commit is contained in:
Marcus Meissner 2002-11-21 23:45:31 +00:00 committed by Alexandre Julliard
parent 24677dd4d9
commit 5163752e8e
2 changed files with 13 additions and 10 deletions

View File

@ -796,10 +796,13 @@ DWORD WINAPI GetConsoleTitleW(LPWSTR title, DWORD size)
#undef GetLargestConsoleWindowSize
DWORD WINAPI GetLargestConsoleWindowSize(HANDLE hConsoleOutput)
{
COORD c;
c.X = 80;
c.Y = 24;
return *(DWORD *)&c;
union {
COORD c;
DWORD w;
} x;
x.c.X = 80;
x.c.Y = 24;
return x.w;
}
#endif /* defined(__i386__) */

View File

@ -180,12 +180,12 @@ DWORD WINAPI GetLargestConsoleWindowSize(HANDLE);
inline static COORD __wine_GetLargestConsoleWindowSize_wrapper(HANDLE h)
{
COORD c;
DWORD dw = GetLargestConsoleWindowSize(h);
c.X = LOWORD(dw);
c.Y = HIWORD(dw);
return c;
union {
COORD c;
DWORD dw;
} u;
u.dw = GetLargestConsoleWindowSize(h);
return u.c;
}
#define GetLargestConsoleWindowSize(h) __wine_GetLargestConsoleWindowSize_wrapper(h)