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
2d58a624
Commit
2d58a624
authored
Jan 14, 2005
by
Joris Huizer
Committed by
Alexandre Julliard
Jan 14, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- add file_operation_delete
- add file_operation_checkFlags - use these in SHFileOperationW replacing inline code
parent
939179d6
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
95 additions
and
69 deletions
+95
-69
shlfileop.c
dlls/shell32/shlfileop.c
+95
-69
No files found.
dlls/shell32/shlfileop.c
View file @
2d58a624
...
...
@@ -861,6 +861,90 @@ static const char * debug_shfileops_action( DWORD op )
#define ERROR_SHELL_INTERNAL_FILE_NOT_FOUND 1026
#define HIGH_ADR (LPWSTR)0xffffffff
static
int
file_operation_delete
(
WIN32_FIND_DATAW
*
wfd
,
SHFILEOPSTRUCTW
nFileOp
,
LPWSTR
pFromFile
,
LPWSTR
pTempFrom
,
HANDLE
*
hFind
)
{
LPWSTR
lpFileName
;
BOOL
b_Mask
=
(
NULL
!=
StrPBrkW
(
&
pFromFile
[
1
],
wWildcardChars
));
int
retCode
=
0
;
do
{
lpFileName
=
wfd
->
cAlternateFileName
;
if
(
!
lpFileName
[
0
])
lpFileName
=
wfd
->
cFileName
;
if
(
IsDotDir
(
lpFileName
)
||
((
b_Mask
)
&&
IsAttribDir
(
wfd
->
dwFileAttributes
)
&&
(
nFileOp
.
fFlags
&
FOF_FILESONLY
)))
continue
;
SHFileStrCpyCatW
(
&
pFromFile
[
1
],
lpFileName
,
NULL
);
/* TODO: Check the SHELL_DeleteFileOrDirectoryW() function in shell32.dll */
if
(
IsAttribFile
(
wfd
->
dwFileAttributes
))
{
if
(
SHNotifyDeleteFileW
(
pTempFrom
)
!=
ERROR_SUCCESS
)
{
nFileOp
.
fAnyOperationsAborted
=
TRUE
;
retCode
=
0x78
;
/* value unknown */
}
}
else
if
(
!
SHELL_DeleteDirectoryW
(
pTempFrom
,
(
!
(
nFileOp
.
fFlags
&
FOF_NOCONFIRMATION
))))
{
nFileOp
.
fAnyOperationsAborted
=
TRUE
;
retCode
=
0x79
;
/* value unknown */
}
}
while
(
!
nFileOp
.
fAnyOperationsAborted
&&
FindNextFileW
(
*
hFind
,
wfd
));
FindClose
(
*
hFind
);
*
hFind
=
INVALID_HANDLE_VALUE
;
return
retCode
;
}
/*
* Summary of flags:
*
* implemented flags:
* FOF_MULTIDESTFILES, FOF_NOCONFIRMATION, FOF_FILESONLY
*
* unimplememented and ignored flags:
* FOF_CONFIRMMOUSE, FOF_SILENT, FOF_NOCONFIRMMKDIR,
* FOF_SIMPLEPROGRESS, FOF_NOCOPYSECURITYATTRIBS
*
* partially implemented, breaks if file exists:
* FOF_RENAMEONCOLLISION
*
* unimplemented and break if any other flag set:
* FOF_ALLOWUNDO, FOF_WANTMAPPINGHANDLE
*/
static
int
file_operation_checkFlags
(
SHFILEOPSTRUCTW
nFileOp
)
{
FILEOP_FLAGS
OFl
=
((
FILEOP_FLAGS
)
nFileOp
.
fFlags
&
0xfff
);
long
FuncSwitch
=
(
nFileOp
.
wFunc
&
FO_MASK
);
long
level
=
nFileOp
.
wFunc
>>
4
;
TRACE
(
"%s level=%ld nFileOp.fFlags=0x%x
\n
"
,
debug_shfileops_action
(
FuncSwitch
),
level
,
nFileOp
.
fFlags
);
/* OFl &= (-1 - (FOF_MULTIDESTFILES | FOF_FILESONLY)); */
/* OFl ^= (FOF_SILENT | FOF_NOCONFIRMATION | FOF_SIMPLEPROGRESS | FOF_NOCONFIRMMKDIR); */
OFl
&=
(
~
(
FOF_MULTIDESTFILES
|
FOF_NOCONFIRMATION
|
FOF_FILESONLY
));
/* implemented */
OFl
^=
(
FOF_SILENT
|
FOF_NOCONFIRMMKDIR
|
FOF_NOERRORUI
|
FOF_NOCOPYSECURITYATTRIBS
);
/* ignored, if one */
OFl
&=
(
~
FOF_SIMPLEPROGRESS
);
/* ignored, only with FOF_SILENT */
if
(
OFl
)
{
if
(
OFl
&
(
~
(
FOF_CONFIRMMOUSE
|
FOF_SILENT
|
FOF_RENAMEONCOLLISION
|
FOF_NOCONFIRMMKDIR
|
FOF_NOERRORUI
|
FOF_NOCOPYSECURITYATTRIBS
)))
{
TRACE
(
"%s level=%ld lpFileOp->fFlags=0x%x not implemented, Aborted=TRUE, stub
\n
"
,
debug_shfileops_action
(
FuncSwitch
),
level
,
OFl
);
return
0x403
;
/* 1027, we need an extension to shlfileop */
}
else
{
TRACE
(
"%s level=%ld lpFileOp->fFlags=0x%x not fully implemented, stub
\n
"
,
debug_shfileops_action
(
FuncSwitch
),
level
,
OFl
);
}
}
return
0
;
}
/*************************************************************************
* SHFileOperationW [SHELL32.@]
*
...
...
@@ -884,8 +968,6 @@ int WINAPI SHFileOperationW(LPSHFILEOPSTRUCTW lpFileOp)
int
retCode
=
0
;
DWORD
ToAttr
;
DWORD
ToPathAttr
;
DWORD
FromPathAttr
;
FILEOP_FLAGS
OFl
=
((
FILEOP_FLAGS
)
lpFileOp
->
fFlags
&
0xfff
);
BOOL
b_Multi
=
(
nFileOp
.
fFlags
&
FOF_MULTIDESTFILES
);
...
...
@@ -904,6 +986,8 @@ int WINAPI SHFileOperationW(LPSHFILEOPSTRUCTW lpFileOp)
long
FuncSwitch
=
(
nFileOp
.
wFunc
&
FO_MASK
);
long
level
=
nFileOp
.
wFunc
>>
4
;
int
ret
;
/* default no error */
nFileOp
.
fAnyOperationsAborted
=
FALSE
;
...
...
@@ -932,47 +1016,12 @@ int WINAPI SHFileOperationW(LPSHFILEOPSTRUCTW lpFileOp)
* create dir 0 0 0 0 0 0 1 0
*/
/*
* Summary of flags:
*
* implemented flags:
* FOF_MULTIDESTFILES, FOF_NOCONFIRMATION, FOF_FILESONLY
*
* unimplememented and ignored flags:
* FOF_CONFIRMMOUSE, FOF_SILENT, FOF_NOCONFIRMMKDIR,
* FOF_SIMPLEPROGRESS, FOF_NOCOPYSECURITYATTRIBS
*
* partially implemented, breaks if file exists:
* FOF_RENAMEONCOLLISION
*
* unimplemented and break if any other flag set:
* FOF_ALLOWUNDO, FOF_WANTMAPPINGHANDLE
*/
TRACE
(
"%s level=%ld nFileOp.fFlags=0x%x
\n
"
,
debug_shfileops_action
(
FuncSwitch
),
level
,
lpFileOp
->
fFlags
);
/* OFl &= (-1 - (FOF_MULTIDESTFILES | FOF_FILESONLY)); */
/* OFl ^= (FOF_SILENT | FOF_NOCONFIRMATION | FOF_SIMPLEPROGRESS | FOF_NOCONFIRMMKDIR); */
OFl
&=
(
~
(
FOF_MULTIDESTFILES
|
FOF_NOCONFIRMATION
|
FOF_FILESONLY
));
/* implemented */
OFl
^=
(
FOF_SILENT
|
FOF_NOCONFIRMMKDIR
|
FOF_NOERRORUI
|
FOF_NOCOPYSECURITYATTRIBS
);
/* ignored, if one */
OFl
&=
(
~
FOF_SIMPLEPROGRESS
);
/* ignored, only with FOF_SILENT */
if
(
OFl
)
{
if
(
OFl
&
(
~
(
FOF_CONFIRMMOUSE
|
FOF_SILENT
|
FOF_RENAMEONCOLLISION
|
FOF_NOCONFIRMMKDIR
|
FOF_NOERRORUI
|
FOF_NOCOPYSECURITYATTRIBS
)))
ret
=
file_operation_checkFlags
(
nFileOp
);
if
(
ret
!=
0
)
{
TRACE
(
"%s level=%ld lpFileOp->fFlags=0x%x not implemented, Aborted=TRUE, stub
\n
"
,
debug_shfileops_action
(
FuncSwitch
),
level
,
OFl
);
retCode
=
0x403
;
/* 1027, we need an extension to shlfileop */
retCode
=
ret
;
goto
shfileop_end
;
}
else
{
TRACE
(
"%s level=%ld lpFileOp->fFlags=0x%x not fully implemented, stub
\n
"
,
debug_shfileops_action
(
FuncSwitch
),
level
,
OFl
);
}
}
if
((
pNextFrom
)
&&
(
!
(
b_MultiTo
)
||
(
pNextTo
)))
{
...
...
@@ -1061,6 +1110,7 @@ int WINAPI SHFileOperationW(LPSHFILEOPSTRUCTW lpFileOp)
{
if
((
FO_DELETE
==
FuncSwitch
)
&&
(
b_Mask
))
{
DWORD
FromPathAttr
;
pFromFile
[
0
]
=
'\0'
;
FromPathAttr
=
GetFileAttributesW
(
pTempFrom
);
pFromFile
[
0
]
=
'\\'
;
...
...
@@ -1080,37 +1130,13 @@ int WINAPI SHFileOperationW(LPSHFILEOPSTRUCTW lpFileOp)
/* ??? b_Mask = (!SHFileStrICmpA(&pFromFile[1], &wfd.cFileName[0], HIGH_ADR, HIGH_ADR)); */
if
(
!
pTo
)
/* FO_DELETE */
{
do
{
lpFileName
=
wfd
.
cAlternateFileName
;
if
(
!
lpFileName
[
0
])
lpFileName
=
wfd
.
cFileName
;
if
(
IsDotDir
(
lpFileName
)
||
((
b_Mask
)
&&
IsAttribDir
(
wfd
.
dwFileAttributes
)
&&
(
nFileOp
.
fFlags
&
FOF_FILESONLY
)))
continue
;
SHFileStrCpyCatW
(
&
pFromFile
[
1
],
lpFileName
,
NULL
);
/* TODO: Check the SHELL_DeleteFileOrDirectoryW() function in shell32.dll */
if
(
IsAttribFile
(
wfd
.
dwFileAttributes
))
ret
=
file_operation_delete
(
&
wfd
,
nFileOp
,
pFromFile
,
pTempFrom
,
&
hFind
);
/* if ret is not 0, nFileOp.fAnyOperationsAborted is TRUE */
if
(
ret
!=
0
)
{
if
(
SHNotifyDeleteFileW
(
pTempFrom
)
!=
ERROR_SUCCESS
)
{
nFileOp
.
fAnyOperationsAborted
=
TRUE
;
retCode
=
0x78
;
/* value unknown */
}
}
else
{
if
(
!
SHELL_DeleteDirectoryW
(
pTempFrom
,
(
!
(
nFileOp
.
fFlags
&
FOF_NOCONFIRMATION
))))
{
nFileOp
.
fAnyOperationsAborted
=
TRUE
;
retCode
=
0x79
;
/* value unknown */
}
}
}
while
(
!
nFileOp
.
fAnyOperationsAborted
&&
FindNextFileW
(
hFind
,
&
wfd
));
FindClose
(
hFind
);
hFind
=
INVALID_HANDLE_VALUE
;
if
(
nFileOp
.
fAnyOperationsAborted
)
retCode
=
ret
;
goto
shfileop_end
;
}
continue
;
}
/* FO_DELETE ends, pTo must be always valid from here */
...
...
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