Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Plan
Wiki
Bugzilla
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
wine
wine
Commits
d46862b4
Commit
d46862b4
authored
10 years ago
by
Piotr Caban
Committed by
Alexandre Julliard
10 years ago
Browse files
Options
Downloads
Patches
Plain Diff
shell32: Handle TRASH_EnumItems failures correctly.
parent
814ab9ee
No related branches found
Branches containing commit
Tags
wine-970616
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dlls/shell32/recyclebin.c
+12
-3
12 additions, 3 deletions
dlls/shell32/recyclebin.c
dlls/shell32/tests/recyclebin.c
+11
-10
11 additions, 10 deletions
dlls/shell32/tests/recyclebin.c
with
23 additions
and
13 deletions
dlls/shell32/recyclebin.c
+
12
−
3
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
]);
...
...
This diff is collapsed.
Click to expand it.
dlls/shell32/tests/recyclebin.c
+
11
−
10
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
));
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment