Bug 458946 - Reduce narrow windows API calls in cairo win32 surface. r=vlad
authorblassey@mozilla.com
Wed, 08 Oct 2008 20:41:11 -0700
changeset 20186 143e49ad94822ab330609585a76ab257d1634d93
parent 20185 0b759f1c72e87518c10c60a7c4d78b22bc8f63ec
child 20187 66d756c2c44d03c1876fc95a4f807d20d061d792
push idunknown
push userunknown
push dateunknown
reviewersvlad
bugs458946
milestone1.9.1b2pre
Bug 458946 - Reduce narrow windows API calls in cairo win32 surface. r=vlad
gfx/cairo/cairo/src/cairo-win32-surface.c
--- a/gfx/cairo/cairo/src/cairo-win32-surface.c
+++ b/gfx/cairo/cairo/src/cairo-win32-surface.c
@@ -82,26 +82,26 @@ static const cairo_surface_backend_t cai
  * Return value: A cairo status code for the error code
  **/
 cairo_status_t
 _cairo_win32_print_gdi_error (const char *context)
 {
     void *lpMsgBuf;
     DWORD last_error = GetLastError ();
 
-    if (!FormatMessageA (FORMAT_MESSAGE_ALLOCATE_BUFFER |
+    if (!FormatMessageW (FORMAT_MESSAGE_ALLOCATE_BUFFER |
 			 FORMAT_MESSAGE_FROM_SYSTEM,
 			 NULL,
 			 last_error,
 			 MAKELANGID (LANG_NEUTRAL, SUBLANG_DEFAULT),
 			 (LPSTR) &lpMsgBuf,
 			 0, NULL)) {
 	fprintf (stderr, "%s: Unknown GDI error", context);
     } else {
-	fprintf (stderr, "%s: %s", context, (char *)lpMsgBuf);
+	fwprintf (stderr, "%S: %s", context, (char *)lpMsgBuf);
 
 	LocalFree (lpMsgBuf);
     }
 
     /* We should switch off of last_status, but we'd either return
      * CAIRO_STATUS_NO_MEMORY or CAIRO_STATUS_UNKNOWN_ERROR and there
      * is no CAIRO_STATUS_UNKNOWN_ERROR.
      */
@@ -743,17 +743,17 @@ static cairo_int_status_t
 	os.dwOSVersionInfoSize = sizeof (os);
 	GetVersionEx (&os);
 
 	/* If running on Win98, disable using AlphaBlend()
 	 * to avoid Win98 AlphaBlend() bug */
 	if (VER_PLATFORM_WIN32_WINDOWS != os.dwPlatformId ||
 	    os.dwMajorVersion != 4 || os.dwMinorVersion != 10)
 	{
-	    HMODULE msimg32_dll = LoadLibraryA ("msimg32");
+	    HMODULE msimg32_dll = LoadLibraryW (L"msimg32");
 
 	    if (msimg32_dll != NULL)
 		alpha_blend = (cairo_alpha_blend_func_t)GetProcAddress (msimg32_dll,
 									"AlphaBlend");
 	}
 
 	alpha_blend_checked = TRUE;
     }