Closed Bug 328306 Opened 18 years ago Closed 18 years ago

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

Categories

(Core :: Widget: Win32, defect)

x86
Windows 95
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: emk, Assigned: emk)

References

Details

(Keywords: regression)

Attachments

(1 file)

Because _WIN32_WINNT=0x500 changed the sizeof(OPENFILENAME) value.
Attached patch trivial patchSplinter Review
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+
Keywords: regression
checked-in to trunk. Thanks.
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Are there any other side-effects like this?
(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 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?
(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
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 → ---
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
Closed: 18 years ago18 years ago
Resolution: --- → FIXED
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.

Attachment

General

Created:
Updated:
Size: