diff win/dw.c @ 1910:000a94a1ddc1

Fix a couple issues revealed by upgrading to Visual Studion 2015... Fixed a problem with wide strings via _snprintf() in dw_window_get_font(). Fixed a problem on x64 with dw_named_memory_new() by using constant. Added compatibility info to the manifests to support Windows 10.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Tue, 06 Oct 2015 02:56:46 +0000
parents cb5f9aa9aebb
children 102fca5f2e19
line wrap: on
line diff
--- a/win/dw.c	Sat Sep 19 10:47:46 2015 +0000
+++ b/win/dw.c	Tue Oct 06 02:56:46 2015 +0000
@@ -2861,7 +2861,7 @@
                                                  DW_GREEN_VALUE(back),
                                                  DW_BLUE_VALUE(back)));
                   SelectObject((HDC)mp1, thiscinfo->hbrush);
-                  return (LONG)(intptr_t)thiscinfo->hbrush;
+                  return (LRESULT)(intptr_t)thiscinfo->hbrush;
                }
             }
  #ifdef AEROGLASS
@@ -2882,7 +2882,7 @@
                               DeleteObject(thiscinfo->hbrush);
                            thiscinfo->hbrush = CreateSolidBrush(_dw_transparencykey);
                            SelectObject((HDC)mp1, thiscinfo->hbrush);
-                           return (LONG)thiscinfo->hbrush;
+                           return (LRESULT)thiscinfo->hbrush;
                         }
                      }
                   }
@@ -4901,7 +4901,7 @@
             italic = " Italic";
          height = MulDiv(abs(lf.lfHeight), 72,  GetDeviceCaps (hdc, LOGPIXELSY));
          ReleaseDC(handle, hdc);
-         _snprintf( str, 100, "%d.%s%s%s", height, lf.lfFaceName, bold, italic );
+         _snprintf( str, 100, "%d.%s%s%s", height, WideToUTF8(lf.lfFaceName), bold, italic );
       }
    }
    if ( oldfont )
@@ -11310,7 +11310,7 @@
    sa.lpSecurityDescriptor = &_dwsd;
    sa.bInheritHandle = FALSE;
 
-   handle = CreateFileMapping((HANDLE)0xFFFFFFFF, &sa, PAGE_READWRITE, 0, size, UTF8toWide(name));
+   handle = CreateFileMapping(INVALID_HANDLE_VALUE, &sa, PAGE_READWRITE, 0, size, UTF8toWide(name));
 
    if(!handle)
       return 0;