diff --git a/configure b/configure
index c178d924c70dabe28f539a2d624091ec7ef79485..89cbede0d73ae85bce0a3890f98f0ab0c5d5abb4 100755
--- a/configure
+++ b/configure
@@ -15395,6 +15395,7 @@ wine_fn_config_program ngen enable_ngen install
 wine_fn_config_program notepad enable_notepad po,install,installbin
 wine_fn_config_program oleview enable_oleview po,install
 wine_fn_config_program ping enable_ping install
+wine_fn_config_program plugplay enable_plugplay install
 wine_fn_config_program progman enable_progman po,install
 wine_fn_config_program reg enable_reg po,install
 wine_fn_config_program regedit enable_regedit po,install,installbin
diff --git a/configure.ac b/configure.ac
index b4be2994c08512a0ae748b734db21c67f1e1c57c..48ed667fbfe552a62856ede75744035c53e33576 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2896,6 +2896,7 @@ WINE_CONFIG_PROGRAM(ngen,,[install])
 WINE_CONFIG_PROGRAM(notepad,,[po,install,installbin])
 WINE_CONFIG_PROGRAM(oleview,,[po,install])
 WINE_CONFIG_PROGRAM(ping,,[install])
+WINE_CONFIG_PROGRAM(plugplay,,[install])
 WINE_CONFIG_PROGRAM(progman,,[po,install])
 WINE_CONFIG_PROGRAM(reg,,[po,install])
 WINE_CONFIG_PROGRAM(regedit,,[po,install,installbin])
diff --git a/programs/plugplay/Makefile.in b/programs/plugplay/Makefile.in
new file mode 100644
index 0000000000000000000000000000000000000000..bbe06dd474cb0ffdfa10fde9fdbd7330f7a8fcd8
--- /dev/null
+++ b/programs/plugplay/Makefile.in
@@ -0,0 +1,9 @@
+EXTRADEFS = -DWINE_NO_UNICODE_MACROS
+MODULE    = plugplay.exe
+APPMODE   = -mconsole -municode
+IMPORTS   = advapi32
+
+C_SRCS = \
+	main.c
+
+@MAKE_PROG_RULES@
diff --git a/programs/plugplay/main.c b/programs/plugplay/main.c
new file mode 100644
index 0000000000000000000000000000000000000000..cbf01d5bf43868945163604992ec7977bde22af7
--- /dev/null
+++ b/programs/plugplay/main.c
@@ -0,0 +1,99 @@
+/*
+ * Copyright 2011 Hans Leidekker for CodeWeavers
+ *
+ * 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#define WIN32_LEAN_AND_MEAN
+
+#include <windows.h>
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(plugplay);
+
+static WCHAR plugplayW[] = {'P','l','u','g','P','l','a','y',0};
+
+static SERVICE_STATUS_HANDLE service_handle;
+static HANDLE stop_event;
+
+static DWORD WINAPI service_handler( DWORD ctrl, DWORD event_type, LPVOID event_data, LPVOID context )
+{
+    SERVICE_STATUS status;
+
+    status.dwServiceType             = SERVICE_WIN32;
+    status.dwControlsAccepted        = SERVICE_ACCEPT_STOP;
+    status.dwWin32ExitCode           = 0;
+    status.dwServiceSpecificExitCode = 0;
+    status.dwCheckPoint              = 0;
+    status.dwWaitHint                = 0;
+
+    switch(ctrl)
+    {
+    case SERVICE_CONTROL_STOP:
+    case SERVICE_CONTROL_SHUTDOWN:
+        WINE_TRACE( "shutting down\n" );
+        status.dwCurrentState     = SERVICE_STOP_PENDING;
+        status.dwControlsAccepted = 0;
+        SetServiceStatus( service_handle, &status );
+        SetEvent( stop_event );
+        return NO_ERROR;
+    default:
+        WINE_FIXME( "got service ctrl %x\n", ctrl );
+        status.dwCurrentState = SERVICE_RUNNING;
+        SetServiceStatus( service_handle, &status );
+        return NO_ERROR;
+    }
+}
+
+static void WINAPI ServiceMain( DWORD argc, LPWSTR *argv )
+{
+    SERVICE_STATUS status;
+
+    WINE_TRACE( "starting service\n" );
+
+    stop_event = CreateEventW( NULL, TRUE, FALSE, NULL );
+
+    service_handle = RegisterServiceCtrlHandlerExW( plugplayW, service_handler, NULL );
+    if (!service_handle)
+        return;
+
+    status.dwServiceType             = SERVICE_WIN32;
+    status.dwCurrentState            = SERVICE_RUNNING;
+    status.dwControlsAccepted        = SERVICE_ACCEPT_STOP | SERVICE_ACCEPT_SHUTDOWN;
+    status.dwWin32ExitCode           = 0;
+    status.dwServiceSpecificExitCode = 0;
+    status.dwCheckPoint              = 0;
+    status.dwWaitHint                = 10000;
+    SetServiceStatus( service_handle, &status );
+
+    WaitForSingleObject( stop_event, INFINITE );
+
+    status.dwCurrentState     = SERVICE_STOPPED;
+    status.dwControlsAccepted = 0;
+    SetServiceStatus( service_handle, &status );
+    WINE_TRACE( "service stopped\n" );
+}
+
+int wmain( int argc, WCHAR *argv[] )
+{
+    static const SERVICE_TABLE_ENTRYW service_table[] =
+    {
+        { plugplayW, ServiceMain },
+        { NULL, NULL }
+    };
+
+    StartServiceCtrlDispatcherW( service_table );
+    return 0;
+}
diff --git a/tools/wine.inf.in b/tools/wine.inf.in
index b2667af001f6a54da3f19e3e5f57845ac9d1196a..4c06900bbf0548a7f6c0b8d09933020cd1b2eafc 100644
--- a/tools/wine.inf.in
+++ b/tools/wine.inf.in
@@ -127,16 +127,19 @@ AddReg=\
 AddService=MountMgr,0x800,MountMgrService
 AddService=Spooler,0,SpoolerService
 AddService=TermService,0,TerminalServices
+AddService=PlugPlay,0,PlugPlayService
 
 [DefaultInstall.NT.Services]
 AddService=MountMgr,0x800,MountMgrService
 AddService=Spooler,0,SpoolerService
 AddService=TermService,0,TerminalServices
+AddService=PlugPlay,0,PlugPlayService
 
 [DefaultInstall.ntamd64.Services]
 AddService=MountMgr,0x800,MountMgrService
 AddService=Spooler,0,SpoolerService
 AddService=TermService,0,TerminalServices
+AddService=PlugPlay,0,PlugPlayService
 
 [Strings]
 MciExtStr="Software\Microsoft\Windows NT\CurrentVersion\MCI Extensions"
@@ -3009,6 +3012,14 @@ ServiceType=32
 StartType=3
 ErrorControl=1
 
+[PlugPlayService]
+Description="Enables automatic configuration of devices"
+DisplayName="Plug and Play Service"
+ServiceBinary="%11%\plugplay.exe"
+ServiceType=32
+StartType=2
+ErrorControl=1
+
 [Services]
 HKLM,%CurrentVersion%\RunServices,"winemenubuilder",2,"%11%\winemenubuilder.exe -a -r"
 HKLM,"System\CurrentControlSet\Services\VxD\MSTCP",,16