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
3e2559b9
Commit
3e2559b9
authored
Sep 28, 2017
by
Nikolay Sivov
Committed by
Alexandre Julliard
Sep 28, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell32: Get rid of original variant used to create a Folder.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
2ef383c0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
21 deletions
+16
-21
shelldispatch.c
dlls/shell32/shelldispatch.c
+16
-21
No files found.
dlls/shell32/shelldispatch.c
View file @
3e2559b9
...
...
@@ -63,7 +63,6 @@ typedef struct {
typedef
struct
{
Folder3
Folder3_iface
;
LONG
ref
;
VARIANT
dir
;
IDispatch
*
application
;
IShellFolder2
*
folder
;
PIDLIST_ABSOLUTE
pidl
;
...
...
@@ -1090,13 +1089,24 @@ static HRESULT WINAPI FolderItemsImpl_Invoke(FolderItems3 *iface,
return
hr
;
}
static
BOOL
shellfolder_exists
(
const
WCHAR
*
path
)
{
PIDLIST_ABSOLUTE
pidl
=
NULL
;
HRESULT
hr
;
hr
=
SHParseDisplayName
(
path
,
NULL
,
&
pidl
,
0
,
NULL
);
ILFree
(
pidl
);
return
SUCCEEDED
(
hr
);
}
static
HRESULT
WINAPI
FolderItemsImpl_get_Count
(
FolderItems3
*
iface
,
LONG
*
count
)
{
FolderItemsImpl
*
This
=
impl_from_FolderItems
(
iface
);
TRACE
(
"(%p,%p)
\n
"
,
iface
,
count
);
*
count
=
PathIsDirectoryW
(
V_BSTR
(
&
This
->
folder
->
dir
)
)
?
This
->
item_count
:
0
;
*
count
=
shellfolder_exists
(
This
->
folder
->
path
)
?
This
->
item_count
:
0
;
return
S_OK
;
}
...
...
@@ -1129,7 +1139,7 @@ static HRESULT WINAPI FolderItemsImpl_Item(FolderItems3 *iface, VARIANT index, F
*
item
=
NULL
;
if
(
!
PathIsDirectoryW
(
V_BSTR
(
&
This
->
folder
->
dir
)
))
if
(
!
shellfolder_exists
(
This
->
folder
->
path
))
return
S_FALSE
;
switch
(
V_VT
(
&
index
))
...
...
@@ -1271,16 +1281,10 @@ static HRESULT FolderItems_Constructor(FolderImpl *folder, FolderItems **ret)
unsigned
int
i
;
HRESULT
hr
;
TRACE
(
"(%s,%p)
\n
"
,
debugstr_
variant
(
&
folder
->
dir
),
ret
);
TRACE
(
"(%s,%p)
\n
"
,
debugstr_
w
(
folder
->
path
),
ret
);
*
ret
=
NULL
;
if
(
V_VT
(
&
folder
->
dir
)
==
VT_I4
)
{
FIXME
(
"special folder constants are not supported
\n
"
);
return
E_NOTIMPL
;
}
This
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
This
));
if
(
!
This
)
return
E_OUTOFMEMORY
;
...
...
@@ -1395,7 +1399,6 @@ static ULONG WINAPI FolderImpl_Release(Folder3 *iface)
ILFree
(
This
->
pidl
);
IShellFolder2_Release
(
This
->
folder
);
IDispatch_Release
(
This
->
application
);
VariantClear
(
&
This
->
dir
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
return
ref
;
...
...
@@ -1662,7 +1665,7 @@ static const Folder3Vtbl FolderImpl_Vtbl = {
FolderImpl_put_ShowWebViewBarricade
};
static
HRESULT
Folder_Constructor
(
VARIANT
*
dir
,
IShellFolder2
*
folder
,
LPITEMIDLIST
pidl
,
Folder
**
ret
)
static
HRESULT
Folder_Constructor
(
IShellFolder2
*
folder
,
LPITEMIDLIST
pidl
,
Folder
**
ret
)
{
PCUITEMID_CHILD
last_part
;
IShellFolder2
*
parent
;
...
...
@@ -1688,14 +1691,6 @@ static HRESULT Folder_Constructor(VARIANT *dir, IShellFolder2 *folder, LPITEMIDL
IShellDispatch_Constructor
(
NULL
,
&
IID_IDispatch
,
(
void
**
)
&
This
->
application
);
VariantInit
(
&
This
->
dir
);
hr
=
VariantCopy
(
&
This
->
dir
,
dir
);
if
(
FAILED
(
hr
))
{
HeapFree
(
GetProcessHeap
(),
0
,
This
);
return
E_OUTOFMEMORY
;
}
*
ret
=
(
Folder
*
)
&
This
->
Folder3_iface
;
return
hr
;
}
...
...
@@ -1880,7 +1875,7 @@ static HRESULT WINAPI ShellDispatch_NameSpace(IShellDispatch6 *iface,
if
(
FAILED
(
hr
))
return
S_FALSE
;
return
Folder_Constructor
(
&
dir
,
folder
,
pidl
,
ret
);
return
Folder_Constructor
(
folder
,
pidl
,
ret
);
}
static
HRESULT
WINAPI
ShellDispatch_BrowseForFolder
(
IShellDispatch6
*
iface
,
...
...
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