]> xenbits.xensource.com Git - pvdrivers/win/xenbus.git/commitdiff
Move FiltersInstall/FiltersUninstall to xen.sys
authorOwen Smith <owen.smith@cloud.com>
Fri, 7 Jun 2024 07:16:57 +0000 (08:16 +0100)
committerPaul Durrant <pdurrant@amazon.com>
Mon, 1 Jul 2024 08:49:46 +0000 (09:49 +0100)
Since WHQL will enable Driver Verifier's registry isolation violation
detection on xenbus.sys, move the registry manipulation for inserting
xenfilt.sys into the appropriate device class UpperFilters to xen.sys.

Signed-off-by: Owen Smith <owen.smith@cloud.com>
include/xen.h
src/xen/filters.c [new file with mode: 0644]
src/xen/filters.h [new file with mode: 0644]
src/xenbus/driver.c
src/xenbus/filters.c [deleted file]
src/xenbus/filters.h [deleted file]
vs2019/xen/xen.vcxproj
vs2019/xenbus/xenbus.vcxproj
vs2022/xen/xen.vcxproj
vs2022/xenbus/xenbus.vcxproj

index f8721e89dd8c4ed6cd168bf06e3853476403dd10..566d9e3848a3ab23067328779964cb1211d8b8e4 100644 (file)
@@ -526,4 +526,18 @@ VcpuRegisterVcpuInfo(
     IN  ULONG                       Offset
     );
 
+// FILTERS
+
+XEN_API
+VOID
+FiltersInstall(
+     VOID
+     );
+
+XEN_API
+VOID
+FiltersUninstall(
+     VOID
+     );
+
 #endif  // _XEN_H
diff --git a/src/xen/filters.c b/src/xen/filters.c
new file mode 100644 (file)
index 0000000..36a266f
--- /dev/null
@@ -0,0 +1,346 @@
+/* Copyright (c) Xen Project.
+ * Copyright (c) Cloud Software Group, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms,
+ * with or without modification, are permitted provided
+ * that the following conditions are met:
+ *
+ * *   Redistributions of source code must retain the above
+ *     copyright notice, this list of conditions and the
+ *     following disclaimer.
+ * *   Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the
+ *     following disclaimer in the documentation and/or other
+ *     materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+ * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#define XEN_API __declspec(dllexport)
+
+#define INITGUID 1
+
+#include <ntddk.h>
+#include <ntstrsafe.h>
+#include <devguid.h>
+#include <xen.h>
+
+#include "registry.h"
+#include "driver.h"
+#include "dbg_print.h"
+#include "assert.h"
+#include "util.h"
+
+#define XENBUS_FILTERS_TAG 'TLIF'
+
+static FORCEINLINE PVOID
+__FiltersAllocate(
+    IN  ULONG   Length
+    )
+{
+    return __AllocatePoolWithTag(NonPagedPool, Length, XENBUS_FILTERS_TAG);
+}
+
+static FORCEINLINE VOID
+__FiltersFree(
+    IN  PVOID   Buffer
+    )
+{
+    __FreePoolWithTag(Buffer, XENBUS_FILTERS_TAG);
+}
+
+#define CLASS_PATH "\\Registry\\Machine\\SYSTEM\\CurrentControlSet\\Control\\Class"
+
+static NTSTATUS
+FiltersInstallClass(
+    IN  const CHAR  *ClassName,
+    IN  const GUID  *ClassGuid,
+    IN  const CHAR  *DriverName
+    )
+{
+    HANDLE          ClassKey;
+    UNICODE_STRING  Unicode;
+    HANDLE          Key;
+    ULONG           Type;
+    ULONG           Count;
+    PANSI_STRING    Old;
+    ULONG           Index;
+    PANSI_STRING    New;
+    NTSTATUS        status;
+
+    Trace("====>\n");
+
+    status = RegistryOpenSubKey(NULL,
+                                CLASS_PATH,
+                                KEY_ALL_ACCESS,
+                                &ClassKey);
+    if (!NT_SUCCESS(status))
+        goto fail1;
+
+    status = RtlStringFromGUID(ClassGuid, &Unicode);
+    if (!NT_SUCCESS(status))
+        goto fail2;
+
+    status = RegistryOpenKey(ClassKey,
+                             &Unicode,
+                             KEY_ALL_ACCESS,
+                             &Key);
+    if (!NT_SUCCESS(status))
+        goto fail3;
+
+    Count = 0;
+
+    status = RegistryQuerySzValue(Key, "UpperFilters", &Type, &Old);
+    if (NT_SUCCESS(status)) {
+        status = STATUS_INVALID_PARAMETER;
+        if (Type != REG_MULTI_SZ)
+            goto fail4;
+
+        for (Index = 0; Old[Index].Buffer != NULL; Index++) {
+            if (_stricmp(Old[Index].Buffer, DriverName) == 0)
+                goto done;
+
+            Count++;
+        }
+    } else {
+        Old = NULL;
+    }
+
+    New = __FiltersAllocate(sizeof (ANSI_STRING) * (Count + 2));
+
+    status = STATUS_NO_MEMORY;
+    if (New == NULL)
+        goto fail5;
+
+    Index = 0;
+    while (Index < Count) {
+        New[Index] = Old[Index];
+        Index++;
+    }
+
+    RtlInitAnsiString(&New[Index], DriverName);
+
+    status = RegistryUpdateSzValue(Key,
+                                   "UpperFilters",
+                                   REG_MULTI_SZ,
+                                   New);
+    if (!NT_SUCCESS(status))
+        goto fail6;
+
+    __FiltersFree(New);
+
+    Info("%s %s\n", ClassName, DriverName);
+
+done:
+    if (Old != NULL)
+        RegistryFreeSzValue(Old);
+
+    RegistryCloseKey(Key);
+
+    RtlFreeUnicodeString(&Unicode);
+
+    RegistryCloseKey(ClassKey);
+
+    Trace("<====\n");
+
+    return STATUS_SUCCESS;
+
+fail6:
+    Error("fail6\n");
+
+    __FiltersFree(New);
+
+fail5:
+    Error("fail5\n");
+
+    if (Old != NULL)
+        RegistryFreeSzValue(Old);
+
+fail4:
+    Error("fail4\n");
+
+    RegistryCloseKey(Key);
+
+fail3:
+    Error("fail3\n");
+
+    RtlFreeUnicodeString(&Unicode);
+
+fail2:
+    Error("fail2\n");
+
+    RegistryCloseKey(ClassKey);
+
+fail1:
+    Error("fail1 (%08x)\n", status);
+
+    return status;
+}
+
+#define FILTERS_INSTALL_CLASS(_ClassGuid, _DriverName) \
+        FiltersInstallClass(#_ClassGuid, &GUID_ ## _ClassGuid, (_DriverName))
+
+static NTSTATUS
+FiltersUninstallClass(
+    IN  const CHAR  *ClassName,
+    IN  const GUID  *ClassGuid,
+    IN  const CHAR  *DriverName
+    )
+{
+    HANDLE          ClassKey;
+    UNICODE_STRING  Unicode;
+    HANDLE          Key;
+    ULONG           Type;
+    ULONG           Count;
+    PANSI_STRING    Old = NULL;
+    ULONG           Index;
+    PANSI_STRING    New;
+    NTSTATUS        status;
+
+    Trace("====>\n");
+
+    status = RegistryOpenSubKey(NULL,
+                                CLASS_PATH,
+                                KEY_ALL_ACCESS,
+                                &ClassKey);
+    if (!NT_SUCCESS(status))
+        goto fail1;
+
+    status = RtlStringFromGUID(ClassGuid, &Unicode);
+    if (!NT_SUCCESS(status))
+        goto fail2;
+
+    status = RegistryOpenKey(ClassKey,
+                             &Unicode,
+                             KEY_ALL_ACCESS,
+                             &Key);
+    if (!NT_SUCCESS(status))
+        goto fail3;
+
+    status = RegistryQuerySzValue(Key, "UpperFilters", &Type, &Old);
+    if (NT_SUCCESS(status)) {
+        status = STATUS_INVALID_PARAMETER;
+        if (Type != REG_MULTI_SZ)
+            goto fail4;
+
+        for (Index = 0; Old[Index].Buffer != NULL; Index++) {
+            if (_stricmp(Old[Index].Buffer, DriverName) == 0)
+                goto found;
+        }
+    }
+
+    goto done;
+
+found:
+    Count = 0;
+    for (Index = 0; Old[Index].Buffer != NULL; Index++)
+        Count++;
+
+    New = __FiltersAllocate(sizeof (ANSI_STRING) * Count);
+
+    status = STATUS_NO_MEMORY;
+    if (New == NULL)
+        goto fail5;
+
+    Count = 0;
+    for (Index = 0; Old[Index].Buffer != NULL; Index++) {
+        if (_stricmp(Old[Index].Buffer, DriverName) == 0)
+            continue;
+
+        New[Count] = Old[Index];
+        Count++;
+    }
+
+    status = RegistryUpdateSzValue(Key,
+                                   "UpperFilters",
+                                   REG_MULTI_SZ,
+                                   New);
+    if (!NT_SUCCESS(status))
+        goto fail6;
+
+    __FiltersFree(New);
+
+    Info("%s %s\n", ClassName, DriverName);
+
+done:
+    if (Old != NULL)
+        RegistryFreeSzValue(Old);
+
+    RegistryCloseKey(Key);
+
+    RtlFreeUnicodeString(&Unicode);
+
+    RegistryCloseKey(ClassKey);
+
+    Trace("<====\n");
+
+    return STATUS_SUCCESS;
+
+fail6:
+    Error("fail6\n");
+
+    __FiltersFree(New);
+
+fail5:
+    Error("fail5\n");
+
+    if (Old != NULL)
+        RegistryFreeSzValue(Old);
+
+fail4:
+    Error("fail4\n");
+
+    RegistryCloseKey(Key);
+
+fail3:
+    Error("fail3\n");
+
+    RtlFreeUnicodeString(&Unicode);
+
+fail2:
+    Error("fail2\n");
+
+    RegistryCloseKey(ClassKey);
+
+fail1:
+    Error("fail1 (%08x)\n", status);
+
+    return status;
+}
+
+#define FILTERS_UNINSTALL_CLASS(_ClassGuid, _DriverName) \
+        FiltersUninstallClass(#_ClassGuid, &GUID_ ## _ClassGuid, (_DriverName))
+
+XEN_API
+VOID
+FiltersInstall(
+    VOID
+    )
+{
+    (VOID) FILTERS_INSTALL_CLASS(DEVCLASS_SYSTEM, "XENFILT");
+    (VOID) FILTERS_INSTALL_CLASS(DEVCLASS_HDC, "XENFILT");
+}
+
+XEN_API
+VOID
+FiltersUninstall(
+    VOID
+    )
+{
+    (VOID) FILTERS_UNINSTALL_CLASS(DEVCLASS_HDC, "XENFILT");
+    (VOID) FILTERS_UNINSTALL_CLASS(DEVCLASS_SYSTEM, "XENFILT");
+}
diff --git a/src/xen/filters.h b/src/xen/filters.h
new file mode 100644 (file)
index 0000000..df38c5a
--- /dev/null
@@ -0,0 +1,46 @@
+/* Copyright (c) Xen Project.
+ * Copyright (c) Cloud Software Group, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms,
+ * with or without modification, are permitted provided
+ * that the following conditions are met:
+ *
+ * *   Redistributions of source code must retain the above
+ *     copyright notice, this list of conditions and the
+ *     following disclaimer.
+ * *   Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the
+ *     following disclaimer in the documentation and/or other
+ *     materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+ * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#ifndef _XENBUS_FILTERS_H
+#define _XENBUS_FILTERS_H
+
+extern NTSTATUS
+FiltersInstall(
+     VOID
+     );
+
+extern NTSTATUS
+FiltersUninstall(
+     VOID
+     );
+
+#endif  // _XENBUS_FILTERS_H
index d6efe893e8456db6614063d1345cab0ac37f642a..e8d0c1fe04b33ed006e962a70dfb621f34e08ad3 100644 (file)
@@ -33,6 +33,7 @@
 #include <ntddk.h>
 #include <procgrp.h>
 #include <ntstrsafe.h>
+#include <xen.h>
 
 #include "registry.h"
 #include "fdo.h"
@@ -40,7 +41,6 @@
 #include "driver.h"
 #include "names.h"
 #include "mutex.h"
-#include "filters.h"
 #include "dbg_print.h"
 #include "assert.h"
 #include "util.h"
diff --git a/src/xenbus/filters.c b/src/xenbus/filters.c
deleted file mode 100644 (file)
index 5b41e11..0000000
+++ /dev/null
@@ -1,342 +0,0 @@
-/* Copyright (c) Xen Project.
- * Copyright (c) Cloud Software Group, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms,
- * with or without modification, are permitted provided
- * that the following conditions are met:
- *
- * *   Redistributions of source code must retain the above
- *     copyright notice, this list of conditions and the
- *     following disclaimer.
- * *   Redistributions in binary form must reproduce the above
- *     copyright notice, this list of conditions and the
- *     following disclaimer in the documentation and/or other
- *     materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
- * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#define INITGUID 1
-
-#include <ntddk.h>
-#include <ntstrsafe.h>
-#include <devguid.h>
-#include <xen.h>
-
-#include "registry.h"
-#include "driver.h"
-#include "dbg_print.h"
-#include "assert.h"
-#include "util.h"
-
-#define XENBUS_FILTERS_TAG 'TLIF'
-
-static FORCEINLINE PVOID
-__FiltersAllocate(
-    IN  ULONG   Length
-    )
-{
-    return __AllocatePoolWithTag(NonPagedPool, Length, XENBUS_FILTERS_TAG);
-}
-
-static FORCEINLINE VOID
-__FiltersFree(
-    IN  PVOID   Buffer
-    )
-{
-    __FreePoolWithTag(Buffer, XENBUS_FILTERS_TAG);
-}
-
-#define CLASS_PATH "\\Registry\\Machine\\SYSTEM\\CurrentControlSet\\Control\\Class"
-
-static NTSTATUS
-FiltersInstallClass(
-    IN  const CHAR  *ClassName,
-    IN  const GUID  *ClassGuid,
-    IN  const CHAR  *DriverName
-    )
-{
-    HANDLE          ClassKey;
-    UNICODE_STRING  Unicode;
-    HANDLE          Key;
-    ULONG           Type;
-    ULONG           Count;
-    PANSI_STRING    Old;
-    ULONG           Index;
-    PANSI_STRING    New;
-    NTSTATUS        status;
-
-    Trace("====>\n");
-
-    status = RegistryOpenSubKey(NULL,
-                                CLASS_PATH,
-                                KEY_ALL_ACCESS,
-                                &ClassKey);
-    if (!NT_SUCCESS(status))
-        goto fail1;
-
-    status = RtlStringFromGUID(ClassGuid, &Unicode);
-    if (!NT_SUCCESS(status))
-        goto fail2;
-
-    status = RegistryOpenKey(ClassKey,
-                             &Unicode,
-                             KEY_ALL_ACCESS,
-                             &Key);
-    if (!NT_SUCCESS(status))
-        goto fail3;
-
-    Count = 0;
-
-    status = RegistryQuerySzValue(Key, "UpperFilters", &Type, &Old);
-    if (NT_SUCCESS(status)) {
-        status = STATUS_INVALID_PARAMETER;
-        if (Type != REG_MULTI_SZ)
-            goto fail4;
-
-        for (Index = 0; Old[Index].Buffer != NULL; Index++) {
-            if (_stricmp(Old[Index].Buffer, DriverName) == 0)
-                goto done;
-
-            Count++;
-        }
-    } else {
-        Old = NULL;
-    }
-
-    New = __FiltersAllocate(sizeof (ANSI_STRING) * (Count + 2));
-
-    status = STATUS_NO_MEMORY;
-    if (New == NULL)
-        goto fail5;
-
-    Index = 0;
-    while (Index < Count) {
-        New[Index] = Old[Index];
-        Index++;
-    }
-
-    RtlInitAnsiString(&New[Index], DriverName);
-
-    status = RegistryUpdateSzValue(Key,
-                                   "UpperFilters",
-                                   REG_MULTI_SZ,
-                                   New);
-    if (!NT_SUCCESS(status))
-        goto fail6;
-
-    __FiltersFree(New);
-
-    Info("%s %s\n", ClassName, DriverName);
-
-done:
-    if (Old != NULL)
-        RegistryFreeSzValue(Old);
-
-    RegistryCloseKey(Key);
-
-    RtlFreeUnicodeString(&Unicode);
-
-    RegistryCloseKey(ClassKey);
-
-    Trace("<====\n");
-
-    return STATUS_SUCCESS;
-
-fail6:
-    Error("fail6\n");
-
-    __FiltersFree(New);
-
-fail5:
-    Error("fail5\n");
-
-    if (Old != NULL)
-        RegistryFreeSzValue(Old);
-
-fail4:
-    Error("fail4\n");
-
-    RegistryCloseKey(Key);
-
-fail3:
-    Error("fail3\n");
-
-    RtlFreeUnicodeString(&Unicode);
-
-fail2:
-    Error("fail2\n");
-
-    RegistryCloseKey(ClassKey);
-
-fail1:
-    Error("fail1 (%08x)\n", status);
-
-    return status;
-}
-
-#define FILTERS_INSTALL_CLASS(_ClassGuid, _DriverName) \
-        FiltersInstallClass(#_ClassGuid, &GUID_ ## _ClassGuid, (_DriverName))
-
-static NTSTATUS
-FiltersUninstallClass(
-    IN  const CHAR  *ClassName,
-    IN  const GUID  *ClassGuid,
-    IN  const CHAR  *DriverName
-    )
-{
-    HANDLE          ClassKey;
-    UNICODE_STRING  Unicode;
-    HANDLE          Key;
-    ULONG           Type;
-    ULONG           Count;
-    PANSI_STRING    Old = NULL;
-    ULONG           Index;
-    PANSI_STRING    New;
-    NTSTATUS        status;
-
-    Trace("====>\n");
-
-    status = RegistryOpenSubKey(NULL,
-                                CLASS_PATH,
-                                KEY_ALL_ACCESS,
-                                &ClassKey);
-    if (!NT_SUCCESS(status))
-        goto fail1;
-
-    status = RtlStringFromGUID(ClassGuid, &Unicode);
-    if (!NT_SUCCESS(status))
-        goto fail2;
-
-    status = RegistryOpenKey(ClassKey,
-                             &Unicode,
-                             KEY_ALL_ACCESS,
-                             &Key);
-    if (!NT_SUCCESS(status))
-        goto fail3;
-
-    status = RegistryQuerySzValue(Key, "UpperFilters", &Type, &Old);
-    if (NT_SUCCESS(status)) {
-        status = STATUS_INVALID_PARAMETER;
-        if (Type != REG_MULTI_SZ)
-            goto fail4;
-
-        for (Index = 0; Old[Index].Buffer != NULL; Index++) {
-            if (_stricmp(Old[Index].Buffer, DriverName) == 0)
-                goto found;
-        }
-    }
-
-    goto done;
-
-found:
-    Count = 0;
-    for (Index = 0; Old[Index].Buffer != NULL; Index++)
-        Count++;
-
-    New = __FiltersAllocate(sizeof (ANSI_STRING) * Count);
-
-    status = STATUS_NO_MEMORY;
-    if (New == NULL)
-        goto fail5;
-
-    Count = 0;
-    for (Index = 0; Old[Index].Buffer != NULL; Index++) {
-        if (_stricmp(Old[Index].Buffer, DriverName) == 0)
-            continue;
-
-        New[Count] = Old[Index];
-        Count++;
-    }
-
-    status = RegistryUpdateSzValue(Key,
-                                   "UpperFilters",
-                                   REG_MULTI_SZ,
-                                   New);
-    if (!NT_SUCCESS(status))
-        goto fail6;
-
-    __FiltersFree(New);
-
-    Info("%s %s\n", ClassName, DriverName);
-
-done:
-    if (Old != NULL)
-        RegistryFreeSzValue(Old);
-
-    RegistryCloseKey(Key);
-
-    RtlFreeUnicodeString(&Unicode);
-
-    RegistryCloseKey(ClassKey);
-
-    Trace("<====\n");
-
-    return STATUS_SUCCESS;
-
-fail6:
-    Error("fail6\n");
-
-    __FiltersFree(New);
-
-fail5:
-    Error("fail5\n");
-
-    if (Old != NULL)
-        RegistryFreeSzValue(Old);
-
-fail4:
-    Error("fail4\n");
-
-    RegistryCloseKey(Key);
-
-fail3:
-    Error("fail3\n");
-
-    RtlFreeUnicodeString(&Unicode);
-
-fail2:
-    Error("fail2\n");
-
-    RegistryCloseKey(ClassKey);
-
-fail1:
-    Error("fail1 (%08x)\n", status);
-
-    return status;
-}
-
-#define FILTERS_UNINSTALL_CLASS(_ClassGuid, _DriverName) \
-        FiltersUninstallClass(#_ClassGuid, &GUID_ ## _ClassGuid, (_DriverName))
-
-VOID
-FiltersInstall(
-    VOID
-    )
-{
-    (VOID) FILTERS_INSTALL_CLASS(DEVCLASS_SYSTEM, "XENFILT");
-    (VOID) FILTERS_INSTALL_CLASS(DEVCLASS_HDC, "XENFILT");
-}
-
-VOID
-FiltersUninstall(
-    VOID
-    )
-{
-    (VOID) FILTERS_UNINSTALL_CLASS(DEVCLASS_HDC, "XENFILT");
-    (VOID) FILTERS_UNINSTALL_CLASS(DEVCLASS_SYSTEM, "XENFILT");
-}
diff --git a/src/xenbus/filters.h b/src/xenbus/filters.h
deleted file mode 100644 (file)
index df38c5a..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/* Copyright (c) Xen Project.
- * Copyright (c) Cloud Software Group, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms,
- * with or without modification, are permitted provided
- * that the following conditions are met:
- *
- * *   Redistributions of source code must retain the above
- *     copyright notice, this list of conditions and the
- *     following disclaimer.
- * *   Redistributions in binary form must reproduce the above
- *     copyright notice, this list of conditions and the
- *     following disclaimer in the documentation and/or other
- *     materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
- * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifndef _XENBUS_FILTERS_H
-#define _XENBUS_FILTERS_H
-
-extern NTSTATUS
-FiltersInstall(
-     VOID
-     );
-
-extern NTSTATUS
-FiltersUninstall(
-     VOID
-     );
-
-#endif  // _XENBUS_FILTERS_H
index ca6cef604cc83b81edae8d645fa3ba64fb2844b5..ec0f7e1aa12190e94cec98a655d74e14018085db 100644 (file)
@@ -70,6 +70,7 @@
     <ClCompile Include="..\..\src\common\registry.c" />
     <ClCompile Include="..\..\src\xen\driver.c" />
     <ClCompile Include="..\..\src\xen\event_channel.c" />
+    <ClCompile Include="..\..\src\xen\filters.c" />
     <ClCompile Include="..\..\src\xen\grant_table.c" />
     <ClCompile Include="..\..\src\xen\hvm.c" />
     <ClCompile Include="..\..\src\xen\xen_version.c" />
index 9227e0a3b3ac06bf6b815d96a45a15d07369cc04..ee439719cf225998d12ff42feb061d7d97d1b43c 100644 (file)
@@ -81,7 +81,6 @@
     <ClCompile Include="..\..\src\xenbus\evtchn_2l.c" />
     <ClCompile Include="..\..\src\xenbus\evtchn_fifo.c" />
     <ClCompile Include="..\..\src\xenbus\fdo.c" />
-    <ClCompile Include="..\..\src\xenbus\filters.c" />
     <ClCompile Include="..\..\src\xenbus\gnttab.c" />
     <ClCompile Include="..\..\src\xenbus\pdo.c" />
     <ClCompile Include="..\..\src\xenbus\shared_info.c" />
index 2304a4b007b2ddb20772b35e5cffebe22e9b94de..7efdce89e656f5e3a539e7a9ff6911d1346b8a89 100644 (file)
@@ -65,6 +65,7 @@
     <ClCompile Include="..\..\src\common\registry.c" />
     <ClCompile Include="..\..\src\xen\driver.c" />
     <ClCompile Include="..\..\src\xen\event_channel.c" />
+    <ClCompile Include="..\..\src\xen\filters.c" />
     <ClCompile Include="..\..\src\xen\grant_table.c" />
     <ClCompile Include="..\..\src\xen\hvm.c" />
     <ClCompile Include="..\..\src\xen\xen_version.c" />
index 422f6107b460e4215b23f71b1e26642b081027ea..939654aaf0202e6568a2307d8d9b436ffe685172 100644 (file)
@@ -73,7 +73,6 @@
     <ClCompile Include="..\..\src\xenbus\evtchn_2l.c" />
     <ClCompile Include="..\..\src\xenbus\evtchn_fifo.c" />
     <ClCompile Include="..\..\src\xenbus\fdo.c" />
-    <ClCompile Include="..\..\src\xenbus\filters.c" />
     <ClCompile Include="..\..\src\xenbus\gnttab.c" />
     <ClCompile Include="..\..\src\xenbus\pdo.c" />
     <ClCompile Include="..\..\src\xenbus\shared_info.c" />