d3dx9: Use size of variable instead of type.
This commit is contained in:
parent
be43a5c414
commit
bb88fada4b
|
@ -1137,7 +1137,7 @@ HRESULT WINAPI D3DXCreateEffectFromFileExA(LPDIRECT3DDEVICE9 device, LPCSTR srcf
|
||||||
return D3DERR_INVALIDCALL;
|
return D3DERR_INVALIDCALL;
|
||||||
|
|
||||||
len = MultiByteToWideChar(CP_ACP, 0, srcfile, -1, NULL, 0);
|
len = MultiByteToWideChar(CP_ACP, 0, srcfile, -1, NULL, 0);
|
||||||
srcfileW = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len * sizeof(WCHAR));
|
srcfileW = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len * sizeof(*srcfileW));
|
||||||
MultiByteToWideChar(CP_ACP, 0, srcfile, -1, srcfileW, len);
|
MultiByteToWideChar(CP_ACP, 0, srcfile, -1, srcfileW, len);
|
||||||
|
|
||||||
ret = D3DXCreateEffectFromFileExW(device, srcfileW, defines, include, skipconstants, flags, pool, effect, compilationerrors);
|
ret = D3DXCreateEffectFromFileExW(device, srcfileW, defines, include, skipconstants, flags, pool, effect, compilationerrors);
|
||||||
|
@ -1274,7 +1274,7 @@ HRESULT WINAPI D3DXCreateEffectCompilerFromFileA(LPCSTR srcfile, const D3DXMACRO
|
||||||
return D3DERR_INVALIDCALL;
|
return D3DERR_INVALIDCALL;
|
||||||
|
|
||||||
len = MultiByteToWideChar(CP_ACP, 0, srcfile, -1, NULL, 0);
|
len = MultiByteToWideChar(CP_ACP, 0, srcfile, -1, NULL, 0);
|
||||||
srcfileW = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len * sizeof(WCHAR));
|
srcfileW = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len * sizeof(*srcfileW));
|
||||||
MultiByteToWideChar(CP_ACP, 0, srcfile, -1, srcfileW, len);
|
MultiByteToWideChar(CP_ACP, 0, srcfile, -1, srcfileW, len);
|
||||||
|
|
||||||
ret = D3DXCreateEffectCompilerFromFileW(srcfileW, defines, include, flags, effectcompiler, parseerrors);
|
ret = D3DXCreateEffectCompilerFromFileW(srcfileW, defines, include, flags, effectcompiler, parseerrors);
|
||||||
|
|
Loading…
Reference in New Issue