Janitorial dlls/advapi32/registry.c W->A cleanup

Vincent Béron vberon at mecano.gme.usherb.ca
Thu Mar 6 10:43:55 CST 2003


Tony Lambregts a écrit:
> when I change the code to the following
> LONG WINAPI RegSaveKeyA( HKEY hkey, LPCSTR file, LPSECURITY_ATTRIBUTES sa )
> {
>    WCHAR fileW[MAX_PATH];
>    LONG  ret, len;
>      len = WideCharToMultiByte(CP_ACP, 0, fileW, -1, file, 0, NULL, NULL);
>    WideCharToMultiByte(CP_ACP, 0, fileW, -1, file, len, NULL, NULL);
>    ret = RegSaveKeyW( hkey, fileW.Buffer, sa );
>    return ret;
> }
> 
> I get the following warning
> 
> warning: passing arg 5 of `WideCharToMultiByte' discards qualifiers from 
> pointer target type
> 
> WideCharToMultiByte does not like LPCSTR. So what to do?
> 

Of course it doesn't, it's the destination :)
MultiByteToWideChar will do the file ==> fileW conversion.

Vincent




More information about the wine-devel mailing list