Fixed GetLargestConsoleWindowSize return type for Winelib apps.

This commit is contained in:
Alexandre Julliard 2000-11-25 21:46:30 +00:00
parent 1852ce8018
commit 3bf456bb44
3 changed files with 31 additions and 9 deletions

View File

@ -357,7 +357,7 @@ debug_channels (comm debugstr dll int resource stress thunk toolhelp win32)
336 stdcall GetHandleInformation(long ptr) GetHandleInformation
337 stub GetLSCallbackTarget
338 stub GetLSCallbackTemplate
339 stdcall GetLargestConsoleWindowSize(long) WIN32_GetLargestConsoleWindowSize
339 stdcall GetLargestConsoleWindowSize(long) GetLargestConsoleWindowSize
340 stdcall GetLastError() GetLastError
341 stdcall GetLocalTime(ptr) GetLocalTime
342 stdcall GetLocaleInfoA(long long ptr long) GetLocaleInfoA

View File

@ -137,7 +137,22 @@ typedef struct tagINPUT_RECORD
#define MENU_EVENT 0x08
#define FOCUS_EVENT 0x10
COORD WINAPI GetLargestConsoleWindowSize(HANDLE);
#ifdef __i386__
/* Note: this should return a COORD, but calling convention for returning
* structures is different between Windows and gcc on i386. */
DWORD WINAPI GetLargestConsoleWindowSize(HANDLE);
inline static COORD __wine_GetLargestConsoleWindowSize_wrapper(HANDLE h)
{
DWORD dw = GetLargestConsoleWindowSize(h);
return *(COORD *)&dw;
}
#define GetLargestConsoleWindowSize(h) __wine_GetLargestConsoleWindowSize_wrapper(h)
#else /* __i386__ */
COORD WINAPI GetLargestConsoleWindowSize(HANDLE);
#endif /* __i386__ */
BOOL WINAPI ReadConsoleOutputCharacterA(HANDLE,LPSTR,DWORD,COORD,LPDWORD);
BOOL WINAPI ReadConsoleOutputCharacterW(HANDLE,LPWSTR,DWORD,COORD,LPDWORD);
#define ReadConsoleOutputCharacter WINELIB_NAME_AW(ReadConsoleOutputCharacter)

View File

@ -511,7 +511,20 @@ BOOL WINAPI SetConsoleActiveScreenBuffer(
/***********************************************************************
* GetLargestConsoleWindowSize (KERNEL32.226)
*
* Note: this should return a COORD, but calling convention for returning
* structures is different between Windows and gcc on i386.
*/
#ifdef __i386__
#undef GetLargestConsoleWindowSize
DWORD WINAPI GetLargestConsoleWindowSize( HANDLE hConsoleOutput )
{
COORD c;
c.X = 80;
c.Y = 24;
return *(DWORD *)&c;
}
#else /* __i386__ */
COORD WINAPI GetLargestConsoleWindowSize( HANDLE hConsoleOutput )
{
COORD c;
@ -519,13 +532,7 @@ COORD WINAPI GetLargestConsoleWindowSize( HANDLE hConsoleOutput )
c.Y = 24;
return c;
}
/* gcc doesn't return structures the same way as dwords */
DWORD WINAPI WIN32_GetLargestConsoleWindowSize( HANDLE hConsoleOutput )
{
COORD c = GetLargestConsoleWindowSize( hConsoleOutput );
return *(DWORD *)&c;
}
#endif /* __i386__ */
/***********************************************************************
* FreeConsole (KERNEL32.267)