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
c4bba67a
Commit
c4bba67a
authored
Sep 27, 2003
by
Rolf Kalbermatter
Committed by
Alexandre Julliard
Sep 27, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix a return value in SHFileOperation and add some extra tests to
internal helper functions necessary to deal with shortcomings of kernel32 functions for the time being.
parent
2999165c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
10 deletions
+26
-10
shlfileop.c
dlls/shell32/shlfileop.c
+19
-7
shlfileop.c
dlls/shell32/tests/shlfileop.c
+7
-3
No files found.
dlls/shell32/shlfileop.c
View file @
c4bba67a
...
...
@@ -258,7 +258,11 @@ static DWORD SHNotifyCreateDirectoryW(LPCWSTR path, LPSECURITY_ATTRIBUTES sec)
implementation does create directories with wildcard characters
without objection!! Once this is fixed, this here can go away. */
SetLastError
(
ERROR_INVALID_NAME
);
#ifdef W98_FO_FUNCTION
/* W98 */
return
ERROR_FILE_NOT_FOUND
;
#else
return
ERROR_INVALID_NAME
;
#endif
}
if
(
CreateDirectoryW
(
path
,
sec
))
...
...
@@ -413,6 +417,19 @@ static DWORD SHNotifyMoveFileW(LPCWSTR src, LPCWSTR dest, BOOL bRename)
TRACE
(
"(%s %s %s)
\n
"
,
debugstr_w
(
src
),
debugstr_w
(
dest
),
bRename
?
"renameIfExists"
:
""
);
if
(
StrPBrkW
(
dest
,
wWildcardChars
))
{
/* FIXME: This test is currently necessary since our MoveFile
implementation does create files with wildcard characters
without objection!! Once this is fixed, this here can go away. */
SetLastError
(
ERROR_INVALID_NAME
);
#ifdef W98_FO_FUNCTION
/* W98 */
return
ERROR_FILE_NOT_FOUND
;
#else
return
ERROR_INVALID_NAME
;
#endif
}
ret
=
MoveFileW
(
src
,
dest
);
if
(
!
ret
)
{
...
...
@@ -946,16 +963,11 @@ DWORD WINAPI SHFileOperationW(LPSHFILEOPSTRUCTW lpFileOp)
if
(
FO_RENAME
==
FuncSwitch
)
{
/* temporary only for FO_RENAME */
/* ??? b_Mask = (NULL != strrbrk(pFrom,"*?")); */
if
(
b_MultiTo
||
b_MultiFrom
||
(
b_Mask
&&
!
b_ToInvalidTail
))
{
/* no work, only RC=0 */
/* ??? nFileOp.fAnyOperationsAborted = TRUE; */
/*#define W98_FO_RENEME */
#ifdef W98_FO_RENEME
goto
shfileop_normal
;
#ifndef W98_FO_FUNCTION
retCode
=
ERROR_GEN_FAILURE
;
/* W2K ERROR_GEN_FAILURE, W98 returns no error */
#endif
retCode
=
0x1
;
/* 1 value unknown, W98 returns no error */
goto
shfileop_error
;
}
}
...
...
dlls/shell32/tests/shlfileop.c
View file @
c4bba67a
...
...
@@ -21,6 +21,7 @@
#include <stdarg.h>
#include <stdio.h>
#define WINE_NOWINSOCK
#include "windef.h"
#include "winbase.h"
#include "wtypes.h"
...
...
@@ -153,6 +154,7 @@ void test_rename()
SHFILEOPSTRUCTA
shfo
,
shfo2
;
CHAR
from
[
MAX_PATH
];
CHAR
to
[
MAX_PATH
];
DWORD
retval
;
shfo
.
hwnd
=
NULL
;
shfo
.
wFunc
=
FO_RENAME
;
...
...
@@ -175,7 +177,8 @@ void test_rename()
set_curr_dir_path
(
from
,
"test1.txt
\0
test2.txt
\0
test4.txt
\0
"
);
set_curr_dir_path
(
to
,
"test6.txt
\0
test7.txt
\0
test8.txt
\0
"
);
ok
(
SHFileOperationA
(
&
shfo
),
"Can't rename many files"
);
retval
=
SHFileOperationA
(
&
shfo
);
/* W98 returns 0, W2K and newer returns ERROR_GEN_FAILURE, both do nothing */
ok
(
!
retval
||
retval
==
ERROR_GEN_FAILURE
,
"Can't rename many files, retval = %lx"
,
retval
);
ok
(
file_exists
(
".
\\
test1.txt"
),
"The file is not renamed - many files are specified "
);
memcpy
(
&
shfo2
,
&
shfo
,
sizeof
(
SHFILEOPSTRUCTA
));
...
...
@@ -183,14 +186,15 @@ void test_rename()
set_curr_dir_path
(
from
,
"test1.txt
\0
test2.txt
\0
test4.txt
\0
"
);
set_curr_dir_path
(
to
,
"test6.txt
\0
test7.txt
\0
test8.txt
\0
"
);
ok
(
SHFileOperationA
(
&
shfo2
),
"Can't rename many files"
);
retval
=
SHFileOperationA
(
&
shfo2
);
/* W98 returns 0, W2K and newer returns ERROR_GEN_FAILURE, both do nothing */
ok
(
!
retval
||
retval
==
ERROR_GEN_FAILURE
,
"Can't rename many files, retval = %lx"
,
retval
);
ok
(
file_exists
(
".
\\
test1.txt"
),
"The file is not renamed - many files are specified "
);
set_curr_dir_path
(
from
,
"test1.txt
\0
"
);
set_curr_dir_path
(
to
,
"test6.txt
\0
"
);
ok
(
!
SHFileOperationA
(
&
shfo
),
"Rename file"
);
ok
(
!
file_exists
(
".
\\
test1.txt"
),
"The file is renamed"
);
ok
(
file_exists
(
".
\\
test6.txt"
),
"The file is renamed
"
);
ok
(
file_exists
(
".
\\
test6.txt"
),
"The file is renamed"
);
set_curr_dir_path
(
from
,
"test6.txt
\0
"
);
set_curr_dir_path
(
to
,
"test1.txt
\0
"
);
ok
(
!
SHFileOperationA
(
&
shfo
),
"Rename file back"
);
...
...
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