]> xenbits.xensource.com Git - people/pauldu/xenbus.git/commitdiff
Registry string value types cannot be inferred
authorPaul Durrant <paul.durrant@citrix.com>
Wed, 5 Aug 2015 07:56:56 +0000 (08:56 +0100)
committerPaul Durrant <paul.durrant@citrix.com>
Wed, 5 Aug 2015 09:10:43 +0000 (10:10 +0100)
For instance, the UpperFilters key needs to be a REG_MULTI_SZ
even if it contains only one string. Thus the type needs to be
passed explicitly to RegistryUpdateSzValue.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
src/common/registry.c
src/common/registry.h
src/xenbus/fdo.c
src/xenbus/filters.c
src/xenfilt/pvdevice.c

index 2785020c4a57ed7325caa22c4513328e106e62e0..2389c33f264d2073151537d0ef18ab8e6ef662a6 100644 (file)
@@ -1300,12 +1300,12 @@ NTSTATUS
 RegistryUpdateSzValue(
     IN  HANDLE                      Key,
     IN  PCHAR                       Name,
+    IN  ULONG                       Type,
     IN  PANSI_STRING                Array
     )
 {
     ANSI_STRING                     Ansi;
     UNICODE_STRING                  Unicode;
-    ULONG                           Type;
     PKEY_VALUE_PARTIAL_INFORMATION  Partial;
     NTSTATUS                        status;
 
@@ -1315,8 +1315,6 @@ RegistryUpdateSzValue(
     if (!NT_SUCCESS(status))
         goto fail1;
 
-    Type = (Array[1].Buffer != NULL) ? REG_MULTI_SZ : REG_SZ;
-
     switch (Type) {
     case REG_SZ:
         status = STATUS_NO_MEMORY;
index 06e9bd60913ee059c3cc1b0adb99e2cbc96e1f7e..ef0cf91081090c1ea3d820244f8dba9a111153d7 100644 (file)
@@ -190,6 +190,7 @@ extern NTSTATUS
 RegistryUpdateSzValue(
     IN  HANDLE          Key,
     IN  PCHAR           Name,
+    IN  ULONG           Type,
     IN  PANSI_STRING    Array
     );
 
index 9eb20e704b978453a883816c2dbc82da496de349..92634cc8c4ffa7d542949735e4b19d313f61430b 100644 (file)
@@ -750,6 +750,7 @@ FdoSetFriendlyName(
 
     status = RegistryUpdateSzValue(HardwareKey,
                                    "FriendlyName",
+                                   REG_SZ,
                                    FriendlyName);
     if (!NT_SUCCESS(status))
         goto fail5;
index fe0cebab2f4e112b13c27cbc72f49a0d82be2ac8..651fcc223318a3b086138f6a03b1111d9abacbaf 100644 (file)
@@ -126,7 +126,10 @@ FiltersInstallClass(
 
     RtlInitAnsiString(&New[Index], DriverName);
 
-    status = RegistryUpdateSzValue(Key, "UpperFilters", New);
+    status = RegistryUpdateSzValue(Key,
+                                   "UpperFilters",
+                                   REG_MULTI_SZ,
+                                   New);
     if (!NT_SUCCESS(status))
         goto fail5;
 
@@ -246,7 +249,10 @@ found:
         Count++;
     }
 
-    status = RegistryUpdateSzValue(Key, "UpperFilters", New);
+    status = RegistryUpdateSzValue(Key,
+                                   "UpperFilters",
+                                   REG_MULTI_SZ,
+                                   New);
     if (!NT_SUCCESS(status))
         goto fail5;
 
index 5f9345dad147a56ee3a442cc38ee0bc62d8794c0..296608c337e1dd8922a9b8ce5e45babb6b9a0288 100644 (file)
@@ -210,6 +210,7 @@ PvdeviceSetActive(
 
     status = RegistryUpdateSzValue(ParametersKey,
                                    "ActiveDeviceID",
+                                   REG_SZ,
                                    Ansi);
     if (!NT_SUCCESS(status))
         goto fail2;
@@ -218,6 +219,7 @@ PvdeviceSetActive(
 
     status = RegistryUpdateSzValue(ParametersKey,
                                    "ActiveInstanceID",
+                                   REG_SZ,
                                    Ansi);
     if (!NT_SUCCESS(status))
         goto fail3;