Open/Save dialogs no longer work on Win9x/Me/NT4 even if cairo is disabled

RESOLVED FIXED

Status

()

Core
Widget: Win32
RESOLVED FIXED
13 years ago
12 years ago

People

(Reporter: emk, Assigned: emk)

Tracking

({regression})

Trunk
x86
Windows 95
regression
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

13 years ago
Because _WIN32_WINNT=0x500 changed the sizeof(OPENFILENAME) value.
(Assignee)

Comment 1

13 years ago
Created attachment 212888 [details] [diff] [review]
trivial patch
Assignee: win32 → VYV03354
Status: NEW → ASSIGNED
Attachment #212888 - Flags: superreview?(roc)
Attachment #212888 - Flags: review?(roc)
Attachment #212888 - Flags: superreview?(roc)
Attachment #212888 - Flags: superreview+
Attachment #212888 - Flags: review?(roc)
Attachment #212888 - Flags: review+

Updated

13 years ago
Keywords: regression
checked-in to trunk. Thanks.
Status: ASSIGNED → RESOLVED
Last Resolved: 13 years ago
Resolution: --- → FIXED

Comment 3

13 years ago
Are there any other side-effects like this?
(Assignee)

Comment 4

13 years ago
(In reply to comment #3)
> Are there any other side-effects like this?
sizeof(RASSCONN) will be changed if WINVER >= 0x401.
Therefore nsRASAutodial::IsRASConnected may not work correctly.
However, I can't test it because I have no dialup modems.
And please file another bug about this problem.

Comment 5

13 years ago
Comment on attachment 212888 [details] [diff] [review]
trivial patch

>+#if _WIN32_WINNT >= 0x0500
>+  ofnA.lStructSize = OPENFILENAME_SIZE_VERSION_400; 
>+#else
>   ofnA.lStructSize = sizeof(OPENFILENAME); 
>+#endif
Out of interest, how does this differ from
ofnA.lStructSize = OPENFILENAME_SIZE_VERSION_400;
without #if?
(Assignee)

Comment 6

13 years ago
(In reply to comment #5)
> Out of interest, how does this differ from
> ofnA.lStructSize = OPENFILENAME_SIZE_VERSION_400;
> without #if?
Commdlg.h from MSVC6 or MINGW doesn't define OPENFILENAME_SIZE_VERSION_400.
So it may cause the build bustage.
Depends on: 328951

Comment 7

12 years ago
According to MSDN
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/userinput/commondialogboxlibrary/commondialogboxreference/commondialogboxstructures/openfilename.asp
|lStructSize| should be set as follows.

    Windows NT 4.0: In an application that is compiled with WINVER and 
                    _WIN32_WINNT >= 0x0500, use 
                    OPENFILENAME_SIZE_VERSION_400 for this member.

    Windows 2000/XP: Use sizeof (OPENFILENAME) for this parameter.

Therefore, the present fix seems to be somewhat incomplete, as no test for a newer system is made (namely, OPENFILENAME_SIZE_VERSION_400 should only be used for older systems).
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
(Assignee)

Comment 8

12 years ago
OPENFILENAME_SIZE_VERSION_400 can work on Win2k/XP for compatibility. Otherwise, old apps can not open Common Dialogs on Win2k/XP.
OPENFILENAME_SIZE_VERSION_400 does simply emulate the sizeof (OPENFILENAME) with _WIN32_WINNT=0x400. Mozilla build worked perfectly before cairo enabled.
Please reopen only after you found a specific problem.
Status: REOPENED → RESOLVED
Last Resolved: 13 years ago12 years ago
Resolution: --- → FIXED
(Assignee)

Comment 9

12 years ago
Also, I already confirmed non-cairo build works on Win2k/XP.
FYI, I'm planing to use sizeof (OPENFILENAME) on cairo build (see bug 330276).
We don't have to bothered to adding runtime version check for non-cairo build because it is not supported.
You need to log in before you can comment on or make changes to this bug.