diff --git a/configure b/configure
index c2b9fd4aba24a36fae4ace495b53e6fa70131aea..72c6330a4402e144a28ae274a6bb1b911a80565c 100755
--- a/configure
+++ b/configure
@@ -15640,7 +15640,7 @@ MAKE_TEST_RULES=dlls/Maketest.rules
 MAKE_PROG_RULES=programs/Makeprog.rules
 
 
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            ac_config_files="$ac_config_files Make.rules dlls/Makedll.rules dlls/Maketest.rules programs/Makeprog.rules Makefile dlls/Makefile dlls/advapi32/Makefile dlls/advapi32/tests/Makefile dlls/avicap32/Makefile dlls/avifil32/Makefile dlls/cabinet/Makefile dlls/comcat/Makefile dlls/comctl32/Makefile dlls/commdlg/Makefile dlls/crtdll/Makefile dlls/crypt32/Makefile dlls/ctl3d/Makefile dlls/d3d8/Makefile dlls/d3dx8/Makefile dlls/dciman32/Makefile dlls/ddraw/Makefile dlls/devenum/Makefile dlls/dinput/Makefile dlls/dinput8/Makefile dlls/dplay/Makefile dlls/dplayx/Makefile dlls/dsound/Makefile dlls/dsound/tests/Makefile dlls/gdi/Makefile dlls/gdi/tests/Makefile dlls/glu32/Makefile dlls/icmp/Makefile dlls/imagehlp/Makefile dlls/imm32/Makefile dlls/kernel/Makefile dlls/kernel/tests/Makefile dlls/lzexpand/Makefile dlls/mapi32/Makefile dlls/mpr/Makefile dlls/msacm/Makefile dlls/msacm/imaadp32/Makefile dlls/msacm/msadp32/Makefile dlls/msacm/msg711/Makefile dlls/msacm/winemp3/Makefile dlls/msdmo/Makefile dlls/msimg32/Makefile dlls/msisys/Makefile dlls/msnet32/Makefile dlls/msvcrt/Makefile dlls/msvcrt/tests/Makefile dlls/msvcrt20/Makefile dlls/msvideo/Makefile dlls/msvideo/msrle32/Makefile dlls/netapi32/Makefile dlls/netapi32/tests/Makefile dlls/ntdll/Makefile dlls/ntdll/tests/Makefile dlls/odbc32/Makefile dlls/ole32/Makefile dlls/oleaut32/Makefile dlls/oleaut32/tests/Makefile dlls/olecli/Makefile dlls/oledlg/Makefile dlls/olepro32/Makefile dlls/olesvr/Makefile dlls/opengl32/Makefile dlls/psapi/Makefile dlls/qcap/Makefile dlls/quartz/Makefile dlls/rasapi32/Makefile dlls/richedit/Makefile dlls/rpcrt4/Makefile dlls/rpcrt4/tests/Makefile dlls/serialui/Makefile dlls/setupapi/Makefile dlls/shdocvw/Makefile dlls/shell32/Makefile dlls/shell32/tests/Makefile dlls/shfolder/Makefile dlls/shlwapi/Makefile dlls/shlwapi/tests/Makefile dlls/snmpapi/Makefile dlls/sti/Makefile dlls/tapi32/Makefile dlls/ttydrv/Makefile dlls/twain/Makefile dlls/url/Makefile dlls/urlmon/Makefile dlls/urlmon/tests/Makefile dlls/user/Makefile dlls/user/tests/Makefile dlls/version/Makefile dlls/win32s/Makefile dlls/winaspi/Makefile dlls/winedos/Makefile dlls/wineps/Makefile dlls/wininet/Makefile dlls/wininet/tests/Makefile dlls/winmm/Makefile dlls/winmm/joystick/Makefile dlls/winmm/mcianim/Makefile dlls/winmm/mciavi/Makefile dlls/winmm/mcicda/Makefile dlls/winmm/mciseq/Makefile dlls/winmm/mciwave/Makefile dlls/winmm/midimap/Makefile dlls/winmm/tests/Makefile dlls/winmm/wavemap/Makefile dlls/winmm/winealsa/Makefile dlls/winmm/winearts/Makefile dlls/winmm/wineaudioio/Makefile dlls/winmm/winenas/Makefile dlls/winmm/winejack/Makefile dlls/winmm/wineoss/Makefile dlls/winnls/Makefile dlls/winsock/Makefile dlls/winsock/tests/Makefile dlls/winspool/Makefile dlls/winspool/tests/Makefile dlls/wintab32/Makefile dlls/wintrust/Makefile dlls/wow32/Makefile dlls/wsock32/Makefile dlls/x11drv/Makefile documentation/Makefile include/Makefile library/Makefile miscemu/Makefile ole/Makefile programs/Makefile programs/avitools/Makefile programs/clock/Makefile programs/cmdlgtst/Makefile programs/control/Makefile programs/expand/Makefile programs/notepad/Makefile programs/osversioncheck/Makefile programs/progman/Makefile programs/regapi/Makefile programs/regedit/Makefile programs/regsvr32/Makefile programs/regtest/Makefile programs/rpcss/Makefile programs/rundll32/Makefile programs/start/Makefile programs/uninstaller/Makefile programs/view/Makefile programs/wcmd/Makefile programs/wineboot/Makefile programs/wineconsole/Makefile programs/winedbg/Makefile programs/winefile/Makefile programs/winemine/Makefile programs/winepath/Makefile programs/winhelp/Makefile programs/winver/Makefile server/Makefile tools/Makefile tools/widl/Makefile tools/winapi/Makefile tools/winebuild/Makefile tools/winedump/Makefile tools/wmc/Makefile tools/wpp/Makefile tools/wrc/Makefile unicode/Makefile"
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      ac_config_files="$ac_config_files Make.rules dlls/Makedll.rules dlls/Maketest.rules programs/Makeprog.rules Makefile dlls/Makefile dlls/advapi32/Makefile dlls/advapi32/tests/Makefile dlls/avicap32/Makefile dlls/avifil32/Makefile dlls/cabinet/Makefile dlls/comcat/Makefile dlls/comctl32/Makefile dlls/commdlg/Makefile dlls/crtdll/Makefile dlls/crypt32/Makefile dlls/ctl3d/Makefile dlls/d3d8/Makefile dlls/d3dim/Makefile dlls/d3dx8/Makefile dlls/dciman32/Makefile dlls/ddraw/Makefile dlls/devenum/Makefile dlls/dinput/Makefile dlls/dinput8/Makefile dlls/dplay/Makefile dlls/dplayx/Makefile dlls/dsound/Makefile dlls/dsound/tests/Makefile dlls/gdi/Makefile dlls/gdi/tests/Makefile dlls/glu32/Makefile dlls/icmp/Makefile dlls/imagehlp/Makefile dlls/imm32/Makefile dlls/kernel/Makefile dlls/kernel/tests/Makefile dlls/lzexpand/Makefile dlls/mapi32/Makefile dlls/mpr/Makefile dlls/msacm/Makefile dlls/msacm/imaadp32/Makefile dlls/msacm/msadp32/Makefile dlls/msacm/msg711/Makefile dlls/msacm/winemp3/Makefile dlls/msdmo/Makefile dlls/msimg32/Makefile dlls/msisys/Makefile dlls/msnet32/Makefile dlls/msvcrt/Makefile dlls/msvcrt/tests/Makefile dlls/msvcrt20/Makefile dlls/msvideo/Makefile dlls/msvideo/msrle32/Makefile dlls/netapi32/Makefile dlls/netapi32/tests/Makefile dlls/ntdll/Makefile dlls/ntdll/tests/Makefile dlls/odbc32/Makefile dlls/ole32/Makefile dlls/oleaut32/Makefile dlls/oleaut32/tests/Makefile dlls/olecli/Makefile dlls/oledlg/Makefile dlls/olepro32/Makefile dlls/olesvr/Makefile dlls/opengl32/Makefile dlls/psapi/Makefile dlls/qcap/Makefile dlls/quartz/Makefile dlls/rasapi32/Makefile dlls/richedit/Makefile dlls/rpcrt4/Makefile dlls/rpcrt4/tests/Makefile dlls/serialui/Makefile dlls/setupapi/Makefile dlls/shdocvw/Makefile dlls/shell32/Makefile dlls/shell32/tests/Makefile dlls/shfolder/Makefile dlls/shlwapi/Makefile dlls/shlwapi/tests/Makefile dlls/snmpapi/Makefile dlls/sti/Makefile dlls/tapi32/Makefile dlls/ttydrv/Makefile dlls/twain/Makefile dlls/url/Makefile dlls/urlmon/Makefile dlls/urlmon/tests/Makefile dlls/user/Makefile dlls/user/tests/Makefile dlls/version/Makefile dlls/win32s/Makefile dlls/winaspi/Makefile dlls/winedos/Makefile dlls/wineps/Makefile dlls/wininet/Makefile dlls/wininet/tests/Makefile dlls/winmm/Makefile dlls/winmm/joystick/Makefile dlls/winmm/mcianim/Makefile dlls/winmm/mciavi/Makefile dlls/winmm/mcicda/Makefile dlls/winmm/mciseq/Makefile dlls/winmm/mciwave/Makefile dlls/winmm/midimap/Makefile dlls/winmm/tests/Makefile dlls/winmm/wavemap/Makefile dlls/winmm/winealsa/Makefile dlls/winmm/winearts/Makefile dlls/winmm/wineaudioio/Makefile dlls/winmm/winenas/Makefile dlls/winmm/winejack/Makefile dlls/winmm/wineoss/Makefile dlls/winnls/Makefile dlls/winsock/Makefile dlls/winsock/tests/Makefile dlls/winspool/Makefile dlls/winspool/tests/Makefile dlls/wintab32/Makefile dlls/wintrust/Makefile dlls/wow32/Makefile dlls/wsock32/Makefile dlls/x11drv/Makefile documentation/Makefile include/Makefile library/Makefile miscemu/Makefile ole/Makefile programs/Makefile programs/avitools/Makefile programs/clock/Makefile programs/cmdlgtst/Makefile programs/control/Makefile programs/expand/Makefile programs/notepad/Makefile programs/osversioncheck/Makefile programs/progman/Makefile programs/regapi/Makefile programs/regedit/Makefile programs/regsvr32/Makefile programs/regtest/Makefile programs/rpcss/Makefile programs/rundll32/Makefile programs/start/Makefile programs/uninstaller/Makefile programs/view/Makefile programs/wcmd/Makefile programs/wineboot/Makefile programs/wineconsole/Makefile programs/winedbg/Makefile programs/winefile/Makefile programs/winemine/Makefile programs/winepath/Makefile programs/winhelp/Makefile programs/winver/Makefile server/Makefile tools/Makefile tools/widl/Makefile tools/winapi/Makefile tools/winebuild/Makefile tools/winedump/Makefile tools/wmc/Makefile tools/wpp/Makefile tools/wrc/Makefile unicode/Makefile"
 
 
 cat >confcache <<\_ACEOF
@@ -16188,6 +16188,7 @@ do
   "dlls/crypt32/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/crypt32/Makefile" ;;
   "dlls/ctl3d/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/ctl3d/Makefile" ;;
   "dlls/d3d8/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/d3d8/Makefile" ;;
+  "dlls/d3dim/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/d3dim/Makefile" ;;
   "dlls/d3dx8/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/d3dx8/Makefile" ;;
   "dlls/dciman32/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/dciman32/Makefile" ;;
   "dlls/ddraw/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/ddraw/Makefile" ;;
diff --git a/configure.ac b/configure.ac
index f2d1b8365027c21600e0dd9912a78616c9e9b1c1..321d97e5ac5cab7e28601531b963e799009859f9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1394,6 +1394,7 @@ dlls/crtdll/Makefile
 dlls/crypt32/Makefile
 dlls/ctl3d/Makefile
 dlls/d3d8/Makefile
+dlls/d3dim/Makefile
 dlls/d3dx8/Makefile
 dlls/dciman32/Makefile
 dlls/ddraw/Makefile
diff --git a/dlls/Makefile.in b/dlls/Makefile.in
index 434e1844b4e273582b6552ba2ef65a6137b9b8a0..cf43a42d75d1180c9d44c3ce34997b95c32ade02 100644
--- a/dlls/Makefile.in
+++ b/dlls/Makefile.in
@@ -25,6 +25,7 @@ BASEDIRS = \
 	crtdll \
 	crypt32 \
 	ctl3d \
+	d3dim \
 	dciman32 \
 	devenum \
 	dinput \
@@ -191,6 +192,7 @@ all: \
 	crtdll.dll$(DLLEXT) \
 	crypt32.dll$(DLLEXT) \
 	ctl3d32.dll$(DLLEXT) \
+	d3dim.dll$(DLLEXT) \
 	dciman32.dll$(DLLEXT) \
 	devenum.dll$(DLLEXT) \
 	dinput.dll$(DLLEXT) \
@@ -312,6 +314,9 @@ ctl3d32.dll$(DLLEXT) ctl3d.dll$(DLLEXT) ctl3dv2.dll$(DLLEXT): ctl3d/ctl3d32.dll$
 d3d8.dll$(DLLEXT): d3d8/d3d8.dll$(DLLEXT)
 	$(RM) $@ && $(LN_S) d3d8/d3d8.dll$(DLLEXT) $@
 
+d3dim.dll$(DLLEXT): d3dim/d3dim.dll$(DLLEXT)
+	$(RM) $@ && $(LN_S) d3dim/d3dim.dll$(DLLEXT) $@
+
 d3dx8.dll$(DLLEXT): d3dx8/d3dx8.dll$(DLLEXT)
 	$(RM) $@ && $(LN_S) d3dx8/d3dx8.dll$(DLLEXT) $@
 
@@ -603,6 +608,7 @@ IMPORT_LIBS = \
 	libcrypt32 \
 	libctl3d32 \
 	libd3d8 \
+	libd3dim \
 	libd3dx8 \
 	libdciman32 \
 	libddraw \
@@ -730,6 +736,11 @@ libd3d8.def: d3d8/d3d8.spec.def
 libd3d8.a: d3d8/d3d8.spec.def
 	$(DLLTOOL) -k -l $@ -d d3d8/d3d8.spec.def
 
+libd3dim.def: d3dim/d3dim.spec.def
+	$(RM) $@ && $(LN_S) d3dim/d3dim.spec.def $@
+libd3dim.a: d3dim/d3dim.spec.def
+	$(DLLTOOL) -k -l $@ -d d3dim/d3dim.spec.def
+
 libd3dx8.def: d3dx8/d3dx8.spec.def
 	$(RM) $@ && $(LN_S) d3dx8/d3dx8.spec.def $@
 libd3dx8.a: d3dx8/d3dx8.spec.def
@@ -1096,6 +1107,7 @@ crtdll/crtdll.spec.def: $(WINEBUILD)
 crypt32/crypt32.spec.def: $(WINEBUILD)
 ctl3d/ctl3d32.spec.def: $(WINEBUILD)
 d3d8/d3d8.spec.def: $(WINEBUILD)
+d3dim/d3dim.spec.def: $(WINEBUILD)
 d3dx8/d3dx8.spec.def: $(WINEBUILD)
 dciman32/dciman32.spec.def: $(WINEBUILD)
 ddraw/ddraw.spec.def: $(WINEBUILD)
@@ -1184,6 +1196,7 @@ crtdll/crtdll.dll$(DLLEXT): crtdll
 crypt32/crypt32.dll$(DLLEXT): crypt32
 ctl3d/ctl3d32.dll$(DLLEXT): ctl3d
 d3d8/d3d8.dll$(DLLEXT): d3d8
+d3dim/d3dim.dll$(DLLEXT): d3dim
 d3dx8/d3dx8.dll$(DLLEXT): d3dx8
 dciman32/dciman32.dll$(DLLEXT): dciman32
 ddraw/ddraw.dll$(DLLEXT): ddraw
@@ -1288,6 +1301,7 @@ crtdll/__install__: crtdll.dll$(DLLEXT)
 crypt32/__install__: crypt32.dll$(DLLEXT)
 ctl3d/__install__: ctl3d32.dll$(DLLEXT)
 d3d8/__install__: d3d8.dll$(DLLEXT)
+d3dim/__install__: d3dim.dll$(DLLEXT)
 d3dx8/__install__: d3dx8.dll$(DLLEXT)
 dciman32/__install__: dciman32.dll$(DLLEXT)
 ddraw/__install__: ddraw.dll$(DLLEXT)
diff --git a/dlls/d3dim/.cvsignore b/dlls/d3dim/.cvsignore
new file mode 100644
index 0000000000000000000000000000000000000000..e1f5ee9ac7788c1f87cc810bb078993a85ae828b
--- /dev/null
+++ b/dlls/d3dim/.cvsignore
@@ -0,0 +1,5 @@
+Makefile
+d3dim.dll.dbg.c
+d3dim.spec.c
+d3dim.spec.def
+version.res
diff --git a/dlls/d3dim/Makefile.in b/dlls/d3dim/Makefile.in
new file mode 100644
index 0000000000000000000000000000000000000000..4749648aa4e0f31fd45937fe2ef834e16bbf25c6
--- /dev/null
+++ b/dlls/d3dim/Makefile.in
@@ -0,0 +1,17 @@
+TOPSRCDIR = @top_srcdir@
+TOPOBJDIR = ../..
+SRCDIR    = @srcdir@
+VPATH     = @srcdir@
+MODULE    = d3dim.dll
+
+LDDLLFLAGS = @LDDLLFLAGS@
+SYMBOLFILE = $(MODULE).tmp.o
+
+C_SRCS = d3dim_main.c
+
+RC_SRCS = version.rc
+
+@MAKE_DLL_RULES@
+
+### Dependencies:
+
diff --git a/dlls/d3dim/d3dim.spec b/dlls/d3dim/d3dim.spec
new file mode 100644
index 0000000000000000000000000000000000000000..3d863ea30e0ade8f0dafbc85bba60157402ef808
--- /dev/null
+++ b/dlls/d3dim/d3dim.spec
@@ -0,0 +1,13 @@
+@ stub D3DFree
+@ stub D3DMalloc
+@ stub D3DRealloc
+@ stub Direct3DCreateDevice
+@ stub Direct3DCreateTexture
+@ stub Direct3DGetSWRastZPixFmts
+@ stub Direct3DCreate
+@ stub Direct3D_HALCleanUp
+@ stub FlushD3DDevices2
+@ stub FlushD3DDevices
+@ stub PaletteAssociateNotify
+@ stub PaletteUpdateNotify
+@ stub SurfaceFlipNotify
diff --git a/dlls/d3dim/d3dim_main.c b/dlls/d3dim/d3dim_main.c
new file mode 100644
index 0000000000000000000000000000000000000000..67a01ed518c6f0b29539c512ac0e1d5c9e0f5d0f
--- /dev/null
+++ b/dlls/d3dim/d3dim_main.c
@@ -0,0 +1 @@
+/* nothing here yet */
diff --git a/dlls/d3dim/version.rc b/dlls/d3dim/version.rc
new file mode 100644
index 0000000000000000000000000000000000000000..ef15d05b36cfe1c04fe31f5ae047d48e442b191a
--- /dev/null
+++ b/dlls/d3dim/version.rc
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2001 Ove Kaaven
+ *
+ * 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 "Wine Direct3D Immediate Mode Utility Functions"
+#define WINE_FILENAME_STR "d3dim.dll"
+#define WINE_FILEVERSION 4,7,0,0
+#define WINE_FILEVERSION_STR "4.7.0.0"
+#define WINE_PRODUCTVERSION 4,7,0,0
+#define WINE_PRODUCTVERSION_STR "4.7"
+#define WINE_PRODUCTNAME_STR "DirectX"
+
+#include "wine/wine_common_ver.rc"