win-pvdrivers

changeset 460:dd42744a458e

Fixed compiler warnings
author Steve Meisner <steve.meisner@virtualcomputer.com>
date Tue Nov 25 18:02:21 2008 -0500 (2008-11-25)
parents ae1c232e7d4a
children c21dadd386da
files common/include/xen_public.h common/include/xen_windows.h copyconfig/copyconfig.c shutdownmon/shutdownmon.c
line diff
     1.1 --- a/common/include/xen_public.h	Sun Nov 23 14:17:34 2008 +1100
     1.2 +++ b/common/include/xen_public.h	Tue Nov 25 18:02:21 2008 -0500
     1.3 @@ -252,15 +252,15 @@ ADD_XEN_INIT_REQ(PUCHAR *ptr, UCHAR type
     1.4    case XEN_INIT_TYPE_STATE_PTR:
     1.5      break;
     1.6    case XEN_INIT_TYPE_WRITE_STRING:
     1.7 -    __ADD_XEN_INIT_STRING(ptr, p1);
     1.8 -    __ADD_XEN_INIT_STRING(ptr, p2);
     1.9 +    __ADD_XEN_INIT_STRING(ptr, (PCHAR) p1);
    1.10 +    __ADD_XEN_INIT_STRING(ptr, (PCHAR) p2);
    1.11      break;
    1.12    case XEN_INIT_TYPE_RING:
    1.13    case XEN_INIT_TYPE_EVENT_CHANNEL:
    1.14    case XEN_INIT_TYPE_EVENT_CHANNEL_IRQ:
    1.15    case XEN_INIT_TYPE_READ_STRING_FRONT:
    1.16    case XEN_INIT_TYPE_READ_STRING_BACK:
    1.17 -    __ADD_XEN_INIT_STRING(ptr, p1);
    1.18 +    __ADD_XEN_INIT_STRING(ptr, (PCHAR) p1);
    1.19      break;
    1.20    case XEN_INIT_TYPE_GRANT_ENTRIES:
    1.21      __ADD_XEN_INIT_ULONG(ptr, PtrToUlong(p2));
    1.22 @@ -319,18 +319,18 @@ ADD_XEN_INIT_RSP(PUCHAR *ptr, UCHAR type
    1.23    case XEN_INIT_TYPE_RUN:
    1.24      break;
    1.25    case XEN_INIT_TYPE_RING:
    1.26 -    __ADD_XEN_INIT_STRING(ptr, p1);
    1.27 +    __ADD_XEN_INIT_STRING(ptr, (PCHAR) p1);
    1.28      __ADD_XEN_INIT_PTR(ptr, p2);
    1.29      break;
    1.30    case XEN_INIT_TYPE_EVENT_CHANNEL:
    1.31    case XEN_INIT_TYPE_EVENT_CHANNEL_IRQ:
    1.32 -    __ADD_XEN_INIT_STRING(ptr, p1);
    1.33 +    __ADD_XEN_INIT_STRING(ptr, (PCHAR) p1);
    1.34      __ADD_XEN_INIT_ULONG(ptr, PtrToUlong(p2));
    1.35      break;
    1.36    case XEN_INIT_TYPE_READ_STRING_FRONT:
    1.37    case XEN_INIT_TYPE_READ_STRING_BACK:
    1.38 -    __ADD_XEN_INIT_STRING(ptr, p1);
    1.39 -    __ADD_XEN_INIT_STRING(ptr, p2);
    1.40 +    __ADD_XEN_INIT_STRING(ptr, (PCHAR) p1);
    1.41 +    __ADD_XEN_INIT_STRING(ptr, (PCHAR) p2);
    1.42      break;
    1.43    case XEN_INIT_TYPE_VECTORS:
    1.44      //__ADD_XEN_INIT_ULONG(ptr, PtrToUlong(p1));
     2.1 --- a/common/include/xen_windows.h	Sun Nov 23 14:17:34 2008 +1100
     2.2 +++ b/common/include/xen_windows.h	Tue Nov 25 18:02:21 2008 -0500
     2.3 @@ -83,7 +83,7 @@ SplitString(char *String, char Split, in
     2.4  
     2.5    *Count = 0;
     2.6  
     2.7 -  RetVal = ExAllocatePoolWithTag(NonPagedPool, (MaxParts + 1) * sizeof(char *), SPLITSTRING_POOL_TAG);
     2.8 +  RetVal = (char **)ExAllocatePoolWithTag(NonPagedPool, (MaxParts + 1) * sizeof(char *), SPLITSTRING_POOL_TAG);
     2.9    last = String;
    2.10    do
    2.11    {
    2.12 @@ -92,7 +92,7 @@ SplitString(char *String, char Split, in
    2.13      //KdPrint((__DRIVER_NAME "     b - count = %d\n", *Count));
    2.14      first = last;
    2.15      for (last = first; *last != '\0' && *last != Split; last++);
    2.16 -    RetVal[*Count] = ExAllocatePoolWithTag(NonPagedPool, last - first + 1, SPLITSTRING_POOL_TAG);
    2.17 +    RetVal[*Count] = (char *)ExAllocatePoolWithTag(NonPagedPool, last - first + 1, SPLITSTRING_POOL_TAG);
    2.18      //KdPrint((__DRIVER_NAME "     c - count = %d\n", *Count));
    2.19      strncpy(RetVal[*Count], first, last - first);
    2.20      RetVal[*Count][last - first] = 0;
    2.21 @@ -132,7 +132,7 @@ AllocatePagesExtra(int Pages, int ExtraS
    2.22      return NULL;
    2.23    }
    2.24  //  KdPrint((__DRIVER_NAME " --- AllocatePages IRQL = %d, Buf = %p\n", KeGetCurrentIrql(), Buf));
    2.25 -  Mdl = ExAllocatePoolWithTag(NonPagedPool, MmSizeOfMdl(Buf, Pages * PAGE_SIZE) + ExtraSize, ALLOCATE_PAGES_POOL_TAG);
    2.26 +  Mdl = (PMDL)ExAllocatePoolWithTag(NonPagedPool, MmSizeOfMdl(Buf, Pages * PAGE_SIZE) + ExtraSize, ALLOCATE_PAGES_POOL_TAG);
    2.27    //Mdl = IoAllocateMdl(Buf, Pages * PAGE_SIZE, FALSE, FALSE, NULL);
    2.28    if (Mdl == NULL)
    2.29    {
     3.1 --- a/copyconfig/copyconfig.c	Sun Nov 23 14:17:34 2008 +1100
     3.2 +++ b/copyconfig/copyconfig.c	Tue Nov 25 18:02:21 2008 -0500
     3.3 @@ -1,3 +1,4 @@
     3.4 +#pragma warning(disable: 4201)
     3.5  #include <basetyps.h>
     3.6  #include <stdlib.h>
     3.7  #include <wtypes.h>
     3.8 @@ -105,7 +106,7 @@ main(
     3.9        continue;
    3.10      }
    3.11      printf(" Description = %s\n", buf);
    3.12 -    if (strstr(buf, "Xen"))
    3.13 +    if (strstr((char *)buf, "Xen"))
    3.14      {
    3.15        printf(" Type = Xen\n");
    3.16        keyptr = adapter->xen_IpConfig_key_name;
    3.17 @@ -128,7 +129,7 @@ main(
    3.18        printf(" Failed to read registry (%08x). Ignoring.\n", status);
    3.19        continue;
    3.20      }
    3.21 -    status = RegQueryValueEx(adapter_key_handle, "IpConfig", NULL, NULL, keyptr, &buf_len);
    3.22 +    status = RegQueryValueEx(adapter_key_handle, "IpConfig", NULL, NULL, (LPBYTE)keyptr, &buf_len);
    3.23      if (status != ERROR_SUCCESS)
    3.24      {
    3.25        printf(" Failed to read registry (%08x). Ignoring.\n", status);
    3.26 @@ -154,15 +155,15 @@ main(
    3.27      if (adapter->xen_IpConfig_key_name[0] && adapter->other_IpConfig_key_name[0])
    3.28      {
    3.29        // open HKLM\SYSTEM\Services\%s
    3.30 -      sprintf(buf, "SYSTEM\\CurrentControlSet\\Services\\%s", adapter->xen_IpConfig_key_name);
    3.31 -      status = RegOpenKey(HKEY_LOCAL_MACHINE, buf, &dst_key_handle);
    3.32 +      sprintf((char *)buf, "SYSTEM\\CurrentControlSet\\Services\\%s", adapter->xen_IpConfig_key_name);
    3.33 +      status = RegOpenKey(HKEY_LOCAL_MACHINE, (LPCSTR)buf, &dst_key_handle);
    3.34        if (status != ERROR_SUCCESS)
    3.35        {
    3.36          printf(" Cannot open Xen adapter config key. Skipping.\n");
    3.37          continue;
    3.38        }
    3.39 -      sprintf(buf, "SYSTEM\\CurrentControlSet\\Services\\%s", adapter->other_IpConfig_key_name);
    3.40 -      status = RegOpenKey(HKEY_LOCAL_MACHINE, buf, &src_key_handle);
    3.41 +      sprintf((char *)buf, "SYSTEM\\CurrentControlSet\\Services\\%s", adapter->other_IpConfig_key_name);
    3.42 +      status = RegOpenKey(HKEY_LOCAL_MACHINE, (LPCSTR)buf, &src_key_handle);
    3.43        if (status != ERROR_SUCCESS)
    3.44        {
    3.45          printf(" Cannot open Other adapter config key. Skipping.\n");
    3.46 @@ -170,7 +171,7 @@ main(
    3.47        }
    3.48        value_name_len = 256;
    3.49        value_data_len = 1024;
    3.50 -      while ((status = RegEnumValue(dst_key_handle, 0, value_name, &value_name_len, NULL, &value_type, value_data, &value_data_len)) != ERROR_NO_MORE_ITEMS)
    3.51 +      while ((status = RegEnumValue(dst_key_handle, 0, value_name, &value_name_len, NULL, &value_type, (LPBYTE)value_data, &value_data_len)) != ERROR_NO_MORE_ITEMS)
    3.52        {
    3.53          RegDeleteValue(dst_key_handle, value_name);
    3.54          value_name_len = 256;
    3.55 @@ -179,9 +180,9 @@ main(
    3.56        i = 0;
    3.57        value_name_len = 256;
    3.58        value_data_len = 1024;
    3.59 -      while ((status = RegEnumValue(src_key_handle, i, value_name, &value_name_len, NULL, &value_type, value_data, &value_data_len)) != ERROR_NO_MORE_ITEMS)
    3.60 +      while ((status = RegEnumValue(src_key_handle, i, value_name, &value_name_len, NULL, &value_type, (LPBYTE)value_data, &value_data_len)) != ERROR_NO_MORE_ITEMS)
    3.61        {
    3.62 -        RegSetValueEx(dst_key_handle, value_name, 0, value_type, value_data, value_data_len);
    3.63 +        RegSetValueEx(dst_key_handle, value_name, 0, value_type, (BYTE *)value_data, value_data_len);
    3.64          value_name_len = 256;
    3.65          value_data_len = 1024;
    3.66          i++;
     4.1 --- a/shutdownmon/shutdownmon.c	Sun Nov 23 14:17:34 2008 +1100
     4.2 +++ b/shutdownmon/shutdownmon.c	Tue Nov 25 18:02:21 2008 -0500
     4.3 @@ -1,3 +1,4 @@
     4.4 +#pragma warning(disable: 4201)
     4.5  #include <windows.h>
     4.6  #include <basetyps.h>
     4.7  #include <stdlib.h>
     4.8 @@ -300,9 +301,10 @@ void control_handler(DWORD request)
     4.9  
    4.10  void service_main(int argc, char *argv[]) 
    4.11  { 
    4.12 -  int error; 
    4.13 +  UNREFERENCED_PARAMETER (argc);
    4.14 +  UNREFERENCED_PARAMETER (argv);
    4.15  
    4.16 -write_log("Entering service_main\n"); 
    4.17 +  write_log("Entering service_main\n"); 
    4.18  
    4.19    service_status.dwServiceType = SERVICE_WIN32; 
    4.20    service_status.dwCurrentState =  SERVICE_START_PENDING;