Zhiyi Zhang : write: Use correct wordpad.exe path.
Alexandre Julliard
julliard at winehq.org
Wed Jun 9 16:43:06 CDT 2021
Module: wine
Branch: master
Commit: 148d4048b466a81ba5ae1b4b018535a976a2f75f
URL: https://source.winehq.org/git/wine.git/?a=commit;h=148d4048b466a81ba5ae1b4b018535a976a2f75f
Author: Zhiyi Zhang <zzhang at codeweavers.com>
Date: Wed Jun 9 22:01:37 2021 +0800
write: Use correct wordpad.exe path.
Wordpad.exe is in C:\Program Files\Windows NT\Accessories\ now.
Signed-off-by: Zhiyi Zhang <zzhang at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
programs/write/Makefile.in | 2 +-
programs/write/write.c | 5 +++--
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/programs/write/Makefile.in b/programs/write/Makefile.in
index b0280b713da..5bde6efdf8d 100644
--- a/programs/write/Makefile.in
+++ b/programs/write/Makefile.in
@@ -1,5 +1,5 @@
MODULE = write.exe
-IMPORTS = user32 gdi32
+IMPORTS = user32 gdi32 shell32
EXTRADLLFLAGS = -mwindows -mno-cygwin
diff --git a/programs/write/write.c b/programs/write/write.c
index 1481e900f75..da9cba8ec51 100644
--- a/programs/write/write.c
+++ b/programs/write/write.c
@@ -23,6 +23,7 @@
#include <stdarg.h>
#include <windows.h>
+#include <shlobj.h>
#include "resources.h"
int CALLBACK WinMain(HINSTANCE hInstance, HINSTANCE hOldInstance, LPSTR szCmdParagraph, int res)
@@ -31,9 +32,9 @@ int CALLBACK WinMain(HINSTANCE hInstance, HINSTANCE hOldInstance, LPSTR szCmdPar
STARTUPINFOW stinf;
PROCESS_INFORMATION info;
- if (!GetSystemDirectoryW(path, MAX_PATH - 1 - lstrlenW(L"\\wordpad.exe")))
+ if (FAILED(SHGetFolderPathW(NULL, CSIDL_PROGRAM_FILES, NULL, 0, path)))
goto failed;
- lstrcatW(path, L"\\wordpad.exe");
+ lstrcatW(path, L"\\Windows NT\\Accessories\\wordpad.exe");
stinf.cb = sizeof(STARTUPINFOW);
GetStartupInfoW(&stinf);
More information about the wine-cvs
mailing list