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
514521bf
Commit
514521bf
authored
Sep 02, 2003
by
Rolf Kalbermatter
Committed by
Alexandre Julliard
Sep 02, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make the different helper functions all return actual error codes.
Avoid code duplication between ANSI and Unicode variant of those functions.
parent
3a35544d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
94 additions
and
90 deletions
+94
-90
shlfileop.c
dlls/shell32/shlfileop.c
+94
-90
No files found.
dlls/shell32/shlfileop.c
View file @
514521bf
...
@@ -52,14 +52,14 @@ WCHAR wWildcardFile[] = {'*','.','*',0};
...
@@ -52,14 +52,14 @@ WCHAR wWildcardFile[] = {'*','.','*',0};
WCHAR
wWildcardChars
[]
=
{
'*'
,
'?'
,
0
};
WCHAR
wWildcardChars
[]
=
{
'*'
,
'?'
,
0
};
WCHAR
wBackslash
[]
=
{
'\\'
,
0
};
WCHAR
wBackslash
[]
=
{
'\\'
,
0
};
static
BOOL
SHNotifyCreateDirectoryA
(
LPCSTR
path
,
LPSECURITY_ATTRIBUTES
sec
);
static
DWORD
SHNotifyCreateDirectoryA
(
LPCSTR
path
,
LPSECURITY_ATTRIBUTES
sec
);
static
BOOL
SHNotifyCreateDirectoryW
(
LPCWSTR
path
,
LPSECURITY_ATTRIBUTES
sec
);
static
DWORD
SHNotifyCreateDirectoryW
(
LPCWSTR
path
,
LPSECURITY_ATTRIBUTES
sec
);
static
BOOL
SHNotifyRemoveDirectoryA
(
LPCSTR
path
);
static
DWORD
SHNotifyRemoveDirectoryA
(
LPCSTR
path
);
static
BOOL
SHNotifyRemoveDirectoryW
(
LPCWSTR
path
);
static
DWORD
SHNotifyRemoveDirectoryW
(
LPCWSTR
path
);
static
BOOL
SHNotifyDeleteFileA
(
LPCSTR
path
);
static
DWORD
SHNotifyDeleteFileA
(
LPCSTR
path
);
static
BOOL
SHNotifyDeleteFileW
(
LPCWSTR
path
);
static
DWORD
SHNotifyDeleteFileW
(
LPCWSTR
path
);
static
BOOL
SHNotifyMoveFileW
(
LPCWSTR
src
,
LPCWSTR
dest
);
static
DWORD
SHNotifyMoveFileW
(
LPCWSTR
src
,
LPCWSTR
dest
,
BOOL
bRenameIfExists
);
static
BOOL
SHNotifyCopyFileW
(
LPCWSTR
src
,
LPCWSTR
dest
,
BOOL
bRenameIfExists
);
static
DWORD
SHNotifyCopyFileW
(
LPCWSTR
src
,
LPCWSTR
dest
,
BOOL
bRenameIfExists
);
typedef
struct
typedef
struct
{
{
...
@@ -156,12 +156,12 @@ BOOL SHELL_DeleteDirectoryA(LPCSTR pszDir, BOOL bShowUI)
...
@@ -156,12 +156,12 @@ BOOL SHELL_DeleteDirectoryA(LPCSTR pszDir, BOOL bShowUI)
if
(
FILE_ATTRIBUTE_DIRECTORY
&
wfd
.
dwFileAttributes
)
if
(
FILE_ATTRIBUTE_DIRECTORY
&
wfd
.
dwFileAttributes
)
ret
=
SHELL_DeleteDirectoryA
(
szTemp
,
FALSE
);
ret
=
SHELL_DeleteDirectoryA
(
szTemp
,
FALSE
);
else
else
ret
=
SHNotifyDeleteFileA
(
szTemp
);
ret
=
(
SHNotifyDeleteFileA
(
szTemp
)
==
ERROR_SUCCESS
);
}
while
(
ret
&&
FindNextFileA
(
hFind
,
&
wfd
));
}
while
(
ret
&&
FindNextFileA
(
hFind
,
&
wfd
));
}
}
FindClose
(
hFind
);
FindClose
(
hFind
);
if
(
ret
)
if
(
ret
)
ret
=
SHNotifyRemoveDirectoryA
(
pszDir
);
ret
=
(
SHNotifyRemoveDirectoryA
(
pszDir
)
==
ERROR_SUCCESS
);
return
ret
;
return
ret
;
}
}
...
@@ -191,12 +191,12 @@ BOOL SHELL_DeleteDirectoryW(LPCWSTR pszDir, BOOL bShowUI)
...
@@ -191,12 +191,12 @@ BOOL SHELL_DeleteDirectoryW(LPCWSTR pszDir, BOOL bShowUI)
if
(
FILE_ATTRIBUTE_DIRECTORY
&
wfd
.
dwFileAttributes
)
if
(
FILE_ATTRIBUTE_DIRECTORY
&
wfd
.
dwFileAttributes
)
ret
=
SHELL_DeleteDirectoryW
(
szTemp
,
FALSE
);
ret
=
SHELL_DeleteDirectoryW
(
szTemp
,
FALSE
);
else
else
ret
=
SHNotifyDeleteFileW
(
szTemp
);
ret
=
(
SHNotifyDeleteFileW
(
szTemp
)
==
ERROR_SUCCESS
);
}
while
(
ret
&&
FindNextFileW
(
hFind
,
&
wfd
));
}
while
(
ret
&&
FindNextFileW
(
hFind
,
&
wfd
));
}
}
FindClose
(
hFind
);
FindClose
(
hFind
);
if
(
ret
)
if
(
ret
)
ret
=
SHNotifyRemoveDirectoryW
(
pszDir
);
ret
=
(
SHNotifyRemoveDirectoryW
(
pszDir
)
==
ERROR_SUCCESS
);
return
ret
;
return
ret
;
}
}
...
@@ -208,7 +208,7 @@ BOOL SHELL_DeleteFileA(LPCSTR pszFile, BOOL bShowUI)
...
@@ -208,7 +208,7 @@ BOOL SHELL_DeleteFileA(LPCSTR pszFile, BOOL bShowUI)
if
(
bShowUI
&&
!
SHELL_ConfirmDialog
(
ASK_DELETE_FILE
,
pszFile
))
if
(
bShowUI
&&
!
SHELL_ConfirmDialog
(
ASK_DELETE_FILE
,
pszFile
))
return
FALSE
;
return
FALSE
;
return
SHNotifyDeleteFileA
(
pszFile
);
return
(
SHNotifyDeleteFileA
(
pszFile
)
==
ERROR_SUCCESS
);
}
}
BOOL
SHELL_DeleteFileW
(
LPCWSTR
pszFile
,
BOOL
bShowUI
)
BOOL
SHELL_DeleteFileW
(
LPCWSTR
pszFile
,
BOOL
bShowUI
)
...
@@ -216,7 +216,7 @@ BOOL SHELL_DeleteFileW(LPCWSTR pszFile, BOOL bShowUI)
...
@@ -216,7 +216,7 @@ BOOL SHELL_DeleteFileW(LPCWSTR pszFile, BOOL bShowUI)
if
(
bShowUI
&&
!
SHELL_ConfirmDialogW
(
ASK_DELETE_FILE
,
pszFile
))
if
(
bShowUI
&&
!
SHELL_ConfirmDialogW
(
ASK_DELETE_FILE
,
pszFile
))
return
FALSE
;
return
FALSE
;
return
SHNotifyDeleteFileW
(
pszFile
);
return
(
SHNotifyDeleteFileW
(
pszFile
)
==
ERROR_SUCCESS
);
}
}
/**************************************************************************
/**************************************************************************
...
@@ -234,37 +234,41 @@ BOOL SHELL_DeleteFileW(LPCWSTR pszFile, BOOL bShowUI)
...
@@ -234,37 +234,41 @@ BOOL SHELL_DeleteFileW(LPCWSTR pszFile, BOOL bShowUI)
* Verified on Win98 / IE 5 (SHELL32 4.72, March 1999 build) to be ANSI.
* Verified on Win98 / IE 5 (SHELL32 4.72, March 1999 build) to be ANSI.
* This is Unicode on NT/2000
* This is Unicode on NT/2000
*/
*/
static
BOOL
SHNotifyCreateDirectoryA
(
LPCSTR
path
,
LPSECURITY_ATTRIBUTES
sec
)
static
DWORD
SHNotifyCreateDirectoryA
(
LPCSTR
path
,
LPSECURITY_ATTRIBUTES
sec
)
{
{
BOOL
ret
;
WCHAR
wPath
[
MAX_PATH
]
;
TRACE
(
"(%s, %p)
\n
"
,
debugstr_a
(
path
),
sec
);
TRACE
(
"(%s, %p)
\n
"
,
debugstr_a
(
path
),
sec
);
ret
=
CreateDirectoryA
(
path
,
sec
);
MultiByteToWideChar
(
CP_ACP
,
0
,
path
,
-
1
,
wPath
,
MAX_PATH
);
if
(
ret
)
return
SHNotifyCreateDirectoryW
(
wPath
,
sec
);
{
SHChangeNotify
(
SHCNE_MKDIR
,
SHCNF_PATHA
,
path
,
NULL
);
}
return
ret
;
}
}
static
BOOL
SHNotifyCreateDirectoryW
(
LPCWSTR
path
,
LPSECURITY_ATTRIBUTES
sec
)
static
DWORD
SHNotifyCreateDirectoryW
(
LPCWSTR
path
,
LPSECURITY_ATTRIBUTES
sec
)
{
{
BOOL
ret
;
TRACE
(
"(%s, %p)
\n
"
,
debugstr_w
(
path
),
sec
);
TRACE
(
"(%s, %p)
\n
"
,
debugstr_w
(
path
),
sec
);
ret
=
CreateDirectoryW
(
path
,
sec
);
if
(
StrPBrkW
(
path
,
wWildcardChars
))
if
(
ret
)
{
/* FIXME: This test is currently necessary since our CreateDirectory
implementation does create directories with wildcard characters
without objection!! Once this is fixed, this here can go away. */
SetLastError
(
ERROR_INVALID_NAME
);
return
ERROR_INVALID_NAME
;
}
if
(
CreateDirectoryW
(
path
,
sec
))
{
{
SHChangeNotify
(
SHCNE_MKDIR
,
SHCNF_PATHW
,
path
,
NULL
);
SHChangeNotify
(
SHCNE_MKDIR
,
SHCNF_PATHW
,
path
,
NULL
);
return
ERROR_SUCCESS
;
}
}
return
ret
;
return
GetLastError
()
;
}
}
BOOL
WINAPI
Win32CreateDirectoryAW
(
LPCVOID
path
,
LPSECURITY_ATTRIBUTES
sec
)
BOOL
WINAPI
Win32CreateDirectoryAW
(
LPCVOID
path
,
LPSECURITY_ATTRIBUTES
sec
)
{
{
if
(
SHELL_OsIsUnicode
())
if
(
SHELL_OsIsUnicode
())
return
SHNotifyCreateDirectoryW
(
path
,
sec
);
return
(
SHNotifyCreateDirectoryW
(
path
,
sec
)
==
ERROR_SUCCESS
);
return
SHNotifyCreateDirectoryA
(
path
,
sec
);
return
(
SHNotifyCreateDirectoryA
(
path
,
sec
)
==
ERROR_SUCCESS
);
}
}
/************************************************************************
/************************************************************************
...
@@ -283,28 +287,18 @@ BOOL WINAPI Win32CreateDirectoryAW(LPCVOID path, LPSECURITY_ATTRIBUTES sec)
...
@@ -283,28 +287,18 @@ BOOL WINAPI Win32CreateDirectoryAW(LPCVOID path, LPSECURITY_ATTRIBUTES sec)
* This is Unicode on NT/2000
* This is Unicode on NT/2000
*/
*/
static
BOOL
SHNotifyRemoveDirectoryA
(
LPCSTR
path
)
static
DWORD
SHNotifyRemoveDirectoryA
(
LPCSTR
path
)
{
{
BOOL
ret
;
WCHAR
wPath
[
MAX_PATH
]
;
TRACE
(
"(%s)
\n
"
,
debugstr_a
(
path
));
TRACE
(
"(%s)
\n
"
,
debugstr_a
(
path
));
ret
=
RemoveDirectoryA
(
path
);
MultiByteToWideChar
(
CP_ACP
,
0
,
path
,
-
1
,
wPath
,
MAX_PATH
);
if
(
!
ret
)
return
SHNotifyRemoveDirectoryW
(
wPath
);
{
/* Directory may be write protected */
DWORD
dwAttr
=
GetFileAttributesA
(
path
);
if
(
dwAttr
!=
-
1
&&
dwAttr
&
FILE_ATTRIBUTE_READONLY
)
if
(
SetFileAttributesA
(
path
,
dwAttr
&
~
FILE_ATTRIBUTE_READONLY
))
ret
=
RemoveDirectoryA
(
path
);
}
if
(
ret
)
SHChangeNotify
(
SHCNE_RMDIR
,
SHCNF_PATHA
,
path
,
NULL
);
return
ret
;
}
}
/***********************************************************************/
/***********************************************************************/
static
BOOL
SHNotifyRemoveDirectoryW
(
LPCWSTR
path
)
static
DWORD
SHNotifyRemoveDirectoryW
(
LPCWSTR
path
)
{
{
BOOL
ret
;
BOOL
ret
;
TRACE
(
"(%s)
\n
"
,
debugstr_w
(
path
));
TRACE
(
"(%s)
\n
"
,
debugstr_w
(
path
));
...
@@ -319,8 +313,11 @@ static BOOL SHNotifyRemoveDirectoryW(LPCWSTR path)
...
@@ -319,8 +313,11 @@ static BOOL SHNotifyRemoveDirectoryW(LPCWSTR path)
ret
=
RemoveDirectoryW
(
path
);
ret
=
RemoveDirectoryW
(
path
);
}
}
if
(
ret
)
if
(
ret
)
{
SHChangeNotify
(
SHCNE_RMDIR
,
SHCNF_PATHW
,
path
,
NULL
);
SHChangeNotify
(
SHCNE_RMDIR
,
SHCNF_PATHW
,
path
,
NULL
);
return
ret
;
return
ERROR_SUCCESS
;
}
return
GetLastError
();
}
}
/***********************************************************************/
/***********************************************************************/
...
@@ -328,8 +325,8 @@ static BOOL SHNotifyRemoveDirectoryW(LPCWSTR path)
...
@@ -328,8 +325,8 @@ static BOOL SHNotifyRemoveDirectoryW(LPCWSTR path)
BOOL
WINAPI
Win32RemoveDirectoryAW
(
LPCVOID
path
)
BOOL
WINAPI
Win32RemoveDirectoryAW
(
LPCVOID
path
)
{
{
if
(
SHELL_OsIsUnicode
())
if
(
SHELL_OsIsUnicode
())
return
SHNotifyRemoveDirectoryW
(
path
);
return
(
SHNotifyRemoveDirectoryW
(
path
)
==
ERROR_SUCCESS
);
return
SHNotifyRemoveDirectoryA
(
path
);
return
(
SHNotifyRemoveDirectoryA
(
path
)
==
ERROR_SUCCESS
);
}
}
/************************************************************************
/************************************************************************
...
@@ -348,29 +345,18 @@ BOOL WINAPI Win32RemoveDirectoryAW(LPCVOID path)
...
@@ -348,29 +345,18 @@ BOOL WINAPI Win32RemoveDirectoryAW(LPCVOID path)
* This is Unicode on NT/2000
* This is Unicode on NT/2000
*/
*/
static
BOOL
SHNotifyDeleteFileA
(
LPCSTR
path
)
static
DWORD
SHNotifyDeleteFileA
(
LPCSTR
path
)
{
{
BOOL
ret
;
WCHAR
wPath
[
MAX_PATH
];
TRACE
(
"(%s)
\n
"
,
debugstr_a
(
path
));
TRACE
(
"(%s)
\n
"
,
debugstr_a
(
path
));
ret
=
DeleteFileA
(
path
);
MultiByteToWideChar
(
CP_ACP
,
0
,
path
,
-
1
,
wPath
,
MAX_PATH
);
if
(
!
ret
)
return
SHNotifyDeleteFileW
(
wPath
);
{
/* File may be write protected or a system file */
DWORD
dwAttr
=
GetFileAttributesA
(
path
);
if
((
dwAttr
!=
-
1
)
&&
(
dwAttr
&
(
FILE_ATTRIBUTE_READONLY
|
FILE_ATTRIBUTE_SYSTEM
)))
if
(
SetFileAttributesA
(
path
,
dwAttr
&
~
(
FILE_ATTRIBUTE_READONLY
|
FILE_ATTRIBUTE_SYSTEM
)))
ret
=
DeleteFileA
(
path
);
}
if
(
ret
)
SHChangeNotify
(
SHCNE_DELETE
,
SHCNF_PATHA
,
path
,
NULL
);
return
ret
;
}
}
/***********************************************************************/
/***********************************************************************/
static
BOOL
SHNotifyDeleteFileW
(
LPCWSTR
path
)
static
DWORD
SHNotifyDeleteFileW
(
LPCWSTR
path
)
{
{
BOOL
ret
;
BOOL
ret
;
...
@@ -386,8 +372,11 @@ static BOOL SHNotifyDeleteFileW(LPCWSTR path)
...
@@ -386,8 +372,11 @@ static BOOL SHNotifyDeleteFileW(LPCWSTR path)
ret
=
DeleteFileW
(
path
);
ret
=
DeleteFileW
(
path
);
}
}
if
(
ret
)
if
(
ret
)
{
SHChangeNotify
(
SHCNE_DELETE
,
SHCNF_PATHW
,
path
,
NULL
);
SHChangeNotify
(
SHCNE_DELETE
,
SHCNF_PATHW
,
path
,
NULL
);
return
ret
;
return
ERROR_SUCCESS
;
}
return
GetLastError
();
}
}
/***********************************************************************/
/***********************************************************************/
...
@@ -395,8 +384,8 @@ static BOOL SHNotifyDeleteFileW(LPCWSTR path)
...
@@ -395,8 +384,8 @@ static BOOL SHNotifyDeleteFileW(LPCWSTR path)
DWORD
WINAPI
Win32DeleteFileAW
(
LPCVOID
path
)
DWORD
WINAPI
Win32DeleteFileAW
(
LPCVOID
path
)
{
{
if
(
SHELL_OsIsUnicode
())
if
(
SHELL_OsIsUnicode
())
return
SHNotifyDeleteFileW
(
path
);
return
(
SHNotifyDeleteFileW
(
path
)
==
ERROR_SUCCESS
);
return
SHNotifyDeleteFileA
(
path
);
return
(
SHNotifyDeleteFileA
(
path
)
==
ERROR_SUCCESS
);
}
}
/************************************************************************
/************************************************************************
...
@@ -407,15 +396,17 @@ DWORD WINAPI Win32DeleteFileAW(LPCVOID path)
...
@@ -407,15 +396,17 @@ DWORD WINAPI Win32DeleteFileAW(LPCVOID path)
* PARAMS
* PARAMS
* src [I] path to source file to move
* src [I] path to source file to move
* dest [I] path to target file to move to
* dest [I] path to target file to move to
* bRename [I] if TRUE, the target file will be renamed if a
* file with this name already exists
*
*
* RETURNS
* RETURNS
*
TRUE if successful, FALSE otherwise
*
ERORR_SUCCESS if successful
*/
*/
static
BOOL
SHNotifyMoveFileW
(
LPCWSTR
src
,
LPCWSTR
dest
)
static
DWORD
SHNotifyMoveFileW
(
LPCWSTR
src
,
LPCWSTR
dest
,
BOOL
bRename
)
{
{
BOOL
ret
;
BOOL
ret
;
TRACE
(
"(%s %s
)
\n
"
,
debugstr_w
(
src
),
debugstr_w
(
dest
)
);
TRACE
(
"(%s %s
%s)
\n
"
,
debugstr_w
(
src
),
debugstr_w
(
dest
),
bRename
?
"renameIfExists"
:
""
);
ret
=
MoveFileW
(
src
,
dest
);
ret
=
MoveFileW
(
src
,
dest
);
if
(
!
ret
)
if
(
!
ret
)
...
@@ -425,10 +416,23 @@ static BOOL SHNotifyMoveFileW(LPCWSTR src, LPCWSTR dest)
...
@@ -425,10 +416,23 @@ static BOOL SHNotifyMoveFileW(LPCWSTR src, LPCWSTR dest)
if
((
dwAttr
!=
-
1
)
&&
(
dwAttr
&
(
FILE_ATTRIBUTE_READONLY
|
FILE_ATTRIBUTE_SYSTEM
)))
if
((
dwAttr
!=
-
1
)
&&
(
dwAttr
&
(
FILE_ATTRIBUTE_READONLY
|
FILE_ATTRIBUTE_SYSTEM
)))
if
(
SetFileAttributesW
(
src
,
dwAttr
&
~
(
FILE_ATTRIBUTE_READONLY
|
FILE_ATTRIBUTE_SYSTEM
)))
if
(
SetFileAttributesW
(
src
,
dwAttr
&
~
(
FILE_ATTRIBUTE_READONLY
|
FILE_ATTRIBUTE_SYSTEM
)))
ret
=
MoveFileW
(
src
,
dest
);
ret
=
MoveFileW
(
src
,
dest
);
if
(
!
ret
&&
bRename
)
{
/* Destination file probably exists */
dwAttr
=
GetFileAttributesW
(
dest
);
if
(
dwAttr
!=
-
1
)
{
FIXME
(
"Rename on move to existing file not implemented!"
);
}
}
}
}
if
(
ret
)
if
(
ret
)
{
SHChangeNotify
(
SHCNE_RENAMEITEM
,
SHCNF_PATHW
,
src
,
dest
);
SHChangeNotify
(
SHCNE_RENAMEITEM
,
SHCNF_PATHW
,
src
,
dest
);
return
ret
;
return
ERROR_SUCCESS
;
}
return
GetLastError
();
}
}
/************************************************************************
/************************************************************************
...
@@ -443,9 +447,9 @@ static BOOL SHNotifyMoveFileW(LPCWSTR src, LPCWSTR dest)
...
@@ -443,9 +447,9 @@ static BOOL SHNotifyMoveFileW(LPCWSTR src, LPCWSTR dest)
* file with this name already exists
* file with this name already exists
*
*
* RETURNS
* RETURNS
*
TRUE if successful, FALSE otherwise
*
ERROR_SUCCESS if successful
*/
*/
static
BOOL
SHNotifyCopyFileW
(
LPCWSTR
src
,
LPCWSTR
dest
,
BOOL
bRename
)
static
DWORD
SHNotifyCopyFileW
(
LPCWSTR
src
,
LPCWSTR
dest
,
BOOL
bRename
)
{
{
BOOL
ret
;
BOOL
ret
;
...
@@ -462,8 +466,11 @@ static BOOL SHNotifyCopyFileW(LPCWSTR src, LPCWSTR dest, BOOL bRename)
...
@@ -462,8 +466,11 @@ static BOOL SHNotifyCopyFileW(LPCWSTR src, LPCWSTR dest, BOOL bRename)
}
}
}
}
if
(
ret
)
if
(
ret
)
{
SHChangeNotify
(
SHCNE_CREATE
,
SHCNF_PATHW
,
dest
,
NULL
);
SHChangeNotify
(
SHCNE_CREATE
,
SHCNF_PATHW
,
dest
,
NULL
);
return
ret
;
return
ERROR_SUCCESS
;
}
return
GetLastError
();
}
}
/*************************************************************************
/*************************************************************************
...
@@ -507,6 +514,7 @@ DWORD WINAPI SHCreateDirectory(HWND hWnd, LPCVOID path)
...
@@ -507,6 +514,7 @@ DWORD WINAPI SHCreateDirectory(HWND hWnd, LPCVOID path)
* RETURNS
* RETURNS
* ERRROR_SUCCESS or one of the following values:
* ERRROR_SUCCESS or one of the following values:
* ERROR_BAD_PATHNAME if the path is relative
* ERROR_BAD_PATHNAME if the path is relative
* ERORO_INVALID_NAME if the path contains invalid chars
* ERROR_FILE_EXISTS when a file with that name exists
* ERROR_FILE_EXISTS when a file with that name exists
* ERROR_ALREADY_EXISTS when the directory already exists
* ERROR_ALREADY_EXISTS when the directory already exists
* ERROR_FILENAME_EXCED_RANGE if the filename was to long to process
* ERROR_FILENAME_EXCED_RANGE if the filename was to long to process
...
@@ -525,28 +533,24 @@ DWORD WINAPI SHCreateDirectoryExA(HWND hWnd, LPCSTR path, LPSECURITY_ATTRIBUTES
...
@@ -525,28 +533,24 @@ DWORD WINAPI SHCreateDirectoryExA(HWND hWnd, LPCSTR path, LPSECURITY_ATTRIBUTES
*/
*/
DWORD
WINAPI
SHCreateDirectoryExW
(
HWND
hWnd
,
LPCWSTR
path
,
LPSECURITY_ATTRIBUTES
sec
)
DWORD
WINAPI
SHCreateDirectoryExW
(
HWND
hWnd
,
LPCWSTR
path
,
LPSECURITY_ATTRIBUTES
sec
)
{
{
DWORD
ret
=
ERROR_
SUCCESS
;
DWORD
ret
=
ERROR_
BAD_PATHNAME
;
TRACE
(
"(%p, %s, %p)
\n
"
,
hWnd
,
debugstr_w
(
path
),
sec
);
TRACE
(
"(%p, %s, %p)
\n
"
,
hWnd
,
debugstr_w
(
path
),
sec
);
if
(
PathIsRelativeW
(
path
))
if
(
PathIsRelativeW
(
path
))
{
{
ret
=
ERROR_BAD_PATHNAME
;
SetLastError
(
ret
);
SetLastError
(
ERROR_BAD_PATHNAME
);
}
}
else
else
{
{
if
(
!
SHNotifyCreateDirectoryW
(
path
,
sec
))
ret
=
SHNotifyCreateDirectoryW
(
path
,
sec
);
if
(
ret
!=
ERROR_FILE_EXISTS
&&
ret
!=
ERROR_ALREADY_EXISTS
&&
ret
!=
ERROR_FILENAME_EXCED_RANGE
)
{
{
ret
=
GetLastError
();
/* handling network file names?
if
(
ret
!=
ERROR_FILE_EXISTS
&&
lstrcpynW(pathName, path, MAX_PATH);
ret
!=
ERROR_ALREADY_EXISTS
&&
lpStr = PathAddBackslashW(pathName);*/
ret
!=
ERROR_FILENAME_EXCED_RANGE
)
FIXME
(
"Semi-stub, non zero hWnd should be used somehow?"
);
{
/* handling network file names?
lstrcpynW(pathName, path, MAX_PATH);
lpStr = PathAddBackslashW(pathName);*/
FIXME
(
"Semi-stub, non zero hWnd should be used somehow?"
);
}
}
}
}
}
return
ret
;
return
ret
;
...
@@ -988,7 +992,7 @@ DWORD WINAPI SHFileOperationW(LPSHFILEOPSTRUCTW lpFileOp)
...
@@ -988,7 +992,7 @@ DWORD WINAPI SHFileOperationW(LPSHFILEOPSTRUCTW lpFileOp)
/* TODO: Check the SHELL_DeleteFileOrDirectoryW() function in shell32.dll */
/* TODO: Check the SHELL_DeleteFileOrDirectoryW() function in shell32.dll */
if
(
IsAttribFile
(
wfd
.
dwFileAttributes
))
if
(
IsAttribFile
(
wfd
.
dwFileAttributes
))
{
{
nFileOp
.
fAnyOperationsAborted
=
(
!
SHNotifyDeleteFileW
(
pTempFrom
)
);
nFileOp
.
fAnyOperationsAborted
=
(
SHNotifyDeleteFileW
(
pTempFrom
)
!=
ERROR_SUCCESS
);
retCode
=
0x78
;
/* value unknown */
retCode
=
0x78
;
/* value unknown */
}
}
else
else
...
@@ -1042,7 +1046,7 @@ DWORD WINAPI SHFileOperationW(LPSHFILEOPSTRUCTW lpFileOp)
...
@@ -1042,7 +1046,7 @@ DWORD WINAPI SHFileOperationW(LPSHFILEOPSTRUCTW lpFileOp)
goto
shfileop_error
;
goto
shfileop_error
;
}
}
/* we use SHNotifyMoveFile() instead MoveFileW */
/* we use SHNotifyMoveFile() instead MoveFileW */
if
(
!
SHNotifyMoveFileW
(
pTempFrom
,
pTempTo
)
)
if
(
SHNotifyMoveFileW
(
pTempFrom
,
pTempTo
,
nFileOp
.
fFlags
&
FOF_RENAMEONCOLLISION
)
!=
ERROR_SUCCESS
)
{
{
/* we need still the value for the returncode, we use the mostly assumed */
/* we need still the value for the returncode, we use the mostly assumed */
retCode
=
0xb7
;
retCode
=
0xb7
;
...
@@ -1214,7 +1218,7 @@ DWORD WINAPI SHFileOperationW(LPSHFILEOPSTRUCTW lpFileOp)
...
@@ -1214,7 +1218,7 @@ DWORD WINAPI SHFileOperationW(LPSHFILEOPSTRUCTW lpFileOp)
retCode
=
0x73
;
retCode
=
0x73
;
goto
shfileop_error
;
goto
shfileop_error
;
}
}
if
(
!
(
SHNotifyCopyFileW
(
pTempFrom
,
pTempTo
,
nFileOp
.
fFlags
&
FOF_RENAMEONCOLLISION
))
)
if
(
SHNotifyCopyFileW
(
pTempFrom
,
pTempTo
,
nFileOp
.
fFlags
&
FOF_RENAMEONCOLLISION
)
!=
ERROR_SUCCESS
)
{
{
retCode
=
0x77
;
/* value unknown */
retCode
=
0x77
;
/* value unknown */
goto
shfileop_error
;
goto
shfileop_error
;
...
...
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