[2/4] d3dx9: D3DXAssembleShader and D3DXAssembleShaderFromFile stubs

Henri Verbeet hverbeet at gmail.com
Mon Aug 24 02:28:50 CDT 2009


2009/8/21 Matteo Bruni <matteo.mystral at gmail.com>:
>
> +HRESULT WINAPI D3DXAssembleShaderFromFileA(LPCSTR pSrcFile,
> +                                           CONST D3DXMACRO* pDefines,
> +                                           LPD3DXINCLUDE pInclude,
> +                                           DWORD Flags,
> +                                           LPD3DXBUFFER* ppShader,
> +                                           LPD3DXBUFFER* ppErrorMsgs)
> +{
> +    LPWSTR pSrcFileW = NULL;
> +    DWORD len;
> +    HRESULT ret;
> +
> +    if (!pSrcFile) return D3DXERR_INVALIDDATA;
> +
> +    len = MultiByteToWideChar( CP_ACP, 0, pSrcFile, -1, NULL, 0 );
> +    pSrcFileW = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) );
> +    MultiByteToWideChar( CP_ACP, 0, pSrcFile, -1, pSrcFileW, len );
> +    ret=D3DXAssembleShaderFromFileW(pSrcFileW, pDefines, pInclude, Flags, ppShader, ppErrorMsgs);
> +    HeapFree( GetProcessHeap(), 0, pSrcFileW );
> +    return ret;
> +}

It doesn't matter much which style you pick, but please try to keep it
consistent (applies to the other patches as well). Note that
HeapAlloc() might fail. Oh, and please don't use hungarian notation.



More information about the wine-devel mailing list