* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#define COBJMACROS
-#define WIN32_NO_STATUS
-
#include "rapps.h"
-#include "resource.h"
-
-#include <commctrl.h>
-#include <shlobj.h>
-#include <shlwapi.h>
-#include <urlmon.h>
static PAPPLICATION_INFO AppInfo;
static HICON hIcon = NULL;
AppInfo->szUrlDownload[len - 1] == 'b')
{
bCab = TRUE;
- if (!GetCurrentDirectoryW(MAX_PATH, path))
+ if (!GetStorageDirectory(path, sizeof(path) / sizeof(path[0])))
goto end;
}
else
{
- wcscpy(path, SettingsInfo.szDownloadDir);
+ if (FAILED(StringCbCopyW(path, sizeof(path),
+ SettingsInfo.szDownloadDir)))
+ {
+ goto end;
+ }
}
}
else goto end;
goto end;
}
- wcscat(path, L"\\");
- wcscat(path, p + 1);
+ if (FAILED(StringCbCatW(path, sizeof(path), L"\\")))
+ goto end;
+ if (FAILED(StringCbCatW(path, sizeof(path), p + 1)))
+ goto end;
/* download it */
bTempfile = TRUE;
ShowWindow(Dlg, SW_HIDE);
/* run it */
- memset(&si, 0, sizeof(si));
+ ZeroMemory(&si, sizeof(si));
si.cb = sizeof(si);
r = CreateProcessW(path, NULL, NULL, NULL, 0, 0, NULL, NULL, &si, &pi);
if (0 == r) goto end;
APPLICATION_INFO IntInfo;
ZeroMemory(&IntInfo, sizeof(APPLICATION_INFO));
- wcscpy(IntInfo.szUrlDownload, lpUrl);
+ if (FAILED(StringCbCopyW(IntInfo.szUrlDownload,
+ sizeof(IntInfo.szUrlDownload),
+ lpUrl)))
+ {
+ return;
+ }
AppInfo = &IntInfo;