d3dx9: Avoid LPCWSTR.

This commit is contained in:
Henri Verbeet 2013-08-30 08:42:48 +02:00 committed by Alexandre Julliard
parent 7175367ad5
commit 82710124e3
6 changed files with 22 additions and 13 deletions

View File

@ -67,7 +67,7 @@ struct pixel_format_desc {
void (*to_rgba)(const struct vec4 *src, struct vec4 *dst, const PALETTEENTRY *palette);
};
HRESULT map_view_of_file(LPCWSTR filename, LPVOID *buffer, DWORD *length) DECLSPEC_HIDDEN;
HRESULT map_view_of_file(const WCHAR *filename, void **buffer, DWORD *length) DECLSPEC_HIDDEN;
HRESULT load_resource_into_memory(HMODULE module, HRSRC resinfo, LPVOID *buffer, DWORD *length) DECLSPEC_HIDDEN;
HRESULT write_buffer_to_file(const WCHAR *filename, ID3DXBuffer *buffer) DECLSPEC_HIDDEN;

View File

@ -347,7 +347,10 @@ HRESULT WINAPI D3DXAssembleShaderFromResourceW(HMODULE module, const WCHAR *reso
HRSRC res;
DWORD len;
if (!(res = FindResourceW(module, resource, (LPCWSTR)RT_RCDATA)))
TRACE("module %p, resource %s, defines %p, include %p, flags %#x, shader %p, error_messages %p.\n",
module, debugstr_w(resource), defines, include, flags, shader, error_messages);
if (!(res = FindResourceW(module, resource, (const WCHAR *)RT_RCDATA)))
return D3DXERR_INVALIDDATA;
if (FAILED(load_resource_into_memory(module, res, &buffer, &len)))
return D3DXERR_INVALIDDATA;
@ -468,7 +471,12 @@ HRESULT WINAPI D3DXCompileShaderFromResourceW(HMODULE module, const WCHAR *resou
HRSRC res;
DWORD len;
if (!(res = FindResourceW(module, resource, (LPCWSTR)RT_RCDATA)))
TRACE("module %p, resource %s, defines %p, include %p, entrypoint %s, profile %s, "
"flags %#x, shader %p, error_messages %p, constant_table %p.\n",
module, debugstr_w(resource), defines, include, debugstr_a(entrypoint), debugstr_a(profile),
flags, shader, error_messages, constant_table);
if (!(res = FindResourceW(module, resource, (const WCHAR *)RT_RCDATA)))
return D3DXERR_INVALIDDATA;
if (FAILED(load_resource_into_memory(module, res, &buffer, &len)))
return D3DXERR_INVALIDDATA;

View File

@ -919,18 +919,19 @@ HRESULT WINAPI D3DXGetImageInfoFromFileA(LPCSTR file, D3DXIMAGE_INFO *info)
return hr;
}
HRESULT WINAPI D3DXGetImageInfoFromFileW(LPCWSTR file, D3DXIMAGE_INFO *info)
HRESULT WINAPI D3DXGetImageInfoFromFileW(const WCHAR *file, D3DXIMAGE_INFO *info)
{
void *buffer;
HRESULT hr;
DWORD size;
LPVOID buffer;
TRACE("(%s, %p): relay\n", debugstr_w(file), info);
TRACE("file %s, info %p.\n", debugstr_w(file), info);
if( !file ) return D3DERR_INVALIDCALL;
if (!file)
return D3DERR_INVALIDCALL;
hr = map_view_of_file(file, &buffer, &size);
if(FAILED(hr)) return D3DXERR_INVALIDDATA;
if (FAILED(map_view_of_file(file, &buffer, &size)))
return D3DXERR_INVALIDDATA;
hr = D3DXGetImageInfoFromFileInMemory(buffer, size, info);
UnmapViewOfFile(buffer);

View File

@ -108,7 +108,7 @@ static const struct pixel_format_desc formats[] =
* The caller must UnmapViewOfFile when it doesn't need the data anymore
*
*/
HRESULT map_view_of_file(LPCWSTR filename, LPVOID *buffer, DWORD *length)
HRESULT map_view_of_file(const WCHAR *filename, void **buffer, DWORD *length)
{
HANDLE hfile, hmapping = NULL;

View File

@ -144,7 +144,7 @@ DECLARE_INTERFACE_(ID3DXFont, IUnknown)
STDMETHOD(PreloadCharacters)(THIS_ UINT first, UINT last) PURE;
STDMETHOD(PreloadGlyphs)(THIS_ UINT first, UINT last) PURE;
STDMETHOD(PreloadTextA)(THIS_ LPCSTR string, INT count) PURE;
STDMETHOD(PreloadTextW)(THIS_ LPCWSTR string, INT count) PURE;
STDMETHOD(PreloadTextW)(THIS_ const WCHAR *string, INT count) PURE;
STDMETHOD_(INT, DrawTextA)(THIS_ struct ID3DXSprite *sprite, const char *string,
INT count, RECT *rect, DWORD format, D3DCOLOR color) PURE;

View File

@ -93,11 +93,11 @@ extern "C" {
/* Image Information */
HRESULT WINAPI D3DXGetImageInfoFromFileA(LPCSTR file, D3DXIMAGE_INFO *info);
HRESULT WINAPI D3DXGetImageInfoFromFileW(LPCWSTR file, D3DXIMAGE_INFO *info);
HRESULT WINAPI D3DXGetImageInfoFromFileW(const WCHAR *file, D3DXIMAGE_INFO *info);
#define D3DXGetImageInfoFromFile WINELIB_NAME_AW(D3DXGetImageInfoFromFile)
HRESULT WINAPI D3DXGetImageInfoFromResourceA(HMODULE module, LPCSTR resource, D3DXIMAGE_INFO *info);
HRESULT WINAPI D3DXGetImageInfoFromResourceW(HMODULE module, LPCWSTR resource, D3DXIMAGE_INFO *info);
HRESULT WINAPI D3DXGetImageInfoFromResourceW(HMODULE module, const WCHAR *resource, D3DXIMAGE_INFO *info);
#define D3DXGetImageInfoFromResource WINELIB_NAME_AW(D3DXGetImageInfoFromResource)
HRESULT WINAPI D3DXGetImageInfoFromFileInMemory(LPCVOID data, UINT datasize, D3DXIMAGE_INFO *info);