win-pvdrivers

changeset 70:21502e79acc3

Added a small shutdown service to do the graceful shutdown
author James Harper <james.harper@bendigoit.com.au>
date Thu Dec 20 10:54:59 2007 +1100 (2007-12-20)
parents 6de0f54b913c
children 0d06cc4c5fc9
files ShutdownMon/Program.cs ShutdownMon/Properties/AssemblyInfo.cs ShutdownMon/ShutdownMon.csproj Xen.sln xenpci/sources xenpci/xenpci.c xenvbd/sources xenvbd/xenvbd.c
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/ShutdownMon/Program.cs	Thu Dec 20 10:54:59 2007 +1100
     1.3 @@ -0,0 +1,255 @@
     1.4 +using System;
     1.5 +using System.Collections;
     1.6 +using System.Configuration.Install;
     1.7 +using System.ComponentModel;
     1.8 +using System.IO;
     1.9 +using System.Runtime.InteropServices;
    1.10 +using System.Reflection;
    1.11 +using System.ServiceProcess;
    1.12 +using System.Text;
    1.13 +using System.Threading;
    1.14 +using Microsoft.Win32.SafeHandles;
    1.15 +
    1.16 +
    1.17 +namespace ShutdownMon
    1.18 +{
    1.19 +    class Program : ServiceBase
    1.20 +    {
    1.21 +        const UInt32 READ_CONTROL = 0x00020000;
    1.22 +        const UInt32 STANDARD_RIGHTS_READ = READ_CONTROL;
    1.23 +        const UInt32 FILE_READ_DATA = 0x0001;
    1.24 +        const UInt32 FILE_READ_ATTRIBUTES = 0x0080;
    1.25 +        const UInt32 FILE_READ_EA = 0x0008;
    1.26 +        const UInt32 SYNCHRONIZE = 0x00100000;
    1.27 +        const UInt32 OPEN_EXISTING = 3;
    1.28 +        const UInt32 FILE_GENERIC_READ = (STANDARD_RIGHTS_READ | FILE_READ_DATA | FILE_READ_ATTRIBUTES | FILE_READ_EA | SYNCHRONIZE);
    1.29 +        const UInt32 FILE_ATTRIBUTE_NORMAL = 0x0080;
    1.30 +
    1.31 +        [DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Auto)]
    1.32 +        internal static extern SafeFileHandle CreateFile(
    1.33 +            String Filename,
    1.34 +            UInt32 DesiredAccess,
    1.35 +            UInt32 ShareMode,
    1.36 +            IntPtr Attributes,
    1.37 +            UInt32 CreationDisposition,
    1.38 +            UInt32 FlagsAndAttributes,
    1.39 +            IntPtr TemplateFile);
    1.40 +
    1.41 +        [StructLayout(LayoutKind.Sequential, Pack = 1)]
    1.42 +        internal struct TokPriv1Luid
    1.43 +        {
    1.44 +            public int Count;
    1.45 +            public long Luid;
    1.46 +            public int Attr;
    1.47 +        }
    1.48 +
    1.49 +        [DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Auto)]
    1.50 +        internal static extern IntPtr GetCurrentProcess();
    1.51 +
    1.52 +        [DllImport("advapi32.dll", SetLastError = true, CharSet = CharSet.Auto)]
    1.53 +        internal static extern bool OpenProcessToken(IntPtr h, int acc, ref IntPtr phtok);
    1.54 +
    1.55 +        [DllImport("advapi32.dll", SetLastError = true, CharSet = CharSet.Auto)]
    1.56 +        internal static extern bool LookupPrivilegeValue(string host, string name, ref long pluid);
    1.57 +
    1.58 +        [DllImport("advapi32.dll", SetLastError = true, CharSet = CharSet.Auto)]
    1.59 +        internal static extern bool AdjustTokenPrivileges(IntPtr htok, bool disall, ref TokPriv1Luid newst, int len, IntPtr prev, IntPtr relen);
    1.60 +
    1.61 +        [DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Auto)]
    1.62 +        internal static extern bool ExitWindowsEx(int flg, int rea);
    1.63 +
    1.64 +        internal const int SE_PRIVILEGE_ENABLED = 0x00000002;
    1.65 +        internal const int TOKEN_QUERY = 0x00000008;
    1.66 +        internal const int TOKEN_ADJUST_PRIVILEGES = 0x00000020;
    1.67 +        internal const string SE_SHUTDOWN_NAME = "SeShutdownPrivilege";
    1.68 +        internal const int EWX_LOGOFF = 0x00000000;
    1.69 +        internal const int EWX_SHUTDOWN = 0x00000001;
    1.70 +        internal const int EWX_REBOOT = 0x00000002;
    1.71 +        internal const int EWX_FORCE = 0x00000004;
    1.72 +        internal const int EWX_POWEROFF = 0x00000008;
    1.73 +        internal const int EWX_FORCEIFHUNG = 0x00000010;
    1.74 +
    1.75 +        private static void DoExitWin(int flg)
    1.76 +        {
    1.77 +            bool ok;
    1.78 +            TokPriv1Luid tp;
    1.79 +            IntPtr hproc = GetCurrentProcess();
    1.80 +            IntPtr htok = IntPtr.Zero;
    1.81 +            ok = OpenProcessToken(hproc, TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, ref htok);
    1.82 +            tp.Count = 1;
    1.83 +            tp.Luid = 0;
    1.84 +            tp.Attr = SE_PRIVILEGE_ENABLED;
    1.85 +            ok = LookupPrivilegeValue(null, SE_SHUTDOWN_NAME, ref tp.Luid);
    1.86 +            ok = AdjustTokenPrivileges(htok, false, ref tp, 0, IntPtr.Zero,
    1.87 +            IntPtr.Zero);
    1.88 +            ok = ExitWindowsEx(flg, 0);
    1.89 +        }
    1.90 +
    1.91 +        const string MyServiceName = "XenShutdownMon";
    1.92 +        const string MyDisplayName = "Xen Shutdown Monitor Service";
    1.93 +        const string MyServiceDescription = "Monitors the kernel driver and shuts down Windows when directed";
    1.94 +
    1.95 +        static void Main(string[] args)
    1.96 +        {
    1.97 +            int argNo = 0;
    1.98 +
    1.99 +            while (argNo < args.Length)
   1.100 +            {
   1.101 +                string arg = args[argNo++];
   1.102 +                switch (arg)
   1.103 +                {
   1.104 +                    case "-i":
   1.105 +                        {
   1.106 +                            IDictionary mySavedState = new Hashtable();
   1.107 +
   1.108 +                            Installer i = new Installer();
   1.109 +                            i.Context = new InstallContext();
   1.110 +                            i.Context.Parameters.Add("AssemblyPath", Assembly.GetExecutingAssembly().Location);
   1.111 +                            i.Context.Parameters.Add("LogToConsole", "false");
   1.112 +                            i.Context.Parameters.Add("Silent", "true");
   1.113 +
   1.114 +                            ServiceProcessInstaller spi = new ServiceProcessInstaller();
   1.115 +                            spi.Account = ServiceAccount.LocalSystem;
   1.116 +                            spi.Username = "";
   1.117 +                            spi.Password = "";
   1.118 +                            i.Installers.Add(spi);
   1.119 +
   1.120 +                            ServiceInstaller si = new ServiceInstaller();
   1.121 +                            si.ServiceName = MyServiceName;
   1.122 +                            si.DisplayName = MyDisplayName;
   1.123 +                            si.Description = MyServiceDescription;
   1.124 +                            si.StartType = ServiceStartMode.Manual;
   1.125 +                            i.Installers.Add(si);
   1.126 +
   1.127 +                            try
   1.128 +                            {
   1.129 +                                i.Install(mySavedState);
   1.130 +
   1.131 +                                Microsoft.Win32.RegistryKey config;
   1.132 +                                config = Microsoft.Win32.Registry.LocalMachine.OpenSubKey("System").OpenSubKey("CurrentControlSet").OpenSubKey("Services").OpenSubKey(si.ServiceName, true);
   1.133 +                                if (args.Length > 1)
   1.134 +                                {
   1.135 +                                    config.SetValue("ImagePath", config.GetValue("ImagePath") + " -s " + string.Join(" ", args, argNo, args.Length - argNo - 1));
   1.136 +                                }
   1.137 +                                else
   1.138 +                                {
   1.139 +                                    config.SetValue("ImagePath", config.GetValue("ImagePath") + " -s");
   1.140 +                                }
   1.141 +
   1.142 +                                Console.WriteLine("Service installed successfully.");
   1.143 +                            }
   1.144 +                            catch (Win32Exception exWin32Exception)
   1.145 +                            {
   1.146 +                                if (exWin32Exception.NativeErrorCode == 1073)
   1.147 +                                {
   1.148 +                                    Console.WriteLine("Service already exists.");
   1.149 +                                    return;
   1.150 +                                }
   1.151 +                                else
   1.152 +                                    throw exWin32Exception;
   1.153 +                            }
   1.154 +                            return;
   1.155 +                        }
   1.156 +                    case "-u":
   1.157 +                        {
   1.158 +                            IDictionary mySavedState = new Hashtable();
   1.159 +                            Installer i = new Installer();
   1.160 +                            i.Context = new InstallContext(null, new string[] { "assemblypath=\"" + Assembly.GetExecutingAssembly().Location + "\" -s", "LogToConsole=false", "Silent=true" });
   1.161 +
   1.162 +                            ServiceProcessInstaller spi = new ServiceProcessInstaller();
   1.163 +                            spi.Account = ServiceAccount.LocalSystem;
   1.164 +                            spi.Username = "";
   1.165 +                            spi.Password = "";
   1.166 +                            i.Installers.Add(spi);
   1.167 +
   1.168 +                            ServiceInstaller si = new ServiceInstaller();
   1.169 +                            si.ServiceName = MyServiceName;
   1.170 +                            si.DisplayName = MyDisplayName;
   1.171 +                            si.Description = MyServiceDescription;
   1.172 +                            si.StartType = ServiceStartMode.Manual;
   1.173 +                            i.Installers.Add(si);
   1.174 +
   1.175 +                            try
   1.176 +                            {
   1.177 +                                i.Uninstall(null);
   1.178 +                                Console.WriteLine("Service uninstalled successfully.");
   1.179 +                            }
   1.180 +                            catch (InstallException exInstallException)
   1.181 +                            {
   1.182 +                                if (exInstallException.InnerException is Win32Exception)
   1.183 +                                {
   1.184 +                                    Win32Exception exWin32Exception = (Win32Exception)exInstallException.InnerException;
   1.185 +                                    if (exWin32Exception.NativeErrorCode == 1060)
   1.186 +                                    {
   1.187 +                                        Console.WriteLine("Service does not exist.");
   1.188 +                                        return;
   1.189 +                                    }
   1.190 +                                }
   1.191 +                                throw exInstallException;
   1.192 +                            }
   1.193 +                            return;
   1.194 +                        }
   1.195 +                    case "-s": // run as service
   1.196 +                        ServiceBase.Run(new Program());
   1.197 +                        return;
   1.198 +                }
   1.199 +            }
   1.200 +            Console.WriteLine("Connecting to kernel driver...");
   1.201 +            new Program().Run();
   1.202 +        }
   1.203 +
   1.204 +        public Program()
   1.205 +        {
   1.206 +            this.ServiceName = MyServiceName;
   1.207 +            this.CanHandlePowerEvent = false;
   1.208 +            this.CanHandleSessionChangeEvent = false;
   1.209 +            this.CanPauseAndContinue = false;
   1.210 +            this.CanShutdown = false;
   1.211 +            this.CanStop = true;
   1.212 +        }
   1.213 +
   1.214 +        private Thread workerThread = null;
   1.215 +
   1.216 +        protected override void OnStart(string[] args)
   1.217 +        {
   1.218 +            workerThread = new Thread(new ThreadStart(Run));
   1.219 +            workerThread.Start();
   1.220 +        }
   1.221 +
   1.222 +        protected override void OnStop()
   1.223 +        {
   1.224 +            workerThread.Abort();
   1.225 +        }
   1.226 +
   1.227 +        protected void Run()
   1.228 +        {
   1.229 +            SafeFileHandle handle;
   1.230 +            byte[] buf = new byte[128];
   1.231 +
   1.232 +            handle = CreateFile(@"\\.\XenShutdown", FILE_GENERIC_READ, 0, IntPtr.Zero, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, IntPtr.Zero);
   1.233 +            FileStream fs = new FileStream(handle, FileAccess.Read);
   1.234 +            StreamReader sr = new StreamReader(fs);
   1.235 +
   1.236 +            while (true)
   1.237 +            {
   1.238 +                string command = sr.ReadLine();
   1.239 +
   1.240 +                Console.WriteLine("Command = " + command);
   1.241 +
   1.242 +                switch (command)
   1.243 +                {
   1.244 +                    case "":
   1.245 +                        break;
   1.246 +                    case "reboot":
   1.247 +                        DoExitWin(EWX_REBOOT | EWX_FORCE);
   1.248 +                        break;
   1.249 +                    case "poweroff":
   1.250 +                    case "halt":
   1.251 +                    default:
   1.252 +                        DoExitWin(EWX_POWEROFF | EWX_FORCE);
   1.253 +                        break;
   1.254 +                }
   1.255 +            }
   1.256 +        }
   1.257 +    }
   1.258 +}
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/ShutdownMon/Properties/AssemblyInfo.cs	Thu Dec 20 10:54:59 2007 +1100
     2.3 @@ -0,0 +1,33 @@
     2.4 +using System.Reflection;
     2.5 +using System.Runtime.CompilerServices;
     2.6 +using System.Runtime.InteropServices;
     2.7 +
     2.8 +// General Information about an assembly is controlled through the following 
     2.9 +// set of attributes. Change these attribute values to modify the information
    2.10 +// associated with an assembly.
    2.11 +[assembly: AssemblyTitle("ShutdownMon")]
    2.12 +[assembly: AssemblyDescription("")]
    2.13 +[assembly: AssemblyConfiguration("")]
    2.14 +[assembly: AssemblyCompany("Bendigo IT")]
    2.15 +[assembly: AssemblyProduct("ShutdownMon")]
    2.16 +[assembly: AssemblyCopyright("Copyright © Bendigo IT 2007")]
    2.17 +[assembly: AssemblyTrademark("")]
    2.18 +[assembly: AssemblyCulture("")]
    2.19 +
    2.20 +// Setting ComVisible to false makes the types in this assembly not visible 
    2.21 +// to COM components.  If you need to access a type in this assembly from 
    2.22 +// COM, set the ComVisible attribute to true on that type.
    2.23 +[assembly: ComVisible(false)]
    2.24 +
    2.25 +// The following GUID is for the ID of the typelib if this project is exposed to COM
    2.26 +[assembly: Guid("8b7b842d-4b9b-41e9-8ffb-41f6250e5a55")]
    2.27 +
    2.28 +// Version information for an assembly consists of the following four values:
    2.29 +//
    2.30 +//      Major Version
    2.31 +//      Minor Version 
    2.32 +//      Build Number
    2.33 +//      Revision
    2.34 +//
    2.35 +[assembly: AssemblyVersion("1.0.0.0")]
    2.36 +[assembly: AssemblyFileVersion("1.0.0.0")]
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/ShutdownMon/ShutdownMon.csproj	Thu Dec 20 10:54:59 2007 +1100
     3.3 @@ -0,0 +1,53 @@
     3.4 +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
     3.5 +  <PropertyGroup>
     3.6 +    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
     3.7 +    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
     3.8 +    <ProductVersion>8.0.50727</ProductVersion>
     3.9 +    <SchemaVersion>2.0</SchemaVersion>
    3.10 +    <ProjectGuid>{26FF5B06-2383-454E-821F-306186171677}</ProjectGuid>
    3.11 +    <OutputType>Exe</OutputType>
    3.12 +    <AppDesignerFolder>Properties</AppDesignerFolder>
    3.13 +    <RootNamespace>ShutdownMon</RootNamespace>
    3.14 +    <AssemblyName>ShutdownMon</AssemblyName>
    3.15 +    <StartupObject>
    3.16 +    </StartupObject>
    3.17 +  </PropertyGroup>
    3.18 +  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    3.19 +    <DebugSymbols>true</DebugSymbols>
    3.20 +    <DebugType>full</DebugType>
    3.21 +    <Optimize>false</Optimize>
    3.22 +    <OutputPath>..\target\</OutputPath>
    3.23 +    <DefineConstants>DEBUG;TRACE</DefineConstants>
    3.24 +    <ErrorReport>prompt</ErrorReport>
    3.25 +    <WarningLevel>4</WarningLevel>
    3.26 +  </PropertyGroup>
    3.27 +  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    3.28 +    <DebugType>pdbonly</DebugType>
    3.29 +    <Optimize>true</Optimize>
    3.30 +    <OutputPath>..\target\</OutputPath>
    3.31 +    <DefineConstants>TRACE</DefineConstants>
    3.32 +    <ErrorReport>prompt</ErrorReport>
    3.33 +    <WarningLevel>4</WarningLevel>
    3.34 +  </PropertyGroup>
    3.35 +  <ItemGroup>
    3.36 +    <Reference Include="System" />
    3.37 +    <Reference Include="System.Configuration.Install" />
    3.38 +    <Reference Include="System.Data" />
    3.39 +    <Reference Include="System.ServiceProcess" />
    3.40 +    <Reference Include="System.Xml" />
    3.41 +  </ItemGroup>
    3.42 +  <ItemGroup>
    3.43 +    <Compile Include="Program.cs">
    3.44 +      <SubType>Component</SubType>
    3.45 +    </Compile>
    3.46 +    <Compile Include="Properties\AssemblyInfo.cs" />
    3.47 +  </ItemGroup>
    3.48 +  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
    3.49 +  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
    3.50 +       Other similar extension points exist, see Microsoft.Common.targets.
    3.51 +  <Target Name="BeforeBuild">
    3.52 +  </Target>
    3.53 +  <Target Name="AfterBuild">
    3.54 +  </Target>
    3.55 +  -->
    3.56 +</Project>
    3.57 \ No newline at end of file
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/Xen.sln	Thu Dec 20 10:54:59 2007 +1100
     4.3 @@ -0,0 +1,20 @@
     4.4 +
     4.5 +Microsoft Visual Studio Solution File, Format Version 9.00
     4.6 +# Visual Studio 2005
     4.7 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ShutdownMon", "ShutdownMon\ShutdownMon.csproj", "{26FF5B06-2383-454E-821F-306186171677}"
     4.8 +EndProject
     4.9 +Global
    4.10 +	GlobalSection(SolutionConfigurationPlatforms) = preSolution
    4.11 +		Debug|Any CPU = Debug|Any CPU
    4.12 +		Release|Any CPU = Release|Any CPU
    4.13 +	EndGlobalSection
    4.14 +	GlobalSection(ProjectConfigurationPlatforms) = postSolution
    4.15 +		{26FF5B06-2383-454E-821F-306186171677}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
    4.16 +		{26FF5B06-2383-454E-821F-306186171677}.Debug|Any CPU.Build.0 = Debug|Any CPU
    4.17 +		{26FF5B06-2383-454E-821F-306186171677}.Release|Any CPU.ActiveCfg = Release|Any CPU
    4.18 +		{26FF5B06-2383-454E-821F-306186171677}.Release|Any CPU.Build.0 = Release|Any CPU
    4.19 +	EndGlobalSection
    4.20 +	GlobalSection(SolutionProperties) = preSolution
    4.21 +		HideSolutionNode = FALSE
    4.22 +	EndGlobalSection
    4.23 +EndGlobal
     5.1 --- a/xenpci/sources	Wed Dec 19 20:28:56 2007 +1100
     5.2 +++ b/xenpci/sources	Thu Dec 20 10:54:59 2007 +1100
     5.3 @@ -1,7 +1,7 @@
     5.4  TARGETNAME=XENPCI
     5.5  TARGETTYPE=DRIVER
     5.6  TARGETPATH=..\Target\$(DDK_TARGET_OS)
     5.7 -VERSION=0.4.0.26
     5.8 +VERSION=0.4.0.28
     5.9  KMDF_VERSION=1
    5.10  MSC_WARNING_LEVEL=/W4
    5.11  INF_NAME=xenpci
     6.1 --- a/xenpci/xenpci.c	Wed Dec 19 20:28:56 2007 +1100
     6.2 +++ b/xenpci/xenpci.c	Thu Dec 20 10:54:59 2007 +1100
     6.3 @@ -82,7 +82,6 @@ typedef struct {
     6.4  } SHUTDOWN_MSG_ENTRY, *PSHUTDOWN_MSG_ENTRY;
     6.5  
     6.6  static KSPIN_LOCK ShutdownMsgLock;
     6.7 -//static KEVENT ShutdownMsgEvent;
     6.8  
     6.9  CM_PARTIAL_RESOURCE_DESCRIPTOR InterruptRaw;
    6.10  CM_PARTIAL_RESOURCE_DESCRIPTOR InterruptTranslated;
    6.11 @@ -680,11 +679,13 @@ XenPCI_IoRead(WDFQUEUE Queue, WDFREQUEST
    6.12  
    6.13    if (Entry->Buf[Entry->Ptr] == 0)
    6.14    {
    6.15 +    KdPrint((__DRIVER_NAME "     All done... stopping queue\n"));
    6.16      if (IsListEmpty(&ShutdownMsgList))
    6.17        WdfIoQueueStop(ReadQueue, NULL, NULL);
    6.18    }
    6.19    else
    6.20    {    
    6.21 +    KdPrint((__DRIVER_NAME "     More to do...\n"));
    6.22      Entry->Ptr += CopyLen;
    6.23      InsertHeadList(&ShutdownMsgList, Entry);
    6.24    }
    6.25 @@ -879,7 +880,7 @@ XenPCI_XenBusWatchHandler(char *Path, PV
    6.26  
    6.27    UNREFERENCED_PARAMETER(Data);
    6.28  
    6.29 -  KdPrint((__DRIVER_NAME " --> XenBusWatchHandle\n"));
    6.30 +  KdPrint((__DRIVER_NAME " --> XenBusWatchHandler\n"));
    6.31  
    6.32    //KdPrint((__DRIVER_NAME "     %s\n", Path));
    6.33  
    6.34 @@ -931,7 +932,7 @@ XenPCI_XenBusWatchHandler(char *Path, PV
    6.35  
    6.36    FreeSplitString(Bits, Count);
    6.37    
    6.38 -  KdPrint((__DRIVER_NAME " <-- XenBusWatchHandle\n"));  
    6.39 +  KdPrint((__DRIVER_NAME " <-- XenBusWatchHandler\n"));
    6.40  }
    6.41  
    6.42  static void
    6.43 @@ -958,7 +959,15 @@ XenBus_ShutdownHandler(char *Path, PVOID
    6.44    if (Value != NULL && strlen(Value) != 0)
    6.45      XenBus_Write(Device, XBT_NIL, SHUTDOWN_PATH, "");
    6.46  
    6.47 -  KdPrint((__DRIVER_NAME "     Shutdown Value = %s\n", Value));
    6.48 +  if (Value != NULL)
    6.49 +  {
    6.50 +    KdPrint((__DRIVER_NAME "     Shutdown Value = %s\n", Value));
    6.51 +    KdPrint((__DRIVER_NAME "     strlen(...) = %d\n", strlen(Value)));
    6.52 +  }
    6.53 +  else
    6.54 +  {
    6.55 +    KdPrint((__DRIVER_NAME "     Shutdown Value = <null>\n"));
    6.56 +  }
    6.57  
    6.58    XenBus_EndTransaction(Device, xbt, 0, &retry);
    6.59  
     7.1 --- a/xenvbd/sources	Wed Dec 19 20:28:56 2007 +1100
     7.2 +++ b/xenvbd/sources	Thu Dec 20 10:54:59 2007 +1100
     7.3 @@ -1,7 +1,7 @@
     7.4  TARGETNAME=XENVBD
     7.5  TARGETTYPE=DRIVER
     7.6  TARGETPATH=..\Target\$(DDK_TARGET_OS)
     7.7 -VERSION=0.4.0.125
     7.8 +VERSION=0.4.0.126
     7.9  KMDF_VERSION=1
    7.10  MSC_WARNING_LEVEL=/W4
    7.11  INF_NAME=xenvbd
     8.1 --- a/xenvbd/xenvbd.c	Wed Dec 19 20:28:56 2007 +1100
     8.2 +++ b/xenvbd/xenvbd.c	Thu Dec 20 10:54:59 2007 +1100
     8.3 @@ -819,7 +819,7 @@ XenVbd_HwScsiStartIo(PVOID DeviceExtensi
     8.4      switch(cdb->CDB6GENERIC.OperationCode)
     8.5      {
     8.6      case SCSIOP_TEST_UNIT_READY:
     8.7 -      KdPrint((__DRIVER_NAME "     Command = TEST_UNIT_READY\n"));
     8.8 +//      KdPrint((__DRIVER_NAME "     Command = TEST_UNIT_READY\n"));
     8.9        Srb->SrbStatus = SRB_STATUS_SUCCESS;
    8.10        Srb->ScsiStatus = 0;
    8.11        ScsiPortNotification(RequestComplete, DeviceExtension, Srb);