From c88ebdd4735d3aece4b3d30e7863f69180f431ef Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Tue, 24 Feb 2015 04:25:29 +0100
Subject: [PATCH] shell32: Correct indentation in shfileop.c.

---
 dlls/shell32/shlfileop.c | 662 +++++++++++++++++++--------------------
 1 file changed, 330 insertions(+), 332 deletions(-)

diff --git a/dlls/shell32/shlfileop.c b/dlls/shell32/shlfileop.c
index 78ee2d1c0..180302db2 100644
--- a/dlls/shell32/shlfileop.c
+++ b/dlls/shell32/shlfileop.c
@@ -207,108 +207,107 @@ static int SHELL_ConfirmMsgBox(HWND hWnd, LPWSTR lpszText, LPWSTR lpszCaption, H
 /* confirmation dialogs content */
 typedef struct
 {
-        HINSTANCE hIconInstance;
-        UINT icon_resource_id;
-	UINT caption_resource_id, text_resource_id;
+    HINSTANCE hIconInstance;
+    UINT icon_resource_id;
+    UINT caption_resource_id, text_resource_id;
 } SHELL_ConfirmIDstruc;
 
 static BOOL SHELL_ConfirmIDs(int nKindOfDialog, SHELL_ConfirmIDstruc *ids)
 {
-        ids->hIconInstance = shell32_hInstance;
-	switch (nKindOfDialog) {
-	  case ASK_DELETE_FILE:
-            ids->icon_resource_id = IDI_SHELL_CONFIRM_DELETE;
-	    ids->caption_resource_id  = IDS_DELETEITEM_CAPTION;
-	    ids->text_resource_id  = IDS_DELETEITEM_TEXT;
-	    return TRUE;
-	  case ASK_DELETE_FOLDER:
-            ids->icon_resource_id = IDI_SHELL_CONFIRM_DELETE;
-	    ids->caption_resource_id  = IDS_DELETEFOLDER_CAPTION;
-	    ids->text_resource_id  = IDS_DELETEITEM_TEXT;
-	    return TRUE;
-	  case ASK_DELETE_MULTIPLE_ITEM:
-            ids->icon_resource_id = IDI_SHELL_CONFIRM_DELETE;
-	    ids->caption_resource_id  = IDS_DELETEITEM_CAPTION;
-	    ids->text_resource_id  = IDS_DELETEMULTIPLE_TEXT;
-	    return TRUE;
-          case ASK_TRASH_FILE:
-            ids->icon_resource_id = IDI_SHELL_TRASH_FILE;
-            ids->caption_resource_id = IDS_DELETEITEM_CAPTION;
-            ids->text_resource_id = IDS_TRASHITEM_TEXT;
-            return TRUE;
-          case ASK_TRASH_FOLDER:
-            ids->icon_resource_id = IDI_SHELL_TRASH_FILE;
-            ids->caption_resource_id = IDS_DELETEFOLDER_CAPTION;
-            ids->text_resource_id = IDS_TRASHFOLDER_TEXT;
-            return TRUE;
-          case ASK_TRASH_MULTIPLE_ITEM:
-            ids->icon_resource_id = IDI_SHELL_TRASH_FILE;
-            ids->caption_resource_id = IDS_DELETEITEM_CAPTION;
-            ids->text_resource_id = IDS_TRASHMULTIPLE_TEXT;
-            return TRUE;
-          case ASK_CANT_TRASH_ITEM:
-            ids->icon_resource_id = IDI_SHELL_CONFIRM_DELETE;
-            ids->caption_resource_id  = IDS_DELETEITEM_CAPTION;
-            ids->text_resource_id  = IDS_CANTTRASH_TEXT;
-            return TRUE;
-	  case ASK_DELETE_SELECTED:
-            ids->icon_resource_id = IDI_SHELL_CONFIRM_DELETE;
+    ids->hIconInstance = shell32_hInstance;
+    switch (nKindOfDialog) {
+        case ASK_DELETE_FILE:
+             ids->icon_resource_id = IDI_SHELL_CONFIRM_DELETE;
             ids->caption_resource_id  = IDS_DELETEITEM_CAPTION;
-            ids->text_resource_id  = IDS_DELETESELECTED_TEXT;
+            ids->text_resource_id  = IDS_DELETEITEM_TEXT;
             return TRUE;
-	  case ASK_OVERWRITE_FILE:
-            ids->hIconInstance = NULL;
-            ids->icon_resource_id = IDI_WARNING;
-	    ids->caption_resource_id  = IDS_OVERWRITEFILE_CAPTION;
-	    ids->text_resource_id  = IDS_OVERWRITEFILE_TEXT;
+        case ASK_DELETE_FOLDER:
+             ids->icon_resource_id = IDI_SHELL_CONFIRM_DELETE;
+            ids->caption_resource_id  = IDS_DELETEFOLDER_CAPTION;
+            ids->text_resource_id  = IDS_DELETEITEM_TEXT;
             return TRUE;
-	  case ASK_OVERWRITE_FOLDER:
-            ids->hIconInstance = NULL;
-            ids->icon_resource_id = IDI_WARNING;
-            ids->caption_resource_id  = IDS_OVERWRITEFILE_CAPTION;
-            ids->text_resource_id  = IDS_OVERWRITEFOLDER_TEXT;
+        case ASK_DELETE_MULTIPLE_ITEM:
+             ids->icon_resource_id = IDI_SHELL_CONFIRM_DELETE;
+            ids->caption_resource_id  = IDS_DELETEITEM_CAPTION;
+            ids->text_resource_id  = IDS_DELETEMULTIPLE_TEXT;
             return TRUE;
-	  default:
-	    FIXME(" Unhandled nKindOfDialog %d stub\n", nKindOfDialog);
-	}
-	return FALSE;
+        case ASK_TRASH_FILE:
+             ids->icon_resource_id = IDI_SHELL_TRASH_FILE;
+             ids->caption_resource_id = IDS_DELETEITEM_CAPTION;
+             ids->text_resource_id = IDS_TRASHITEM_TEXT;
+             return TRUE;
+        case ASK_TRASH_FOLDER:
+             ids->icon_resource_id = IDI_SHELL_TRASH_FILE;
+             ids->caption_resource_id = IDS_DELETEFOLDER_CAPTION;
+             ids->text_resource_id = IDS_TRASHFOLDER_TEXT;
+             return TRUE;
+        case ASK_TRASH_MULTIPLE_ITEM:
+             ids->icon_resource_id = IDI_SHELL_TRASH_FILE;
+             ids->caption_resource_id = IDS_DELETEITEM_CAPTION;
+             ids->text_resource_id = IDS_TRASHMULTIPLE_TEXT;
+             return TRUE;
+        case ASK_CANT_TRASH_ITEM:
+             ids->icon_resource_id = IDI_SHELL_CONFIRM_DELETE;
+             ids->caption_resource_id  = IDS_DELETEITEM_CAPTION;
+             ids->text_resource_id  = IDS_CANTTRASH_TEXT;
+             return TRUE;
+        case ASK_DELETE_SELECTED:
+             ids->icon_resource_id = IDI_SHELL_CONFIRM_DELETE;
+             ids->caption_resource_id  = IDS_DELETEITEM_CAPTION;
+             ids->text_resource_id  = IDS_DELETESELECTED_TEXT;
+             return TRUE;
+        case ASK_OVERWRITE_FILE:
+             ids->hIconInstance = NULL;
+             ids->icon_resource_id = IDI_WARNING;
+             ids->caption_resource_id  = IDS_OVERWRITEFILE_CAPTION;
+             ids->text_resource_id  = IDS_OVERWRITEFILE_TEXT;
+             return TRUE;
+        case ASK_OVERWRITE_FOLDER:
+             ids->hIconInstance = NULL;
+             ids->icon_resource_id = IDI_WARNING;
+             ids->caption_resource_id  = IDS_OVERWRITEFILE_CAPTION;
+             ids->text_resource_id  = IDS_OVERWRITEFOLDER_TEXT;
+             return TRUE;
+        default:
+            FIXME(" Unhandled nKindOfDialog %d stub\n", nKindOfDialog);
+   }
+   return FALSE;
 }
 
 static BOOL SHELL_ConfirmDialogW(HWND hWnd, int nKindOfDialog, LPCWSTR szDir, FILE_OPERATION *op)
 {
-	WCHAR szCaption[255], szText[255], szBuffer[MAX_PATH + 256];
-	SHELL_ConfirmIDstruc ids;
-	DWORD_PTR args[1];
-	HICON hIcon;
-	int ret;
-
-        assert(nKindOfDialog >= 0 && nKindOfDialog < 32);
-        if (op && (op->dwYesToAllMask & (1 << nKindOfDialog)))
-            return TRUE;
-
-        if (!SHELL_ConfirmIDs(nKindOfDialog, &ids)) return FALSE;
-
-        LoadStringW(shell32_hInstance, ids.caption_resource_id, szCaption, ARRAY_SIZE(szCaption));
-        LoadStringW(shell32_hInstance, ids.text_resource_id, szText, ARRAY_SIZE(szText));
-
-        args[0] = (DWORD_PTR)szDir;
-        FormatMessageW(FORMAT_MESSAGE_FROM_STRING|FORMAT_MESSAGE_ARGUMENT_ARRAY,
-            szText, 0, 0, szBuffer, ARRAY_SIZE(szBuffer), (__ms_va_list*)args);
-
-        hIcon = LoadIconW(ids.hIconInstance, (LPWSTR)MAKEINTRESOURCE(ids.icon_resource_id));
+    WCHAR szCaption[255], szText[255], szBuffer[MAX_PATH + 256];
+    SHELL_ConfirmIDstruc ids;
+    DWORD_PTR args[1];
+    HICON hIcon;
+    int ret;
 
-        ret = SHELL_ConfirmMsgBox(hWnd, szBuffer, szCaption, hIcon, op && op->bManyItems);
-        if (op) {
-            if (ret == IDD_YESTOALL) {
-                op->dwYesToAllMask |= (1 << nKindOfDialog);
-                ret = IDYES;
-            }
-            if (ret == IDCANCEL)
-                op->bCancelled = TRUE;
-            if (ret != IDYES)
-                op->req->fAnyOperationsAborted = TRUE;
-        }
-        return ret == IDYES;
+    assert(nKindOfDialog >= 0 && nKindOfDialog < 32);
+    if (op && (op->dwYesToAllMask & (1 << nKindOfDialog)))
+        return TRUE;
+
+    if (!SHELL_ConfirmIDs(nKindOfDialog, &ids)) return FALSE;
+
+    LoadStringW(shell32_hInstance, ids.caption_resource_id, szCaption, ARRAY_SIZE(szCaption));
+    LoadStringW(shell32_hInstance, ids.text_resource_id, szText, ARRAY_SIZE(szText));
+
+    args[0] = (DWORD_PTR)szDir;
+    FormatMessageW(FORMAT_MESSAGE_FROM_STRING|FORMAT_MESSAGE_ARGUMENT_ARRAY,
+        szText, 0, 0, szBuffer, ARRAY_SIZE(szBuffer), (__ms_va_list*)args);
+    hIcon = LoadIconW(ids.hIconInstance, (LPWSTR)MAKEINTRESOURCE(ids.icon_resource_id));
+
+    ret = SHELL_ConfirmMsgBox(hWnd, szBuffer, szCaption, hIcon, op && op->bManyItems);
+    if (op) {
+        if (ret == IDD_YESTOALL) {
+            op->dwYesToAllMask |= (1 << nKindOfDialog);
+            ret = IDYES;
+         }
+        if (ret == IDCANCEL)
+            op->bCancelled = TRUE;
+        if (ret != IDYES)
+            op->req->fAnyOperationsAborted = TRUE;
+    }
+    return ret == IDYES;
 }
 
 BOOL SHELL_ConfirmYesNoW(HWND hWnd, int nKindOfDialog, LPCWSTR szDir)
@@ -318,18 +317,18 @@ BOOL SHELL_ConfirmYesNoW(HWND hWnd, int nKindOfDialog, LPCWSTR szDir)
 
 static DWORD SHELL32_AnsiToUnicodeBuf(LPCSTR aPath, LPWSTR *wPath, DWORD minChars)
 {
-	DWORD len = MultiByteToWideChar(CP_ACP, 0, aPath, -1, NULL, 0);
+    DWORD len = MultiByteToWideChar(CP_ACP, 0, aPath, -1, NULL, 0);
 
-	if (len < minChars)
-	  len = minChars;
+    if (len < minChars)
+      len = minChars;
 
-	*wPath = heap_alloc(len * sizeof(WCHAR));
-	if (*wPath)
-	{
-	  MultiByteToWideChar(CP_ACP, 0, aPath, -1, *wPath, len);
-	  return NO_ERROR;
-	}
-	return E_OUTOFMEMORY;
+    *wPath = heap_alloc(len * sizeof(WCHAR));
+    if (*wPath)
+    {
+        MultiByteToWideChar(CP_ACP, 0, aPath, -1, *wPath, len);
+        return NO_ERROR;
+    }
+    return E_OUTOFMEMORY;
 }
 
 HRESULT WINAPI SHIsFileAvailableOffline(LPCWSTR path, LPDWORD status)
@@ -372,8 +371,8 @@ static DWORD SHELL_DeleteDirectoryW(HWND hwnd, LPCWSTR pszDir, BOOL bShowUI)
         ret = SHNotifyRemoveDirectoryW(pszDir);
 
     return ret == ERROR_PATH_NOT_FOUND ?
-        0x7C: /* DE_INVALIDFILES (legacy Windows error) */
-        ret;
+                  0x7C: /* DE_INVALIDFILES (legacy Windows error) */
+                  ret;
 }
 
 /**************************************************************************
@@ -393,41 +392,41 @@ static DWORD SHELL_DeleteDirectoryW(HWND hwnd, LPCWSTR pszDir, BOOL bShowUI)
  */
 static DWORD SHNotifyCreateDirectoryA(LPCSTR path, LPSECURITY_ATTRIBUTES sec)
 {
-	LPWSTR wPath;
-	DWORD retCode;
+    LPWSTR wPath;
+    DWORD retCode;
 
-	TRACE("(%s, %p)\n", debugstr_a(path), sec);
+    TRACE("(%s, %p)\n", debugstr_a(path), sec);
 
-	retCode = SHELL32_AnsiToUnicodeBuf(path, &wPath, 0);
-	if (!retCode)
-	{
-	  retCode = SHNotifyCreateDirectoryW(wPath, sec);
-	  heap_free(wPath);
-	}
-	return retCode;
+    retCode = SHELL32_AnsiToUnicodeBuf(path, &wPath, 0);
+    if (!retCode)
+    {
+        retCode = SHNotifyCreateDirectoryW(wPath, sec);
+        heap_free(wPath);
+    }
+    return retCode;
 }
 
 /**********************************************************************/
 
 static DWORD SHNotifyCreateDirectoryW(LPCWSTR path, LPSECURITY_ATTRIBUTES sec)
 {
-	TRACE("(%s, %p)\n", debugstr_w(path), sec);
+    TRACE("(%s, %p)\n", debugstr_w(path), sec);
 
-	if (CreateDirectoryW(path, sec))
-	{
-	  SHChangeNotify(SHCNE_MKDIR, SHCNF_PATHW, path, NULL);
-	  return ERROR_SUCCESS;
-	}
-	return GetLastError();
+    if (CreateDirectoryW(path, sec))
+    {
+        SHChangeNotify(SHCNE_MKDIR, SHCNF_PATHW, path, NULL);
+        return ERROR_SUCCESS;
+    }
+    return GetLastError();
 }
 
 /**********************************************************************/
 
 BOOL WINAPI Win32CreateDirectoryAW(LPCVOID path, LPSECURITY_ATTRIBUTES sec)
 {
-	if (SHELL_OsIsUnicode())
-	  return (SHNotifyCreateDirectoryW(path, sec) == ERROR_SUCCESS);
-	return (SHNotifyCreateDirectoryA(path, sec) == ERROR_SUCCESS);
+    if (SHELL_OsIsUnicode())
+        return (SHNotifyCreateDirectoryW(path, sec) == ERROR_SUCCESS);
+    return (SHNotifyCreateDirectoryA(path, sec) == ERROR_SUCCESS);
 }
 
 /************************************************************************
@@ -447,51 +446,51 @@ BOOL WINAPI Win32CreateDirectoryAW(LPCVOID path, LPSECURITY_ATTRIBUTES sec)
  */
 static DWORD SHNotifyRemoveDirectoryA(LPCSTR path)
 {
-	LPWSTR wPath;
-	DWORD retCode;
+    LPWSTR wPath;
+    DWORD retCode;
 
-	TRACE("(%s)\n", debugstr_a(path));
+    TRACE("(%s)\n", debugstr_a(path));
 
-	retCode = SHELL32_AnsiToUnicodeBuf(path, &wPath, 0);
-	if (!retCode)
-	{
-	  retCode = SHNotifyRemoveDirectoryW(wPath);
-	  heap_free(wPath);
-	}
-	return retCode;
+    retCode = SHELL32_AnsiToUnicodeBuf(path, &wPath, 0);
+    if (!retCode)
+    {
+        retCode = SHNotifyRemoveDirectoryW(wPath);
+        heap_free(wPath);
+    }
+    return retCode;
 }
 
 /***********************************************************************/
 
 static DWORD SHNotifyRemoveDirectoryW(LPCWSTR path)
 {
-	BOOL ret;
-	TRACE("(%s)\n", debugstr_w(path));
+    BOOL ret;
+    TRACE("(%s)\n", debugstr_w(path));
 
-	ret = RemoveDirectoryW(path);
-	if (!ret)
-	{
-	  /* Directory may be write protected */
-	  DWORD dwAttr = GetFileAttributesW(path);
-	  if (IsAttrib(dwAttr, FILE_ATTRIBUTE_READONLY))
-	    if (SetFileAttributesW(path, dwAttr & ~FILE_ATTRIBUTE_READONLY))
-	      ret = RemoveDirectoryW(path);
-	}
-	if (ret)
-	{
-	  SHChangeNotify(SHCNE_RMDIR, SHCNF_PATHW, path, NULL);
-	  return ERROR_SUCCESS;
-	}
-	return GetLastError();
+    ret = RemoveDirectoryW(path);
+    if (!ret)
+    {
+        /* Directory may be write protected */
+        DWORD dwAttr = GetFileAttributesW(path);
+        if (IsAttrib(dwAttr, FILE_ATTRIBUTE_READONLY))
+            if (SetFileAttributesW(path, dwAttr & ~FILE_ATTRIBUTE_READONLY))
+                ret = RemoveDirectoryW(path);
+    }
+    if (ret)
+    {
+        SHChangeNotify(SHCNE_RMDIR, SHCNF_PATHW, path, NULL);
+        return ERROR_SUCCESS;
+    }
+    return GetLastError();
 }
 
 /***********************************************************************/
 
 BOOL WINAPI Win32RemoveDirectoryAW(LPCVOID path)
 {
-	if (SHELL_OsIsUnicode())
-	  return (SHNotifyRemoveDirectoryW(path) == ERROR_SUCCESS);
-	return (SHNotifyRemoveDirectoryA(path) == ERROR_SUCCESS);
+    if (SHELL_OsIsUnicode())
+        return (SHNotifyRemoveDirectoryW(path) == ERROR_SUCCESS);
+    return (SHNotifyRemoveDirectoryA(path) == ERROR_SUCCESS);
 }
 
 /************************************************************************
@@ -511,52 +510,52 @@ BOOL WINAPI Win32RemoveDirectoryAW(LPCVOID path)
  */
 static DWORD SHNotifyDeleteFileA(LPCSTR path)
 {
-	LPWSTR wPath;
-	DWORD retCode;
+    LPWSTR wPath;
+    DWORD retCode;
 
-	TRACE("(%s)\n", debugstr_a(path));
+    TRACE("(%s)\n", debugstr_a(path));
 
-	retCode = SHELL32_AnsiToUnicodeBuf(path, &wPath, 0);
-	if (!retCode)
-	{
-	  retCode = SHNotifyDeleteFileW(wPath);
-	  heap_free(wPath);
-	}
-	return retCode;
+    retCode = SHELL32_AnsiToUnicodeBuf(path, &wPath, 0);
+    if (!retCode)
+    {
+        retCode = SHNotifyDeleteFileW(wPath);
+        heap_free(wPath);
+    }
+    return retCode;
 }
 
 /***********************************************************************/
 
 static DWORD SHNotifyDeleteFileW(LPCWSTR path)
 {
-	BOOL ret;
+    BOOL ret;
 
-	TRACE("(%s)\n", debugstr_w(path));
+    TRACE("(%s)\n", debugstr_w(path));
 
-	ret = DeleteFileW(path);
-	if (!ret)
-	{
-	  /* File may be write protected or a system file */
-	  DWORD dwAttr = GetFileAttributesW(path);
-	  if (IsAttrib(dwAttr, FILE_ATTRIBUTE_READONLY | FILE_ATTRIBUTE_SYSTEM))
-	    if (SetFileAttributesW(path, dwAttr & ~(FILE_ATTRIBUTE_READONLY | FILE_ATTRIBUTE_SYSTEM)))
-	      ret = DeleteFileW(path);
-	}
-	if (ret)
-	{
-	  SHChangeNotify(SHCNE_DELETE, SHCNF_PATHW, path, NULL);
-	  return ERROR_SUCCESS;
-	}
-	return GetLastError();
+    ret = DeleteFileW(path);
+    if (!ret)
+    {
+        /* File may be write protected or a system file */
+        DWORD dwAttr = GetFileAttributesW(path);
+        if (IsAttrib(dwAttr, FILE_ATTRIBUTE_READONLY | FILE_ATTRIBUTE_SYSTEM))
+            if (SetFileAttributesW(path, dwAttr & ~(FILE_ATTRIBUTE_READONLY | FILE_ATTRIBUTE_SYSTEM)))
+                ret = DeleteFileW(path);
+    }
+    if (ret)
+    {
+        SHChangeNotify(SHCNE_DELETE, SHCNF_PATHW, path, NULL);
+        return ERROR_SUCCESS;
+    }
+    return GetLastError();
 }
 
 /***********************************************************************/
 
 DWORD WINAPI Win32DeleteFileAW(LPCVOID path)
 {
-	if (SHELL_OsIsUnicode())
-	  return (SHNotifyDeleteFileW(path) == ERROR_SUCCESS);
-	return (SHNotifyDeleteFileA(path) == ERROR_SUCCESS);
+    if (SHELL_OsIsUnicode())
+        return (SHNotifyDeleteFileW(path) == ERROR_SUCCESS);
+    return (SHNotifyDeleteFileA(path) == ERROR_SUCCESS);
 }
 
 /************************************************************************
@@ -573,36 +572,36 @@ DWORD WINAPI Win32DeleteFileAW(LPCVOID path)
  */
 static DWORD SHNotifyMoveFileW(LPCWSTR src, LPCWSTR dest)
 {
-	BOOL ret;
+    BOOL ret;
 
-	TRACE("(%s %s)\n", debugstr_w(src), debugstr_w(dest));
+    TRACE("(%s %s)\n", debugstr_w(src), debugstr_w(dest));
 
-        ret = MoveFileExW(src, dest, MOVEFILE_REPLACE_EXISTING);
+    ret = MoveFileExW(src, dest, MOVEFILE_REPLACE_EXISTING);
 
-        /* MOVEFILE_REPLACE_EXISTING fails with dirs, so try MoveFile */
-        if (!ret)
-            ret = MoveFileW(src, dest);
+    /* MOVEFILE_REPLACE_EXISTING fails with dirs, so try MoveFile */
+    if (!ret)
+        ret = MoveFileW(src, dest);
 
-	if (!ret)
-	{
-	  DWORD dwAttr;
+    if (!ret)
+    {
+        DWORD dwAttr;
 
-	  dwAttr = SHFindAttrW(dest, FALSE);
-	  if (INVALID_FILE_ATTRIBUTES == dwAttr)
-	  {
-	    /* Source file may be write protected or a system file */
-	    dwAttr = GetFileAttributesW(src);
-	    if (IsAttrib(dwAttr, FILE_ATTRIBUTE_READONLY | FILE_ATTRIBUTE_SYSTEM))
-	      if (SetFileAttributesW(src, dwAttr & ~(FILE_ATTRIBUTE_READONLY | FILE_ATTRIBUTE_SYSTEM)))
-	        ret = MoveFileW(src, dest);
-	  }
-	}
-	if (ret)
-	{
-	  SHChangeNotify(SHCNE_RENAMEITEM, SHCNF_PATHW, src, dest);
-	  return ERROR_SUCCESS;
-	}
-	return GetLastError();
+        dwAttr = SHFindAttrW(dest, FALSE);
+        if (INVALID_FILE_ATTRIBUTES == dwAttr)
+        {
+            /* Source file may be write protected or a system file */
+            dwAttr = GetFileAttributesW(src);
+            if (IsAttrib(dwAttr, FILE_ATTRIBUTE_READONLY | FILE_ATTRIBUTE_SYSTEM))
+                if (SetFileAttributesW(src, dwAttr & ~(FILE_ATTRIBUTE_READONLY | FILE_ATTRIBUTE_SYSTEM)))
+                    ret = MoveFileW(src, dest);
+        }
+    }
+    if (ret)
+    {
+        SHChangeNotify(SHCNE_RENAMEITEM, SHCNF_PATHW, src, dest);
+        return ERROR_SUCCESS;
+    }
+    return GetLastError();
 }
 
 /************************************************************************
@@ -621,24 +620,24 @@ static DWORD SHNotifyMoveFileW(LPCWSTR src, LPCWSTR dest)
  */
 static DWORD SHNotifyCopyFileW(LPCWSTR src, LPCWSTR dest, BOOL bFailIfExists)
 {
-	BOOL ret;
-	DWORD attribs;
+    BOOL ret;
+    DWORD attribs;
 
-	TRACE("(%s %s %s)\n", debugstr_w(src), debugstr_w(dest), bFailIfExists ? "failIfExists" : "");
+    TRACE("(%s %s %s)\n", debugstr_w(src), debugstr_w(dest), bFailIfExists ? "failIfExists" : "");
 
-        /* Destination file may already exist with read only attribute */
-        attribs = GetFileAttributesW(dest);
-        if (IsAttrib(attribs, FILE_ATTRIBUTE_READONLY))
-          SetFileAttributesW(dest, attribs & ~FILE_ATTRIBUTE_READONLY);
+    /* Destination file may already exist with read only attribute */
+    attribs = GetFileAttributesW(dest);
+    if (IsAttrib(attribs, FILE_ATTRIBUTE_READONLY))
+        SetFileAttributesW(dest, attribs & ~FILE_ATTRIBUTE_READONLY);
 
-	ret = CopyFileW(src, dest, bFailIfExists);
-	if (ret)
-	{
-	  SHChangeNotify(SHCNE_CREATE, SHCNF_PATHW, dest, NULL);
-	  return ERROR_SUCCESS;
-	}
+    ret = CopyFileW(src, dest, bFailIfExists);
+    if (ret)
+    {
+        SHChangeNotify(SHCNE_CREATE, SHCNF_PATHW, dest, NULL);
+        return ERROR_SUCCESS;
+    }
 
-	return GetLastError();
+    return GetLastError();
 }
 
 /*************************************************************************
@@ -668,9 +667,9 @@ static DWORD SHNotifyCopyFileW(LPCWSTR src, LPCWSTR dest, BOOL bFailIfExists)
  */
 DWORD WINAPI SHCreateDirectory(HWND hWnd, LPCVOID path)
 {
-	if (SHELL_OsIsUnicode())
-	  return SHCreateDirectoryExW(hWnd, path, NULL);
-	return SHCreateDirectoryExA(hWnd, path, NULL);
+    if (SHELL_OsIsUnicode())
+        return SHCreateDirectoryExW(hWnd, path, NULL);
+    return SHCreateDirectoryExA(hWnd, path, NULL);
 }
 
 /*************************************************************************
@@ -707,18 +706,18 @@ DWORD WINAPI SHCreateDirectory(HWND hWnd, LPCVOID path)
  */
 int WINAPI SHCreateDirectoryExA(HWND hWnd, LPCSTR path, LPSECURITY_ATTRIBUTES sec)
 {
-	LPWSTR wPath;
-	DWORD retCode;
+    LPWSTR wPath;
+    DWORD retCode;
 
-	TRACE("(%s, %p)\n", debugstr_a(path), sec);
+    TRACE("(%s, %p)\n", debugstr_a(path), sec);
 
-	retCode = SHELL32_AnsiToUnicodeBuf(path, &wPath, 0);
-	if (!retCode)
-	{
-	  retCode = SHCreateDirectoryExW(hWnd, wPath, sec);
-	  heap_free(wPath);
-	}
-	return retCode;
+    retCode = SHELL32_AnsiToUnicodeBuf(path, &wPath, 0);
+    if (!retCode)
+    {
+        retCode = SHCreateDirectoryExW(hWnd, wPath, sec);
+        heap_free(wPath);
+    }
+    return retCode;
 }
 
 /*************************************************************************
@@ -792,25 +791,25 @@ int WINAPI SHCreateDirectoryExW(HWND hWnd, LPCWSTR path, LPSECURITY_ATTRIBUTES s
  */
 static DWORD SHFindAttrW(LPCWSTR pName, BOOL fileOnly)
 {
-	WIN32_FIND_DATAW wfd;
-	BOOL b_FileMask = fileOnly && (NULL != StrPBrkW(pName, wWildcardChars));
-	DWORD dwAttr = INVALID_FILE_ATTRIBUTES;
-	HANDLE hFind = FindFirstFileW(pName, &wfd);
+    WIN32_FIND_DATAW wfd;
+    BOOL b_FileMask = fileOnly && (NULL != StrPBrkW(pName, wWildcardChars));
+    DWORD dwAttr = INVALID_FILE_ATTRIBUTES;
+    HANDLE hFind = FindFirstFileW(pName, &wfd);
 
-	TRACE("%s %d\n", debugstr_w(pName), fileOnly);
-	if (INVALID_HANDLE_VALUE != hFind)
-	{
-	  do
-	  {
-	    if (b_FileMask && IsAttribDir(wfd.dwFileAttributes))
-	       continue;
-	    dwAttr = wfd.dwFileAttributes;
-	    break;
-	  }
-	  while (FindNextFileW(hFind, &wfd));
-	  FindClose(hFind);
-	}
-	return dwAttr;
+    TRACE("%s %d\n", debugstr_w(pName), fileOnly);
+    if (INVALID_HANDLE_VALUE != hFind)
+    {
+        do
+        {
+            if (b_FileMask && IsAttribDir(wfd.dwFileAttributes))
+                continue;
+            dwAttr = wfd.dwFileAttributes;
+            break;
+        }
+        while (FindNextFileW(hFind, &wfd));
+        FindClose(hFind);
+    }
+    return dwAttr;
 }
 
 /*************************************************************************
@@ -824,27 +823,27 @@ static DWORD SHFindAttrW(LPCWSTR pName, BOOL fileOnly)
  */
 static DWORD SHNameTranslate(LPWSTR* wString, LPCWSTR* pWToFrom, BOOL more)
 {
-	DWORD size = 0, aSize = 0;
-	LPCSTR aString = (LPCSTR)*pWToFrom;
+    DWORD size = 0, aSize = 0;
+    LPCSTR aString = (LPCSTR)*pWToFrom;
 
-	if (aString)
-	{
-	  do
-	  {
-	    size = lstrlenA(aString) + 1;
-	    aSize += size;
-	    aString += size;
-	  } while ((size != 1) && more);
-	  /* The two sizes might be different in the case of multibyte chars */
-	  size = MultiByteToWideChar(CP_ACP, 0, (LPCSTR)*pWToFrom, aSize, *wString, 0);
-	  if (*wString) /* only in the second loop */
-	  {
-	    MultiByteToWideChar(CP_ACP, 0, (LPCSTR)*pWToFrom, aSize, *wString, size);
-	    *pWToFrom = *wString;
-	    *wString += size;
-	  }
-	}
-	return size;
+    if (aString)
+    {
+        do
+        {
+            size = lstrlenA(aString) + 1;
+            aSize += size;
+            aString += size;
+        } while ((size != 1) && more);
+        /* The two sizes might be different in the case of multibyte chars */
+        size = MultiByteToWideChar(CP_ACP, 0, (LPCSTR)*pWToFrom, aSize, *wString, 0);
+        if (*wString) /* only in the second loop */
+        {
+            MultiByteToWideChar(CP_ACP, 0, (LPCSTR)*pWToFrom, aSize, *wString, size);
+            *pWToFrom = *wString;
+            *wString += size;
+        }
+    }
+    return size;
 }
 /*************************************************************************
  * SHFileOperationA          [SHELL32.@]
@@ -864,46 +863,45 @@ static DWORD SHNameTranslate(LPWSTR* wString, LPCWSTR* pWToFrom, BOOL more)
  */
 int WINAPI SHFileOperationA(LPSHFILEOPSTRUCTA lpFileOp)
 {
-	SHFILEOPSTRUCTW nFileOp = *((LPSHFILEOPSTRUCTW)lpFileOp);
-	int retCode = 0;
-	DWORD size;
-	LPWSTR ForFree = NULL, /* we change wString in SHNameTranslate and can't use it for freeing */
-	       wString = NULL; /* we change this in SHNameTranslate */
-
-	TRACE("\n");
-	if (FO_DELETE == (nFileOp.wFunc & FO_MASK))
-	  nFileOp.pTo = NULL; /* we need a NULL or a valid pointer for translation */
-	if (!(nFileOp.fFlags & FOF_SIMPLEPROGRESS))
-	  nFileOp.lpszProgressTitle = NULL; /* we need a NULL or a valid pointer for translation */
-	while (1) /* every loop calculate size, second translate also, if we have storage for this */
-	{
-	  size = SHNameTranslate(&wString, &nFileOp.lpszProgressTitle, FALSE); /* no loop */
-	  size += SHNameTranslate(&wString, &nFileOp.pFrom, TRUE); /* internal loop */
-	  size += SHNameTranslate(&wString, &nFileOp.pTo, TRUE); /* internal loop */
-
-	  if (ForFree)
-	  {
-	    retCode = SHFileOperationW(&nFileOp);
-	    /* Windows 95/98 returns S_OK for this case. */
-	    if (retCode == ERROR_ACCESS_DENIED && (GetVersion() & 0x80000000))
-	      retCode = S_OK;
+    SHFILEOPSTRUCTW nFileOp = *((LPSHFILEOPSTRUCTW)lpFileOp);
+    int retCode = 0;
+    DWORD size;
+    LPWSTR ForFree = NULL, /* we change wString in SHNameTranslate and can't use it for freeing */
+           wString = NULL; /* we change this in SHNameTranslate */
+
+    TRACE("\n");
+    if (FO_DELETE == (nFileOp.wFunc & FO_MASK))
+        nFileOp.pTo = NULL; /* we need a NULL or a valid pointer for translation */
+    if (!(nFileOp.fFlags & FOF_SIMPLEPROGRESS))
+        nFileOp.lpszProgressTitle = NULL; /* we need a NULL or a valid pointer for translation */
+    while (1) /* every loop calculate size, second translate also, if we have storage for this */
+    {
+        size = SHNameTranslate(&wString, &nFileOp.lpszProgressTitle, FALSE); /* no loop */
+        size += SHNameTranslate(&wString, &nFileOp.pFrom, TRUE); /* internal loop */
+        size += SHNameTranslate(&wString, &nFileOp.pTo, TRUE); /* internal loop */
 
-	    heap_free(ForFree); /* we cannot use wString, it was changed */
-	    break;
-	  }
-	  else
-	  {
-	    wString = ForFree = heap_alloc(size * sizeof(WCHAR));
-	    if (ForFree) continue;
-	    retCode = ERROR_OUTOFMEMORY;
-	    nFileOp.fAnyOperationsAborted = TRUE;
-	    return retCode;
-	  }
-	}
+        if (ForFree)
+        {
+            retCode = SHFileOperationW(&nFileOp);
+            /* Windows 95/98 returns S_OK for this case. */
+            if (retCode == ERROR_ACCESS_DENIED && (GetVersion() & 0x80000000))
+                retCode = S_OK;
+            heap_free(ForFree); /* we cannot use wString, it was changed */
+            break;
+        }
+        else
+        {
+            wString = ForFree = heap_alloc(size * sizeof(WCHAR));
+            if (ForFree) continue;
+            retCode = ERROR_OUTOFMEMORY;
+            nFileOp.fAnyOperationsAborted = TRUE;
+            return retCode;
+        }
+    }
 
-	lpFileOp->hNameMappings = nFileOp.hNameMappings;
-	lpFileOp->fAnyOperationsAborted = nFileOp.fAnyOperationsAborted;
-	return retCode;
+    lpFileOp->hNameMappings = nFileOp.hNameMappings;
+    lpFileOp->fAnyOperationsAborted = nFileOp.fAnyOperationsAborted;
+    return retCode;
 }
 
 #define ERROR_SHELL_INTERNAL_FILE_NOT_FOUND 1026
@@ -933,7 +931,7 @@ typedef struct
 static inline void grow_list(FILE_LIST *list)
 {
     FILE_ENTRY *new = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, list->feFiles,
-                                  list->num_alloc * 2 * sizeof(*new) );
+    list->num_alloc * 2 * sizeof(*new) );
     list->feFiles = new;
     list->num_alloc *= 2;
 }
@@ -1026,7 +1024,7 @@ static HRESULT parse_file_list(FILE_LIST *flList, LPCWSTR szFiles)
     /* empty list */
     if (!szFiles[0])
         return ERROR_ACCESS_DENIED;
-        
+
     flList->feFiles = heap_alloc_zero(flList->num_alloc * sizeof(FILE_ENTRY));
 
     while (*ptr)
@@ -1131,7 +1129,7 @@ static void copy_dir_to_dir(FILE_OPERATION *op, const FILE_ENTRY *feFrom, LPCWST
     /* Don't ask the user about overwriting files when he accepted to overwrite the
        folder. FIXME: this is not exactly what Windows does - e.g. there would be
        an additional confirmation for a nested folder */
-    fileOp.fFlags |= FOF_NOCONFIRMATION;  
+    fileOp.fFlags |= FOF_NOCONFIRMATION;
 
     SHFileOperationW(&fileOp);
 }
@@ -1344,7 +1342,7 @@ static int delete_files(LPSHFILEOPSTRUCTW lpFileOp, const FILE_LIST *flFrom)
 
     /* Windows also checks only the first item */
     bTrash = (lpFileOp->fFlags & FOF_ALLOWUNDO)
-        && TRASH_CanTrashFile(flFrom->feFiles[0].szFullPath);
+             && TRASH_CanTrashFile(flFrom->feFiles[0].szFullPath);
 
     if (!(lpFileOp->fFlags & FOF_NOCONFIRMATION) || (!bTrash && lpFileOp->fFlags & FOF_WANTNUKEWARNING))
         if (!confirm_delete_list(lpFileOp->hwnd, lpFileOp->fFlags, bTrash, flFrom))
@@ -1379,11 +1377,11 @@ static int delete_files(LPSHFILEOPSTRUCTW lpFileOp, const FILE_LIST *flFrom)
                 break;
             }
         }
-        
+
         /* delete the file or directory */
         if (IsAttribFile(fileEntry->attributes))
             ret = DeleteFileW(fileEntry->szFullPath) ?
-                    ERROR_SUCCESS : GetLastError();
+                  ERROR_SUCCESS : GetLastError();
         else
             ret = SHELL_DeleteDirectoryW(lpFileOp->hwnd, fileEntry->szFullPath, FALSE);
 
@@ -1508,8 +1506,8 @@ static int rename_files(LPSHFILEOPSTRUCTW lpFileOp, const FILE_LIST *flFrom, con
 static void check_flags(FILEOP_FLAGS fFlags)
 {
     WORD wUnsupportedFlags = FOF_NO_CONNECTED_ELEMENTS |
-        FOF_NOCOPYSECURITYATTRIBS | FOF_NORECURSEREPARSE |
-        FOF_RENAMEONCOLLISION | FOF_WANTMAPPINGHANDLE;
+                             FOF_NOCOPYSECURITYATTRIBS | FOF_NORECURSEREPARSE |
+                             FOF_RENAMEONCOLLISION | FOF_WANTMAPPINGHANDLE;
 
     if (fFlags & wUnsupportedFlags)
         FIXME("Unsupported flags: %04x\n", fFlags);
@@ -1592,19 +1590,19 @@ int WINAPI SHFileOperationW(LPSHFILEOPSTRUCTW lpFileOp)
  */
 void WINAPI SHFreeNameMappings(HANDLE hNameMapping)
 {
-	if (hNameMapping)
-	{
-	  int i = SHDSA_GetItemCount((HDSA)hNameMapping) - 1;
+    if (hNameMapping)
+    {
+        int i = SHDSA_GetItemCount((HDSA)hNameMapping) - 1;
 
-	  for (; i>= 0; i--)
-	  {
+        for (; i>= 0; i--)
+        {
             LPSHNAMEMAPPINGW lp = DSA_GetItemPtr(hNameMapping, i);
 
-	    SHFree(lp->pszOldPath);
-	    SHFree(lp->pszNewPath);
-	  }
-          DSA_Destroy(hNameMapping);
-	}
+            SHFree(lp->pszOldPath);
+            SHFree(lp->pszNewPath);
+        }
+        DSA_Destroy(hNameMapping);
+    }
 }
 
 /*************************************************************************
@@ -1710,14 +1708,14 @@ DWORD WINAPI SheChangeDirW(LPWSTR path)
 }
 
 /*************************************************************************
- * IsNetDrive			[SHELL32.66]
+ * IsNetDrive                   [SHELL32.66]
  */
 int WINAPI IsNetDrive(int drive)
 {
-	char root[4];
-	strcpy(root, "A:\\");
-	root[0] += (char)drive;
-	return (GetDriveTypeA(root) == DRIVE_REMOTE);
+    char root[4];
+    strcpy(root, "A:\\");
+    root[0] += (char)drive;
+    return (GetDriveTypeA(root) == DRIVE_REMOTE);
 }
 
 
-- 
2.21.0

