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
d46862b4
Commit
d46862b4
authored
Jan 30, 2015
by
Piotr Caban
Committed by
Alexandre Julliard
Feb 02, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell32: Handle TRASH_EnumItems failures correctly.
parent
814ab9ee
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
13 deletions
+23
-13
recyclebin.c
dlls/shell32/recyclebin.c
+12
-3
recyclebin.c
dlls/shell32/tests/recyclebin.c
+11
-10
No files found.
dlls/shell32/recyclebin.c
View file @
d46862b4
...
...
@@ -411,7 +411,7 @@ static HRESULT WINAPI RecycleBin_EnumObjects(IShellFolder2 *iface, HWND hwnd, SH
IEnumIDListImpl
*
list
;
LPITEMIDLIST
*
pidls
;
HRESULT
ret
=
E_OUTOFMEMORY
;
int
pidls_count
;
int
pidls_count
=
0
;
int
i
=
0
;
TRACE
(
"(%p, %p, %x, %p)
\n
"
,
This
,
hwnd
,
grfFlags
,
ppenumIDList
);
...
...
@@ -860,10 +860,14 @@ HRESULT WINAPI SHQueryRecycleBinW(LPCWSTR pszRootPath, LPSHQUERYRBINFO pSHQueryR
LPITEMIDLIST
*
apidl
;
INT
cidl
;
INT
i
=
0
;
HRESULT
hr
;
TRACE
(
"(%s, %p)
\n
"
,
debugstr_w
(
pszRootPath
),
pSHQueryRBInfo
);
FIXME
(
"Ignoring pszRootPath=%s
\n
"
,
debugstr_w
(
pszRootPath
));
TRASH_EnumItems
(
&
apidl
,
&
cidl
);
hr
=
TRASH_EnumItems
(
&
apidl
,
&
cidl
);
if
(
FAILED
(
hr
))
return
hr
;
pSHQueryRBInfo
->
i64NumItems
=
cidl
;
pSHQueryRBInfo
->
i64Size
=
0
;
for
(;
i
<
cidl
;
i
++
)
...
...
@@ -894,9 +898,14 @@ HRESULT WINAPI SHEmptyRecycleBinW(HWND hwnd, LPCWSTR pszRootPath, DWORD dwFlags)
INT
cidl
;
INT
i
=
0
;
HRESULT
ret
;
TRACE
(
"(%p, %s, 0x%08x)
\n
"
,
hwnd
,
debugstr_w
(
pszRootPath
)
,
dwFlags
);
FIXME
(
"Ignoring pszRootPath=%s
\n
"
,
debugstr_w
(
pszRootPath
));
TRASH_EnumItems
(
&
apidl
,
&
cidl
);
ret
=
TRASH_EnumItems
(
&
apidl
,
&
cidl
);
if
(
FAILED
(
ret
))
return
ret
;
ret
=
erase_items
(
hwnd
,(
const
LPCITEMIDLIST
*
)
apidl
,
cidl
,
!
(
dwFlags
&
SHERB_NOCONFIRMATION
));
for
(;
i
<
cidl
;
i
++
)
ILFree
(
apidl
[
i
]);
...
...
dlls/shell32/tests/recyclebin.c
View file @
d46862b4
...
...
@@ -70,9 +70,12 @@ static void test_query_recyclebin(void)
ok
(
GetTempFileNameA
(
temp_path
,
"trash"
,
0
,
buf
),
"GetTempFileName failed
\n
"
);
buf
[
strlen
(
buf
)
+
1
]
=
'\0'
;
hr
=
pSHQueryRecycleBinA
(
buf
,
&
info1
);
ok
(
hr
==
S_OK
,
"SHQueryRecycleBinA failed with error 0x%x
\n
"
,
hr
);
ok
(
info1
.
i64Size
!=
0xdeadbeef
,
"i64Size not set
\n
"
);
ok
(
info1
.
i64NumItems
!=
0xdeadbeef
,
"i64NumItems not set
\n
"
);
if
(
hr
!=
S_OK
)
todo_wine
ok
(
hr
==
S_OK
,
"SHQueryRecycleBinA failed with error 0x%x
\n
"
,
hr
);
else
{
ok
(
hr
==
S_OK
,
"SHQueryRecycleBinA failed with error 0x%x
\n
"
,
hr
);
ok
(
info1
.
i64Size
!=
0xdeadbeef
,
"i64Size not set
\n
"
);
ok
(
info1
.
i64NumItems
!=
0xdeadbeef
,
"i64NumItems not set
\n
"
);
}
/*create and send a file to the recycle bin*/
file
=
CreateFileA
(
buf
,
GENERIC_WRITE
,
0
,
NULL
,
CREATE_ALWAYS
,
0
,
NULL
);
ok
(
file
!=
INVALID_HANDLE_VALUE
,
"Failure to open file %s
\n
"
,
buf
);
...
...
@@ -87,13 +90,11 @@ static void test_query_recyclebin(void)
shfo
.
lpszProgressTitle
=
NULL
;
ok
(
!
pSHFileOperationA
(
&
shfo
),
"Deletion was not successful
\n
"
);
hr
=
pSHQueryRecycleBinA
(
buf
,
&
info2
);
ok
(
hr
==
S_OK
,
"SHQueryRecycleBinW failed with error 0x%x
\n
"
,
hr
);
if
(
info2
.
i64Size
!=
info1
.
i64Size
||
info2
.
i64NumItems
!=
info1
.
i64NumItems
)
{
ok
(
info2
.
i64Size
==
info1
.
i64Size
+
written
,
"Expected recycle bin to have 0x%s bytes
\n
"
,
str_from_int64
(
info1
.
i64Size
+
written
));
ok
(
info2
.
i64NumItems
==
info1
.
i64NumItems
+
1
,
"Expected recycle bin to have 0x%s items
\n
"
,
str_from_int64
(
info1
.
i64NumItems
+
1
));
}
else
todo_wine
{
ok
(
info2
.
i64Size
==
info1
.
i64Size
+
written
,
"Expected recycle bin to have 0x%s bytes
\n
"
,
str_from_int64
(
info1
.
i64Size
+
written
));
ok
(
info2
.
i64NumItems
==
info1
.
i64NumItems
+
1
,
"Expected recycle bin to have 0x%s items
\n
"
,
str_from_int64
(
info1
.
i64NumItems
+
1
));
if
(
hr
!=
S_OK
)
todo_wine
ok
(
hr
==
S_OK
,
"SHQueryRecycleBinA failed with error 0x%x
\n
"
,
hr
);
else
{
ok
(
hr
==
S_OK
,
"SHQueryRecycleBinA failed with error 0x%x
\n
"
,
hr
);
ok
(
info2
.
i64Size
==
info1
.
i64Size
+
written
,
"Expected recycle bin to have 0x%s bytes
\n
"
,
str_from_int64
(
info1
.
i64Size
+
written
));
ok
(
info2
.
i64NumItems
==
info1
.
i64NumItems
+
1
,
"Expected recycle bin to have 0x%s items
\n
"
,
str_from_int64
(
info1
.
i64NumItems
+
1
));
}
}
...
...
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