https://git.reactos.org/?p=reactos.git;a=commitdiff;h=c5f89b815921d41fe97ce…
commit c5f89b815921d41fe97ce645c72cdbb9e4ef8683
Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
AuthorDate: Sat Dec 29 05:55:19 2018 +0900
Commit: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
CommitDate: Sat Dec 29 05:55:19 2018 +0900
[APPWIZ] Show message box upon error
---
dll/cpl/appwiz/createlink.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/dll/cpl/appwiz/createlink.c b/dll/cpl/appwiz/createlink.c
index c3a3c1055c..5f70b4641f 100644
--- a/dll/cpl/appwiz/createlink.c
+++ b/dll/cpl/appwiz/createlink.c
@@ -407,12 +407,14 @@ ShowCreateShortcutWizard(HWND hwndCPl, LPWSTR szPath)
UINT nPages = 0;
UINT nLength;
DWORD attrs;
+ PCREATE_LINK_CONTEXT pContext;
- PCREATE_LINK_CONTEXT pContext = (PCREATE_LINK_CONTEXT) HeapAlloc(GetProcessHeap(),
HEAP_ZERO_MEMORY, sizeof(CREATE_LINK_CONTEXT));
+ pContext = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*pContext));
if (!pContext)
{
- /* no memory */
- return FALSE;
+ /* no memory */
+ MessageBoxA(hwndCPl, "Out of memory!", NULL, MB_ICONERROR);
+ return FALSE;
}
nLength = wcslen(szPath);
@@ -421,6 +423,7 @@ ShowCreateShortcutWizard(HWND hwndCPl, LPWSTR szPath)
HeapFree(GetProcessHeap(), 0, pContext);
/* no directory given */
+ MessageBoxA(hwndCPl, "No directory given!", NULL, MB_ICONERROR);
return FALSE;
}
@@ -430,6 +433,7 @@ ShowCreateShortcutWizard(HWND hwndCPl, LPWSTR szPath)
HeapFree(GetProcessHeap(), 0, pContext);
/* invalid path */
+ MessageBoxA(hwndCPl, "Invalid path!", NULL, MB_ICONERROR);
return FALSE;
}
@@ -461,7 +465,6 @@ ShowCreateShortcutWizard(HWND hwndCPl, LPWSTR szPath)
psp.pszTemplate = MAKEINTRESOURCEW(IDD_SHORTCUT_FINISH);
ahpsp[nPages++] = CreatePropertySheetPage(&psp);
-
/* Create the property sheet */
psh.dwSize = sizeof(PROPSHEETHEADER);
psh.dwFlags = PSH_WIZARD97 | PSH_WATERMARK | PSH_USEICONID | PSH_USECALLBACK;