Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
fcb169fe
Commit
fcb169fe
authored
Apr 01, 2011
by
David Hedberg
Committed by
Alexandre Julliard
Apr 01, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comdlg32: Factor out some path building code from FILEDLG95_OnOpen.
parent
a172365b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
30 deletions
+44
-30
cdlg.h
dlls/comdlg32/cdlg.h
+3
-0
filedlg.c
dlls/comdlg32/filedlg.c
+41
-30
No files found.
dlls/comdlg32/cdlg.h
View file @
fcb169fe
...
...
@@ -173,6 +173,9 @@ typedef struct {
HRESULT
FileOpenDialog_Constructor
(
IUnknown
*
pUnkOuter
,
REFIID
riid
,
void
**
ppv
);
HRESULT
FileSaveDialog_Constructor
(
IUnknown
*
pUnkOuter
,
REFIID
riid
,
void
**
ppv
);
/* Shared helper functions */
void
COMDLG32_GetCanonicalPath
(
PCIDLIST_ABSOLUTE
pidlAbsCurrent
,
LPWSTR
lpstrFile
,
LPWSTR
lpstrPathAndFile
);
/* ITEMIDLIST */
extern
LPITEMIDLIST
(
WINAPI
*
COMDLG32_PIDL_ILClone
)
(
LPCITEMIDLIST
);
...
...
dlls/comdlg32/filedlg.c
View file @
fcb169fe
...
...
@@ -568,6 +568,46 @@ static BOOL COMDLG32_GetDisplayNameOf(LPCITEMIDLIST pidl, LPWSTR pwszPath) {
return
SUCCEEDED
(
StrRetToBufW
(
&
strret
,
pidl
,
pwszPath
,
MAX_PATH
));
}
/******************************************************************************
* COMDLG32_GetCanonicalPath [internal]
*
* Helper function to get the canonical path.
*/
void
COMDLG32_GetCanonicalPath
(
PCIDLIST_ABSOLUTE
pidlAbsCurrent
,
LPWSTR
lpstrFile
,
LPWSTR
lpstrPathAndFile
)
{
WCHAR
lpstrTemp
[
MAX_PATH
];
/* Get the current directory name */
if
(
!
COMDLG32_GetDisplayNameOf
(
pidlAbsCurrent
,
lpstrPathAndFile
))
{
/* last fallback */
GetCurrentDirectoryW
(
MAX_PATH
,
lpstrPathAndFile
);
}
PathAddBackslashW
(
lpstrPathAndFile
);
TRACE
(
"current directory=%s
\n
"
,
debugstr_w
(
lpstrPathAndFile
));
/* if the user specified a fully qualified path use it */
if
(
PathIsRelativeW
(
lpstrFile
))
{
lstrcatW
(
lpstrPathAndFile
,
lpstrFile
);
}
else
{
/* does the path have a drive letter? */
if
(
PathGetDriveNumberW
(
lpstrFile
)
==
-
1
)
lstrcpyW
(
lpstrPathAndFile
+
2
,
lpstrFile
);
else
lstrcpyW
(
lpstrPathAndFile
,
lpstrFile
);
}
/* resolve "." and ".." */
PathCanonicalizeW
(
lpstrTemp
,
lpstrPathAndFile
);
lstrcpyW
(
lpstrPathAndFile
,
lpstrTemp
);
TRACE
(
"canon=%s
\n
"
,
debugstr_w
(
lpstrPathAndFile
));
}
/***********************************************************************
* ArrangeCtrlPositions [internal]
*
...
...
@@ -2200,7 +2240,6 @@ BOOL FILEDLG95_OnOpen(HWND hwnd)
UINT
sizeUsed
=
0
;
BOOL
ret
=
TRUE
;
WCHAR
lpstrPathAndFile
[
MAX_PATH
];
WCHAR
lpstrTemp
[
MAX_PATH
];
LPSHELLFOLDER
lpsf
=
NULL
;
int
nOpenAction
;
FileOpenDlgInfos
*
fodInfos
=
GetPropA
(
hwnd
,
FileOpenDlgInfosStr
);
...
...
@@ -2234,35 +2273,7 @@ BOOL FILEDLG95_OnOpen(HWND hwnd)
- the edit box contains ".." (or a path with ".." in it)
*/
/* Get the current directory name */
if
(
!
COMDLG32_GetDisplayNameOf
(
fodInfos
->
ShellInfos
.
pidlAbsCurrent
,
lpstrPathAndFile
))
{
/* last fallback */
GetCurrentDirectoryW
(
MAX_PATH
,
lpstrPathAndFile
);
}
PathAddBackslashW
(
lpstrPathAndFile
);
TRACE
(
"current directory=%s
\n
"
,
debugstr_w
(
lpstrPathAndFile
));
/* if the user specified a fully qualified path use it */
if
(
PathIsRelativeW
(
lpstrFileList
))
{
lstrcatW
(
lpstrPathAndFile
,
lpstrFileList
);
}
else
{
/* does the path have a drive letter? */
if
(
PathGetDriveNumberW
(
lpstrFileList
)
==
-
1
)
lstrcpyW
(
lpstrPathAndFile
+
2
,
lpstrFileList
);
else
lstrcpyW
(
lpstrPathAndFile
,
lpstrFileList
);
}
/* resolve "." and ".." */
PathCanonicalizeW
(
lpstrTemp
,
lpstrPathAndFile
);
lstrcpyW
(
lpstrPathAndFile
,
lpstrTemp
);
TRACE
(
"canon=%s
\n
"
,
debugstr_w
(
lpstrPathAndFile
));
COMDLG32_GetCanonicalPath
(
fodInfos
->
ShellInfos
.
pidlAbsCurrent
,
lpstrFileList
,
lpstrPathAndFile
);
MemFree
(
lpstrFileList
);
/*
...
...
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