[vlc-devel] [vlc-commits] DirectDraw: DirectDrawEnumerateExW does not work, use DirectDrawEnumerateExA instead.

Jean-Baptiste Kempf jb at videolan.org
Mon Jan 20 17:18:43 CET 2014


On 20 Jan, Rafaël Carré wrote :
> >  #ifdef UNICODE
> > -# define DIRECTDRAWENUMERATEEX_NAME "DirectDrawEnumerateExW"
> > +# define DIRECTDRAWENUMERATEEX_NAME "DirectDrawEnumerateExA"
> >  #else
> >  # define DIRECTDRAWENUMERATEEX_NAME "DirectDrawEnumerateExA"
> >  #endif
> 
> Please remove the ifdef UNICODE, or even merge it where it's used.

Well, if someone manages to fix the issue, it's easier that way.

> > @@ -453,8 +453,8 @@ static BOOL WINAPI DirectXOpenDDrawCallback(GUID *guid, LPTSTR desc,
> 
> http://msdn.microsoft.com/en-us/library/windows/desktop/gg426106(v=vs.85).aspx
> 
> desc and drivername are LPSTR, not LPTSTR.

If UNICODE is defined, the string values are returned as type LPWSTR,
rather than LPSTR.

> You can use LPDDENUMCALLBACKEXA to avoid prototype mismatch
> 
> >      if (!hmon)
> >          return TRUE;
> >  
> > -    char *psz_drivername = FromT(drivername);
> > -    char *psz_desc = FromT(desc);
> > +    char *psz_drivername = (char*)drivername;
> > +    char *psz_desc = (char*)desc;
> 
> If you use the correct prototype, casting char * to char * will not be
> needed either.

Well, the issue appears to be that DirectDrawEnumerateExW calls the A
callback.
See http://www.gamedev.net/topic/433723-ddraw-device-enumeration-callback-never-gets-called/#entry3882316

With my kindest regards,

-- 
Jean-Baptiste Kempf
http://www.jbkempf.com/ - +33 672 704 734
Sent from my Electronic Device



More information about the vlc-devel mailing list