win-pvdrivers

changeset 286:89e1a0af859c wdm 0.9.5

Wrote an installer using NSIS. Updated some documentation. Minor bugfixes too.
author James Harper <james.harper@bendigoit.com.au>
date Sun Jun 01 23:16:21 2008 +1000 (2008-06-01)
parents e11d7173c7be
children f02ee956fe94
files ShutdownMon/Program.cs common.inc doc/BUILDING.txt driver.nsh drvsetup.nsh installer.nsi makedist.bat winver.nsh xenpci/sources xenpci/xenpci.h xenpci/xenpci.inx xenpci/xenpci_fdo.c xenvbd/scsiport.c
line diff
     1.1 --- a/ShutdownMon/Program.cs	Sat May 31 22:35:47 2008 +1000
     1.2 +++ b/ShutdownMon/Program.cs	Sun Jun 01 23:16:21 2008 +1000
     1.3 @@ -204,6 +204,30 @@ namespace ShutdownMon
     1.4          const string MyDisplayName = "Xen Shutdown Monitor Service";
     1.5          const string MyServiceDescription = "Monitors the kernel driver and shuts down Windows when directed";
     1.6  
     1.7 +        private static Installer MakeServiceInstaller()
     1.8 +        {
     1.9 +            Installer i = new Installer();
    1.10 +            i.Context = new InstallContext();
    1.11 +            i.Context.Parameters.Add("AssemblyPath", Assembly.GetExecutingAssembly().Location);
    1.12 +            i.Context.Parameters.Add("LogToConsole", "false");
    1.13 +            i.Context.Parameters.Add("Silent", "true");
    1.14 +
    1.15 +            ServiceProcessInstaller spi = new ServiceProcessInstaller();
    1.16 +            spi.Account = ServiceAccount.LocalSystem;
    1.17 +            spi.Username = "";
    1.18 +            spi.Password = "";
    1.19 +            i.Installers.Add(spi);
    1.20 +
    1.21 +            ServiceInstaller si = new ServiceInstaller();
    1.22 +            si.ServiceName = MyServiceName;
    1.23 +            si.DisplayName = MyDisplayName;
    1.24 +            si.Description = MyServiceDescription;
    1.25 +            si.StartType = ServiceStartMode.Automatic;
    1.26 +            i.Installers.Add(si);
    1.27 +
    1.28 +            return i;
    1.29 +        }
    1.30 +
    1.31          static void Main(string[] args)
    1.32          {
    1.33              int argNo = 0;
    1.34 @@ -216,32 +240,13 @@ namespace ShutdownMon
    1.35                      case "-i":
    1.36                          {
    1.37                              IDictionary mySavedState = new Hashtable();
    1.38 -
    1.39 -                            Installer i = new Installer();
    1.40 -                            i.Context = new InstallContext();
    1.41 -                            i.Context.Parameters.Add("AssemblyPath", Assembly.GetExecutingAssembly().Location);
    1.42 -                            i.Context.Parameters.Add("LogToConsole", "false");
    1.43 -                            i.Context.Parameters.Add("Silent", "true");
    1.44 -
    1.45 -                            ServiceProcessInstaller spi = new ServiceProcessInstaller();
    1.46 -                            spi.Account = ServiceAccount.LocalSystem;
    1.47 -                            spi.Username = "";
    1.48 -                            spi.Password = "";
    1.49 -                            i.Installers.Add(spi);
    1.50 -
    1.51 -                            ServiceInstaller si = new ServiceInstaller();
    1.52 -                            si.ServiceName = MyServiceName;
    1.53 -                            si.DisplayName = MyDisplayName;
    1.54 -                            si.Description = MyServiceDescription;
    1.55 -                            si.StartType = ServiceStartMode.Manual;
    1.56 -                            i.Installers.Add(si);
    1.57 -
    1.58 +                            Installer i = MakeServiceInstaller();
    1.59                              try
    1.60                              {
    1.61                                  i.Install(mySavedState);
    1.62  
    1.63                                  Microsoft.Win32.RegistryKey config;
    1.64 -                                config = Microsoft.Win32.Registry.LocalMachine.OpenSubKey("System").OpenSubKey("CurrentControlSet").OpenSubKey("Services").OpenSubKey(si.ServiceName, true);
    1.65 +                                config = Microsoft.Win32.Registry.LocalMachine.OpenSubKey("System").OpenSubKey("CurrentControlSet").OpenSubKey("Services").OpenSubKey(MyServiceName, true);
    1.66                                  if (args.Length > 1)
    1.67                                  {
    1.68                                      config.SetValue("ImagePath", config.GetValue("ImagePath") + " -s " + string.Join(" ", args, argNo, args.Length - argNo - 1));
    1.69 @@ -268,21 +273,7 @@ namespace ShutdownMon
    1.70                      case "-u":
    1.71                          {
    1.72                              IDictionary mySavedState = new Hashtable();
    1.73 -                            Installer i = new Installer();
    1.74 -                            i.Context = new InstallContext(null, new string[] { "assemblypath=\"" + Assembly.GetExecutingAssembly().Location + "\" -s", "LogToConsole=false", "Silent=true" });
    1.75 -
    1.76 -                            ServiceProcessInstaller spi = new ServiceProcessInstaller();
    1.77 -                            spi.Account = ServiceAccount.LocalSystem;
    1.78 -                            spi.Username = "";
    1.79 -                            spi.Password = "";
    1.80 -                            i.Installers.Add(spi);
    1.81 -
    1.82 -                            ServiceInstaller si = new ServiceInstaller();
    1.83 -                            si.ServiceName = MyServiceName;
    1.84 -                            si.DisplayName = MyDisplayName;
    1.85 -                            si.Description = MyServiceDescription;
    1.86 -                            si.StartType = ServiceStartMode.Manual;
    1.87 -                            i.Installers.Add(si);
    1.88 +                            Installer i = MakeServiceInstaller();
    1.89  
    1.90                              try
    1.91                              {
     2.1 --- a/common.inc	Sat May 31 22:35:47 2008 +1000
     2.2 +++ b/common.inc	Sun Jun 01 23:16:21 2008 +1000
     2.3 @@ -1,4 +1,4 @@
     2.4 -VERSION=0.9.3.0
     2.5 +VERSION=0.9.5.0
     2.6  TARGETPATH=..\Target\$(DDK_TARGET_OS)
     2.7  MSC_WARNING_LEVEL=/W4
     2.8  INCLUDES = ..\common\include;..\common\include\public
     3.1 --- a/doc/BUILDING.txt	Sat May 31 22:35:47 2008 +1000
     3.2 +++ b/doc/BUILDING.txt	Sun Jun 01 23:16:21 2008 +1000
     3.3 @@ -7,22 +7,26 @@ to start.
     3.4  http://www.microsoft.com/whdc/DevTools/WDK/WDKpkg.mspx is probably a
     3.5  better place to start. 
     3.6  
     3.7 -2. Start the WDF Build Environment that best suits your needs. 32 bit
     3.8 -W2K3 and XP checked and free should all work. 64 bit W2K3 works too.
     3.9 +2. Download and install the Nullsoft Installer from
    3.10 +http://nsis.sourceforge.net/
    3.11  
    3.12  3. Use Mercurial (get it from 
    3.13  http://www.selenic.com/mercurial/wiki/index.cgi/BinaryPackages) to get 
    3.14  the latest sources from 
    3.15 -http://xenbits.xensource.com/ext/win-pvdrivers.hg. 
    3.16 +http://xenbits.xensource.com/ext/win-pvdrivers.hg. The current branch
    3.17 +is wdm so you'll need to specify that branch.
    3.18  
    3.19 -4. From the top directory, type 'BLD'. 
    3.20 +4. Build the shutdown monitor using Visual Studio. If you don't build it,
    3.21 +then you'll need to edit it out of installer.nsi before the next step.
    3.22  
    3.23 -5. Assuming all went well, your drivers should be in target/<sys>/i386 
    3.24 -directory. (<sys> is winnet or winxp, depending on your DDK compilation 
    3.25 -environment.) 
    3.26 +5. From the top directory, type 'makedist', which will build the drivers
    3.27 +for all architectures. If the build fails, then you probably don't have
    3.28 +exactly the 6001.17121 that i'm using. Edit set_ddk_path.bat and do a
    3.29 +'makedist' again.
    3.30 +
    3.31 +6. Assuming all went well, your drivers should be in target/<os>/<arch> 
    3.32 +directory. (<os> is win2k, winxp, winnet and winlh, arch is i386 and
    3.33 +amd64). "Xen PV Drivers <version>.exe" should also be created which is
    3.34 +the nsis installer.
    3.35  
    3.36  See the INSTALLING.txt file for information on how to install. 
    3.37 -
    3.38 -There is also a simple C# app which will enable 'graceful' shutdown (eg 
    3.39 -'xm shutdown' and 'xm reboot' will do the right thing). Open Xen.sln in 
    3.40 -Visual Studio to build it. 
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/driver.nsh	Sun Jun 01 23:16:21 2008 +1000
     4.3 @@ -0,0 +1,105 @@
     4.4 +!include "winver.nsh"
     4.5 +!include "drvsetup.nsh"
     4.6 + 
     4.7 +;
     4.8 +; Written by Kuba Ober
     4.9 +; Copyright (c) 2004 Kuba Ober
    4.10 +;
    4.11 +; Permission is hereby granted, free of charge, to any person obtaining a 
    4.12 +; copy of this software and associated documentation files (the "Software"), 
    4.13 +; to deal in the Software without restriction, including without limitation 
    4.14 +; the rights to use, copy, modify, merge, publish, distribute, sublicense, 
    4.15 +; and/or sell copies of the Software, and to permit persons to whom the 
    4.16 +; Software is furnished to do so, subject to the following conditions:
    4.17 +;
    4.18 +; The above copyright notice and this permission notice shall be included in 
    4.19 +; all copies or substantial portions of the Software.
    4.20 +; 
    4.21 +; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    4.22 +; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    4.23 +; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    4.24 +; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    4.25 +; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
    4.26 +; FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
    4.27 +; DEALINGS IN THE SOFTWARE.
    4.28 + 
    4.29 +;
    4.30 +; U S A G E
    4.31 +;
    4.32 +; Push "c:\program files\yoursoftware\driver" 
    4.33 +;  -- the directory of the .inf file
    4.34 +; Push "c:\program files\yoursoftware\driver\driver.inf"
    4.35 +;  -- the filepath of the .inf file (directory + filename)
    4.36 +; Push "USB\VID_1234&PID_5678"
    4.37 +;  -- the HID (Hardware ID) of your device
    4.38 +; Call InstallUpgradeDriver
    4.39 +;
    4.40 +; Your driver (minimally the .inf and .sys files) should already by installed
    4.41 +; by your NSIS script.
    4.42 +;
    4.43 +; Typically, you would put the driver either in $INSTDIR or $INSTDIR\Driver
    4.44 +; It's up to you, of course.
    4.45 +;
    4.46 +; The driver (i.e. .inf, .sys and related files) must be present for the
    4.47 +; lifetime of your application, you shouldn't remove them after calling
    4.48 +; this function!
    4.49 +;
    4.50 +; You DON'T want to put the driver in any of system directories. Windows
    4.51 +; will do it when the device is first plugged in.
    4.52 + 
    4.53 +Function InstallUpgradeDriver
    4.54 + 
    4.55 + Pop $R0 ; HID
    4.56 + Pop $R1 ; INFPATH
    4.57 + Pop $R2 ; INFDIR
    4.58 + 
    4.59 + ; Get the Windows version
    4.60 + Call GetWindowsVersion
    4.61 + Pop $R3 ; Windows Version
    4.62 + ;DetailPrint 'Windows Version: $R3'
    4.63 + StrCmp $R3 '2000' lbl_upgrade
    4.64 + StrCmp $R3 'XP' lbl_upgrade
    4.65 + StrCmp $R3 '2003' lbl_upgrade
    4.66 + DetailPrint "Windows $R3 doesn't support automatic driver updates."
    4.67 + 
    4.68 + ; Upgrade the driver if the device is already plugged in
    4.69 + Goto lbl_noupgrade
    4.70 +lbl_upgrade:
    4.71 + System::Get '${sysUpdateDriverForPlugAndPlayDevices}'
    4.72 + Pop $0
    4.73 + StrCmp $0 'error' lbl_noapi
    4.74 + DetailPrint "Updating the driver..."
    4.75 + ; 0, HID, INFPATH, 0, 0
    4.76 + Push $INSTDIR ; Otherwise this function will swallow it, dunno why
    4.77 + System::Call '${sysUpdateDriverForPlugAndPlayDevices}?e (0, R0, R1, 0, 0) .r0'
    4.78 + Pop $1 ; last error
    4.79 + Pop $INSTDIR
    4.80 + IntCmp $0 1 lbl_done
    4.81 + IntCmp $1 ${ERROR_NO_SUCH_DEVINST} lbl_notplugged
    4.82 + 
    4.83 + DetailPrint "Driver update has failed. ($R3:$0,$1)"
    4.84 + Goto lbl_noupgrade
    4.85 +lbl_notplugged:
    4.86 + DetailPrint "The device is not plugged in, cannot update the driver."
    4.87 + Goto lbl_noupgrade
    4.88 +lbl_noapi:
    4.89 + DetailPrint "Your Windows $R3 doesn't support driver updates."
    4.90 + 
    4.91 +lbl_noupgrade:
    4.92 + ; Pre-install the driver
    4.93 + System::Get '${sysSetupCopyOEMInf}'
    4.94 + Pop $0
    4.95 + StrCmp $0 'error' lbl_inoapi
    4.96 + DetailPrint "Installing the driver..."
    4.97 + ; INFPATH, INFDIR, SPOST_PATH, "", 0, 0, 0, 0
    4.98 + System::Call '${sysSetupCopyOEMInf}?e (R1, R2, ${SPOST_PATH}, 0, 0, 0, 0, 0) .r0'
    4.99 + Pop $1 ; last error
   4.100 + IntCmp $0 1 lbl_nodriver
   4.101 + DetailPrint 'Driver pre-installation has failed with error #$1 ($R3)'
   4.102 + Goto lbl_done
   4.103 +lbl_inoapi:
   4.104 + DetailPrint "Your Windows $R3 doesn't support driver pre-installation."
   4.105 +lbl_nodriver:
   4.106 +lbl_done:
   4.107 + 
   4.108 +FunctionEnd
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/drvsetup.nsh	Sun Jun 01 23:16:21 2008 +1000
     5.3 @@ -0,0 +1,15 @@
     5.4 +; BOOL UpdateDriverForPlugAndPlayDevices(HWND, PSTR, PSTR, DWORD, PBOOL);
     5.5 +!define sysUpdateDriverForPlugAndPlayDevices "newdev::UpdateDriverForPlugAndPlayDevices(i, t, t, i, *i) i"
     5.6 +; the masked value of ERROR_NO_SUCH_DEVINST is 523
     5.7 +!define ERROR_NO_SUCH_DEVINST -536870389
     5.8 + 
     5.9 +;BOOL SetupCopyOEMInf(PSTR, PSTR, DWORD, DWORD, PSTR, DWORD, PDWORD, PSTR);
    5.10 +!define sysSetupCopyOEMInf "setupapi::SetupCopyOEMInf(t, t, i, i, i, i, *i, t) i"
    5.11 +!define SPOST_NONE 0
    5.12 +!define SPOST_PATH 1
    5.13 +!define SPOST_URL 2
    5.14 +!define SP_COPY_DELETESOURCE 0x1
    5.15 +!define SP_COPY_REPLACEONLY 0x2
    5.16 +!define SP_COPY_NOOVERWRITE 0x8
    5.17 +!define SP_COPY_OEMINF_CATALOG_ONLY 0x40000
    5.18 +
     6.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.2 +++ b/installer.nsi	Sun Jun 01 23:16:21 2008 +1000
     6.3 @@ -0,0 +1,362 @@
     6.4 +!include "MUI.nsh"
     6.5 +!include "driver.nsh"
     6.6 +
     6.7 +!define AppName "Xen PV Drivers"
     6.8 +!define StartMenu "$SMPROGRAMS\${AppName}"
     6.9 +!define Version "0.9.5"
    6.10 +#!define Version "$%VERSION%"
    6.11 +Name "${AppName}"
    6.12 +InstallDir "$PROGRAMFILES\${AppName}"
    6.13 +OutFile "${AppName} ${Version}.exe"
    6.14 +
    6.15 +# make sure /GPLPV is not currently active
    6.16 +
    6.17 +#!define MUI_PAGE_CUSTOMFUNCTION_PRE WelcomePageSetupLinkPre
    6.18 +#!define MUI_PAGE_CUSTOMFUNCTION_SHOW WelcomePageSetupLinkShow
    6.19 +!define MUI_STARTMENUPAGE
    6.20 +!define MUI_COMPONENTSPAGE
    6.21 +!define MUI_DIRECTORYPAGE
    6.22 +!insertmacro MUI_PAGE_WELCOME
    6.23 +!insertmacro MUI_PAGE_COMPONENTS
    6.24 +!insertmacro MUI_PAGE_INSTFILES
    6.25 +!define MUI_UNINSTALLER
    6.26 +!insertmacro MUI_LANGUAGE "English"
    6.27 +
    6.28 +Section "Common Files"
    6.29 +  SectionIn RO
    6.30 +  SetOutPath $INSTDIR
    6.31 +  File .\doc\Building.txt
    6.32 +  File .\doc\Installing.txt
    6.33 +  File .\doc\Readme.txt
    6.34 +  File .\doc\TODO.txt
    6.35 +  CreateDirectory "${StartMenu}\"
    6.36 +  CreateShortCut "${StartMenu}\Building.lnk" "$INSTDIR\Building.txt"
    6.37 +  CreateShortCut "${StartMenu}\Installing.lnk" "$INSTDIR\Installing.txt"
    6.38 +  CreateShortCut "${StartMenu}\Readme.lnk" "$INSTDIR\Readme.txt"
    6.39 +  CreateShortCut "${StartMenu}\TODO.lnk" "$INSTDIR\TODO.txt"
    6.40 +  CreateShortCut "${StartMenu}\Wiki Page.lnk" "http://wiki.xensource.com/xenwiki/XenWindowsGplPv" 
    6.41 +  WriteUninstaller $INSTDIR\Uninstall.exe
    6.42 +  CreateShortCut "${StartMenu}\Uninstall.lnk" "$INSTDIR\uninstall.exe"
    6.43 +SectionEnd
    6.44 +
    6.45 +Section "Shutdown Monitor Service" shutdownmon
    6.46 +  SetOutPath $INSTDIR
    6.47 +
    6.48 +  # stop shutdownmon service
    6.49 +  File .\target\ShutdownMon.exe
    6.50 +  CreateShortCut "${StartMenu}\Install Shutdown Service.lnk" "$INSTDIR\ShutdownMon.exe" "-i"
    6.51 +  CreateShortCut "${StartMenu}\UnInstall Shutdown Service.lnk" "$INSTDIR\ShutdownMon.exe" "-u"
    6.52 +  # start shutdownmon service
    6.53 +SectionEnd
    6.54 +  
    6.55 +Section "Windows 2000" win2k
    6.56 +  SetOutPath $INSTDIR\drivers
    6.57 +  File .\target\win2k\xenpci.inf
    6.58 +  File .\target\win2k\xennet.inf
    6.59 +  File .\target\win2k\xenvbd.inf
    6.60 +  File .\target\win2k\xenscsi.inf
    6.61 +  File .\target\win2k\xenstub.inf
    6.62 +  SetOutPath $INSTDIR\drivers\i386
    6.63 +  File .\target\win2k\i386\xenpci.sys
    6.64 +  File .\target\win2k\i386\xenhide.sys
    6.65 +  File .\target\win2k\i386\xennet.sys
    6.66 +  File .\target\win2k\i386\xenvbd.sys
    6.67 +  File .\target\win2k\i386\xenscsi.sys
    6.68 +  File .\target\win2k\i386\xenstub.sys
    6.69 +SectionEnd
    6.70 +
    6.71 +Section "Windows XP" winxp
    6.72 +  SetOutPath $INSTDIR\drivers
    6.73 +  File .\target\winxp\xenpci.inf
    6.74 +  File .\target\winxp\xennet.inf
    6.75 +  File .\target\winxp\xenvbd.inf
    6.76 +  File .\target\winxp\xenscsi.inf
    6.77 +  File .\target\winxp\xenstub.inf
    6.78 +  SetOutPath $INSTDIR\drivers\i386
    6.79 +  File .\target\winxp\i386\xenpci.sys
    6.80 +  File .\target\winxp\i386\xenhide.sys
    6.81 +  File .\target\winxp\i386\xennet.sys
    6.82 +  File .\target\winxp\i386\xenvbd.sys
    6.83 +  File .\target\winxp\i386\xenscsi.sys
    6.84 +  File .\target\winxp\i386\xenstub.sys
    6.85 +SectionEnd
    6.86 +
    6.87 +Section "Windows 2003 x32" win2k3x32
    6.88 +  SetOutPath $INSTDIR\drivers
    6.89 +  File .\target\winnet\xenpci.inf
    6.90 +  File .\target\winnet\xennet.inf
    6.91 +  File .\target\winnet\xenvbd.inf
    6.92 +  File .\target\winnet\xenscsi.inf
    6.93 +  File .\target\winnet\xenstub.inf
    6.94 +  SetOutPath $INSTDIR\drivers\i386
    6.95 +  File .\target\winnet\i386\xenpci.sys
    6.96 +  File .\target\winnet\i386\xenhide.sys
    6.97 +  File .\target\winnet\i386\xennet.sys
    6.98 +  File .\target\winnet\i386\xenvbd.sys
    6.99 +  File .\target\winnet\i386\xenscsi.sys
   6.100 +  File .\target\winnet\i386\xenstub.sys
   6.101 +SectionEnd
   6.102 +
   6.103 +Section "Windows 2003 x64" win2k3x64
   6.104 +  SetOutPath $INSTDIR\drivers
   6.105 +  File .\target\winnet\xenpci.inf
   6.106 +  File .\target\winnet\xennet.inf
   6.107 +  File .\target\winnet\xenvbd.inf
   6.108 +  File .\target\winnet\xenscsi.inf
   6.109 +  File .\target\winnet\xenstub.inf
   6.110 +  SetOutPath $INSTDIR\drivers\amd64
   6.111 +  File .\target\winnet\amd64\xenpci.sys
   6.112 +  File .\target\winnet\amd64\xenhide.sys
   6.113 +  File .\target\winnet\amd64\xennet.sys
   6.114 +  File .\target\winnet\amd64\xenvbd.sys
   6.115 +  File .\target\winnet\amd64\xenscsi.sys
   6.116 +  File .\target\winnet\amd64\xenstub.sys
   6.117 +SectionEnd
   6.118 +
   6.119 +Section "Windows 2008 x32" win2k8x32
   6.120 +  SetOutPath $INSTDIR\drivers
   6.121 +  File .\target\winlh\xenpci.inf
   6.122 +  File .\target\winlh\xennet.inf
   6.123 +  File .\target\winlh\xenvbd.inf
   6.124 +  File .\target\winlh\xenscsi.inf
   6.125 +  File .\target\winlh\xenstub.inf
   6.126 +  SetOutPath $INSTDIR\drivers\i386
   6.127 +  File .\target\winlh\i386\xenpci.sys
   6.128 +  File .\target\winlh\i386\xenhide.sys
   6.129 +  File .\target\winlh\i386\xennet.sys
   6.130 +  File .\target\winlh\i386\xenvbd.sys
   6.131 +  File .\target\winlh\i386\xenscsi.sys
   6.132 +  File .\target\winlh\i386\xenstub.sys
   6.133 +SectionEnd
   6.134 +
   6.135 +Section "Windows 2008 x64" win2k8x64
   6.136 +  SetOutPath $INSTDIR\drivers
   6.137 +  File .\target\winlh\xenpci.inf
   6.138 +  File .\target\winlh\xennet.inf
   6.139 +  File .\target\winlh\xenvbd.inf
   6.140 +  File .\target\winlh\xenscsi.inf
   6.141 +  File .\target\winlh\xenstub.inf
   6.142 +  SetOutPath $INSTDIR\drivers\amd64
   6.143 +  File .\target\winlh\amd64\xenpci.sys
   6.144 +  File .\target\winlh\amd64\xenhide.sys
   6.145 +  File .\target\winlh\amd64\xennet.sys
   6.146 +  File .\target\winlh\amd64\xenvbd.sys
   6.147 +  File .\target\winlh\amd64\xenscsi.sys
   6.148 +  File .\target\winlh\amd64\xenstub.sys
   6.149 +SectionEnd
   6.150 +
   6.151 +Section "Install Drivers" installdrivers
   6.152 +  Push "$INSTDIR\drivers"
   6.153 +  Push "$INSTDIR\drivers\xenpci.inf"
   6.154 +  Push "PCI\VEN_5853&DEV_0001"
   6.155 +  Call InstallUpgradeDriver
   6.156 +
   6.157 +  Push "$INSTDIR\drivers"
   6.158 +  Push "$INSTDIR\drivers\xennet.inf"
   6.159 +  Push "XEN\VIF"
   6.160 +  Call InstallUpgradeDriver
   6.161 +
   6.162 +  Push "$INSTDIR\drivers"
   6.163 +  Push "$INSTDIR\drivers\xenvbd.inf"
   6.164 +  Push "XEN\VBD"
   6.165 +  Call InstallUpgradeDriver
   6.166 +
   6.167 +  Push "$INSTDIR\drivers"
   6.168 +  Push "$INSTDIR\drivers\xenscsi.inf"
   6.169 +  Push "XEN\VSCSI"
   6.170 +  Call InstallUpgradeDriver
   6.171 +
   6.172 +  Push "$INSTDIR\drivers"
   6.173 +  Push "$INSTDIR\drivers\xenstub.inf"
   6.174 +  Push "XEN\CONSOLE"
   6.175 +  Call InstallUpgradeDriver
   6.176 +
   6.177 +  Push "$INSTDIR\drivers"
   6.178 +  Push "$INSTDIR\drivers\xenstub.inf"
   6.179 +  Push "XEN\VFB"
   6.180 +  Call InstallUpgradeDriver
   6.181 +
   6.182 +  Push "$INSTDIR\drivers"
   6.183 +  Push "$INSTDIR\drivers\xenstub.inf"
   6.184 +  Push "XEN\VKBD"
   6.185 +  Call InstallUpgradeDriver
   6.186 +SectionEnd
   6.187 +
   6.188 +Var arch
   6.189 +
   6.190 +Function .onInit
   6.191 +  Push $0
   6.192 + 
   6.193 +  ReadRegStr $0 HKLM SYSTEM\CurrentControlSet\Control SystemStartOptions
   6.194 +  Push $0
   6.195 +  Push "GPLPV"
   6.196 +  Call StrContains
   6.197 +  Pop $0
   6.198 +  StrCmp $0 "" no_GPLPV
   6.199 +  MessageBox MB_OK "Warning - GPLPV specified on boot. Upgrade may work but install may break things"
   6.200 +no_GPLPV:
   6.201 +  
   6.202 +  Call GetWindowsVersion
   6.203 +  Pop $R0
   6.204 +  
   6.205 +  StrCmp $R0 "2000" 0 check_XP
   6.206 +  StrCpy $arch "win2k"
   6.207 +  Goto version_done
   6.208 +check_XP:
   6.209 +  StrCmp $R0 "XP" 0 check_2k3
   6.210 +  StrCpy $arch "winxp"
   6.211 +  Goto version_done
   6.212 +check_2k3:
   6.213 +  StrCmp $R0 "2003" 0 check_2k8
   6.214 +  ReadRegStr $0 HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" PROCESSOR_ARCHITECTURE
   6.215 +  StrCmp $0 "AMD64" version_2k3x64
   6.216 +  StrCpy $arch "win2k3x32"
   6.217 +  Goto version_done
   6.218 +version_2k3x64:
   6.219 +  StrCpy $arch "win2k3x64"
   6.220 +  Goto version_done
   6.221 +check_2k8:
   6.222 +  StrCmp $R0 "Vista" 0 version_error
   6.223 +  ReadRegStr $0 HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" PROCESSOR_ARCHITECTURE
   6.224 +  StrCmp $0 "AMD64" version_2k8x64
   6.225 +  StrCpy $arch "win2k8x32"
   6.226 +  Goto version_done
   6.227 +version_2k8x64:
   6.228 +  StrCpy $arch "win2k8x64"
   6.229 +  Goto version_done
   6.230 +version_error:
   6.231 +  MessageBox MB_OK "Unable to detect windows version - proceed with caution"
   6.232 +  StrCpy $arch ""
   6.233 +
   6.234 +version_done:
   6.235 +  Call SelectSection
   6.236 +
   6.237 +#  SectionGetFlags ${sec1} $0
   6.238 +#  IntOp $0 $0 | ${SF_SELECTED}
   6.239 +#  SectionSetFlags ${sec1} $0
   6.240 + 
   6.241 +  Pop $0
   6.242 +FunctionEnd
   6.243 +
   6.244 +Var NewArch
   6.245 +
   6.246 +Function .onSelChange
   6.247 +  Push $0
   6.248 +  
   6.249 +  StrCmp $arch "win2k" check_xp
   6.250 +  SectionGetFlags ${win2k} $0
   6.251 +  IntOp $0 $0 & ${SF_SELECTED}
   6.252 +  IntCmp $0 ${SF_SELECTED} 0 check_xp check_xp
   6.253 +  StrCpy $newarch "win2k"
   6.254 +check_xp:
   6.255 +  StrCmp $arch "winxp" check_2k3x32
   6.256 +  SectionGetFlags ${winxp} $0
   6.257 +  IntOp $0 $0 & ${SF_SELECTED}
   6.258 +  IntCmp $0 ${SF_SELECTED} 0 check_2k3x32 check_2k3x32
   6.259 +  StrCpy $newarch "winxp"
   6.260 +check_2k3x32:
   6.261 +  StrCmp $arch "win2k3x32" check_2k3x64
   6.262 +  SectionGetFlags ${win2k3x32} $0
   6.263 +  IntOp $0 $0 & ${SF_SELECTED}
   6.264 +  IntCmp $0 ${SF_SELECTED} 0 check_2k3x64 check_2k3x64
   6.265 +  StrCpy $newarch "win2k3x32"
   6.266 +check_2k3x64:
   6.267 +  StrCmp $arch "win2k3x64" check_2k8x32
   6.268 +  SectionGetFlags ${win2k3x64} $0
   6.269 +  IntOp $0 $0 & ${SF_SELECTED}
   6.270 +  IntCmp $0 ${SF_SELECTED} 0 check_2k8x32 check_2k8x32
   6.271 +  StrCpy $newarch "win2k3x64"
   6.272 +check_2k8x32:
   6.273 +  StrCmp $arch "win2k8x32" check_2k8x64
   6.274 +  SectionGetFlags ${win2k8x32} $0
   6.275 +  IntOp $0 $0 & ${SF_SELECTED}
   6.276 +  IntCmp $0 ${SF_SELECTED} 0 check_2k8x64 check_2k8x64
   6.277 +  StrCpy $newarch "win2k8x32"
   6.278 +check_2k8x64:
   6.279 +  StrCmp $arch "win2k8x64" done
   6.280 +  SectionGetFlags ${win2k8x64} $0
   6.281 +  IntOp $0 $0 & ${SF_SELECTED}
   6.282 +  IntCmp $0 ${SF_SELECTED} 0 done done
   6.283 +  StrCpy $newarch "win2k8x64"
   6.284 +done:
   6.285 +  StrCpy $arch $newarch
   6.286 +  Call SelectSection
   6.287 +
   6.288 +  Pop $0
   6.289 +FunctionEnd
   6.290 +
   6.291 +Function SelectSection
   6.292 +  Push $0
   6.293 +
   6.294 +  StrCmp $arch "win2k" check_xp
   6.295 +  SectionGetFlags ${win2k} $0
   6.296 +  IntOp $0 $0 & ${SECTION_OFF}
   6.297 +  SectionSetFlags ${win2k} $0
   6.298 +check_xp:
   6.299 +  StrCmp $arch "winxp" check_2k3x32
   6.300 +  SectionGetFlags ${winxp} $0
   6.301 +  IntOp $0 $0 & ${SECTION_OFF}
   6.302 +  SectionSetFlags ${winxp} $0
   6.303 +check_2k3x32:
   6.304 +  StrCmp $arch "win2k3x32" check_2k3x64
   6.305 +  SectionGetFlags ${win2k3x32} $0
   6.306 +  IntOp $0 $0 & ${SECTION_OFF}
   6.307 +  SectionSetFlags ${win2k3x32} $0
   6.308 +check_2k3x64:
   6.309 +  StrCmp $arch "win2k3x64" check_2k8x32
   6.310 +  SectionGetFlags ${win2k3x64} $0
   6.311 +  IntOp $0 $0 & ${SECTION_OFF}
   6.312 +  SectionSetFlags ${win2k3x64} $0
   6.313 +check_2k8x32:
   6.314 +  StrCmp $arch "win2k8x32" check_2k8x64
   6.315 +  SectionGetFlags ${win2k8x32} $0
   6.316 +  IntOp $0 $0 & ${SECTION_OFF}
   6.317 +  SectionSetFlags ${win2k8x32} $0
   6.318 +check_2k8x64:
   6.319 +  StrCmp $arch "win2k8x64" done
   6.320 +  SectionGetFlags ${win2k8x64} $0
   6.321 +  IntOp $0 $0 & ${SECTION_OFF}
   6.322 +  SectionSetFlags ${win2k8x64} $0
   6.323 +done:
   6.324 +  Pop $0
   6.325 +
   6.326 +FunctionEnd
   6.327 +
   6.328 +Section "Uninstall"
   6.329 +  Delete "${StartMenu}\Uninstall.lnk"
   6.330 +  RMDir "${StartMenu}\"
   6.331 +  Delete $INSTDIR\uninstall.exe
   6.332 +  RMDir $INSTDIR
   6.333 +SectionEnd
   6.334 +
   6.335 +Var STR_HAYSTACK
   6.336 +Var STR_NEEDLE
   6.337 +Var STR_CONTAINS_VAR_1
   6.338 +Var STR_CONTAINS_VAR_2
   6.339 +Var STR_CONTAINS_VAR_3
   6.340 +Var STR_CONTAINS_VAR_4
   6.341 +Var STR_RETURN_VAR
   6.342 + 
   6.343 +Function StrContains
   6.344 +  Exch $STR_NEEDLE
   6.345 +  Exch 1
   6.346 +  Exch $STR_HAYSTACK
   6.347 +  ; Uncomment to debug
   6.348 +  ;MessageBox MB_OK 'STR_NEEDLE = $STR_NEEDLE STR_HAYSTACK = $STR_HAYSTACK '
   6.349 +    StrCpy $STR_RETURN_VAR ""
   6.350 +    StrCpy $STR_CONTAINS_VAR_1 -1
   6.351 +    StrLen $STR_CONTAINS_VAR_2 $STR_NEEDLE
   6.352 +    StrLen $STR_CONTAINS_VAR_4 $STR_HAYSTACK
   6.353 +    loop:
   6.354 +      IntOp $STR_CONTAINS_VAR_1 $STR_CONTAINS_VAR_1 + 1
   6.355 +      StrCpy $STR_CONTAINS_VAR_3 $STR_HAYSTACK $STR_CONTAINS_VAR_2 $STR_CONTAINS_VAR_1
   6.356 +      StrCmp $STR_CONTAINS_VAR_3 $STR_NEEDLE found
   6.357 +      StrCmp $STR_CONTAINS_VAR_1 $STR_CONTAINS_VAR_4 done
   6.358 +      Goto loop
   6.359 +    found:
   6.360 +      StrCpy $STR_RETURN_VAR $STR_NEEDLE
   6.361 +      Goto done
   6.362 +    done:
   6.363 +   Pop $STR_NEEDLE ;Prevent "invalid opcode" errors and keep the
   6.364 +   Exch $STR_RETURN_VAR  
   6.365 +FunctionEnd
     7.1 --- a/makedist.bat	Sat May 31 22:35:47 2008 +1000
     7.2 +++ b/makedist.bat	Sun Jun 01 23:16:21 2008 +1000
     7.3 @@ -1,9 +1,12 @@
     7.4  @echo off
     7.5 -cmd /C "C:\WinDDK\6001.17121\bin\setenv.bat C:\WinDDK\6001.17121\ chk W2K && CD \Projects\win-pvdrivers.hg && build -cZg"
     7.6 -cmd /C "C:\WinDDK\6001.17121\bin\setenv.bat C:\WinDDK\6001.17121\ chk WXP && CD \Projects\win-pvdrivers.hg && build -cZg"
     7.7 -cmd /C "C:\WinDDK\6001.17121\bin\setenv.bat C:\WinDDK\6001.17121\ chk WNET && CD \Projects\win-pvdrivers.hg && build -cZg"
     7.8 -cmd /C "C:\WinDDK\6001.17121\bin\setenv.bat C:\WinDDK\6001.17121\ chk x64 WNET && CD \Projects\win-pvdrivers.hg && build -cZg"
     7.9 -cmd /C "C:\WinDDK\6001.17121\bin\setenv.bat C:\WinDDK\6001.17121\ chk WLH && CD \Projects\win-pvdrivers.hg && build -cZg"
    7.10 -cmd /C "C:\WinDDK\6001.17121\bin\setenv.bat C:\WinDDK\6001.17121\ chk x64 WLH && CD \Projects\win-pvdrivers.hg && build -cZg"
    7.11 -xcopy target\* dist /E /EXCLUDE:exclude.txt /I /D /Y
    7.12 -copy doc\*.txt dist
    7.13 +IF NOT EXIST set_ddk_path.bat ECHO >set_ddk_path.bat SET DDK_PATH=C:\WinDDK\6001.17121
    7.14 +CALL set_ddk_path.bat
    7.15 +cmd /C "%DDK_PATH%\bin\setenv.bat %DDK_PATH%\ chk W2K && CD \Projects\win-pvdrivers.hg && build -cZg"
    7.16 +cmd /C "%DDK_PATH%\bin\setenv.bat %DDK_PATH%\ chk WXP && CD \Projects\win-pvdrivers.hg && build -cZg"
    7.17 +cmd /C "%DDK_PATH%\bin\setenv.bat %DDK_PATH%\ chk WNET && CD \Projects\win-pvdrivers.hg && build -cZg"
    7.18 +cmd /C "%DDK_PATH%\bin\setenv.bat %DDK_PATH%\ chk x64 WNET && CD \Projects\win-pvdrivers.hg && build -cZg"
    7.19 +cmd /C "%DDK_PATH%\bin\setenv.bat %DDK_PATH%\ chk WLH && CD \Projects\win-pvdrivers.hg && build -cZg"
    7.20 +cmd /C "%DDK_PATH%\bin\setenv.bat %DDK_PATH%\ chk x64 WLH && CD \Projects\win-pvdrivers.hg && build -cZg"
    7.21 +rem xcopy target\* dist /E /EXCLUDE:exclude.txt /I /D /Y
    7.22 +rem copy doc\*.txt dist
    7.23 +"%ProgramFiles%\NSIS\makensis.exe" installer.nsi
    7.24 \ No newline at end of file
     8.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.2 +++ b/winver.nsh	Sun Jun 01 23:16:21 2008 +1000
     8.3 @@ -0,0 +1,94 @@
     8.4 +; GetWindowsVersion
     8.5 +;
     8.6 +; Based on Yazno's function, http://yazno.tripod.com/powerpimpit/
     8.7 +; Updated by Joost Verburg
     8.8 +;
     8.9 +; Returns on top of stack
    8.10 +;
    8.11 +; Windows Version (95, 98, ME, NT x.x, 2000, XP, 2003, Vista)
    8.12 +; or
    8.13 +; '' (Unknown Windows Version)
    8.14 +;
    8.15 +; Usage:
    8.16 +;   Call GetWindowsVersion
    8.17 +;   Pop $R0
    8.18 +;   ; at this point $R0 is "NT 4.0" or whatnot
    8.19 + 
    8.20 +Function GetWindowsVersion
    8.21 + 
    8.22 +  Push $R0
    8.23 +  Push $R1
    8.24 + 
    8.25 +  ClearErrors
    8.26 + 
    8.27 +  ReadRegStr $R0 HKLM \
    8.28 +  "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
    8.29 + 
    8.30 +  IfErrors 0 lbl_winnt
    8.31 + 
    8.32 +  ; we are not NT
    8.33 +  ReadRegStr $R0 HKLM \
    8.34 +  "SOFTWARE\Microsoft\Windows\CurrentVersion" VersionNumber
    8.35 + 
    8.36 +  StrCpy $R1 $R0 1
    8.37 +  StrCmp $R1 '4' 0 lbl_error
    8.38 + 
    8.39 +  StrCpy $R1 $R0 3
    8.40 + 
    8.41 +  StrCmp $R1 '4.0' lbl_win32_95
    8.42 +  StrCmp $R1 '4.9' lbl_win32_ME lbl_win32_98
    8.43 + 
    8.44 +  lbl_win32_95:
    8.45 +    StrCpy $R0 '95'
    8.46 +  Goto lbl_done
    8.47 + 
    8.48 +  lbl_win32_98:
    8.49 +    StrCpy $R0 '98'
    8.50 +  Goto lbl_done
    8.51 + 
    8.52 +  lbl_win32_ME:
    8.53 +    StrCpy $R0 'ME'
    8.54 +  Goto lbl_done
    8.55 + 
    8.56 +  lbl_winnt:
    8.57 + 
    8.58 +  StrCpy $R1 $R0 1
    8.59 + 
    8.60 +  StrCmp $R1 '3' lbl_winnt_x
    8.61 +  StrCmp $R1 '4' lbl_winnt_x
    8.62 + 
    8.63 +  StrCpy $R1 $R0 3
    8.64 + 
    8.65 +  StrCmp $R1 '5.0' lbl_winnt_2000
    8.66 +  StrCmp $R1 '5.1' lbl_winnt_XP
    8.67 +  StrCmp $R1 '5.2' lbl_winnt_2003
    8.68 +  StrCmp $R1 '6.0' lbl_winnt_vista lbl_error
    8.69 + 
    8.70 +  lbl_winnt_x:
    8.71 +    StrCpy $R0 "NT $R0" 6
    8.72 +  Goto lbl_done
    8.73 + 
    8.74 +  lbl_winnt_2000:
    8.75 +    Strcpy $R0 '2000'
    8.76 +  Goto lbl_done
    8.77 + 
    8.78 +  lbl_winnt_XP:
    8.79 +    Strcpy $R0 'XP'
    8.80 +  Goto lbl_done
    8.81 + 
    8.82 +  lbl_winnt_2003:
    8.83 +    Strcpy $R0 '2003'
    8.84 +  Goto lbl_done
    8.85 + 
    8.86 +  lbl_winnt_vista:
    8.87 +    Strcpy $R0 'Vista'
    8.88 +  Goto lbl_done
    8.89 + 
    8.90 +  lbl_error:
    8.91 +    Strcpy $R0 ''
    8.92 +  lbl_done:
    8.93 + 
    8.94 +  Pop $R1
    8.95 +  Exch $R0
    8.96 + 
    8.97 +FunctionEnd
    8.98 \ No newline at end of file
     9.1 --- a/xenpci/sources	Sat May 31 22:35:47 2008 +1000
     9.2 +++ b/xenpci/sources	Sun Jun 01 23:16:21 2008 +1000
     9.3 @@ -1,6 +1,4 @@
     9.4  !INCLUDE ..\common.inc
     9.5 -!UNDEF KMDF_VERSION
     9.6 -!UNDEF KMDF_VERSION_MAJOR
     9.7  TARGETNAME=xenpci
     9.8  TARGETTYPE=DRIVER
     9.9  INF_NAME=$(TARGETNAME)
    10.1 --- a/xenpci/xenpci.h	Sat May 31 22:35:47 2008 +1000
    10.2 +++ b/xenpci/xenpci.h	Sun Jun 01 23:16:21 2008 +1000
    10.3 @@ -261,12 +261,28 @@ sw_interrupt(UCHAR intno)
    10.4    SWINT(0x38) SWINT(0x39) SWINT(0x3A) SWINT(0x3B) SWINT(0x3C) SWINT(0x3D) SWINT(0x3E) SWINT(0x3F)
    10.5    SWINT(0x40) SWINT(0x41) SWINT(0x42) SWINT(0x43) SWINT(0x44) SWINT(0x45) SWINT(0x46) SWINT(0x47)
    10.6    SWINT(0x48) SWINT(0x49) SWINT(0x4A) SWINT(0x4B) SWINT(0x4C) SWINT(0x4D) SWINT(0x4E) SWINT(0x4F)
    10.7 -
    10.8 +  SWINT(0x50) SWINT(0x51) SWINT(0x52) SWINT(0x53) SWINT(0x54) SWINT(0x55) SWINT(0x56) SWINT(0x57)
    10.9 +  SWINT(0x58) SWINT(0x59) SWINT(0x5A) SWINT(0x5B) SWINT(0x5C) SWINT(0x5D) SWINT(0x5E) SWINT(0x5F)
   10.10 +  SWINT(0x60) SWINT(0x61) SWINT(0x62) SWINT(0x63) SWINT(0x64) SWINT(0x65) SWINT(0x66) SWINT(0x67)
   10.11 +  SWINT(0x68) SWINT(0x69) SWINT(0x6A) SWINT(0x6B) SWINT(0x6C) SWINT(0x6D) SWINT(0x6E) SWINT(0x6F)
   10.12 +  SWINT(0x70) SWINT(0x71) SWINT(0x72) SWINT(0x73) SWINT(0x74) SWINT(0x75) SWINT(0x76) SWINT(0x77)
   10.13 +  SWINT(0x78) SWINT(0x79) SWINT(0x7A) SWINT(0x7B) SWINT(0x7C) SWINT(0x7D) SWINT(0x7E) SWINT(0x7F)
   10.14    SWINT(0x80) SWINT(0x81) SWINT(0x82) SWINT(0x83) SWINT(0x84) SWINT(0x85) SWINT(0x86) SWINT(0x87)
   10.15    SWINT(0x88) SWINT(0x89) SWINT(0x8A) SWINT(0x8B) SWINT(0x8C) SWINT(0x8D) SWINT(0x8E) SWINT(0x8F)
   10.16 -
   10.17 +  SWINT(0x90) SWINT(0x91) SWINT(0x92) SWINT(0x93) SWINT(0x94) SWINT(0x95) SWINT(0x96) SWINT(0x97)
   10.18 +  SWINT(0x98) SWINT(0x99) SWINT(0x9A) SWINT(0x9B) SWINT(0x9C) SWINT(0x9D) SWINT(0x9E) SWINT(0x9F)
   10.19 +  SWINT(0xA0) SWINT(0xA1) SWINT(0xA2) SWINT(0xA3) SWINT(0xA4) SWINT(0xA5) SWINT(0xA6) SWINT(0xA7)
   10.20 +  SWINT(0xA8) SWINT(0xA9) SWINT(0xAA) SWINT(0xAB) SWINT(0xAC) SWINT(0xAD) SWINT(0xAE) SWINT(0xAF)
   10.21    SWINT(0xB0) SWINT(0xB1) SWINT(0xB2) SWINT(0xB3) SWINT(0xB4) SWINT(0xB5) SWINT(0xB6) SWINT(0xB7)
   10.22    SWINT(0xB8) SWINT(0xB9) SWINT(0xBA) SWINT(0xBB) SWINT(0xBC) SWINT(0xBD) SWINT(0xBE) SWINT(0xBF)
   10.23 +  SWINT(0xC0) SWINT(0xC1) SWINT(0xC2) SWINT(0xC3) SWINT(0xC4) SWINT(0xC5) SWINT(0xC6) SWINT(0xC7)
   10.24 +  SWINT(0xC8) SWINT(0xC9) SWINT(0xCA) SWINT(0xCB) SWINT(0xCC) SWINT(0xCD) SWINT(0xCE) SWINT(0xCF)
   10.25 +  SWINT(0xD0) SWINT(0xD1) SWINT(0xD2) SWINT(0xD3) SWINT(0xD4) SWINT(0xD5) SWINT(0xD6) SWINT(0xD7)
   10.26 +  SWINT(0xD8) SWINT(0xD9) SWINT(0xDA) SWINT(0xDB) SWINT(0xDC) SWINT(0xDD) SWINT(0xDE) SWINT(0xDF)
   10.27 +  SWINT(0xE0) SWINT(0xE1) SWINT(0xE2) SWINT(0xE3) SWINT(0xE4) SWINT(0xE5) SWINT(0xE6) SWINT(0xE7)
   10.28 +  SWINT(0xE8) SWINT(0xE9) SWINT(0xEA) SWINT(0xEB) SWINT(0xEC) SWINT(0xED) SWINT(0xEE) SWINT(0xEF)
   10.29 +  SWINT(0xF0) SWINT(0xF1) SWINT(0xF2) SWINT(0xF3) SWINT(0xF4) SWINT(0xF5) SWINT(0xF6) SWINT(0xF7)
   10.30 +  SWINT(0xF8) SWINT(0xF9) SWINT(0xFA) SWINT(0xFB) SWINT(0xFC) SWINT(0xFD) SWINT(0xFE) SWINT(0xFF)
   10.31  
   10.32    default:
   10.33      KdPrint((__DRIVER_NAME "     interrupt %02X not set up. Blame James.\n", intno));
    11.1 --- a/xenpci/xenpci.inx	Sat May 31 22:35:47 2008 +1000
    11.2 +++ b/xenpci/xenpci.inx	Sun Jun 01 23:16:21 2008 +1000
    11.3 @@ -7,7 +7,6 @@ CatalogFile="XenGPLPV.cat"
    11.4  
    11.5  [DestinationDirs]
    11.6  DefaultDestDir = 12
    11.7 -ClassInstall32_CopyFiles=11
    11.8  
    11.9  [ControlFlags]
   11.10  ExcludeFromSelect=*
    12.1 --- a/xenpci/xenpci_fdo.c	Sat May 31 22:35:47 2008 +1000
    12.2 +++ b/xenpci/xenpci_fdo.c	Sun Jun 01 23:16:21 2008 +1000
    12.3 @@ -999,7 +999,7 @@ XenPci_Pnp_Fdo(PDEVICE_OBJECT device_obj
    12.4      KdPrint((__DRIVER_NAME "     IRP_MN_QUERY_STOP_DEVICE\n"));
    12.5      status = XenPci_Pnp_QueryStopRemoveDevice(device_object, irp);
    12.6      if (NT_SUCCESS(status))
    12.7 -      SET_PNP_STATE(&xpdd->common.fdo, RemovePending);
    12.8 +      SET_PNP_STATE(&xpdd->common, RemovePending);
    12.9      return status;
   12.10  
   12.11    case IRP_MN_STOP_DEVICE:
   12.12 @@ -1019,7 +1019,7 @@ XenPci_Pnp_Fdo(PDEVICE_OBJECT device_obj
   12.13      KdPrint((__DRIVER_NAME "     IRP_MN_QUERY_REMOVE_DEVICE\n"));
   12.14      status = XenPci_Pnp_QueryStopRemoveDevice(device_object, irp);
   12.15      if (NT_SUCCESS(status))
   12.16 -      SET_PNP_STATE(&xpdd->common.fdo, RemovePending);
   12.17 +      SET_PNP_STATE(&xpdd->common, RemovePending);
   12.18      return status;
   12.19  
   12.20    case IRP_MN_REMOVE_DEVICE:
   12.21 @@ -1030,7 +1030,7 @@ XenPci_Pnp_Fdo(PDEVICE_OBJECT device_obj
   12.22    case IRP_MN_CANCEL_REMOVE_DEVICE:
   12.23      KdPrint((__DRIVER_NAME "     IRP_MN_CANCEL_REMOVE_DEVICE\n"));
   12.24      IoSkipCurrentIrpStackLocation(irp);
   12.25 -    REVERT_PNP_STATE(&xpdd->common.fdo, &xpdd->common);
   12.26 +    REVERT_PNP_STATE(&xpdd->common);
   12.27      irp->IoStatus.Status = STATUS_SUCCESS;
   12.28      break;
   12.29  
    13.1 --- a/xenvbd/scsiport.c	Sat May 31 22:35:47 2008 +1000
    13.2 +++ b/xenvbd/scsiport.c	Sun Jun 01 23:16:21 2008 +1000
    13.3 @@ -30,7 +30,7 @@ Foundation, Inc., 51 Franklin Street, Fi
    13.4  #pragma warning(disable: 4127)
    13.5  
    13.6  #if defined(__x86_64__)
    13.7 -  #define GET_PAGE_ALIGNED(ptr) ((ptr + PAGE_SIZE - 1) & ~PAGE_MASK)
    13.8 +  #define GET_PAGE_ALIGNED(ptr) ((PVOID)(((ULONGLONG)ptr + PAGE_SIZE - 1) & ~(PAGE_SIZE - 1)))
    13.9  #else
   13.10    #define GET_PAGE_ALIGNED(ptr) UlongToPtr((PtrToUlong(ptr) + PAGE_SIZE - 1) & ~(PAGE_SIZE - 1))
   13.11  #endif
   13.12 @@ -688,8 +688,8 @@ XenVbd_HwScsiStartIo(PVOID DeviceExtensi
   13.13          if ((Srb->Cdb[1] & 1) == 0)
   13.14          {
   13.15            PINQUIRYDATA id = (PINQUIRYDATA)DataBuffer;
   13.16 -          id->DeviceType = DIRECT_ACCESS_DEVICE;          
   13.17 -          id->ANSIVersion = 3;
   13.18 +          id->DeviceType = DIRECT_ACCESS_DEVICE;
   13.19 +          id->Versions = 3;
   13.20            id->ResponseDataFormat = 0;
   13.21            id->AdditionalLength = FIELD_OFFSET(INQUIRYDATA, VendorSpecific) - FIELD_OFFSET(INQUIRYDATA, AdditionalLength);
   13.22            id->CommandQueue = 1;
   13.23 @@ -729,7 +729,7 @@ XenVbd_HwScsiStartIo(PVOID DeviceExtensi
   13.24            PINQUIRYDATA id = (PINQUIRYDATA)DataBuffer;
   13.25            id->DeviceType = READ_ONLY_DIRECT_ACCESS_DEVICE;
   13.26            id->RemovableMedia = 1;
   13.27 -          id->ANSIVersion = 3;
   13.28 +          id->Versions = 3;
   13.29            id->ResponseDataFormat = 0;
   13.30            id->AdditionalLength = FIELD_OFFSET(INQUIRYDATA, VendorSpecific) - FIELD_OFFSET(INQUIRYDATA, AdditionalLength);
   13.31            id->CommandQueue = 1;