ReactOS 0.4.15-dev-6669-g8227c5d
loaddlg.cpp
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS Applications Manager
3 * LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
4 * PURPOSE: Displaying a download dialog
5 * COPYRIGHT: Copyright 2001 John R. Sheets (for CodeWeavers)
6 * Copyright 2004 Mike McCormack (for CodeWeavers)
7 * Copyright 2005 Ge van Geldorp (gvg@reactos.org)
8 * Copyright 2009 Dmitry Chapyshev (dmitry@reactos.org)
9 * Copyright 2015 Ismael Ferreras Morezuelas (swyterzone+ros@gmail.com)
10 * Copyright 2017 Alexander Shaposhnikov (sanchaez@reactos.org)
11 */
12
13/*
14 * Based on Wine dlls/shdocvw/shdocvw_main.c
15 *
16 * This library is free software; you can redistribute it and/or
17 * modify it under the terms of the GNU Lesser General Public
18 * License as published by the Free Software Foundation; either
19 * version 2.1 of the License, or (at your option) any later version.
20 *
21 * This library is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
24 * Lesser General Public License for more details.
25 *
26 * You should have received a copy of the GNU Lesser General Public
27 * License along with this library; if not, write to the Free Software
28 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
29 */
30#include "rapps.h"
31
32#include <shlobj_undoc.h>
33#include <shlguid_undoc.h>
34
35#include <atlbase.h>
36#include <atlcom.h>
37#include <atlwin.h>
38#include <wininet.h>
39#include <shellutils.h>
40
41#include <debug.h>
42
43#include <ui/rosctrls.h>
44#include <windowsx.h>
45#include <process.h>
46#undef SubclassWindow
47
48#include "rosui.h"
49#include "dialogs.h"
50#include "misc.h"
51
52#ifdef USE_CERT_PINNING
53#define CERT_ISSUER_INFO_OLD "US\r\nLet's Encrypt\r\nLet's Encrypt Authority X3"
54#define CERT_ISSUER_INFO_NEW "US\r\nLet's Encrypt\r\nR3"
55#define CERT_SUBJECT_INFO "rapps.reactos.org"
56#endif
57
59{
63};
64
66{
73};
74
77{
78 CStringW szString;
79 szString.LoadStringW(StatusParam);
80 return szString;
81}
82
84{
86 {
87 }
89 {
91 szName = AppInfo.szDisplayName;
92 }
93
99};
100
102{
104 {
105 }
107 : Dialog(dlg), AppInfo(info), szCaption(caption)
108 {
109 }
110
114};
115
116class CDownloaderProgress : public CWindowImpl<CDownloaderProgress, CWindow, CControlWinTraits>
117{
119
120 public:
122 {
123 }
124
125 VOID
127 {
128 if (Enable)
130 else
132
134 }
135
136 VOID
137 SetProgress(ULONG ulProgress, ULONG ulProgressMax)
138 {
139 WCHAR szProgress[100];
140
141 /* format the bits and bytes into pretty and accessible units... */
142 StrFormatByteSizeW(ulProgress, szProgress, _countof(szProgress));
143
144 /* use our subclassed progress bar text subroutine */
145 CStringW ProgressText;
146
147 if (ulProgressMax)
148 {
149 /* total size is known */
150 WCHAR szProgressMax[100];
151 UINT uiPercentage = ((ULONGLONG)ulProgress * 100) / ulProgressMax;
152
153 /* send the current progress to the progress bar */
154 if (!IsWindow())
155 return;
156 SendMessage(PBM_SETPOS, uiPercentage, 0);
157
158 /* format total download size */
159 StrFormatByteSizeW(ulProgressMax, szProgressMax, _countof(szProgressMax));
160
161 /* generate the text on progress bar */
162 ProgressText.Format(L"%u%% \x2014 %ls / %ls", uiPercentage, szProgress, szProgressMax);
163 }
164 else
165 {
166 /* send the current progress to the progress bar */
167 if (!IsWindow())
168 return;
169 SendMessage(PBM_SETPOS, 0, 0);
170
171 /* total size is not known, display only current size */
172 ProgressText.Format(L"%ls...", szProgress);
173 }
174
175 /* and finally display it */
176 if (!IsWindow())
177 return;
178 SetWindowText(ProgressText.GetString());
179 }
180
181 LRESULT
183 {
184 return TRUE;
185 }
186
187 LRESULT
189 {
190 PAINTSTRUCT ps;
191 HDC hDC = BeginPaint(&ps), hdcMem;
192 HBITMAP hbmMem;
193 HANDLE hOld;
194 RECT myRect;
195 UINT win_width, win_height;
196
197 GetClientRect(&myRect);
198
199 /* grab the progress bar rect size */
200 win_width = myRect.right - myRect.left;
201 win_height = myRect.bottom - myRect.top;
202
203 /* create an off-screen DC for double-buffering */
205 hbmMem = CreateCompatibleBitmap(hDC, win_width, win_height);
206
207 hOld = SelectObject(hdcMem, hbmMem);
208
209 /* call the original draw code and redirect it to our memory buffer */
211
212 /* draw our nifty progress text over it */
218
219 /* transfer the off-screen DC to the screen */
220 BitBlt(hDC, 0, 0, win_width, win_height, hdcMem, 0, 0, SRCCOPY);
221
222 /* free the off-screen DC */
223 SelectObject(hdcMem, hOld);
224 DeleteObject(hbmMem);
226
227 EndPaint(&ps);
228 return 0;
229 }
230
231 LRESULT
233 {
234 PCWSTR pszText = (PCWSTR)lParam;
235 if (pszText)
236 {
237 if (m_szProgressText != pszText)
238 {
239 m_szProgressText = pszText;
241 }
242 }
243 else
244 {
246 {
249 }
250 }
251 return TRUE;
252 }
253
259};
260
262{
263 public:
264 HWND
266 {
267 RECT r;
269 r.top = (2 * r.top + 1 * r.bottom) / 3; /* The vertical position at ratio 1 : 2 */
270#define MARGIN 10
272
275
277
278 AddColumn(0, 150, LVCFMT_LEFT);
279 AddColumn(1, 120, LVCFMT_LEFT);
280
281 return hwnd;
282 }
283
284 VOID
286 {
287 for (INT i = 0; i < arrInfo.GetSize(); ++i)
288 {
289 AddRow(i, arrInfo[i].szName.GetString(), DLSTATUS_WAITING);
290 }
291 }
292
293 VOID
295 {
296 CStringW szBuffer = LoadStatusString(Status);
297 SetItemText(ItemIndex, 1, szBuffer.GetString());
298 }
299
300 BOOL
301 AddItem(INT ItemIndex, LPWSTR lpText)
302 {
304
305 ZeroMemory(&Item, sizeof(Item));
306
307 Item.mask = LVIF_TEXT | LVIF_STATE;
308 Item.pszText = lpText;
309 Item.iItem = ItemIndex;
310
311 return InsertItem(&Item);
312 }
313
314 VOID
316 {
317 CStringW szStatus = LoadStatusString(Status);
318 AddItem(RowIndex, const_cast<LPWSTR>(szAppName));
319 SetDownloadStatus(RowIndex, Status);
320 }
321
322 BOOL
324 {
325 LVCOLUMNW Column;
326 ZeroMemory(&Column, sizeof(Column));
327
329 Column.iSubItem = Index;
330 Column.cx = Width;
331 Column.fmt = Format;
332
333 return (InsertColumn(Index, &Column) == -1) ? FALSE : TRUE;
334 }
335};
336
337#ifdef USE_CERT_PINNING
338static BOOL
339CertGetSubjectAndIssuer(HINTERNET hFile, CLocalPtr<char> &subjectInfo, CLocalPtr<char> &issuerInfo)
340{
341 DWORD certInfoLength;
344
345 size = sizeof(flags);
347 {
348 return FALSE;
349 }
350
352 {
353 return FALSE;
354 }
355
356 /* Despite what the header indicates, the implementation of INTERNET_CERTIFICATE_INFO is not Unicode-aware. */
357 certInfoLength = sizeof(certInfo);
359 {
360 return FALSE;
361 }
362
363 subjectInfo.Attach(certInfo.lpszSubjectInfo);
364 issuerInfo.Attach(certInfo.lpszIssuerInfo);
365
366 if (certInfo.lpszProtocolName)
367 LocalFree(certInfo.lpszProtocolName);
368 if (certInfo.lpszSignatureAlgName)
370 if (certInfo.lpszEncryptionAlgName)
372
373 return certInfo.lpszSubjectInfo && certInfo.lpszIssuerInfo;
374}
375#endif
376
377inline VOID
379{
380 CStringW szMsgText;
381 if (szMsgText.LoadStringW(StringID))
382 {
384 }
385}
386
387// Download dialog (loaddlg.cpp)
389{
394 static BOOL bModal;
395 static VOID
396 UpdateProgress(HWND hDlg, ULONG ulProgress, ULONG ulProgressMax, ULONG ulStatusCode, LPCWSTR szStatusText);
397
398 public:
399 static VOID
401 static VOID
402 Download(const DownloadInfo &DLInfo, BOOL bIsModal = FALSE);
403 static INT_PTR CALLBACK
405 static unsigned int WINAPI
408};
409
410// CDownloadManager
416
417VOID
419{
421}
422
423VOID
425{
427 AppsDownloadList.Add(DLInfo);
428 LaunchDownloadDialog(bIsModal);
429}
430
433{
434 static WCHAR szCaption[MAX_PATH];
435
436 switch (uMsg)
437 {
438 case WM_INITDIALOG:
439 {
440 HICON hIconSm, hIconBg;
441 CStringW szTempCaption;
442
444
445 if (hMainWnd)
446 {
449 }
450 if (!hMainWnd || (!hIconBg || !hIconSm))
451 {
452 /* Load the default icon */
454 }
455
456 if (hIconBg && hIconSm)
457 {
458 SendMessageW(Dlg, WM_SETICON, ICON_BIG, (LPARAM)hIconBg);
459 SendMessageW(Dlg, WM_SETICON, ICON_SMALL, (LPARAM)hIconSm);
460 }
461
463 if (Item)
464 {
465 // initialize the default values for our nifty progress bar
466 // and subclass it so that it learns to print a status text
470 if (AppsDownloadList.GetSize() > 0)
471 ProgressBar.SetProgress(0, AppsDownloadList[0].SizeInBytes);
472 }
473
474 // Add a ListView
475 HWND hListView = DownloadsListView.Create(Dlg);
476 if (!hListView)
477 {
478 return FALSE;
479 }
481
482 // Get a dlg string for later use
483 GetWindowTextW(Dlg, szCaption, _countof(szCaption));
484
485 // Hide a placeholder from displaying
486 szTempCaption = szCaption;
487 szTempCaption.Replace(L"%ls", L"");
488 SetWindowText(Dlg, szTempCaption.GetString());
489
490 ShowWindow(Dlg, SW_SHOW);
491
492 // Start download process
493 DownloadParam *param = new DownloadParam(Dlg, AppsDownloadList, szCaption);
494 unsigned int ThreadId;
495 HANDLE Thread = (HANDLE)_beginthreadex(NULL, 0, ThreadFunc, (void *)param, 0, &ThreadId);
496 if (!Thread)
497 {
498 return FALSE;
499 }
500
503 return TRUE;
504 }
505
506 case WM_COMMAND:
507 if (wParam == IDCANCEL)
508 {
510 PostMessageW(Dlg, WM_CLOSE, 0, 0);
511 }
512 return FALSE;
513
514 case WM_CLOSE:
515 if (ProgressBar)
518 {
519 ::EndDialog(Dlg, 0);
520 }
521 else
522 {
523 ::DestroyWindow(Dlg);
524 }
525 return TRUE;
526
527 default:
528 return FALSE;
529 }
530}
531
533
534VOID
536 HWND hDlg,
537 ULONG ulProgress,
538 ULONG ulProgressMax,
539 ULONG ulStatusCode,
540 LPCWSTR szStatusText)
541{
542 HWND Item;
543
544 if (!IsWindow(hDlg))
545 return;
546 ProgressBar.SetProgress(ulProgress, ulProgressMax);
547
548 if (!IsWindow(hDlg))
549 return;
551 if (Item && szStatusText && wcslen(szStatusText) > 0 && UrlHasBeenCopied == FALSE)
552 {
553 SIZE_T len = wcslen(szStatusText) + 1;
555 DWORD dummyLen;
556
557 /* beautify our url for display purposes */
558 if (!InternetCanonicalizeUrlW(szStatusText, buf.GetBuffer(len), &dummyLen, ICU_DECODE | ICU_NO_ENCODE))
559 {
560 /* just use the original */
561 buf.ReleaseBuffer();
562 buf = szStatusText;
563 }
564 else
565 {
566 buf.ReleaseBuffer();
567 }
568
569 /* paste it into our dialog and don't do it again in this instance */
570 ::SetWindowText(Item, buf.GetString());
572 }
573}
574
575BOOL
576ShowLastError(HWND hWndOwner, BOOL bInetError, DWORD dwLastError)
577{
578 CLocalPtr<WCHAR> lpMsg;
579
580 if (!FormatMessageW(
583 (bInetError ? GetModuleHandleW(L"wininet.dll") : NULL), dwLastError, LANG_USER_DEFAULT, (LPWSTR)&lpMsg, 0,
584 NULL))
585 {
586 DPRINT1("FormatMessageW unexpected failure (err %d)\n", GetLastError());
587 return FALSE;
588 }
589
590 MessageBoxW(hWndOwner, lpMsg, NULL, MB_OK | MB_ICONERROR);
591 return TRUE;
592}
593
594unsigned int WINAPI
596{
597 CPathW Path;
598 PWSTR p, q;
599
600 HWND hDlg = static_cast<DownloadParam *>(param)->Dialog;
601 HWND Item;
602 INT iAppId;
603
604 ULONG dwContentLen, dwBytesWritten, dwBytesRead, dwStatus;
605 ULONG dwCurrentBytesRead = 0;
606 ULONG dwStatusLen = sizeof(dwStatus);
607
608 BOOL bTempfile = FALSE;
609
610 HINTERNET hOpen = NULL;
613
614 unsigned char lpBuffer[4096];
615 LPCWSTR lpszAgent = L"RApps/1.1";
616 URL_COMPONENTSW urlComponents;
617 size_t urlLength, filenameLength;
618
619 const ATL::CSimpleArray<DownloadInfo> &InfoArray = static_cast<DownloadParam *>(param)->AppInfo;
620 LPCWSTR szCaption = static_cast<DownloadParam *>(param)->szCaption;
621 CStringW szNewCaption;
622
623 const DWORD dwUrlConnectFlags =
625
626 if (InfoArray.GetSize() <= 0)
627 {
629 goto end;
630 }
631
632 for (iAppId = 0; iAppId < InfoArray.GetSize(); ++iAppId)
633 {
634 // Reset progress bar
635 if (!IsWindow(hDlg))
636 break;
638 if (Item)
639 {
642 ProgressBar.SetProgress(0, InfoArray[iAppId].SizeInBytes);
643 }
644
645 // is this URL an update package for RAPPS? if so store it in a different place
646 if (InfoArray[iAppId].DLType != DLTYPE_APPLICATION)
647 {
649 {
651 goto end;
652 }
653 }
654 else
655 {
657 }
658
659 // Change caption to show the currently downloaded app
660 switch (InfoArray[iAppId].DLType)
661 {
663 szNewCaption.Format(szCaption, InfoArray[iAppId].szName.GetString());
664 break;
665 case DLTYPE_DBUPDATE:
666 szNewCaption.LoadStringW(IDS_DL_DIALOG_DB_DOWNLOAD_DISP);
667 break;
669 szNewCaption.LoadStringW(IDS_DL_DIALOG_DB_UNOFFICIAL_DOWNLOAD_DISP);
670 break;
671 }
672
673 if (!IsWindow(hDlg))
674 goto end;
675 SetWindowTextW(hDlg, szNewCaption.GetString());
676
677 // build the path for the download
678 p = wcsrchr(InfoArray[iAppId].szUrl.GetString(), L'/');
679 q = wcsrchr(InfoArray[iAppId].szUrl.GetString(), L'?');
680
681 // do we have a final slash separator?
682 if (!p)
683 {
685 goto end;
686 }
687
688 // prepare the tentative length of the filename, maybe we've to remove part of it later on
689 filenameLength = wcslen(p) * sizeof(WCHAR);
690
691 /* do we have query arguments in the target URL after the filename? account for them
692 (e.g. https://example.org/myfile.exe?no_adware_plz) */
693 if (q && q > p && (q - p) > 0)
694 filenameLength -= wcslen(q - 1) * sizeof(WCHAR);
695
696 // is the path valid? can we access it?
698 {
700 {
702 goto end;
703 }
704 }
705
706 switch (InfoArray[iAppId].DLType)
707 {
708 case DLTYPE_DBUPDATE:
711 break;
713 Path += (LPWSTR)(p + 1); // use the filename retrieved from URL
714 break;
715 }
716
717 if ((InfoArray[iAppId].DLType == DLTYPE_APPLICATION) && InfoArray[iAppId].szSHA1[0] &&
719 {
720 // only open it in case of total correctness
721 if (VerifyInteg(InfoArray[iAppId].szSHA1.GetString(), Path))
722 goto run;
723 }
724
725 // Add the download URL
726 if (!IsWindow(hDlg))
727 goto end;
728 SetDlgItemTextW(hDlg, IDC_DOWNLOAD_STATUS, InfoArray[iAppId].szUrl.GetString());
729
731
732 // download it
734 bTempfile = TRUE;
735
736 /* FIXME: this should just be using the system-wide proxy settings */
737 switch (SettingsInfo.Proxy)
738 {
739 case 0: // preconfig
740 default:
741 hOpen = InternetOpenW(lpszAgent, INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0);
742 break;
743 case 1: // direct (no proxy)
744 hOpen = InternetOpenW(lpszAgent, INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0);
745 break;
746 case 2: // use proxy
747 hOpen = InternetOpenW(
749 break;
750 }
751
752 if (!hOpen)
753 {
755 goto end;
756 }
757
758 dwStatusLen = sizeof(dwStatus);
759
760 memset(&urlComponents, 0, sizeof(urlComponents));
761 urlComponents.dwStructSize = sizeof(urlComponents);
762
763 urlLength = InfoArray[iAppId].szUrl.GetLength();
764 urlComponents.dwSchemeLength = urlLength + 1;
765 urlComponents.lpszScheme = (LPWSTR)malloc(urlComponents.dwSchemeLength * sizeof(WCHAR));
766
767 if (!InternetCrackUrlW(InfoArray[iAppId].szUrl, urlLength + 1, ICU_DECODE | ICU_ESCAPE, &urlComponents))
768 {
770 goto end;
771 }
772
773 dwContentLen = 0;
774
775 if (urlComponents.nScheme == INTERNET_SCHEME_HTTP || urlComponents.nScheme == INTERNET_SCHEME_HTTPS)
776 {
777 hFile = InternetOpenUrlW(hOpen, InfoArray[iAppId].szUrl.GetString(), NULL, 0, dwUrlConnectFlags, 0);
778 if (!hFile)
779 {
781 {
782 /* Workaround for CORE-17377 */
784 }
785 goto end;
786 }
787
788 // query connection
790 {
792 goto end;
793 }
794
796 {
798 goto end;
799 }
800
801 // query content length
803 hFile, HTTP_QUERY_CONTENT_LENGTH | HTTP_QUERY_FLAG_NUMBER, &dwContentLen, &dwStatusLen, NULL);
804 }
805 else if (urlComponents.nScheme == INTERNET_SCHEME_FTP)
806 {
807 // force passive mode on FTP
808 hFile =
809 InternetOpenUrlW(hOpen, InfoArray[iAppId].szUrl, NULL, 0, dwUrlConnectFlags | INTERNET_FLAG_PASSIVE, 0);
810 if (!hFile)
811 {
813 {
814 /* Workaround for CORE-17377 */
816 }
817 goto end;
818 }
819
820 dwContentLen = FtpGetFileSize(hFile, &dwStatus);
821 }
822 else if (urlComponents.nScheme == INTERNET_SCHEME_FILE)
823 {
824 // Add support for the file scheme so testing locally is simpler
825 WCHAR LocalFilePath[MAX_PATH];
826 DWORD cchPath = _countof(LocalFilePath);
827 // Ideally we would use PathCreateFromUrlAlloc here, but that is not exported (yet)
828 HRESULT hr = PathCreateFromUrlW(InfoArray[iAppId].szUrl, LocalFilePath, &cchPath, 0);
829 if (SUCCEEDED(hr))
830 {
831 if (CopyFileW(LocalFilePath, Path, FALSE))
832 {
833 goto run;
834 }
835 else
836 {
838 goto end;
839 }
840 }
841 else
842 {
844 goto end;
845 }
846 }
847
848 if (!dwContentLen)
849 {
850 // Someone was nice enough to add this, let's use it
851 if (InfoArray[iAppId].SizeInBytes)
852 {
853 dwContentLen = InfoArray[iAppId].SizeInBytes;
854 }
855 else
856 {
857 // content-length is not known, enable marquee mode
859 }
860 }
861
862 free(urlComponents.lpszScheme);
863
864#ifdef USE_CERT_PINNING
865 // are we using HTTPS to download the RAPPS update package? check if the certificate is original
866 if ((urlComponents.nScheme == INTERNET_SCHEME_HTTPS) && (InfoArray[iAppId].DLType == DLTYPE_DBUPDATE))
867 {
868 CLocalPtr<char> subjectName, issuerName;
869 CStringA szMsgText;
870 bool bAskQuestion = false;
871 if (!CertGetSubjectAndIssuer(hFile, subjectName, issuerName))
872 {
873 szMsgText.LoadStringW(IDS_UNABLE_TO_QUERY_CERT);
874 bAskQuestion = true;
875 }
876 else
877 {
878 if (strcmp(subjectName, CERT_SUBJECT_INFO) ||
879 (strcmp(issuerName, CERT_ISSUER_INFO_OLD) && strcmp(issuerName, CERT_ISSUER_INFO_NEW)))
880 {
881 szMsgText.Format(IDS_MISMATCH_CERT_INFO, (char *)subjectName, (const char *)issuerName);
882 bAskQuestion = true;
883 }
884 }
885
886 if (bAskQuestion)
887 {
889 {
890 goto end;
891 }
892 }
893 }
894#endif
895
897
898 if (hOut == INVALID_HANDLE_VALUE)
899 {
901 goto end;
902 }
903
904 dwCurrentBytesRead = 0;
905 do
906 {
907 if (!InternetReadFile(hFile, lpBuffer, _countof(lpBuffer), &dwBytesRead))
908 {
910 goto end;
911 }
912
913 if (!WriteFile(hOut, &lpBuffer[0], dwBytesRead, &dwBytesWritten, NULL))
914 {
916 goto end;
917 }
918
919 dwCurrentBytesRead += dwBytesRead;
920 if (!IsWindow(hDlg))
921 goto end;
922 UpdateProgress(hDlg, dwCurrentBytesRead, dwContentLen, 0, InfoArray[iAppId].szUrl.GetString());
923 } while (dwBytesRead && !bCancelled);
924
925 CloseHandle(hOut);
927
928 if (bCancelled)
929 {
930 DPRINT1("Operation cancelled\n");
931 goto end;
932 }
933
934 if (!dwContentLen)
935 {
936 // set progress bar to 100%
938
939 dwContentLen = dwCurrentBytesRead;
940 if (!IsWindow(hDlg))
941 goto end;
942 UpdateProgress(hDlg, dwCurrentBytesRead, dwContentLen, 0, InfoArray[iAppId].szUrl.GetString());
943 }
944
945 /* if this thing isn't a RAPPS update and it has a SHA-1 checksum
946 verify its integrity by using the native advapi32.A_SHA1 functions */
947 if ((InfoArray[iAppId].DLType == DLTYPE_APPLICATION) && InfoArray[iAppId].szSHA1[0] != 0)
948 {
949 CStringW szMsgText;
950
951 // change a few strings in the download dialog to reflect the verification process
952 if (!szMsgText.LoadStringW(IDS_INTEG_CHECK_TITLE))
953 {
954 DPRINT1("Unable to load string\n");
955 goto end;
956 }
957
958 if (!IsWindow(hDlg))
959 goto end;
960 SetWindowTextW(hDlg, szMsgText.GetString());
962
963 // this may take a while, depending on the file size
964 if (!VerifyInteg(InfoArray[iAppId].szSHA1.GetString(), Path))
965 {
966 if (!szMsgText.LoadStringW(IDS_INTEG_CHECK_FAIL))
967 {
968 DPRINT1("Unable to load string\n");
969 goto end;
970 }
971
972 if (!IsWindow(hDlg))
973 goto end;
974 MessageBoxW(hDlg, szMsgText.GetString(), NULL, MB_OK | MB_ICONERROR);
975 goto end;
976 }
977 }
978
979 run:
981
982 // run it
983 if (InfoArray[iAppId].DLType == DLTYPE_APPLICATION)
984 {
985 SHELLEXECUTEINFOW shExInfo = {0};
986 shExInfo.cbSize = sizeof(shExInfo);
988 shExInfo.lpVerb = L"open";
989 shExInfo.lpFile = Path;
990 shExInfo.lpParameters = L"";
991 shExInfo.nShow = SW_SHOW;
992
993 /* FIXME: Do we want to log installer status? */
994 WriteLogMessage(EVENTLOG_SUCCESS, MSG_SUCCESS_INSTALL, InfoArray[iAppId].szName);
995
996 if (ShellExecuteExW(&shExInfo))
997 {
998 // reflect installation progress in the titlebar
999 // TODO: make a separate string with a placeholder to include app name?
1001 if (!IsWindow(hDlg))
1002 goto end;
1003 SetWindowTextW(hDlg, szMsgText.GetString());
1004
1006
1007 // TODO: issue an install operation separately so that the apps could be downloaded in the background
1009 CloseHandle(shExInfo.hProcess);
1010 }
1011 else
1012 {
1014 }
1015 }
1016
1017 end:
1018 if (hOut != INVALID_HANDLE_VALUE)
1019 CloseHandle(hOut);
1020
1021 if (hFile)
1023 InternetCloseHandle(hOpen);
1024
1025 if (bTempfile)
1026 {
1027 if (bCancelled || (SettingsInfo.bDelInstaller && (InfoArray[iAppId].DLType == DLTYPE_APPLICATION)))
1029 }
1030
1031 if (!IsWindow(hDlg))
1032 return 0;
1034 }
1035
1036 delete static_cast<DownloadParam *>(param);
1037 if (!IsWindow(hDlg))
1038 return 0;
1039 SendMessageW(hDlg, WM_CLOSE, 0, 0);
1040 return 0;
1041}
1042
1043// TODO: Reuse the dialog
1044VOID
1046{
1047 CDownloadManager::bModal = bIsModal;
1048 if (bIsModal)
1049 {
1051 }
1052 else
1053 {
1055 }
1056}
1057// CDownloadManager
1058
1059BOOL
1061{
1062 if (AppsList.IsEmpty())
1063 return FALSE;
1064
1065 POSITION CurrentListPosition = AppsList.GetHeadPosition();
1066 while (CurrentListPosition)
1067 {
1068 const CAppInfo *Info = AppsList.GetNext(CurrentListPosition);
1070 }
1071
1072 // Create a dialog and issue a download process
1074
1075 return TRUE;
1076}
1077
1078BOOL
1080{
1081 if (!pAppInfo)
1082 return FALSE;
1083
1085 return TRUE;
1086}
1087
1088VOID
1090{
1091 static DownloadInfo DatabaseDLInfo;
1092 DatabaseDLInfo.szUrl = lpUrl;
1093 DatabaseDLInfo.szName.LoadStringW(IDS_DL_DIALOG_DB_DISP);
1094 DatabaseDLInfo.DLType = IsOfficial ? DLTYPE_DBUPDATE : DLTYPE_DBUPDATE_UNOFFICIAL;
1095 CDownloadManager::Download(DatabaseDLInfo, TRUE);
1096}
static HDC hDC
Definition: 3dtext.c:33
PRTL_UNICODE_STRING_BUFFER Path
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
Arabic default style
Definition: afstyles.h:94
#define IDI_MAIN
Definition: resource.h:4
#define APPLICATION_DATABASE_NAME
Definition: defines.h:41
BOOL WriteLogMessage(WORD wType, DWORD dwEventID, LPCWSTR lpMsg)
Definition: misc.cpp:227
BOOL GetStorageDirectory(CStringW &lpDirectory)
Definition: misc.cpp:145
#define IDD_DOWNLOAD_DIALOG
Definition: resource.h:65
#define IDS_UNABLE_TO_DOWNLOAD
Definition: resource.h:108
#define IDS_MISMATCH_CERT_INFO
Definition: resource.h:118
#define IDS_STATUS_FINISHED
Definition: resource.h:201
#define IDS_STATUS_WAITING
Definition: resource.h:200
#define IDS_DL_DIALOG_DB_DISP
Definition: resource.h:217
#define IDS_STATUS_INSTALLING
Definition: resource.h:199
#define IDS_UNABLE_TO_DOWNLOAD2
Definition: resource.h:109
#define IDC_DOWNLOAD_PROGRESS
Definition: resource.h:41
#define IDS_UNABLE_PATH
Definition: resource.h:119
#define IDS_STATUS_DOWNLOADED
Definition: resource.h:196
#define IDS_STATUS_DOWNLOADING
Definition: resource.h:198
#define IDS_UNABLE_TO_QUERY_CERT
Definition: resource.h:110
#define IDC_DOWNLOAD_STATUS
Definition: resource.h:42
#define IDS_STATUS_INSTALLED
Definition: resource.h:194
#define IDS_INTEG_CHECK_TITLE
Definition: resource.h:111
#define IDS_DL_DIALOG_DB_DOWNLOAD_DISP
Definition: resource.h:218
#define IDS_INTEG_CHECK_FAIL
Definition: resource.h:112
#define IDS_DL_DIALOG_DB_UNOFFICIAL_DOWNLOAD_DISP
Definition: resource.h:219
SETTINGS_INFO SettingsInfo
Definition: winmain.cpp:20
#define DPRINT1
Definition: precomp.h:8
bool IsEmpty() const
Definition: atlcoll.h:545
POSITION GetHeadPosition() const
Definition: atlcoll.h:551
E & GetNext(_Inout_ POSITION &pos)
Definition: atlcoll.h:563
int GetSize() const
Definition: atlsimpcoll.h:104
BOOL Add(const T &t)
Definition: atlsimpcoll.h:58
int GetLength() const
Definition: atlsimpstr.h:362
bool IsEmpty() const
Definition: atlsimpstr.h:389
int Replace(PCXSTR pszOld, PCXSTR pszNew)
Definition: cstringt.h:886
void __cdecl Format(UINT nFormatID,...)
Definition: cstringt.h:818
BOOL SubclassWindow(HWND hWnd)
Definition: atlwin.h:1552
HWND UnsubclassWindow(BOOL bForce=FALSE)
Definition: atlwin.h:1575
BOOL ModifyStyle(DWORD dwRemove, DWORD dwAdd, UINT nFlags=0)
Definition: atlwin.h:1008
LRESULT SendMessage(UINT message, WPARAM wParam=0, LPARAM lParam=0)
Definition: atlwin.h:1116
BOOL IsWindow() const
Definition: atlwin.h:947
virtual VOID GetDownloadInfo(CStringW &Url, CStringW &Sha1, ULONG &SizeInBytes) const =0
CStringW szDisplayName
Definition: appinfo.h:78
HWND Create(HWND hwndParent)
Definition: loaddlg.cpp:265
VOID LoadList(ATL::CSimpleArray< DownloadInfo > arrInfo)
Definition: loaddlg.cpp:285
VOID SetDownloadStatus(INT ItemIndex, DownloadStatus Status)
Definition: loaddlg.cpp:294
VOID AddRow(INT RowIndex, LPCWSTR szAppName, const DownloadStatus Status)
Definition: loaddlg.cpp:315
BOOL AddColumn(INT Index, INT Width, INT Format)
Definition: loaddlg.cpp:323
BOOL AddItem(INT ItemIndex, LPWSTR lpText)
Definition: loaddlg.cpp:301
static INT_PTR CALLBACK DownloadDlgProc(HWND Dlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: loaddlg.cpp:432
static BOOL bCancelled
Definition: loaddlg.cpp:393
static ATL::CSimpleArray< DownloadInfo > AppsDownloadList
Definition: loaddlg.cpp:390
static BOOL bModal
Definition: loaddlg.cpp:394
static VOID UpdateProgress(HWND hDlg, ULONG ulProgress, ULONG ulProgressMax, ULONG ulStatusCode, LPCWSTR szStatusText)
Definition: loaddlg.cpp:535
static VOID Download(const DownloadInfo &DLInfo, BOOL bIsModal=FALSE)
Definition: loaddlg.cpp:424
static CDownloaderProgress ProgressBar
Definition: loaddlg.cpp:392
static CDowloadingAppsListView DownloadsListView
Definition: loaddlg.cpp:391
static VOID Add(DownloadInfo info)
Definition: loaddlg.cpp:418
static unsigned int WINAPI ThreadFunc(LPVOID Context)
Definition: loaddlg.cpp:595
static VOID LaunchDownloadDialog(BOOL)
Definition: loaddlg.cpp:1045
VOID SetMarquee(BOOL Enable)
Definition: loaddlg.cpp:126
VOID SetProgress(ULONG ulProgress, ULONG ulProgressMax)
Definition: loaddlg.cpp:137
CStringW m_szProgressText
Definition: loaddlg.cpp:118
LRESULT OnEraseBkgnd(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: loaddlg.cpp:182
LRESULT OnSetText(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: loaddlg.cpp:232
LRESULT OnPaint(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: loaddlg.cpp:188
void Attach(T *lp)
Definition: atlalloc.h:162
int InsertItem(const LV_ITEM *pitem)
Definition: rosctrls.h:96
int InsertColumn(int iCol, LV_COLUMN *pcol)
Definition: rosctrls.h:52
BOOL SetItemText(int i, int subItem, LPCWSTR text)
Definition: rosctrls.h:186
HWND Create(HWND hWndParent, _U_RECT rect, LPCTSTR szWindowName=NULL, DWORD dwStyle=0, DWORD dwExStyle=0, _U_MENUorID MenuOrID=0U, LPVOID lpCreateParam=NULL)
Definition: rosctrls.h:8
Definition: misc.h:53
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
int WINAPI DrawShadowText(HDC hdc, LPCWSTR pszText, UINT cch, RECT *prc, DWORD dwFlags, COLORREF crText, COLORREF crShadow, int ixOffset, int iyOffset)
Definition: commctrl.c:1845
static HWND hwndParent
Definition: cryptui.c:300
static TAGREF LPCWSTR LPDWORD LPVOID lpBuffer
Definition: db.cpp:175
#define free
Definition: debug_ros.c:5
#define malloc
Definition: debug_ros.c:4
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define CloseHandle
Definition: compat.h:739
#define wcsrchr
Definition: compat.h:16
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define MAX_PATH
Definition: compat.h:34
#define CreateFileW
Definition: compat.h:741
#define CALLBACK
Definition: compat.h:35
#define FILE_SHARE_READ
Definition: compat.h:136
BOOL WINAPI CopyFileW(IN LPCWSTR lpExistingFileName, IN LPCWSTR lpNewFileName, IN BOOL bFailIfExists)
Definition: copy.c:439
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
Definition: delete.c:39
BOOL WINAPI CreateDirectoryW(IN LPCWSTR lpPathName, IN LPSECURITY_ATTRIBUTES lpSecurityAttributes)
Definition: dir.c:90
DWORD WINAPI GetFileAttributesW(LPCWSTR lpFileName)
Definition: fileinfo.c:652
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
Definition: rw.c:24
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
Definition: loader.c:838
DWORD WINAPI FormatMessageW(DWORD dwFlags, LPCVOID lpSource, DWORD dwMessageId, DWORD dwLanguageId, LPWSTR lpBuffer, DWORD nSize, __ms_va_list *args)
Definition: format_msg.c:583
HRESULT WINAPI PathCreateFromUrlW(LPCWSTR pszUrl, LPWSTR pszPath, LPDWORD pcchPath, DWORD dwReserved)
Definition: path.c:3355
LPWSTR WINAPI StrFormatByteSizeW(LONGLONG llBytes, LPWSTR lpszDest, UINT cchMax)
Definition: string.c:2380
DWORD WINAPI FtpGetFileSize(HINTERNET hFile, LPDWORD lpdwFileSizeHigh)
Definition: ftp.c:1757
BOOL WINAPI HttpQueryInfoW(HINTERNET hHttpRequest, DWORD dwInfoLevel, LPVOID lpBuffer, LPDWORD lpdwBufferLength, LPDWORD lpdwIndex)
Definition: http.c:3870
BOOL WINAPI InternetQueryOptionA(HINTERNET hInternet, DWORD dwOption, LPVOID lpBuffer, LPDWORD lpdwBufferLength)
Definition: internet.c:2730
BOOL WINAPI InternetCrackUrlW(const WCHAR *lpszUrl, DWORD dwUrlLength, DWORD dwFlags, URL_COMPONENTSW *lpUC)
Definition: internet.c:1625
BOOL WINAPI InternetCanonicalizeUrlW(LPCWSTR lpszUrl, LPWSTR lpszBuffer, LPDWORD lpdwBufferLength, DWORD dwFlags)
Definition: internet.c:2004
BOOL WINAPI InternetReadFile(HINTERNET hFile, LPVOID lpBuffer, DWORD dwNumOfBytesToRead, LPDWORD pdwNumOfBytesRead)
Definition: internet.c:2154
HINTERNET WINAPI InternetOpenUrlW(HINTERNET hInternet, LPCWSTR lpszUrl, LPCWSTR lpszHeaders, DWORD dwHeadersLength, DWORD dwFlags, DWORD_PTR dwContext)
Definition: internet.c:3722
BOOL WINAPI InternetCloseHandle(HINTERNET hInternet)
Definition: internet.c:1414
HINTERNET WINAPI InternetOpenW(LPCWSTR lpszAgent, DWORD dwAccessType, LPCWSTR lpszProxy, LPCWSTR lpszProxyBypass, DWORD dwFlags)
Definition: internet.c:979
static VOID NTAPI 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)
Definition: common.c:49
#define INFINITE
Definition: serial.h:102
HINSTANCE hInst
Definition: dxdiag.c:13
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
_In_opt_ PFILE_OBJECT _In_opt_ PETHREAD Thread
Definition: fltkernel.h:2653
pKey DeleteObject()
Status
Definition: gdiplustypes.h:25
GLuint GLuint end
Definition: gl.h:1545
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLdouble GLdouble GLdouble GLdouble q
Definition: gl.h:2063
GLsizeiptr size
Definition: glext.h:5919
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
GLbitfield flags
Definition: glext.h:7161
GLfloat GLfloat p
Definition: glext.h:8902
GLfloat param
Definition: glext.h:5796
GLenum GLsizei len
Definition: glext.h:6722
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
Definition: glfuncs.h:248
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1594
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define MESSAGE_HANDLER(msg, func)
Definition: atlwin.h:1926
#define BEGIN_MSG_MAP(theClass)
Definition: atlwin.h:1898
#define END_MSG_MAP()
Definition: atlwin.h:1917
BOOL DownloadApplication(CAppInfo *pAppInfo)
Definition: loaddlg.cpp:1079
BOOL UrlHasBeenCopied
Definition: loaddlg.cpp:532
BOOL ShowLastError(HWND hWndOwner, BOOL bInetError, DWORD dwLastError)
Definition: loaddlg.cpp:576
BOOL DownloadListOfApplications(const CAtlList< CAppInfo * > &AppsList, BOOL bIsModal)
Definition: loaddlg.cpp:1060
DownloadStatus
Definition: loaddlg.cpp:66
@ DLSTATUS_DOWNLOADING
Definition: loaddlg.cpp:68
@ DLSTATUS_FINISHED
Definition: loaddlg.cpp:72
@ DLSTATUS_WAITING_INSTALL
Definition: loaddlg.cpp:69
@ DLSTATUS_WAITING
Definition: loaddlg.cpp:67
@ DLSTATUS_INSTALLED
Definition: loaddlg.cpp:71
@ DLSTATUS_INSTALLING
Definition: loaddlg.cpp:70
CStringW LoadStatusString(DownloadStatus StatusParam)
Definition: loaddlg.cpp:76
#define MARGIN
VOID MessageBox_LoadString(HWND hMainWnd, INT StringID)
Definition: loaddlg.cpp:378
DownloadType
Definition: loaddlg.cpp:59
@ DLTYPE_DBUPDATE_UNOFFICIAL
Definition: loaddlg.cpp:62
@ DLTYPE_DBUPDATE
Definition: loaddlg.cpp:61
@ DLTYPE_APPLICATION
Definition: loaddlg.cpp:60
VOID DownloadApplicationsDB(LPCWSTR lpUrl, BOOL IsOfficial)
Definition: loaddlg.cpp:1089
HWND hMainWnd
Definition: magnifier.c:32
#define CREATE_ALWAYS
Definition: disk.h:72
static HBITMAP
Definition: button.c:44
static HDC
Definition: imagelist.c:92
static HICON
Definition: imagelist.c:84
static BYTE subjectName[]
Definition: cert.c:63
HICON hIconSm
Definition: msconfig.c:44
_In_ HANDLE hFile
Definition: mswsock.h:90
unsigned int UINT
Definition: ndis.h:50
#define FILE_SHARE_WRITE
Definition: nt_native.h:681
#define GENERIC_WRITE
Definition: nt_native.h:90
_In_ ULONGLONG _In_ ULONGLONG _In_ BOOLEAN Enable
Definition: ntddpcm.h:142
#define L(x)
Definition: ntvdm.h:50
#define WS_CHILD
Definition: pedump.c:617
#define WS_VISIBLE
Definition: pedump.c:620
static const WCHAR szName[]
Definition: powrprof.c:45
#define LVS_SINGLESEL
Definition: commctrl.h:2266
#define LVS_NOCOLUMNHEADER
Definition: commctrl.h:2284
#define PBS_MARQUEE
Definition: commctrl.h:2198
#define LVIF_STATE
Definition: commctrl.h:2312
#define LVS_SHOWSELALWAYS
Definition: commctrl.h:2267
#define LVS_REPORT
Definition: commctrl.h:2262
#define LVCF_WIDTH
Definition: commctrl.h:2587
#define PBM_SETPOS
Definition: commctrl.h:2184
#define PBM_SETRANGE
Definition: commctrl.h:2183
#define LVS_NOSORTHEADER
Definition: commctrl.h:2285
#define LVIF_TEXT
Definition: commctrl.h:2309
#define LVCF_FMT
Definition: commctrl.h:2586
#define LVCF_SUBITEM
Definition: commctrl.h:2589
#define LVCFMT_LEFT
Definition: commctrl.h:2598
#define PBM_SETMARQUEE
Definition: commctrl.h:2199
DWORD dwStatus
Definition: mediaobj.idl:95
#define DefWindowProc
Definition: ros2win.h:31
_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 memset(x, y, z)
Definition: compat.h:39
#define SEE_MASK_NOCLOSEPROCESS
Definition: shellapi.h:31
BOOL WINAPI DECLSPEC_HOTPATCH ShellExecuteExW(LPSHELLEXECUTEINFOW sei)
Definition: shlexec.cpp:2368
HRESULT hr
Definition: shlfolder.c:183
#define _countof(array)
Definition: sndvol32.h:68
TCHAR szAppName[128]
Definition: solitaire.cpp:18
Definition: window.h:372
CStringW szName
Definition: loaddlg.cpp:96
DownloadType DLType
Definition: loaddlg.cpp:94
CStringW szUrl
Definition: loaddlg.cpp:95
ULONG SizeInBytes
Definition: loaddlg.cpp:98
CStringW szSHA1
Definition: loaddlg.cpp:97
DownloadInfo(const CAppInfo &AppInfo)
Definition: loaddlg.cpp:88
DownloadParam(HWND dlg, const ATL::CSimpleArray< DownloadInfo > &info, LPCWSTR caption)
Definition: loaddlg.cpp:106
ATL::CSimpleArray< DownloadInfo > AppInfo
Definition: loaddlg.cpp:112
LPCWSTR szCaption
Definition: loaddlg.cpp:113
WCHAR szDownloadDir[MAX_PATH]
Definition: settings.h:10
BOOL bDelInstaller
Definition: settings.h:11
WCHAR szNoProxyFor[MAX_PATH]
Definition: settings.h:21
WCHAR szProxyServer[MAX_PATH]
Definition: settings.h:20
DWORD dwStructSize
Definition: wininet.h:211
INTERNET_SCHEME nScheme
Definition: wininet.h:214
LPWSTR lpszScheme
Definition: wininet.h:212
DWORD dwSchemeLength
Definition: wininet.h:213
LPCWSTR lpParameters
Definition: shellapi.h:330
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
#define ICON_BIG
Definition: tnclass.cpp:51
#define ICON_SMALL
Definition: tnclass.cpp:48
#define LANG_USER_DEFAULT
Definition: tnerror.cpp:50
uint16_t * PWSTR
Definition: typedefs.h:56
int32_t INT_PTR
Definition: typedefs.h:64
const uint16_t * PCWSTR
Definition: typedefs.h:57
PVOID HANDLE
Definition: typedefs.h:73
ULONG_PTR SIZE_T
Definition: typedefs.h:80
int32_t INT
Definition: typedefs.h:58
uint32_t ULONG
Definition: typedefs.h:59
uint64_t ULONGLONG
Definition: typedefs.h:67
_In_ HFONT _Out_ PUINT _Out_ PUINT Width
Definition: font.h:89
#define AddItem
Definition: userenv.h:209
#define INVALID_FILE_ATTRIBUTES
Definition: vfdcmd.c:23
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
Definition: wdfchildlist.h:690
_In_ WDFCOLLECTION _In_ ULONG Index
_In_ WDFCOLLECTION _In_ WDFOBJECT Item
HDC hdcMem
Definition: welcome.c:104
int WINAPI GetWindowTextW(HWND hWnd, LPWSTR lpString, int nMaxCount)
Definition: window.c:1412
#define ZeroMemory
Definition: winbase.h:1700
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define FORMAT_MESSAGE_IGNORE_INSERTS
Definition: winbase.h:420
#define FORMAT_MESSAGE_FROM_SYSTEM
Definition: winbase.h:423
#define FORMAT_MESSAGE_ALLOCATE_BUFFER
Definition: winbase.h:419
#define FORMAT_MESSAGE_FROM_HMODULE
Definition: winbase.h:422
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
LONG_PTR LPARAM
Definition: windef.h:208
LONG_PTR LRESULT
Definition: windef.h:209
UINT_PTR WPARAM
Definition: windef.h:207
#define WINAPI
Definition: msvc.h:6
#define SelectFont(hdc, hfont)
Definition: windowsx.h:516
#define GetStockFont(i)
Definition: windowsx.h:308
#define DEFAULT_GUI_FONT
Definition: wingdi.h:909
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1539
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
#define SRCCOPY
Definition: wingdi.h:333
HBITMAP WINAPI CreateCompatibleBitmap(_In_ HDC hdc, _In_ INT cx, _In_ INT cy)
BOOL WINAPI DeleteDC(_In_ HDC)
#define HTTP_STATUS_OK
Definition: winhttp.h:240
#define INTERNET_SCHEME_FTP
Definition: winhttp.h:44
#define ICU_DECODE
Definition: winhttp.h:291
#define INTERNET_SCHEME_HTTP
Definition: winhttp.h:42
#define SECURITY_FLAG_SECURE
Definition: winhttp.h:285
#define ICU_NO_ENCODE
Definition: winhttp.h:290
#define INTERNET_SCHEME_HTTPS
Definition: winhttp.h:43
#define ICU_ESCAPE
Definition: winhttp.h:48
#define INTERNET_FLAG_PRAGMA_NOCACHE
Definition: wininet.h:85
#define INTERNET_OPTION_SECURITY_FLAGS
Definition: wininet.h:725
#define INTERNET_FLAG_DONT_CACHE
Definition: wininet.h:67
#define INTERNET_FLAG_KEEP_CONNECTION
Definition: wininet.h:72
#define INTERNET_FLAG_PASSIVE
Definition: wininet.h:65
#define HTTP_QUERY_FLAG_NUMBER
Definition: wininet.h:1606
#define INTERNET_OPEN_TYPE_DIRECT
Definition: wininet.h:522
@ INTERNET_SCHEME_FILE
Definition: wininet.h:143
#define INTERNET_OPEN_TYPE_PROXY
Definition: wininet.h:523
#define HTTP_QUERY_STATUS_CODE
Definition: wininet.h:1542
#define INTERNET_OPEN_TYPE_PRECONFIG
Definition: wininet.h:521
#define INTERNET_OPTION_SECURITY_CERTIFICATE_STRUCT
Definition: wininet.h:726
#define HTTP_QUERY_CONTENT_LENGTH
Definition: wininet.h:1528
BOOL VerifyInteg(LPCWSTR lpSHA1Hash, LPCWSTR lpFileName)
Definition: integrity.cpp:14
#define EVENTLOG_SUCCESS
Definition: winnt_old.h:2886
#define WM_PAINT
Definition: winuser.h:1610
#define WM_ERASEBKGND
Definition: winuser.h:1615
DWORD WINAPI GetSysColor(_In_ int)
BOOL WINAPI IsWindow(_In_opt_ HWND)
#define WM_CLOSE
Definition: winuser.h:1611
#define DT_NOPREFIX
Definition: winuser.h:537
#define GCLP_HICONSM
Definition: winuser.h:670
#define MAKELPARAM(l, h)
Definition: winuser.h:3998
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define DT_CENTER
Definition: winuser.h:527
#define IDCANCEL
Definition: winuser.h:825
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define GCLP_HICON
Definition: winuser.h:669
#define DialogBoxW(i, t, p, f)
Definition: winuser.h:4389
int WINAPI MessageBoxA(_In_opt_ HWND hWnd, _In_opt_ LPCSTR lpText, _In_opt_ LPCSTR lpCaption, _In_ UINT uType)
#define DT_SINGLELINE
Definition: winuser.h:540
#define WM_COMMAND
Definition: winuser.h:1730
#define COLOR_3DDKSHADOW
Definition: winuser.h:933
BOOL WINAPI SetDlgItemTextW(_In_ HWND, _In_ int, _In_ LPCWSTR)
#define WM_INITDIALOG
Definition: winuser.h:1729
#define MB_YESNO
Definition: winuser.h:811
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)
#define MB_ICONERROR
Definition: winuser.h:781
BOOL WINAPI SetWindowTextW(_In_ HWND, _In_opt_ LPCWSTR)
#define WM_SETTEXT
Definition: winuser.h:1607
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
#define SendMessage
Definition: winuser.h:5833
#define MB_OK
Definition: winuser.h:784
#define CreateDialogW(h, n, w, f)
Definition: winuser.h:4271
#define DT_VCENTER
Definition: winuser.h:543
#define GetClassLongPtrW
Definition: winuser.h:4554
#define SW_SHOW
Definition: winuser.h:769
#define WS_EX_CLIENTEDGE
Definition: winuser.h:384
#define SetWindowText
Definition: winuser.h:5847
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define IDYES
Definition: winuser.h:829
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)
BOOL WINAPI InflateRect(_Inout_ LPRECT, _In_ int, _In_ int)
#define COLOR_CAPTIONTEXT
Definition: winuser.h:916
BOOL WINAPI DestroyWindow(_In_ HWND)
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE hInstance, _In_ LPCWSTR lpIconName)
Definition: cursoricon.c:2044
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185