win-pvdrivers

view coinst/coinst.c @ 783:644e5ddb1b47

Handle SCSI INQUIRY command better in xenvbd
author James Harper <james.harper@bendigoit.com.au>
date Mon Feb 15 20:53:57 2010 +1100 (2010-02-15)
parents bf13631a5054
children
line source
1 /*
2 PV Drivers for Windows Xen HVM Domains
3 Copyright (C) 2009 Neocleus Inc., Amir Szekely (amir@neocleus.com)
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License
7 as published by the Free Software Foundation; either version 2
8 of the License, or (at your option) any later version.
10 This program 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
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 */
20 #include <windows.h>
21 #include <setupapi.h>
23 DWORD
24 __stdcall CoRequireReboot (
25 IN DI_FUNCTION InstallFunction,
26 IN HDEVINFO DeviceInfoSet,
27 IN PSP_DEVINFO_DATA DeviceInfoData,
28 IN OUT PCOINSTALLER_CONTEXT_DATA Context
29 )
30 {
31 UNREFERENCED_PARAMETER(Context);
33 OutputDebugString(TEXT("CoRequireReboot"));
35 if (InstallFunction == DIF_INSTALLDEVICE)
36 {
37 SP_DEVINSTALL_PARAMS DevInstallParams;
38 OutputDebugString(TEXT(" CoRequireReboot: DIF_INSTALLDEVICE"));
39 DevInstallParams.cbSize = sizeof(SP_DEVINSTALL_PARAMS);
41 if (SetupDiGetDeviceInstallParams(DeviceInfoSet, DeviceInfoData, &DevInstallParams))
42 {
43 OutputDebugString(TEXT(" CoRequireReboot: SetupDiGetDeviceInstallParams"));
44 DevInstallParams.Flags |= DI_DONOTCALLCONFIGMG;
45 DevInstallParams.Flags |= DI_NEEDREBOOT;
46 if (SetupDiSetDeviceInstallParams(DeviceInfoSet, DeviceInfoData, &DevInstallParams))
47 {
48 OutputDebugString(TEXT(" CoRequireReboot: SetupDiSetDeviceInstallParams"));
49 }
50 }
51 }
53 return NO_ERROR;
54 }