Commit 2a24b11a authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

d3dx9: Avoid LPWSTR.

parent 0be8e524
...@@ -5531,11 +5531,14 @@ HRESULT WINAPI D3DXCreateEffectFromFileExA(struct IDirect3DDevice9 *device, cons ...@@ -5531,11 +5531,14 @@ HRESULT WINAPI D3DXCreateEffectFromFileExA(struct IDirect3DDevice9 *device, cons
const D3DXMACRO *defines, struct ID3DXInclude *include, const char *skipconstants, DWORD flags, const D3DXMACRO *defines, struct ID3DXInclude *include, const char *skipconstants, DWORD flags,
struct ID3DXEffectPool *pool, struct ID3DXEffect **effect, struct ID3DXBuffer **compilationerrors) struct ID3DXEffectPool *pool, struct ID3DXEffect **effect, struct ID3DXBuffer **compilationerrors)
{ {
LPWSTR srcfileW; WCHAR *srcfileW;
HRESULT ret; HRESULT ret;
DWORD len; DWORD len;
TRACE("(void): relay\n"); TRACE("device %p, srcfile %s, defines %p, include %p, skipconstants %s, "
"flags %#x, pool %p, effect %p, compilationerrors %p.\n",
device, debugstr_a(srcfile), defines, include, debugstr_a(skipconstants),
flags, pool, effect, compilationerrors);
if (!srcfile) if (!srcfile)
return D3DERR_INVALIDCALL; return D3DERR_INVALIDCALL;
...@@ -5660,11 +5663,12 @@ HRESULT WINAPI D3DXCreateEffectCompilerFromFileW(const WCHAR *srcfile, const D3D ...@@ -5660,11 +5663,12 @@ HRESULT WINAPI D3DXCreateEffectCompilerFromFileW(const WCHAR *srcfile, const D3D
HRESULT WINAPI D3DXCreateEffectCompilerFromFileA(const char *srcfile, const D3DXMACRO *defines, HRESULT WINAPI D3DXCreateEffectCompilerFromFileA(const char *srcfile, const D3DXMACRO *defines,
ID3DXInclude *include, DWORD flags, ID3DXEffectCompiler **effectcompiler, ID3DXBuffer **parseerrors) ID3DXInclude *include, DWORD flags, ID3DXEffectCompiler **effectcompiler, ID3DXBuffer **parseerrors)
{ {
LPWSTR srcfileW; WCHAR *srcfileW;
HRESULT ret; HRESULT ret;
DWORD len; DWORD len;
TRACE("(void): relay\n"); TRACE("srcfile %s, defines %p, include %p, flags %#x, effectcompiler %p, parseerrors %p.\n",
debugstr_a(srcfile), defines, include, flags, effectcompiler, parseerrors);
if (!srcfile) if (!srcfile)
return D3DERR_INVALIDCALL; return D3DERR_INVALIDCALL;
......
...@@ -3673,12 +3673,14 @@ HRESULT WINAPI D3DXLoadMeshHierarchyFromXA(const char *filename, DWORD options, ...@@ -3673,12 +3673,14 @@ HRESULT WINAPI D3DXLoadMeshHierarchyFromXA(const char *filename, DWORD options,
struct ID3DXAllocateHierarchy *alloc_hier, struct ID3DXLoadUserData *load_user_data, struct ID3DXAllocateHierarchy *alloc_hier, struct ID3DXLoadUserData *load_user_data,
D3DXFRAME **frame_hierarchy, struct ID3DXAnimationController **anim_controller) D3DXFRAME **frame_hierarchy, struct ID3DXAnimationController **anim_controller)
{ {
WCHAR *filenameW;
HRESULT hr; HRESULT hr;
int len; int len;
LPWSTR filenameW;
TRACE("(%s, %x, %p, %p, %p, %p, %p)\n", debugstr_a(filename), options, TRACE("filename %s, options %#x, device %p, alloc_hier %p, "
device, alloc_hier, load_user_data, frame_hierarchy, anim_controller); "load_user_data %p, frame_hierarchy %p, anim_controller %p.\n",
debugstr_a(filename), options, device, alloc_hier,
load_user_data, frame_hierarchy, anim_controller);
if (!filename) if (!filename)
return D3DERR_INVALIDCALL; return D3DERR_INVALIDCALL;
...@@ -4025,12 +4027,14 @@ HRESULT WINAPI D3DXLoadMeshFromXA(const char *filename, DWORD options, struct ID ...@@ -4025,12 +4027,14 @@ HRESULT WINAPI D3DXLoadMeshFromXA(const char *filename, DWORD options, struct ID
struct ID3DXBuffer **adjacency, struct ID3DXBuffer **materials, struct ID3DXBuffer **effect_instances, struct ID3DXBuffer **adjacency, struct ID3DXBuffer **materials, struct ID3DXBuffer **effect_instances,
DWORD *num_materials, struct ID3DXMesh **mesh) DWORD *num_materials, struct ID3DXMesh **mesh)
{ {
WCHAR *filenameW;
HRESULT hr; HRESULT hr;
int len; int len;
LPWSTR filenameW;
TRACE("(%s, %x, %p, %p, %p, %p, %p, %p)\n", debugstr_a(filename), options, TRACE("filename %s, options %#x, device %p, adjacency %p, materials %p, "
device, adjacency, materials, effect_instances, num_materials, mesh); "effect_instances %p, num_materials %p, mesh %p.\n",
debugstr_a(filename), options, device, adjacency, materials,
effect_instances, num_materials, mesh);
if (!filename) if (!filename)
return D3DERR_INVALIDCALL; return D3DERR_INVALIDCALL;
...@@ -4943,12 +4947,12 @@ HRESULT WINAPI D3DXCreateTeapot(struct IDirect3DDevice9 *device, ...@@ -4943,12 +4947,12 @@ HRESULT WINAPI D3DXCreateTeapot(struct IDirect3DDevice9 *device,
HRESULT WINAPI D3DXCreateTextA(struct IDirect3DDevice9 *device, HDC hdc, const char *text, float deviation, HRESULT WINAPI D3DXCreateTextA(struct IDirect3DDevice9 *device, HDC hdc, const char *text, float deviation,
float extrusion, struct ID3DXMesh **mesh, struct ID3DXBuffer **adjacency, GLYPHMETRICSFLOAT *glyphmetrics) float extrusion, struct ID3DXMesh **mesh, struct ID3DXBuffer **adjacency, GLYPHMETRICSFLOAT *glyphmetrics)
{ {
WCHAR *textW;
HRESULT hr; HRESULT hr;
int len; int len;
LPWSTR textW;
TRACE("(%p, %p, %s, %f, %f, %p, %p, %p)\n", device, hdc, TRACE("device %p, hdc %p, text %s, deviation %.8e, extrusion %.8e, mesh %p, adjacency %p, glyphmetrics %p.\n",
debugstr_a(text), deviation, extrusion, mesh, adjacency, glyphmetrics); device, hdc, debugstr_a(text), deviation, extrusion, mesh, adjacency, glyphmetrics);
if (!text) if (!text)
return D3DERR_INVALIDCALL; return D3DERR_INVALIDCALL;
......
...@@ -284,10 +284,13 @@ struct D3DXIncludeImpl { ...@@ -284,10 +284,13 @@ struct D3DXIncludeImpl {
HRESULT WINAPI D3DXAssembleShaderFromFileA(const char *filename, const D3DXMACRO *defines, HRESULT WINAPI D3DXAssembleShaderFromFileA(const char *filename, const D3DXMACRO *defines,
ID3DXInclude *include, DWORD flags, ID3DXBuffer **shader, ID3DXBuffer **error_messages) ID3DXInclude *include, DWORD flags, ID3DXBuffer **shader, ID3DXBuffer **error_messages)
{ {
LPWSTR filename_w = NULL; WCHAR *filename_w;
DWORD len; DWORD len;
HRESULT ret; HRESULT ret;
TRACE("filename %s, defines %p, include %p, flags %#x, shader %p, error_messages %p.\n",
debugstr_a(filename), defines, include, flags, shader, error_messages);
if (!filename) return D3DXERR_INVALIDDATA; if (!filename) return D3DXERR_INVALIDDATA;
len = MultiByteToWideChar(CP_ACP, 0, filename, -1, NULL, 0); len = MultiByteToWideChar(CP_ACP, 0, filename, -1, NULL, 0);
...@@ -387,10 +390,15 @@ HRESULT WINAPI D3DXCompileShaderFromFileA(const char *filename, const D3DXMACRO ...@@ -387,10 +390,15 @@ HRESULT WINAPI D3DXCompileShaderFromFileA(const char *filename, const D3DXMACRO
ID3DXInclude *include, const char *entrypoint, const char *profile, DWORD flags, ID3DXInclude *include, const char *entrypoint, const char *profile, DWORD flags,
ID3DXBuffer **shader, ID3DXBuffer **error_messages, ID3DXConstantTable **constant_table) ID3DXBuffer **shader, ID3DXBuffer **error_messages, ID3DXConstantTable **constant_table)
{ {
LPWSTR filename_w = NULL; WCHAR *filename_w;
DWORD len; DWORD len;
HRESULT ret; HRESULT ret;
TRACE("filename %s, defines %p, include %p, entrypoint %s, profile %s, "
"flags %#x, shader %p, error_messages %p, constant_table %p.\n",
debugstr_a(filename), defines, include, debugstr_a(entrypoint),
debugstr_a(profile), flags, shader, error_messages, constant_table);
if (!filename) return D3DXERR_INVALIDDATA; if (!filename) return D3DXERR_INVALIDDATA;
len = MultiByteToWideChar(CP_ACP, 0, filename, -1, NULL, 0); len = MultiByteToWideChar(CP_ACP, 0, filename, -1, NULL, 0);
......
...@@ -901,11 +901,11 @@ HRESULT WINAPI D3DXGetImageInfoFromFileInMemory(const void *data, UINT datasize, ...@@ -901,11 +901,11 @@ HRESULT WINAPI D3DXGetImageInfoFromFileInMemory(const void *data, UINT datasize,
*/ */
HRESULT WINAPI D3DXGetImageInfoFromFileA(LPCSTR file, D3DXIMAGE_INFO *info) HRESULT WINAPI D3DXGetImageInfoFromFileA(LPCSTR file, D3DXIMAGE_INFO *info)
{ {
LPWSTR widename; WCHAR *widename;
HRESULT hr; HRESULT hr;
int strlength; int strlength;
TRACE("(%s, %p): relay\n", debugstr_a(file), info); TRACE("file %s, info %p.\n", debugstr_a(file), info);
if( !file ) return D3DERR_INVALIDCALL; if( !file ) return D3DERR_INVALIDCALL;
...@@ -1188,7 +1188,7 @@ HRESULT WINAPI D3DXLoadSurfaceFromFileA(IDirect3DSurface9 *dst_surface, ...@@ -1188,7 +1188,7 @@ HRESULT WINAPI D3DXLoadSurfaceFromFileA(IDirect3DSurface9 *dst_surface,
const PALETTEENTRY *dst_palette, const RECT *dst_rect, const char *src_file, const PALETTEENTRY *dst_palette, const RECT *dst_rect, const char *src_file,
const RECT *src_rect, DWORD filter, D3DCOLOR color_key, D3DXIMAGE_INFO *src_info) const RECT *src_rect, DWORD filter, D3DCOLOR color_key, D3DXIMAGE_INFO *src_info)
{ {
LPWSTR pWidename; WCHAR *src_file_w;
HRESULT hr; HRESULT hr;
int strlength; int strlength;
...@@ -1201,12 +1201,12 @@ HRESULT WINAPI D3DXLoadSurfaceFromFileA(IDirect3DSurface9 *dst_surface, ...@@ -1201,12 +1201,12 @@ HRESULT WINAPI D3DXLoadSurfaceFromFileA(IDirect3DSurface9 *dst_surface,
return D3DERR_INVALIDCALL; return D3DERR_INVALIDCALL;
strlength = MultiByteToWideChar(CP_ACP, 0, src_file, -1, NULL, 0); strlength = MultiByteToWideChar(CP_ACP, 0, src_file, -1, NULL, 0);
pWidename = HeapAlloc(GetProcessHeap(), 0, strlength * sizeof(*pWidename)); src_file_w = HeapAlloc(GetProcessHeap(), 0, strlength * sizeof(*src_file_w));
MultiByteToWideChar(CP_ACP, 0, src_file, -1, pWidename, strlength); MultiByteToWideChar(CP_ACP, 0, src_file, -1, src_file_w, strlength);
hr = D3DXLoadSurfaceFromFileW(dst_surface, dst_palette, dst_rect, hr = D3DXLoadSurfaceFromFileW(dst_surface, dst_palette, dst_rect,
pWidename, src_rect, filter, color_key, src_info); src_file_w, src_rect, filter, color_key, src_info);
HeapFree(GetProcessHeap(), 0, pWidename); HeapFree(GetProcessHeap(), 0, src_file_w);
return hr; return hr;
} }
......
...@@ -719,13 +719,14 @@ HRESULT WINAPI D3DXCreateTextureFromFileExA(struct IDirect3DDevice9 *device, con ...@@ -719,13 +719,14 @@ HRESULT WINAPI D3DXCreateTextureFromFileExA(struct IDirect3DDevice9 *device, con
D3DPOOL pool, DWORD filter, DWORD mipfilter, D3DCOLOR colorkey, D3DXIMAGE_INFO *srcinfo, D3DPOOL pool, DWORD filter, DWORD mipfilter, D3DCOLOR colorkey, D3DXIMAGE_INFO *srcinfo,
PALETTEENTRY *palette, struct IDirect3DTexture9 **texture) PALETTEENTRY *palette, struct IDirect3DTexture9 **texture)
{ {
LPWSTR widename; WCHAR *widename;
HRESULT hr; HRESULT hr;
DWORD len; DWORD len;
TRACE("(%p, %s, %u, %u, %u, %x, %x, %x, %u, %u, %x, %p, %p, %p): relay\n", TRACE("device %p, srcfile %s, width %u, height %u, miplevels %u, usage %#x, format %#x, "
device, debugstr_a(srcfile), width, height, miplevels, usage, format, pool, filter, "pool %#x, filter %#x, mipfilter %#x, colorkey 0x%08x, srcinfo %p, palette %p, texture %p.\n",
mipfilter, colorkey, srcinfo, palette, texture); device, debugstr_a(srcfile), width, height, miplevels, usage, format,
pool, filter, mipfilter, colorkey, srcinfo, palette, texture);
if (!device || !srcfile || !texture) if (!device || !srcfile || !texture)
return D3DERR_INVALIDCALL; return D3DERR_INVALIDCALL;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment