[PATCH] d3dxof: Remove LP stuff and rename variables for IDirectXFile methods.
Christian Costa
titan.costa at gmail.com
Thu Jun 13 15:15:29 CDT 2013
---
dlls/d3dxof/d3dxof.c | 79 +++++++++++++++++++++++++-------------------------
1 file changed, 40 insertions(+), 39 deletions(-)
diff --git a/dlls/d3dxof/d3dxof.c b/dlls/d3dxof/d3dxof.c
index c0bea3c..66e1bac 100644
--- a/dlls/d3dxof/d3dxof.c
+++ b/dlls/d3dxof/d3dxof.c
@@ -73,25 +73,25 @@ static inline IDirectXFileImpl *impl_from_IDirectXFile(IDirectXFile *iface)
}
/*** IUnknown methods ***/
-static HRESULT WINAPI IDirectXFileImpl_QueryInterface(IDirectXFile* iface, REFIID riid, void** ppvObject)
+static HRESULT WINAPI IDirectXFileImpl_QueryInterface(IDirectXFile *iface, REFIID riid, void **object)
{
IDirectXFileImpl *This = impl_from_IDirectXFile(iface);
- TRACE("(%p/%p)->(%s,%p)\n", iface, This, debugstr_guid(riid), ppvObject);
+ TRACE("(%p/%p)->(%s,%p)\n", iface, This, debugstr_guid(riid), object);
if (IsEqualGUID(riid, &IID_IUnknown)
|| IsEqualGUID(riid, &IID_IDirectXFile))
{
IUnknown_AddRef(iface);
- *ppvObject = &This->IDirectXFile_iface;
+ *object = &This->IDirectXFile_iface;
return S_OK;
}
- ERR("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppvObject);
+ ERR("(%p)->(%s,%p),not found\n", iface, debugstr_guid(riid), object);
return E_NOINTERFACE;
}
-static ULONG WINAPI IDirectXFileImpl_AddRef(IDirectXFile* iface)
+static ULONG WINAPI IDirectXFileImpl_AddRef(IDirectXFile *iface)
{
IDirectXFileImpl *This = impl_from_IDirectXFile(iface);
ULONG ref = InterlockedIncrement(&This->ref);
@@ -101,7 +101,7 @@ static ULONG WINAPI IDirectXFileImpl_AddRef(IDirectXFile* iface)
return ref;
}
-static ULONG WINAPI IDirectXFileImpl_Release(IDirectXFile* iface)
+static ULONG WINAPI IDirectXFileImpl_Release(IDirectXFile *iface)
{
IDirectXFileImpl *This = impl_from_IDirectXFile(iface);
ULONG ref = InterlockedDecrement(&This->ref);
@@ -115,7 +115,7 @@ static ULONG WINAPI IDirectXFileImpl_Release(IDirectXFile* iface)
}
/*** IDirectXFile methods ***/
-static HRESULT WINAPI IDirectXFileImpl_CreateEnumObject(IDirectXFile* iface, LPVOID pvSource, DXFILELOADOPTIONS dwLoadOptions, LPDIRECTXFILEENUMOBJECT* ppEnumObj)
+static HRESULT WINAPI IDirectXFileImpl_CreateEnumObject(IDirectXFile *iface, void *source, DXFILELOADOPTIONS load_options, IDirectXFileEnumObject **enum_object)
{
IDirectXFileImpl *This = impl_from_IDirectXFile(iface);
IDirectXFileEnumObjectImpl* object;
@@ -123,28 +123,28 @@ static HRESULT WINAPI IDirectXFileImpl_CreateEnumObject(IDirectXFile* iface, LPV
LPBYTE file_buffer;
DWORD file_size;
- TRACE("(%p/%p)->(%p,%x,%p)\n", This, iface, pvSource, dwLoadOptions, ppEnumObj);
+ TRACE("(%p/%p)->(%p,%x,%p)\n", This, iface, source, load_options, enum_object);
- if (!ppEnumObj)
+ if (!enum_object)
return DXFILEERR_BADVALUE;
/* Only lowest 4 bits are relevant in DXFILELOADOPTIONS */
- dwLoadOptions &= 0xF;
+ load_options &= 0xF;
hr = IDirectXFileEnumObjectImpl_Create(&object);
if (FAILED(hr))
return hr;
- if (dwLoadOptions == DXFILELOAD_FROMFILE)
+ if (load_options == DXFILELOAD_FROMFILE)
{
HANDLE hFile, file_mapping;
- TRACE("Open source file '%s'\n", (char*)pvSource);
+ TRACE("Open source file '%s'\n", (char*)source);
- hFile = CreateFileA(pvSource, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL);
+ hFile = CreateFileA(source, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL);
if (hFile == INVALID_HANDLE_VALUE)
{
- TRACE("File '%s' not found\n", (char*)pvSource);
+ TRACE("File '%s' not found\n", (char*)source);
return DXFILEERR_FILENOTFOUND;
}
@@ -167,24 +167,25 @@ static HRESULT WINAPI IDirectXFileImpl_CreateEnumObject(IDirectXFile* iface, LPV
}
file_buffer = object->mapped_memory;
}
- else if (dwLoadOptions == DXFILELOAD_FROMRESOURCE)
+ else if (load_options == DXFILELOAD_FROMRESOURCE)
{
HRSRC resource_info;
HGLOBAL resource_data;
- LPDXFILELOADRESOURCE lpdxflr = pvSource;
+ DXFILELOADRESOURCE *load_resource = source;
- TRACE("Source in resource (module = %p, name = %s, type = %s\n", lpdxflr->hModule, debugstr_a(lpdxflr->lpName), debugstr_a(lpdxflr->lpType));
+ TRACE("Source in resource (module = %p, name = %s, type = %s\n", load_resource->hModule, debugstr_a(load_resource->lpName),
+ debugstr_a(load_resource->lpType));
- resource_info = FindResourceA(lpdxflr->hModule, lpdxflr->lpName, lpdxflr->lpType);
+ resource_info = FindResourceA(load_resource->hModule, load_resource->lpName, load_resource->lpType);
if (!resource_info)
{
hr = DXFILEERR_RESOURCENOTFOUND;
goto error;
}
- file_size = SizeofResource(lpdxflr->hModule, resource_info);
+ file_size = SizeofResource(load_resource->hModule, resource_info);
- resource_data = LoadResource(lpdxflr->hModule, resource_info);
+ resource_data = LoadResource(load_resource->hModule, resource_info);
if (!resource_data)
{
hr = DXFILEERR_BADRESOURCE;
@@ -198,18 +199,18 @@ static HRESULT WINAPI IDirectXFileImpl_CreateEnumObject(IDirectXFile* iface, LPV
goto error;
}
}
- else if (dwLoadOptions == DXFILELOAD_FROMMEMORY)
+ else if (load_options == DXFILELOAD_FROMMEMORY)
{
- LPDXFILELOADMEMORY lpdxflm = pvSource;
+ DXFILELOADMEMORY *load_memory = source;
- TRACE("Source in memory at %p with size %d\n", lpdxflm->lpMemory, lpdxflm->dSize);
+ TRACE("Source in memory at %p with size %d\n", load_memory->lpMemory, load_memory->dSize);
- file_buffer = lpdxflm->lpMemory;
- file_size = lpdxflm->dSize;
+ file_buffer = load_memory->lpMemory;
+ file_size = load_memory->dSize;
}
else
{
- FIXME("Source type %d is not handled yet\n", dwLoadOptions);
+ FIXME("Source type %d is not handled yet\n", load_options);
hr = DXFILEERR_NOTDONEYET;
goto error;
}
@@ -256,49 +257,49 @@ static HRESULT WINAPI IDirectXFileImpl_CreateEnumObject(IDirectXFile* iface, LPV
DPRINTF("%s - %s\n", This->xtemplates[i].name, debugstr_guid(&This->xtemplates[i].class_id));
}
- *ppEnumObj = &object->IDirectXFileEnumObject_iface;
+ *enum_object = &object->IDirectXFileEnumObject_iface;
return DXFILE_OK;
error:
IDirectXFileEnumObject_Release(&object->IDirectXFileEnumObject_iface);
- *ppEnumObj = NULL;
+ *enum_object = NULL;
return hr;
}
-static HRESULT WINAPI IDirectXFileImpl_CreateSaveObject(IDirectXFile* iface, LPCSTR szFileName, DXFILEFORMAT dwFileFormat, LPDIRECTXFILESAVEOBJECT* ppSaveObj)
+static HRESULT WINAPI IDirectXFileImpl_CreateSaveObject(IDirectXFile *iface, const char *filename, DXFILEFORMAT file_format, IDirectXFileSaveObject **save_object)
{
IDirectXFileImpl *This = impl_from_IDirectXFile(iface);
IDirectXFileSaveObjectImpl *object;
HRESULT hr;
- FIXME("(%p/%p)->(%s,%x,%p) partial stub!\n", This, iface, szFileName, dwFileFormat, ppSaveObj);
+ FIXME("(%p/%p)->(%s,%x,%p) partial stub!\n", This, iface, filename, file_format, save_object);
- if (!szFileName || !ppSaveObj)
+ if (!filename || !save_object)
return E_POINTER;
hr = IDirectXFileSaveObjectImpl_Create(&object);
if (SUCCEEDED(hr))
- *ppSaveObj = &object->IDirectXFileSaveObject_iface;
+ *save_object = &object->IDirectXFileSaveObject_iface;
return hr;
}
-static HRESULT WINAPI IDirectXFileImpl_RegisterTemplates(IDirectXFile* iface, LPVOID pvData, DWORD cbSize)
+static HRESULT WINAPI IDirectXFileImpl_RegisterTemplates(IDirectXFile *iface, void *data, DWORD size)
{
IDirectXFileImpl *This = impl_from_IDirectXFile(iface);
parse_buffer buf;
HRESULT hr;
- LPBYTE decomp_buffer = NULL;
+ BYTE *decomp_buffer = NULL;
ZeroMemory(&buf, sizeof(buf));
- buf.buffer = pvData;
- buf.rem_bytes = cbSize;
+ buf.buffer = data;
+ buf.rem_bytes = size;
buf.pdxf = This;
- TRACE("(%p/%p)->(%p,%d)\n", This, iface, pvData, cbSize);
+ TRACE("(%p/%p)->(%p,%d)\n", This, iface, data, size);
- if (!pvData)
+ if (!data)
return DXFILEERR_BADVALUE;
if (TRACE_ON(d3dxof_dump))
@@ -311,7 +312,7 @@ static HRESULT WINAPI IDirectXFileImpl_RegisterTemplates(IDirectXFile* iface, LP
file = CreateFileA(tmp, GENERIC_WRITE, FILE_SHARE_READ, NULL, CREATE_ALWAYS, 0, NULL);
if (file != INVALID_HANDLE_VALUE)
{
- WriteFile(file, pvData, cbSize, NULL, NULL);
+ WriteFile(file, data, size, NULL, NULL);
CloseHandle(file);
}
}
More information about the wine-patches
mailing list