Alexandre Julliard : winedos: Link to DirectDrawCreate through delayed imports instead of doing it by hand .
Alexandre Julliard
julliard at winehq.org
Tue Jan 5 11:37:50 CST 2010
Module: wine
Branch: master
Commit: 0a8573a226e644cc292e75fc91217c83dbc79f14
URL: http://source.winehq.org/git/wine.git/?a=commit;h=0a8573a226e644cc292e75fc91217c83dbc79f14
Author: Alexandre Julliard <julliard at winehq.org>
Date: Mon Jan 4 17:57:55 2010 +0100
winedos: Link to DirectDrawCreate through delayed imports instead of doing it by hand.
---
dlls/winedos/Makefile.in | 1 +
dlls/winedos/vga.c | 14 +-------------
2 files changed, 2 insertions(+), 13 deletions(-)
diff --git a/dlls/winedos/Makefile.in b/dlls/winedos/Makefile.in
index 8cf3db8..632815c 100644
--- a/dlls/winedos/Makefile.in
+++ b/dlls/winedos/Makefile.in
@@ -4,6 +4,7 @@ SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = winedos.dll
IMPORTS = user32 kernel32 kernel ntdll
+DELAYIMPORTS = ddraw
C_SRCS = \
devices.c \
diff --git a/dlls/winedos/vga.c b/dlls/winedos/vga.c
index 86737bc..3c904be 100644
--- a/dlls/winedos/vga.c
+++ b/dlls/winedos/vga.c
@@ -231,9 +231,6 @@ static CRITICAL_SECTION_DEBUG critsect_debug =
};
static CRITICAL_SECTION vga_lock = { &critsect_debug, -1, 0, 0, 0, 0 };
-typedef HRESULT (WINAPI *DirectDrawCreateProc)(LPGUID,LPDIRECTDRAW *,LPUNKNOWN);
-static DirectDrawCreateProc pDirectDrawCreate;
-
static void CALLBACK VGA_Poll( LPVOID arg, DWORD low, DWORD high );
static HWND vga_hwnd = NULL;
@@ -787,16 +784,7 @@ static void WINAPI VGA_DoSetMode(ULONG_PTR arg)
if (lpddraw) VGA_DoExit(0);
if (!lpddraw) {
- if (!pDirectDrawCreate)
- {
- HMODULE hmod = LoadLibraryA( "ddraw.dll" );
- if (hmod) pDirectDrawCreate = (DirectDrawCreateProc)GetProcAddress( hmod, "DirectDrawCreate" );
- if (!pDirectDrawCreate) {
- ERR("Can't lookup DirectDrawCreate from ddraw.dll.\n");
- return;
- }
- }
- res = pDirectDrawCreate(NULL,&lpddraw,NULL);
+ res = DirectDrawCreate(NULL,&lpddraw,NULL);
if (!lpddraw) {
ERR("DirectDraw is not available (res = 0x%x)\n",res);
return;
More information about the wine-cvs
mailing list