diff options
author | Jon TURNEY <jon.turney@dronecode.org.uk> | 2011-07-03 19:10:52 +0100 |
---|---|---|
committer | Jon TURNEY <jon.turney@dronecode.org.uk> | 2011-11-02 14:08:06 +0000 |
commit | 3ead1d810b0e157078db39712e02ea6dc85216d8 (patch) | |
tree | dfd32d4eb34b71e78799ad10dc5ac8be292c6542 /hw/xwin/winmonitors.c | |
parent | f6529a05a2f087cb57a7fe84f226fef3780728d0 (diff) |
hw/xwin: Stop pretending we work on NT4
We already link directly to some functions not available in NT4, so stop
pretending we will work on NT4 and link directly to EnumDisplayMonitors()
and SHGetFolderPath()
Also remove mentions of NT4 & Win95 from error messages
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Diffstat (limited to 'hw/xwin/winmonitors.c')
-rw-r--r-- | hw/xwin/winmonitors.c | 28 |
1 files changed, 1 insertions, 27 deletions
diff --git a/hw/xwin/winmonitors.c b/hw/xwin/winmonitors.c index a9d46f90e..967ae6d35 100644 --- a/hw/xwin/winmonitors.c +++ b/hw/xwin/winmonitors.c @@ -53,30 +53,8 @@ wBOOL CALLBACK getMonitorInfo(HMONITOR hMonitor, HDC hdc, LPRECT rect, LPARAM _d return TRUE; } -typedef WINAPI wBOOL (*ENUMDISPLAYMONITORSPROC)(HDC,LPCRECT,MONITORENUMPROC,LPARAM); -ENUMDISPLAYMONITORSPROC _EnumDisplayMonitors; - -wBOOL CALLBACK getMonitorInfo(HMONITOR hMonitor, HDC hdc, LPRECT rect, LPARAM _data); - Bool QueryMonitor(int index, struct GetMonitorInfoData *data) { - /* Load EnumDisplayMonitors from DLL */ - HMODULE user32; - FARPROC func; - user32 = LoadLibrary("user32.dll"); - if (user32 == NULL) - { - winW32Error(2, "Could not open user32.dll"); - return FALSE; - } - func = GetProcAddress(user32, "EnumDisplayMonitors"); - if (func == NULL) - { - winW32Error(2, "Could not resolve EnumDisplayMonitors: "); - return FALSE; - } - _EnumDisplayMonitors = (ENUMDISPLAYMONITORSPROC)func; - /* prepare data */ if (data == NULL) return FALSE; @@ -84,9 +62,5 @@ Bool QueryMonitor(int index, struct GetMonitorInfoData *data) data->requestedMonitor = index; /* query information */ - _EnumDisplayMonitors(NULL, NULL, getMonitorInfo, (LPARAM) data); - - /* cleanup */ - FreeLibrary(user32); - return TRUE; + return EnumDisplayMonitors(NULL, NULL, getMonitorInfo, (LPARAM) data); } |