Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
9649ca2a
Commit
9649ca2a
authored
Dec 03, 2007
by
Aric Stewart
Committed by
Alexandre Julliard
Dec 05, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
commdlg: File name and extension offsets are not guaranteed to be the same in W->A conversions.
parent
90d8741d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
9 deletions
+34
-9
filedlg.c
dlls/comdlg32/filedlg.c
+34
-9
No files found.
dlls/comdlg32/filedlg.c
View file @
9649ca2a
...
...
@@ -2140,7 +2140,6 @@ BOOL FILEDLG95_OnOpen(HWND hwnd)
if
(
lstrlenW
(
lpstrPathAndFile
)
<
fodInfos
->
ofnInfos
->
nMaxFile
-
((
fodInfos
->
ofnInfos
->
Flags
&
OFN_ALLOWMULTISELECT
)
?
1
:
0
))
{
LPWSTR
lpszTemp
;
/* fill destination buffer */
if
(
fodInfos
->
ofnInfos
->
lpstrFile
)
...
...
@@ -2164,13 +2163,31 @@ BOOL FILEDLG95_OnOpen(HWND hwnd)
}
}
/* set filename offset */
lpszTemp
=
PathFindFileNameW
(
lpstrPathAndFile
);
fodInfos
->
ofnInfos
->
nFileOffset
=
(
lpszTemp
-
lpstrPathAndFile
);
if
(
fodInfos
->
unicode
)
{
LPWSTR
lpszTemp
;
/* set filename offset */
lpszTemp
=
PathFindFileNameW
(
lpstrPathAndFile
);
fodInfos
->
ofnInfos
->
nFileOffset
=
(
lpszTemp
-
lpstrPathAndFile
);
/* set extension offset */
lpszTemp
=
PathFindExtensionW
(
lpstrPathAndFile
);
fodInfos
->
ofnInfos
->
nFileExtension
=
(
*
lpszTemp
)
?
(
lpszTemp
-
lpstrPathAndFile
)
+
1
:
0
;
}
else
{
LPSTR
lpszTemp
;
LPOPENFILENAMEA
ofn
=
(
LPOPENFILENAMEA
)
fodInfos
->
ofnInfos
;
/* set filename offset */
lpszTemp
=
PathFindFileNameA
(
ofn
->
lpstrFile
);
fodInfos
->
ofnInfos
->
nFileOffset
=
(
lpszTemp
-
ofn
->
lpstrFile
);
/* set extension offset */
lpszTemp
=
PathFindExtensionW
(
lpstrPathAndFile
);
fodInfos
->
ofnInfos
->
nFileExtension
=
(
*
lpszTemp
)
?
(
lpszTemp
-
lpstrPathAndFile
)
+
1
:
0
;
/* set extension offset */
lpszTemp
=
PathFindExtensionA
(
ofn
->
lpstrFile
);
fodInfos
->
ofnInfos
->
nFileExtension
=
(
*
lpszTemp
)
?
(
lpszTemp
-
ofn
->
lpstrFile
)
+
1
:
0
;
}
/* set the lpstrFileTitle */
if
(
fodInfos
->
ofnInfos
->
lpstrFileTitle
)
...
...
@@ -3658,12 +3675,20 @@ static void CALLBACK FD32_UpdateResult(const FD31_DATA *lfs)
if
(
priv
->
ofnA
)
{
LPSTR
lpszTemp
;
if
(
ofnW
->
nMaxFile
&&
!
WideCharToMultiByte
(
CP_ACP
,
0
,
ofnW
->
lpstrFile
,
-
1
,
priv
->
ofnA
->
lpstrFile
,
ofnW
->
nMaxFile
,
NULL
,
NULL
))
priv
->
ofnA
->
lpstrFile
[
ofnW
->
nMaxFile
-
1
]
=
0
;
priv
->
ofnA
->
nFileOffset
=
ofnW
->
nFileOffset
;
priv
->
ofnA
->
nFileExtension
=
ofnW
->
nFileExtension
;
/* offsets are not guarenteed to be the same in WCHAR to MULTIBYTE conversion */
/* set filename offset */
lpszTemp
=
PathFindFileNameA
(
priv
->
ofnA
->
lpstrFile
);
priv
->
ofnA
->
nFileOffset
=
(
lpszTemp
-
priv
->
ofnA
->
lpstrFile
);
/* set extension offset */
lpszTemp
=
PathFindExtensionA
(
priv
->
ofnA
->
lpstrFile
);
priv
->
ofnA
->
nFileExtension
=
(
*
lpszTemp
)
?
(
lpszTemp
-
priv
->
ofnA
->
lpstrFile
)
+
1
:
0
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment