Commit 7590fe58 authored by Christian Costa's avatar Christian Costa Committed by Alexandre Julliard

Added d3dxof dll, part of Direct3D.

parent 92425aab
......@@ -1512,6 +1512,7 @@ dlls/d3d9/Makefile
dlls/d3dim/Makefile
dlls/d3drm/Makefile
dlls/d3dx8/Makefile
dlls/d3dxof/Makefile
dlls/dbghelp/Makefile
dlls/dciman32/Makefile
dlls/ddraw/Makefile
......
......@@ -32,6 +32,7 @@ BASEDIRS = \
ctl3d \
d3dim \
d3drm \
d3dxof \
dbghelp \
dciman32 \
devenum \
......@@ -250,6 +251,7 @@ SYMLINKS_SO = \
ctl3d32.dll.so \
d3dim.dll.so \
d3drm.dll.so \
d3dxof.dll.so \
dbghelp.dll.so \
dciman32.dll.so \
devenum.dll.so \
......@@ -458,6 +460,9 @@ d3drm.dll.so: d3drm/d3drm.dll.so
d3dx8.dll.so: d3dx8/d3dx8.dll.so
$(RM) $@ && $(LN_S) d3dx8/d3dx8.dll.so $@
d3dxof.dll.so: d3dxof/d3dxof.dll.so
$(RM) $@ && $(LN_S) d3dxof/d3dxof.dll.so $@
dbghelp.dll.so: dbghelp/dbghelp.dll.so
$(RM) $@ && $(LN_S) dbghelp/dbghelp.dll.so $@
......@@ -957,6 +962,7 @@ IMPORT_LIBS = \
libd3dim \
libd3drm \
libd3dx8 \
libd3dxof \
libdbghelp \
libdciman32 \
libddraw \
......@@ -1163,6 +1169,11 @@ libd3dx8.def: d3dx8/d3dx8.spec.def
libd3dx8.a: d3dx8/d3dx8.spec.def
$(DLLTOOL) -k -l $@ -d d3dx8/d3dx8.spec.def
libd3dxof.def: d3dxof/d3dxof.spec.def
$(RM) $@ && $(LN_S) d3dxof/d3dxof.spec.def $@
libd3dxof.a: d3dxof/d3dxof.spec.def
$(DLLTOOL) -k -l $@ -d d3dxof/d3dxof.spec.def
libdbghelp.def: dbghelp/dbghelp.spec.def
$(RM) $@ && $(LN_S) dbghelp/dbghelp.spec.def $@
libdbghelp.a: dbghelp/dbghelp.spec.def
......@@ -1687,6 +1698,7 @@ d3d9/d3d9.spec.def: $(WINEBUILD)
d3dim/d3dim.spec.def: $(WINEBUILD)
d3drm/d3drm.spec.def: $(WINEBUILD)
d3dx8/d3dx8.spec.def: $(WINEBUILD)
d3dxof/d3dxof.spec.def: $(WINEBUILD)
dbghelp/dbghelp.spec.def: $(WINEBUILD)
dciman32/dciman32.spec.def: $(WINEBUILD)
ddraw/ddraw.spec.def: $(WINEBUILD)
......@@ -1813,6 +1825,7 @@ d3d9/d3d9.dll.so: d3d9
d3dim/d3dim.dll.so: d3dim
d3drm/d3drm.dll.so: d3drm
d3dx8/d3dx8.dll.so: d3dx8
d3dxof/d3dxof.dll.so: d3dxof
dbghelp/dbghelp.dll.so: dbghelp
dciman32/dciman32.dll.so: dciman32
ddraw/ddraw.dll.so: ddraw
......
Makefile
d3dxof.dll.dbg.c
d3dxof.spec.def
version.res
TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = d3dxof.dll
IMPORTS = ole32 user32 advapi32 kernel32
EXTRALIBS = -ldxguid -luuid
C_SRCS = \
main.c \
d3dxof.c \
regsvr.c
RC_SRCS = version.rc
@MAKE_DLL_RULES@
### Dependencies:
@ stdcall DirectXFileCreate(ptr)
@ stdcall -private DllCanUnloadNow() D3DXOF_DllCanUnloadNow
@ stdcall -private DllGetClassObject(ptr ptr ptr) D3DXOF_DllGetClassObject
/*
* DirectX File private interfaces (D3DXOF.DLL)
*
* Copyright 2004 Christian Costa
*
* This file contains the (internal) driver registration functions,
* driver enumeration APIs and DirectDraw creation functions.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __D3DXOF_PRIVATE_INCLUDED__
#define __D3DXOF_PRIVATE_INCLUDED__
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "wtypes.h"
#include "wingdi.h"
#include "winuser.h"
#include "dxfile.h"
HRESULT XF_create(IUnknown *pUnkOuter, LPVOID *ppObj);
typedef struct {
IDirectXFile lpVtbl;
int ref;
} IDirectXFileImpl;
typedef struct {
IDirectXFileBinary lpVtbl;
int ref;
} IDirectXFileBinaryImpl;
typedef struct {
IDirectXFileData lpVtbl;
int ref;
} IDirectXFileDataImpl;
typedef struct {
IDirectXFileDataReference lpVtbl;
int ref;
} IDirectXFileDataReferenceImpl;
typedef struct {
IDirectXFileObject lpVtbl;
int ref;
} IDirectXFileObjectImpl;
typedef struct {
IDirectXFileEnumObject lpVtbl;
int ref;
} IDirectXFileEnumObjectImpl;
typedef struct {
IDirectXFileSaveObject lpVtbl;
int ref;
} IDirectXFileSaveObjectImpl;
#endif /* __D3DXOF_PRIVATE_INCLUDED__ */
/*
* DirectX Files Functions (D3DXOF.DLL)
*
* Copyright 2004 Christian Costa
*
* This file contains the (internal) driver registration functions,
* driver enumeration APIs and DirectDraw creation functions.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#define COM_NO_WINDOWS_H
#include <stdarg.h>
#include <string.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "winreg.h"
#include "winerror.h"
#include "ole2.h"
#include "uuids.h"
#include "d3dxof_private.h"
#include "dxfile.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(d3dxof);
static DWORD dll_ref = 0;
/* For the moment, do nothing here. */
BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv)
{
switch(fdwReason) {
case DLL_PROCESS_ATTACH:
DisableThreadLibraryCalls(hInstDLL);
break;
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}
/******************************************************************************
* DirectX File ClassFactory
*/
typedef struct {
IClassFactory ITF_IClassFactory;
DWORD ref;
HRESULT (*pfnCreateInstance)(IUnknown *pUnkOuter, LPVOID *ppObj);
} IClassFactoryImpl;
struct object_creation_info
{
const CLSID *clsid;
HRESULT (*pfnCreateInstance)(IUnknown *pUnkOuter, LPVOID *ppObj);
};
static const struct object_creation_info object_creation[] =
{
{ &CLSID_CDirectXFile, XF_create },
};
static HRESULT WINAPI XFCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IClassFactoryImpl,iface);
if (IsEqualGUID(riid, &IID_IUnknown)
|| IsEqualGUID(riid, &IID_IClassFactory))
{
IClassFactory_AddRef(iface);
*ppobj = This;
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
static ULONG WINAPI XFCF_AddRef(LPCLASSFACTORY iface)
{
ICOM_THIS(IClassFactoryImpl,iface);
return ++(This->ref);
}
static ULONG WINAPI XFCF_Release(LPCLASSFACTORY iface)
{
ICOM_THIS(IClassFactoryImpl,iface);
ULONG ref = --This->ref;
if (ref == 0)
HeapFree(GetProcessHeap(), 0, This);
return ref;
}
static HRESULT WINAPI XFCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IClassFactoryImpl,iface);
HRESULT hres;
LPUNKNOWN punk;
TRACE("(%p)->(%p,%s,%p)\n",This,pOuter,debugstr_guid(riid),ppobj);
hres = This->pfnCreateInstance(pOuter, (LPVOID *) &punk);
if (FAILED(hres)) {
*ppobj = NULL;
return hres;
}
hres = IUnknown_QueryInterface(punk, riid, ppobj);
if (FAILED(hres)) {
*ppobj = NULL;
return hres;
}
IUnknown_Release(punk);
return hres;
}
static HRESULT WINAPI XFCF_LockServer(LPCLASSFACTORY iface, BOOL dolock)
{
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%d),stub!\n",This,dolock);
return S_OK;
}
static ICOM_VTABLE(IClassFactory) XFCF_Vtbl =
{
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
XFCF_QueryInterface,
XFCF_AddRef,
XFCF_Release,
XFCF_CreateInstance,
XFCF_LockServer
};
/***********************************************************************
* DirectXFileCreate (D3DXOF.@)
*/
HRESULT WINAPI DirectXFileCreate(LPDIRECTXFILE* lplpDirectXFile)
{
HRESULT hr;
FIXME("(%p) Stub\n", lplpDirectXFile);
if (!lplpDirectXFile)
return DXFILEERR_BADVALUE;
hr = XF_create(NULL, (LPVOID)lplpDirectXFile);
if (FAILED(hr))
return DXFILEERR_BADALLOC;
return S_OK;
}
/*******************************************************************************
* DllGetClassObject [D3DXOF.@]
* Retrieves class object from a DLL object
*
* NOTES
* Docs say returns STDAPI
*
* PARAMS
* rclsid [I] CLSID for the class object
* riid [I] Reference to identifier of interface for class object
* ppv [O] Address of variable to receive interface pointer for riid
*
* RETURNS
* Success: S_OK
* Failure: CLASS_E_CLASSNOTAVAILABLE, E_OUTOFMEMORY, E_INVALIDARG,
* E_UNEXPECTED
*/
DWORD WINAPI D3DXOF_DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
{
int i;
IClassFactoryImpl *factory;
TRACE("(%s,%s,%p)\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
if ( !IsEqualGUID( &IID_IClassFactory, riid )
&& ! IsEqualGUID( &IID_IUnknown, riid) )
return E_NOINTERFACE;
for (i=0; i < sizeof(object_creation)/sizeof(object_creation[0]); i++)
{
if (IsEqualGUID(object_creation[i].clsid, rclsid))
break;
}
if (i == sizeof(object_creation)/sizeof(object_creation[0]))
{
FIXME("%s: no class found.\n", debugstr_guid(rclsid));
return CLASS_E_CLASSNOTAVAILABLE;
}
factory = HeapAlloc(GetProcessHeap(), 0, sizeof(*factory));
if (factory == NULL) return E_OUTOFMEMORY;
factory->ITF_IClassFactory.lpVtbl = &XFCF_Vtbl;
factory->ref = 1;
factory->pfnCreateInstance = object_creation[i].pfnCreateInstance;
*ppv = &(factory->ITF_IClassFactory);
return S_OK;
}
/***********************************************************************
* DllCanUnloadNow (D3DXOF.@)
*/
HRESULT WINAPI D3DXOF_DllCanUnloadNow()
{
return dll_ref != 0 ? S_FALSE : S_OK;
}
/*
* Copyright (c) 2004 Christian Costa
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#define WINE_FILEDESCRIPTION_STR "DirectX Files dll"
#define WINE_FILENAME_STR "d3dxof.dll"
#define WINE_FILEVERSION 5,0,2135,1
#define WINE_FILEVERSION_STR "5.0.2135.1"
#define WINE_PRODUCTVERSION 5,0,2135,1
#define WINE_PRODUCTVERSION_STR "5.0.2135.1"
#define WINE_PRODUCTNAME_STR "Direct3D"
#include "wine/wine_common_ver.rc"
......@@ -44,3 +44,4 @@
#include "dplobby.h"
#include "dinput.h"
#include "ddrawi.h"
#include "dxfile.h"
......@@ -41,6 +41,7 @@ WINE REGISTRY Version 2
"mcianim.drv" = "native, builtin"
"msi" = "native, builtin"
"d3drm" = "native, builtin"
"d3dxof" = "native, builtin"
"dpnhpast" = "native, builtin"
; you can specify applications too
; this one will apply for all notepad.exe
......
......@@ -93,6 +93,7 @@ WINDOWS_INCLUDES = \
dxdiag.h \
dxerr8.h \
dxerr9.h \
dxfile.h \
evcode.h \
excpt.h \
fci.h \
......
......@@ -2005,6 +2005,7 @@ HKLM,%CurrentVersion%\Telephony\Country List\998,"SameAreaRule",,"G"
11,,avifil32.dll,1
11,,amstream.dll,1
11,,comcat.dll,1
11,,d3dxof.dll,1
11,,ddraw.dll,1
11,,devenum.dll,1
11,,dinput.dll,1
......
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