https://git.reactos.org/?p=reactos.git;a=commitdiff;h=6413024cab03c194830ee…
commit 6413024cab03c194830eebfe169b5331fc8eb266
Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
AuthorDate: Sun Aug 6 20:07:39 2023 +0900
Commit: GitHub <noreply(a)github.com>
CommitDate: Sun Aug 6 13:07:39 2023 +0200
[SHELL32] Move SheRemoveQuotesA/W to utils.cpp (#5535)
* [SHELL32] Move SheRemoveQuotesA/W to utils.cpp
Follow-up to #5529 (7100fa8).
JIRA issue: CORE-9277
---
dll/win32/shell32/CMakeLists.txt | 1 +
dll/win32/shell32/iconcache.cpp | 48 ---------------------------------
dll/win32/shell32/utils.cpp | 58 ++++++++++++++++++++++++++++++++++++++++
3 files changed, 59 insertions(+), 48 deletions(-)
diff --git a/dll/win32/shell32/CMakeLists.txt b/dll/win32/shell32/CMakeLists.txt
index 4e1d4f63804..5f972807c8b 100644
--- a/dll/win32/shell32/CMakeLists.txt
+++ b/dll/win32/shell32/CMakeLists.txt
@@ -40,6 +40,7 @@ list(APPEND SOURCE
folders.cpp
iconcache.cpp
shell32.cpp
+ utils.cpp
CShellItem.cpp
CShellLink.cpp
CFolderOptions.cpp
diff --git a/dll/win32/shell32/iconcache.cpp b/dll/win32/shell32/iconcache.cpp
index 3da28ecd826..9a55f0f9fc0 100644
--- a/dll/win32/shell32/iconcache.cpp
+++ b/dll/win32/shell32/iconcache.cpp
@@ -987,54 +987,6 @@ HICON WINAPI ExtractAssociatedIconW(HINSTANCE hInst, LPWSTR
lpIconPath, LPWORD l
return hIcon;
}
-/*************************************************************************
- * SheRemoveQuotesA (SHELL32.@)
- */
-EXTERN_C LPSTR
-WINAPI
-SheRemoveQuotesA(LPSTR psz)
-{
- PCHAR pch;
-
- if (*psz == '"')
- {
- for (pch = psz + 1; *pch && *pch != '"'; ++pch)
- {
- *(pch - 1) = *pch;
- }
-
- if (*pch == '"')
- *(pch - 1) = ANSI_NULL;
- }
-
- return psz;
-}
-
-/*************************************************************************
- * SheRemoveQuotesW (SHELL32.@)
- *
- * ExtractAssociatedIconExW uses this function.
- */
-EXTERN_C LPWSTR
-WINAPI
-SheRemoveQuotesW(LPWSTR psz)
-{
- PWCHAR pch;
-
- if (*psz == L'"')
- {
- for (pch = psz + 1; *pch && *pch != L'"'; ++pch)
- {
- *(pch - 1) = *pch;
- }
-
- if (*pch == L'"')
- *(pch - 1) = UNICODE_NULL;
- }
-
- return psz;
-}
-
/*************************************************************************
* ExtractAssociatedIconExW (SHELL32.@)
*
diff --git a/dll/win32/shell32/utils.cpp b/dll/win32/shell32/utils.cpp
new file mode 100644
index 00000000000..c2085b9c1e0
--- /dev/null
+++ b/dll/win32/shell32/utils.cpp
@@ -0,0 +1,58 @@
+/*
+ * PROJECT: shell32
+ * LICENSE: LGPL-2.1+ (
https://spdx.org/licenses/LGPL-2.1+)
+ * PURPOSE: Utility functions
+ * COPYRIGHT: Copyright 2023 Katayama Hirofumi MZ
<katayama.hirofumi.mz(a)gmail.com>
+ */
+
+#include "precomp.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(shell);
+
+/*************************************************************************
+ * SheRemoveQuotesA (SHELL32.@)
+ */
+EXTERN_C LPSTR
+WINAPI
+SheRemoveQuotesA(LPSTR psz)
+{
+ PCHAR pch;
+
+ if (*psz == '"')
+ {
+ for (pch = psz + 1; *pch && *pch != '"'; ++pch)
+ {
+ *(pch - 1) = *pch;
+ }
+
+ if (*pch == '"')
+ *(pch - 1) = ANSI_NULL;
+ }
+
+ return psz;
+}
+
+/*************************************************************************
+ * SheRemoveQuotesW (SHELL32.@)
+ *
+ * ExtractAssociatedIconExW uses this function.
+ */
+EXTERN_C LPWSTR
+WINAPI
+SheRemoveQuotesW(LPWSTR psz)
+{
+ PWCHAR pch;
+
+ if (*psz == L'"')
+ {
+ for (pch = psz + 1; *pch && *pch != L'"'; ++pch)
+ {
+ *(pch - 1) = *pch;
+ }
+
+ if (*pch == L'"')
+ *(pch - 1) = UNICODE_NULL;
+ }
+
+ return psz;
+}