Relicence newdev.dll to LGPL. Christoph von Wittich and I both agree on this licence change.

Do according changes in source to follow Wine way of code

svn path=/trunk/; revision=20447
This commit is contained in:
Hervé Poussineau 2005-12-29 22:43:44 +00:00
parent a73d1b05b1
commit 8ac1adfd7d
6 changed files with 92 additions and 67 deletions

View file

@ -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 <debug.h>
* 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,

View file

@ -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

View file

@ -4,13 +4,12 @@
#include <setupapi.h>
#include <cfgmgr32.h>
#include <tchar.h>
#include <wine/debug.h>
#include <stdio.h>
#include "resource.h"
ULONG DbgPrint(PCH Format,...);
typedef struct _DEVINSTDATA
{
HFONT hTitleFont;

View file

@ -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)

View file

@ -2,12 +2,14 @@
<include base="newdev">.</include>
<define name="UNICODE" />
<define name="_UNICODE" />
<importlibrary definition="newdev.def" />
<importlibrary definition="newdev.spec.def" />
<define name="_WIN32_IE">0x0600</define>
<define name="_WIN32_WINNT">0x0501</define>
<file>newdev.c</file>
<file>stubs.c</file>
<file>newdev.rc</file>
<file>newdev.spec</file>
<library>wine</library>
<library>gdi32</library>
<library>comctl32</library>
<library>ntdll</library>

View file

@ -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 <debug.h>
#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;
}