From e148366e9afde02513e4696d22cf2dda53c28568 Mon Sep 17 00:00:00 2001 From: Katayama Hirofumi MZ Date: Mon, 18 May 2026 21:19:01 +0900 Subject: [PATCH] [SHLWAPI][SDK] Support FixSlashesAndColonA (#9040) Implementing missing features... JIRA issue: CORE-19278 - Implement FixSlashesAndColonA function. - Modify shlwapi.spec. - Add prototype into . --- dll/win32/shlwapi/ordinal.c | 15 +++++++++++++++ dll/win32/shlwapi/shlwapi.spec | 2 +- sdk/include/reactos/shlwapi_undoc.h | 5 ++++- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/dll/win32/shlwapi/ordinal.c b/dll/win32/shlwapi/ordinal.c index dd16b3bfd40..932f80bab38 100644 --- a/dll/win32/shlwapi/ordinal.c +++ b/dll/win32/shlwapi/ordinal.c @@ -4729,6 +4729,21 @@ DWORD WINAPI SHMenuIndexFromID(HMENU hMenu, UINT uID) } +#ifdef __REACTOS__ +/************************************************************************* + * @ [SHLWAPI.447] + */ +VOID WINAPI FixSlashesAndColonA(_Inout_ LPSTR lpstr) +{ + PCHAR pch; + for (pch = lpstr; *pch; pch = CharNextA(pch)) + { + if (*pch == '/') + *pch = '\\'; + } +} +#endif + /************************************************************************* * @ [SHLWAPI.448] */ diff --git a/dll/win32/shlwapi/shlwapi.spec b/dll/win32/shlwapi/shlwapi.spec index d3666170aaf..132b2c7b80f 100644 --- a/dll/win32/shlwapi/shlwapi.spec +++ b/dll/win32/shlwapi/shlwapi.spec @@ -444,7 +444,7 @@ 444 stdcall -noname SHGetSystemWindowsDirectoryW(ptr long) kernel32.GetSystemWindowsDirectoryW 445 stdcall -noname PathFileExistsAndAttributesA(str ptr) 446 stdcall -noname PathFileExistsAndAttributesW(wstr ptr) -447 stub -noname FixSlashesAndColonA +447 stdcall -noname FixSlashesAndColonA(str) 448 stdcall -noname FixSlashesAndColonW(wstr) 449 stub -noname NextPathA 450 stub -noname NextPathW diff --git a/sdk/include/reactos/shlwapi_undoc.h b/sdk/include/reactos/shlwapi_undoc.h index 6b8b2dd61fb..30eec8317d4 100644 --- a/sdk/include/reactos/shlwapi_undoc.h +++ b/sdk/include/reactos/shlwapi_undoc.h @@ -389,7 +389,8 @@ PathFileExistsDefExtAndAttributesW( _Out_opt_ LPDWORD pdwFileAttributes); BOOL WINAPI PathFindOnPathExW(LPWSTR lpszFile, LPCWSTR *lppszOtherDirs, DWORD dwWhich); -VOID WINAPI FixSlashesAndColonW(LPWSTR); +VOID WINAPI FixSlashesAndColonA(_Inout_ LPSTR lpstr); +VOID WINAPI FixSlashesAndColonW(_Inout_ LPWSTR lpwstr); BOOL WINAPI PathIsValidCharA(char c, DWORD dwClass); BOOL WINAPI PathIsValidCharW(WCHAR c, DWORD dwClass); BOOL WINAPI SHGetPathFromIDListWrapW(LPCITEMIDLIST pidl, LPWSTR pszPath); @@ -407,9 +408,11 @@ LPWSTR WINAPI StrCpyNXW(LPWSTR lpszDest, LPCWSTR lpszSrc, int iLen); #ifdef UNICODE #define PathIsValidChar PathIsValidCharW #define StrCpyNX StrCpyNXW + #define FixSlashesAndColon FixSlashesAndColonW #else #define PathIsValidChar PathIsValidCharA #define StrCpyNX StrCpyNXA + #define FixSlashesAndColon FixSlashesAndColonA #endif BOOL WINAPI