--- /dev/null
+
+
+spec2def(hotplug.dll hotplug.spec)
+
+list(APPEND SOURCE
+ hotplug.c
+ enum.c
+ hotplug.rc
+ ${CMAKE_CURRENT_BINARY_DIR}/hotplug.def)
+
+add_library(hotplug SHARED ${SOURCE})
+
+set_module_type(hotplug win32dll UNICODE)
+
+add_importlibs(hotplug
+ msvcrt
+ user32
+ gdi32
+ advapi32
+ ntdll
+ setupapi
+ comctl32
+ kernel32)
+
+add_pch(hotplug hotplug.h)
+add_cd_file(TARGET hotplug DESTINATION reactos/system32 FOR all)
--- /dev/null
+/*
+ * PROJECT: Safely Remove Hardware Applet
+ * LICENSE: GPL - See COPYING in the top level directory
+ * FILE: dll/cpl/hotplug/hotplug.c
+ * PURPOSE: device enumeration
+ * PROGRAMMERS: Johannes Anderwald (janderwald@reactos.org)
+ */
--- /dev/null
+/*
+* PROJECT: Safely Remove Hardware Applet
+* LICENSE: GPL - See COPYING in the top level directory
+* FILE: dll/cpl/hotplug/hotplug.c
+* PURPOSE: applet initialization
+* PROGRAMMERS: Johannes Anderwald (janderwald@reactos.org)
+*/
+
+#include "hotplug.h"
+
+// globals
+HINSTANCE hApplet = 0;
+
+/* Applets */
+APPLET Applets[NUM_APPLETS] =
+{
+ {IDC_CPLICON, IDS_CPLNAME, IDS_CPLDESCRIPTION, InitApplet}
+};
+
+
+LONG
+APIENTRY
+InitApplet(
+ HWND hwnd,
+ UINT uMsg,
+ LPARAM wParam,
+ LPARAM lParam)
+{
+ // TODO
+ return FALSE;
+}
+
+
+LONG
+CALLBACK
+CPlApplet(
+ HWND hwndCPl,
+ UINT uMsg,
+ LPARAM lParam1,
+ LPARAM lParam2)
+{
+ switch(uMsg)
+ {
+ case CPL_INIT:
+ {
+ return TRUE;
+ }
+ case CPL_GETCOUNT:
+ {
+ return NUM_APPLETS;
+ }
+ case CPL_INQUIRE:
+ {
+ CPLINFO *CPlInfo = (CPLINFO*)lParam2;
+ CPlInfo->idIcon = Applets[0].idIcon;
+ CPlInfo->idName = Applets[0].idName;
+ CPlInfo->idInfo = Applets[0].idDescription;
+ break;
+ }
+ case CPL_DBLCLK:
+ {
+ InitApplet(hwndCPl, uMsg, lParam1, lParam2);
+ break;
+ }
+ }
+ return FALSE;
+}
+
+
+INT
+WINAPI
+DllMain(
+ HINSTANCE hinstDLL,
+ DWORD dwReason,
+ LPVOID lpvReserved)
+{
+ UNREFERENCED_PARAMETER(lpvReserved);
+
+ switch(dwReason)
+ {
+ case DLL_PROCESS_ATTACH:
+ case DLL_THREAD_ATTACH:
+ hApplet = hinstDLL;
+ break;
+ }
+ return TRUE;
+}
--- /dev/null
+#pragma once
+
+#define WIN32_NO_STATUS
+#include <stdarg.h>
+#include <windef.h>
+#include <winbase.h>
+#include <wingdi.h>
+#include <winuser.h>
+#include <wincon.h>
+#include <commctrl.h>
+#include <cpl.h>
+#include <tchar.h>
+#include <limits.h>
+
+#include "resource.h"
+
+// Globals
+extern HINSTANCE hApplet;
+
+// defines
+#define NUM_APPLETS (1)
+
+// global structures
+typedef struct
+{
+ int idIcon;
+ int idName;
+ int idDescription;
+ APPLET_PROC AppletProc;
+}APPLET, *PAPPLET;
+
+
+
+// hotplug.c
+LONG
+APIENTRY
+InitApplet(
+ HWND hwnd,
+ UINT uMsg,
+ LPARAM wParam,
+ LPARAM lParam);
--- /dev/null
+/*
+ * PROJECT: ReactOS Safely Remove Hardware Applet
+ * LICENSE: GPL - See COPYING in the top level directory
+ * FILE: dll/cpl/hotplug/hotplug.rc
+ * PURPOSE: main resource file
+ * PROGRAMMERS: Johannes Anderwald (janderwald@reactos.org)
+ */
+
+#include <windef.h>
+#include <winuser.h>
+
+#include "resource.h"
+
+#define REACTOS_VERSION_DLL
+#define REACTOS_STR_FILE_DESCRIPTION "ReactOS Hardware Safe Removal Support\0"
+#define REACTOS_STR_INTERNAL_NAME "hotplug\0"
+#define REACTOS_STR_ORIGINAL_FILENAME "hotplug.dll\0"
+#include <reactos/version.rc>
+
+#include "rsrc.rc"
--- /dev/null
+@ stdcall CPlApplet(ptr long ptr ptr)
+;@ stub HotPlugChildWithInvalidIdW
+;@ stub HotPlugDriverBlockedW
+;@ stub HotPlugEjectDevice
+;@ stub HotPlugEjectDeviceEx
+;@ stub HotPlugEjectVetoedW
+;@ stub HotPlugHibernateVetoedW
+;@ stub HotPlugRemovealVetoedW
+;@ stub HotPlugSafeRemovalDriveNotificationW
+;@ stub HotPlugSafeRemovalNotificationW
+;@ stub HotPlugStandyVetoedW
+;@ stub HotPlugWarmEjectVetoedW
--- /dev/null
+
+// dialog ids
+#define IDD_SAFE_REMOVE_HARDWARE_DIALOG 100
+#define IDD_CONFIRM_STOP_HARDWARE_DIALOG 101
+
+// resource strings ids
+#define IDS_CPLNAME 1000
+#define IDS_CPLDESCRIPTION 1001
+
+// control ids
+#define IDC_CPLICON 10000
--- /dev/null
+LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
+
+#ifdef LANGUAGE_DE_DE
+ #include "lang/de-DE.rc"
+#endif
+#ifdef LANGUAGE_EN_US
+ #include "lang/en-US.rc"
+#endif