[SHELL32] Validate file operation (#2085)

- Support FOF_RENAMEONCOLLISION flag of SHFileOperationW.
- Add validate_operation function and use it in SHFileOperationW.

CORE-10225
This commit is contained in:
Katayama Hirofumi MZ 2019-11-30 15:36:16 +09:00 committed by GitHub
parent ccc52d2e5b
commit 0e2bb5b0b8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
36 changed files with 346 additions and 0 deletions

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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."

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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 "फ़ोल्डर बनाने में असमर्थ"

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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 "フォルダを作成できません"

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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 "Невозможно создать папку"

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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 "Не вдалося створити папку"

View file

@ -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 "无法创建文件夹"

View file

@ -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 "無法建立資料夾"

View file

@ -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,

View file

@ -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