WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] WinPv driver 64bit patch

To: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>, James Harper <james.harper@xxxxxxxxxxxxxxxx>
Subject: [Xen-devel] WinPv driver 64bit patch
From: Wayne Gong <wayne.gong@xxxxxxxxxx>
Date: Tue, 08 Jul 2008 13:10:16 +0800
Cc:
Delivery-date: Mon, 07 Jul 2008 22:11:03 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 2.0.0.14 (Windows/20080421)
Hi James,

This patch can help WinPv driver work fine on Windows 2003 x64 version.
Please review.

Best regards
Wayne
# HG changeset patch
# User Wayne Gong <wayne.gong@xxxxxxxxxx>
# Date 1215493632 -28800
# Node ID dbaf8f156f3f4cd6f6acc5a10cdf1d282809d1ff
# Parent  bfc6e1f99b4fcbd4a5d20b1392d28be66fd310fc
Let winpv work for win2k3_x64.

diff -r bfc6e1f99b4f -r dbaf8f156f3f xenhide/xenhide.c
--- a/xenhide/xenhide.c Tue Jul 08 13:04:41 2008 +0800
+++ b/xenhide/xenhide.c Tue Jul 08 13:07:12 2008 +0800
@@ -171,12 +171,12 @@
 XenHide_IdSuffixMatches(PDEVICE_OBJECT pdo, PWCHAR matching_id)
 {
   NTSTATUS status;
-  ULONG remaining;
-  ULONG string_length;
+  ULONG cmpLen = 0;
   WCHAR ids[512];
   PWCHAR ptr;
   ULONG ids_length;
   int i;
+  size_t j = 0;
   
   for (i = 0; i < 2; i++)
   {
@@ -190,20 +190,29 @@
       //KdPrint((__DRIVER_NAME "     i = %d, status = %x, ids_length = %d\n", 
i, status, ids_length));
       continue;
     }
-    
-    remaining = ids_length / 2;
-    for (ptr = ids; *ptr != 0; ptr += string_length + 1)
+    ptr = ids;
+    for (j = 0; j < 512 - 3; j++)
     {
-      RtlStringCchLengthW(ptr, remaining, (size_t *)&string_length);
-      remaining -= string_length - 1;
-      if (string_length >= wcslen(matching_id))
+      if (ids[j] == L'V' && ids[j+1] == L'E' && ids[j+2] == L'N')
+      {  
+        ptr = ids + j;
+        cmpLen = 17; // "VEN_10EC&DEV_8139"
+        break;
+      }
+      if (ids[j] == L'P' && ids[j+1] == L'N' && ids[j+2] == L'P')
       {
-        ptr += string_length - wcslen(matching_id);
-        string_length -= (ULONG)wcslen(matching_id);
+        ptr = ids + j;
+        cmpLen = 7; // "PNP0A03"
+        break;
       }
-      //KdPrint((__DRIVER_NAME "     Comparing '%S' and '%S'\n", ptr, 
matching_id));
-      if (wcscmp(ptr, matching_id) == 0)
-       return TRUE;
+    }
+    if (j == 512 - 3)
+      break;
+    //KdPrint((__DRIVER_NAME "     Comparing '%S' and '%S'\n", ptr, 
matching_id));
+    if (wcsncmp(ptr, matching_id, cmpLen) == 0)
+    {
+      //KdPrint((__DRIVER_NAME "     Matched\n"));
+      return TRUE;
     }
   }
   //KdPrint((__DRIVER_NAME "     No match\n"));  
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>