https://git.reactos.org/?p=reactos.git;a=commitdiff;h=b69a7460db5a8e71cdf9d49565ea2910088bffac

commit b69a7460db5a8e71cdf9d49565ea2910088bffac
Author:     Katayama Hirofumi MZ <katayama.hirofumi...@gmail.com>
AuthorDate: Sat Nov 4 19:47:58 2023 +0900
Commit:     Katayama Hirofumi MZ <katayama.hirofumi...@gmail.com>
CommitDate: Sat Nov 4 19:50:36 2023 +0900

    [MSPAINT] Fix filter string UNICODE_NULL problem
    
    Follow-up to #5882.
    Some ATL CString do not append the string if there is
    a UNICODE_NULL in the middle.
    CORE-19094
---
 base/applications/mspaint/main.cpp | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/base/applications/mspaint/main.cpp 
b/base/applications/mspaint/main.cpp
index b98f8ee841b..470c4fd4348 100644
--- a/base/applications/mspaint/main.cpp
+++ b/base/applications/mspaint/main.cpp
@@ -209,7 +209,8 @@ BOOL CMainWindow::GetOpenFileName(IN OUT LPWSTR pszFile, 
INT cchMaxFile)
         // Get the import filter
         CSimpleArray<GUID> aguidFileTypesI;
         CImage::GetImporterFilterString(strFilter, aguidFileTypesI, 
strAllPictureFiles,
-                                        CImage::excludeDefaultLoad, 
UNICODE_NULL);
+                                        CImage::excludeDefaultLoad, L'|');
+        strFilter.Replace(L'|', UNICODE_NULL);
 
         // Initializing the OPENFILENAME structure for GetOpenFileName
         ZeroMemory(&ofn, sizeof(ofn));
@@ -236,7 +237,8 @@ BOOL CMainWindow::GetSaveFileName(IN OUT LPWSTR pszFile, 
INT cchMaxFile)
         // Get the export filter
         CSimpleArray<GUID> aguidFileTypesE;
         CImage::GetExporterFilterString(strFilter, aguidFileTypesE, NULL,
-                                        CImage::excludeDefaultSave, 
UNICODE_NULL);
+                                        CImage::excludeDefaultSave, L'|');
+        strFilter.Replace(L'|', UNICODE_NULL);
 
         // Initializing the OPENFILENAME structure for GetSaveFileName
         ZeroMemory(&sfn, sizeof(sfn));

Reply via email to