Janitorial reporting ;-)
In the Get rid of W->A calls task, Say I try dlls/ddraw/main.c: ddraw: DirectDrawEnumerateExW: illegal call to DirectDrawEnumerateExA
The misbheaving function is :
HRESULT WINAPI DirectDrawEnumerateExW( LPDDENUMCALLBACKEXW lpCallback, LPVOID lpContext, DWORD dwFlags) { DirectDrawEnumerateProcData epd; epd.lpCallback = (LPVOID) lpCallback; epd.lpContext = lpContext;
return DirectDrawEnumerateExA(DirectDrawEnumerateExProcW, (LPVOID) &epd, 0); }
What sould I do? 1. copy the entire DirectDrawEnumerateExA into it 2. create a 3rd function DirectDrawEnumerateEx that both of them will call 3. somthing else (you tell me)
Hatky.
__________________________________ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com
Le ven 05/09/2003 à 09:41, hatky a écrit :
Janitorial reporting ;-)
In the Get rid of W->A calls task, Say I try dlls/ddraw/main.c: ddraw: DirectDrawEnumerateExW: illegal call to DirectDrawEnumerateExA
The misbheaving function is :
HRESULT WINAPI DirectDrawEnumerateExW( LPDDENUMCALLBACKEXW lpCallback, LPVOID lpContext, DWORD dwFlags) { DirectDrawEnumerateProcData epd; epd.lpCallback = (LPVOID) lpCallback; epd.lpContext = lpContext;
return
DirectDrawEnumerateExA(DirectDrawEnumerateExProcW, (LPVOID) &epd, 0); }
What sould I do?
- copy the entire DirectDrawEnumerateExA into it
Not exactly.
- create a 3rd function DirectDrawEnumerateEx that
both of them will call
Sometimes it's the way to go, usually not.
- somthing else (you tell me)
Usually, it should be the other way around: A calls W, translating the parameters on the way in (before calling W) and the way out (before returning).
I'm not sure about the exact function(s) to use to do the translation, but I've seen MultiByteToWideChar (or it's reciproqual) used for that a couple of times. There are other functions too (don't know all the details).
Vincent
On Fri, 5 Sep 2003, hatky wrote:
What sould I do?
- copy the entire DirectDrawEnumerateExA into it
- create a 3rd function DirectDrawEnumerateEx that
both of them will call 3. somthing else (you tell me)
It's not always the same answer. Most of the time, you do
3. xxxA converts its argumets to Unicode and calls xxxW There are plenty of examples in the tree how this is done, look for stuff using MultiByteToWideChar(). A good example is DrawTextExA/W in dlls/user/text.c
As for the 1 & 2 they are valid approaches sometimes, but it's best to stay away from them. For most cases 3 works fine.
Let us know if you need any help.