[UXTHEME]
authorChristoph von Wittich <christoph_vw@reactos.org>
Sat, 6 Mar 2010 12:53:36 +0000 (12:53 +0000)
committerChristoph von Wittich <christoph_vw@reactos.org>
Sat, 6 Mar 2010 12:53:36 +0000 (12:53 +0000)
sync uxtheme to wine 1.1.40

svn path=/trunk/; revision=45932

reactos/dll/win32/uxtheme/draw.c
reactos/dll/win32/uxtheme/msstyles.c
reactos/dll/win32/uxtheme/system.c

index 9e22025..17900f8 100644 (file)
@@ -56,7 +56,7 @@ HRESULT WINAPI EnableThemeDialogTexture(HWND hwnd, DWORD dwFlags)
 
     TRACE("(%p,0x%08x\n", hwnd, dwFlags);
     res = SetPropW (hwnd, (LPCWSTR)MAKEINTATOM(atDialogThemeEnabled), 
-        (HANDLE)(dwFlags|0x80000000)); 
+                    UlongToHandle(dwFlags|0x80000000));
         /* 0x80000000 serves as a "flags set" flag */
     if (!res)
           return HRESULT_FROM_WIN32(GetLastError());
@@ -74,8 +74,7 @@ BOOL WINAPI IsThemeDialogTextureEnabled(HWND hwnd)
     DWORD dwDialogTextureFlags;
     TRACE("(%p)\n", hwnd);
 
-    dwDialogTextureFlags = (DWORD)GetPropW (hwnd, 
-        (LPCWSTR)MAKEINTATOM(atDialogThemeEnabled));
+    dwDialogTextureFlags = HandleToUlong( GetPropW( hwnd, (LPCWSTR)MAKEINTATOM(atDialogThemeEnabled) ));
     if (dwDialogTextureFlags == 0) 
         /* Means EnableThemeDialogTexture wasn't called for this dialog */
         return TRUE;
index 825645d..0adb70d 100644 (file)
@@ -364,7 +364,10 @@ static BOOL MSSTYLES_ParseIniSectionName(LPCWSTR lpSection, DWORD dwLen, LPWSTR
             lstrcpynW(part, comp, sizeof(part)/sizeof(part[0]));
             comp = tmp;
             /* now get the state */
-            *strchrW(comp, ')') = 0;
+            tmp = strchrW(comp, ')');
+            if (!tmp)
+                return FALSE;
+            *tmp = 0;
             lstrcpynW(state, comp, sizeof(state)/sizeof(state[0]));
         }
         else {
@@ -378,7 +381,10 @@ static BOOL MSSTYLES_ParseIniSectionName(LPCWSTR lpSection, DWORD dwLen, LPWSTR
             lstrcpynW(szClassName, comp, MAX_THEME_CLASS_NAME);
             comp = tmp;
             /* now get the state */
-            *strchrW(comp, ')') = 0;
+            tmp = strchrW(comp, ')');
+            if (!tmp)
+                return FALSE;
+            *tmp = 0;
             lstrcpynW(state, comp, sizeof(state)/sizeof(state[0]));
         }
         else {
@@ -1087,7 +1093,7 @@ static BOOL prepare_alpha (HBITMAP bmp, BOOL* hasAlpha)
 
     *hasAlpha = TRUE;
     p = dib.dsBm.bmBits;
-    n = abs(dib.dsBmih.biHeight) * dib.dsBmih.biWidth;
+    n = dib.dsBmih.biHeight * dib.dsBmih.biWidth;
     /* AlphaBlend() wants premultiplied alpha, so do that now */
     while (n-- > 0)
     {
index 2839539..b84e978 100644 (file)
@@ -393,8 +393,7 @@ static void UXTHEME_RestoreSystemMetrics(void)
             if (RegQueryValueExW (hKey, bsp->keyName, 0,
                 &type, (LPBYTE)&value, &count) == ERROR_SUCCESS)
             {
-                SystemParametersInfoW (bsp->spiSet, 0, (LPVOID)value,
-                    SPIF_UPDATEINIFILE);
+                SystemParametersInfoW (bsp->spiSet, 0, UlongToPtr(value), SPIF_UPDATEINIFILE);
             }
         
             bsp++;
@@ -445,9 +444,7 @@ static void UXTHEME_SaveSystemMetrics(void)
         DWORD value;
         
         SystemParametersInfoW (bsp->spiGet, 0, &value, 0);
-        SystemParametersInfoW (bsp->spiSet, 0, (LPVOID)value,
-            SPIF_UPDATEINIFILE);
-    
+        SystemParametersInfoW (bsp->spiSet, 0, UlongToPtr(value), SPIF_UPDATEINIFILE);
         bsp++;
     }