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

Felix Abecassis felix.abecassis at gmail.com
Mon Jan 20 17:24:20 CET 2014


Indeed, the idea was that ideally we should be calling
DirectDrawEnumerateExW but since it is not working correctly in some
cases, we use the ExA version.

However you are right that it might be confusing so for developers
reading the code so we should maybe add a comment before the define or
modify the code to only handle ExA.

2014/1/20 Jean-Baptiste Kempf <jb at videolan.org>:
> 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
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel



-- 
Félix Abecassis
http://felix.abecassis.me



More information about the vlc-devel mailing list