Add "Add hardware" control panel applet.
Not added to the build, as InstallNewDevice in newdev.dll is not
implemented
Modified: trunk/reactos/baseaddress.xml
Added: trunk/reactos/lib/cpl/hdwwiz/
Added: trunk/reactos/lib/cpl/hdwwiz/En.rc
Added: trunk/reactos/lib/cpl/hdwwiz/Fr.rc
Added: trunk/reactos/lib/cpl/hdwwiz/hdwwiz.c
Added: trunk/reactos/lib/cpl/hdwwiz/hdwwiz.def
Added: trunk/reactos/lib/cpl/hdwwiz/hdwwiz.h
Added: trunk/reactos/lib/cpl/hdwwiz/hdwwiz.rc
Added: trunk/reactos/lib/cpl/hdwwiz/hdwwiz.xml
Added: trunk/reactos/lib/cpl/hdwwiz/resource.h
Added: trunk/reactos/lib/cpl/hdwwiz/resources/
Added: trunk/reactos/lib/cpl/hdwwiz/resources/applet.ico
_____
Modified: trunk/reactos/baseaddress.xml
--- trunk/reactos/baseaddress.xml 2005-10-03 07:26:39 UTC (rev
18238)
+++ trunk/reactos/baseaddress.xml 2005-10-03 07:48:59 UTC (rev
18239)
@@ -5,6 +5,7 @@
<property name="BASEADDRESS_UXTHEME" value="0x5AD70000" />
<property name="BASEADDRESS_OBJSEL" value="0x5B400000" />
<property name="BASEADDRESS_DINPUT" value="0x5F580000" />
+<property name="BASEADDRESS_HDWWIZ" value="0x64D40000" />
<property name="BASEADDRESS_TIMEDATE" value="0x64DA0000" />
<property name="BASEADDRESS_SYSDM" value="0x64DD0000" />
<property name="BASEADDRESS_MAIN" value="0x64F40000" />
Property changes on: trunk/reactos/lib/cpl/hdwwiz
___________________________________________________________________
Name: svn:ignore
+ GNUmakefile
_____
Added: trunk/reactos/lib/cpl/hdwwiz/En.rc
--- trunk/reactos/lib/cpl/hdwwiz/En.rc 2005-10-03 07:26:39 UTC (rev
18238)
+++ trunk/reactos/lib/cpl/hdwwiz/En.rc 2005-10-03 07:48:59 UTC (rev
18239)
@@ -0,0 +1,7 @@
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
+
+STRINGTABLE
+BEGIN
+ IDS_CPLNAME "Add hardware"
+ IDS_CPLDESCRIPTION "Add hardware to your computer."
+END
Property changes on: trunk/reactos/lib/cpl/hdwwiz/En.rc
___________________________________________________________________
Name: svn:keywords
+ author date revision
Name: svn:eol-style
+ native
_____
Added: trunk/reactos/lib/cpl/hdwwiz/Fr.rc
--- trunk/reactos/lib/cpl/hdwwiz/Fr.rc 2005-10-03 07:26:39 UTC (rev
18238)
+++ trunk/reactos/lib/cpl/hdwwiz/Fr.rc 2005-10-03 07:48:59 UTC (rev
18239)
@@ -0,0 +1,7 @@
+LANGUAGE LANG_FRENCH, SUBLANG_NEUTRAL
+
+STRINGTABLE
+BEGIN
+ IDS_CPLNAME "Ajout de matÚriel"
+ IDS_CPLDESCRIPTION "Ajoute un nouveau matÚriel Ó votre
ordinateur."
+END
Property changes on: trunk/reactos/lib/cpl/hdwwiz/Fr.rc
___________________________________________________________________
Name: svn:keywords
+ author date revision
Name: svn:eol-style
+ native
_____
Added: trunk/reactos/lib/cpl/hdwwiz/hdwwiz.c
--- trunk/reactos/lib/cpl/hdwwiz/hdwwiz.c 2005-10-03 07:26:39 UTC
(rev 18238)
+++ trunk/reactos/lib/cpl/hdwwiz/hdwwiz.c 2005-10-03 07:48:59 UTC
(rev 18239)
@@ -0,0 +1,146 @@
+/*
+ * ReactOS New devices installation
+ * Copyright (C) 2005 ReactOS Team
+ *
+ * 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
+ */
+/*
+ * PROJECT: ReactOS Add hardware control panel
+ * FILE: lib/cpl/hdwwiz/hdwwiz.c
+ * PURPOSE: ReactOS Add hardware control panel
+ * PROGRAMMER: HervÚ Poussineau (hpoussin(a)reactos.org)
+ */
+
+#include <windows.h>
+#include <commctrl.h>
+#include <setupapi.h>
+#include <cpl.h>
+#include <tchar.h>
+#include <stdio.h>
+
+#include "resource.h"
+#include "hdwwiz.h"
+
+LONG APIENTRY Applet(HWND hwnd, UINT uMsg, LONG wParam, LONG lParam);
+HINSTANCE hApplet = 0;
+
+/* Applets */
+APPLET Applets[] =
+{
+ {IDI_CPLICON, IDS_CPLNAME, IDS_CPLDESCRIPTION, Applet}
+};
+
+typedef BOOL (*PINSTALL_NEW_DEVICE)(HWND, LPGUID, PDWORD);
+
+LONG APIENTRY
+Applet(HWND hwnd, UINT uMsg, LONG wParam, LONG lParam)
+{
+ HMODULE hNewDev = NULL;
+ PINSTALL_NEW_DEVICE InstallNewDevice;
+ DWORD Reboot;
+ BOOL ret;
+ LONG rc;
+
+ hNewDev = LoadLibrary(_T("newdev.dll"));
+ if (!hNewDev)
+ {
+ rc = 1;
+ goto cleanup;
+ }
+
+ InstallNewDevice = (PINSTALL_NEW_DEVICE)GetProcAddress(hNewDev,
(LPCSTR)"InstallNewDevice");
+ if (!InstallNewDevice)
+ {
+ rc = 2;
+ goto cleanup;
+ }
+
+ ret = InstallNewDevice(hwnd, NULL, &Reboot);
+ if (!ret)
+ {
+ rc = 3;
+ goto cleanup;
+ }
+
+ if (Reboot != DI_NEEDRESTART && Reboot != DI_NEEDREBOOT)
+ {
+ /* We're done with installation */
+ rc = 0;
+ goto cleanup;
+ }
+
+ /* We need to reboot */
+ if (SetupPromptReboot(NULL, hwnd, FALSE) == -1)
+ {
+ /* User doesn't want to reboot, or an error occurred */
+ rc = 5;
+ goto cleanup;
+ }
+
+ rc = 0;
+
+cleanup:
+ if (hNewDev != NULL)
+ FreeLibrary(hNewDev);
+ return rc;
+}
+
+/* Control Panel Callback */
+LONG CALLBACK
+CPlApplet(HWND hwndCpl,
+ UINT uMsg,
+ LPARAM lParam1,
+ LPARAM lParam2)
+{
+ int i = (int)lParam1;
+
+ switch (uMsg)
+ {
+ case CPL_INIT:
+ return TRUE;
+
+ case CPL_GETCOUNT:
+ return sizeof(Applets)/sizeof(Applets[0]);
+
+ case CPL_INQUIRE:
+ {
+ CPLINFO *CPlInfo = (CPLINFO*)lParam2;
+ CPlInfo->lData = 0;
+ CPlInfo->idIcon = Applets[i].idIcon;
+ CPlInfo->idName = Applets[i].idName;
+ CPlInfo->idInfo = Applets[i].idDescription;
+ break;
+ }
+
+ case CPL_DBLCLK:
+ {
+ Applets[i].AppletProc(hwndCpl, uMsg, lParam1,
lParam2);
+ break;
+ }
+ }
+ return FALSE;
+}
+
+BOOL WINAPI
+DllMain(HINSTANCE hinstDLL, DWORD dwReason, LPVOID lpvReserved)
+{
+ switch(dwReason)
+ {
+ case DLL_PROCESS_ATTACH:
+ hApplet = hinstDLL;
+ break;
+ }
+ return TRUE;
+}
Property changes on: trunk/reactos/lib/cpl/hdwwiz/hdwwiz.c
___________________________________________________________________
Name: svn:keywords
+ author date revision
Name: svn:eol-style
+ native
_____
Added: trunk/reactos/lib/cpl/hdwwiz/hdwwiz.def
--- trunk/reactos/lib/cpl/hdwwiz/hdwwiz.def 2005-10-03 07:26:39 UTC
(rev 18238)
+++ trunk/reactos/lib/cpl/hdwwiz/hdwwiz.def 2005-10-03 07:48:59 UTC
(rev 18239)
@@ -0,0 +1,6 @@
+LIBRARY hdwwiz.cpl
+
+EXPORTS
+CPlApplet@16
+
+; EOF
Property changes on: trunk/reactos/lib/cpl/hdwwiz/hdwwiz.def
___________________________________________________________________
Name: svn:eol-style
+ native
_____
Added: trunk/reactos/lib/cpl/hdwwiz/hdwwiz.h
--- trunk/reactos/lib/cpl/hdwwiz/hdwwiz.h 2005-10-03 07:26:39 UTC
(rev 18238)
+++ trunk/reactos/lib/cpl/hdwwiz/hdwwiz.h 2005-10-03 07:48:59 UTC
(rev 18239)
@@ -0,0 +1,16 @@
+#ifndef __CPL_HDWWIZ_H
+#define __CPL_HDWWIZ_H
+
+typedef struct
+{
+ int idIcon;
+ int idName;
+ int idDescription;
+ APPLET_PROC AppletProc;
+} APPLET, *PAPPLET;
+
+extern HINSTANCE hApplet;
+
+#endif /* __CPL_HDWWIZ_H */
+
+/* EOF */
Property changes on: trunk/reactos/lib/cpl/hdwwiz/hdwwiz.h
___________________________________________________________________
Name: svn:keywords
+ author date revision
Name: svn:eol-style
+ native
_____
Added: trunk/reactos/lib/cpl/hdwwiz/hdwwiz.rc
--- trunk/reactos/lib/cpl/hdwwiz/hdwwiz.rc 2005-10-03 07:26:39 UTC
(rev 18238)
+++ trunk/reactos/lib/cpl/hdwwiz/hdwwiz.rc 2005-10-03 07:48:59 UTC
(rev 18239)
@@ -0,0 +1,21 @@
+#include <windows.h>
+
+#include "resource.h"
+
+LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
+
+#define REACTOS_VERSION_DLL
+#define REACTOS_STR_FILE_DESCRIPTION "ReactOS Software Control
Panel\0"
+#define REACTOS_STR_INTERNAL_NAME "hdwwiz\0"
+#define REACTOS_STR_ORIGINAL_FILENAME "hdwwiz.cpl\0"
+
+#ifdef _MSC_VER
+#include <../../../reactos/version.rc>
+#else
+#include <reactos/version.rc>
+#endif
+
+IDI_CPLICON ICON "resources/applet.ico"
+
+#include "En.rc"
+#include "Fr.rc"
Property changes on: trunk/reactos/lib/cpl/hdwwiz/hdwwiz.rc
___________________________________________________________________
Name: svn:keywords
+ author date revision
Name: svn:eol-style
+ native
_____
Added: trunk/reactos/lib/cpl/hdwwiz/hdwwiz.xml
--- trunk/reactos/lib/cpl/hdwwiz/hdwwiz.xml 2005-10-03 07:26:39 UTC
(rev 18238)
+++ trunk/reactos/lib/cpl/hdwwiz/hdwwiz.xml 2005-10-03 07:48:59 UTC
(rev 18239)
@@ -0,0 +1,13 @@
+<module name="hdwwiz" type="win32dll" extension=".cpl"
baseaddress="${BASEADDRESS_HDWWIZ}" installbase="system32"
installname="hdwwiz.cpl">
+ <importlibrary definition="hdwwiz.def" />
+ <include base="hdwwiz">.</include>
+ <define name="UNICODE" />
+ <define name="_UNICODE" />
+ <define name="__REACTOS__" />
+ <define name="__USE_W32API" />
+ <define name="_WIN32_IE">0x600</define>
+ <define name="_WIN32_WINNT">0x501</define>
+ <library>setupapi</library>
+ <file>hdwwiz.c</file>
+ <file>hdwwiz.rc</file>
+</module>
Property changes on: trunk/reactos/lib/cpl/hdwwiz/hdwwiz.xml
___________________________________________________________________
Name: svn:keywords
+ author date revision
Name: svn:eol-style
+ native
_____
Added: trunk/reactos/lib/cpl/hdwwiz/resource.h
--- trunk/reactos/lib/cpl/hdwwiz/resource.h 2005-10-03 07:26:39 UTC
(rev 18238)
+++ trunk/reactos/lib/cpl/hdwwiz/resource.h 2005-10-03 07:48:59 UTC
(rev 18239)
@@ -0,0 +1,12 @@
+#ifndef __CPL_RESOURCE_H
+#define __CPL_RESOURCE_H
+
+/* ids */
+
+#define IDI_CPLICON 1
+#define IDS_CPLNAME 2
+#define IDS_CPLDESCRIPTION 3
+
+#endif /* __CPL_RESOURCE_H */
+
+/* EOF */
Property changes on: trunk/reactos/lib/cpl/hdwwiz/resource.h
___________________________________________________________________
Name: svn:keywords
+ author date revision
Name: svn:eol-style
+ native
_____
Added: trunk/reactos/lib/cpl/hdwwiz/resources/applet.ico
(Binary files differ)
Property changes on: trunk/reactos/lib/cpl/hdwwiz/resources/applet.ico
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream