mirror of
https://github.com/reactos/reactos.git
synced 2024-10-02 07:26:47 +00:00
[RAPPS] Rapps trivial fixes (#2819)
- Specify W explicitly for URL_COMPONENTS; - Remove malloc/free for once used HostName in urlComponents; - Use PathAppendW to operate on path string.
This commit is contained in:
parent
5349f49cfe
commit
e5336bd2af
|
@ -563,7 +563,7 @@ unsigned int WINAPI CDownloadManager::ThreadFunc(LPVOID param)
|
||||||
|
|
||||||
unsigned char lpBuffer[4096];
|
unsigned char lpBuffer[4096];
|
||||||
LPCWSTR lpszAgent = L"RApps/1.0";
|
LPCWSTR lpszAgent = L"RApps/1.0";
|
||||||
URL_COMPONENTS urlComponents;
|
URL_COMPONENTSW urlComponents;
|
||||||
size_t urlLength, filenameLength;
|
size_t urlLength, filenameLength;
|
||||||
|
|
||||||
const ATL::CSimpleArray<DownloadInfo> &InfoArray = static_cast<DownloadParam*>(param)->AppInfo;
|
const ATL::CSimpleArray<DownloadInfo> &InfoArray = static_cast<DownloadParam*>(param)->AppInfo;
|
||||||
|
@ -698,8 +698,6 @@ unsigned int WINAPI CDownloadManager::ThreadFunc(LPVOID param)
|
||||||
urlLength = InfoArray[iAppId].szUrl.GetLength();
|
urlLength = InfoArray[iAppId].szUrl.GetLength();
|
||||||
urlComponents.dwSchemeLength = urlLength + 1;
|
urlComponents.dwSchemeLength = urlLength + 1;
|
||||||
urlComponents.lpszScheme = (LPWSTR) malloc(urlComponents.dwSchemeLength * sizeof(WCHAR));
|
urlComponents.lpszScheme = (LPWSTR) malloc(urlComponents.dwSchemeLength * sizeof(WCHAR));
|
||||||
urlComponents.dwHostNameLength = urlLength + 1;
|
|
||||||
urlComponents.lpszHostName = (LPWSTR) malloc(urlComponents.dwHostNameLength * sizeof(WCHAR));
|
|
||||||
|
|
||||||
if (!InternetCrackUrlW(InfoArray[iAppId].szUrl, urlLength + 1, ICU_DECODE | ICU_ESCAPE, &urlComponents))
|
if (!InternetCrackUrlW(InfoArray[iAppId].szUrl, urlLength + 1, ICU_DECODE | ICU_ESCAPE, &urlComponents))
|
||||||
{
|
{
|
||||||
|
@ -766,7 +764,6 @@ unsigned int WINAPI CDownloadManager::ThreadFunc(LPVOID param)
|
||||||
}
|
}
|
||||||
|
|
||||||
free(urlComponents.lpszScheme);
|
free(urlComponents.lpszScheme);
|
||||||
free(urlComponents.lpszHostName);
|
|
||||||
|
|
||||||
#ifdef USE_CERT_PINNING
|
#ifdef USE_CERT_PINNING
|
||||||
// are we using HTTPS to download the RAPPS update package? check if the certificate is original
|
// are we using HTTPS to download the RAPPS update package? check if the certificate is original
|
||||||
|
|
|
@ -63,7 +63,9 @@ VOID FillDefaultSettings(PSETTINGS_INFO pSettingsInfo)
|
||||||
szDownloadDir.ReleaseBuffer();
|
szDownloadDir.ReleaseBuffer();
|
||||||
}
|
}
|
||||||
|
|
||||||
szDownloadDir += L"\\RAPPS Downloads";
|
PathAppendW(szDownloadDir.GetBuffer(MAX_PATH), L"\\RAPPS Downloads");
|
||||||
|
szDownloadDir.ReleaseBuffer();
|
||||||
|
|
||||||
ATL::CStringW::CopyChars(pSettingsInfo->szDownloadDir,
|
ATL::CStringW::CopyChars(pSettingsInfo->szDownloadDir,
|
||||||
_countof(pSettingsInfo->szDownloadDir),
|
_countof(pSettingsInfo->szDownloadDir),
|
||||||
szDownloadDir.GetString(),
|
szDownloadDir.GetString(),
|
||||||
|
|
Loading…
Reference in a new issue