[prev in list] [next in list] [prev in thread] [next in thread] 

List:       wine-patches
Subject:    fixed crash in color common dialog
From:       Eric Pouech <Eric.Pouech () wanadoo ! fr>
Date:       2000-06-25 18:49:19
[Download RAW message or body]

-- 
---------------
Eric Pouech (http://perso.wanadoo.fr/eric.pouech/)
"The future will be better tomorrow", Vice President Dan Quayle
["colordlg.diff" (text/plain)]

Name: colordlg
ChangeLog: fixed crash when lpTemplateName is gotten from MAKEINTRESOURCE
GenDate: 2000/06/25 19:48:53 UTC
ModifiedFiles: dlls/commdlg/colordlg.c
AddedFiles: 
===================================================================
RCS file: /home/cvs/cvsroot/wine/wine/dlls/commdlg/colordlg.c,v
retrieving revision 1.16
diff -u -u -r1.16 colordlg.c
--- dlls/commdlg/colordlg.c	2000/05/23 01:22:35	1.16
+++ dlls/commdlg/colordlg.c	2000/06/25 18:47:32
@@ -1468,14 +1468,18 @@
   lpcc->Flags = lpChCol->Flags;
   lpcc->lCustData = lpChCol->lCustData;
   lpcc->lpfnHook = (LPCCHOOKPROC) lpChCol->lpfnHook;
-  if ((lpcc->Flags & CC_ENABLETEMPLATE) && (lpChCol->lpTemplateName))
-      lpcc->lpTemplateName = HEAP_strdupAtoW(GetProcessHeap(), 0, lpChCol->lpTemplateName);
-  
+  if ((lpcc->Flags & CC_ENABLETEMPLATE) && (lpChCol->lpTemplateName)) {
+      if (HIWORD(lpChCol->lpTemplateName))
+	  lpcc->lpTemplateName = HEAP_strdupAtoW(GetProcessHeap(), 0, lpChCol->lpTemplateName);
+      else
+	  lpcc->lpTemplateName = (LPWSTR)lpChCol->lpTemplateName;
+  }
+
   ret = ChooseColorW(lpcc);
 
   if (ret)
       lpChCol->rgbResult = lpcc->rgbResult;
-  if (lpcc->lpTemplateName) HeapFree(GetProcessHeap(), 0, (LPSTR)lpcc->lpTemplateName);
+  if (HIWORD(lpcc->lpTemplateName)) HeapFree(GetProcessHeap(), 0, (LPSTR)lpcc->lpTemplateName);
   HeapFree(GetProcessHeap(), 0, lpcc);
   return ret;
 }


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic