win-pvdrivers

changeset 189:eeeeb6924803

updates preparing for next release
author James Harper <james.harper@bendigoit.com.au>
date Mon Feb 18 22:16:03 2008 +1100 (2008-02-18)
parents a416c66be9c2
children 8242c5efce07
files common.inc doc/BUILDING.txt doc/INSTALLING.old.txt doc/INSTALLING.txt xenhide/xenhide.c xenhide/xenhide.h
line diff
     1.1 --- a/common.inc	Mon Feb 18 16:12:48 2008 +1100
     1.2 +++ b/common.inc	Mon Feb 18 22:16:03 2008 +1100
     1.3 @@ -1,4 +1,4 @@
     1.4 -VERSION=0.7.0.74
     1.5 +VERSION=0.7.0.77
     1.6  TARGETPATH=..\Target\$(DDK_TARGET_OS)
     1.7  KMDF_VERSION=1
     1.8  !IF $(_NT_TOOLS_VERSION) > 0x700
     2.1 --- a/doc/BUILDING.txt	Mon Feb 18 16:12:48 2008 +1100
     2.2 +++ b/doc/BUILDING.txt	Mon Feb 18 22:16:03 2008 +1100
     2.3 @@ -1,15 +1,14 @@
     2.4 -1. Download and install the Windows Driver Framework SDK (6000, although
     2.5 -there are some reports that 6001 works too) from Microsoft. You have to
     2.6 -jump through a few hoops to get it, but it is free (as in beer of
     2.7 -course. Microsoft don't do the 'as in speech' variety of free). It's
     2.8 -also huge. http://www.microsoft.com/whdc/driver/wdf/default.mspx is a
     2.9 -good place to start.
    2.10 +1. Download and install the Windows Driver Framework SDK (6001 is all
    2.11 +that is supported now) from Microsoft. You have to jump through a few
    2.12 +hoops to get it, but it is free (as in beer of course. Microsoft don't
    2.13 +do the 'as in speech' variety of free). It's also huge.
    2.14 +http://www.microsoft.com/whdc/driver/wdf/default.mspx is a good place
    2.15 +to start.
    2.16  http://www.microsoft.com/whdc/DevTools/WDK/WDKpkg.mspx is probably a
    2.17  better place to start. 
    2.18  
    2.19  2. Start the WDF Build Environment that best suits your needs. 32 bit
    2.20 -W2K3 and XP checked and free should all work. 64 bit builds but doesn't
    2.21 -run.
    2.22 +W2K3 and XP checked and free should all work. 64 bit W2K3 works too.
    2.23  
    2.24  3. Use Mercurial (get it from 
    2.25  http://www.selenic.com/mercurial/wiki/index.cgi/BinaryPackages) to get 
    2.26 @@ -22,12 +21,8 @@ 5. Assuming all went well, your drivers 
    2.27  directory. (<sys> is winnet or winxp, depending on your DDK compilation 
    2.28  environment.) 
    2.29  
    2.30 -I've probably omitted some vitally important step from the above, so 
    2.31 -please let me know if you need any assistance compiling. 
    2.32 -
    2.33  See the INSTALLING.txt file for information on how to install. 
    2.34  
    2.35  There is also a simple C# app which will enable 'graceful' shutdown (eg 
    2.36  'xm shutdown' and 'xm reboot' will do the right thing). Open Xen.sln in 
    2.37  Visual Studio to build it. 
    2.38 -
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/doc/INSTALLING.old.txt	Mon Feb 18 22:16:03 2008 +1100
     3.3 @@ -0,0 +1,97 @@
     3.4 +Please follow the steps here exactly. If you don't, you may be left with 
     3.5 +an unbootable machine (although 'Last known good configuration' should 
     3.6 +make it bootable again). 
     3.7 +
     3.8 +1. Copy the driver files that you built by following the BUILDING.txt 
     3.9 +steps (or that you got from a binary dist), so that on your testing 
    3.10 +machine the tree looks like this: 
    3.11 +
    3.12 +Xen\<arch>\xenhide.inf
    3.13 +Xen\<arch>\xenpci.inf
    3.14 +Xen\<arch>\xenvbd.inf 
    3.15 +Xen\<arch>\i386\xenaddresource.sys Xen\<arch>\i386\xenhide.sys 
    3.16 +Xen\<arch>\i386\xenpci.sys
    3.17 +Xen\<arch>\i386\xenvbd.sys 
    3.18 +Xen\<arch>\i386\WdfCoInstaller01005.dll
    3.19 +(If you have compiled yourself, you'll need to copy
    3.20 +WdfCoInstaller01005.dll from the redist folder in the DDK) (<arch> is
    3.21 +winxp for XP, or winnet for 2K3)
    3.22 +
    3.23 +2. Go to the device manager (Right click on My Computer, then select the 
    3.24 +Hardware tab, then click Device Manager) 
    3.25 +
    3.26 +3. Find the 'PCI Device' under 'Other Devices' - it should have an 
    3.27 +exclamation mark against it. Right click on it and select 'Update 
    3.28 +Driver...' 
    3.29 +
    3.30 +4. Select 'No, not this time' in answer to 'Can Windows connect to 
    3.31 +Windows Update...' and click Next 
    3.32 +
    3.33 +5. Select 'Install from a list of specific location (Advanced)' and 
    3.34 +click Next 
    3.35 +
    3.36 +6. Untick 'Search removable media...' and tick 'Include this 
    3.37 +location...'. Enter the name of the directory where you put the .inf 
    3.38 +files, then click Next 
    3.39 +
    3.40 +7. Windows should find the XenPCI driver as a candidate, and will 
    3.41 +complain that it hasn't been signed. Just accept the warning. 
    3.42 +
    3.43 +8. Windows should load the XenPCI driver, and then give you 4 more 
    3.44 +'Other Devices' - console, vfb, vif, and vbd. 
    3.45 +
    3.46 +9. Repeat steps 3-7 for the vbd and vif devices. Windows should then
    3.47 +load the XenVBD driver. 
    3.48 +
    3.49 +10. The next bit is a bit tricker. In Device Manager, drill down on 
    3.50 +System devices and right click on PCI Bus and select Update Driver. 
    3.51 +
    3.52 +11. Select 'No, not this time' in answer to 'Can Windows connect to 
    3.53 +Windows Update...' and click Next 
    3.54 +
    3.55 +12. Select 'Install from a list or specific location (Advanced)' and 
    3.56 +click Next 
    3.57 +
    3.58 +13. This time, select 'Don't search. I will choose the driver to 
    3.59 +install' and click Next 
    3.60 +
    3.61 +14. Click 'Have Disk' and go to the locaton where you put the .inf 
    3.62 +files. 
    3.63 +
    3.64 +15. Select the 'Xen PCI Device Hider Driver' (I know, it's a stupid 
    3.65 +name) and install it, again accepting the unsigned driver warning. 
    3.66 +
    3.67 +16. edit your boot.ini to look something like this: 
    3.68 +
    3.69 +" [boot loader] timeout=30 
    3.70 +default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS [operating systems] 
    3.71 +multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Windows Server 2003, 
    3.72 +Enterprise" /noexecute=optout /fastdetect 
    3.73 +multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Windows Server 2003, 
    3.74 +Enterprise, GPLPV" /noexecute=optout /fastdetect /gplpv " 
    3.75 +
    3.76 +17. The main thing in the above step is that you have a line with /gplpv 
    3.77 +on the end. This tells the PV device (vbd, vif) drivers to activate,
    3.78 +otherwise they will pretty much sit silent.
    3.79 +
    3.80 +18. Reboot and select the /gplpv entry. If it doesn't work then email me 
    3.81 +(james.harper@bendigoit.com.au) with some details and i'll see what I can
    3.82 +do. 
    3.83 +
    3.84 +Without the /gplpv option specified, the xenvbd driver will only pick up 
    3.85 +on devices you have added since boot, so you can still test it without 
    3.86 +specifying /gplpv and doing something like the following in Dom0: 
    3.87 +
    3.88 +" xm block-attach mywindowsdomain phy:/dev/someblockdevice /dev/hdc w " 
    3.89 +
    3.90 +You need to specify the 'phy:' in your xen config file and in the
    3.91 +block-attach line otherwise the backend doesn't seem to publish the block
    3.92 +and sector sizes correctly. 
    3.93 +
    3.94 +If you do the block-attach, then your block device should show up under 
    3.95 +windows, and you can partition it etc. 
    3.96 +
    3.97 +19. If you have built ShutdownMon, run "ShutdownMon -i" which will 
    3.98 +install it as a service. You will need to change the service to 
    3.99 +'Automatic' and start it (or reboot). 'xm shutdown' and 'xm reboot' 
   3.100 +should then do the right thing. 
     4.1 --- a/doc/INSTALLING.txt	Mon Feb 18 16:12:48 2008 +1100
     4.2 +++ b/doc/INSTALLING.txt	Mon Feb 18 22:16:03 2008 +1100
     4.3 @@ -6,73 +6,46 @@ 1. Copy the driver files that you built 
     4.4  steps (or that you got from a binary dist), so that on your testing 
     4.5  machine the tree looks like this: 
     4.6  
     4.7 -Xen\<arch>\xenhide.inf
     4.8 -Xen\<arch>\xenpci.inf
     4.9 -Xen\<arch>\xenvbd.inf 
    4.10 -Xen\<arch>\i386\xenaddresource.sys Xen\<arch>\i386\xenhide.sys 
    4.11 -Xen\<arch>\i386\xenpci.sys
    4.12 -Xen\<arch>\i386\xenvbd.sys 
    4.13 -Xen\<arch>\i386\WdfCoInstaller01005.dll
    4.14 +Xen\install.bat
    4.15 +Xen\ShutdownMon.exe
    4.16 +Xen\<os>\xenhide.inf
    4.17 +Xen\<os>\xenpci.inf
    4.18 +Xen\<os>\xenvbd.inf
    4.19 +Xen\<os>\DPInst.exe
    4.20 +Xen\<os>\<arch>\xenaddresource.sys
    4.21 +Xen\<os>\<arch>\xenhide.sys 
    4.22 +Xen\<os>\<arch>\xenpci.sys
    4.23 +Xen\<os>\<arch>\xenvbd.sys 
    4.24 +Xen\<os>\<arch>\WdfCoInstaller01005.dll
    4.25  (If you have compiled yourself, you'll need to copy
    4.26 -WdfCoInstaller01005.dll from the redist folder in the DDK) (<arch> is
    4.27 -winxp for XP, or winnet for 2K3)
    4.28 -
    4.29 -2. Go to the device manager (Right click on My Computer, then select the 
    4.30 -Hardware tab, then click Device Manager) 
    4.31 -
    4.32 -3. Find the 'PCI Device' under 'Other Devices' - it should have an 
    4.33 -exclamation mark against it. Right click on it and select 'Update 
    4.34 -Driver...' 
    4.35 -
    4.36 -4. Select 'No, not this time' in answer to 'Can Windows connect to 
    4.37 -Windows Update...' and click Next 
    4.38 -
    4.39 -5. Select 'Install from a list of specific location (Advanced)' and 
    4.40 -click Next 
    4.41 -
    4.42 -6. Untick 'Search removable media...' and tick 'Include this 
    4.43 -location...'. Enter the name of the directory where you put the .inf 
    4.44 -files, then click Next 
    4.45 -
    4.46 -7. Windows should find the XenPCI driver as a candidate, and will 
    4.47 -complain that it hasn't been signed. Just accept the warning. 
    4.48 +WdfCoInstaller01007.dll and DPInst.exe from the redist folder in the DDK) (<os> is
    4.49 +winxp for XP, or winnet for 2K3. <arch> is i386 or amd64)
    4.50  
    4.51 -8. Windows should load the XenPCI driver, and then give you 4 more 
    4.52 -'Other Devices' - console, vfb, vif, and vbd. 
    4.53 -
    4.54 -9. Repeat steps 3-7 for the vbd and vif devices. Windows should then
    4.55 -load the XenVBD driver. 
    4.56 -
    4.57 -10. The next bit is a bit tricker. In Device Manager, drill down on 
    4.58 -System devices and right click on PCI Bus and select Update Driver. 
    4.59 -
    4.60 -11. Select 'No, not this time' in answer to 'Can Windows connect to 
    4.61 -Windows Update...' and click Next 
    4.62 -
    4.63 -12. Select 'Install from a list or specific location (Advanced)' and 
    4.64 -click Next 
    4.65 +2. run 'install.bat' in the Xen directory
    4.66  
    4.67 -13. This time, select 'Don't search. I will choose the driver to 
    4.68 -install' and click Next 
    4.69 -
    4.70 -14. Click 'Have Disk' and go to the locaton where you put the .inf 
    4.71 -files. 
    4.72 +3. Click Next and Ok when prompted. The drivers are unsigned so be prepared to do
    4.73 +this more than once.
    4.74  
    4.75 -15. Select the 'Xen PCI Device Hider Driver' (I know, it's a stupid 
    4.76 -name) and install it, again accepting the unsigned driver warning. 
    4.77 -
    4.78 -16. edit your boot.ini to look something like this: 
    4.79 +4. Reboot when prompted to ensure that your computer still boots without any
    4.80 +issues. You'll now have two ethernet interfaces, which may or may not cause
    4.81 +problems.
    4.82  
    4.83 -" [boot loader] timeout=30 
    4.84 -default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS [operating systems] 
    4.85 -multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Windows Server 2003, 
    4.86 -Enterprise" /noexecute=optout /fastdetect 
    4.87 -multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Windows Server 2003, 
    4.88 -Enterprise, GPLPV" /noexecute=optout /fastdetect /gplpv " 
    4.89 +5. edit your boot.ini to look something like this: 
    4.90 +
    4.91 +"
    4.92 +[boot loader]
    4.93 +timeout=30 
    4.94 +default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS
    4.95 +
    4.96 +[operating systems] 
    4.97 +multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Windows Server 2003, Enterprise" /noexecute=optout /fastdetect 
    4.98 +multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Windows Server 2003, Enterprise, GPLPV" /noexecute=optout /fastdetect /gplpv
    4.99 +" 
   4.100  
   4.101  17. The main thing in the above step is that you have a line with /gplpv 
   4.102  on the end. This tells the PV device (vbd, vif) drivers to activate,
   4.103 -otherwise they will pretty much sit silent.
   4.104 +otherwise they will pretty much sit silent. At the moment, vif always
   4.105 +activates.
   4.106  
   4.107  18. Reboot and select the /gplpv entry. If it doesn't work then email me 
   4.108  (james.harper@bendigoit.com.au) with some details and i'll see what I can
   4.109 @@ -82,7 +55,9 @@ Without the /gplpv option specified, the
   4.110  on devices you have added since boot, so you can still test it without 
   4.111  specifying /gplpv and doing something like the following in Dom0: 
   4.112  
   4.113 -" xm block-attach mywindowsdomain phy:/dev/someblockdevice /dev/hdc w " 
   4.114 +"
   4.115 +xm block-attach mywindowsdomain phy:/dev/someblockdevice /dev/hdc w
   4.116 +" 
   4.117  
   4.118  You need to specify the 'phy:' in your xen config file and in the
   4.119  block-attach line otherwise the backend doesn't seem to publish the block
   4.120 @@ -90,8 +65,3 @@ and sector sizes correctly.
   4.121  
   4.122  If you do the block-attach, then your block device should show up under 
   4.123  windows, and you can partition it etc. 
   4.124 -
   4.125 -19. If you have built ShutdownMon, run "ShutdownMon -i" which will 
   4.126 -install it as a service. You will need to change the service to 
   4.127 -'Automatic' and start it (or reboot). 'xm shutdown' and 'xm reboot' 
   4.128 -should then do the right thing. 
     5.1 --- a/xenhide/xenhide.c	Mon Feb 18 16:12:48 2008 +1100
     5.2 +++ b/xenhide/xenhide.c	Mon Feb 18 22:16:03 2008 +1100
     5.3 @@ -28,8 +28,6 @@ XenHide_Pass(PDEVICE_OBJECT DeviceObject
     5.4  static NTSTATUS
     5.5  XenHide_Pnp(PDEVICE_OBJECT DeviceObject, PIRP Irp);
     5.6  static NTSTATUS
     5.7 -XenHide_Power(PDEVICE_OBJECT DeviceObject, PIRP Irp);
     5.8 -static NTSTATUS
     5.9  XenHide_AddDevice();
    5.10  //static NTSTATUS
    5.11  //XenHide_Unload();
    5.12 @@ -142,12 +140,8 @@ DriverEntry(PDRIVER_OBJECT DriverObject,
    5.13  
    5.14    for (i = 0; i <= IRP_MJ_MAXIMUM_FUNCTION; i++)
    5.15      DriverObject->MajorFunction[i] = XenHide_Pass;
    5.16 -
    5.17 -  DriverObject->MajorFunction[IRP_MJ_POWER] = XenHide_Power;
    5.18 -
    5.19    if (AutoEnumerate)
    5.20      DriverObject->MajorFunction[IRP_MJ_PNP] = XenHide_Pnp;
    5.21 -
    5.22    DriverObject->DriverExtension->AddDevice = XenHide_AddDevice;
    5.23  
    5.24    KdPrint((__DRIVER_NAME " <-- DriverEntry\n"));
    5.25 @@ -162,7 +156,7 @@ XenHide_AddDevice(
    5.26    )
    5.27  {
    5.28    NTSTATUS status;
    5.29 -  PDEVICE_OBJECT DeviceObject = NULL;
    5.30 +  PDEVICE_OBJECT deviceObject = NULL;
    5.31    PDEVICE_EXTENSION DeviceExtension;
    5.32    ULONG Length;
    5.33    WCHAR Buffer[1000];
    5.34 @@ -171,50 +165,40 @@ XenHide_AddDevice(
    5.35  
    5.36    Length = 1000;
    5.37    status = IoGetDeviceProperty(PhysicalDeviceObject, DevicePropertyDeviceDescription, Length, Buffer, &Length);
    5.38 -  KdPrint((__DRIVER_NAME "     status = %08x, DevicePropertyDeviceDescription = %ws\n", status, Buffer));
    5.39 +  KdPrint((__DRIVER_NAME " status = %08x, DevicePropertyDeviceDescription = %ws\n", status, Buffer));
    5.40  
    5.41    if (!NT_SUCCESS(status) || wcscmp(Buffer, L"PCI bus") != 0)
    5.42    {
    5.43      KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
    5.44      return STATUS_SUCCESS;
    5.45    }
    5.46 -  KdPrint((__DRIVER_NAME "     Found\n"));
    5.47  
    5.48 -  status = IoCreateDevice(DriverObject,
    5.49 +  KdPrint((__DRIVER_NAME " Found\n")); 
    5.50 +
    5.51 +  status = IoCreateDevice (DriverObject,
    5.52      sizeof(DEVICE_EXTENSION),
    5.53      NULL,
    5.54      FILE_DEVICE_UNKNOWN,
    5.55      FILE_DEVICE_SECURE_OPEN,
    5.56      FALSE,
    5.57 -    &DeviceObject);
    5.58 -  if (!NT_SUCCESS(status))
    5.59 -  {
    5.60 -    KdPrint((__DRIVER_NAME "     IoCreateDevice failed 0x%08x\n", status));
    5.61 -    return status;
    5.62 -  }
    5.63 +    &deviceObject);
    5.64  
    5.65 -  DeviceExtension = (PDEVICE_EXTENSION)DeviceObject->DeviceExtension;
    5.66 -
    5.67 -  DeviceExtension->Self = DeviceObject;
    5.68 -  DeviceExtension->PhysicalDeviceObject = PhysicalDeviceObject;
    5.69 -  DeviceExtension->DriverObject = DriverObject;
    5.70 -  DeviceExtension->Type = XENHIDE_TYPE_PCI;
    5.71 -  DeviceExtension->InternalState = 0;
    5.72 +  DeviceExtension = (PDEVICE_EXTENSION)deviceObject->DeviceExtension;
    5.73  
    5.74    DeviceExtension->NextLowerDevice = IoAttachDeviceToDeviceStack(
    5.75 -    DeviceObject,
    5.76 +    deviceObject,
    5.77      PhysicalDeviceObject);
    5.78 +  deviceObject->Flags |= DeviceExtension->NextLowerDevice->Flags;
    5.79  
    5.80 -  DeviceObject->Flags |= DeviceExtension->NextLowerDevice->Flags;
    5.81 +  deviceObject->DeviceType = DeviceExtension->NextLowerDevice->DeviceType;
    5.82  
    5.83 -  DeviceObject->DeviceType = DeviceExtension->NextLowerDevice->DeviceType;
    5.84 -
    5.85 -  DeviceObject->Characteristics = 
    5.86 +  deviceObject->Characteristics = 
    5.87      DeviceExtension->NextLowerDevice->Characteristics;
    5.88  
    5.89 -//  IoInitializeRemoveLock(&DeviceExtension->RemoveLock, XENHIDE_POOL_TAG, 1, 100);
    5.90 +  DeviceExtension->Self = deviceObject;
    5.91  
    5.92 -#if 0
    5.93 +  //INITIALIZE_PNP_STATE(DeviceExtension);
    5.94 +
    5.95    if (AutoEnumerate)
    5.96    {
    5.97      status = IoRegisterDeviceInterface(PhysicalDeviceObject, (LPGUID)&GUID_XENHIDE_IFACE, NULL, &DeviceExtension->InterfaceName);
    5.98 @@ -235,9 +219,8 @@ XenHide_AddDevice(
    5.99    {
   5.100      KdPrint((__DRIVER_NAME "     Not registering Interface\n"));
   5.101    }
   5.102 -#endif
   5.103  
   5.104 -  DeviceObject->Flags &= ~DO_DEVICE_INITIALIZING;
   5.105 +  deviceObject->Flags &= ~DO_DEVICE_INITIALIZING;
   5.106  
   5.107    KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
   5.108  
   5.109 @@ -252,7 +235,7 @@ XenHide_StringMatches(PWCHAR String1, PW
   5.110  }
   5.111  
   5.112  static NTSTATUS
   5.113 -XenHide_IoCompletionPciQueryDeviceRelations(PDEVICE_OBJECT DeviceObject, PIRP Irp, PVOID Context)
   5.114 +XenHide_IoCompletion(PDEVICE_OBJECT DeviceObject, PIRP Irp, PVOID Context)
   5.115  {
   5.116    ULONG i, j;
   5.117    PDEVICE_RELATIONS Relations;
   5.118 @@ -261,20 +244,16 @@ XenHide_IoCompletionPciQueryDeviceRelati
   5.119    ULONG Length;
   5.120    size_t StrLen;
   5.121    int Match;
   5.122 -  NTSTATUS status;
   5.123 -  PDEVICE_OBJECT NewDeviceObject;
   5.124 +  int Offset = 0;
   5.125    PDEVICE_EXTENSION DeviceExtension = (PDEVICE_EXTENSION)Context;
   5.126 -  PDEVICE_EXTENSION NewDeviceExtension;
   5.127  
   5.128    UNREFERENCED_PARAMETER(DeviceObject);
   5.129    UNREFERENCED_PARAMETER(Context);
   5.130  
   5.131 -  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
   5.132 +  KdPrint((__DRIVER_NAME " --> IoCompletion\n"));
   5.133    KdPrint((__DRIVER_NAME "     IRQL = %d\n", KeGetCurrentIrql()));
   5.134 -  KdPrint((__DRIVER_NAME "     InternalState = %d\n", DeviceExtension->InternalState));
   5.135  
   5.136 -  if (Irp->PendingReturned)
   5.137 -    IoMarkIrpPending(Irp);
   5.138 +  Relations = (PDEVICE_RELATIONS)Irp->IoStatus.Information;
   5.139  
   5.140    switch (DeviceExtension->InternalState)
   5.141    {
   5.142 @@ -282,31 +261,30 @@ XenHide_IoCompletionPciQueryDeviceRelati
   5.143      DeviceExtension->InternalState = 1;
   5.144      break;
   5.145    case 1:
   5.146 -    DeviceExtension->InternalState = 2;
   5.147 -    Relations = (PDEVICE_RELATIONS)Irp->IoStatus.Information;
   5.148 -  
   5.149 +    DeviceExtension->InternalState = 2; 
   5.150      for (i = 0; i < Relations->Count; i++)
   5.151      {
   5.152 +      if (Offset != 0)
   5.153 +        Relations->Objects[i - Offset] = Relations->Objects[i];
   5.154 +  
   5.155        Match = 0;
   5.156        for (j = 0; j < 2 && !Match; j++)
   5.157        {
   5.158          Length = sizeof(Buffer);
   5.159          if (j == 0)
   5.160 -          IoGetDeviceProperty(Relations->Objects[i], DevicePropertyCompatibleIDs, Length, Buffer, &Length);
   5.161 +          IoGetDeviceProperty(Relations->Objects[i - Offset], DevicePropertyCompatibleIDs, Length, Buffer, &Length);
   5.162          else
   5.163 -          IoGetDeviceProperty(Relations->Objects[i], DevicePropertyHardwareID, Length, Buffer, &Length);
   5.164 -        StrLen = 0;
   5.165 +          IoGetDeviceProperty(Relations->Objects[i - Offset], DevicePropertyHardwareID, Length, Buffer, &Length);
   5.166 +         StrLen = 0;
   5.167          for (Ptr = Buffer; *Ptr != 0; Ptr += StrLen + 1)
   5.168          {
   5.169            // Qemu PCI
   5.170            if (XenHide_StringMatches(Ptr, L"PCI\\VEN_8086&DEV_7010")) {
   5.171 -            KdPrint((__DRIVER_NAME "     %ws\n", Ptr));
   5.172              Match = 1;
   5.173              break;
   5.174            }
   5.175            // Qemu Network
   5.176            if (XenHide_StringMatches(Ptr, L"PCI\\VEN_10EC&DEV_8139")) {
   5.177 -            KdPrint((__DRIVER_NAME "     %ws\n", Ptr));
   5.178              Match = 1;
   5.179              break;
   5.180            }
   5.181 @@ -315,167 +293,29 @@ XenHide_IoCompletionPciQueryDeviceRelati
   5.182        }
   5.183        if (Match)
   5.184        {
   5.185 -        KdPrint((__DRIVER_NAME "     Creating and attaching Device\n"));
   5.186 -        NewDeviceObject = NULL;
   5.187 -        status = IoCreateDevice(DeviceExtension->DriverObject,
   5.188 -          sizeof(DEVICE_EXTENSION),
   5.189 -          NULL,
   5.190 -          FILE_DEVICE_UNKNOWN,
   5.191 -          FILE_DEVICE_SECURE_OPEN,
   5.192 -          FALSE,
   5.193 -          &NewDeviceObject);
   5.194 -        if (!NT_SUCCESS(status))
   5.195 -        {
   5.196 -          KdPrint((__DRIVER_NAME "     IoCreateDevice failed 0x%08x\n", status));
   5.197 -          continue;
   5.198 -        }
   5.199 -  
   5.200 -        NewDeviceExtension = (PDEVICE_EXTENSION)NewDeviceObject->DeviceExtension;
   5.201 -        NewDeviceExtension->PhysicalDeviceObject = Relations->Objects[i];
   5.202 -        NewDeviceExtension->InternalState = 0;
   5.203 -        NewDeviceExtension->NextLowerDevice = IoAttachDeviceToDeviceStack(
   5.204 -          NewDeviceObject,
   5.205 -          Relations->Objects[i]);
   5.206 -        NewDeviceObject->Flags |= NewDeviceExtension->NextLowerDevice->Flags;
   5.207 -          
   5.208 -        NewDeviceObject->DeviceType = NewDeviceExtension->NextLowerDevice->DeviceType;
   5.209 -      
   5.210 -        NewDeviceObject->Characteristics = 
   5.211 -          NewDeviceExtension->NextLowerDevice->Characteristics;
   5.212 -
   5.213 -//        IoInitializeRemoveLock(&NewDeviceExtension->RemoveLock, XENHIDE_POOL_TAG, 1, 100);
   5.214 -      
   5.215 -        NewDeviceExtension->Self = NewDeviceObject;
   5.216 -        NewDeviceExtension->Type = XENHIDE_TYPE_HIDE;
   5.217 -      
   5.218 -        NewDeviceObject->Flags &= ~DO_DEVICE_INITIALIZING;
   5.219 +        Offset++;
   5.220        }
   5.221      }
   5.222 +    Relations->Count -= Offset;
   5.223      break;
   5.224    default:
   5.225      break;
   5.226    }
   5.227 -
   5.228 -  KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
   5.229 -
   5.230 -  return STATUS_SUCCESS; //Irp->IoStatus.Status;
   5.231 -}
   5.232 -
   5.233 -static NTSTATUS
   5.234 -XenHide_IoCompletionHideQueryPnpDeviceState(PDEVICE_OBJECT DeviceObject, PIRP Irp, PVOID Context)
   5.235 -{
   5.236 -  UNREFERENCED_PARAMETER(DeviceObject);
   5.237 -  UNREFERENCED_PARAMETER(Context);
   5.238 -
   5.239 -  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
   5.240 -
   5.241 -  if (Irp->PendingReturned)
   5.242 -    IoMarkIrpPending(Irp);
   5.243 -
   5.244 -  Irp->IoStatus.Information |= PNP_DEVICE_DONT_DISPLAY_IN_UI|PNP_DEVICE_DISABLED;
   5.245 -
   5.246 -  KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
   5.247 -  return STATUS_SUCCESS;
   5.248 -}
   5.249 -
   5.250 -static NTSTATUS
   5.251 -XenHide_IoCompletionPciQueryId(PDEVICE_OBJECT DeviceObject, PIRP Irp, PVOID Context)
   5.252 -{
   5.253 -  PIO_STACK_LOCATION Stack;
   5.254 -
   5.255 -  UNREFERENCED_PARAMETER(DeviceObject);
   5.256 -  UNREFERENCED_PARAMETER(Context);
   5.257 -
   5.258 -  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
   5.259 -
   5.260 -  if (Irp->PendingReturned)
   5.261 -    IoMarkIrpPending(Irp);
   5.262 -
   5.263 -  Stack = IoGetCurrentIrpStackLocation(Irp);
   5.264 +    
   5.265 +  KdPrint((__DRIVER_NAME " <-- IoCompletion\n"));
   5.266  
   5.267 -  switch (Stack->Parameters.QueryId.IdType)
   5.268 -  {
   5.269 -  case BusQueryDeviceID:
   5.270 -    KdPrint((__DRIVER_NAME "     IdType = BusQueryDeviceID\n"));
   5.271 -    KdPrint((__DRIVER_NAME "     %ws\n", Irp->IoStatus.Information));
   5.272 -    break;
   5.273 -  case BusQueryHardwareIDs:
   5.274 -    KdPrint((__DRIVER_NAME "     IdType = BusQueryHardwareIDs\n"));
   5.275 -    KdPrint((__DRIVER_NAME "     %ws\n", Irp->IoStatus.Information));
   5.276 -    break;
   5.277 -  case BusQueryCompatibleIDs:
   5.278 -    KdPrint((__DRIVER_NAME "     IdType = BusQueryCompatibleIDs\n"));
   5.279 -    KdPrint((__DRIVER_NAME "     %ws\n", Irp->IoStatus.Information));
   5.280 -    break;
   5.281 -  case BusQueryInstanceID:
   5.282 -    KdPrint((__DRIVER_NAME "     IdType = BusQueryInstanceID\n"));
   5.283 -    KdPrint((__DRIVER_NAME "     %ws\n", Irp->IoStatus.Information));
   5.284 -    break;
   5.285 -  default:
   5.286 -    KdPrint((__DRIVER_NAME "     IdType = %08x\n", Stack->Parameters.QueryId.IdType));
   5.287 -    KdPrint((__DRIVER_NAME "     %ws\n", Irp->IoStatus.Information));
   5.288 -    break;
   5.289 -  }
   5.290 -
   5.291 -  KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
   5.292 -  return STATUS_SUCCESS;
   5.293 -}
   5.294 -
   5.295 -static NTSTATUS
   5.296 -XenHide_IoCompletionHideStartDevice(PDEVICE_OBJECT DeviceObject, PIRP Irp, PVOID Context)
   5.297 -{
   5.298 -  UNREFERENCED_PARAMETER(DeviceObject);
   5.299 -  UNREFERENCED_PARAMETER(Context);
   5.300 -
   5.301 -  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
   5.302 -  KdPrint((__DRIVER_NAME "     IRQL = %d\n", KeGetCurrentIrql()));
   5.303 -
   5.304 -  if (Irp->PendingReturned)
   5.305 -    IoMarkIrpPending(Irp);
   5.306 -
   5.307 -  KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
   5.308 -  return STATUS_SUCCESS;
   5.309 +  return Irp->IoStatus.Status;
   5.310  }
   5.311  
   5.312  static NTSTATUS
   5.313  XenHide_Pass(PDEVICE_OBJECT DeviceObject, PIRP Irp)
   5.314  {
   5.315    PDEVICE_EXTENSION DeviceExtension = (PDEVICE_EXTENSION)DeviceObject->DeviceExtension;
   5.316 -  NTSTATUS Status;
   5.317 -
   5.318 -#if 0
   5.319 -  Status = IoAcquireRemoveLock (&DeviceExtension->RemoveLock, Irp);
   5.320 -  if (!NT_SUCCESS(Status)) {
   5.321 -    Irp->IoStatus.Status = Status;
   5.322 -    IoCompleteRequest(Irp, IO_NO_INCREMENT);
   5.323 -    return Status;
   5.324 -  }
   5.325 -#endif
   5.326 +  NTSTATUS status;
   5.327 +    
   5.328    IoSkipCurrentIrpStackLocation(Irp);
   5.329 -  Status = IoCallDriver(DeviceExtension->NextLowerDevice, Irp);
   5.330 -//  IoReleaseRemoveLock(&DeviceExtension->RemoveLock, Irp); 
   5.331 -  return Status;
   5.332 -}
   5.333 -
   5.334 -static NTSTATUS
   5.335 -XenHide_Power(PDEVICE_OBJECT DeviceObject, PIRP Irp)
   5.336 -{
   5.337 -  NTSTATUS Status = STATUS_SUCCESS;
   5.338 -  PDEVICE_EXTENSION DeviceExtension = (PDEVICE_EXTENSION)DeviceObject->DeviceExtension;
   5.339 -
   5.340 -//  Status = IoAcquireRemoveLock (&DeviceExtension->RemoveLock, Irp);
   5.341 -  if (!NT_SUCCESS(Status)) {
   5.342 -    Irp->IoStatus.Status = Status;
   5.343 -    PoStartNextPowerIrp(Irp);
   5.344 -    IoCompleteRequest(Irp, IO_NO_INCREMENT);
   5.345 -    return Status;
   5.346 -  }
   5.347 -
   5.348 -  PoStartNextPowerIrp(Irp);
   5.349 -  IoSkipCurrentIrpStackLocation(Irp);
   5.350 -  Status = PoCallDriver(DeviceExtension->NextLowerDevice, Irp);
   5.351 -//  IoReleaseRemoveLock(&DeviceExtension->RemoveLock, Irp); 
   5.352 -  return Status;
   5.353 +  status = IoCallDriver(DeviceExtension->NextLowerDevice, Irp);
   5.354 +  return status;
   5.355  }
   5.356  
   5.357  static NTSTATUS
   5.358 @@ -486,189 +326,32 @@ XenHide_Pnp(PDEVICE_OBJECT DeviceObject,
   5.359    PDEVICE_EXTENSION DeviceExtension = (PDEVICE_EXTENSION)DeviceObject->DeviceExtension;
   5.360  
   5.361    KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
   5.362 -  KdPrint((__DRIVER_NAME "     DeviceObject = %p\n", DeviceObject));
   5.363    KdPrint((__DRIVER_NAME "     IRQL = %d\n", KeGetCurrentIrql()));
   5.364  
   5.365 -/*
   5.366 -  Status = IoAcquireRemoveLock (&DeviceExtension->RemoveLock, Irp);
   5.367 -  if (!NT_SUCCESS(Status)) {
   5.368 -    Irp->IoStatus.Status = Status;
   5.369 -    IoCompleteRequest(Irp, IO_NO_INCREMENT);
   5.370 -    KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ " (returning with status %08x)\n", Status));
   5.371 -    return Status;
   5.372 -  }
   5.373 -*/
   5.374    Stack = IoGetCurrentIrpStackLocation(Irp);
   5.375  
   5.376 -  switch (Stack->MinorFunction)
   5.377 -  {
   5.378 -  case IRP_MN_START_DEVICE:
   5.379 -    KdPrint((__DRIVER_NAME "     MinorFunction = IRP_MN_START_DEVICE\n"));
   5.380 -    break;
   5.381 -  case IRP_MN_QUERY_STOP_DEVICE:
   5.382 -    KdPrint((__DRIVER_NAME "     MinorFunction = IRP_MN_QUERY_STOP_DEVICE\n"));
   5.383 -    break;
   5.384 -  case IRP_MN_STOP_DEVICE:
   5.385 -    KdPrint((__DRIVER_NAME "     MinorFunction = IRP_MN_STOP_DEVICE\n"));
   5.386 -    break;
   5.387 -  case IRP_MN_CANCEL_STOP_DEVICE:
   5.388 -    KdPrint((__DRIVER_NAME "     MinorFunction = IRP_MN_CANCEL_STOP_DEVICE\n"));
   5.389 -    break;
   5.390 -  case IRP_MN_QUERY_REMOVE_DEVICE:
   5.391 -    KdPrint((__DRIVER_NAME "     MinorFunction = IRP_MN_QUERY_REMOVE_DEVICE\n"));
   5.392 -    break;
   5.393 -  case IRP_MN_REMOVE_DEVICE:
   5.394 -    KdPrint((__DRIVER_NAME "     MinorFunction = IRP_MN_REMOVE_DEVICE\n"));
   5.395 -    break;
   5.396 -  case IRP_MN_CANCEL_REMOVE_DEVICE:
   5.397 -    KdPrint((__DRIVER_NAME "     MinorFunction = IRP_MN_CANCEL_REMOVE_DEVICE\n"));
   5.398 -    break;
   5.399 -  case IRP_MN_SURPRISE_REMOVAL:
   5.400 -    KdPrint((__DRIVER_NAME "     MinorFunction = IRP_MN_SURPRISE_REMOVAL\n"));
   5.401 -    break;
   5.402 -  case IRP_MN_QUERY_CAPABILITIES:
   5.403 -    KdPrint((__DRIVER_NAME "     MinorFunction = IRP_MN_QUERY_CAPABILITIES\n"));
   5.404 -    break;
   5.405 -  case IRP_MN_QUERY_PNP_DEVICE_STATE:
   5.406 -    KdPrint((__DRIVER_NAME "     MinorFunction = IRP_MN_QUERY_PNP_DEVICE_STATE\n"));
   5.407 -    break;
   5.408 -  case IRP_MN_FILTER_RESOURCE_REQUIREMENTS:
   5.409 -    KdPrint((__DRIVER_NAME "     MinorFunction = IRP_MN_FILTER_RESOURCE_REQUIREMENTS\n"));
   5.410 -    break;
   5.411 -  case IRP_MN_DEVICE_USAGE_NOTIFICATION:
   5.412 -    KdPrint((__DRIVER_NAME "     MinorFunction = IRP_MN_DEVICE_USAGE_NOTIFICATION\n"));
   5.413 -    break;
   5.414 +  switch (Stack->MinorFunction) {
   5.415    case IRP_MN_QUERY_DEVICE_RELATIONS:
   5.416 -    KdPrint((__DRIVER_NAME "     MinorFunction = IRP_MN_QUERY_DEVICE_RELATIONS\n"));
   5.417 -    break;
   5.418 -  case IRP_MN_QUERY_RESOURCES:
   5.419 -    KdPrint((__DRIVER_NAME "     MinorFunction = IRP_MN_QUERY_RESOURCES\n"));
   5.420 -    break;
   5.421 -  case IRP_MN_QUERY_RESOURCE_REQUIREMENTS:
   5.422 -    KdPrint((__DRIVER_NAME "     MinorFunction = IRP_MN_QUERY_RESOURCE_REQUIREMENTS\n"));
   5.423 -    break;
   5.424 -  case IRP_MN_QUERY_ID:
   5.425 -    KdPrint((__DRIVER_NAME "     MinorFunction = IRP_MN_QUERY_ID\n"));
   5.426 -    break;
   5.427 -  case IRP_MN_QUERY_DEVICE_TEXT:
   5.428 -    KdPrint((__DRIVER_NAME "     MinorFunction = IRP_MN_QUERY_DEVICE_TEXT\n"));
   5.429 -    break;
   5.430 -  case IRP_MN_QUERY_BUS_INFORMATION:
   5.431 -    KdPrint((__DRIVER_NAME "     MinorFunction = IRP_MN_QUERY_BUS_INFORMATION\n"));
   5.432 -    break;
   5.433 -  case IRP_MN_QUERY_INTERFACE:
   5.434 -    KdPrint((__DRIVER_NAME "     MinorFunction = IRP_MN_QUERY_INTERFACE\n"));
   5.435 -    break;
   5.436 -  case IRP_MN_READ_CONFIG:
   5.437 -    KdPrint((__DRIVER_NAME "     MinorFunction = IRP_MN_READ_CONFIG\n"));
   5.438 -    break;
   5.439 -  case IRP_MN_WRITE_CONFIG:
   5.440 -    KdPrint((__DRIVER_NAME "     MinorFunction = IRP_MN_WRITE_CONFIG\n"));
   5.441 -    break;
   5.442 -  case IRP_MN_EJECT:
   5.443 -    KdPrint((__DRIVER_NAME "     MinorFunction = IRP_MN_EJECT\n"));
   5.444 -    break;
   5.445 -  case IRP_MN_SET_LOCK:
   5.446 -    KdPrint((__DRIVER_NAME "     MinorFunction = IRP_MN_SET_LOCK\n"));
   5.447 +    KdPrint((__DRIVER_NAME "     IRP_MN_QUERY_DEVICE_RELATIONS\n"));
   5.448 +    switch (Stack->Parameters.QueryDeviceRelations.Type)
   5.449 +    {
   5.450 +    case BusRelations:
   5.451 +      KdPrint((__DRIVER_NAME "       BusRelations\n"));
   5.452 +      IoCopyCurrentIrpStackLocationToNext(Irp);
   5.453 +      IoSetCompletionRoutine(Irp, XenHide_IoCompletion, DeviceExtension, TRUE, TRUE, TRUE);
   5.454 +      break;  
   5.455 +    default:
   5.456 +      IoSkipCurrentIrpStackLocation(Irp);
   5.457 +      break;  
   5.458 +    }
   5.459      break;
   5.460    default:
   5.461 -    KdPrint((__DRIVER_NAME "     MinorFunction = %02x\n", Stack->MinorFunction));
   5.462 +    IoSkipCurrentIrpStackLocation(Irp);
   5.463      break;
   5.464    }
   5.465  
   5.466 -  switch (DeviceExtension->Type)
   5.467 -  {
   5.468 -  case XENHIDE_TYPE_PCI:
   5.469 -    KdPrint((__DRIVER_NAME "     As PCI\n"));
   5.470 +  Status = IoCallDriver(DeviceExtension->NextLowerDevice, Irp);
   5.471  
   5.472 -    switch (Stack->MinorFunction) {
   5.473 -    case IRP_MN_QUERY_DEVICE_RELATIONS:
   5.474 -      KdPrint((__DRIVER_NAME "     IRP_MN_QUERY_DEVICE_RELATIONS\n"));
   5.475 -      switch (Stack->Parameters.QueryDeviceRelations.Type)
   5.476 -      {
   5.477 -      case BusRelations:
   5.478 -        KdPrint((__DRIVER_NAME "       BusRelations\n"));
   5.479 -        IoCopyCurrentIrpStackLocationToNext(Irp);
   5.480 -        IoSetCompletionRoutine(Irp, XenHide_IoCompletionPciQueryDeviceRelations, DeviceExtension, TRUE, TRUE, TRUE);
   5.481 -        break;
   5.482 -      default:
   5.483 -        IoSkipCurrentIrpStackLocation(Irp);
   5.484 -        break;  
   5.485 -      }
   5.486 -      break;
   5.487 -    case IRP_MN_QUERY_ID:
   5.488 -      IoCopyCurrentIrpStackLocationToNext(Irp);
   5.489 -      IoSetCompletionRoutine(Irp, XenHide_IoCompletionPciQueryId, DeviceExtension, TRUE, TRUE, TRUE);
   5.490 -      break;
   5.491 -    case IRP_MN_QUERY_CAPABILITIES:
   5.492 -    default:
   5.493 -      IoSkipCurrentIrpStackLocation(Irp);
   5.494 -      break;
   5.495 -    }
   5.496 -    Status = IoCallDriver(DeviceExtension->NextLowerDevice, Irp);
   5.497 -    break;
   5.498 -  case XENHIDE_TYPE_HIDE:
   5.499 -    KdPrint((__DRIVER_NAME "     As Hide\n"));
   5.500 -    switch (Stack->MinorFunction)
   5.501 -    {
   5.502 -/*
   5.503 -    case IRP_MN_START_DEVICE:
   5.504 -      IoCopyCurrentIrpStackLocationToNext(Irp);
   5.505 -      IoSetCompletionRoutine(Irp, XenHide_IoCompletionHideStartDevice, DeviceExtension, TRUE, TRUE, TRUE);
   5.506 -      IoCopyCurrentIrpStackLocationToNext(Irp);
   5.507 -      Stack = IoGetNextIrpStackLocation(Irp);
   5.508 -      Stack->Parameters.StartDevice.AllocatedResources = ExAllocatePoolWithTag(NonPagedPool, sizeof(CM_RESOURCE_LIST), XENHIDE_POOL_TAG);
   5.509 -      Stack->Parameters.StartDevice.AllocatedResources->Count = 1;
   5.510 -      Stack->Parameters.StartDevice.AllocatedResources->List[0].InterfaceType = Internal;
   5.511 -      Stack->Parameters.StartDevice.AllocatedResources->List[0].BusNumber = 0;
   5.512 -      Stack->Parameters.StartDevice.AllocatedResources->List[0].PartialResourceList.Version = 1;
   5.513 -      Stack->Parameters.StartDevice.AllocatedResources->List[0].PartialResourceList.Revision = 1;
   5.514 -      Stack->Parameters.StartDevice.AllocatedResources->List[0].PartialResourceList.Count = 0;
   5.515 -      Stack->Parameters.StartDevice.AllocatedResourcesTranslated = ExAllocatePoolWithTag(NonPagedPool, sizeof(CM_RESOURCE_LIST), XENHIDE_POOL_TAG);
   5.516 -      Stack->Parameters.StartDevice.AllocatedResourcesTranslated->Count = 1;
   5.517 -      Stack->Parameters.StartDevice.AllocatedResourcesTranslated->List[0].InterfaceType = Internal;
   5.518 -      Stack->Parameters.StartDevice.AllocatedResourcesTranslated->List[0].BusNumber = 0;
   5.519 -      Stack->Parameters.StartDevice.AllocatedResourcesTranslated->List[0].PartialResourceList.Version = 1;
   5.520 -      Stack->Parameters.StartDevice.AllocatedResourcesTranslated->List[0].PartialResourceList.Revision = 1;
   5.521 -      Stack->Parameters.StartDevice.AllocatedResourcesTranslated->List[0].PartialResourceList.Count = 0;
   5.522 -      break;
   5.523 -    case IRP_MN_QUERY_PNP_DEVICE_STATE:
   5.524 -      IoCopyCurrentIrpStackLocationToNext(Irp);
   5.525 -      IoSetCompletionRoutine(Irp, XenHide_IoCompletionHideQueryPnpDeviceState, DeviceExtension, TRUE, TRUE, TRUE);
   5.526 -      break;
   5.527 -*/
   5.528 -    case IRP_MN_QUERY_ID:
   5.529 -      switch (Stack->Parameters.QueryId.IdType)
   5.530 -      {
   5.531 -      case BusQueryDeviceID:
   5.532 -        KdPrint((__DRIVER_NAME "     BusQueryDeviceID\n"));
   5.533 -        break;
   5.534 -      case BusQueryHardwareIDs:
   5.535 -        KdPrint((__DRIVER_NAME "     BusQueryHardwareIDs\n"));
   5.536 -        break;
   5.537 -      case BusQueryCompatibleIDs:
   5.538 -        KdPrint((__DRIVER_NAME "     BusQueryCompatibleIDs\n"));
   5.539 -        break;
   5.540 -      case BusQueryInstanceID:
   5.541 -        KdPrint((__DRIVER_NAME "     BusQueryInstanceID\n"));
   5.542 -        break;
   5.543 -      default:
   5.544 -        KdPrint((__DRIVER_NAME "     %08x\n", Stack->Parameters.QueryId.IdType));
   5.545 -        break;
   5.546 -      }
   5.547 -      IoCopyCurrentIrpStackLocationToNext(Irp);
   5.548 -      IoSetCompletionRoutine(Irp, XenHide_IoCompletionPciQueryId, DeviceExtension, TRUE, TRUE, TRUE);
   5.549 -      break;
   5.550 -    default:
   5.551 -      IoSkipCurrentIrpStackLocation(Irp);
   5.552 -      break;
   5.553 -    }
   5.554 -    Status = IoCallDriver(DeviceExtension->NextLowerDevice, Irp);
   5.555 -    break;
   5.556 -  }
   5.557 -
   5.558 -//  IoReleaseRemoveLock(&DeviceExtension->RemoveLock, Irp); 
   5.559 -  
   5.560    KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ " (returning with status %08x)\n", Status));
   5.561  
   5.562    return Status;
     6.1 --- a/xenhide/xenhide.h	Mon Feb 18 16:12:48 2008 +1100
     6.2 +++ b/xenhide/xenhide.h	Mon Feb 18 22:16:03 2008 +1100
     6.3 @@ -45,7 +45,6 @@ struct _DEVICE_EXTENSION {
     6.4    PDEVICE_OBJECT NextLowerDevice;
     6.5    IO_REMOVE_LOCK RemoveLock;
     6.6    UNICODE_STRING InterfaceName;
     6.7 -  ULONG Type;
     6.8    ULONG InternalState;
     6.9  } typedef DEVICE_EXTENSION, *PDEVICE_EXTENSION;
    6.10