Fixed dialogex resource loading on sparc.
authorEric Frias <efrias@syncad.com>
Sun, 21 Nov 2004 15:36:05 +0000 (15:36 +0000)
committerAlexandre Julliard <julliard@winehq.org>
Sun, 21 Nov 2004 15:36:05 +0000 (15:36 +0000)
windows/dialog.c

index daf7e3de6df51da52dbad3490244f06498c41785..40f55f05d38c35e19cfa9d7698685daabd8c1cd1 100644 (file)
@@ -377,9 +377,13 @@ static BOOL DIALOG_CreateControls32( HWND hwnd, LPCSTR template, const DLG_TEMPL
 static LPCSTR DIALOG_ParseTemplate32( LPCSTR template, DLG_TEMPLATE * result )
 {
     const WORD *p = (const WORD *)template;
+    WORD signature;
+    WORD dlgver;
 
-    result->style = GET_DWORD(p); p += 2;
-    if (result->style == 0xffff0001)  /* DIALOGEX resource */
+    signature = GET_WORD(p); p++;
+    dlgver = GET_WORD(p); p++;
+
+    if (signature == 1 && dlgver == 0xffff)  /* DIALOGEX resource */
     {
         result->dialogEx = TRUE;
         result->helpId   = GET_DWORD(p); p += 2;
@@ -388,6 +392,7 @@ static LPCSTR DIALOG_ParseTemplate32( LPCSTR template, DLG_TEMPLATE * result )
     }
     else
     {
+        result->style = GET_DWORD(p - 2);
         result->dialogEx = FALSE;
         result->helpId   = 0;
         result->exStyle  = GET_DWORD(p); p += 2;