From 5508c5cbb291d54887b32415ad29ea08062a209a Mon Sep 17 00:00:00 2001 From: Colin Finck Date: Sun, 18 May 2008 11:24:56 +0000 Subject: [PATCH] Make 1000% sure that any regedit is started by launching regedit from the search path if the GetWindowsDirectory call failed. (suggested by Alex on ros-dev) svn path=/trunk/; revision=33573 --- reactos/base/applications/regedt32/regedt32.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/reactos/base/applications/regedt32/regedt32.c b/reactos/base/applications/regedt32/regedt32.c index a7355e53100..8fc8cdd15d9 100644 --- a/reactos/base/applications/regedt32/regedt32.c +++ b/reactos/base/applications/regedt32/regedt32.c @@ -3,6 +3,8 @@ #include #include +#define REGEDIT _T("regedit.exe") + int WINAPI _tWinMain(HINSTANCE hCurInst, HINSTANCE hPrevInst, LPTSTR lpsCmdLine, int nCmdShow) { @@ -10,9 +12,13 @@ int WINAPI _tWinMain(HINSTANCE hCurInst, HINSTANCE hPrevInst, if(GetWindowsDirectory(szPath, MAX_PATH)) { - PathAppend(szPath, _T("regedit.exe")); + PathAppend(szPath, REGEDIT); ShellExecute(NULL, NULL, szPath, lpsCmdLine, NULL, nCmdShow); } + else + { + ShellExecute(NULL, NULL, REGEDIT, lpsCmdLine, NULL, nCmdShow); + } return 0; }