2 * ReactOS New devices installation
3 * Copyright (C) 2005 ReactOS Team
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 * PROJECT: ReactOS Add hardware control panel
21 * FILE: lib/cpl/hdwwiz/hdwwiz.c
22 * PURPOSE: ReactOS Add hardware control panel
23 * PROGRAMMER: Hervé Poussineau (hpoussin@reactos.org)
36 LONG APIENTRY
Applet(HWND hwnd
, UINT uMsg
, LONG wParam
, LONG lParam
);
37 HINSTANCE hApplet
= 0;
42 {IDI_CPLICON
, IDS_CPLNAME
, IDS_CPLDESCRIPTION
, Applet
}
45 typedef BOOL (*PINSTALL_NEW_DEVICE
)(HWND
, LPGUID
, PDWORD
);
48 Applet(HWND hwnd
, UINT uMsg
, LONG wParam
, LONG lParam
)
50 HMODULE hNewDev
= NULL
;
51 PINSTALL_NEW_DEVICE InstallNewDevice
;
56 hNewDev
= LoadLibrary(_T("newdev.dll"));
63 InstallNewDevice
= (PINSTALL_NEW_DEVICE
)GetProcAddress(hNewDev
, (LPCSTR
)"InstallNewDevice");
64 if (!InstallNewDevice
)
70 ret
= InstallNewDevice(hwnd
, NULL
, &Reboot
);
77 if (Reboot
!= DI_NEEDRESTART
&& Reboot
!= DI_NEEDREBOOT
)
79 /* We're done with installation */
84 /* We need to reboot */
85 if (SetupPromptReboot(NULL
, hwnd
, FALSE
) == -1)
87 /* User doesn't want to reboot, or an error occurred */
100 /* Control Panel Callback */
102 CPlApplet(HWND hwndCpl
,
107 int i
= (int)lParam1
;
115 return sizeof(Applets
)/sizeof(Applets
[0]);
119 CPLINFO
*CPlInfo
= (CPLINFO
*)lParam2
;
121 CPlInfo
->idIcon
= Applets
[i
].idIcon
;
122 CPlInfo
->idName
= Applets
[i
].idName
;
123 CPlInfo
->idInfo
= Applets
[i
].idDescription
;
129 Applets
[i
].AppletProc(hwndCpl
, uMsg
, lParam1
, lParam2
);
137 DllMain(HINSTANCE hinstDLL
, DWORD dwReason
, LPVOID lpvReserved
)
141 case DLL_PROCESS_ATTACH
: