[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[XENBUS PATCH 02/13] Switch from char pointers to null-terminated string types



CHAR*/WCHAR* are currently used as string pointers in many places. These
can be safely replaced with PSTR/PWSTR (and their const equivalents) as
they only differ by annotations.

Signed-off-by: Tu Dinh <ngoc-tu.dinh@xxxxxxxxxx>
---
 include/cache_interface.h     |   4 +-
 include/console_interface.h   |   4 +-
 include/debug_interface.h     |   4 +-
 include/emulated_interface.h  |   4 +-
 include/gnttab_interface.h    |   4 +-
 include/range_set_interface.h |   2 +-
 include/store_interface.h     |  32 +++++------
 include/unplug_interface.h    |   2 +-
 include/xen.h                 |  42 +++++++-------
 src/common/assert.h           |  12 ++--
 src/common/dbg_print.h        |  16 +++---
 src/common/names.h            |  36 ++++++------
 src/common/registry.c         |  60 +++++++++----------
 src/common/registry.h         |  22 +++----
 src/common/util.h             |  24 ++++----
 src/monitor/monitor.c         |  92 ++++++++++++++---------------
 src/xen/acpi.c                |   2 +-
 src/xen/acpi.h                |   2 +-
 src/xen/bug_check.c           |  26 ++++-----
 src/xen/config.c              |  42 +++++++-------
 src/xen/driver.c              |  12 ++--
 src/xen/driver.h              |   2 +-
 src/xen/filters.c             |   8 +--
 src/xen/log.c                 |  32 +++++------
 src/xen/module.c              |  26 ++++-----
 src/xen/process.c             |   4 +-
 src/xen/process.h             |   2 +-
 src/xen/system.c              |   8 +--
 src/xen/unplug.c              |  14 ++---
 src/xen/xen_version.c         |   2 +-
 src/xenbus/balloon.c          |   4 +-
 src/xenbus/cache.c            |   4 +-
 src/xenbus/console.c          |  10 ++--
 src/xenbus/debug.c            |   8 +--
 src/xenbus/evtchn.c           |   2 +-
 src/xenbus/fdo.c              |  60 +++++++++----------
 src/xenbus/fdo.h              |   4 +-
 src/xenbus/gnttab.c           |   4 +-
 src/xenbus/pdo.c              |  18 +++---
 src/xenbus/pdo.h              |   4 +-
 src/xenbus/range_set.c        |   2 +-
 src/xenbus/store.c            | 105 +++++++++++++++++-----------------
 src/xenbus/suspend.c          |   6 +-
 src/xenbus/unplug.c           |   4 +-
 src/xenfilt/driver.c          |  38 ++++++------
 src/xenfilt/driver.h          |  14 ++---
 src/xenfilt/emulated.c        |  26 ++++-----
 src/xenfilt/emulated.h        |   6 +-
 src/xenfilt/fdo.c             |   6 +-
 src/xenfilt/fdo.h             |   2 +-
 src/xenfilt/pdo.c             |  26 ++++-----
 src/xenfilt/pdo.h             |   2 +-
 52 files changed, 449 insertions(+), 448 deletions(-)

diff --git a/include/cache_interface.h b/include/cache_interface.h
index dcf0222..a43e9cc 100644
--- a/include/cache_interface.h
+++ b/include/cache_interface.h
@@ -127,7 +127,7 @@ typedef VOID
 typedef NTSTATUS
 (*XENBUS_CACHE_CREATE_V1)(
     _In_ PINTERFACE                 Interface,
-    _In_ const CHAR                 *Name,
+    _In_ PCSTR                      Name,
     _In_ ULONG                      Size,
     _In_ ULONG                      Reservation,
     _In_ XENBUS_CACHE_CTOR          Ctor,
@@ -159,7 +159,7 @@ typedef NTSTATUS
 typedef NTSTATUS
 (*XENBUS_CACHE_CREATE)(
     _In_ PINTERFACE                 Interface,
-    _In_ const CHAR                 *Name,
+    _In_ PCSTR                      Name,
     _In_ ULONG                      Size,
     _In_ ULONG                      Reservation,
     _In_ ULONG                      Cap,
diff --git a/include/console_interface.h b/include/console_interface.h
index 9235862..0d5a2da 100644
--- a/include/console_interface.h
+++ b/include/console_interface.h
@@ -90,7 +90,7 @@ typedef BOOLEAN
 typedef ULONG
 (*XENBUS_CONSOLE_READ)(
     _In_ PINTERFACE Interface,
-    _In_ PCHAR      Data,
+    _In_ PSTR       Data,
     _In_ ULONG      Length
     );
 
@@ -118,7 +118,7 @@ typedef BOOLEAN
 typedef ULONG
 (*XENBUS_CONSOLE_WRITE)(
     _In_ PINTERFACE Interface,
-    _In_ PCHAR      Data,
+    _In_ PSTR       Data,
     _In_ ULONG      Length
     );
 
diff --git a/include/debug_interface.h b/include/debug_interface.h
index 77f40ba..05fcc3e 100644
--- a/include/debug_interface.h
+++ b/include/debug_interface.h
@@ -93,7 +93,7 @@ typedef VOID
 typedef NTSTATUS
 (*XENBUS_DEBUG_REGISTER)(
     _In_ PINTERFACE                 Interface,
-    _In_ PCHAR                      Prefix,
+    _In_ PSTR                       Prefix,
     _In_ XENBUS_DEBUG_FUNCTION      Function,
     _In_opt_ PVOID                  Argument,
     _Out_ PXENBUS_DEBUG_CALLBACK    *Callback
@@ -112,7 +112,7 @@ typedef NTSTATUS
 typedef VOID
 (*XENBUS_DEBUG_PRINTF)(
     _In_ PINTERFACE             Interface,
-    _In_ const CHAR             *Format,
+    _In_ PCSTR                  Format,
     ...
     );
 
diff --git a/include/emulated_interface.h b/include/emulated_interface.h
index 7920c44..ead9c14 100644
--- a/include/emulated_interface.h
+++ b/include/emulated_interface.h
@@ -75,8 +75,8 @@ typedef VOID
 typedef BOOLEAN
 (*XENFILT_EMULATED_IS_DEVICE_PRESENT)(
     _In_ PVOID      Context,
-    _In_ PCHAR      DeviceID,
-    _In_opt_ PCHAR  InstanceID
+    _In_ PSTR       DeviceID,
+    _In_opt_ PSTR   InstanceID
     );
 
 typedef BOOLEAN
diff --git a/include/gnttab_interface.h b/include/gnttab_interface.h
index 1bc9c4e..6574e97 100644
--- a/include/gnttab_interface.h
+++ b/include/gnttab_interface.h
@@ -76,7 +76,7 @@ typedef VOID
 typedef NTSTATUS
 (*XENBUS_GNTTAB_CREATE_CACHE_V1)(
     _In_ PINTERFACE                 Interface,
-    _In_ const CHAR                 *Name,
+    _In_ PCSTR                      Name,
     _In_ ULONG                      Reservation,
     _In_ XENBUS_CACHE_ACQUIRE_LOCK  AcquireLock,
     _In_ XENBUS_CACHE_RELEASE_LOCK  ReleaseLock,
@@ -99,7 +99,7 @@ typedef NTSTATUS
 typedef NTSTATUS
 (*XENBUS_GNTTAB_CREATE_CACHE)(
     _In_ PINTERFACE                 Interface,
-    _In_ const CHAR                 *Name,
+    _In_ PCSTR                      Name,
     _In_ ULONG                      Reservation,
     _In_ ULONG                      Cap,
     _In_ XENBUS_CACHE_ACQUIRE_LOCK  AcquireLock,
diff --git a/include/range_set_interface.h b/include/range_set_interface.h
index 7b18eb9..dc19a45 100644
--- a/include/range_set_interface.h
+++ b/include/range_set_interface.h
@@ -77,7 +77,7 @@ typedef VOID
 typedef NTSTATUS
 (*XENBUS_RANGE_SET_CREATE)(
     _In_ PINTERFACE         Interface,
-    _In_ const CHAR                 *Name,
+    _In_ PCSTR              Name,
     _Out_ PXENBUS_RANGE_SET *RangeSet
     );
 
diff --git a/include/store_interface.h b/include/store_interface.h
index 4521ba7..dbc383d 100644
--- a/include/store_interface.h
+++ b/include/store_interface.h
@@ -97,7 +97,7 @@ typedef VOID
 typedef VOID
 (*XENBUS_STORE_FREE)(
     _In_ PINTERFACE Interface,
-    _In_ PCHAR      Buffer
+    _In_ PSTR       Buffer
     );
 
 /*! \typedef XENBUS_STORE_READ
@@ -118,9 +118,9 @@ typedef NTSTATUS
 (*XENBUS_STORE_READ)(
     _In_ PINTERFACE                     Interface,
     _In_opt_ PXENBUS_STORE_TRANSACTION  Transaction,
-    _In_opt_ PCHAR                      Prefix,
-    _In_ PCHAR                          Node,
-    _Out_ PCHAR                         *Buffer
+    _In_opt_ PSTR                       Prefix,
+    _In_ PSTR                           Node,
+    _Outptr_result_z_ PSTR              *Buffer
     );
 
 /*! \typedef XENBUS_STORE_PRINTF
@@ -141,9 +141,9 @@ typedef NTSTATUS
 (*XENBUS_STORE_PRINTF)(
     _In_ PINTERFACE                     Interface,
     _In_opt_ PXENBUS_STORE_TRANSACTION  Transaction,
-    _In_opt_ PCHAR                      Prefix,
-    _In_ PCHAR                          Node,
-    _In_ const CHAR                     *Format,
+    _In_opt_ PSTR                       Prefix,
+    _In_ PSTR                           Node,
+    _In_ PCSTR                          Format,
     ...
     );
 
@@ -161,8 +161,8 @@ typedef NTSTATUS
 (*XENBUS_STORE_REMOVE)(
     _In_ PINTERFACE                     Interface,
     _In_opt_ PXENBUS_STORE_TRANSACTION  Transaction,
-    _In_opt_ PCHAR                      Prefix,
-    _In_ PCHAR                          Node
+    _In_opt_ PSTR                       Prefix,
+    _In_ PSTR                           Node
     );
 
 /*! \typedef XENBUS_STORE_DIRECTORY
@@ -183,9 +183,9 @@ typedef NTSTATUS
 (*XENBUS_STORE_DIRECTORY)(
     _In_ PINTERFACE                     Interface,
     _In_opt_ PXENBUS_STORE_TRANSACTION  Transaction,
-    _In_opt_ PCHAR                      Prefix,
-    _In_ PCHAR                          Node,
-    _Out_ PCHAR                         *Buffer
+    _In_opt_ PSTR                       Prefix,
+    _In_ PSTR                           Node,
+    _Outptr_result_z_ PSTR              *Buffer
     );
 
 /*! \typedef XENBUS_STORE_TRANSACTION_START
@@ -232,8 +232,8 @@ typedef NTSTATUS
 typedef NTSTATUS
 (*XENBUS_STORE_WATCH_ADD)(
     _In_ PINTERFACE             Interface,
-    _In_opt_ PCHAR              Prefix,
-    _In_ PCHAR                  Node,
+    _In_opt_ PSTR               Prefix,
+    _In_ PSTR                   Node,
     _In_ PKEVENT                Event,
     _Out_ PXENBUS_STORE_WATCH   *Watch
     );
@@ -281,8 +281,8 @@ typedef NTSTATUS
 (*XENBUS_STORE_PERMISSIONS_SET)(
     _In_ PINTERFACE                     Interface,
     _In_opt_ PXENBUS_STORE_TRANSACTION  Transaction,
-    _In_opt_ PCHAR                      Prefix,
-    _In_ PCHAR                          Node,
+    _In_opt_ PSTR                       Prefix,
+    _In_ PSTR                           Node,
     _In_ PXENBUS_STORE_PERMISSION       Permissions,
     _In_ ULONG                          NumberPermissions
     );
diff --git a/include/unplug_interface.h b/include/unplug_interface.h
index 7b030e7..249a873 100644
--- a/include/unplug_interface.h
+++ b/include/unplug_interface.h
@@ -118,7 +118,7 @@ typedef BOOLEAN
 typedef VOID
 (*XENBUS_UNPLUG_REBOOT)(
     _In_ PINTERFACE                 Interface,
-    _In_ PCHAR                      Module
+    _In_ PSTR                       Module
     );
 
 // {73db6517-3d06-4937-989f-199b7501e229}
diff --git a/include/xen.h b/include/xen.h
index 1ba109c..ce78f86 100644
--- a/include/xen.h
+++ b/include/xen.h
@@ -69,7 +69,7 @@
 XEN_API
 NTSTATUS
 XenTouch(
-    _In_ const CHAR *Name,
+    _In_ PCSTR      Name,
     _In_ ULONG      MajorVersion,
     _In_ ULONG      MinorVersion,
     _In_ ULONG      MicroVersion,
@@ -338,7 +338,7 @@ _Check_return_
 XEN_API
 NTSTATUS
 XenVersionExtra(
-    _Out_writes_(XEN_EXTRAVERSION_LEN) PCHAR    Extra
+    _Out_writes_z_(XEN_EXTRAVERSION_LEN) PSTR   Extra
     );
 
 // MODULE
@@ -346,9 +346,9 @@ XenVersionExtra(
 XEN_API
 VOID
 ModuleLookup(
-    _In_ ULONG_PTR      Address,
-    _Out_ PCHAR         *Name,
-    _Out_ PULONG_PTR    Offset
+    _In_ ULONG_PTR          Address,
+    _Outptr_result_z_ PSTR  *Name,
+    _Out_ PULONG_PTR        Offset
     );
 
 // UNPLUG
@@ -399,7 +399,7 @@ VOID
 LogCchVPrintf(
     _In_ LOG_LEVEL  Level,
     _In_ ULONG      Count,
-    _In_ const CHAR *Format,
+    _In_ PCSTR      Format,
     _In_ va_list    Arguments
     );
 
@@ -407,7 +407,7 @@ XEN_API
 VOID
 LogVPrintf(
     _In_ LOG_LEVEL  Level,
-    _In_ const CHAR *Format,
+    _In_ PCSTR      Format,
     _In_ va_list    Arguments
     );
 
@@ -416,7 +416,7 @@ VOID
 LogCchPrintf(
     _In_ LOG_LEVEL  Level,
     _In_ ULONG      Count,
-    _In_ const CHAR *Format,
+    _In_ PCSTR      Format,
     ...
     );
 
@@ -424,7 +424,7 @@ XEN_API
 VOID
 LogPrintf(
     _In_ LOG_LEVEL  Level,
-    _In_ const CHAR *Format,
+    _In_ PCSTR      Format,
     ...
     );
 
@@ -438,7 +438,7 @@ XEN_API
 NTSTATUS
 LogReadLogLevel(
     _In_ HANDLE         Key,
-    _In_ PCHAR          Name,
+    _In_ PSTR           Name,
     _Out_ PLOG_LEVEL    LogLevel
     );
 
@@ -448,7 +448,7 @@ XEN_API
 NTSTATUS
 LogAddDisposition(
     _In_ LOG_LEVEL          Mask,
-    _In_ VOID               (*Function)(PVOID, PCHAR, ULONG),
+    _In_ VOID               (*Function)(PVOID, PSTR, ULONG),
     _In_opt_ PVOID          Argument,
     _Out_ PLOG_DISPOSITION  *Disposition
     );
@@ -545,24 +545,24 @@ FiltersUninstall(
 XEN_API
 NTSTATUS
 ConfigGetActive(
-    _In_ const CHAR *Key,
-    _Out_ PCHAR     *Value
+    _In_ PCSTR              Key,
+    _Outptr_result_z_ PSTR  *Value
     );
 
 XEN_API
 NTSTATUS
 ConfigSetActive(
-    _In_ PCHAR  DeviceID,
-    _In_ PCHAR  InstanceID,
-    _In_ PCHAR  LocationInformation
+    _In_ PSTR   DeviceID,
+    _In_ PSTR   InstanceID,
+    _In_ PSTR   LocationInformation
     );
 
 XEN_API
 NTSTATUS
 ConfigUpdateActive(
-    _In_ PCHAR  DeviceID,
-    _In_ PCHAR  InstanceID,
-    _In_ PCHAR  LocationInformation
+    _In_ PSTR   DeviceID,
+    _In_ PSTR   InstanceID,
+    _In_ PSTR   LocationInformation
     );
 
 XEN_API
@@ -575,13 +575,13 @@ XEN_API
 NTSTATUS
 ConfigRequestReboot(
     _In_ HANDLE     ParametersKey,
-    _In_ PCHAR      Module
+    _In_ PSTR       Module
     );
 
 XEN_API
 NTSTATUS
 ConfigQuerySystemStartOption(
-    _In_ PCHAR          Key,
+    _In_ PSTR           Key,
     _Out_ PANSI_STRING  *Option
     );
 
diff --git a/src/common/assert.h b/src/common/assert.h
index 6c6ee28..1c1104d 100644
--- a/src/common/assert.h
+++ b/src/common/assert.h
@@ -58,8 +58,8 @@ __Bug(
 
 #define BUG(_TEXT)                                              \
         do {                                                    \
-            const CHAR  *_Text = (_TEXT);                       \
-            const CHAR  *_File = __FILE__;                      \
+            PCSTR       _Text = (_TEXT);                       \
+            PCSTR       _File = __FILE__;                      \
             ULONG       _Line = __LINE__;                       \
                                                                 \
             Error("BUG: " _TEXT "\n");                          \
@@ -154,8 +154,8 @@ __Bug(
 
 static __inline BOOLEAN
 _IsZeroMemory(
-    _In_ const PCHAR    Caller,
-    _In_ const PCHAR    Name,
+    _In_ const PSTR     Caller,
+    _In_ const PSTR     Name,
     _In_ PVOID          Buffer,
     _In_ ULONG          Length
     )
@@ -178,8 +178,8 @@ _IsZeroMemory(
 
 static __inline BOOLEAN
 _IsZeroMemory(
-    _In_ const PCHAR    Caller,
-    _In_ const PCHAR    Name,
+    _In_ const PSTR     Caller,
+    _In_ const PSTR     Name,
     _In_ PVOID          Buffer,
     _In_ ULONG          Length
     )
diff --git a/src/common/dbg_print.h b/src/common/dbg_print.h
index 372fd7b..a35f51d 100644
--- a/src/common/dbg_print.h
+++ b/src/common/dbg_print.h
@@ -44,8 +44,8 @@
 
 static __inline VOID
 __Error(
-    _In_ const CHAR *Prefix,
-    _In_ const CHAR *Format,
+    _In_ PCSTR      Prefix,
+    _In_ PCSTR      Format,
     ...
     )
 {
@@ -67,8 +67,8 @@ __Error(
 
 static __inline VOID
 __Warning(
-    _In_ const CHAR *Prefix,
-    _In_ const CHAR *Format,
+    _In_ PCSTR      Prefix,
+    _In_ PCSTR      Format,
     ...
     )
 {
@@ -91,8 +91,8 @@ __Warning(
 #if DBG
 static __inline VOID
 __Trace(
-    _In_ const CHAR *Prefix,
-    _In_ const CHAR *Format,
+    _In_ PCSTR      Prefix,
+    _In_ PCSTR      Format,
     ...
     )
 {
@@ -117,8 +117,8 @@ __Trace(
 
 static __inline VOID
 __Info(
-    _In_ const CHAR *Prefix,
-    _In_ const CHAR *Format,
+    _In_ PCSTR      Prefix,
+    _In_ PCSTR      Format,
     ...
     )
 {
diff --git a/src/common/names.h b/src/common/names.h
index a7af965..912fd4d 100644
--- a/src/common/names.h
+++ b/src/common/names.h
@@ -36,7 +36,7 @@
 #include <ntddk.h>
 #include <xen.h>
 
-static FORCEINLINE const CHAR *
+static FORCEINLINE PCSTR
 PowerStateTypeName(
     _In_ POWER_STATE_TYPE   Type
     )
@@ -56,7 +56,7 @@ PowerStateTypeName(
 #undef  _POWER_ACTION_NAME
 }
 
-static FORCEINLINE const CHAR *
+static FORCEINLINE PCSTR
 SystemPowerStateName(
     _In_ SYSTEM_POWER_STATE State
     )
@@ -82,7 +82,7 @@ SystemPowerStateName(
 #undef  _POWER_SYSTEM_STATE_NAME
 }
 
-static FORCEINLINE const CHAR *
+static FORCEINLINE PCSTR
 DevicePowerStateName(
     _In_ DEVICE_POWER_STATE State
     )
@@ -106,7 +106,7 @@ DevicePowerStateName(
 #undef  _POWER_DEVICE_STATE_NAME
 }
 
-static FORCEINLINE const CHAR *
+static FORCEINLINE PCSTR
 PowerActionName(
     _In_ POWER_ACTION   Type
     )
@@ -132,7 +132,7 @@ PowerActionName(
 #undef  _POWER_ACTION_NAME
 }
 
-static FORCEINLINE const CHAR *
+static FORCEINLINE PCSTR
 PowerMinorFunctionName(
     _In_ ULONG  MinorFunction
     )
@@ -154,7 +154,7 @@ PowerMinorFunctionName(
 #undef  _POWER_MINOR_FUNCTION_NAME
 }
 
-static FORCEINLINE const CHAR *
+static FORCEINLINE PCSTR
 PnpMinorFunctionName(
     _In_ ULONG  Function
     )
@@ -197,7 +197,7 @@ PnpMinorFunctionName(
 #undef  _PNP_MINOR_FUNCTION_NAME
 }
 
-static FORCEINLINE const CHAR *
+static FORCEINLINE PCSTR
 ResourceDescriptorTypeName(
     _In_ UCHAR  Type
     )
@@ -226,7 +226,7 @@ ResourceDescriptorTypeName(
 #undef  _RESOURCE_DESCRIPTOR_TYPE_NAME
 }
 
-static FORCEINLINE const CHAR *
+static FORCEINLINE PCSTR
 ResourceDescriptorShareDispositionName(
     _In_ UCHAR  Disposition
     )
@@ -249,7 +249,7 @@ ResourceDescriptorShareDispositionName(
 #undef  _RESOURCE_DESCRIPTOR_SHARE_DISPOSITION_NAME
 }
 
-static FORCEINLINE const CHAR *
+static FORCEINLINE PCSTR
 IrqDevicePolicyName(
     _In_ IRQ_DEVICE_POLICY  Policy
     )
@@ -274,7 +274,7 @@ IrqDevicePolicyName(
 #undef  _IRQ_DEVICE_POLICY_NAME
 }
 
-static FORCEINLINE const CHAR *
+static FORCEINLINE PCSTR
 IrqPriorityName(
     _In_ IRQ_PRIORITY   Priority
     )
@@ -297,7 +297,7 @@ IrqPriorityName(
 #undef  _IRQ_PRIORITY_NAME
 }
 
-static FORCEINLINE const CHAR *
+static FORCEINLINE PCSTR
 InterruptModeName(
     _In_ KINTERRUPT_MODE    Mode
     )
@@ -318,7 +318,7 @@ InterruptModeName(
 #undef  _INTERRUPT_MODE_NAME
 }
 
-static FORCEINLINE const CHAR *
+static FORCEINLINE PCSTR
 DeviceUsageNotificationTypeName(
     _In_ DEVICE_USAGE_NOTIFICATION_TYPE Type
     )
@@ -340,7 +340,7 @@ DeviceUsageNotificationTypeName(
 #undef  _DEVICE_USAGE_TYPE_NAME
 }
 
-static FORCEINLINE const CHAR *
+static FORCEINLINE PCSTR
 InterfaceTypeName(
     _In_ INTERFACE_TYPE Type
     )
@@ -378,7 +378,7 @@ InterfaceTypeName(
 #undef  _INTERFACE_TYPE_NAME
 }
 
-static FORCEINLINE const CHAR *
+static FORCEINLINE PCSTR
 DmaWidthName(
     _In_ DMA_WIDTH  Width
     )
@@ -402,7 +402,7 @@ DmaWidthName(
 #undef  _DMA_WIDTH_NAME
 }
 
-static FORCEINLINE const CHAR *
+static FORCEINLINE PCSTR
 DmaSpeedName(
     _In_ DMA_SPEED  Speed
     )
@@ -427,7 +427,7 @@ DmaSpeedName(
 #undef  _DMA_SPEED_NAME
 }
 
-static FORCEINLINE const CHAR *
+static FORCEINLINE PCSTR
 BusQueryIdTypeName(
     _In_ BUS_QUERY_ID_TYPE  Type
     )
@@ -452,7 +452,7 @@ BusQueryIdTypeName(
 #undef  _BUS_QUERY_ID_TYPE_NAME
 }
 
-static FORCEINLINE const CHAR *
+static FORCEINLINE PCSTR
 ProcessorChangeName(
     _In_ KE_PROCESSOR_CHANGE_NOTIFY_STATE   Change
     )
@@ -474,7 +474,7 @@ ProcessorChangeName(
 #undef _PROCESSOR_CHANGE_NAME
 }
 
-static FORCEINLINE const CHAR *
+static FORCEINLINE PCSTR
 VirqName(
     _In_ ULONG  Type
     )
diff --git a/src/common/registry.c b/src/common/registry.c
index 6a8c73e..51a98bb 100644
--- a/src/common/registry.c
+++ b/src/common/registry.c
@@ -188,15 +188,15 @@ fail1:
 
 static NTSTATUS
 RegistryOpenRoot(
-    _In_ PWCHAR         Path,
-    _Out_ PHANDLE       Parent,
-    _Out_ PWCHAR        *ChildPath
+    _In_ PWSTR              Path,
+    _Out_ PHANDLE           Parent,
+    _Outptr_result_z_ PWSTR *ChildPath
     )
 {
-    const WCHAR         Prefix[] = L"\\Registry\\Machine\\";
-    ULONG               Length;
-    UNICODE_STRING      Unicode;
-    NTSTATUS            status;
+    PCWSTR                  Prefix = L"\\Registry\\Machine\\";
+    ULONG                   Length;
+    UNICODE_STRING          Unicode;
+    NTSTATUS                status;
 
     Length = (ULONG)wcslen(Prefix);
 
@@ -227,11 +227,11 @@ RegistryCreateKey(
     _Out_ PHANDLE           Key
     )
 {
-    PWCHAR              Buffer;
+    PWSTR               Buffer;
     HANDLE              Root;
-    PWCHAR              ChildPath;
-    PWCHAR              ChildName;
-    PWCHAR              Context;
+    PWSTR               ChildPath;
+    PWSTR               ChildName;
+    PWSTR               Context;
     HANDLE              Child;
     NTSTATUS            status;
 
@@ -368,7 +368,7 @@ RegistryOpenHardwareKey(
     HANDLE                  SubKey;
     ULONG                   Length;
     PKEY_NAME_INFORMATION   Info;
-    PWCHAR                  Cursor;
+    PWSTR                   Cursor;
     UNICODE_STRING          Unicode;
     NTSTATUS                status;
 
@@ -438,7 +438,7 @@ fail1:
 NTSTATUS
 RegistryOpenSubKey(
     _In_opt_ PHANDLE    Key,
-    _In_ PCHAR          Name,
+    _In_ PSTR           Name,
     _In_ ACCESS_MASK    DesiredAccess,
     _Out_ PHANDLE       SubKey
     )
@@ -471,7 +471,7 @@ fail1:
 NTSTATUS
 RegistryCreateSubKey(
     _In_opt_ HANDLE     Key,
-    _In_ PCHAR          Name,
+    _In_ PSTR           Name,
     _In_ ULONG          Options,
     _Out_ PHANDLE       SubKey
     )
@@ -504,7 +504,7 @@ fail1:
 NTSTATUS
 RegistryDeleteSubKey(
     _In_ PHANDLE        Key,
-    _In_ PCHAR          Name
+    _In_ PSTR           Name
     )
 {
     ANSI_STRING         Ansi;
@@ -756,7 +756,7 @@ fail1:
 NTSTATUS
 RegistryDeleteValue(
     _In_ PHANDLE        Key,
-    _In_ PCHAR          Name
+    _In_ PSTR           Name
     )
 {
     ANSI_STRING         Ansi;
@@ -787,7 +787,7 @@ fail1:
 NTSTATUS
 RegistryQueryDwordValue(
     _In_ HANDLE                     Key,
-    _In_ PCHAR                      Name,
+    _In_ PSTR                       Name,
     _Out_ PULONG                    Value
     )
 {
@@ -857,7 +857,7 @@ fail1:
 NTSTATUS
 RegistryUpdateDwordValue(
     _In_ HANDLE                     Key,
-    _In_ PCHAR                      Name,
+    _In_ PSTR                       Name,
     _In_ ULONG                      Value
     )
 {
@@ -912,7 +912,7 @@ fail1:
 
 static PANSI_STRING
 RegistrySzToAnsi(
-    _In_ PWCHAR     Buffer
+    _In_ PWSTR      Buffer
     )
 {
     PANSI_STRING    Ansi;
@@ -951,7 +951,7 @@ fail1:
 
 static PANSI_STRING
 RegistryMultiSzToAnsi(
-    _In_ PWCHAR     Buffer
+    _In_ PWSTR      Buffer
     )
 {
     PANSI_STRING    Ansi;
@@ -1014,7 +1014,7 @@ fail1:
 NTSTATUS
 RegistryQuerySzValue(
     _In_ HANDLE                     Key,
-    _In_ PCHAR                      Name,
+    _In_ PSTR                       Name,
     _Out_opt_ PULONG                Type,
     _Out_ PANSI_STRING              *Array
     )
@@ -1060,12 +1060,12 @@ RegistryQuerySzValue(
     switch (Value->Type) {
     case REG_SZ:
         status = STATUS_NO_MEMORY;
-        *Array = RegistrySzToAnsi((PWCHAR)Value->Data);
+        *Array = RegistrySzToAnsi((PWSTR)Value->Data);
         break;
 
     case REG_MULTI_SZ:
         status = STATUS_NO_MEMORY;
-        *Array = RegistryMultiSzToAnsi((PWCHAR)Value->Data);
+        *Array = RegistryMultiSzToAnsi((PWSTR)Value->Data);
         break;
 
     default:
@@ -1101,7 +1101,7 @@ fail1:
 NTSTATUS
 RegistryQueryBinaryValue(
     _In_ HANDLE                     Key,
-    _In_ PCHAR                      Name,
+    _In_ PSTR                       Name,
     _Out_ PVOID                     *Buffer,
     _Out_ PULONG                    Length
     )
@@ -1186,7 +1186,7 @@ fail1:
 NTSTATUS
 RegistryUpdateBinaryValue(
     _In_ HANDLE                     Key,
-    _In_ PCHAR                      Name,
+    _In_ PSTR                       Name,
     _In_ PVOID                      Buffer,
     _In_ ULONG                      Length
     )
@@ -1276,7 +1276,7 @@ RegistryQueryKeyName(
         goto fail3;
 
     Value->Name[Value->NameLength / sizeof (WCHAR)] = L'\0';
-    *Array = RegistrySzToAnsi((PWCHAR)Value->Name);
+    *Array = RegistrySzToAnsi((PWSTR)Value->Name);
 
     status = STATUS_NO_MEMORY;
     if (*Array == NULL)
@@ -1297,7 +1297,7 @@ fail1:
 
 NTSTATUS
 RegistryQuerySystemStartOption(
-    _In_ PCHAR                      Prefix,
+    _In_ PSTR                       Prefix,
     _Out_ PANSI_STRING              *Value
     )
 {
@@ -1305,8 +1305,8 @@ RegistryQuerySystemStartOption(
     HANDLE                          Key;
     PANSI_STRING                    Ansi;
     ULONG                           Length;
-    PCHAR                           Option;
-    PCHAR                           Context;
+    PSTR                            Option;
+    PSTR                            Context;
     NTSTATUS                        status;
 
     RtlInitUnicodeString(&Unicode, 
L"\\Registry\\Machine\\SYSTEM\\CurrentControlSet\\Control");
@@ -1468,7 +1468,7 @@ fail1:
 NTSTATUS
 RegistryUpdateSzValue(
     _In_ HANDLE                     Key,
-    _In_ PCHAR                      Name,
+    _In_ PSTR                       Name,
     _In_ ULONG                      Type,
     _In_ PANSI_STRING               Array
     )
diff --git a/src/common/registry.h b/src/common/registry.h
index dd4e035..a65081f 100644
--- a/src/common/registry.h
+++ b/src/common/registry.h
@@ -96,7 +96,7 @@ RegistryOpenHardwareKey(
 extern NTSTATUS
 RegistryOpenSubKey(
     _In_opt_ HANDLE     Key,
-    _In_ PCHAR          Name,
+    _In_ PSTR           Name,
     _In_ ACCESS_MASK    DesiredAccess,
     _Out_ PHANDLE       SubKey
     );
@@ -104,7 +104,7 @@ RegistryOpenSubKey(
 extern NTSTATUS
 RegistryCreateSubKey(
     _In_opt_ HANDLE Key,
-    _In_ PCHAR      Name,
+    _In_ PSTR       Name,
     _In_ ULONG      Options,
     _Out_ PHANDLE   SubKey
     );
@@ -112,7 +112,7 @@ RegistryCreateSubKey(
 extern NTSTATUS
 RegistryDeleteSubKey(
     _In_ HANDLE     Key,
-    _In_ PCHAR      Name
+    _In_ PSTR       Name
     );
 
 extern NTSTATUS
@@ -132,27 +132,27 @@ RegistryEnumerateValues(
 extern NTSTATUS
 RegistryDeleteValue(
     _In_ HANDLE     Key,
-    _In_ PCHAR      Name
+    _In_ PSTR       Name
     );
 
 extern NTSTATUS
 RegistryQueryDwordValue(
     _In_ HANDLE         Key,
-    _In_ PCHAR          Name,
+    _In_ PSTR           Name,
     _Out_ PULONG        Value
     );
 
 extern NTSTATUS
 RegistryUpdateDwordValue(
     _In_ HANDLE         Key,
-    _In_ PCHAR          Name,
+    _In_ PSTR           Name,
     _In_ ULONG          Value
     );
 
 extern NTSTATUS
 RegistryQuerySzValue(
     _In_ HANDLE         Key,
-    _In_ PCHAR          Name,
+    _In_ PSTR           Name,
     _Out_opt_ PULONG    Type,
     _Out_ PANSI_STRING  *Array
     );
@@ -160,7 +160,7 @@ RegistryQuerySzValue(
 extern NTSTATUS
 RegistryQueryBinaryValue(
     _In_ HANDLE         Key,
-    _In_ PCHAR          Name,
+    _In_ PSTR           Name,
     _Out_ PVOID         *Buffer,
     _Out_ PULONG        Length
     );
@@ -168,7 +168,7 @@ RegistryQueryBinaryValue(
 extern NTSTATUS
 RegistryUpdateBinaryValue(
     _In_ HANDLE         Key,
-    _In_ PCHAR          Name,
+    _In_ PSTR           Name,
     _In_ PVOID          Buffer,
     _In_ ULONG          Length
     );
@@ -181,7 +181,7 @@ RegistryQueryKeyName(
 
 extern NTSTATUS
 RegistryQuerySystemStartOption(
-    _In_ PCHAR          Name,
+    _In_ PSTR           Name,
     _Out_ PANSI_STRING  *Option
     );
 
@@ -198,7 +198,7 @@ RegistryFreeBinaryValue(
 extern NTSTATUS
 RegistryUpdateSzValue(
     _In_ HANDLE         Key,
-    _In_ PCHAR          Name,
+    _In_ PSTR           Name,
     _In_ ULONG          Type,
     _In_ PANSI_STRING   Array
     );
diff --git a/src/common/util.h b/src/common/util.h
index a658adb..9398daa 100644
--- a/src/common/util.h
+++ b/src/common/util.h
@@ -274,15 +274,15 @@ __FreePages(
 
 #define __FreePage(_Mdl)    __FreePages(_Mdl)
 
-static FORCEINLINE PCHAR
+static FORCEINLINE PSTR
 __strtok_r(
-    _In_opt_ PCHAR  Buffer,
-    _In_ PCHAR      Delimiter,
-    _Inout_ PCHAR   *Context
+    _In_opt_ PSTR   Buffer,
+    _In_ PSTR       Delimiter,
+    _Inout_ PSTR    *Context
     )
 {
-    PCHAR           Token;
-    PCHAR           End;
+    PSTR            Token;
+    PSTR            End;
 
     if (Buffer != NULL)
         *Context = Buffer;
@@ -312,15 +312,15 @@ __strtok_r(
     return Token;
 }
 
-static FORCEINLINE PWCHAR
+static FORCEINLINE PWSTR
 __wcstok_r(
-    _In_opt_ PWCHAR Buffer,
-    _In_ PWCHAR     Delimiter,
-    _Inout_ PWCHAR  *Context
+    _In_opt_ PWSTR  Buffer,
+    _In_ PWSTR      Delimiter,
+    _Inout_ PWSTR   *Context
     )
 {
-    PWCHAR          Token;
-    PWCHAR          End;
+    PWSTR           Token;
+    PWSTR           End;
 
     if (Buffer != NULL)
         *Context = Buffer;
diff --git a/src/monitor/monitor.c b/src/monitor/monitor.c
index 532436d..f6e39f8 100644
--- a/src/monitor/monitor.c
+++ b/src/monitor/monitor.c
@@ -61,18 +61,18 @@ typedef struct _MONITOR_CONTEXT {
     HANDLE                  RequestEvent;
     HANDLE                  Timer;
     HKEY                    RequestKey;
-    PTCHAR                  Title;
-    PTCHAR                  Text;
-    PTCHAR                  Question;
+    PTSTR                   Title;
+    PTSTR                   Text;
+    PTSTR                   Question;
     BOOL                    RebootPrompted;
-    PTCHAR                  RebootRequestedBy;
+    PTSTR                   RebootRequestedBy;
     HANDLE                  ResponseEvent;
     DWORD                   Response;
 } MONITOR_CONTEXT, *PMONITOR_CONTEXT;
 
 typedef struct _REBOOT_PROMPT {
-    PTCHAR                  Title;
-    PTCHAR                  Text;
+    PTSTR                   Title;
+    PTSTR                   Text;
     HANDLE                  ResponseEvent;
     PDWORD                  PResponse;
 } REBOOT_PROMPT, *PREBOOT_PROMPT;
@@ -93,7 +93,7 @@ MONITOR_CONTEXT MonitorContext;
 static VOID
 #pragma prefast(suppress:6262) // Function uses '1036' bytes of stack: exceeds 
/analyze:stacksize'1024'
 __Log(
-    _In_ const CHAR     *Format,
+    _In_ PCSTR          Format,
     ...
     )
 {
@@ -146,12 +146,12 @@ __Log(
 #define Log(_Format, ...) \
         __Log(__MODULE__ "|" __FUNCTION__ ": " _Format, __VA_ARGS__)
 
-static PTCHAR
+static PTSTR
 GetErrorMessage(
     _In_  HRESULT   Error
     )
 {
-    PTCHAR          Message;
+    PTSTR           Message;
     ULONG           Index;
 
     if (!FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
@@ -175,7 +175,7 @@ GetErrorMessage(
     return Message;
 }
 
-static const CHAR *
+static PCSTR
 ServiceStateName(
     _In_ DWORD  State
     )
@@ -241,7 +241,7 @@ fail1:
     Error = GetLastError();
 
     {
-        PTCHAR  Message;
+        PTSTR   Message;
         Message = GetErrorMessage(Error);
         Log("fail1 (%s)", Message);
         LocalFree(Message);
@@ -285,7 +285,7 @@ MonitorCtrlHandlerEx(
     return ERROR_CALL_NOT_IMPLEMENTED;
 }
 
-static const CHAR *
+static PCSTR
 WTSStateName(
     _In_ DWORD  State
     )
@@ -316,7 +316,7 @@ WTSStateName(
 
 static VOID
 DoReboot(
-    _In_ PTCHAR Message,
+    _In_ PTSTR  Message,
     _In_ DWORD  Timeout
     )
 {
@@ -365,9 +365,9 @@ GetPromptTimeout(
     return Value;
 }
 
-static PTCHAR
+static PTSTR
 GetDisplayName(
-    _In_ PTCHAR         DriverName
+    _In_ PTSTR          DriverName
     )
 {
     HRESULT             Result;
@@ -376,7 +376,7 @@ GetDisplayName(
     DWORD               MaxValueLength;
     DWORD               Type;
     DWORD               DisplayNameLength;
-    PTCHAR              DisplayName;
+    PTSTR               DisplayName;
     HRESULT             Error;
 
     Result = StringCbPrintf(ServiceKeyName,
@@ -458,7 +458,7 @@ fail1:
     Error = GetLastError();
 
     {
-        PTCHAR  Message;
+        PTSTR   Message;
         Message = GetErrorMessage(Error);
         Log("fail1 (%s)", Message);
         LocalFree(Message);
@@ -521,7 +521,7 @@ DoPromptForReboot(
 
     for (Index = 0; Index < Count; Index++) {
         DWORD                   SessionId = SessionInfo[Index].SessionId;
-        PTCHAR                  Name = SessionInfo[Index].pWinStationName;
+        PTSTR                   Name = SessionInfo[Index].pWinStationName;
         WTS_CONNECTSTATE_CLASS  State = SessionInfo[Index].State;
         DWORD                   Response;
 
@@ -570,14 +570,14 @@ fail1:
 
 static VOID
 PromptForReboot(
-    _In_ PTCHAR         DriverName
+    _In_ PTSTR          DriverName
     )
 {
     PMONITOR_CONTEXT    Context = &MonitorContext;
     HRESULT             Result;
     PREBOOT_PROMPT      Prompt;
-    PTCHAR              DisplayName;
-    PTCHAR              Description;
+    PTSTR               DisplayName;
+    PTSTR               Description;
     HANDLE              PromptThread;
     DWORD               TextLength;
     DWORD               Error;
@@ -670,7 +670,7 @@ fail2:
 
 fail1:
     {
-        PTCHAR  Message;
+        PTSTR   Message;
         Message = GetErrorMessage(Error);
         Log("fail1 (%s)", Message);
         LocalFree(Message);
@@ -681,7 +681,7 @@ fail1:
 
 static VOID
 TryAutoReboot(
-    _In_ PTCHAR         DriverName
+    _In_ PTSTR          DriverName
     )
 {
     PMONITOR_CONTEXT    Context = &MonitorContext;
@@ -692,9 +692,9 @@ TryAutoReboot(
     DWORD               RebootCount;
     DWORD               Length;
     DWORD               Timeout;
-    PTCHAR              DisplayName;
-    PTCHAR              Description;
-    PTCHAR              Text;
+    PTSTR               DisplayName;
+    PTSTR               Description;
+    PTSTR               Text;
     DWORD               TextLength;
     ULONG               PowerInfo;
     NTSTATUS            Status;
@@ -847,7 +847,7 @@ fail2:
 
 fail1:
     {
-        PTCHAR  Message;
+        PTSTR   Message;
         Message = GetErrorMessage(Error);
         Log("fail1 (%s)", Message);
         LocalFree(Message);
@@ -865,7 +865,7 @@ CheckRequestSubKeys(
     DWORD               SubKeys;
     DWORD               MaxSubKeyLength;
     DWORD               SubKeyLength;
-    PTCHAR              SubKeyName;
+    PTSTR               SubKeyName;
     DWORD               Index;
     HKEY                SubKey;
     HRESULT             Error;
@@ -976,7 +976,7 @@ fail1:
     Error = GetLastError();
 
     {
-        PTCHAR  Message;
+        PTSTR   Message;
         Message = GetErrorMessage(Error);
         Log("fail1 (%s)", Message);
         LocalFree(Message);
@@ -1012,7 +1012,7 @@ fail1:
     Error = GetLastError();
 
     {
-        PTCHAR  Message;
+        PTSTR   Message;
         Message = GetErrorMessage(Error);
         Log("fail1 (%s)", Message);
         LocalFree(Message);
@@ -1077,7 +1077,7 @@ fail1:
     Error = GetLastError();
 
     {
-        PTCHAR  Message;
+        PTSTR   Message;
         Message = GetErrorMessage(Error);
         Log("fail1 (%s)", Message);
         LocalFree(Message);
@@ -1089,14 +1089,14 @@ fail1:
 _Success_(return)
 static BOOL
 GetRequestKeyName(
-    _Out_ PTCHAR        *RequestKeyName
+    _Outptr_result_z_ PTSTR     *RequestKeyName
     )
 {
-    PMONITOR_CONTEXT    Context = &MonitorContext;
-    DWORD               MaxValueLength;
-    DWORD               RequestKeyNameLength;
-    DWORD               Type;
-    HRESULT             Error;
+    PMONITOR_CONTEXT            Context = &MonitorContext;
+    DWORD                       MaxValueLength;
+    DWORD                       RequestKeyNameLength;
+    DWORD                       Type;
+    HRESULT                     Error;
 
     Error = RegQueryInfoKey(Context->ParametersKey,
                             NULL,
@@ -1156,7 +1156,7 @@ fail1:
     Error = GetLastError();
 
     {
-        PTCHAR  Message;
+        PTSTR   Message;
         Message = GetErrorMessage(Error);
         Log("fail1 (%s)", Message);
         LocalFree(Message);
@@ -1300,7 +1300,7 @@ fail1:
     Error = GetLastError();
 
     {
-        PTCHAR  Message;
+        PTSTR   Message;
         Message = GetErrorMessage(Error);
         Log("fail1 (%s)", Message);
         LocalFree(Message);
@@ -1311,7 +1311,7 @@ fail1:
 
 static BOOL
 RemoveStartOverride(
-    _In_ PTCHAR         DriverName
+    _In_ PTSTR          DriverName
     )
 {
     TCHAR               KeyName[MAX_PATH];
@@ -1360,7 +1360,7 @@ fail1:
     Error = GetLastError();
 
     {
-        PTCHAR  Message;
+        PTSTR   Message;
         Message = GetErrorMessage(Error);
         Log("fail1 (%s)", Message);
         LocalFree(Message);
@@ -1376,7 +1376,7 @@ MonitorMain(
     )
 {
     PMONITOR_CONTEXT    Context = &MonitorContext;
-    PTCHAR              RequestKeyName;
+    PTSTR               RequestKeyName;
     BOOL                Success;
     HRESULT             Error;
     LARGE_INTEGER       DueTime;
@@ -1601,7 +1601,7 @@ fail1:
     Error = GetLastError();
 
     {
-        PTCHAR  Message;
+        PTSTR   Message;
         Message = GetErrorMessage(Error);
         Log("fail1 (%s)", Message);
         LocalFree(Message);
@@ -1666,7 +1666,7 @@ fail1:
     Error = GetLastError();
 
     {
-        PTCHAR  Message;
+        PTSTR   Message;
         Message = GetErrorMessage(Error);
         Log("fail1 (%s)", Message);
         LocalFree(Message);
@@ -1738,7 +1738,7 @@ fail1:
     Error = GetLastError();
 
     {
-        PTCHAR  Message;
+        PTSTR   Message;
         Message = GetErrorMessage(Error);
         Log("fail1 (%s)", Message);
         LocalFree(Message);
@@ -1775,7 +1775,7 @@ fail1:
     Error = GetLastError();
 
     {
-        PTCHAR  Message;
+        PTSTR   Message;
         Message = GetErrorMessage(Error);
         Log("fail1 (%s)", Message);
         LocalFree(Message);
diff --git a/src/xen/acpi.c b/src/xen/acpi.c
index a73e822..c5399f0 100644
--- a/src/xen/acpi.c
+++ b/src/xen/acpi.c
@@ -212,7 +212,7 @@ fail1:
 
 NTSTATUS
 AcpiGetTable(
-    _In_ const CHAR     *Signature,
+    _In_ PCSTR          Signature,
     _Out_opt_ PVOID     Buffer,
     _Inout_ PULONG      Length
     )
diff --git a/src/xen/acpi.h b/src/xen/acpi.h
index f6a9f99..2de9765 100644
--- a/src/xen/acpi.h
+++ b/src/xen/acpi.h
@@ -95,7 +95,7 @@ AcpiInitialize(
 
 extern NTSTATUS
 AcpiGetTable(
-    _In_ const CHAR *Signature,
+    _In_ PCSTR      Signature,
     _Out_opt_ PVOID Buffer,
     _Inout_ PULONG  Length
     );
diff --git a/src/xen/bug_check.c b/src/xen/bug_check.c
index 85f9f70..24bedfb 100644
--- a/src/xen/bug_check.c
+++ b/src/xen/bug_check.c
@@ -213,7 +213,7 @@ BugCheckStackDump(
             ULONG       EIP;
             ULONG       Parameter[PARAMETER_COUNT] = {0};
             ULONG       Index;
-            PCHAR       Name;
+            PSTR        Name;
             ULONG       Offset;
 
             NextEBP = *(PULONG)EBP;
@@ -515,7 +515,7 @@ BugCheckStackDump(
             ULONG64             RSP;
             ULONG64             Parameter[PARAMETER_COUNT] = {0};
             ULONG               Index;
-            PCHAR               Name;
+            PSTR                Name;
             ULONG64             Offset;
 
             if (Context->Rip == 0)
@@ -619,7 +619,7 @@ BugCheckIrqlNotLessOrEqual(
         KIRQL       Irql = (KIRQL)Parameter2;
         ULONG_PTR   Access = Parameter3;
         PVOID       Address = (PVOID)Parameter4;
-        PCHAR       Name;
+        PSTR        Name;
         ULONG_PTR   Offset;
 
         LogPrintf(LOG_LEVEL_CRITICAL,
@@ -670,7 +670,7 @@ BugCheckDriverIrqlNotLessOrEqual(
         KIRQL       Irql = (KIRQL)Parameter2;
         ULONG_PTR   Access = Parameter3;
         PVOID       Address = (PVOID)Parameter4;
-        PCHAR       Name;
+        PSTR        Name;
         ULONG_PTR   Offset;
 
         LogPrintf(LOG_LEVEL_CRITICAL,
@@ -743,7 +743,7 @@ BugCheckSystemThreadExceptionNotHandled(
         PVOID               Address = (PVOID)Parameter2;
         PEXCEPTION_RECORD   Exception = (PEXCEPTION_RECORD)Parameter3;
         PCONTEXT            Context = (PCONTEXT)Parameter4;
-        PCHAR               Name;
+        PSTR                Name;
         ULONG_PTR           Offset;
 
         ModuleLookup((ULONG_PTR)Address, &Name, &Offset);
@@ -783,7 +783,7 @@ BugCheckKernelModeExceptionNotHandled(
         CONTEXT     Context;
         ULONG       Code = (ULONG)Parameter1;
         PVOID       Address = (PVOID)Parameter2;
-        PCHAR       Name;
+        PSTR        Name;
         ULONG_PTR      Offset;
 
         UNREFERENCED_PARAMETER(Parameter3);
@@ -829,8 +829,8 @@ BugCheckCriticalObjectTermination(
     __try {
         ULONG       Type = (ULONG)Parameter1;
         PVOID      Object = (PVOID)Parameter2;
-        PCHAR      Name = (PCHAR)Parameter3;
-        PCHAR       Reason = (PCHAR)Parameter4;
+        PSTR       Name = (PSTR)Parameter3;
+        PSTR        Reason = (PSTR)Parameter4;
         CONTEXT     Context;
 
         LogPrintf(LOG_LEVEL_CRITICAL,
@@ -933,7 +933,7 @@ BugCheckDriverPowerStateFailure(
                       __MODULE__);
 
             for (Index = 0; Index <= Irp->StackCount; Index++) {
-                PCHAR       Name;
+                PSTR        Name;
                 ULONG_PTR   Offset;
 
                 LogPrintf(LOG_LEVEL_CRITICAL,
@@ -993,8 +993,8 @@ BugCheckAssertionFailure(
     )
 {
     __try {
-        PCHAR       Text = (PCHAR)Parameter1;
-        PCHAR       File = (PCHAR)Parameter2;
+        PSTR        Text = (PSTR)Parameter1;
+        PSTR        File = (PSTR)Parameter2;
         ULONG       Line = (ULONG)Parameter3;
         CONTEXT     Context;
 
@@ -1041,7 +1041,7 @@ BugCheckBugEFCriticalProcessDied(
         switch (Code) {
         case 0x0: {
             PEPROCESS   EProcess = (PEPROCESS)Parameter1;
-            PCHAR       Name = ProcessGetImageFileName(EProcess);
+            PSTR        Name = ProcessGetImageFileName(EProcess);
 
             if (Name == NULL)
                 Name = "(unknown)";
@@ -1079,7 +1079,7 @@ BugCheckBugEFCriticalProcessDied(
 
 struct _BUG_CODE_ENTRY {
     ULONG       Code;
-    const CHAR  *Name;
+    PCSTR       Name;
     VOID        (*Handler)(ULONG_PTR, ULONG_PTR, ULONG_PTR, ULONG_PTR);
 };
 
diff --git a/src/xen/config.c b/src/xen/config.c
index 45d66c6..c170d3a 100644
--- a/src/xen/config.c
+++ b/src/xen/config.c
@@ -56,15 +56,15 @@
 XEN_API
 NTSTATUS
 ConfigGetActive(
-    _In_ const CHAR *Key,
-    _Out_ PCHAR     *Value
+    _In_ PCSTR              Key,
+    _Outptr_result_z_ PSTR  *Value
     )
 {
-    HANDLE          ActiveKey;
-    CHAR            Name[MAXNAMELEN];
-    PANSI_STRING    Ansi;
-    ULONG           Length;
-    NTSTATUS        status;
+    HANDLE                  ActiveKey;
+    CHAR                    Name[MAXNAMELEN];
+    PANSI_STRING            Ansi;
+    ULONG                   Length;
+    NTSTATUS                status;
 
     Trace("====>\n");
 
@@ -126,13 +126,13 @@ fail1:
 
 static FORCEINLINE BOOLEAN
 __ConfigIsDeviceLegacy(
-    _In_ PCHAR  DeviceID
+    _In_ PSTR   DeviceID
     )
 {
     UNREFERENCED_PARAMETER(DeviceID);
 
 #ifdef VENDOR_DEVICE_ID_STR
-    const CHAR  *VendorDeviceID = "PCI\\VEN_5853&DEV_" VENDOR_DEVICE_ID_STR;
+    PCSTR       VendorDeviceID = "PCI\\VEN_5853&DEV_" VENDOR_DEVICE_ID_STR;
 
     return _strnicmp(DeviceID, VendorDeviceID, strlen(VendorDeviceID)) != 0;
 #endif
@@ -152,7 +152,7 @@ __ConfigIsVendorDevicePresent(
     HANDLE      DeviceKey;
     BOOLEAN     Found;
     NTSTATUS    status;
-    const CHAR  *VendorDeviceID = "PCI\\VEN_5853&DEV_" VENDOR_DEVICE_ID_STR 
"&SUBSYS_C0005853&REV_01";
+    PCSTR       VendorDeviceID = "PCI\\VEN_5853&DEV_" VENDOR_DEVICE_ID_STR 
"&SUBSYS_C0005853&REV_01";
 
     status = RegistryOpenSubKey(NULL,
                                 ENUM_PATH,
@@ -164,7 +164,7 @@ __ConfigIsVendorDevicePresent(
     Found = FALSE;
 
     status = RegistryOpenSubKey(EnumKey,
-                                (PCHAR)VendorDeviceID,
+                                (PSTR)VendorDeviceID,
                                 KEY_READ,
                                 &DeviceKey);
     if (!NT_SUCCESS(status))
@@ -188,9 +188,9 @@ fail1:
 XEN_API
 NTSTATUS
 ConfigSetActive(
-    _In_ PCHAR  DeviceID,
-    _In_ PCHAR  InstanceID,
-    _In_ PCHAR  LocationInformation
+    _In_ PSTR   DeviceID,
+    _In_ PSTR   InstanceID,
+    _In_ PSTR   LocationInformation
     )
 {
     HANDLE      ActiveKey;
@@ -273,15 +273,15 @@ fail1:
 XEN_API
 NTSTATUS
 ConfigUpdateActive(
-    _In_ PCHAR  DeviceID,
-    _In_ PCHAR  InstanceID,
-    _In_ PCHAR  LocationInformation
+    _In_ PSTR   DeviceID,
+    _In_ PSTR   InstanceID,
+    _In_ PSTR   LocationInformation
     )
 {
     HANDLE      ActiveKey;
     ANSI_STRING Ansi[2];
-    PCHAR       ActiveInstanceID;
-    PCHAR       ActiveLocationInformation;
+    PSTR        ActiveInstanceID;
+    PSTR        ActiveLocationInformation;
     NTSTATUS    status;
 
     Trace("====>\n");
@@ -411,7 +411,7 @@ XEN_API
 NTSTATUS
 ConfigRequestReboot(
     _In_ HANDLE     ParametersKey,
-    _In_ PCHAR      Module
+    _In_ PSTR       Module
     )
 {
     PANSI_STRING    Ansi;
@@ -489,7 +489,7 @@ fail1:
 XEN_API
 NTSTATUS
 ConfigQuerySystemStartOption(
-    _In_ PCHAR          Key,
+    _In_ PSTR           Key,
     _Out_ PANSI_STRING  *Option
     )
 {
diff --git a/src/xen/driver.c b/src/xen/driver.c
index 107dc65..48fe169 100644
--- a/src/xen/driver.c
+++ b/src/xen/driver.c
@@ -164,7 +164,7 @@ __DriverGetMemoryKey(
 
 static FORCEINLINE NTSTATUS
 __DriverSetPfnArray(
-    _In_ PCHAR      Name,
+    _In_ PSTR       Name,
     _In_ ULONG      Count,
     _In_ PFN_NUMBER PfnArray[]
     )
@@ -224,7 +224,7 @@ fail1:
 
 static FORCEINLINE NTSTATUS
 __DriverAllocatePfnArray(
-    _In_ PCHAR          Name,
+    _In_ PSTR           Name,
     _In_ ULONG          Count,
     _Out_ PFN_NUMBER    PfnArray[]
     )
@@ -289,7 +289,7 @@ fail1:
 
 static FORCEINLINE NTSTATUS
 __DriverGetPfnArray(
-    _In_ PCHAR                      Name,
+    _In_ PSTR                       Name,
     _In_ ULONG                      Count,
     _Out_writes_(Count) PFN_NUMBER  PfnArray[]
     )
@@ -341,7 +341,7 @@ fail1:
 
 PMDL
 DriverGetNamedPages(
-    _In_ PCHAR  Name,
+    _In_ PSTR   Name,
     _In_ ULONG  Count
     )
 {
@@ -425,7 +425,7 @@ DriverPutNamedPages(
 XEN_API
 NTSTATUS
 XenTouch(
-    _In_ const CHAR *Name,
+    _In_ PCSTR      Name,
     _In_ ULONG      MajorVersion,
     _In_ ULONG      MinorVersion,
     _In_ ULONG      MicroVersion,
@@ -480,7 +480,7 @@ fail1:
 static VOID
 DriverOutputBuffer(
     _In_ PVOID  Argument,
-    _In_ PCHAR  Buffer,
+    _In_ PSTR   Buffer,
     _In_ ULONG  Length
     )
 {
diff --git a/src/xen/driver.h b/src/xen/driver.h
index 6806886..21df779 100644
--- a/src/xen/driver.h
+++ b/src/xen/driver.h
@@ -45,7 +45,7 @@ DriverGetUnplugKey(
 
 extern PMDL
 DriverGetNamedPages(
-    _In_ PCHAR  Name,
+    _In_ PSTR   Name,
     _In_ ULONG  Count
     );
 
diff --git a/src/xen/filters.c b/src/xen/filters.c
index b643404..46324ea 100644
--- a/src/xen/filters.c
+++ b/src/xen/filters.c
@@ -67,9 +67,9 @@ __FiltersFree(
 
 static NTSTATUS
 FiltersInstallClass(
-    _In_ const CHAR *ClassName,
+    _In_ PCSTR      ClassName,
     _In_ const GUID *ClassGuid,
-    _In_ const CHAR *DriverName
+    _In_ PCSTR      DriverName
     )
 {
     HANDLE          ClassKey;
@@ -196,9 +196,9 @@ fail1:
 
 static NTSTATUS
 FiltersUninstallClass(
-    _In_ const CHAR *ClassName,
+    _In_ PCSTR      ClassName,
     _In_ const GUID *ClassGuid,
-    _In_ const CHAR *DriverName
+    _In_ PCSTR      DriverName
     )
 {
     HANDLE          ClassKey;
diff --git a/src/xen/log.c b/src/xen/log.c
index c81c834..5687801 100644
--- a/src/xen/log.c
+++ b/src/xen/log.c
@@ -52,7 +52,7 @@ typedef struct _LOG_SLOT {
 
 struct _LOG_DISPOSITION {
     LOG_LEVEL   Mask;
-    VOID        (*Function)(PVOID, PCHAR, ULONG);
+    VOID        (*Function)(PVOID, PSTR, ULONG);
     PVOID       Argument;
 };
 
@@ -121,9 +121,9 @@ __LogPut(
     Slot->Buffer[Slot->Offset++] = Character;
 }
 
-static PCHAR
+static PSTR
 LogFormatNumber(
-    _In_ PCHAR      Buffer,
+    _In_ PSTR       Buffer,
     _In_ ULONGLONG  Value,
     _In_ UCHAR      Base,
     _In_ BOOLEAN    UpperCase
@@ -185,7 +185,7 @@ static VOID
 LogWriteSlot(
     _In_ PLOG_SLOT  Slot,
     _In_ LONG       Count,
-    _In_ const CHAR *Format,
+    _In_ PCSTR      Format,
     _In_ va_list    Arguments
     )
 {
@@ -298,7 +298,7 @@ LogWriteSlot(
         }
         case 's': {
             if (Wide) {
-                PWCHAR  Value = va_arg(Arguments, PWCHAR);
+                PWSTR   Value = va_arg(Arguments, PWSTR);
                 ULONG   Length;
                 ULONG   Index;
 
@@ -324,7 +324,7 @@ LogWriteSlot(
                     }
                 }
             } else {
-                PCHAR   Value = va_arg(Arguments, PCHAR);
+                PSTR    Value = va_arg(Arguments, PSTR);
                 ULONG   Length;
                 ULONG   Index;
 
@@ -356,7 +356,7 @@ LogWriteSlot(
         case 'Z': {
             if (Wide) {
                 PUNICODE_STRING Value = va_arg(Arguments, PUNICODE_STRING);
-                PWCHAR          Buffer;
+                PWSTR           Buffer;
                 ULONG           Length;
                 ULONG           Index;
 
@@ -386,7 +386,7 @@ LogWriteSlot(
                 }
             } else {
                 PANSI_STRING Value = va_arg(Arguments, PANSI_STRING);
-                PCHAR        Buffer;
+                PSTR         Buffer;
                 ULONG        Length;
                 ULONG        Index;
 
@@ -434,7 +434,7 @@ VOID
 LogCchVPrintf(
     _In_ LOG_LEVEL  Level,
     _In_ ULONG      Count,
-    _In_ const CHAR *Format,
+    _In_ PCSTR      Format,
     _In_ va_list    Arguments
     )
 {
@@ -464,7 +464,7 @@ XEN_API
 VOID
 LogVPrintf(
     _In_ LOG_LEVEL  Level,
-    _In_ const CHAR *Format,
+    _In_ PCSTR      Format,
     _In_ va_list    Arguments
     )
 {
@@ -476,7 +476,7 @@ VOID
 LogCchPrintf(
     _In_ LOG_LEVEL  Level,
     _In_ ULONG      Count,
-    _In_ const CHAR *Format,
+    _In_ PCSTR      Format,
     ...
     )
 {
@@ -491,7 +491,7 @@ XEN_API
 VOID
 LogPrintf(
     _In_ LOG_LEVEL  Level,
-    _In_ const CHAR *Format,
+    _In_ PCSTR      Format,
     ...
     )
 {
@@ -603,7 +603,7 @@ LogTeardown(
 NTSTATUS
 LogAddDisposition(
     _In_ LOG_LEVEL          Mask,
-    _In_ VOID               (*Function)(PVOID, PCHAR, ULONG),
+    _In_ VOID               (*Function)(PVOID, PSTR, ULONG),
     _In_opt_ PVOID          Argument,
     _Out_ PLOG_DISPOSITION  *Disposition
     )
@@ -682,7 +682,7 @@ __LogDbgPrintCallbackEnable(
 {
     CHAR            Key[] = "XEN:DBG_PRINT=";
     PANSI_STRING    Option;
-    PCHAR           Value;
+    PSTR            Value;
     BOOLEAN         Enable;
     NTSTATUS        status;
 
@@ -721,7 +721,7 @@ LogResume(
 }
 
 typedef struct _XEN_LOG_LEVEL_NAME {
-    const CHAR      *Name;
+    PCSTR           Name;
     LOG_LEVEL       LogLevel;
 } XEN_LOG_LEVEL_NAME, *PXEN_LOG_LEVEL_NAME;
 
@@ -737,7 +737,7 @@ XEN_API
 NTSTATUS
 LogReadLogLevel(
     _In_ HANDLE         Key,
-    _In_ PCHAR          Name,
+    _In_ PSTR           Name,
     _Out_ PLOG_LEVEL    LogLevel
     )
 {
diff --git a/src/xen/module.c b/src/xen/module.c
index 6c804bc..35a16f4 100644
--- a/src/xen/module.c
+++ b/src/xen/module.c
@@ -115,7 +115,7 @@ ModuleSearchBackwards(
 static NTSTATUS
 ModuleAdd(
     _In_ PMODULE_CONTEXT    Context,
-    _In_ PCHAR              Name,
+    _In_ PSTR               Name,
     _In_ ULONG_PTR          Start,
     _In_ ULONG_PTR          Size
     )
@@ -274,8 +274,8 @@ ModuleLoad(
 {
     PMODULE_CONTEXT     Context = &ModuleContext;
     ANSI_STRING         Ansi;
-    PCHAR               Buffer;
-    PCHAR               Name;
+    PSTR                Buffer;
+    PSTR                Name;
     NTSTATUS            status;
 
     UNREFERENCED_PARAMETER(ProcessId);
@@ -297,7 +297,7 @@ ModuleLoad(
 
     RtlCopyMemory(Buffer, Ansi.Buffer, Ansi.Length);
 
-    Name = strrchr((const CHAR *)Buffer, '\\');
+    Name = strrchr((PCSTR)Buffer, '\\');
     Name = (Name == NULL) ? Buffer : (Name + 1);
 
     status = ModuleAdd(Context,
@@ -330,14 +330,14 @@ fail1:
 XEN_API
 VOID
 ModuleLookup(
-    _In_ ULONG_PTR  Address,
-    _Out_ PCHAR     *Name,
-    _Out_ PULONG_PTR Offset
+    _In_ ULONG_PTR          Address,
+    _Outptr_result_z_ PSTR  *Name,
+    _Out_ PULONG_PTR        Offset
     )
 {
-    PMODULE_CONTEXT Context = &ModuleContext;
-    PLIST_ENTRY     ListEntry;
-    KIRQL           Irql;
+    PMODULE_CONTEXT         Context = &ModuleContext;
+    PLIST_ENTRY             ListEntry;
+    KIRQL                   Irql;
 
     *Name = NULL;
     *Offset = 0;
@@ -448,10 +448,10 @@ again:
     Context->Cursor = &Context->List;
 
     for (Index = 0; Index < Count; Index++) {
-        PCHAR   Name;
+        PSTR    Name;
 
-        Name = strrchr((const CHAR *)QueryInfo[Index].FullPathName, '\\');
-        Name = (Name == NULL) ? (PCHAR)QueryInfo[Index].FullPathName : (Name + 
1);
+        Name = strrchr((PCSTR)QueryInfo[Index].FullPathName, '\\');
+        Name = (Name == NULL) ? (PSTR)QueryInfo[Index].FullPathName : (Name + 
1);
 
         status = ModuleAdd(Context,
                            Name,
diff --git a/src/xen/process.c b/src/xen/process.c
index 8e83188..503c832 100644
--- a/src/xen/process.c
+++ b/src/xen/process.c
@@ -40,7 +40,7 @@
 #include "dbg_print.h"
 #include "assert.h"
 
-typedef PCHAR (*GET_PROCESS_IMAGE_NAME)(PEPROCESS Process);
+typedef PSTR (*GET_PROCESS_IMAGE_NAME)(PEPROCESS Process);
 
 typedef struct _PROCESS_CONTEXT {
     LONG                    References;
@@ -77,7 +77,7 @@ ProcessNotify(
     KeLowerIrql(Irql);
 }
 
-PCHAR
+PSTR
 ProcessGetImageFileName(
     _In_ PEPROCESS  Process
     )
diff --git a/src/xen/process.h b/src/xen/process.h
index 9ae2ec9..880acd4 100644
--- a/src/xen/process.h
+++ b/src/xen/process.h
@@ -44,7 +44,7 @@ ProcessTeardown(
     VOID
     );
 
-extern PCHAR
+extern PSTR
 ProcessGetImageFileName(
     _In_ PEPROCESS  Process
     );
diff --git a/src/xen/system.c b/src/xen/system.c
index b813326..6618b67 100644
--- a/src/xen/system.c
+++ b/src/xen/system.c
@@ -99,7 +99,7 @@ __SystemFree(
     __FreePoolWithTag(Buffer, XEN_SYSTEM_TAG);
 }
 
-static FORCEINLINE const CHAR *
+static FORCEINLINE PCSTR
 __PlatformIdName(
     _In_ ULONG  PlatformId
     )
@@ -120,7 +120,7 @@ __PlatformIdName(
 #undef  PLATFORM_ID_NAME
 }
 
-static FORCEINLINE const CHAR *
+static FORCEINLINE PCSTR
 __SuiteName(
     _In_ ULONG SuiteBit
     )
@@ -153,7 +153,7 @@ __SuiteName(
 #undef  SUITE_NAME
 }
 
-static FORCEINLINE const CHAR *
+static FORCEINLINE PCSTR
 __ProductTypeName(
     _In_ UCHAR  ProductType
     )
@@ -1071,7 +1071,7 @@ fail1:
 
 static NTSTATUS
 SystemRegisterCallback(
-    _In_ PWCHAR             Name,
+    _In_ PWSTR              Name,
     _In_ PCALLBACK_FUNCTION Function,
     _In_opt_ PVOID          Argument,
     _Out_ PVOID             *Handle
diff --git a/src/xen/unplug.c b/src/xen/unplug.c
index bdf5843..dbd9a2e 100644
--- a/src/xen/unplug.c
+++ b/src/xen/unplug.c
@@ -50,7 +50,7 @@
 #define UNPLUG_TAG  'LPNU'
 
 typedef struct _UNPLUG_DATA {
-    PCHAR       Name;
+    PSTR        Name;
     BOOLEAN     Found;
 } UNPLUG_DATA, *PUNPLUG_DATA;
 
@@ -88,7 +88,7 @@ UnplugSetBootEmulated(
     PUNPLUG_CONTEXT Context = &UnplugContext;
     CHAR            Key[] = "XEN:BOOT_EMULATED=";
     PANSI_STRING    Option;
-    PCHAR           Value;
+    PSTR            Value;
     NTSTATUS        status;
 
     status = RegistryQuerySystemStartOption(Key, &Option);
@@ -210,7 +210,7 @@ UnplugCheckEnumKeyCallback(
 
 static NTSTATUS
 UnplugCheckEnumKey(
-    _In_ PCHAR          EnumName,
+    _In_ PSTR           EnumName,
     _Out_ PULONG        Value
     )
 {
@@ -266,8 +266,8 @@ UnplugSetRequest(
 {
     PUNPLUG_CONTEXT     Context = &UnplugContext;
     HANDLE              UnplugKey;
-    PCHAR               ValueName;
-    PCHAR               EnumName;
+    PSTR                ValueName;
+    PSTR                EnumName;
     ULONG               Value;
     KIRQL               Irql;
     NTSTATUS            status;
@@ -321,7 +321,7 @@ UnplugIncrementValue(
     )
 {
     HANDLE              UnplugKey;
-    PCHAR               ValueName;
+    PSTR                ValueName;
     ULONG               Value;
     NTSTATUS            status;
 
@@ -372,7 +372,7 @@ UnplugDecrementValue(
     )
 {
     HANDLE              UnplugKey;
-    PCHAR               ValueName;
+    PSTR                ValueName;
     LONG                Value;
     NTSTATUS            status;
 
diff --git a/src/xen/xen_version.c b/src/xen/xen_version.c
index 4cff07f..0043752 100644
--- a/src/xen/xen_version.c
+++ b/src/xen/xen_version.c
@@ -81,7 +81,7 @@ _Check_return_
 XEN_API
 NTSTATUS
 XenVersionExtra(
-    _Out_writes_(XEN_EXTRAVERSION_LEN) PCHAR    Extra
+    _Out_writes_z_(XEN_EXTRAVERSION_LEN) PSTR   Extra
     )
 {
     xen_extraversion_t                          op;
diff --git a/src/xenbus/balloon.c b/src/xenbus/balloon.c
index 98c2f79..7afd387 100644
--- a/src/xenbus/balloon.c
+++ b/src/xenbus/balloon.c
@@ -750,7 +750,7 @@ BalloonGetFISTEntries(
     _In_ PXENBUS_BALLOON_CONTEXT    Context
     )
 {
-    PCHAR                           Buffer;
+    PSTR                            Buffer;
     NTSTATUS                        status;
 
     status = XENBUS_STORE(Read,
@@ -792,7 +792,7 @@ BalloonGetFISTEntries(
         Warning("deflation disallowed\n");
 }
 
-static FORCEINLINE PCHAR
+static FORCEINLINE PSTR
 __BalloonStatus(
     _In_ NTSTATUS   status
     )
diff --git a/src/xenbus/cache.c b/src/xenbus/cache.c
index 1af0ea8..24fc029 100644
--- a/src/xenbus/cache.c
+++ b/src/xenbus/cache.c
@@ -824,7 +824,7 @@ __CacheFlushMagazines(
 static NTSTATUS
 CacheCreate(
     _In_ PINTERFACE         Interface,
-    _In_ const CHAR         *Name,
+    _In_ PCSTR              Name,
     _In_ ULONG              Size,
     _In_ ULONG              Reservation,
     _In_ ULONG              Cap,
@@ -946,7 +946,7 @@ fail1:
 static NTSTATUS
 CacheCreateVersion1(
     _In_ PINTERFACE         Interface,
-    _In_ const CHAR         *Name,
+    _In_ PCSTR              Name,
     _In_ ULONG              Size,
     _In_ ULONG              Reservation,
     _In_ NTSTATUS           (*Ctor)(PVOID, PVOID),
diff --git a/src/xenbus/console.c b/src/xenbus/console.c
index 1c2af75..24f9d27 100644
--- a/src/xenbus/console.c
+++ b/src/xenbus/console.c
@@ -118,7 +118,7 @@ ConsoleOutAvailable(
 static ULONG
 ConsoleCopyToOut(
     _In_ PXENBUS_CONSOLE_CONTEXT    Context,
-    _In_ PCHAR                      Data,
+    _In_ PSTR                       Data,
     _In_ ULONG                      Length
     )
 {
@@ -193,7 +193,7 @@ ConsoleInAvailable(
 static ULONG
 ConsoleCopyFromIn(
     _In_ PXENBUS_CONSOLE_CONTEXT    Context,
-    _In_ PCHAR                      Data,
+    _In_ PSTR                       Data,
     _In_ ULONG                      Length
     )
 {
@@ -486,7 +486,7 @@ ConsoleDebugCallback(
              ListEntry != &(Context->WakeupList);
              ListEntry = ListEntry->Flink) {
             PXENBUS_CONSOLE_WAKEUP  Wakeup;
-            PCHAR                   Name;
+            PSTR                    Name;
             ULONG_PTR               Offset;
 
             Wakeup = CONTAINING_RECORD(ListEntry,
@@ -530,7 +530,7 @@ ConsoleCanRead(
 static ULONG
 ConsoleRead(
     _In_ PINTERFACE         Interface,
-    _In_ PCHAR              Data,
+    _In_ PSTR               Data,
     _In_ ULONG              Length
     )
 {
@@ -579,7 +579,7 @@ ConsoleCanWrite(
 static ULONG
 ConsoleWrite(
     _In_ PINTERFACE         Interface,
-    _In_ PCHAR              Data,
+    _In_ PSTR               Data,
     _In_ ULONG              Length
     )
 {
diff --git a/src/xenbus/debug.c b/src/xenbus/debug.c
index 2440afc..a0bb27d 100644
--- a/src/xenbus/debug.c
+++ b/src/xenbus/debug.c
@@ -59,7 +59,7 @@ struct _XENBUS_DEBUG_CONTEXT {
     LONG                        References;
     KBUGCHECK_CALLBACK_RECORD   CallbackRecord;
     LIST_ENTRY                  CallbackList;
-    const CHAR                  *CallbackPrefix;
+    PCSTR                       CallbackPrefix;
     HIGH_LOCK                   CallbackLock;
 };
 
@@ -92,7 +92,7 @@ RtlCaptureStackBackTrace(
 static NTSTATUS
 DebugRegister(
     _In_ PINTERFACE                     Interface,
-    _In_ PCHAR                          Prefix,
+    _In_ PSTR                           Prefix,
     _In_ XENBUS_DEBUG_FUNCTION          Function,
     _In_opt_ PVOID                      Argument,
     _Out_opt_ PXENBUS_DEBUG_CALLBACK    *Callback
@@ -132,7 +132,7 @@ fail1:
 static VOID
 DebugPrintf(
     _In_ PINTERFACE             Interface,
-    _In_ const CHAR             *Format,
+    _In_ PCSTR                  Format,
     ...
     )
 {
@@ -175,7 +175,7 @@ DebugCallback(
     _In_ BOOLEAN                Crashing
     )
 {
-    PCHAR                       Name;
+    PSTR                        Name;
     ULONG_PTR                   Offset;
 
     ModuleLookup((ULONG_PTR)Callback->Function, &Name, &Offset);
diff --git a/src/xenbus/evtchn.c b/src/xenbus/evtchn.c
index bb071d4..8927938 100644
--- a/src/xenbus/evtchn.c
+++ b/src/xenbus/evtchn.c
@@ -1465,7 +1465,7 @@ EvtchnDebugCallback(
              ListEntry != &Context->List;
              ListEntry = ListEntry->Flink) {
             PXENBUS_EVTCHN_CHANNEL  Channel;
-            PCHAR                   Name;
+            PSTR                    Name;
             ULONG_PTR               Offset;
 
             Channel = CONTAINING_RECORD(ListEntry, XENBUS_EVTCHN_CHANNEL, 
ListEntry);
diff --git a/src/xenbus/fdo.c b/src/xenbus/fdo.c
index d2a8869..c673ae0 100644
--- a/src/xenbus/fdo.c
+++ b/src/xenbus/fdo.c
@@ -521,7 +521,7 @@ fail1:
     return status;
 }
 
-static FORCEINLINE PCHAR
+static FORCEINLINE PSTR
 __FdoGetVendorName(
     _In_ PXENBUS_FDO    Fdo
     )
@@ -529,7 +529,7 @@ __FdoGetVendorName(
     return Fdo->VendorName;
 }
 
-PCHAR
+PSTR
 FdoGetVendorName(
     _In_ PXENBUS_FDO    Fdo
     )
@@ -552,7 +552,7 @@ __FdoSetName(
     ASSERT(NT_SUCCESS(status));
 }
 
-static FORCEINLINE PCHAR
+static FORCEINLINE PSTR
 __FdoGetName(
     _In_ PXENBUS_FDO    Fdo
     )
@@ -562,7 +562,7 @@ __FdoGetName(
     return Dx->Name;
 }
 
-PCHAR
+PSTR
 FdoGetName(
     _In_ PXENBUS_FDO    Fdo
     )
@@ -575,14 +575,14 @@ static NTSTATUS
 FdoQueryId(
     _In_ PXENBUS_FDO        Fdo,
     _In_ BUS_QUERY_ID_TYPE  Type,
-    _Out_ PCHAR             *Id
+    _Outptr_result_z_ PSTR  *Id
     )
 {
     KEVENT                  Event;
     IO_STATUS_BLOCK         StatusBlock;
     PIRP                    Irp;
     PIO_STACK_LOCATION      StackLocation;
-    PWCHAR                  Buffer;
+    PWSTR                   Buffer;
     ULONG                   Length;
     NTSTATUS                status;
 
@@ -623,7 +623,7 @@ FdoQueryId(
     if (!NT_SUCCESS(status))
         goto fail2;
 
-    Buffer = (PWCHAR)StatusBlock.Information;
+    Buffer = (PWSTR)StatusBlock.Information;
     Length = (ULONG)(wcslen(Buffer) + 1) * sizeof (CHAR);
 
     *Id = __AllocatePoolWithTag(PagedPool, Length, 'SUB');
@@ -658,14 +658,14 @@ static NTSTATUS
 FdoQueryDeviceText(
     _In_ PXENBUS_FDO        Fdo,
     _In_ DEVICE_TEXT_TYPE   Type,
-    _Out_ PCHAR             *Text
+    _Outptr_result_z_ PSTR  *Text
     )
 {
     KEVENT                  Event;
     IO_STATUS_BLOCK         StatusBlock;
     PIRP                    Irp;
     PIO_STACK_LOCATION      StackLocation;
-    PWCHAR                  Buffer;
+    PWSTR                   Buffer;
     ULONG                   Length;
     NTSTATUS                status;
 
@@ -706,7 +706,7 @@ FdoQueryDeviceText(
     if (!NT_SUCCESS(status))
         goto fail2;
 
-    Buffer = (PWCHAR)StatusBlock.Information;
+    Buffer = (PWSTR)StatusBlock.Information;
     Length = (ULONG)(wcslen(Buffer) + 1) * sizeof (CHAR);
 
     *Text = __AllocatePoolWithTag(PagedPool, Length, 'SUB');
@@ -741,10 +741,10 @@ FdoSetActive(
     _In_ PXENBUS_FDO    Fdo
     )
 {
-    PCHAR               DeviceID;
-    PCHAR               InstanceID;
-    PCHAR               ActiveDeviceID;
-    PCHAR               LocationInformation;
+    PSTR                DeviceID;
+    PSTR                InstanceID;
+    PSTR                ActiveDeviceID;
+    PSTR                LocationInformation;
     NTSTATUS            status;
 
     status = FdoQueryId(Fdo,
@@ -1110,7 +1110,7 @@ FdoEnumerate(
         PXENBUS_PDO     Pdo = Dx->Pdo;
 
         if (!PdoIsMissing(Pdo) && PdoGetDevicePnpState(Pdo) != Deleted) {
-            PCHAR           Name;
+            PSTR            Name;
             BOOLEAN         Missing;
 
             Name = PdoGetName(Pdo);
@@ -1171,7 +1171,7 @@ done:
 
 static PANSI_STRING
 FdoMultiSzToUpcaseAnsi(
-    _In_ PCHAR      Buffer
+    _In_ PSTR       Buffer
     )
 {
     PANSI_STRING    Ansi;
@@ -1355,7 +1355,7 @@ FdoScan(
     ParametersKey = DriverGetParametersKey();
 
     for (;;) {
-        PCHAR                   Buffer;
+        PSTR                    Buffer;
         PANSI_STRING            StoreClasses;
         PANSI_STRING            SyntheticClasses;
         PANSI_STRING            SupportedClasses;
@@ -1529,7 +1529,7 @@ FdoSuspend(
     Event = ThreadGetEvent(Self);
 
     for (;;) {
-        PCHAR       Buffer;
+        PSTR        Buffer;
         BOOLEAN     Suspend;
         NTSTATUS    status;
 
@@ -1679,7 +1679,7 @@ FdoBalloon(
     Active = FALSE;
 
     for (;;) {
-        PCHAR                   Buffer;
+        PSTR                    Buffer;
         ULONGLONG               Target;
         ULONGLONG               Size;
 
@@ -2442,13 +2442,13 @@ FdoDestroyInterrupt(
 static FORCEINLINE BOOLEAN
 __FdoMatchDistribution(
     _In_ PXENBUS_FDO    Fdo,
-    _In_ PCHAR          Buffer
+    _In_ PSTR           Buffer
     )
 {
-    PCHAR               Vendor;
-    PCHAR               Product;
-    PCHAR               Context;
-    const CHAR          *Text;
+    PSTR                Vendor;
+    PSTR                Product;
+    PSTR                Context;
+    PCSTR               Text;
     BOOLEAN             Match;
     ULONG               Index;
     NTSTATUS            status;
@@ -2504,7 +2504,7 @@ FdoClearDistribution(
     _In_ PXENBUS_FDO    Fdo
     )
 {
-    PCHAR               Buffer;
+    PSTR                Buffer;
     PANSI_STRING        Distributions;
     ULONG               Index;
     NTSTATUS            status;
@@ -2570,14 +2570,14 @@ FdoSetDistribution(
     ULONG               Index;
     CHAR                Distribution[MAXNAMELEN];
     CHAR                Vendor[MAXNAMELEN];
-    const CHAR          *Product;
+    PCSTR               Product;
     NTSTATUS            status;
 
     Trace("====>\n");
 
     Index = 0;
     while (Index <= MAXIMUM_INDEX) {
-        PCHAR   Buffer;
+        PSTR    Buffer;
 
         status = RtlStringCbPrintfA(Distribution,
                                     MAXNAMELEN,
@@ -2663,13 +2663,13 @@ CHAR FdoOutBuffer[FDO_OUT_BUFFER_SIZE];
 static VOID
 FdoOutputBuffer(
     _In_ PVOID  Argument,
-    _In_ PCHAR  Buffer,
+    _In_ PSTR   Buffer,
     _In_ ULONG  Length
     )
 {
     PXENBUS_FDO Fdo = Argument;
     ULONG       Index;
-    PCHAR       Cursor;
+    PSTR        Cursor;
 
     Cursor = FdoOutBuffer;
     for (Index = 0; Index < Length; Index++) {
@@ -5632,7 +5632,7 @@ FdoBalloonInitialize(
 {
     CHAR                Key[] = "XEN:BALLOON=";
     PANSI_STRING        Option;
-    PCHAR               Value;
+    PSTR                Value;
     BOOLEAN             Enabled;
     NTSTATUS            status;
 
diff --git a/src/xenbus/fdo.h b/src/xenbus/fdo.h
index ae4b86d..e506787 100644
--- a/src/xenbus/fdo.h
+++ b/src/xenbus/fdo.h
@@ -122,12 +122,12 @@ FdoGetBusData(
     _In_ ULONG          Length
     );
 
-extern PCHAR
+extern PSTR
 FdoGetVendorName(
     _In_ PXENBUS_FDO    Fdo
     );
 
-extern PCHAR
+extern PSTR
 FdoGetName(
     _In_ PXENBUS_FDO    Fdo
     );
diff --git a/src/xenbus/gnttab.c b/src/xenbus/gnttab.c
index 550b8e0..1ee0cd1 100644
--- a/src/xenbus/gnttab.c
+++ b/src/xenbus/gnttab.c
@@ -367,7 +367,7 @@ GnttabReleaseLock(
 static NTSTATUS
 GnttabCreateCache(
     _In_ PINTERFACE             Interface,
-    _In_ const CHAR             *Name,
+    _In_ PCSTR                  Name,
     _In_ ULONG                  Reservation,
     _In_ ULONG                  Cap,
     _In_ VOID                   (*AcquireLock)(PVOID),
@@ -446,7 +446,7 @@ fail1:
 static NTSTATUS
 GnttabCreateCacheVersion1(
     _In_ PINTERFACE             Interface,
-    _In_ const CHAR             *Name,
+    _In_ PCSTR                  Name,
     _In_ ULONG                  Reservation,
     _In_ VOID                   (*AcquireLock)(PVOID),
     _In_ VOID                   (*ReleaseLock)(PVOID),
diff --git a/src/xenbus/pdo.c b/src/xenbus/pdo.c
index a504652..df07973 100644
--- a/src/xenbus/pdo.c
+++ b/src/xenbus/pdo.c
@@ -65,7 +65,7 @@ struct _XENBUS_PDO {
 
     PXENBUS_FDO                 Fdo;
     BOOLEAN                     Missing;
-    const CHAR                  *Reason;
+    PCSTR                       Reason;
 
     BOOLEAN                     Removable;
     BOOLEAN                     Ejectable;
@@ -191,7 +191,7 @@ __PdoGetSystemPowerState(
 static FORCEINLINE VOID
 __PdoSetMissing(
     _In_ PXENBUS_PDO    Pdo,
-    _In_ const CHAR     *Reason
+    _In_ PCSTR          Reason
     )
 {
     Pdo->Reason = Reason;
@@ -201,7 +201,7 @@ __PdoSetMissing(
 VOID
 PdoSetMissing(
     _In_ PXENBUS_PDO    Pdo,
-    _In_ const CHAR     *Reason
+    _In_ PCSTR          Reason
     )
 {
     __PdoSetMissing(Pdo, Reason);
@@ -239,7 +239,7 @@ __PdoSetName(
     ASSERT(NT_SUCCESS(status));
 }
 
-static FORCEINLINE PCHAR
+static FORCEINLINE PSTR
 __PdoGetName(
     _In_ PXENBUS_PDO    Pdo
     )
@@ -249,7 +249,7 @@ __PdoGetName(
     return Dx->Name;
 }
 
-PCHAR
+PSTR
 PdoGetName(
     _In_ PXENBUS_PDO    Pdo
     )
@@ -491,7 +491,7 @@ PdoGetDeviceObject(
     return __PdoGetDeviceObject(Pdo);
 }
 
-static FORCEINLINE PCHAR
+static FORCEINLINE PSTR
 __PdoGetVendorName(
     _In_ PXENBUS_PDO    Pdo
     )
@@ -1038,7 +1038,7 @@ DEFINE_PDO_QUERY_INTERFACE(Console)
 
 struct _INTERFACE_ENTRY {
     const GUID  *Guid;
-    const CHAR  *Name;
+    PCSTR       Name;
     NTSTATUS    (*Query)(PXENBUS_PDO, PIRP);
 };
 
@@ -1250,7 +1250,7 @@ PdoQueryDeviceText(
     )
 {
     PIO_STACK_LOCATION  StackLocation;
-    PWCHAR              Buffer;
+    PWSTR               Buffer;
     UNICODE_STRING      Text;
     NTSTATUS            status;
 
@@ -1361,7 +1361,7 @@ PdoQueryId(
     )
 {
     PIO_STACK_LOCATION  StackLocation;
-    PWCHAR              Buffer;
+    PWSTR               Buffer;
     UNICODE_STRING      Id;
     ULONG               Type;
     NTSTATUS            status;
diff --git a/src/xenbus/pdo.h b/src/xenbus/pdo.h
index 1de01f8..af59955 100644
--- a/src/xenbus/pdo.h
+++ b/src/xenbus/pdo.h
@@ -57,10 +57,10 @@ PdoIsMissing(
 extern VOID
 PdoSetMissing(
     _In_ PXENBUS_PDO    Pdo,
-    _In_ const CHAR     *Reason
+    _In_ PCSTR          Reason
     );
 
-extern PCHAR
+extern PSTR
 PdoGetName(
     _In_ PXENBUS_PDO    Pdo
     );
diff --git a/src/xenbus/range_set.c b/src/xenbus/range_set.c
index 13df2e5..354b3ca 100644
--- a/src/xenbus/range_set.c
+++ b/src/xenbus/range_set.c
@@ -568,7 +568,7 @@ fail1:
 NTSTATUS
 RangeSetCreate(
     _In_ PINTERFACE             Interface,
-    _In_ const CHAR             *Name,
+    _In_ PCSTR                  Name,
     _Out_ PXENBUS_RANGE_SET     *RangeSet
     )
 {
diff --git a/src/xenbus/store.c b/src/xenbus/store.c
index 0a0ee94..9bdd590 100644
--- a/src/xenbus/store.c
+++ b/src/xenbus/store.c
@@ -68,7 +68,7 @@ struct _XENBUS_STORE_WATCH {
     ULONG       Magic;
     PVOID       Caller;
     USHORT      Id;
-    PCHAR       Path;
+    PSTR        Path;
     PKEVENT     Event;
     BOOLEAN     Active; // Must be tested at >= DISPATCH_LEVEL
 };
@@ -82,7 +82,7 @@ typedef enum _XENBUS_STORE_REQUEST_STATE {
 } XENBUS_STORE_REQUEST_STATE, *PXENBUS_STORE_REQUEST_STATE;
 
 typedef struct _XENBUS_STORE_SEGMENT {
-    PCHAR   Data;
+    PSTR    Data;
     ULONG   Offset;
     ULONG   Length;
 } XENBUS_STORE_SEGMENT, *PXENBUS_STORE_SEGMENT;
@@ -206,17 +206,17 @@ StorePrepareRequest(
     Request->Count = 0;
     Segment = &Request->Segment[Request->Count++];
 
-    Segment->Data = (PCHAR)&Request->Header;
+    Segment->Data = (PSTR)&Request->Header;
     Segment->Offset = 0;
     Segment->Length = sizeof (struct xsd_sockmsg);
 
     va_start(Arguments, Type);
     status = STATUS_UNSUCCESSFUL;
     for (;;) {
-        PCHAR   Data;
+        PSTR    Data;
         ULONG   Length;
 
-        Data = va_arg(Arguments, PCHAR);
+        Data = va_arg(Arguments, PSTR);
         Length = va_arg(Arguments, ULONG);
 
         if (Data == NULL) {
@@ -255,7 +255,7 @@ fail1:
 static ULONG
 StoreCopyToRing(
     _In_ PXENBUS_STORE_CONTEXT          Context,
-    _In_ PCHAR                          Data,
+    _In_ PSTR                           Data,
     _In_ ULONG                          Length
     )
 {
@@ -372,7 +372,7 @@ StoreSendRequests(
 static ULONG
 StoreCopyFromRing(
     _In_ PXENBUS_STORE_CONTEXT          Context,
-    _In_ PCHAR                          Data,
+    _In_ PSTR                           Data,
     _In_ ULONG                          Length
     )
 {
@@ -609,14 +609,14 @@ StoreNextWatchId(
 
 static NTSTATUS
 StoreParseWatchEvent(
-    _In_ PCHAR      Data,
-    _In_ ULONG      Length,
-    _Out_ PCHAR     *Path,
-    _Out_ PVOID     *Caller,
-    _Out_ PUSHORT   Id
+    _In_ PSTR               Data,
+    _In_ ULONG              Length,
+    _Outptr_result_z_ PSTR  *Path,
+    _Outptr_ PVOID          *Caller,
+    _Out_ PUSHORT           Id
     )
 {
-    PCHAR           End;
+    PSTR            End;
 
     *Path = Data;
     while (*Data != '\0' && Length != 0) {
@@ -682,7 +682,7 @@ StoreProcessWatchEvent(
     )
 {
     PXENBUS_STORE_RESPONSE      Response;
-    PCHAR                       Path;
+    PSTR                        Path;
     PVOID                       Caller;
     USHORT                      Id;
     PXENBUS_STORE_WATCH         Watch;
@@ -705,7 +705,7 @@ StoreProcessWatchEvent(
     Watch = StoreFindWatch(Context, Id);
 
     if (Watch == NULL) {
-        PCHAR       Name;
+        PSTR        Name;
         ULONG_PTR   Offset;
 
         ModuleLookup((ULONG_PTR)Caller, &Name, &Offset);
@@ -742,7 +742,7 @@ StoreResetResponse(
 
     Segment = &Response->Segment[XENBUS_STORE_RESPONSE_HEADER_SEGMENT];
 
-    Segment->Data = (PCHAR)&Response->Header;
+    Segment->Data = (PSTR)&Response->Header;
     Segment->Offset = 0;
     Segment->Length = sizeof (struct xsd_sockmsg);
 }
@@ -759,8 +759,8 @@ StoreCopyResponse(
     *Response = Context->Response;
 
     Segment = &Response->Segment[XENBUS_STORE_RESPONSE_HEADER_SEGMENT];
-    ASSERT3P(Segment->Data, ==, (PCHAR)&Context->Response.Header);
-    Segment->Data = (PCHAR)&Response->Header;
+    ASSERT3P(Segment->Data, ==, (PSTR)&Context->Response.Header);
+    Segment->Data = (PSTR)&Response->Header;
 
     Segment = &Response->Segment[XENBUS_STORE_RESPONSE_PAYLOAD_SEGMENT];
     if (Segment->Length != 0) {
@@ -987,7 +987,7 @@ StoreCheckResponse(
     status = STATUS_SUCCESS;
 
     if (Response->Header.type == XS_ERROR) {
-        PCHAR   Error;
+        PSTR    Error;
         ULONG   Length;
         ULONG   Index;
 
@@ -1024,7 +1024,7 @@ StoreCopyPayload(
     _In_ PVOID                  Caller
     )
 {
-    PCHAR                       Data;
+    PSTR                        Data;
     ULONG                       Length;
     PXENBUS_STORE_BUFFER        Buffer;
     KIRQL                       Irql;
@@ -1079,7 +1079,7 @@ StoreFreePayload(
 static VOID
 StoreFree(
     _In_ PINTERFACE         Interface,
-    _In_ PCHAR              Value
+    _In_ PSTR               Value
     )
 {
     PXENBUS_STORE_CONTEXT   Context = Interface->Context;
@@ -1102,9 +1102,9 @@ static NTSTATUS
 StoreRead(
     _In_ PINTERFACE                     Interface,
     _In_opt_ PXENBUS_STORE_TRANSACTION  Transaction,
-    _In_opt_ PCHAR                      Prefix,
-    _In_ PCHAR                          Node,
-    _Out_ PCHAR                         *Value
+    _In_opt_ PSTR                       Prefix,
+    _In_ PSTR                           Node,
+    _Outptr_result_z_ PSTR              *Value
     )
 {
     PXENBUS_STORE_CONTEXT               Context = Interface->Context;
@@ -1184,9 +1184,9 @@ static NTSTATUS
 StoreWrite(
     _In_ PXENBUS_STORE_CONTEXT          Context,
     _In_opt_ PXENBUS_STORE_TRANSACTION  Transaction,
-    _In_opt_ PCHAR                      Prefix,
-    _In_ PCHAR                          Node,
-    _In_ PCHAR                          Value
+    _In_opt_ PSTR                       Prefix,
+    _In_ PSTR                           Node,
+    _In_ PSTR                           Value
     )
 {
     XENBUS_STORE_REQUEST                Request;
@@ -1254,14 +1254,14 @@ static NTSTATUS
 StoreVPrintf(
     _In_ PINTERFACE                     Interface,
     _In_opt_ PXENBUS_STORE_TRANSACTION  Transaction,
-    _In_opt_ PCHAR                      Prefix,
-    _In_ PCHAR                          Node,
-    _In_ const CHAR                     *Format,
+    _In_opt_ PSTR                       Prefix,
+    _In_ PSTR                           Node,
+    _In_ PCSTR                          Format,
     _In_ va_list                        Arguments
     )
 {
     PXENBUS_STORE_CONTEXT               Context = Interface->Context;
-    PCHAR                               Buffer;
+    PSTR                                Buffer;
     ULONG                               Length;
     NTSTATUS                            status;
 
@@ -1316,9 +1316,9 @@ static NTSTATUS
 StorePrintf(
     _In_ PINTERFACE                     Interface,
     _In_opt_ PXENBUS_STORE_TRANSACTION  Transaction,
-    _In_opt_ PCHAR                      Prefix,
-    _In_ PCHAR                          Node,
-    _In_ const CHAR                     *Format,
+    _In_opt_ PSTR                       Prefix,
+    _In_ PSTR                           Node,
+    _In_ PCSTR                          Format,
     ...
     )
 {
@@ -1341,8 +1341,8 @@ static NTSTATUS
 StoreRemove(
     _In_ PINTERFACE                     Interface,
     _In_opt_ PXENBUS_STORE_TRANSACTION  Transaction,
-    _In_opt_ PCHAR                      Prefix,
-    _In_ PCHAR                          Node
+    _In_opt_ PSTR                       Prefix,
+    _In_ PSTR                           Node
     )
 {
     PXENBUS_STORE_CONTEXT               Context = Interface->Context;
@@ -1409,9 +1409,9 @@ static NTSTATUS
 StoreDirectory(
     _In_ PINTERFACE                     Interface,
     _In_opt_ PXENBUS_STORE_TRANSACTION  Transaction,
-    _In_opt_ PCHAR                      Prefix,
-    _In_ PCHAR                          Node,
-    _Out_ PCHAR                         *Value
+    _In_opt_ PSTR                       Prefix,
+    _In_ PSTR                           Node,
+    _Outptr_result_z_ PSTR              *Value
     )
 {
     PXENBUS_STORE_CONTEXT               Context = Interface->Context;
@@ -1656,15 +1656,15 @@ fail1:
 static NTSTATUS
 StoreWatchAdd(
     _In_ PINTERFACE             Interface,
-    _In_opt_ PCHAR              Prefix,
-    _In_ PCHAR                  Node,
+    _In_opt_ PSTR               Prefix,
+    _In_ PSTR                   Node,
     _In_ PKEVENT                Event,
     _Out_ PXENBUS_STORE_WATCH   *Watch
     )
 {
     PXENBUS_STORE_CONTEXT       Context = Interface->Context;
     ULONG                       Length;
-    PCHAR                       Path;
+    PSTR                        Path;
     CHAR                        Token[TOKEN_LENGTH];
     XENBUS_STORE_REQUEST        Request;
     PXENBUS_STORE_RESPONSE      Response;
@@ -1791,7 +1791,7 @@ StoreWatchRemove(
     )
 {
     PXENBUS_STORE_CONTEXT       Context = Interface->Context;
-    PCHAR                       Path;
+    PSTR                        Path;
     CHAR                        Token[TOKEN_LENGTH];
     XENBUS_STORE_REQUEST        Request;
     PXENBUS_STORE_RESPONSE      Response;
@@ -1978,7 +1978,8 @@ StoreWatchdog(
 static NTSTATUS
 StorePermissionToString(
     _In_ PXENBUS_STORE_PERMISSION   Permission,
-    _Out_ PCHAR                     Buffer,
+    _Out_writes_to_(BufferSize, *UsedSize)
+    PSTR                            Buffer,
     _In_ ULONG                      BufferSize,
     _Out_ PULONG                    UsedSize
     )
@@ -2037,8 +2038,8 @@ static NTSTATUS
 StorePermissionsSet(
     _In_ PINTERFACE                     Interface,
     _In_opt_ PXENBUS_STORE_TRANSACTION  Transaction,
-    _In_opt_ PCHAR                      Prefix,
-    _In_ PCHAR                          Node,
+    _In_opt_ PSTR                       Prefix,
+    _In_ PSTR                           Node,
     _In_ PXENBUS_STORE_PERMISSION       Permissions,
     _In_ ULONG                          NumberPermissions
     )
@@ -2051,9 +2052,9 @@ StorePermissionsSet(
     ULONG                               Index;
     ULONG                               Length;
     ULONG                               Used;
-    PCHAR                               Path;
-    PCHAR                               PermissionString;
-    PCHAR                               Segment;
+    PSTR                                Path;
+    PSTR                                PermissionString;
+    PSTR                                Segment;
 
     PermissionString = __StoreAllocate(XENSTORE_PAYLOAD_MAX);
 
@@ -2378,7 +2379,7 @@ StoreDebugCallback(
              ListEntry != &(Context->BufferList);
              ListEntry = ListEntry->Flink) {
             PXENBUS_STORE_BUFFER    Buffer;
-            PCHAR                   Name;
+            PSTR                    Name;
             ULONG_PTR               Offset;
 
             Buffer = CONTAINING_RECORD(ListEntry, XENBUS_STORE_BUFFER, 
ListEntry);
@@ -2413,7 +2414,7 @@ StoreDebugCallback(
              ListEntry != &(Context->WatchList);
              ListEntry = ListEntry->Flink) {
             PXENBUS_STORE_WATCH Watch;
-            PCHAR               Name;
+            PSTR                Name;
             ULONG_PTR           Offset;
 
             Watch = CONTAINING_RECORD(ListEntry, XENBUS_STORE_WATCH, 
ListEntry);
@@ -2452,7 +2453,7 @@ StoreDebugCallback(
              ListEntry != &(Context->TransactionList);
              ListEntry = ListEntry->Flink) {
             PXENBUS_STORE_TRANSACTION   Transaction;
-            PCHAR                       Name;
+            PSTR                        Name;
             ULONG_PTR                   Offset;
 
             Transaction = CONTAINING_RECORD(ListEntry, 
XENBUS_STORE_TRANSACTION, ListEntry);
diff --git a/src/xenbus/suspend.c b/src/xenbus/suspend.c
index ab403bf..55c00a2 100644
--- a/src/xenbus/suspend.c
+++ b/src/xenbus/suspend.c
@@ -143,7 +143,7 @@ SuspendDeregister(
 
 static FORCEINLINE VOID
 __SuspendLogTimers(
-    _In_ const CHAR *Prefix
+    _In_ PCSTR      Prefix
     )
 {
     LARGE_INTEGER   SystemTime;
@@ -331,7 +331,7 @@ SuspendDebugCallback(
          ListEntry != &Context->EarlyList;
          ListEntry = ListEntry->Flink) {
         PXENBUS_SUSPEND_CALLBACK    Callback;
-        PCHAR                       Name;
+        PSTR                        Name;
         ULONG_PTR                   Offset;
 
         Callback = CONTAINING_RECORD(ListEntry, XENBUS_SUSPEND_CALLBACK, 
ListEntry);
@@ -358,7 +358,7 @@ SuspendDebugCallback(
          ListEntry != &Context->LateList;
          ListEntry = ListEntry->Flink) {
         PXENBUS_SUSPEND_CALLBACK    Callback;
-        PCHAR                       Name;
+        PSTR                        Name;
         ULONG_PTR                   Offset;
 
         Callback = CONTAINING_RECORD(ListEntry, XENBUS_SUSPEND_CALLBACK, 
ListEntry);
diff --git a/src/xenbus/unplug.c b/src/xenbus/unplug.c
index a21df30..21cc122 100644
--- a/src/xenbus/unplug.c
+++ b/src/xenbus/unplug.c
@@ -154,7 +154,7 @@ UnplugBootEmulated(
     PXENBUS_UNPLUG_CONTEXT          Context = Interface->Context;
     CHAR                            KeyName[] = "XEN:BOOT_EMULATED=";
     PANSI_STRING                    Option;
-    PCHAR                           Value;
+    PSTR                            Value;
     NTSTATUS                        status;
     BOOLEAN                         BootEmulated;
 
@@ -187,7 +187,7 @@ _IRQL_requires_(PASSIVE_LEVEL)
 static VOID
 UnplugReboot(
     _In_ PINTERFACE                 Interface,
-    _In_ PCHAR                      Module
+    _In_ PSTR                       Module
     )
 {
     PXENBUS_UNPLUG_CONTEXT          Context = Interface->Context;
diff --git a/src/xenfilt/driver.c b/src/xenfilt/driver.c
index fd1ed22..16e4deb 100644
--- a/src/xenfilt/driver.c
+++ b/src/xenfilt/driver.c
@@ -206,15 +206,15 @@ DriverRemoveFunctionDeviceObject(
 
 static FORCEINLINE NTSTATUS
 __DriverGetActive(
-    _In_ const CHAR *Key,
-    _Out_ PCHAR     *Value
+    _In_ PCSTR              Key,
+    _Outptr_result_z_ PSTR  *Value
     )
 {
-    HANDLE          ParametersKey;
-    CHAR            Name[MAXNAMELEN];
-    PANSI_STRING    Ansi;
-    ULONG           Length;
-    NTSTATUS        status;
+    HANDLE                  ParametersKey;
+    CHAR                    Name[MAXNAMELEN];
+    PANSI_STRING            Ansi;
+    ULONG                   Length;
+    NTSTATUS                status;
 
     Trace("====>\n");
 
@@ -272,8 +272,8 @@ fail1:
 
 NTSTATUS
 DriverGetActive(
-    _In_ const CHAR *Key,
-    _Out_ PCHAR     *Value
+    _In_ PCSTR              Key,
+    _Outptr_result_z_ PSTR  *Value
     )
 {
     return __DriverGetActive(Key, Value);
@@ -284,7 +284,7 @@ DriverIsActivePresent(
     VOID
     )
 {
-    PCHAR       ActiveDeviceID;
+    PSTR        ActiveDeviceID;
     BOOLEAN     Present;
     NTSTATUS    status;
 
@@ -453,13 +453,13 @@ NTSTATUS
 DriverQueryId(
     _In_ PDEVICE_OBJECT     DeviceObject,
     _In_ BUS_QUERY_ID_TYPE  Type,
-    _Out_ PCHAR             *Id
+    _Outptr_result_z_ PSTR  *Id
     )
 {
     PIRP                    Irp;
     KEVENT                  Event;
     PIO_STACK_LOCATION      StackLocation;
-    PWCHAR                  Buffer;
+    PWSTR                   Buffer;
     NTSTATUS                status;
 
     ASSERT3U(KeGetCurrentIrql(), ==, PASSIVE_LEVEL);
@@ -524,7 +524,7 @@ DriverQueryId(
     if (!NT_SUCCESS(status))
         goto fail3;
 
-    Buffer = (PWCHAR)Irp->IoStatus.Information;
+    Buffer = (PWSTR)Irp->IoStatus.Information;
 
     switch (Type) {
     case BusQueryDeviceID:
@@ -617,13 +617,13 @@ NTSTATUS
 DriverQueryDeviceText(
     _In_ PDEVICE_OBJECT     DeviceObject,
     _In_ DEVICE_TEXT_TYPE   Type,
-    _Out_ PCHAR             *Text
+    _Outptr_result_z_ PSTR  *Text
     )
 {
     PIRP                    Irp;
     KEVENT                  Event;
     PIO_STACK_LOCATION      StackLocation;
-    PWCHAR                  Buffer;
+    PWSTR                   Buffer;
     ULONG                   Length;
     NTSTATUS                status;
 
@@ -673,7 +673,7 @@ DriverQueryDeviceText(
     if (!NT_SUCCESS(status))
         goto fail2;
 
-    Buffer = (PWCHAR)Irp->IoStatus.Information;
+    Buffer = (PWSTR)Irp->IoStatus.Information;
     Length = (ULONG)(wcslen(Buffer) + 1) * sizeof (CHAR);
 
     *Text = __AllocatePoolWithTag(PagedPool, Length, 'TLIF');
@@ -703,7 +703,7 @@ fail1:
     return status;
 }
 
-static FORCEINLINE PCHAR
+static FORCEINLINE PSTR
 __EmulatedTypeName(
     _In_ XENFILT_EMULATED_OBJECT_TYPE   Type
     )
@@ -718,7 +718,7 @@ __EmulatedTypeName(
 
 static XENFILT_EMULATED_OBJECT_TYPE
 DriverGetEmulatedType(
-    _In_ PCHAR                      Id
+    _In_ PSTR                       Id
     )
 {
     HANDLE                          ParametersKey;
@@ -780,7 +780,7 @@ DriverAddDevice(
     _In_ PDEVICE_OBJECT             PhysicalDeviceObject
     )
 {
-    PCHAR                           Id;
+    PSTR                            Id;
     XENFILT_EMULATED_OBJECT_TYPE    Type;
     NTSTATUS                        status;
 
diff --git a/src/xenfilt/driver.h b/src/xenfilt/driver.h
index ab36936..9c703c1 100644
--- a/src/xenfilt/driver.h
+++ b/src/xenfilt/driver.h
@@ -50,8 +50,8 @@ DriverReleaseMutex(
 
 extern NTSTATUS
 DriverGetActive(
-    _In_ const CHAR *Key,
-    _Out_ PCHAR     *Value
+    _In_ PCSTR              Key,
+    _Outptr_result_z_ PSTR  *Value
     );
 
 typedef enum _XENFILT_FILTER_STATE {
@@ -74,14 +74,14 @@ extern NTSTATUS
 DriverQueryId(
     _In_ PDEVICE_OBJECT     PhysicalDeviceObject,
     _In_ BUS_QUERY_ID_TYPE  Type,
-    _Out_ PCHAR             *Id
+    _Outptr_result_z_ PSTR  *Id
     );
 
 extern NTSTATUS
 DriverQueryDeviceText(
     _In_ PDEVICE_OBJECT     LowerDeviceObject,
     _In_ DEVICE_TEXT_TYPE   Type,
-    _Out_ PCHAR             *Text
+    _Outptr_result_z_ PSTR  *Text
     );
 
 #include "emulated.h"
@@ -120,9 +120,9 @@ typedef struct _XENFILT_DX {
     SYSTEM_POWER_STATE  SystemPowerState;
     DEVICE_POWER_STATE  DevicePowerState;
 
-    PCHAR               DeviceID;
-    PCHAR               InstanceID;
-    PCHAR               LocationInformation;
+    PSTR                DeviceID;
+    PSTR                InstanceID;
+    PSTR                LocationInformation;
 
     IO_REMOVE_LOCK      RemoveLock;
 
diff --git a/src/xenfilt/emulated.c b/src/xenfilt/emulated.c
index 76bb3c0..f5e1cc4 100644
--- a/src/xenfilt/emulated.c
+++ b/src/xenfilt/emulated.c
@@ -93,13 +93,13 @@ static NTSTATUS
 EmulatedSetObjectDeviceData(
     _In_ PXENFILT_EMULATED_OBJECT       EmulatedObject,
     _In_ XENFILT_EMULATED_OBJECT_TYPE   Type,
-    _In_ PCHAR                          DeviceID,
-    _In_ PCHAR                          InstanceID,
-    _In_opt_ PCHAR                      CompatibleIDs
+    _In_ PSTR                           DeviceID,
+    _In_ PSTR                           InstanceID,
+    _In_opt_ PSTR                       CompatibleIDs
     )
 {
     ULONG                               Index;
-    PCHAR                               LastMatch;
+    PSTR                                LastMatch;
     NTSTATUS                            status;
 
     status = STATUS_INVALID_PARAMETER;
@@ -154,12 +154,12 @@ static NTSTATUS
 EmulatedSetObjectDiskData(
     _In_ PXENFILT_EMULATED_OBJECT       EmulatedObject,
     _In_ XENFILT_EMULATED_OBJECT_TYPE   Type,
-    _In_ PCHAR                          DeviceID,
-    _In_ PCHAR                          InstanceID,
-    _In_opt_ PCHAR                      CompatibleIDs
+    _In_ PSTR                           DeviceID,
+    _In_ PSTR                           InstanceID,
+    _In_opt_ PSTR                       CompatibleIDs
     )
 {
-    PCHAR                               End;
+    PSTR                                End;
     ULONG                               Controller;
     ULONG                               Target;
     ULONG                               Lun;
@@ -223,9 +223,9 @@ fail1:
 NTSTATUS
 EmulatedAddObject(
     _In_ PXENFILT_EMULATED_CONTEXT      Context,
-    _In_ PCHAR                          DeviceID,
-    _In_ PCHAR                          InstanceID,
-    _In_opt_ PCHAR                      CompatibleIDs,
+    _In_ PSTR                           DeviceID,
+    _In_ PSTR                           InstanceID,
+    _In_opt_ PSTR                       CompatibleIDs,
     _In_ XENFILT_EMULATED_OBJECT_TYPE   Type,
     _Out_ PXENFILT_EMULATED_OBJECT      *EmulatedObject
     )
@@ -305,8 +305,8 @@ EmulatedRemoveObject(
 static BOOLEAN
 EmulatedIsDevicePresent(
     _In_ PINTERFACE             Interface,
-    _In_ PCHAR                  DeviceID,
-    _In_opt_ PCHAR              InstanceID
+    _In_ PSTR                   DeviceID,
+    _In_opt_ PSTR               InstanceID
     )
 {
     PXENFILT_EMULATED_CONTEXT   Context = Interface->Context;
diff --git a/src/xenfilt/emulated.h b/src/xenfilt/emulated.h
index 5cb6ece..686d542 100644
--- a/src/xenfilt/emulated.h
+++ b/src/xenfilt/emulated.h
@@ -68,9 +68,9 @@ EmulatedTeardown(
 extern NTSTATUS
 EmulatedAddObject(
     _In_ PXENFILT_EMULATED_CONTEXT      Context,
-    _In_ PCHAR                          DeviceID,
-    _In_ PCHAR                          InstanceID,
-    _In_opt_ PCHAR                      CompatibleIDs,
+    _In_ PSTR                           DeviceID,
+    _In_ PSTR                           InstanceID,
+    _In_opt_ PSTR                       CompatibleIDs,
     _In_ XENFILT_EMULATED_OBJECT_TYPE   Type,
     _Out_ PXENFILT_EMULATED_OBJECT      *EmulatedObject
     );
diff --git a/src/xenfilt/fdo.c b/src/xenfilt/fdo.c
index 94578f6..de70c6d 100644
--- a/src/xenfilt/fdo.c
+++ b/src/xenfilt/fdo.c
@@ -221,7 +221,7 @@ __FdoSetDeviceID(
 
 }
 
-static FORCEINLINE PCHAR
+static FORCEINLINE PSTR
 __FdoGetDeviceID(
     _In_ PXENFILT_FDO   Fdo
     )
@@ -254,7 +254,7 @@ __FdoSetInstanceID(
                          &Dx->InstanceID);
 }
 
-static FORCEINLINE PCHAR
+static FORCEINLINE PSTR
 __FdoGetInstanceID(
     _In_ PXENFILT_FDO   Fdo
     )
@@ -290,7 +290,7 @@ __FdoSetName(
     ASSERT(NT_SUCCESS(status));
 }
 
-static FORCEINLINE PCHAR
+static FORCEINLINE PSTR
 __FdoGetName(
     _In_ PXENFILT_FDO   Fdo
     )
diff --git a/src/xenfilt/fdo.h b/src/xenfilt/fdo.h
index bd1d347..907ec4b 100644
--- a/src/xenfilt/fdo.h
+++ b/src/xenfilt/fdo.h
@@ -52,7 +52,7 @@ FdoDestroy(
     _In_ PXENFILT_FDO   Fdo
     );
 
-extern PCHAR
+extern PSTR
 FdoGetPrefix(
     _In_ PXENFILT_FDO   Fdo
     );
diff --git a/src/xenfilt/pdo.c b/src/xenfilt/pdo.c
index 9c6ba99..4f40c4f 100644
--- a/src/xenfilt/pdo.c
+++ b/src/xenfilt/pdo.c
@@ -59,7 +59,7 @@ struct _XENFILT_PDO {
 
     PXENFILT_FDO                    Fdo;
     BOOLEAN                         Missing;
-    const CHAR                      *Reason;
+    PCSTR                           Reason;
 
     XENFILT_EMULATED_OBJECT_TYPE    Type;
     PXENFILT_EMULATED_OBJECT        EmulatedObject;
@@ -189,7 +189,7 @@ PdoGetPhysicalDeviceObject(
 static FORCEINLINE VOID
 __PdoSetMissing(
     _In_ PXENFILT_PDO   Pdo,
-    _In_ const CHAR     *Reason
+    _In_ PCSTR          Reason
     )
 {
     Pdo->Reason = Reason;
@@ -199,7 +199,7 @@ __PdoSetMissing(
 VOID
 PdoSetMissing(
     _In_ PXENFILT_PDO   Pdo,
-    _In_ const CHAR     *Reason
+    _In_ PCSTR          Reason
     )
 {
     __PdoSetMissing(Pdo, Reason);
@@ -253,10 +253,10 @@ PdoSetDeviceInformation(
     )
 {
     PXENFILT_DX         Dx = Pdo->Dx;
-    PCHAR               DeviceID;
-    PCHAR               ActiveDeviceID;
-    PCHAR               InstanceID;
-    PCHAR               LocationInformation;
+    PSTR                DeviceID;
+    PSTR                ActiveDeviceID;
+    PSTR                InstanceID;
+    PSTR                LocationInformation;
     NTSTATUS            status;
 
     status = DriverQueryId(Pdo->LowerDeviceObject,
@@ -350,7 +350,7 @@ PdoClearDeviceInformation(
     Pdo->Active = FALSE;
 }
 
-static FORCEINLINE PCHAR
+static FORCEINLINE PSTR
 __PdoGetDeviceID(
     _In_ PXENFILT_PDO   Pdo
     )
@@ -361,7 +361,7 @@ __PdoGetDeviceID(
     return Dx->DeviceID;
 }
 
-static FORCEINLINE PCHAR
+static FORCEINLINE PSTR
 __PdoGetInstanceID(
     _In_ PXENFILT_PDO   Pdo
     )
@@ -380,7 +380,7 @@ __PdoGetType(
     return Pdo->Type;
 }
 
-static FORCEINLINE PCHAR
+static FORCEINLINE PSTR
 __PdoGetLocationInformation(
     _In_ PXENFILT_PDO   Pdo
     )
@@ -413,7 +413,7 @@ __PdoSetName(
     ASSERT(NT_SUCCESS(status));
 }
 
-static FORCEINLINE PCHAR
+static FORCEINLINE PSTR
 __PdoGetName(
     _In_ PXENFILT_PDO   Pdo
     )
@@ -814,7 +814,7 @@ DEFINE_PDO_QUERY_INTERFACE(Emulated)
 
 struct _INTERFACE_ENTRY {
     const GUID  *Guid;
-    const CHAR  *Name;
+    PCSTR       Name;
     NTSTATUS    (*Query)(PXENFILT_PDO, PIRP);
 };
 
@@ -1630,7 +1630,7 @@ PdoCreate(
     PDEVICE_OBJECT                      FilterDeviceObject;
     PXENFILT_DX                         Dx;
     PXENFILT_PDO                        Pdo;
-    PCHAR                               CompatibleIDs;
+    PSTR                                CompatibleIDs;
     NTSTATUS                            status;
 
     ASSERT(Type != XENFILT_EMULATED_OBJECT_TYPE_UNKNOWN);
diff --git a/src/xenfilt/pdo.h b/src/xenfilt/pdo.h
index fbce164..85bc07f 100644
--- a/src/xenfilt/pdo.h
+++ b/src/xenfilt/pdo.h
@@ -65,7 +65,7 @@ PdoIsMissing(
 extern VOID
 PdoSetMissing(
     _In_ PXENFILT_PDO   Pdo,
-    _In_ const CHAR     *Reason
+    _In_ PCSTR          Reason
     );
 
 extern BOOLEAN
-- 
2.50.0.windows.1



Ngoc Tu Dinh | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.