[vlc-commits] DirectX: use DirectDrawEnumerateExA/W when GetProcAddress

Jean-Baptiste Kempf git at videolan.org
Tue Jan 15 11:59:18 CET 2013


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Tue Jan 15 11:58:18 2013 +0100| [8de5a80df97ba39be2f576bdb95de01d27cef9e8] | committer: Jean-Baptiste Kempf

DirectX: use DirectDrawEnumerateExA/W when GetProcAddress

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=8de5a80df97ba39be2f576bdb95de01d27cef9e8
---

 modules/video_output/msw/directx.c |   11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/modules/video_output/msw/directx.c b/modules/video_output/msw/directx.c
index 61c1cb4..cab6bee 100644
--- a/modules/video_output/msw/directx.c
+++ b/modules/video_output/msw/directx.c
@@ -55,6 +55,13 @@
 # warning "Unicode mode not tested"
 #endif
 
+#ifdef UNICODE
+# define DIRECTDRAWENUMERATEEX_NAME "DirectDrawEnumerateExW"
+#else
+# define DIRECTDRAWENUMERATEEX_NAME "DirectDrawEnumerateExA"
+#endif
+
+
 /*****************************************************************************
  * Module descriptor
  *****************************************************************************/
@@ -575,7 +582,7 @@ static int DirectXOpenDDraw(vout_display_t *vd)
     /* */
     HRESULT (WINAPI *OurDirectDrawEnumerateEx)(LPDDENUMCALLBACKEX, LPVOID, DWORD);
     OurDirectDrawEnumerateEx =
-      (void *)GetProcAddress(sys->hddraw_dll, "DirectDrawEnumerateEx");
+      (void *)GetProcAddress(sys->hddraw_dll, DIRECTDRAWENUMERATEEX_NAME);
 
     if (OurDirectDrawEnumerateEx) {
         char *device = var_GetString(vd, "directx-device");
@@ -1452,7 +1459,7 @@ static int FindDevicesCallback(vlc_object_t *object, const char *name,
         /* Enumerate displays */
         HRESULT (WINAPI *OurDirectDrawEnumerateEx)(LPDDENUMCALLBACKEX,
                                                    LPVOID, DWORD) =
-              (void *)GetProcAddress(hddraw_dll, "DirectDrawEnumerateEx");
+              (void *)GetProcAddress(hddraw_dll, DIRECTDRAWENUMERATEEX_NAME);
         if (OurDirectDrawEnumerateEx != NULL)
             OurDirectDrawEnumerateEx(DirectXEnumCallback2, &ctx,
                                      DDENUM_ATTACHEDSECONDARYDEVICES);



More information about the vlc-commits mailing list