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

RE: [PATCH:XenIface] Rename UTF8_STRING -> XENUTF8_STRING



> -----Original Message-----
> From: win-pv-devel <win-pv-devel-bounces@xxxxxxxxxxxxxxxxxxxx> On Behalf Of 
> Owen Smith
> Sent: 30 June 2020 10:49
> To: win-pv-devel@xxxxxxxxxxxxxxxxxxxx
> Cc: Owen Smith <owen.smith@xxxxxxxxxx>
> Subject: [PATCH:XenIface] Rename UTF8_STRING -> XENUTF8_STRING
> 
> EWDK 16.3.0 (19041) defines UTF8_STRING. Rename to avoid redefinition
> warnings.

Could we use the definition from the new EWDK and define it ourselves if using 
an older (E)WDK?

  Paul

> 
> Signed-off-by: Owen Smith <owen.smith@xxxxxxxxxx>
> ---
>  src/xeniface/wmi.c | 28 ++++++++++++++--------------
>  1 file changed, 14 insertions(+), 14 deletions(-)
> 
> diff --git a/src/xeniface/wmi.c b/src/xeniface/wmi.c
> index f250429..71cd168 100644
> --- a/src/xeniface/wmi.c
> +++ b/src/xeniface/wmi.c
> @@ -228,12 +228,12 @@ USHORT Utf8FromUtf32(CHAR *dest, ULONG utf32) {
>      }
>  }
> 
> -typedef struct {
> +typedef struct _XENUTF8_STRING {
>      USHORT Length;
>      CHAR Buffer[1];
> -} UTF8_STRING;
> +} XENUTF8_STRING, *PXENUTF8_STRING;
> 
> -USHORT CountBytesUtf16FromUtf8String(const UTF8_STRING *utf8) {
> +USHORT CountBytesUtf16FromUtf8String(const XENUTF8_STRING *utf8) {
>      ULONG utf32;
>      int i = 0;
>      USHORT bytecount = 0;
> @@ -253,7 +253,7 @@ USHORT CountBytesUtf16FromUtf8(const UCHAR *utf8) {
>      }
>      return bytecount * sizeof(WCHAR);
>  }
> -NTSTATUS GetUTF8String(UTF8_STRING** utf8, USHORT bufsize, LPWSTR ustring)
> +NTSTATUS GetUTF8String(XENUTF8_STRING** utf8, USHORT bufsize, LPWSTR ustring)
>  {
>      USHORT bytecount = 0;
>      USHORT i;
> @@ -264,7 +264,7 @@ NTSTATUS GetUTF8String(UTF8_STRING** utf8, USHORT 
> bufsize, LPWSTR ustring)
>          bytecount += CountUtf8FromUtf32(utf32);
>      }
> 
> -    *utf8 = ExAllocatePoolWithTag(NonPagedPool, 
> sizeof(UTF8_STRING)+bytecount, 'XIU8');
> +    *utf8 = ExAllocatePoolWithTag(NonPagedPool, 
> sizeof(XENUTF8_STRING)+bytecount, 'XIU8');
>      if ((*utf8) == NULL)
>          return STATUS_INSUFFICIENT_RESOURCES;
> 
> @@ -281,11 +281,11 @@ NTSTATUS GetUTF8String(UTF8_STRING** utf8, USHORT 
> bufsize, LPWSTR ustring)
>      return STATUS_SUCCESS;
>  }
> 
> -void FreeUTF8String(UTF8_STRING *utf8) {
> +void FreeUTF8String(XENUTF8_STRING *utf8) {
>      ExFreePoolWithTag(utf8, 'XIU8');
>  }
> 
> -NTSTATUS GetCountedUTF8String(UTF8_STRING **utf8, UCHAR *location)
> +NTSTATUS GetCountedUTF8String(XENUTF8_STRING **utf8, UCHAR *location)
>  {
>      USHORT bufsize = *(USHORT*)location;
>      LPWSTR ustring = (LPWSTR)(location+sizeof(USHORT));
> @@ -1452,7 +1452,7 @@ SessionExecuteRemoveValue(UCHAR *InBuffer,
>      ULONG RequiredSize;
>      NTSTATUS status;
>      UCHAR* upathname;
> -    UTF8_STRING *pathname;
> +    XENUTF8_STRING *pathname;
>      XenStoreSession *session;
>      char *tmpbuffer;
> 
> @@ -1625,8 +1625,8 @@ SessionExecuteSetValue(UCHAR *InBuffer,
>      NTSTATUS status;
>      UCHAR* upathname;
>      UCHAR* uvalue;
> -    UTF8_STRING* pathname;
> -    UTF8_STRING* value;
> +    XENUTF8_STRING* pathname;
> +    XENUTF8_STRING* value;
>      XenStoreSession *session;
>      char *tmppath;
>      char* tmpvalue;
> @@ -1699,7 +1699,7 @@ SessionExecuteGetFirstChild(UCHAR *InBuffer,
>      ULONG RequiredSize;
>      UCHAR *uloc;
>      NTSTATUS status;
> -    UTF8_STRING* path;
> +    XENUTF8_STRING* path;
>      PCHAR listresults;
>      size_t stringarraysize;
>      UCHAR *valuepos;
> @@ -1812,7 +1812,7 @@ SessionExecuteGetNextSibling(UCHAR *InBuffer,
>      ULONG RequiredSize;
>      UCHAR *uloc;
>      NTSTATUS status;
> -    UTF8_STRING* path;
> +    XENUTF8_STRING* path;
>      ANSI_STRING checkleaf;
>      PCHAR listresults;
>      PCHAR nextresult;
> @@ -1990,7 +1990,7 @@ SessionExecuteGetChildren(UCHAR *InBuffer,
>      ULONG RequiredSize;
>      UCHAR *uloc;
>      NTSTATUS status;
> -    UTF8_STRING* path;
> +    XENUTF8_STRING* path;
>      PCHAR listresults;
>      PCHAR nextresults;
>      ULONG *noofnodes;
> @@ -2259,7 +2259,7 @@ SessionExecuteGetValue(UCHAR *InBuffer,
>                          UNICODE_STRING *instance,
>                          OUT ULONG_PTR *byteswritten) {
>      NTSTATUS status;
> -    UTF8_STRING* path;
> +    XENUTF8_STRING* path;
>      UCHAR *uloc;
>      char *value;
>      UCHAR *valuepos;
> --
> 2.16.2.windows.1
> 





 


Rackspace

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