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
c851ecca
Commit
c851ecca
authored
Jul 06, 2016
by
Lauri Kenttä
Committed by
Alexandre Julliard
Jul 08, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comdlg32: Avoid repeated GlobalLock etc in filedlg.
Signed-off-by:
Lauri Kenttä
<
lauri.kentta@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
f99da3f3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
4 deletions
+11
-4
filedlg.c
dlls/comdlg32/filedlg.c
+11
-4
No files found.
dlls/comdlg32/filedlg.c
View file @
c851ecca
...
...
@@ -225,6 +225,7 @@ LPITEMIDLIST GetParentPidl(LPITEMIDLIST pidl);
static
LPITEMIDLIST
GetPidlFromName
(
IShellFolder
*
psf
,
LPWSTR
lpcstrFileName
);
static
BOOL
IsPidlFolder
(
LPSHELLFOLDER
psf
,
LPCITEMIDLIST
pidl
);
static
UINT
GetNumSelected
(
IDataObject
*
doSelected
);
static
void
COMCTL32_ReleaseStgMedium
(
STGMEDIUM
medium
);
/* Shell memory allocation */
static
void
*
MemAlloc
(
UINT
size
);
...
...
@@ -3649,12 +3650,18 @@ void FILEDLG95_FILENAME_FillFromSelection (HWND hwnd)
LPITEMIDLIST
pidl
;
LPWSTR
lpstrAllFiles
,
lpstrTmp
;
UINT
nFiles
=
0
,
nFileToOpen
,
nFileSelected
,
nAllFilesLength
=
0
,
nThisFileLength
,
nAllFilesMaxLength
;
STGMEDIUM
medium
;
LPIDA
cida
;
FORMATETC
formatetc
=
get_def_format
();
TRACE
(
"
\n
"
);
fodInfos
=
GetPropA
(
hwnd
,
FileOpenDlgInfosStr
);
/* Count how many files we have */
nFileSelected
=
GetNumSelected
(
fodInfos
->
Shell
.
FOIDataObject
);
if
(
FAILED
(
IDataObject_GetData
(
fodInfos
->
Shell
.
FOIDataObject
,
&
formatetc
,
&
medium
)))
return
;
cida
=
GlobalLock
(
medium
.
u
.
hGlobal
);
nFileSelected
=
cida
->
cidl
;
/* Allocate a buffer */
nAllFilesMaxLength
=
MAX_PATH
+
3
;
...
...
@@ -3665,7 +3672,7 @@ void FILEDLG95_FILENAME_FillFromSelection (HWND hwnd)
/* Loop through the selection, handle only files (not folders) */
for
(
nFileToOpen
=
0
;
nFileToOpen
<
nFileSelected
;
nFileToOpen
++
)
{
pidl
=
GetPidlFromDataObject
(
fodInfos
->
Shell
.
FOIDataObject
,
nFileToOpen
+
1
);
pidl
=
(
LPITEMIDLIST
)((
LPBYTE
)
cida
+
cida
->
aoffset
[
nFileToOpen
+
1
]
);
if
(
pidl
)
{
if
(
!
IsPidlFolder
(
fodInfos
->
Shell
.
FOIShellFolder
,
pidl
))
...
...
@@ -3686,7 +3693,6 @@ void FILEDLG95_FILENAME_FillFromSelection (HWND hwnd)
lpstrAllFiles
[
nAllFilesLength
++
]
=
'"'
;
lpstrAllFiles
[
nAllFilesLength
++
]
=
' '
;
}
COMDLG32_SHFree
(
pidl
);
}
}
...
...
@@ -3707,6 +3713,7 @@ void FILEDLG95_FILENAME_FillFromSelection (HWND hwnd)
ret:
HeapFree
(
GetProcessHeap
(),
0
,
lpstrAllFiles
);
COMCTL32_ReleaseStgMedium
(
medium
);
}
...
...
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