diff --git a/reactos/lib/newdev/newdev.c b/reactos/lib/newdev/newdev.c index 461c4999566..7ded0173316 100644 --- a/reactos/lib/newdev/newdev.c +++ b/reactos/lib/newdev/newdev.c @@ -1,18 +1,29 @@ /* -* COPYRIGHT: See COPYING in the top level directory -* PROJECT: ReactOS New devices installation -* FILE: lib/newdev/newdev.c -* PURPOSE: New devices installation -* -* PROGRAMMERS: Hervé Poussineau (hpoussin@reactos.org) -* PROGRAMMERS: Christoph von Wittich (Christoph@ActiveVB.de) -*/ - -//#define NDEBUG -#include + * New device installer (newdev.dll) + * + * Copyright 2005 Hervé Poussineau (hpoussin@reactos.org) + * 2005 Christoph von Wittich (Christoph@ActiveVB.de) + * + * 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 YDEBUG #include "newdev.h" +WINE_DEFAULT_DEBUG_CHANNEL(newdev); + static BOOL SearchDriver ( PDEVINSTDATA DevInstData, LPCTSTR Path ); static BOOL InstallDriver ( PDEVINSTDATA DevInstData ); static DWORD WINAPI FindDriverProc( LPVOID lpParam ); @@ -22,7 +33,7 @@ static DEVINSTDATA DevInstData; HINSTANCE hDllInstance; HANDLE hThread; -BOOL +static BOOL CanDisableDevice(IN DEVINST DevInst, IN HMACHINE hMachine, OUT BOOL *CanDisable) @@ -54,7 +65,7 @@ CanDisableDevice(IN DEVINST DevInst, } -BOOL +static BOOL IsDeviceStarted(IN DEVINST DevInst, IN HMACHINE hMachine, OUT BOOL *IsEnabled) @@ -78,7 +89,7 @@ IsDeviceStarted(IN DEVINST DevInst, } -BOOL +static BOOL StartDevice(IN HDEVINFO DeviceInfoSet, IN PSP_DEVINFO_DATA DevInfoData OPTIONAL, IN BOOL bEnable, @@ -745,20 +756,20 @@ FindDriver( DevInstallParams.cbSize = sizeof(SP_DEVINSTALL_PARAMS); if (!SetupDiGetDeviceInstallParams(DevInstData->hDevInfo, &DevInstData->devInfoData, &DevInstallParams)) { - DPRINT("SetupDiGetDeviceInstallParams() failed with error 0x%lx\n", GetLastError()); + TRACE("SetupDiGetDeviceInstallParams() failed with error 0x%lx\n", GetLastError()); return FALSE; } DevInstallParams.FlagsEx |= DI_FLAGSEX_ALLOWEXCLUDEDDRVS; if (!SetupDiSetDeviceInstallParams(DevInstData->hDevInfo, &DevInstData->devInfoData, &DevInstallParams)) { - DPRINT("SetupDiSetDeviceInstallParams() failed with error 0x%lx\n", GetLastError()); + TRACE("SetupDiSetDeviceInstallParams() failed with error 0x%lx\n", GetLastError()); return FALSE; } ret = SetupDiBuildDriverInfoList(DevInstData->hDevInfo, &DevInstData->devInfoData, SPDIT_COMPATDRIVER); if (!ret) { - DPRINT("SetupDiBuildDriverInfoList() failed with error 0x%lx\n", GetLastError()); + TRACE("SetupDiBuildDriverInfoList() failed with error 0x%lx\n", GetLastError()); return FALSE; } @@ -773,10 +784,10 @@ FindDriver( { if (GetLastError() == ERROR_NO_MORE_ITEMS) return FALSE; - DPRINT("SetupDiEnumDriverInfo() failed with error 0x%lx\n", GetLastError()); + TRACE("SetupDiEnumDriverInfo() failed with error 0x%lx\n", GetLastError()); return FALSE; } - DPRINT("Installing driver %S: %S\n", DevInstData->drvInfoData.MfgName, DevInstData->drvInfoData.Description); + TRACE("Installing driver %S: %S\n", DevInstData->drvInfoData.MfgName, DevInstData->drvInfoData.Description); return TRUE; } @@ -899,7 +910,7 @@ InstallDriver( &DevInstData->devInfoData); if (!ret) { - DPRINT("SetupDiCallClassInstaller(DIF_SELECTBESTCOMPATDRV) failed with error 0x%lx\n", GetLastError()); + TRACE("SetupDiCallClassInstaller(DIF_SELECTBESTCOMPATDRV) failed with error 0x%lx\n", GetLastError()); return FALSE; } @@ -909,7 +920,7 @@ InstallDriver( &DevInstData->devInfoData); if (!ret) { - DPRINT("SetupDiCallClassInstaller(DIF_ALLOW_INSTALL) failed with error 0x%lx\n", GetLastError()); + TRACE("SetupDiCallClassInstaller(DIF_ALLOW_INSTALL) failed with error 0x%lx\n", GetLastError()); return FALSE; } @@ -919,7 +930,7 @@ InstallDriver( &DevInstData->devInfoData); if (!ret) { - DPRINT("SetupDiCallClassInstaller(DIF_NEWDEVICEWIZARD_PREANALYZE) failed with error 0x%lx\n", GetLastError()); + TRACE("SetupDiCallClassInstaller(DIF_NEWDEVICEWIZARD_PREANALYZE) failed with error 0x%lx\n", GetLastError()); return FALSE; } @@ -929,7 +940,7 @@ InstallDriver( &DevInstData->devInfoData); if (!ret) { - DPRINT("SetupDiCallClassInstaller(DIF_NEWDEVICEWIZARD_POSTANALYZE) failed with error 0x%lx\n", GetLastError()); + TRACE("SetupDiCallClassInstaller(DIF_NEWDEVICEWIZARD_POSTANALYZE) failed with error 0x%lx\n", GetLastError()); return FALSE; } @@ -939,7 +950,7 @@ InstallDriver( &DevInstData->devInfoData); if (!ret) { - DPRINT("SetupDiCallClassInstaller(DIF_INSTALLDEVICEFILES) failed with error 0x%lx\n", GetLastError()); + TRACE("SetupDiCallClassInstaller(DIF_INSTALLDEVICEFILES) failed with error 0x%lx\n", GetLastError()); return FALSE; } @@ -949,7 +960,7 @@ InstallDriver( &DevInstData->devInfoData); if (!ret) { - DPRINT("SetupDiCallClassInstaller(DIF_REGISTER_COINSTALLERS) failed with error 0x%lx\n", GetLastError()); + TRACE("SetupDiCallClassInstaller(DIF_REGISTER_COINSTALLERS) failed with error 0x%lx\n", GetLastError()); return FALSE; } @@ -959,7 +970,7 @@ InstallDriver( &DevInstData->devInfoData); if (!ret) { - DPRINT("SetupDiCallClassInstaller(DIF_INSTALLINTERFACES) failed with error 0x%lx\n", GetLastError()); + TRACE("SetupDiCallClassInstaller(DIF_INSTALLINTERFACES) failed with error 0x%lx\n", GetLastError()); return FALSE; } @@ -969,7 +980,7 @@ InstallDriver( &DevInstData->devInfoData); if (!ret) { - DPRINT("SetupDiCallClassInstaller(DIF_INSTALLDEVICE) failed with error 0x%lx\n", GetLastError()); + TRACE("SetupDiCallClassInstaller(DIF_INSTALLDEVICE) failed with error 0x%lx\n", GetLastError()); return FALSE; } @@ -979,7 +990,7 @@ InstallDriver( &DevInstData->devInfoData); if (!ret) { - DPRINT("SetupDiCallClassInstaller(DIF_NEWDEVICEWIZARD_FINISHINSTALL) failed with error 0x%lx\n", GetLastError()); + TRACE("SetupDiCallClassInstaller(DIF_NEWDEVICEWIZARD_FINISHINSTALL) failed with error 0x%lx\n", GetLastError()); return FALSE; } @@ -989,7 +1000,7 @@ InstallDriver( &DevInstData->devInfoData); if (!ret) { - DPRINT("SetupDiCallClassInstaller(DIF_DESTROYPRIVATEDATA) failed with error 0x%lx\n", GetLastError()); + TRACE("SetupDiCallClassInstaller(DIF_DESTROYPRIVATEDATA) failed with error 0x%lx\n", GetLastError()); return FALSE; } @@ -1004,13 +1015,13 @@ CleanUp(VOID) if (DevInstData.devInfoData.cbSize != 0) { if (!SetupDiDestroyDriverInfoList(DevInstData.hDevInfo, &DevInstData.devInfoData, SPDIT_COMPATDRIVER)) - DPRINT("SetupDiDestroyDriverInfoList() failed with error 0x%lx\n", GetLastError()); + TRACE("SetupDiDestroyDriverInfoList() failed with error 0x%lx\n", GetLastError()); } if (DevInstData.hDevInfo != INVALID_HANDLE_VALUE) { if (!SetupDiDestroyDeviceInfoList(DevInstData.hDevInfo)) - DPRINT("SetupDiDestroyDeviceInfoList() failed with error 0x%lx\n", GetLastError()); + TRACE("SetupDiDestroyDeviceInfoList() failed with error 0x%lx\n", GetLastError()); } if (DevInstData.buffer) @@ -1018,6 +1029,9 @@ CleanUp(VOID) } +/* +* @implemented +*/ BOOL WINAPI DevInstallW( IN HWND hWndParent, @@ -1046,7 +1060,7 @@ DevInstallW( DevInstData.hDevInfo = SetupDiCreateDeviceInfoListExW(NULL, NULL, NULL, NULL); if (DevInstData.hDevInfo == INVALID_HANDLE_VALUE) { - DPRINT("SetupDiCreateDeviceInfoListExW() failed with error 0x%lx\n", GetLastError()); + TRACE("SetupDiCreateDeviceInfoListExW() failed with error 0x%lx\n", GetLastError()); CleanUp(); return FALSE; } @@ -1060,7 +1074,7 @@ DevInstallW( &DevInstData.devInfoData); if (!ret) { - DPRINT("SetupDiOpenDeviceInfoW() failed with error 0x%lx (InstanceId %S)\n", GetLastError(), InstanceId); + TRACE("SetupDiOpenDeviceInfoW() failed with error 0x%lx (InstanceId %S)\n", GetLastError(), InstanceId); DevInstData.devInfoData.cbSize = 0; CleanUp(); return FALSE; @@ -1080,7 +1094,7 @@ DevInstallW( DevInstData.buffer = HeapAlloc(GetProcessHeap(), 0, DevInstData.requiredSize); if (!DevInstData.buffer) { - DPRINT("HeapAlloc() failed\n"); + TRACE("HeapAlloc() failed\n"); SetLastError(ERROR_NOT_ENOUGH_MEMORY); } else @@ -1096,7 +1110,7 @@ DevInstallW( } if (!ret) { - DPRINT("SetupDiGetDeviceRegistryProperty() failed with error 0x%lx (InstanceId %S)\n", GetLastError(), InstanceId); + TRACE("SetupDiGetDeviceRegistryProperty() failed with error 0x%lx (InstanceId %S)\n", GetLastError(), InstanceId); CleanUp(); return FALSE; } @@ -1123,7 +1137,7 @@ DevInstallW( } */ - DPRINT("Installing %S (%S)\n", DevInstData.buffer, InstanceId); + TRACE("Installing %S (%S)\n", DevInstData.buffer, InstanceId); if ((!FindDriver(&DevInstData)) && (Show != SW_HIDE)) { @@ -1191,6 +1205,9 @@ DevInstallW( return TRUE; } +/* +* @unimplemented +*/ BOOL WINAPI ClientSideInstallW(IN HWND hWndOwner, IN DWORD dwUnknownFlags, diff --git a/reactos/lib/newdev/newdev.def b/reactos/lib/newdev/newdev.def deleted file mode 100644 index 004c9cd7e57..00000000000 --- a/reactos/lib/newdev/newdev.def +++ /dev/null @@ -1,16 +0,0 @@ -LIBRARY newdev.dll - -EXPORTS -ClientSideInstallW@12 -DevInstallW@16 -;InstallDevInst -;InstallDevInstEx -InstallNewDevice@12 -;InstallSelectedDevice -InstallSelectedDriverW@20 -;InstallWindowsUpdateDriver -;RollbackDriver -UpdateDriverForPlugAndPlayDevicesA@20 -UpdateDriverForPlugAndPlayDevicesW@20 - -;EOF \ No newline at end of file diff --git a/reactos/lib/newdev/newdev.h b/reactos/lib/newdev/newdev.h index 338de977c74..b2504eef4c8 100644 --- a/reactos/lib/newdev/newdev.h +++ b/reactos/lib/newdev/newdev.h @@ -4,13 +4,12 @@ #include #include #include +#include #include #include "resource.h" -ULONG DbgPrint(PCH Format,...); - typedef struct _DEVINSTDATA { HFONT hTitleFont; diff --git a/reactos/lib/newdev/newdev.spec b/reactos/lib/newdev/newdev.spec new file mode 100644 index 00000000000..1a2c99306e9 --- /dev/null +++ b/reactos/lib/newdev/newdev.spec @@ -0,0 +1,11 @@ +@ stdcall ClientSideInstallW(ptr long wstr) +@ stdcall DevInstallW(ptr ptr wstr long) +@ stub InstallDevInst +@ stub InstallDevInstEx +@ stdcall InstallNewDevice(ptr ptr ptr) +@ stub InstallSelectedDevice +@ stdcall InstallSelectedDriverW(ptr ptr wstr long ptr) +@ stub InstallWindowsUpdateDriver +@ stub RollbackDriver +@ stdcall UpdateDriverForPlugAndPlayDevicesA(ptr str str long ptr) +@ stdcall UpdateDriverForPlugAndPlayDevicesW(ptr wstr wstr long ptr) diff --git a/reactos/lib/newdev/newdev.xml b/reactos/lib/newdev/newdev.xml index ebf81e78fda..45cfebaeb0b 100644 --- a/reactos/lib/newdev/newdev.xml +++ b/reactos/lib/newdev/newdev.xml @@ -2,12 +2,14 @@ . - + 0x0600 0x0501 newdev.c stubs.c newdev.rc + newdev.spec + wine gdi32 comctl32 ntdll diff --git a/reactos/lib/newdev/stubs.c b/reactos/lib/newdev/stubs.c index 7b465aaa3a6..226a87e0bf0 100644 --- a/reactos/lib/newdev/stubs.c +++ b/reactos/lib/newdev/stubs.c @@ -1,17 +1,30 @@ /* - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS New devices installation - * FILE: lib/newdev/stubs.c - * PURPOSE: Stubs + * New device installer (newdev.dll) * - * PROGRAMMERS: Hervé Poussineau (hpoussin@reactos.org) + * Copyright 2005 Hervé Poussineau (hpoussin@reactos.org) + * + * 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 NDEBUG -#include - #include "newdev.h" +WINE_DEFAULT_DEBUG_CHANNEL(newdev); + +/* +* @unimplemented +*/ BOOL WINAPI InstallNewDevice( IN HWND hwndParent, @@ -23,6 +36,9 @@ InstallNewDevice( return FALSE; } +/* +* @unimplemented +*/ BOOL WINAPI InstallSelectedDriverW( IN HWND hwndParent, @@ -35,7 +51,3 @@ InstallSelectedDriverW( SetLastError(ERROR_GEN_FAILURE); return FALSE; } - - - -