Henri Verbeet : d3dx9: Avoid LPCWSTR.
Alexandre Julliard
julliard at winehq.org
Fri Aug 30 11:00:37 CDT 2013
Module: wine
Branch: master
Commit: 82710124e364953789426554481e82faef7be74c
URL: http://source.winehq.org/git/wine.git/?a=commit;h=82710124e364953789426554481e82faef7be74c
Author: Henri Verbeet <hverbeet at codeweavers.com>
Date: Fri Aug 30 08:42:48 2013 +0200
d3dx9: Avoid LPCWSTR.
---
dlls/d3dx9_36/d3dx9_36_private.h | 2 +-
dlls/d3dx9_36/shader.c | 12 ++++++++++--
dlls/d3dx9_36/surface.c | 13 +++++++------
dlls/d3dx9_36/util.c | 2 +-
include/d3dx9core.h | 2 +-
include/d3dx9tex.h | 4 ++--
6 files changed, 22 insertions(+), 13 deletions(-)
diff --git a/dlls/d3dx9_36/d3dx9_36_private.h b/dlls/d3dx9_36/d3dx9_36_private.h
index 08a73c2..451615b 100644
--- a/dlls/d3dx9_36/d3dx9_36_private.h
+++ b/dlls/d3dx9_36/d3dx9_36_private.h
@@ -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;
diff --git a/dlls/d3dx9_36/shader.c b/dlls/d3dx9_36/shader.c
index e3f6d5c..66a38ab 100644
--- a/dlls/d3dx9_36/shader.c
+++ b/dlls/d3dx9_36/shader.c
@@ -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;
diff --git a/dlls/d3dx9_36/surface.c b/dlls/d3dx9_36/surface.c
index 9b76457..2f4499e 100644
--- a/dlls/d3dx9_36/surface.c
+++ b/dlls/d3dx9_36/surface.c
@@ -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);
diff --git a/dlls/d3dx9_36/util.c b/dlls/d3dx9_36/util.c
index 5463e42..1fae956 100644
--- a/dlls/d3dx9_36/util.c
+++ b/dlls/d3dx9_36/util.c
@@ -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;
diff --git a/include/d3dx9core.h b/include/d3dx9core.h
index b6226d6..c28fe71 100644
--- a/include/d3dx9core.h
+++ b/include/d3dx9core.h
@@ -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;
diff --git a/include/d3dx9tex.h b/include/d3dx9tex.h
index d10e01d..295a324 100644
--- a/include/d3dx9tex.h
+++ b/include/d3dx9tex.h
@@ -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);
More information about the wine-cvs
mailing list