54#ifdef USE_CERT_PINNING
55#define CERT_ISSUER_INFO_OLD "US\r\nLet's Encrypt\r\nR3"
56#define CERT_ISSUER_INFO_NEW "US\r\nLet's Encrypt\r\nR11"
57#define CERT_SUBJECT_INFO "rapps.reactos.org"
81 szString.LoadStringW(StatusParam);
85#define FILENAME_VALID_CHAR ( \
86 PATH_CHAR_CLASS_LETTER | \
87 PATH_CHAR_CLASS_DOT | \
88 PATH_CHAR_CLASS_SEMICOLON | \
89 PATH_CHAR_CLASS_COMMA | \
90 PATH_CHAR_CLASS_SPACE | \
91 PATH_CHAR_CLASS_OTHER_VALID)
172 WCHAR szProgress[100];
183 WCHAR szProgressMax[100];
184 UINT uiPercentage = ((
ULONGLONG)ulProgress * 100) / ulProgressMax;
195 ProgressText.
Format(
L"%u%% \x2014 %ls / %ls", uiPercentage, szProgress, szProgressMax);
205 ProgressText.
Format(
L"%ls...", szProgress);
228 UINT win_width, win_height;
302 r.top = (2 *
r.top + 1 *
r.bottom) / 3;
341 Item.pszText = lpText;
342 Item.iItem = ItemIndex;
370#ifdef USE_CERT_PINNING
374 DWORD certInfoLength;
390 certInfoLength =
sizeof(certInfo);
414 if (szMsgText.LoadStringW(StringID))
438 static unsigned int WINAPI
520 szTempCaption = szCaption;
528 unsigned int ThreadId;
645 ULONG dwCurrentBytesRead = 0;
657 size_t urlLength, filenameLength;
663 const DWORD dwUrlConnectFlags =
672 for (iAppId = 0; iAppId < InfoArray.
GetSize(); ++iAppId)
700 switch (InfoArray[iAppId].DLType)
703 szNewCaption.
Format(szCaption, InfoArray[iAppId].
szName.GetString());
718 p =
wcsrchr(InfoArray[iAppId].szUrl.GetString(),
L'/');
719 q =
wcsrchr(InfoArray[iAppId].szUrl.GetString(),
L'?');
733 if (
q &&
q >
p && (
q -
p) > 0)
746 switch (InfoArray[iAppId].DLType)
761 if ((InfoArray[iAppId].DLType ==
DLTYPE_APPLICATION) && InfoArray[iAppId].szSHA1[0] &&
804 memset(&urlComponents, 0,
sizeof(urlComponents));
807 urlLength = InfoArray[iAppId].szUrl.GetLength();
895 if (InfoArray[iAppId].SizeInBytes)
897 dwContentLen = InfoArray[iAppId].SizeInBytes;
908#ifdef USE_CERT_PINNING
914 bool bAskQuestion =
false;
923 (
strcmp(issuerName, CERT_ISSUER_INFO_OLD) &&
strcmp(issuerName, CERT_ISSUER_INFO_NEW)))
948 dwCurrentBytesRead = 0;
963 dwCurrentBytesRead += dwBytesRead;
966 UpdateProgress(hDlg, dwCurrentBytesRead, dwContentLen, 0, InfoArray[iAppId].szUrl.GetString());
974 DPRINT1(
"Operation cancelled\n");
983 dwContentLen = dwCurrentBytesRead;
986 UpdateProgress(hDlg, dwCurrentBytesRead, dwContentLen, 0, InfoArray[iAppId].szUrl.GetString());
991 if ((InfoArray[iAppId].DLType ==
DLTYPE_APPLICATION) && InfoArray[iAppId].szSHA1[0] != 0)
998 DPRINT1(
"Unable to load string\n");
1012 DPRINT1(
"Unable to load string\n");
1031 shExInfo.
cbSize =
sizeof(shExInfo);
1041 InfoArray[iAppId].szPackageName +
L"\" \"" +
1122 while (CurrentListPosition)
1148 DatabaseDLInfo.
szUrl = lpUrl;
PRTL_UNICODE_STRING_BUFFER Path
int strcmp(const char *String1, const char *String2)
#define APPLICATION_DATABASE_NAME
BOOL WriteLogMessage(WORD wType, DWORD dwEventID, LPCWSTR lpMsg)
BOOL GetStorageDirectory(CStringW &lpDirectory)
#define IDD_DOWNLOAD_DIALOG
#define IDS_UNABLE_TO_DOWNLOAD
#define IDS_MISMATCH_CERT_INFO
#define IDS_STATUS_FINISHED
#define IDS_STATUS_WAITING
#define IDS_DL_DIALOG_DB_DISP
#define IDS_STATUS_INSTALLING
#define IDS_UNABLE_TO_DOWNLOAD2
#define IDC_DOWNLOAD_PROGRESS
#define IDS_STATUS_DOWNLOADED
#define IDS_STATUS_DOWNLOADING
#define IDS_UNABLE_TO_QUERY_CERT
#define IDC_DOWNLOAD_STATUS
#define IDS_STATUS_INSTALLED
#define IDS_INTEG_CHECK_TITLE
#define IDS_DL_DIALOG_DB_DOWNLOAD_DISP
#define IDS_INTEG_CHECK_FAIL
#define IDS_DL_DIALOG_DB_UNOFFICIAL_DOWNLOAD_DISP
SETTINGS_INFO SettingsInfo
POSITION GetHeadPosition() const
E & GetNext(_Inout_ POSITION &pos)
bool IsEmpty() const noexcept
void ReleaseBuffer(_In_ int nNewLength=-1)
PXSTR GetString() noexcept
int GetLength() const noexcept
int Replace(PCXSTR pszOld, PCXSTR pszNew)
void __cdecl Format(UINT nFormatID,...)
BOOL SubclassWindow(HWND hWnd)
HWND UnsubclassWindow(BOOL bForce=FALSE)
BOOL ModifyStyle(DWORD dwRemove, DWORD dwAdd, UINT nFlags=0)
LRESULT SendMessage(UINT message, WPARAM wParam=0, LPARAM lParam=0)
virtual VOID GetDownloadInfo(CStringW &Url, CStringW &Sha1, ULONG &SizeInBytes) const =0
virtual InstallerType GetInstallerType() const
const CStringW szIdentifier
HWND Create(HWND hwndParent)
VOID LoadList(ATL::CSimpleArray< DownloadInfo > arrInfo)
VOID SetDownloadStatus(INT ItemIndex, DownloadStatus Status)
VOID AddRow(INT RowIndex, LPCWSTR szAppName, const DownloadStatus Status)
BOOL AddColumn(INT Index, INT Width, INT Format)
BOOL AddItem(INT ItemIndex, LPWSTR lpText)
static INT_PTR CALLBACK DownloadDlgProc(HWND Dlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
static ATL::CSimpleArray< DownloadInfo > AppsDownloadList
static VOID UpdateProgress(HWND hDlg, ULONG ulProgress, ULONG ulProgressMax, ULONG ulStatusCode, LPCWSTR szStatusText)
static VOID Download(const DownloadInfo &DLInfo, BOOL bIsModal=FALSE)
static CDownloaderProgress ProgressBar
static CDowloadingAppsListView DownloadsListView
static VOID Add(DownloadInfo info)
static unsigned int WINAPI ThreadFunc(LPVOID Context)
static VOID LaunchDownloadDialog(BOOL)
VOID SetMarquee(BOOL Enable)
VOID SetProgress(ULONG ulProgress, ULONG ulProgressMax)
CStringW m_szProgressText
LRESULT OnEraseBkgnd(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
LRESULT OnSetText(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
LRESULT OnPaint(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
int InsertItem(const LV_ITEM *pitem)
int InsertColumn(int iCol, LV_COLUMN *pcol)
BOOL SetItemText(int i, int subItem, LPCWSTR text)
HWND Create(HWND hWndParent, _U_RECT rect, LPCTSTR szWindowName=NULL, DWORD dwStyle=0, DWORD dwExStyle=0, _U_MENUorID MenuOrID=0U, LPVOID lpCreateParam=NULL)
int WINAPI DrawShadowText(HDC hdc, LPCWSTR pszText, UINT cch, RECT *prc, DWORD dwFlags, COLORREF crText, COLORREF crShadow, int ixOffset, int iyOffset)
static TAGREF LPCWSTR LPDWORD LPVOID lpBuffer
#define INVALID_HANDLE_VALUE
BOOL WINAPI CopyFileW(IN LPCWSTR lpExistingFileName, IN LPCWSTR lpNewFileName, IN BOOL bFailIfExists)
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
BOOL WINAPI CreateDirectoryW(IN LPCWSTR lpPathName, IN LPSECURITY_ATTRIBUTES lpSecurityAttributes)
DWORD WINAPI GetFileAttributesW(LPCWSTR lpFileName)
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
DWORD WINAPI GetModuleFileNameW(HINSTANCE hModule, LPWSTR lpFilename, DWORD nSize)
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
HRESULT WINAPI PathCreateFromUrlW(LPCWSTR pszUrl, LPWSTR pszPath, LPDWORD pcchPath, DWORD dwReserved)
BOOL WINAPI PathIsValidCharW(WCHAR c, DWORD class)
LPWSTR WINAPI StrFormatByteSizeW(LONGLONG llBytes, LPWSTR lpszDest, UINT cchMax)
HRESULT WINAPI UrlUnescapeW(LPWSTR pszUrl, LPWSTR pszUnescaped, LPDWORD pcchUnescaped, DWORD dwFlags)
DWORD WINAPI FtpGetFileSize(HINTERNET hFile, LPDWORD lpdwFileSizeHigh)
BOOL WINAPI HttpQueryInfoW(HINTERNET hHttpRequest, DWORD dwInfoLevel, LPVOID lpBuffer, LPDWORD lpdwBufferLength, LPDWORD lpdwIndex)
BOOL WINAPI InternetQueryOptionA(HINTERNET hInternet, DWORD dwOption, LPVOID lpBuffer, LPDWORD lpdwBufferLength)
BOOL WINAPI InternetCrackUrlW(const WCHAR *lpszUrl, DWORD dwUrlLength, DWORD dwFlags, URL_COMPONENTSW *lpUC)
BOOL WINAPI InternetCanonicalizeUrlW(LPCWSTR lpszUrl, LPWSTR lpszBuffer, LPDWORD lpdwBufferLength, DWORD dwFlags)
BOOL WINAPI InternetReadFile(HINTERNET hFile, LPVOID lpBuffer, DWORD dwNumOfBytesToRead, LPDWORD pdwNumOfBytesRead)
HINTERNET WINAPI InternetOpenUrlW(HINTERNET hInternet, LPCWSTR lpszUrl, LPCWSTR lpszHeaders, DWORD dwHeadersLength, DWORD dwFlags, DWORD_PTR dwContext)
BOOL WINAPI InternetCloseHandle(HINTERNET hInternet)
HINTERNET WINAPI InternetOpenW(LPCWSTR lpszAgent, DWORD dwAccessType, LPCWSTR lpszProxy, LPCWSTR lpszProxyBypass, DWORD dwFlags)
static VOID BitBlt(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Width, _In_ ULONG Height, _In_reads_bytes_(Delta *Height) PUCHAR Buffer, _In_ ULONG BitsPerPixel, _In_ ULONG Delta)
_In_opt_ PFILE_OBJECT _In_opt_ PETHREAD Thread
GLdouble GLdouble GLdouble r
GLdouble GLdouble GLdouble GLdouble q
GLenum const GLfloat * params
GLenum GLuint GLenum GLsizei const GLchar * buf
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
HLOCAL NTAPI LocalFree(HLOCAL hMem)
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define MESSAGE_HANDLER(msg, func)
#define BEGIN_MSG_MAP(theClass)
BOOL DownloadApplication(CAppInfo *pAppInfo)
VOID UrlUnescapeAndMakeFileNameValid(CStringW &str)
BOOL ShowLastError(HWND hWndOwner, BOOL bInetError, DWORD dwLastError)
BOOL DownloadListOfApplications(const CAtlList< CAppInfo * > &AppsList, BOOL bIsModal)
@ DLSTATUS_WAITING_INSTALL
VOID MessageBox_LoadString(HWND hOwnerWnd, INT StringID)
CStringW LoadStatusString(DownloadStatus StatusParam)
#define FILENAME_VALID_CHAR
@ DLTYPE_DBUPDATE_UNOFFICIAL
VOID DownloadApplicationsDB(LPCWSTR lpUrl, BOOL IsOfficial)
static BYTE subjectName[]
_In_ ULONGLONG _In_ ULONGLONG _In_ BOOLEAN Enable
static const WCHAR szName[]
#define LVS_NOCOLUMNHEADER
#define LVS_SHOWSELALWAYS
#define WM_NOTIFY_OPERATIONCOMPLETED
_CRTIMP uintptr_t __cdecl _beginthreadex(_In_opt_ void *_Security, _In_ unsigned _StackSize, _In_ unsigned(__stdcall *_StartAddress)(void *), _In_opt_ void *_ArgList, _In_ unsigned _InitFlag, _Out_opt_ unsigned *_ThrdAddr)
#define SEE_MASK_NOCLOSEPROCESS
BOOL WINAPI DECLSPEC_HOTPATCH ShellExecuteExW(LPSHELLEXECUTEINFOW sei)
DownloadInfo(const CAppInfo &AppInfo)
DownloadParam(HWND dlg, const ATL::CSimpleArray< DownloadInfo > &info, LPCWSTR caption)
ATL::CSimpleArray< DownloadInfo > AppInfo
LPSTR lpszSignatureAlgName
LPSTR lpszEncryptionAlgName
WCHAR szDownloadDir[MAX_PATH]
WCHAR szNoProxyFor[MAX_PATH]
WCHAR szProxyServer[MAX_PATH]
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
#define LANG_USER_DEFAULT
_In_ HFONT _Out_ PUINT _Out_ PUINT Width
#define INVALID_FILE_ATTRIBUTES
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
_In_ WDFCOLLECTION _In_ ULONG Index
_In_ WDFCOLLECTION _In_ WDFOBJECT Item
int WINAPI GetWindowTextW(HWND hWnd, LPWSTR lpString, int nMaxCount)
DWORD WINAPI GetLastError(void)
#define FORMAT_MESSAGE_IGNORE_INSERTS
#define FORMAT_MESSAGE_FROM_SYSTEM
#define FORMAT_MESSAGE_ALLOCATE_BUFFER
#define FORMAT_MESSAGE_FROM_HMODULE
#define SelectFont(hdc, hfont)
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
HBITMAP WINAPI CreateCompatibleBitmap(_In_ HDC hdc, _In_ INT cx, _In_ INT cy)
BOOL WINAPI DeleteDC(_In_ HDC)
#define INTERNET_SCHEME_FTP
#define INTERNET_SCHEME_HTTP
#define SECURITY_FLAG_SECURE
#define INTERNET_SCHEME_HTTPS
#define INTERNET_FLAG_PRAGMA_NOCACHE
#define INTERNET_OPTION_SECURITY_FLAGS
#define INTERNET_FLAG_DONT_CACHE
#define INTERNET_FLAG_KEEP_CONNECTION
#define INTERNET_FLAG_PASSIVE
#define HTTP_QUERY_FLAG_NUMBER
#define INTERNET_OPEN_TYPE_DIRECT
#define INTERNET_OPEN_TYPE_PROXY
#define HTTP_QUERY_STATUS_CODE
#define INTERNET_OPEN_TYPE_PRECONFIG
#define INTERNET_OPTION_SECURITY_CERTIFICATE_STRUCT
#define HTTP_QUERY_CONTENT_LENGTH
BOOL VerifyInteg(LPCWSTR lpSHA1Hash, LPCWSTR lpFileName)
DWORD WINAPI GetSysColor(_In_ int)
BOOL WINAPI IsWindow(_In_opt_ HWND)
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define DialogBoxW(i, t, p, f)
int WINAPI MessageBoxA(_In_opt_ HWND hWnd, _In_opt_ LPCSTR lpText, _In_opt_ LPCSTR lpCaption, _In_ UINT uType)
BOOL WINAPI SetDlgItemTextW(_In_ HWND, _In_ int, _In_ LPCWSTR)
int WINAPI MessageBoxW(_In_opt_ HWND hWnd, _In_opt_ LPCWSTR lpText, _In_opt_ LPCWSTR lpCaption, _In_ UINT uType)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
BOOL WINAPI SetWindowTextW(_In_ HWND, _In_opt_ LPCWSTR)
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
#define CreateDialogW(h, n, w, f)
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
#define MAKEINTRESOURCEW(i)
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)
BOOL WINAPI InflateRect(_Inout_ LPRECT, _In_ int, _In_ int)
#define COLOR_CAPTIONTEXT
BOOL WINAPI DestroyWindow(_In_ HWND)
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE hInstance, _In_ LPCWSTR lpIconName)
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)