https://git.reactos.org/?p=reactos.git;a=commitdiff;h=0e2bb5b0b80edac9e10783...
commit 0e2bb5b0b80edac9e1078388c9d0b60fba4a55e1 Author: Katayama Hirofumi MZ katayama.hirofumi.mz@gmail.com AuthorDate: Sat Nov 30 15:36:16 2019 +0900 Commit: GitHub noreply@github.com CommitDate: Sat Nov 30 15:36:16 2019 +0900
[SHELL32] Validate file operation (#2085)
- Support FOF_RENAMEONCOLLISION flag of SHFileOperationW. - Add validate_operation function and use it in SHFileOperationW.
CORE-10225 --- dll/win32/shell32/lang/bg-BG.rc | 6 ++ dll/win32/shell32/lang/ca-ES.rc | 6 ++ dll/win32/shell32/lang/cs-CZ.rc | 6 ++ dll/win32/shell32/lang/da-DK.rc | 6 ++ dll/win32/shell32/lang/de-DE.rc | 6 ++ dll/win32/shell32/lang/el-GR.rc | 6 ++ dll/win32/shell32/lang/en-GB.rc | 6 ++ dll/win32/shell32/lang/en-US.rc | 6 ++ dll/win32/shell32/lang/es-ES.rc | 6 ++ dll/win32/shell32/lang/et-EE.rc | 6 ++ dll/win32/shell32/lang/fi-FI.rc | 6 ++ dll/win32/shell32/lang/fr-FR.rc | 6 ++ dll/win32/shell32/lang/he-IL.rc | 6 ++ dll/win32/shell32/lang/hi-IN.rc | 6 ++ dll/win32/shell32/lang/hu-HU.rc | 6 ++ dll/win32/shell32/lang/id-ID.rc | 6 ++ dll/win32/shell32/lang/it-IT.rc | 6 ++ dll/win32/shell32/lang/ja-JP.rc | 6 ++ dll/win32/shell32/lang/ko-KR.rc | 6 ++ dll/win32/shell32/lang/nl-NL.rc | 6 ++ dll/win32/shell32/lang/no-NO.rc | 6 ++ dll/win32/shell32/lang/pl-PL.rc | 6 ++ dll/win32/shell32/lang/pt-BR.rc | 6 ++ dll/win32/shell32/lang/pt-PT.rc | 6 ++ dll/win32/shell32/lang/ro-RO.rc | 6 ++ dll/win32/shell32/lang/ru-RU.rc | 6 ++ dll/win32/shell32/lang/sk-SK.rc | 6 ++ dll/win32/shell32/lang/sl-SI.rc | 6 ++ dll/win32/shell32/lang/sq-AL.rc | 6 ++ dll/win32/shell32/lang/sv-SE.rc | 6 ++ dll/win32/shell32/lang/tr-TR.rc | 6 ++ dll/win32/shell32/lang/uk-UA.rc | 6 ++ dll/win32/shell32/lang/zh-CN.rc | 6 ++ dll/win32/shell32/lang/zh-TW.rc | 6 ++ dll/win32/shell32/shlfileop.cpp | 136 ++++++++++++++++++++++++++++++++++++++++ dll/win32/shell32/shresdef.h | 6 ++ 36 files changed, 346 insertions(+)
diff --git a/dll/win32/shell32/lang/bg-BG.rc b/dll/win32/shell32/lang/bg-BG.rc index f04caa795dc..979da9dc353 100644 --- a/dll/win32/shell32/lang/bg-BG.rc +++ b/dll/win32/shell32/lang/bg-BG.rc @@ -773,6 +773,12 @@ BEGIN IDS_OPENFILELOCATION "Open f&ile location" IDS_DESKLINK "Desktop (Create shortcut)" IDS_SENDTO_MENU "Se&nd To" + IDS_MOVEERRORTITLE "Error Moving File or Folder" + IDS_COPYERRORTITLE "Error Copying File or Folder" + IDS_MOVEERRORSAME "Cannot move '%s': The destination folder is the same as the source folder." + IDS_COPYERRORSAME "Cannot copy '%s': The source and destination file names are the same." + IDS_MOVEERRORSUBF "Cannot move '%s': The destination folder is a subfolder of the source folder." + IDS_COPYERRORSUBF "Cannot copy '%s': The destination folder is a subfolder of the source folder."
IDS_CREATEFOLDER_DENIED "Unable to create the folder '%1'" IDS_CREATEFOLDER_CAPTION "Unable to create folder" diff --git a/dll/win32/shell32/lang/ca-ES.rc b/dll/win32/shell32/lang/ca-ES.rc index 0a844310342..58c2455943a 100644 --- a/dll/win32/shell32/lang/ca-ES.rc +++ b/dll/win32/shell32/lang/ca-ES.rc @@ -772,6 +772,12 @@ BEGIN IDS_OPENFILELOCATION "Open f&ile location" IDS_DESKLINK "Desktop (Create shortcut)" IDS_SENDTO_MENU "Se&nd To" + IDS_MOVEERRORTITLE "Error Moving File or Folder" + IDS_COPYERRORTITLE "Error Copying File or Folder" + IDS_MOVEERRORSAME "Cannot move '%s': The destination folder is the same as the source folder." + IDS_COPYERRORSAME "Cannot copy '%s': The source and destination file names are the same." + IDS_MOVEERRORSUBF "Cannot move '%s': The destination folder is a subfolder of the source folder." + IDS_COPYERRORSUBF "Cannot copy '%s': The destination folder is a subfolder of the source folder."
IDS_CREATEFOLDER_DENIED "Unable to create the folder '%1'" IDS_CREATEFOLDER_CAPTION "Unable to create folder" diff --git a/dll/win32/shell32/lang/cs-CZ.rc b/dll/win32/shell32/lang/cs-CZ.rc index 4a22af175e6..e437182022d 100644 --- a/dll/win32/shell32/lang/cs-CZ.rc +++ b/dll/win32/shell32/lang/cs-CZ.rc @@ -778,6 +778,12 @@ BEGIN IDS_OPENFILELOCATION "Open f&ile location" IDS_DESKLINK "Desktop (Create shortcut)" IDS_SENDTO_MENU "Se&nd To" + IDS_MOVEERRORTITLE "Error Moving File or Folder" + IDS_COPYERRORTITLE "Error Copying File or Folder" + IDS_MOVEERRORSAME "Cannot move '%s': The destination folder is the same as the source folder." + IDS_COPYERRORSAME "Cannot copy '%s': The source and destination file names are the same." + IDS_MOVEERRORSUBF "Cannot move '%s': The destination folder is a subfolder of the source folder." + IDS_COPYERRORSUBF "Cannot copy '%s': The destination folder is a subfolder of the source folder."
IDS_CREATEFOLDER_DENIED "Složku '%1' nebylo možné vytvořit" IDS_CREATEFOLDER_CAPTION "Složku nebylo možné vytvořit" diff --git a/dll/win32/shell32/lang/da-DK.rc b/dll/win32/shell32/lang/da-DK.rc index 22fc8626ab9..6233431c38e 100644 --- a/dll/win32/shell32/lang/da-DK.rc +++ b/dll/win32/shell32/lang/da-DK.rc @@ -778,6 +778,12 @@ BEGIN IDS_OPENFILELOCATION "Open f&ile location" IDS_DESKLINK "Desktop (Create shortcut)" IDS_SENDTO_MENU "Se&nd To" + IDS_MOVEERRORTITLE "Error Moving File or Folder" + IDS_COPYERRORTITLE "Error Copying File or Folder" + IDS_MOVEERRORSAME "Cannot move '%s': The destination folder is the same as the source folder." + IDS_COPYERRORSAME "Cannot copy '%s': The source and destination file names are the same." + IDS_MOVEERRORSUBF "Cannot move '%s': The destination folder is a subfolder of the source folder." + IDS_COPYERRORSUBF "Cannot copy '%s': The destination folder is a subfolder of the source folder."
IDS_CREATEFOLDER_DENIED "Unable to create the folder '%1'" IDS_CREATEFOLDER_CAPTION "Unable to create folder" diff --git a/dll/win32/shell32/lang/de-DE.rc b/dll/win32/shell32/lang/de-DE.rc index 624d2d8ce88..38d75a4297e 100644 --- a/dll/win32/shell32/lang/de-DE.rc +++ b/dll/win32/shell32/lang/de-DE.rc @@ -773,6 +773,12 @@ BEGIN IDS_OPENFILELOCATION "Open f&ile location" IDS_DESKLINK "Desktop (Create shortcut)" IDS_SENDTO_MENU "Se&nd To" + IDS_MOVEERRORTITLE "Error Moving File or Folder" + IDS_COPYERRORTITLE "Error Copying File or Folder" + IDS_MOVEERRORSAME "Cannot move '%s': The destination folder is the same as the source folder." + IDS_COPYERRORSAME "Cannot copy '%s': The source and destination file names are the same." + IDS_MOVEERRORSUBF "Cannot move '%s': The destination folder is a subfolder of the source folder." + IDS_COPYERRORSUBF "Cannot copy '%s': The destination folder is a subfolder of the source folder."
IDS_CREATEFOLDER_DENIED " Der Ordner kann nicht erstellt werden '%1'" IDS_CREATEFOLDER_CAPTION " Der Ordner kann nicht erstellt werden." diff --git a/dll/win32/shell32/lang/el-GR.rc b/dll/win32/shell32/lang/el-GR.rc index 4ace3aa836e..ca57c93f42c 100644 --- a/dll/win32/shell32/lang/el-GR.rc +++ b/dll/win32/shell32/lang/el-GR.rc @@ -772,6 +772,12 @@ BEGIN IDS_OPENFILELOCATION "Open f&ile location" IDS_DESKLINK "Desktop (Create shortcut)" IDS_SENDTO_MENU "Se&nd To" + IDS_MOVEERRORTITLE "Error Moving File or Folder" + IDS_COPYERRORTITLE "Error Copying File or Folder" + IDS_MOVEERRORSAME "Cannot move '%s': The destination folder is the same as the source folder." + IDS_COPYERRORSAME "Cannot copy '%s': The source and destination file names are the same." + IDS_MOVEERRORSUBF "Cannot move '%s': The destination folder is a subfolder of the source folder." + IDS_COPYERRORSUBF "Cannot copy '%s': The destination folder is a subfolder of the source folder."
IDS_CREATEFOLDER_DENIED "Unable to create the folder '%1'" IDS_CREATEFOLDER_CAPTION "Unable to create folder" diff --git a/dll/win32/shell32/lang/en-GB.rc b/dll/win32/shell32/lang/en-GB.rc index 767c0bb8ce8..5073c9866ef 100644 --- a/dll/win32/shell32/lang/en-GB.rc +++ b/dll/win32/shell32/lang/en-GB.rc @@ -772,6 +772,12 @@ BEGIN IDS_OPENFILELOCATION "Open f&ile location" IDS_DESKLINK "Desktop (Create shortcut)" IDS_SENDTO_MENU "Se&nd To" + IDS_MOVEERRORTITLE "Error Moving File or Folder" + IDS_COPYERRORTITLE "Error Copying File or Folder" + IDS_MOVEERRORSAME "Cannot move '%s': The destination folder is the same as the source folder." + IDS_COPYERRORSAME "Cannot copy '%s': The source and destination file names are the same." + IDS_MOVEERRORSUBF "Cannot move '%s': The destination folder is a subfolder of the source folder." + IDS_COPYERRORSUBF "Cannot copy '%s': The destination folder is a subfolder of the source folder."
IDS_CREATEFOLDER_DENIED "Unable to create the folder '%1'" IDS_CREATEFOLDER_CAPTION "Unable to create folder" diff --git a/dll/win32/shell32/lang/en-US.rc b/dll/win32/shell32/lang/en-US.rc index 3abbaa21a45..ed821b399eb 100644 --- a/dll/win32/shell32/lang/en-US.rc +++ b/dll/win32/shell32/lang/en-US.rc @@ -772,6 +772,12 @@ BEGIN IDS_OPENFILELOCATION "Open f&ile location" IDS_DESKLINK "Desktop (Create shortcut)" IDS_SENDTO_MENU "Se&nd To" + IDS_MOVEERRORTITLE "Error Moving File or Folder" + IDS_COPYERRORTITLE "Error Copying File or Folder" + IDS_MOVEERRORSAME "Cannot move '%s': The destination folder is the same as the source folder." + IDS_COPYERRORSAME "Cannot copy '%s': The source and destination file names are the same." + IDS_MOVEERRORSUBF "Cannot move '%s': The destination folder is a subfolder of the source folder." + IDS_COPYERRORSUBF "Cannot copy '%s': The destination folder is a subfolder of the source folder."
IDS_CREATEFOLDER_DENIED "Unable to create the folder '%1'" IDS_CREATEFOLDER_CAPTION "Unable to create folder" diff --git a/dll/win32/shell32/lang/es-ES.rc b/dll/win32/shell32/lang/es-ES.rc index 45eeb3fba71..ba2623d97f0 100644 --- a/dll/win32/shell32/lang/es-ES.rc +++ b/dll/win32/shell32/lang/es-ES.rc @@ -780,6 +780,12 @@ BEGIN IDS_OPENFILELOCATION "Open f&ile location" IDS_DESKLINK "Desktop (Create shortcut)" IDS_SENDTO_MENU "Se&nd To" + IDS_MOVEERRORTITLE "Error Moving File or Folder" + IDS_COPYERRORTITLE "Error Copying File or Folder" + IDS_MOVEERRORSAME "Cannot move '%s': The destination folder is the same as the source folder." + IDS_COPYERRORSAME "Cannot copy '%s': The source and destination file names are the same." + IDS_MOVEERRORSUBF "Cannot move '%s': The destination folder is a subfolder of the source folder." + IDS_COPYERRORSUBF "Cannot copy '%s': The destination folder is a subfolder of the source folder."
IDS_CREATEFOLDER_DENIED "No se pudo crear la carpeta '%1'" IDS_CREATEFOLDER_CAPTION "No se pudo crear la carpeta" diff --git a/dll/win32/shell32/lang/et-EE.rc b/dll/win32/shell32/lang/et-EE.rc index 644a1bc77ff..e188b6ae007 100644 --- a/dll/win32/shell32/lang/et-EE.rc +++ b/dll/win32/shell32/lang/et-EE.rc @@ -779,6 +779,12 @@ BEGIN IDS_OPENFILELOCATION "Open f&ile location" IDS_DESKLINK "Desktop (Create shortcut)" IDS_SENDTO_MENU "Se&nd To" + IDS_MOVEERRORTITLE "Error Moving File or Folder" + IDS_COPYERRORTITLE "Error Copying File or Folder" + IDS_MOVEERRORSAME "Cannot move '%s': The destination folder is the same as the source folder." + IDS_COPYERRORSAME "Cannot copy '%s': The source and destination file names are the same." + IDS_MOVEERRORSUBF "Cannot move '%s': The destination folder is a subfolder of the source folder." + IDS_COPYERRORSUBF "Cannot copy '%s': The destination folder is a subfolder of the source folder."
IDS_CREATEFOLDER_DENIED "Ei saa luua kausta '%1'" IDS_CREATEFOLDER_CAPTION "Ei saa kausta luua" diff --git a/dll/win32/shell32/lang/fi-FI.rc b/dll/win32/shell32/lang/fi-FI.rc index 3f37a24fcb8..15a8dc3e0d8 100644 --- a/dll/win32/shell32/lang/fi-FI.rc +++ b/dll/win32/shell32/lang/fi-FI.rc @@ -772,6 +772,12 @@ BEGIN IDS_OPENFILELOCATION "Open f&ile location" IDS_DESKLINK "Desktop (Create shortcut)" IDS_SENDTO_MENU "Se&nd To" + IDS_MOVEERRORTITLE "Error Moving File or Folder" + IDS_COPYERRORTITLE "Error Copying File or Folder" + IDS_MOVEERRORSAME "Cannot move '%s': The destination folder is the same as the source folder." + IDS_COPYERRORSAME "Cannot copy '%s': The source and destination file names are the same." + IDS_MOVEERRORSUBF "Cannot move '%s': The destination folder is a subfolder of the source folder." + IDS_COPYERRORSUBF "Cannot copy '%s': The destination folder is a subfolder of the source folder."
IDS_CREATEFOLDER_DENIED "Unable to create the folder '%1'" IDS_CREATEFOLDER_CAPTION "Unable to create folder" diff --git a/dll/win32/shell32/lang/fr-FR.rc b/dll/win32/shell32/lang/fr-FR.rc index d8856c9bbb8..532827de319 100644 --- a/dll/win32/shell32/lang/fr-FR.rc +++ b/dll/win32/shell32/lang/fr-FR.rc @@ -772,6 +772,12 @@ BEGIN IDS_OPENFILELOCATION "Open f&ile location" IDS_DESKLINK "Desktop (Create shortcut)" IDS_SENDTO_MENU "Se&nd To" + IDS_MOVEERRORTITLE "Error Moving File or Folder" + IDS_COPYERRORTITLE "Error Copying File or Folder" + IDS_MOVEERRORSAME "Cannot move '%s': The destination folder is the same as the source folder." + IDS_COPYERRORSAME "Cannot copy '%s': The source and destination file names are the same." + IDS_MOVEERRORSUBF "Cannot move '%s': The destination folder is a subfolder of the source folder." + IDS_COPYERRORSUBF "Cannot copy '%s': The destination folder is a subfolder of the source folder."
IDS_CREATEFOLDER_DENIED "Impossible de créer le dossier '%1'" IDS_CREATEFOLDER_CAPTION "Impossible de créer un dossier" diff --git a/dll/win32/shell32/lang/he-IL.rc b/dll/win32/shell32/lang/he-IL.rc index 3b4f96d8213..bcd51f00d61 100644 --- a/dll/win32/shell32/lang/he-IL.rc +++ b/dll/win32/shell32/lang/he-IL.rc @@ -774,6 +774,12 @@ BEGIN IDS_OPENFILELOCATION "Open f&ile location" IDS_DESKLINK "Desktop (Create shortcut)" IDS_SENDTO_MENU "Se&nd To" + IDS_MOVEERRORTITLE "Error Moving File or Folder" + IDS_COPYERRORTITLE "Error Copying File or Folder" + IDS_MOVEERRORSAME "Cannot move '%s': The destination folder is the same as the source folder." + IDS_COPYERRORSAME "Cannot copy '%s': The source and destination file names are the same." + IDS_MOVEERRORSUBF "Cannot move '%s': The destination folder is a subfolder of the source folder." + IDS_COPYERRORSUBF "Cannot copy '%s': The destination folder is a subfolder of the source folder."
IDS_CREATEFOLDER_DENIED "Unable to create the folder '%1'" IDS_CREATEFOLDER_CAPTION "Unable to create folder" diff --git a/dll/win32/shell32/lang/hi-IN.rc b/dll/win32/shell32/lang/hi-IN.rc index 4051fa022d8..e711c7295f3 100644 --- a/dll/win32/shell32/lang/hi-IN.rc +++ b/dll/win32/shell32/lang/hi-IN.rc @@ -772,6 +772,12 @@ BEGIN IDS_OPENFILELOCATION "Open f&ile location" IDS_DESKLINK "Desktop (Create shortcut)" IDS_SENDTO_MENU "Se&nd To" + IDS_MOVEERRORTITLE "Error Moving File or Folder" + IDS_COPYERRORTITLE "Error Copying File or Folder" + IDS_MOVEERRORSAME "Cannot move '%s': The destination folder is the same as the source folder." + IDS_COPYERRORSAME "Cannot copy '%s': The source and destination file names are the same." + IDS_MOVEERRORSUBF "Cannot move '%s': The destination folder is a subfolder of the source folder." + IDS_COPYERRORSUBF "Cannot copy '%s': The destination folder is a subfolder of the source folder."
IDS_CREATEFOLDER_DENIED "फ़ोल्डर '%1' बनाने में असमर्थ" IDS_CREATEFOLDER_CAPTION "फ़ोल्डर बनाने में असमर्थ" diff --git a/dll/win32/shell32/lang/hu-HU.rc b/dll/win32/shell32/lang/hu-HU.rc index 3d0cd95cea6..d9fe252d6cc 100644 --- a/dll/win32/shell32/lang/hu-HU.rc +++ b/dll/win32/shell32/lang/hu-HU.rc @@ -772,6 +772,12 @@ BEGIN IDS_OPENFILELOCATION "Open f&ile location" IDS_DESKLINK "Desktop (Create shortcut)" IDS_SENDTO_MENU "Se&nd To" + IDS_MOVEERRORTITLE "Error Moving File or Folder" + IDS_COPYERRORTITLE "Error Copying File or Folder" + IDS_MOVEERRORSAME "Cannot move '%s': The destination folder is the same as the source folder." + IDS_COPYERRORSAME "Cannot copy '%s': The source and destination file names are the same." + IDS_MOVEERRORSUBF "Cannot move '%s': The destination folder is a subfolder of the source folder." + IDS_COPYERRORSUBF "Cannot copy '%s': The destination folder is a subfolder of the source folder."
IDS_CREATEFOLDER_DENIED "Unable to create the folder '%1'" IDS_CREATEFOLDER_CAPTION "Unable to create folder" diff --git a/dll/win32/shell32/lang/id-ID.rc b/dll/win32/shell32/lang/id-ID.rc index 659f15172c4..9e0e8d4cc3b 100644 --- a/dll/win32/shell32/lang/id-ID.rc +++ b/dll/win32/shell32/lang/id-ID.rc @@ -772,6 +772,12 @@ BEGIN IDS_OPENFILELOCATION "Open f&ile location" IDS_DESKLINK "Desktop (Create shortcut)" IDS_SENDTO_MENU "Se&nd To" + IDS_MOVEERRORTITLE "Error Moving File or Folder" + IDS_COPYERRORTITLE "Error Copying File or Folder" + IDS_MOVEERRORSAME "Cannot move '%s': The destination folder is the same as the source folder." + IDS_COPYERRORSAME "Cannot copy '%s': The source and destination file names are the same." + IDS_MOVEERRORSUBF "Cannot move '%s': The destination folder is a subfolder of the source folder." + IDS_COPYERRORSUBF "Cannot copy '%s': The destination folder is a subfolder of the source folder."
IDS_CREATEFOLDER_DENIED "Tidak bisa membuat folder folder '%1'" IDS_CREATEFOLDER_CAPTION "Tidak bisa membuat folder" diff --git a/dll/win32/shell32/lang/it-IT.rc b/dll/win32/shell32/lang/it-IT.rc index a8d1a685984..bc6a7e40b75 100644 --- a/dll/win32/shell32/lang/it-IT.rc +++ b/dll/win32/shell32/lang/it-IT.rc @@ -772,6 +772,12 @@ BEGIN IDS_OPENFILELOCATION "Open f&ile location" IDS_DESKLINK "Desktop (Create shortcut)" IDS_SENDTO_MENU "Se&nd To" + IDS_MOVEERRORTITLE "Error Moving File or Folder" + IDS_COPYERRORTITLE "Error Copying File or Folder" + IDS_MOVEERRORSAME "Cannot move '%s': The destination folder is the same as the source folder." + IDS_COPYERRORSAME "Cannot copy '%s': The source and destination file names are the same." + IDS_MOVEERRORSUBF "Cannot move '%s': The destination folder is a subfolder of the source folder." + IDS_COPYERRORSUBF "Cannot copy '%s': The destination folder is a subfolder of the source folder."
IDS_CREATEFOLDER_DENIED "Unable to create the folder '%1'" IDS_CREATEFOLDER_CAPTION "Unable to create folder" diff --git a/dll/win32/shell32/lang/ja-JP.rc b/dll/win32/shell32/lang/ja-JP.rc index dd114ce8cd2..4428f130b5b 100644 --- a/dll/win32/shell32/lang/ja-JP.rc +++ b/dll/win32/shell32/lang/ja-JP.rc @@ -769,6 +769,12 @@ BEGIN IDS_OPENFILELOCATION "Open f&ile location" IDS_DESKLINK "Desktop (Create shortcut)" IDS_SENDTO_MENU "Se&nd To" + IDS_MOVEERRORTITLE "Error Moving File or Folder" + IDS_COPYERRORTITLE "Error Copying File or Folder" + IDS_MOVEERRORSAME "Cannot move '%s': The destination folder is the same as the source folder." + IDS_COPYERRORSAME "Cannot copy '%s': The source and destination file names are the same." + IDS_MOVEERRORSUBF "Cannot move '%s': The destination folder is a subfolder of the source folder." + IDS_COPYERRORSUBF "Cannot copy '%s': The destination folder is a subfolder of the source folder."
IDS_CREATEFOLDER_DENIED "フォルダ '%1' を作成できません" IDS_CREATEFOLDER_CAPTION "フォルダを作成できません" diff --git a/dll/win32/shell32/lang/ko-KR.rc b/dll/win32/shell32/lang/ko-KR.rc index 44e14519876..77bc592ee41 100644 --- a/dll/win32/shell32/lang/ko-KR.rc +++ b/dll/win32/shell32/lang/ko-KR.rc @@ -772,6 +772,12 @@ BEGIN IDS_OPENFILELOCATION "Open f&ile location" IDS_DESKLINK "Desktop (Create shortcut)" IDS_SENDTO_MENU "Se&nd To" + IDS_MOVEERRORTITLE "Error Moving File or Folder" + IDS_COPYERRORTITLE "Error Copying File or Folder" + IDS_MOVEERRORSAME "Cannot move '%s': The destination folder is the same as the source folder." + IDS_COPYERRORSAME "Cannot copy '%s': The source and destination file names are the same." + IDS_MOVEERRORSUBF "Cannot move '%s': The destination folder is a subfolder of the source folder." + IDS_COPYERRORSUBF "Cannot copy '%s': The destination folder is a subfolder of the source folder."
IDS_CREATEFOLDER_DENIED "Unable to create the folder '%1'" IDS_CREATEFOLDER_CAPTION "Unable to create folder" diff --git a/dll/win32/shell32/lang/nl-NL.rc b/dll/win32/shell32/lang/nl-NL.rc index 556f77549e7..a50fe1aac5e 100644 --- a/dll/win32/shell32/lang/nl-NL.rc +++ b/dll/win32/shell32/lang/nl-NL.rc @@ -772,6 +772,12 @@ BEGIN IDS_OPENFILELOCATION "Open f&ile location" IDS_DESKLINK "Desktop (Create shortcut)" IDS_SENDTO_MENU "Se&nd To" + IDS_MOVEERRORTITLE "Error Moving File or Folder" + IDS_COPYERRORTITLE "Error Copying File or Folder" + IDS_MOVEERRORSAME "Cannot move '%s': The destination folder is the same as the source folder." + IDS_COPYERRORSAME "Cannot copy '%s': The source and destination file names are the same." + IDS_MOVEERRORSUBF "Cannot move '%s': The destination folder is a subfolder of the source folder." + IDS_COPYERRORSUBF "Cannot copy '%s': The destination folder is a subfolder of the source folder."
IDS_CREATEFOLDER_DENIED "Unable to create the folder '%1'" IDS_CREATEFOLDER_CAPTION "Unable to create folder" diff --git a/dll/win32/shell32/lang/no-NO.rc b/dll/win32/shell32/lang/no-NO.rc index ef7139eb566..32e80b4bf92 100644 --- a/dll/win32/shell32/lang/no-NO.rc +++ b/dll/win32/shell32/lang/no-NO.rc @@ -772,6 +772,12 @@ BEGIN IDS_OPENFILELOCATION "Open f&ile location" IDS_DESKLINK "Desktop (Create shortcut)" IDS_SENDTO_MENU "Se&nd To" + IDS_MOVEERRORTITLE "Error Moving File or Folder" + IDS_COPYERRORTITLE "Error Copying File or Folder" + IDS_MOVEERRORSAME "Cannot move '%s': The destination folder is the same as the source folder." + IDS_COPYERRORSAME "Cannot copy '%s': The source and destination file names are the same." + IDS_MOVEERRORSUBF "Cannot move '%s': The destination folder is a subfolder of the source folder." + IDS_COPYERRORSUBF "Cannot copy '%s': The destination folder is a subfolder of the source folder."
IDS_CREATEFOLDER_DENIED "Unable to create the folder '%1'" IDS_CREATEFOLDER_CAPTION "Unable to create folder" diff --git a/dll/win32/shell32/lang/pl-PL.rc b/dll/win32/shell32/lang/pl-PL.rc index c74d513f98a..d69f49ebd59 100644 --- a/dll/win32/shell32/lang/pl-PL.rc +++ b/dll/win32/shell32/lang/pl-PL.rc @@ -777,6 +777,12 @@ BEGIN IDS_OPENFILELOCATION "Open f&ile location" IDS_DESKLINK "Desktop (Create shortcut)" IDS_SENDTO_MENU "Se&nd To" + IDS_MOVEERRORTITLE "Error Moving File or Folder" + IDS_COPYERRORTITLE "Error Copying File or Folder" + IDS_MOVEERRORSAME "Cannot move '%s': The destination folder is the same as the source folder." + IDS_COPYERRORSAME "Cannot copy '%s': The source and destination file names are the same." + IDS_MOVEERRORSUBF "Cannot move '%s': The destination folder is a subfolder of the source folder." + IDS_COPYERRORSUBF "Cannot copy '%s': The destination folder is a subfolder of the source folder."
IDS_CREATEFOLDER_DENIED "Nie można utworzyć folderu '%1'" IDS_CREATEFOLDER_CAPTION "Nie można utworzyć folderu" diff --git a/dll/win32/shell32/lang/pt-BR.rc b/dll/win32/shell32/lang/pt-BR.rc index ac3d16a51a9..91c816306e9 100644 --- a/dll/win32/shell32/lang/pt-BR.rc +++ b/dll/win32/shell32/lang/pt-BR.rc @@ -772,6 +772,12 @@ BEGIN IDS_OPENFILELOCATION "Open f&ile location" IDS_DESKLINK "Desktop (Create shortcut)" IDS_SENDTO_MENU "Se&nd To" + IDS_MOVEERRORTITLE "Error Moving File or Folder" + IDS_COPYERRORTITLE "Error Copying File or Folder" + IDS_MOVEERRORSAME "Cannot move '%s': The destination folder is the same as the source folder." + IDS_COPYERRORSAME "Cannot copy '%s': The source and destination file names are the same." + IDS_MOVEERRORSUBF "Cannot move '%s': The destination folder is a subfolder of the source folder." + IDS_COPYERRORSUBF "Cannot copy '%s': The destination folder is a subfolder of the source folder."
IDS_CREATEFOLDER_DENIED "Unable to create the folder '%1'" IDS_CREATEFOLDER_CAPTION "Unable to create folder" diff --git a/dll/win32/shell32/lang/pt-PT.rc b/dll/win32/shell32/lang/pt-PT.rc index fb8fd3f93f9..a01bebdd281 100644 --- a/dll/win32/shell32/lang/pt-PT.rc +++ b/dll/win32/shell32/lang/pt-PT.rc @@ -772,6 +772,12 @@ BEGIN IDS_OPENFILELOCATION "Open f&ile location" IDS_DESKLINK "Desktop (Create shortcut)" IDS_SENDTO_MENU "Se&nd To" + IDS_MOVEERRORTITLE "Error Moving File or Folder" + IDS_COPYERRORTITLE "Error Copying File or Folder" + IDS_MOVEERRORSAME "Cannot move '%s': The destination folder is the same as the source folder." + IDS_COPYERRORSAME "Cannot copy '%s': The source and destination file names are the same." + IDS_MOVEERRORSUBF "Cannot move '%s': The destination folder is a subfolder of the source folder." + IDS_COPYERRORSUBF "Cannot copy '%s': The destination folder is a subfolder of the source folder."
IDS_CREATEFOLDER_DENIED "Impossivel de criar pasta '%1'" IDS_CREATEFOLDER_CAPTION "Impossivel de criar pasta" diff --git a/dll/win32/shell32/lang/ro-RO.rc b/dll/win32/shell32/lang/ro-RO.rc index 7b6691343fa..3e1b6861b82 100644 --- a/dll/win32/shell32/lang/ro-RO.rc +++ b/dll/win32/shell32/lang/ro-RO.rc @@ -774,6 +774,12 @@ BEGIN IDS_OPENFILELOCATION "Open f&ile location" IDS_DESKLINK "Desktop (Create shortcut)" IDS_SENDTO_MENU "Se&nd To" + IDS_MOVEERRORTITLE "Error Moving File or Folder" + IDS_COPYERRORTITLE "Error Copying File or Folder" + IDS_MOVEERRORSAME "Cannot move '%s': The destination folder is the same as the source folder." + IDS_COPYERRORSAME "Cannot copy '%s': The source and destination file names are the same." + IDS_MOVEERRORSUBF "Cannot move '%s': The destination folder is a subfolder of the source folder." + IDS_COPYERRORSUBF "Cannot copy '%s': The destination folder is a subfolder of the source folder."
IDS_CREATEFOLDER_DENIED "Nu poate fi creat un dosar cu numele „%1”" IDS_CREATEFOLDER_CAPTION "Nu poate fi creat dosar" diff --git a/dll/win32/shell32/lang/ru-RU.rc b/dll/win32/shell32/lang/ru-RU.rc index d0a826765b4..8da35e1e9bf 100644 --- a/dll/win32/shell32/lang/ru-RU.rc +++ b/dll/win32/shell32/lang/ru-RU.rc @@ -779,6 +779,12 @@ BEGIN IDS_OPENFILELOCATION "Open f&ile location" IDS_DESKLINK "Desktop (Create shortcut)" IDS_SENDTO_MENU "Se&nd To" + IDS_MOVEERRORTITLE "Error Moving File or Folder" + IDS_COPYERRORTITLE "Error Copying File or Folder" + IDS_MOVEERRORSAME "Cannot move '%s': The destination folder is the same as the source folder." + IDS_COPYERRORSAME "Cannot copy '%s': The source and destination file names are the same." + IDS_MOVEERRORSUBF "Cannot move '%s': The destination folder is a subfolder of the source folder." + IDS_COPYERRORSUBF "Cannot copy '%s': The destination folder is a subfolder of the source folder."
IDS_CREATEFOLDER_DENIED "Невозможно создать папку '%1'" IDS_CREATEFOLDER_CAPTION "Невозможно создать папку" diff --git a/dll/win32/shell32/lang/sk-SK.rc b/dll/win32/shell32/lang/sk-SK.rc index 3b6425e9f50..0f7e2ba41e8 100644 --- a/dll/win32/shell32/lang/sk-SK.rc +++ b/dll/win32/shell32/lang/sk-SK.rc @@ -772,6 +772,12 @@ BEGIN IDS_OPENFILELOCATION "Open f&ile location" IDS_DESKLINK "Desktop (Create shortcut)" IDS_SENDTO_MENU "Se&nd To" + IDS_MOVEERRORTITLE "Error Moving File or Folder" + IDS_COPYERRORTITLE "Error Copying File or Folder" + IDS_MOVEERRORSAME "Cannot move '%s': The destination folder is the same as the source folder." + IDS_COPYERRORSAME "Cannot copy '%s': The source and destination file names are the same." + IDS_MOVEERRORSUBF "Cannot move '%s': The destination folder is a subfolder of the source folder." + IDS_COPYERRORSUBF "Cannot copy '%s': The destination folder is a subfolder of the source folder."
IDS_CREATEFOLDER_DENIED "Unable to create the folder '%1'" IDS_CREATEFOLDER_CAPTION "Unable to create folder" diff --git a/dll/win32/shell32/lang/sl-SI.rc b/dll/win32/shell32/lang/sl-SI.rc index 7156fc59143..8823dd6c82b 100644 --- a/dll/win32/shell32/lang/sl-SI.rc +++ b/dll/win32/shell32/lang/sl-SI.rc @@ -772,6 +772,12 @@ BEGIN IDS_OPENFILELOCATION "Open f&ile location" IDS_DESKLINK "Desktop (Create shortcut)" IDS_SENDTO_MENU "Se&nd To" + IDS_MOVEERRORTITLE "Error Moving File or Folder" + IDS_COPYERRORTITLE "Error Copying File or Folder" + IDS_MOVEERRORSAME "Cannot move '%s': The destination folder is the same as the source folder." + IDS_COPYERRORSAME "Cannot copy '%s': The source and destination file names are the same." + IDS_MOVEERRORSUBF "Cannot move '%s': The destination folder is a subfolder of the source folder." + IDS_COPYERRORSUBF "Cannot copy '%s': The destination folder is a subfolder of the source folder."
IDS_CREATEFOLDER_DENIED "Unable to create the folder '%1'" IDS_CREATEFOLDER_CAPTION "Unable to create folder" diff --git a/dll/win32/shell32/lang/sq-AL.rc b/dll/win32/shell32/lang/sq-AL.rc index 25e327389f7..6546f0f5342 100644 --- a/dll/win32/shell32/lang/sq-AL.rc +++ b/dll/win32/shell32/lang/sq-AL.rc @@ -776,6 +776,12 @@ BEGIN IDS_OPENFILELOCATION "Open f&ile location" IDS_DESKLINK "Desktop (Create shortcut)" IDS_SENDTO_MENU "Se&nd To" + IDS_MOVEERRORTITLE "Error Moving File or Folder" + IDS_COPYERRORTITLE "Error Copying File or Folder" + IDS_MOVEERRORSAME "Cannot move '%s': The destination folder is the same as the source folder." + IDS_COPYERRORSAME "Cannot copy '%s': The source and destination file names are the same." + IDS_MOVEERRORSUBF "Cannot move '%s': The destination folder is a subfolder of the source folder." + IDS_COPYERRORSUBF "Cannot copy '%s': The destination folder is a subfolder of the source folder."
IDS_CREATEFOLDER_DENIED "Unable to create the folder '%1'" IDS_CREATEFOLDER_CAPTION "Unable to create folder" diff --git a/dll/win32/shell32/lang/sv-SE.rc b/dll/win32/shell32/lang/sv-SE.rc index a8a041b0612..71cc07adae6 100644 --- a/dll/win32/shell32/lang/sv-SE.rc +++ b/dll/win32/shell32/lang/sv-SE.rc @@ -772,6 +772,12 @@ BEGIN IDS_OPENFILELOCATION "Open f&ile location" IDS_DESKLINK "Desktop (Create shortcut)" IDS_SENDTO_MENU "Se&nd To" + IDS_MOVEERRORTITLE "Error Moving File or Folder" + IDS_COPYERRORTITLE "Error Copying File or Folder" + IDS_MOVEERRORSAME "Cannot move '%s': The destination folder is the same as the source folder." + IDS_COPYERRORSAME "Cannot copy '%s': The source and destination file names are the same." + IDS_MOVEERRORSUBF "Cannot move '%s': The destination folder is a subfolder of the source folder." + IDS_COPYERRORSUBF "Cannot copy '%s': The destination folder is a subfolder of the source folder."
IDS_CREATEFOLDER_DENIED "Kunde inte skapa mappen '%1'" IDS_CREATEFOLDER_CAPTION "Kunde inte skapa mapp" diff --git a/dll/win32/shell32/lang/tr-TR.rc b/dll/win32/shell32/lang/tr-TR.rc index 137f26b50c6..e80b864b735 100644 --- a/dll/win32/shell32/lang/tr-TR.rc +++ b/dll/win32/shell32/lang/tr-TR.rc @@ -774,6 +774,12 @@ BEGIN IDS_OPENFILELOCATION "Open f&ile location" IDS_DESKLINK "Desktop (Create shortcut)" IDS_SENDTO_MENU "Se&nd To" + IDS_MOVEERRORTITLE "Error Moving File or Folder" + IDS_COPYERRORTITLE "Error Copying File or Folder" + IDS_MOVEERRORSAME "Cannot move '%s': The destination folder is the same as the source folder." + IDS_COPYERRORSAME "Cannot copy '%s': The source and destination file names are the same." + IDS_MOVEERRORSUBF "Cannot move '%s': The destination folder is a subfolder of the source folder." + IDS_COPYERRORSUBF "Cannot copy '%s': The destination folder is a subfolder of the source folder."
IDS_CREATEFOLDER_DENIED """%1"" dizini oluşturulamıyor." IDS_CREATEFOLDER_CAPTION "Dizin Oluşturulamıyor" diff --git a/dll/win32/shell32/lang/uk-UA.rc b/dll/win32/shell32/lang/uk-UA.rc index 3a36763d514..f0049c6aba0 100644 --- a/dll/win32/shell32/lang/uk-UA.rc +++ b/dll/win32/shell32/lang/uk-UA.rc @@ -772,6 +772,12 @@ BEGIN IDS_OPENFILELOCATION "Open f&ile location" IDS_DESKLINK "Desktop (Create shortcut)" IDS_SENDTO_MENU "Se&nd To" + IDS_MOVEERRORTITLE "Error Moving File or Folder" + IDS_COPYERRORTITLE "Error Copying File or Folder" + IDS_MOVEERRORSAME "Cannot move '%s': The destination folder is the same as the source folder." + IDS_COPYERRORSAME "Cannot copy '%s': The source and destination file names are the same." + IDS_MOVEERRORSUBF "Cannot move '%s': The destination folder is a subfolder of the source folder." + IDS_COPYERRORSUBF "Cannot copy '%s': The destination folder is a subfolder of the source folder."
IDS_CREATEFOLDER_DENIED "Не вдалося створити папку '%1'" IDS_CREATEFOLDER_CAPTION "Не вдалося створити папку" diff --git a/dll/win32/shell32/lang/zh-CN.rc b/dll/win32/shell32/lang/zh-CN.rc index 23253b17f70..5f90351692b 100644 --- a/dll/win32/shell32/lang/zh-CN.rc +++ b/dll/win32/shell32/lang/zh-CN.rc @@ -780,6 +780,12 @@ BEGIN IDS_OPENFILELOCATION "Open f&ile location" IDS_DESKLINK "Desktop (Create shortcut)" IDS_SENDTO_MENU "Se&nd To" + IDS_MOVEERRORTITLE "Error Moving File or Folder" + IDS_COPYERRORTITLE "Error Copying File or Folder" + IDS_MOVEERRORSAME "Cannot move '%s': The destination folder is the same as the source folder." + IDS_COPYERRORSAME "Cannot copy '%s': The source and destination file names are the same." + IDS_MOVEERRORSUBF "Cannot move '%s': The destination folder is a subfolder of the source folder." + IDS_COPYERRORSUBF "Cannot copy '%s': The destination folder is a subfolder of the source folder."
IDS_CREATEFOLDER_DENIED "无法创建文件夹 '%1'" IDS_CREATEFOLDER_CAPTION "无法创建文件夹" diff --git a/dll/win32/shell32/lang/zh-TW.rc b/dll/win32/shell32/lang/zh-TW.rc index e5388754625..c05bc04534e 100644 --- a/dll/win32/shell32/lang/zh-TW.rc +++ b/dll/win32/shell32/lang/zh-TW.rc @@ -781,6 +781,12 @@ BEGIN IDS_OPENFILELOCATION "Open f&ile location" IDS_DESKLINK "Desktop (Create shortcut)" IDS_SENDTO_MENU "Se&nd To" + IDS_MOVEERRORTITLE "Error Moving File or Folder" + IDS_COPYERRORTITLE "Error Copying File or Folder" + IDS_MOVEERRORSAME "Cannot move '%s': The destination folder is the same as the source folder." + IDS_COPYERRORSAME "Cannot copy '%s': The source and destination file names are the same." + IDS_MOVEERRORSUBF "Cannot move '%s': The destination folder is a subfolder of the source folder." + IDS_COPYERRORSUBF "Cannot copy '%s': The destination folder is a subfolder of the source folder."
IDS_CREATEFOLDER_DENIED "無法建立資料夾 '%1'" IDS_CREATEFOLDER_CAPTION "無法建立資料夾" diff --git a/dll/win32/shell32/shlfileop.cpp b/dll/win32/shell32/shlfileop.cpp index 499f4d3079e..e7f53fcd448 100644 --- a/dll/win32/shell32/shlfileop.cpp +++ b/dll/win32/shell32/shlfileop.cpp @@ -1273,6 +1273,19 @@ static void copy_dir_to_dir(FILE_OPERATION *op, const FILE_ENTRY *feFrom, LPCWST else lstrcpyW(szTo, szDestPath);
+#ifdef __REACTOS__ + if (PathFileExistsW(szTo)) + { + if (op->req->fFlags & FOF_RENAMEONCOLLISION) + { + CStringW newPath = try_find_new_name(szTo); + if (!newPath.IsEmpty()) + { + StringCchCopyW(szTo, _countof(szTo), newPath); + } + } + else if (!(op->req->fFlags & FOF_NOCONFIRMATION)) +#else if (!(op->req->fFlags & FOF_NOCONFIRMATION) && PathFileExistsW(szTo)) { CStringW newPath; @@ -1281,6 +1294,7 @@ static void copy_dir_to_dir(FILE_OPERATION *op, const FILE_ENTRY *feFrom, LPCWST StringCchCopyW(szTo, _countof(szTo), newPath); } else +#endif { if (!SHELL_ConfirmDialogW(op->req->hwnd, ASK_OVERWRITE_FOLDER, feFrom->szFilename, op)) { @@ -1311,6 +1325,23 @@ static void copy_dir_to_dir(FILE_OPERATION *op, const FILE_ENTRY *feFrom, LPCWST
static BOOL copy_file_to_file(FILE_OPERATION *op, const WCHAR *szFrom, const WCHAR *szTo) { +#ifdef __REACTOS__ + if (PathFileExistsW(szTo)) + { + if (op->req->fFlags & FOF_RENAMEONCOLLISION) + { + CStringW newPath = try_find_new_name(szTo); + if (!newPath.IsEmpty()) + { + return SHNotifyCopyFileW(op, szFrom, newPath, FALSE) == 0; + } + } + else if (!(op->req->fFlags & FOF_NOCONFIRMATION)) + { + if (!SHELL_ConfirmDialogW(op->req->hwnd, ASK_OVERWRITE_FILE, PathFindFileNameW(szTo), op)) + return FALSE; + } +#else if (!(op->req->fFlags & FOF_NOCONFIRMATION) && PathFileExistsW(szTo)) { CStringW newPath; @@ -1321,6 +1352,7 @@ static BOOL copy_file_to_file(FILE_OPERATION *op, const WCHAR *szFrom, const WCH
if (!SHELL_ConfirmDialogW(op->req->hwnd, ASK_OVERWRITE_FILE, PathFindFileNameW(szTo), op)) return FALSE; +#endif }
return SHNotifyCopyFileW(op, szFrom, szTo, FALSE) == 0; @@ -1768,12 +1800,111 @@ static void check_flags(FILEOP_FLAGS fFlags) { WORD wUnsupportedFlags = FOF_NO_CONNECTED_ELEMENTS | FOF_NOCOPYSECURITYATTRIBS | FOF_NORECURSEREPARSE | +#ifdef __REACTOS__ + FOF_WANTMAPPINGHANDLE; +#else FOF_RENAMEONCOLLISION | FOF_WANTMAPPINGHANDLE; +#endif
if (fFlags & wUnsupportedFlags) FIXME("Unsupported flags: %04x\n", fFlags); }
+#ifdef __REACTOS__ +static DWORD +validate_operation(LPSHFILEOPSTRUCTW lpFileOp, FILE_LIST *flFrom, FILE_LIST *flTo) +{ + DWORD i, k, dwNumDest; + WCHAR szFrom[MAX_PATH], szTo[MAX_PATH], szText[MAX_PATH]; + const FILE_ENTRY *feFrom; + const FILE_ENTRY *feTo; + UINT wFunc = lpFileOp->wFunc; + HWND hwnd = lpFileOp->hwnd; + + dwNumDest = ((lpFileOp->fFlags & FOF_MULTIDESTFILES) ? flTo->dwNumFiles : 1); + + if (wFunc != FO_COPY && wFunc != FO_MOVE) + return ERROR_SUCCESS; + + for (k = 0; k < dwNumDest; ++k) + { + feTo = &flTo->feFiles[k]; + for (i = 0; i < flFrom->dwNumFiles; ++i) + { + feFrom = &flFrom->feFiles[i]; + StringCbCopyW(szFrom, sizeof(szFrom), feFrom->szFullPath); + + StringCbCopyW(szTo, sizeof(szTo), feTo->szFullPath); + if (IsAttribDir(feTo->attributes)) + { + PathAppendW(szTo, feFrom->szFilename); + } + + // same path? + if (lstrcmpiW(szFrom, szTo) == 0 && + (wFunc == FO_MOVE || !(lpFileOp->fFlags & FOF_RENAMEONCOLLISION))) + { + if (!(lpFileOp->fFlags & FOF_SILENT)) + { + if (wFunc == FO_MOVE) + { + CStringW strTitle(MAKEINTRESOURCEW(IDS_MOVEERRORTITLE)); + CStringW strText(MAKEINTRESOURCEW(IDS_MOVEERRORSAME)); + StringCchPrintfW(szText, sizeof(szText), strText, feFrom->szFilename); + MessageBoxW(hwnd, szText, strTitle, MB_ICONERROR); + } + else + { + CStringW strTitle(MAKEINTRESOURCEW(IDS_COPYERRORTITLE)); + CStringW strText(MAKEINTRESOURCEW(IDS_COPYERRORSAME)); + StringCchPrintfW(szText, sizeof(szText), strText, feFrom->szFilename); + MessageBoxW(hwnd, szText, strTitle, MB_ICONERROR); + } + } + return ERROR_SHARING_VIOLATION; + } + + // subfolder? + if (IsAttribDir(feFrom->attributes)) + { + size_t cchFrom = PathAddBackslashW(szFrom) - szFrom; + size_t cchTo = PathAddBackslashW(szTo) - szTo; + if (cchFrom <= cchTo) + { + WCHAR ch = szTo[cchFrom]; + szTo[cchFrom] = 0; + int compare = lstrcmpiW(szFrom, szTo); + szTo[cchFrom] = ch; + + if (compare == 0) + { + if (!(lpFileOp->fFlags & FOF_SILENT)) + { + if (wFunc == FO_MOVE) + { + CStringW strTitle(MAKEINTRESOURCEW(IDS_MOVEERRORTITLE)); + CStringW strText(MAKEINTRESOURCEW(IDS_MOVEERRORSUBF)); + StringCchPrintfW(szText, sizeof(szText), strText, feFrom->szFilename); + MessageBoxW(hwnd, szText, strTitle, MB_ICONERROR); + } + else + { + CStringW strTitle(MAKEINTRESOURCEW(IDS_COPYERRORTITLE)); + CStringW strText(MAKEINTRESOURCEW(IDS_COPYERRORSUBF)); + StringCchPrintfW(szText, sizeof(szText), strText, feFrom->szFilename); + MessageBoxW(hwnd, szText, strTitle, MB_ICONERROR); + } + } + return ERROR_SHARING_VIOLATION; + } + } + } + } + } + + return ERROR_SUCCESS; +} +#endif /************************************************************************* * SHFileOperationW [SHELL32.@] * @@ -1810,6 +1941,11 @@ int WINAPI SHFileOperationW(LPSHFILEOPSTRUCTW lpFileOp) op.completedSize.QuadPart = 0ull; op.bManyItems = (flFrom.dwNumFiles > 1);
+#ifdef __REACTOS__ + ret = validate_operation(lpFileOp, &flFrom, &flTo); + if (ret) + goto cleanup; +#endif if (lpFileOp->wFunc != FO_RENAME && !(lpFileOp->fFlags & FOF_SILENT)) { ret = CoCreateInstance(CLSID_ProgressDialog, NULL, diff --git a/dll/win32/shell32/shresdef.h b/dll/win32/shell32/shresdef.h index 875401a23f4..9f18d8d4b4f 100644 --- a/dll/win32/shell32/shresdef.h +++ b/dll/win32/shell32/shresdef.h @@ -231,6 +231,12 @@ #define IDS_OPENFILELOCATION 341 #define IDS_DESKLINK 342 #define IDS_SENDTO_MENU 343 +#define IDS_MOVEERRORTITLE 344 +#define IDS_COPYERRORTITLE 345 +#define IDS_MOVEERRORSAME 346 +#define IDS_COPYERRORSAME 347 +#define IDS_MOVEERRORSUBF 348 +#define IDS_COPYERRORSUBF 349
#define IDS_MENU_EMPTY 34561