ReactOS  0.4.15-dev-2528-g5506091
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 <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 
58 
60 {
64 };
65 
67 {
74 };
75 
77 {
78  ATL::CStringW szString;
79  szString.LoadStringW(StatusParam);
80  return szString;
81 }
82 
84 {
88  , szUrl(AppInfo.m_szUrlDownload)
89  , szName(AppInfo.m_szName)
90  , szSHA1(AppInfo.m_szSHA1)
91  , SizeInBytes(AppInfo.m_SizeBytes)
92  {
93  }
94 
100 };
101 
103 {
106  : Dialog(dlg), AppInfo(info), szCaption(caption)
107  {
108  }
109 
113 };
114 
115 
117  : public CWindowImpl<CDownloaderProgress, CWindow, CControlWinTraits>
118 {
120 
121 public:
123  {
124  }
125 
127  {
128  if (Enable)
129  ModifyStyle(0, PBS_MARQUEE, 0);
130  else
131  ModifyStyle(PBS_MARQUEE, 0, 0);
132 
134  }
135 
136  VOID SetProgress(ULONG ulProgress, ULONG ulProgressMax)
137  {
138  WCHAR szProgress[100];
139 
140  /* format the bits and bytes into pretty and accessible units... */
142 
143  /* use our subclassed progress bar text subroutine */
144  ATL::CStringW ProgressText;
145 
146  if (ulProgressMax)
147  {
148  /* total size is known */
149  WCHAR szProgressMax[100];
150  UINT uiPercentage = ((ULONGLONG) ulProgress * 100) / ulProgressMax;
151 
152  /* send the current progress to the progress bar */
153  if (!IsWindow()) return;
154  SendMessage(PBM_SETPOS, uiPercentage, 0);
155 
156  /* format total download size */
157  StrFormatByteSizeW(ulProgressMax, szProgressMax, _countof(szProgressMax));
158 
159  /* generate the text on progress bar */
160  ProgressText.Format(L"%u%% \x2014 %ls / %ls",
161  uiPercentage,
162  szProgress,
163  szProgressMax);
164  }
165  else
166  {
167  /* send the current progress to the progress bar */
168  if (!IsWindow()) 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()) return;
177  SendMessage(WM_SETTEXT, 0, (LPARAM) ProgressText.GetString());
178  }
179 
181  {
182  PAINTSTRUCT ps;
183  HDC hDC = BeginPaint(&ps), hdcMem;
184  HBITMAP hbmMem;
185  HANDLE hOld;
186  RECT myRect;
187  UINT win_width, win_height;
188 
189  GetClientRect(&myRect);
190 
191  /* grab the progress bar rect size */
192  win_width = myRect.right - myRect.left;
193  win_height = myRect.bottom - myRect.top;
194 
195  /* create an off-screen DC for double-buffering */
197  hbmMem = CreateCompatibleBitmap(hDC, win_width, win_height);
198 
199  hOld = SelectObject(hdcMem, hbmMem);
200 
201  /* call the original draw code and redirect it to our memory buffer */
202  DefWindowProc(uMsg, (WPARAM) hdcMem, lParam);
203 
204  /* draw our nifty progress text over it */
207  &myRect,
211  1, 1);
212 
213  /* transfer the off-screen DC to the screen */
214  BitBlt(hDC, 0, 0, win_width, win_height, hdcMem, 0, 0, SRCCOPY);
215 
216  /* free the off-screen DC */
217  SelectObject(hdcMem, hOld);
218  DeleteObject(hbmMem);
219  DeleteDC(hdcMem);
220 
221  EndPaint(&ps);
222  return 0;
223  }
224 
226  {
227  if (lParam)
228  {
230  }
231  return 0;
232  }
233 
238  END_MSG_MAP()
239 };
240 
242  : public CListView
243 {
244 public:
246  {
247  RECT r = {10, 150, 320, 350};
250 
252 
253  AddColumn(0, 150, LVCFMT_LEFT);
254  AddColumn(1, 120, LVCFMT_LEFT);
255 
256  return hwnd;
257  }
258 
260  {
261  for (INT i = 0; i < arrInfo.GetSize(); ++i)
262  {
263  AddRow(i, arrInfo[i].szName.GetString(), DLSTATUS_WAITING);
264  }
265  }
266 
268  {
270  SetItemText(ItemIndex, 1, szBuffer.GetString());
271  }
272 
273  BOOL AddItem(INT ItemIndex, LPWSTR lpText)
274  {
275  LVITEMW Item;
276 
277  ZeroMemory(&Item, sizeof(Item));
278 
279  Item.mask = LVIF_TEXT | LVIF_STATE;
280  Item.pszText = lpText;
281  Item.iItem = ItemIndex;
282 
283  return InsertItem(&Item);
284  }
285 
287  {
289  AddItem(RowIndex,
290  const_cast<LPWSTR>(szAppName));
291  SetDownloadStatus(RowIndex, Status);
292  }
293 
295  {
296  LVCOLUMNW Column;
297  ZeroMemory(&Column, sizeof(Column));
298 
299  Column.mask = LVCF_FMT | LVCF_WIDTH | LVCF_SUBITEM;
300  Column.iSubItem = Index;
301  Column.cx = Width;
302  Column.fmt = Format;
303 
304  return (InsertColumn(Index, &Column) == -1) ? FALSE : TRUE;
305  }
306 };
307 
308 #ifdef USE_CERT_PINNING
309 static BOOL CertGetSubjectAndIssuer(HINTERNET hFile, CLocalPtr<char>& subjectInfo, CLocalPtr<char>& issuerInfo)
310 {
311  DWORD certInfoLength;
313  DWORD size, flags;
314 
315  size = sizeof(flags);
317  {
318  return FALSE;
319  }
320 
322  {
323  return FALSE;
324  }
325 
326  /* Despite what the header indicates, the implementation of INTERNET_CERTIFICATE_INFO is not Unicode-aware. */
327  certInfoLength = sizeof(certInfo);
330  &certInfo,
331  &certInfoLength))
332  {
333  return FALSE;
334  }
335 
336  subjectInfo.Attach(certInfo.lpszSubjectInfo);
337  issuerInfo.Attach(certInfo.lpszIssuerInfo);
338 
339  if (certInfo.lpszProtocolName)
340  LocalFree(certInfo.lpszProtocolName);
341  if (certInfo.lpszSignatureAlgName)
343  if (certInfo.lpszEncryptionAlgName)
345 
346  return certInfo.lpszSubjectInfo && certInfo.lpszIssuerInfo;
347 }
348 #endif
349 
351 {
352  ATL::CStringW szMsgText;
353  if (szMsgText.LoadStringW(StringID))
354  {
356  }
357 }
358 
359 // Download dialog (loaddlg.cpp)
361 {
365  static BOOL bCancelled;
366  static BOOL bModal;
367  static VOID UpdateProgress(HWND hDlg, ULONG ulProgress, ULONG ulProgressMax, ULONG ulStatusCode, LPCWSTR szStatusText);
368 public:
369  static VOID Add(DownloadInfo info);
370  static VOID Download(const DownloadInfo& DLInfo, BOOL bIsModal = FALSE);
372  static unsigned int WINAPI ThreadFunc(LPVOID Context);
374 };
375 
376 
377 // CDownloadManager
383 
385 {
387 }
388 
390 {
392  AppsDownloadList.Add(DLInfo);
393  LaunchDownloadDialog(bIsModal);
394 }
395 
397 {
398  static WCHAR szCaption[MAX_PATH];
399 
400  switch (uMsg)
401  {
402  case WM_INITDIALOG:
403  {
404  HICON hIconSm, hIconBg;
405  ATL::CStringW szTempCaption;
406 
407  bCancelled = FALSE;
408 
411 
412  if (hIconBg && hIconSm)
413  {
414  SendMessageW(Dlg, WM_SETICON, ICON_BIG, (LPARAM) hIconBg);
415  SendMessageW(Dlg, WM_SETICON, ICON_SMALL, (LPARAM) hIconSm);
416  }
417 
420  if (Item)
421  {
422  // initialize the default values for our nifty progress bar
423  // and subclass it so that it learns to print a status text
427  }
428 
429  // Add a ListView
430  HWND hListView = DownloadsListView.Create(Dlg);
431  if (!hListView)
432  {
433  return FALSE;
434  }
436 
437  // Get a dlg string for later use
438  GetWindowTextW(Dlg, szCaption, _countof(szCaption));
439 
440  // Hide a placeholder from displaying
441  szTempCaption = szCaption;
442  szTempCaption.Replace(L"%ls", L"");
443  SetWindowText(Dlg, szTempCaption.GetString());
444 
445  ShowWindow(Dlg, SW_SHOW);
446 
447  // Start download process
448  DownloadParam *param = new DownloadParam(Dlg, AppsDownloadList, szCaption);
449  unsigned int ThreadId;
450  HANDLE Thread = (HANDLE)_beginthreadex(NULL, 0, ThreadFunc, (void *) param, 0, &ThreadId);
451 
452  if (!Thread)
453  {
454  return FALSE;
455  }
456 
459  return TRUE;
460  }
461 
462  case WM_COMMAND:
463  if (wParam == IDCANCEL)
464  {
465  bCancelled = TRUE;
466  PostMessageW(Dlg, WM_CLOSE, 0, 0);
467  }
468  return FALSE;
469 
470  case WM_CLOSE:
472  {
473  ::EndDialog(Dlg, 0);
474  }
475  else
476  {
477  ::DestroyWindow(Dlg);
478  }
479  return TRUE;
480 
481  default:
482  return FALSE;
483  }
484 }
485 
487 
489  HWND hDlg,
490  ULONG ulProgress,
491  ULONG ulProgressMax,
492  ULONG ulStatusCode,
493  LPCWSTR szStatusText)
494 {
495  HWND Item;
496 
497  if (!IsWindow(hDlg)) return;
498  ProgressBar.SetProgress(ulProgress, ulProgressMax);
499 
500  if (!IsWindow(hDlg)) return;
502  if (Item && szStatusText && wcslen(szStatusText) > 0 && UrlHasBeenCopied == FALSE)
503  {
504  SIZE_T len = wcslen(szStatusText) + 1;
506  DWORD dummyLen;
507 
508  /* beautify our url for display purposes */
509  if (!InternetCanonicalizeUrlW(szStatusText, buf.GetBuffer(len), &dummyLen, ICU_DECODE | ICU_NO_ENCODE))
510  {
511  /* just use the original */
512  buf.ReleaseBuffer();
513  buf = szStatusText;
514  }
515  else
516  {
517  buf.ReleaseBuffer();
518  }
519 
520  /* paste it into our dialog and don't do it again in this instance */
521  SendMessageW(Item, WM_SETTEXT, 0, (LPARAM) buf.GetString());
523  }
524 }
525 
527  HWND hWndOwner,
528  BOOL bInetError,
529  DWORD dwLastError)
530 {
531  CLocalPtr<WCHAR> lpMsg;
532 
536  (bInetError ? GetModuleHandleW(L"wininet.dll") : NULL),
537  dwLastError,
539  (LPWSTR)&lpMsg,
540  0, NULL))
541  {
542  DPRINT1("FormatMessageW unexpected failure (err %d)\n", GetLastError());
543  return FALSE;
544  }
545 
546  MessageBoxW(hWndOwner, lpMsg, NULL, MB_OK | MB_ICONERROR);
547  return TRUE;
548 }
549 
551 {
553  PWSTR p, q;
554 
555  HWND hDlg = static_cast<DownloadParam*>(param)->Dialog;
556  HWND Item;
557  INT iAppId;
558 
559  ULONG dwContentLen, dwBytesWritten, dwBytesRead, dwStatus;
560  ULONG dwCurrentBytesRead = 0;
561  ULONG dwStatusLen = sizeof(dwStatus);
562 
563  BOOL bTempfile = FALSE;
564 
565  HINTERNET hOpen = NULL;
566  HINTERNET hFile = NULL;
568 
569  unsigned char lpBuffer[4096];
570  LPCWSTR lpszAgent = L"RApps/1.1";
571  URL_COMPONENTSW urlComponents;
572  size_t urlLength, filenameLength;
573 
574  const ATL::CSimpleArray<DownloadInfo> &InfoArray = static_cast<DownloadParam*>(param)->AppInfo;
575  LPCWSTR szCaption = static_cast<DownloadParam*>(param)->szCaption;
576  ATL::CStringW szNewCaption;
577 
579 
580  if (InfoArray.GetSize() <= 0)
581  {
583  goto end;
584  }
585 
586  for (iAppId = 0; iAppId < InfoArray.GetSize(); ++iAppId)
587  {
588  // Reset progress bar
589  if (!IsWindow(hDlg)) break;
591  if (Item)
592  {
596  }
597 
598  // is this URL an update package for RAPPS? if so store it in a different place
599  if (InfoArray[iAppId].DLType != DLTYPE_APPLICATION)
600  {
602  {
604  goto end;
605  }
606  }
607  else
608  {
610  }
611 
612  // Change caption to show the currently downloaded app
613  switch(InfoArray[iAppId].DLType)
614  {
615  case DLTYPE_APPLICATION:
616  szNewCaption.Format(szCaption, InfoArray[iAppId].szName.GetString());
617  break;
618  case DLTYPE_DBUPDATE:
619  szNewCaption.LoadStringW(IDS_DL_DIALOG_DB_DOWNLOAD_DISP);
620  break;
622  szNewCaption.LoadStringW(IDS_DL_DIALOG_DB_UNOFFICIAL_DOWNLOAD_DISP);
623  break;
624  }
625 
626  if (!IsWindow(hDlg)) goto end;
627  SetWindowTextW(hDlg, szNewCaption.GetString());
628 
629  // build the path for the download
630  p = wcsrchr(InfoArray[iAppId].szUrl.GetString(), L'/');
631  q = wcsrchr(InfoArray[iAppId].szUrl.GetString(), L'?');
632 
633  // do we have a final slash separator?
634  if (!p)
635  {
637  goto end;
638  }
639 
640  // prepare the tentative length of the filename, maybe we've to remove part of it later on
641  filenameLength = wcslen(p) * sizeof(WCHAR);
642 
643  /* do we have query arguments in the target URL after the filename? account for them
644  (e.g. https://example.org/myfile.exe?no_adware_plz) */
645  if (q && q > p && (q - p) > 0)
646  filenameLength -= wcslen(q - 1) * sizeof(WCHAR);
647 
648  // is the path valid? can we access it?
649  if (GetFileAttributesW(Path.GetString()) == INVALID_FILE_ATTRIBUTES)
650  {
651  if (!CreateDirectoryW(Path.GetString(), NULL))
652  {
654  goto end;
655  }
656  }
657 
658  // append a \ to the provided file system path, and the filename portion from the URL after that
659 
660  PathAddBackslashW(Path.GetBuffer(MAX_PATH));
661  switch (InfoArray[iAppId].DLType)
662  {
663  case DLTYPE_DBUPDATE:
666  break;
667  case DLTYPE_APPLICATION:
668  PathAppendW(Path.GetBuffer(), (LPWSTR)(p + 1)); // use the filename retrieved from URL
669  break;
670  }
671  Path.ReleaseBuffer();
672 
673  if ((InfoArray[iAppId].DLType == DLTYPE_APPLICATION) && InfoArray[iAppId].szSHA1[0] && GetFileAttributesW(Path.GetString()) != INVALID_FILE_ATTRIBUTES)
674  {
675  // only open it in case of total correctness
676  if (VerifyInteg(InfoArray[iAppId].szSHA1.GetString(), Path))
677  goto run;
678  }
679 
680  // Add the download URL
681  if (!IsWindow(hDlg)) goto end;
682  SetDlgItemTextW(hDlg, IDC_DOWNLOAD_STATUS, InfoArray[iAppId].szUrl.GetString());
683 
685 
686  // download it
688  bTempfile = TRUE;
689 
690  /* FIXME: this should just be using the system-wide proxy settings */
691  switch (SettingsInfo.Proxy)
692  {
693  case 0: // preconfig
694  default:
695  hOpen = InternetOpenW(lpszAgent, INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0);
696  break;
697  case 1: // direct (no proxy)
698  hOpen = InternetOpenW(lpszAgent, INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0);
699  break;
700  case 2: // use proxy
702  break;
703  }
704 
705  if (!hOpen)
706  {
708  goto end;
709  }
710 
711  dwStatusLen = sizeof(dwStatus);
712 
713  memset(&urlComponents, 0, sizeof(urlComponents));
714  urlComponents.dwStructSize = sizeof(urlComponents);
715 
716  urlLength = InfoArray[iAppId].szUrl.GetLength();
717  urlComponents.dwSchemeLength = urlLength + 1;
718  urlComponents.lpszScheme = (LPWSTR) malloc(urlComponents.dwSchemeLength * sizeof(WCHAR));
719 
720  if (!InternetCrackUrlW(InfoArray[iAppId].szUrl, urlLength + 1, ICU_DECODE | ICU_ESCAPE, &urlComponents))
721  {
723  goto end;
724  }
725 
726  dwContentLen = 0;
727 
728  if (urlComponents.nScheme == INTERNET_SCHEME_HTTP ||
729  urlComponents.nScheme == INTERNET_SCHEME_HTTPS)
730  {
731  hFile = InternetOpenUrlW(hOpen, InfoArray[iAppId].szUrl.GetString(), NULL, 0,
732  dwUrlConnectFlags,
733  0);
734  if (!hFile)
735  {
737  {
738  /* Workaround for CORE-17377 */
740  }
741  goto end;
742  }
743 
744  // query connection
746  {
748  goto end;
749  }
750 
751  if (dwStatus != HTTP_STATUS_OK)
752  {
754  goto end;
755  }
756 
757  // query content length
759  }
760  else if (urlComponents.nScheme == INTERNET_SCHEME_FTP)
761  {
762  // force passive mode on FTP
763  hFile = InternetOpenUrlW(hOpen, InfoArray[iAppId].szUrl, NULL, 0,
764  dwUrlConnectFlags | INTERNET_FLAG_PASSIVE,
765  0);
766  if (!hFile)
767  {
769  {
770  /* Workaround for CORE-17377 */
772  }
773  goto end;
774  }
775 
776  dwContentLen = FtpGetFileSize(hFile, &dwStatus);
777  }
778  else if (urlComponents.nScheme == INTERNET_SCHEME_FILE)
779  {
780  // Add support for the file scheme so testing locally is simpler
781  WCHAR LocalFilePath[MAX_PATH];
782  DWORD cchPath = _countof(LocalFilePath);
783  // Ideally we would use PathCreateFromUrlAlloc here, but that is not exported (yet)
784  HRESULT hr = PathCreateFromUrlW(InfoArray[iAppId].szUrl, LocalFilePath, &cchPath, 0);
785  if (SUCCEEDED(hr))
786  {
787  if (CopyFileW(LocalFilePath, Path, FALSE))
788  {
789  goto run;
790  }
791  else
792  {
794  goto end;
795  }
796  }
797  else
798  {
800  goto end;
801  }
802  }
803 
804  if (!dwContentLen)
805  {
806  // Someone was nice enough to add this, let's use it
807  if (InfoArray[iAppId].SizeInBytes)
808  {
809  dwContentLen = InfoArray[iAppId].SizeInBytes;
810  }
811  else
812  {
813  // content-length is not known, enable marquee mode
815  }
816  }
817 
818  free(urlComponents.lpszScheme);
819 
820 #ifdef USE_CERT_PINNING
821  // are we using HTTPS to download the RAPPS update package? check if the certificate is original
822  if ((urlComponents.nScheme == INTERNET_SCHEME_HTTPS) &&
823  (InfoArray[iAppId].DLType == DLTYPE_DBUPDATE))
824  {
825  CLocalPtr<char> subjectName, issuerName;
826  CStringA szMsgText;
827  bool bAskQuestion = false;
828  if (!CertGetSubjectAndIssuer(hFile, subjectName, issuerName))
829  {
830  szMsgText.LoadStringW(IDS_UNABLE_TO_QUERY_CERT);
831  bAskQuestion = true;
832  }
833  else
834  {
835  if (strcmp(subjectName, CERT_SUBJECT_INFO) ||
836  (strcmp(issuerName, CERT_ISSUER_INFO_OLD) &&
837  strcmp(issuerName, CERT_ISSUER_INFO_NEW)))
838  {
839  szMsgText.Format(IDS_MISMATCH_CERT_INFO, (char*)subjectName, (const char*)issuerName);
840  bAskQuestion = true;
841  }
842  }
843 
844  if (bAskQuestion)
845  {
846  if (MessageBoxA(hMainWnd, szMsgText.GetString(), NULL, MB_YESNO | MB_ICONERROR) != IDYES)
847  {
848  goto end;
849  }
850  }
851  }
852 #endif
853 
855 
856  if (hOut == INVALID_HANDLE_VALUE)
857  {
859  goto end;
860  }
861 
862  dwCurrentBytesRead = 0;
863  do
864  {
865  if (!InternetReadFile(hFile, lpBuffer, _countof(lpBuffer), &dwBytesRead))
866  {
868  goto end;
869  }
870 
871  if (!WriteFile(hOut, &lpBuffer[0], dwBytesRead, &dwBytesWritten, NULL))
872  {
874  goto end;
875  }
876 
877  dwCurrentBytesRead += dwBytesRead;
878  if (!IsWindow(hDlg)) goto end;
879  UpdateProgress(hDlg, dwCurrentBytesRead, dwContentLen, 0, InfoArray[iAppId].szUrl.GetString());
880  } while (dwBytesRead && !bCancelled);
881 
882  CloseHandle(hOut);
883  hOut = INVALID_HANDLE_VALUE;
884 
885  if (bCancelled)
886  {
887  DPRINT1("Operation cancelled\n");
888  goto end;
889  }
890 
891  if (!dwContentLen)
892  {
893  // set progress bar to 100%
895 
896  dwContentLen = dwCurrentBytesRead;
897  if (!IsWindow(hDlg)) goto end;
898  UpdateProgress(hDlg, dwCurrentBytesRead, dwContentLen, 0, InfoArray[iAppId].szUrl.GetString());
899  }
900 
901  /* if this thing isn't a RAPPS update and it has a SHA-1 checksum
902  verify its integrity by using the native advapi32.A_SHA1 functions */
903  if ((InfoArray[iAppId].DLType == DLTYPE_APPLICATION) && InfoArray[iAppId].szSHA1[0] != 0)
904  {
905  ATL::CStringW szMsgText;
906 
907  // change a few strings in the download dialog to reflect the verification process
908  if (!szMsgText.LoadStringW(IDS_INTEG_CHECK_TITLE))
909  {
910  DPRINT1("Unable to load string\n");
911  goto end;
912  }
913 
914  if (!IsWindow(hDlg)) goto end;
915  SetWindowTextW(hDlg, szMsgText.GetString());
917 
918  // this may take a while, depending on the file size
919  if (!VerifyInteg(InfoArray[iAppId].szSHA1.GetString(), Path.GetString()))
920  {
921  if (!szMsgText.LoadStringW(IDS_INTEG_CHECK_FAIL))
922  {
923  DPRINT1("Unable to load string\n");
924  goto end;
925  }
926 
927  if (!IsWindow(hDlg)) goto end;
928  MessageBoxW(hDlg, szMsgText.GetString(), NULL, MB_OK | MB_ICONERROR);
929  goto end;
930  }
931  }
932 
933 run:
935 
936  // run it
937  if (InfoArray[iAppId].DLType == DLTYPE_APPLICATION)
938  {
939  SHELLEXECUTEINFOW shExInfo = {0};
940  shExInfo.cbSize = sizeof(shExInfo);
941  shExInfo.fMask = SEE_MASK_NOCLOSEPROCESS;
942  shExInfo.lpVerb = L"open";
943  shExInfo.lpFile = Path.GetString();
944  shExInfo.lpParameters = L"";
945  shExInfo.nShow = SW_SHOW;
946 
947  /* FIXME: Do we want to log installer status? */
948  WriteLogMessage(EVENTLOG_SUCCESS, MSG_SUCCESS_INSTALL, InfoArray[iAppId].szName);
949 
950  if (ShellExecuteExW(&shExInfo))
951  {
952  //reflect installation progress in the titlebar
953  //TODO: make a separate string with a placeholder to include app name?
955  if (!IsWindow(hDlg)) goto end;
956  SetWindowTextW(hDlg, szMsgText.GetString());
957 
959 
960  //TODO: issue an install operation separately so that the apps could be downloaded in the background
962  CloseHandle(shExInfo.hProcess);
963  }
964  else
965  {
967  }
968  }
969 
970 end:
971  if (hOut != INVALID_HANDLE_VALUE)
972  CloseHandle(hOut);
973 
974  if (hFile)
976  InternetCloseHandle(hOpen);
977 
978  if (bTempfile)
979  {
980  if (bCancelled || (SettingsInfo.bDelInstaller && (InfoArray[iAppId].DLType == DLTYPE_APPLICATION)))
981  DeleteFileW(Path.GetString());
982  }
983 
984  if (!IsWindow(hDlg)) return 0;
986  }
987 
988  delete static_cast<DownloadParam*>(param);
989  if (!IsWindow(hDlg)) return 0;
990  SendMessageW(hDlg, WM_CLOSE, 0, 0);
991  return 0;
992 }
993 
994 //TODO: Reuse the dialog
996 {
997  CDownloadManager::bModal = bIsModal;
998  if (bIsModal)
999  {
1000  DialogBoxW(hInst,
1002  hMainWnd,
1003  DownloadDlgProc);
1004  }
1005  else
1006  {
1009  hMainWnd,
1010  DownloadDlgProc);
1011  }
1012 }
1013 // CDownloadManager
1014 
1015 
1017 {
1018  if (AppsList.GetSize() == 0)
1019  return FALSE;
1020 
1021  // Initialize shared variables
1022  for (INT i = 0; i < AppsList.GetSize(); ++i)
1023  {
1024  CDownloadManager::Add(AppsList[i]); // implicit conversion to DownloadInfo
1025  }
1026 
1027  // Create a dialog and issue a download process
1029 
1030  return TRUE;
1031 }
1032 
1034 {
1035  if (!pAppInfo)
1036  return FALSE;
1037 
1038  CDownloadManager::Download(*pAppInfo, bIsModal);
1039  return TRUE;
1040 }
1041 
1043 {
1044  static DownloadInfo DatabaseDLInfo;
1045  DatabaseDLInfo.szUrl = lpUrl;
1046  DatabaseDLInfo.szName.LoadStringW(IDS_DL_DIALOG_DB_DISP);
1047  DatabaseDLInfo.DLType = IsOfficial ? DLTYPE_DBUPDATE : DLTYPE_DBUPDATE_UNOFFICIAL;
1048  CDownloadManager::Download(DatabaseDLInfo, TRUE);
1049 }
1050 
#define HTTP_QUERY_CONTENT_LENGTH
Definition: wininet.h:1528
int GetLength() const
Definition: atlsimpstr.h:356
BOOL WINAPI CreateDirectoryW(IN LPCWSTR lpPathName, IN LPSECURITY_ATTRIBUTES lpSecurityAttributes)
Definition: dir.c:90
LPWSTR WINAPI StrFormatByteSizeW(LONGLONG llBytes, LPWSTR lpszDest, UINT cchMax)
Definition: string.c:2380
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
Definition: rw.c:24
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
const uint16_t * PCWSTR
Definition: typedefs.h:57
HRESULT WINAPI PathCreateFromUrlW(LPCWSTR pszUrl, LPWSTR pszPath, LPDWORD pcchPath, DWORD dwReserved)
Definition: path.c:3334
#define IDS_DL_DIALOG_DB_DOWNLOAD_DISP
Definition: resource.h:218
DownloadType
Definition: loaddlg.cpp:59
static HICON
Definition: imagelist.c:84
#define CloseHandle
Definition: compat.h:598
BOOL DownloadApplication(CAvailableApplicationInfo *pAppInfo, BOOL bIsModal)
Definition: loaddlg.cpp:1033
#define IDS_STATUS_INSTALLED
Definition: resource.h:194
#define PBS_MARQUEE
Definition: commctrl.h:2198
#define LVCF_WIDTH
Definition: commctrl.h:2587
BOOL VerifyInteg(LPCWSTR lpSHA1Hash, LPCWSTR lpFileName)
Definition: integrity.cpp:13
BOOL Add(const T &t)
Definition: atlsimpcoll.h:58
#define IDS_DL_DIALOG_DB_DISP
Definition: resource.h:217
HRESULT hr
Definition: shlfolder.c:183
#define IDYES
Definition: winuser.h:829
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
BOOL WINAPI IsWindow(_In_opt_ HWND)
static VOID Download(const DownloadInfo &DLInfo, BOOL bIsModal=FALSE)
Definition: loaddlg.cpp:389
#define LVS_NOCOLUMNHEADER
Definition: commctrl.h:2284
DWORD dwStructSize
Definition: wininet.h:211
#define IDD_DOWNLOAD_DIALOG
Definition: resource.h:65
#define GetStockFont(i)
Definition: windowsx.h:283
#define LVS_SHOWSELALWAYS
Definition: commctrl.h:2267
HBITMAP WINAPI CreateCompatibleBitmap(_In_ HDC hdc, _In_ INT cx, _In_ INT cy)
#define PBM_SETMARQUEE
Definition: commctrl.h:2199
#define SEE_MASK_NOCLOSEPROCESS
Definition: shellapi.h:31
#define TRUE
Definition: types.h:120
static BYTE subjectName[]
Definition: cert.c:63
uint16_t * PWSTR
Definition: typedefs.h:56
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define LVS_REPORT
Definition: commctrl.h:2262
static BOOL bCancelled
Definition: loaddlg.cpp:365
#define free
Definition: debug_ros.c:5
static unsigned int WINAPI ThreadFunc(LPVOID Context)
Definition: loaddlg.cpp:550
#define MAKELPARAM(l, h)
Definition: winuser.h:3983
#define IDS_MISMATCH_CERT_INFO
Definition: resource.h:120
#define INTERNET_OPTION_SECURITY_CERTIFICATE_STRUCT
Definition: wininet.h:726
BOOL ShowLastError(HWND hWndOwner, BOOL bInetError, DWORD dwLastError)
Definition: loaddlg.cpp:526
_In_ ULONGLONG _In_ ULONGLONG _In_ BOOLEAN Enable
Definition: ntddpcm.h:140
static HDC
Definition: imagelist.c:92
#define CALLBACK
Definition: compat.h:35
BOOL IsWindow() const
Definition: atlwin.h:882
LONG top
Definition: windef.h:307
LPCWSTR szCaption
Definition: loaddlg.cpp:112
#define INTERNET_OPEN_TYPE_PROXY
Definition: wininet.h:523
#define LVCFMT_LEFT
Definition: commctrl.h:2598
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1499
static VOID LaunchDownloadDialog(BOOL)
Definition: loaddlg.cpp:995
#define INVALID_HANDLE_VALUE
Definition: compat.h:590
#define COLOR_CAPTIONTEXT
Definition: winuser.h:912
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1044
#define ZeroMemory
Definition: winbase.h:1664
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
VOID SetProgress(ULONG ulProgress, ULONG ulProgressMax)
Definition: loaddlg.cpp:136
void __cdecl Format(UINT nFormatID,...)
Definition: cstringt.h:716
#define PBM_SETPOS
Definition: commctrl.h:2184
static ATL::CSimpleArray< DownloadInfo > AppsDownloadList
Definition: loaddlg.cpp:362
BOOL WINAPI InternetCloseHandle(HINTERNET hInternet)
Definition: internet.c:1414
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
BOOL WINAPI InternetCanonicalizeUrlW(LPCWSTR lpszUrl, LPWSTR lpszBuffer, LPDWORD lpdwBufferLength, DWORD dwFlags)
Definition: internet.c:2004
#define IDS_STATUS_DOWNLOADING
Definition: resource.h:198
BOOL WINAPI SetWindowTextW(_In_ HWND, _In_opt_ LPCWSTR)
UINT_PTR WPARAM
Definition: windef.h:207
void EndPaint(LPPAINTSTRUCT lpPaint)
Definition: atlwin.h:495
#define WS_CHILD
Definition: pedump.c:617
#define IDS_STATUS_INSTALLING
Definition: resource.h:199
LONG left
Definition: windef.h:306
#define FILE_SHARE_WRITE
Definition: nt_native.h:681
#define IDS_UNABLE_TO_DOWNLOAD
Definition: resource.h:109
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
int32_t INT_PTR
Definition: typedefs.h:64
_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)
DWORD WINAPI FormatMessageW(DWORD dwFlags, LPCVOID lpSource, DWORD dwMessageId, DWORD dwLanguageId, LPWSTR lpBuffer, DWORD nSize, __ms_va_list *args)
Definition: format_msg.c:583
LONG right
Definition: windef.h:308
#define DT_NOPREFIX
Definition: winuser.h:537
int GetSize() const
Definition: atlsimpcoll.h:104
BOOL WINAPI DestroyWindow(_In_ HWND)
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
#define INTERNET_FLAG_DONT_CACHE
Definition: wininet.h:67
DownloadInfo(const CAvailableApplicationInfo &AppInfo)
Definition: loaddlg.cpp:86
int32_t INT
Definition: typedefs.h:58
DWORD WINAPI GetSysColor(_In_ int)
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
WPARAM wParam
Definition: combotst.c:138
LRESULT DefWindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: atlwin.h:1546
#define FILE_SHARE_READ
Definition: compat.h:136
#define COLOR_3DSHADOW
Definition: winuser.h:921
BOOL WINAPI PathAppendW(LPWSTR lpszPath, LPCWSTR lpszAppend)
Definition: path.c:121
#define ICON_SMALL
Definition: tnclass.cpp:48
#define IDC_DOWNLOAD_STATUS
Definition: resource.h:42
WCHAR szDownloadDir[MAX_PATH]
Definition: settings.h:10
BOOL WINAPI SetDlgItemTextW(_In_ HWND, _In_ int, _In_ LPCWSTR)
#define LVIF_TEXT
Definition: commctrl.h:2309
#define LVCF_SUBITEM
Definition: commctrl.h:2589
ATL::CStringW szSHA1
Definition: loaddlg.cpp:98
HINTERNET WINAPI InternetOpenUrlW(HINTERNET hInternet, LPCWSTR lpszUrl, LPCWSTR lpszHeaders, DWORD dwHeadersLength, DWORD dwFlags, DWORD_PTR dwContext)
Definition: internet.c:3722
int WINAPI MessageBoxA(_In_opt_ HWND, _In_opt_ LPCSTR, _In_opt_ LPCSTR, _In_ UINT)
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define PBM_SETRANGE
Definition: commctrl.h:2183
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
DownloadParam(HWND dlg, const ATL::CSimpleArray< DownloadInfo > &info, LPCWSTR caption)
Definition: loaddlg.cpp:105
DownloadType DLType
Definition: loaddlg.cpp:95
VOID MessageBox_LoadString(HWND hMainWnd, INT StringID)
Definition: loaddlg.cpp:350
BOOL SubclassWindow(HWND hWnd)
Definition: atlwin.h:1486
DWORD dwSchemeLength
Definition: wininet.h:213
BOOL SetItemText(int i, int subItem, LPCWSTR text)
Definition: rosctrls.h:186
#define FALSE
Definition: types.h:117
#define MB_YESNO
Definition: winuser.h:811
DWORD WINAPI FtpGetFileSize(HINTERNET hFile, LPDWORD lpdwFileSizeHigh)
Definition: ftp.c:1757
LPWSTR WINAPI PathAddBackslashW(LPWSTR lpszPath)
Definition: path.c:289
unsigned int BOOL
Definition: ntddk_ex.h:94
ATL::CStringW szUrl
Definition: loaddlg.cpp:96
DWORD WINAPI GetFileAttributesW(LPCWSTR lpFileName)
Definition: fileinfo.c:652
if SUCCEEDED(hr)
#define GENERIC_WRITE
Definition: nt_native.h:90
BOOL GetClientRect(LPRECT lpRect) const
Definition: atlwin.h:507
static TAGREF LPCWSTR LPDWORD LPVOID lpBuffer
Definition: db.cpp:175
#define FORMAT_MESSAGE_ALLOCATE_BUFFER
Definition: winbase.h:416
#define IDS_INTEG_CHECK_FAIL
Definition: resource.h:113
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
Definition: delete.c:39
#define GWLP_USERDATA
Definition: treelist.c:63
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
LONG_PTR LPARAM
Definition: windef.h:208
static const WCHAR szProgress[]
Definition: dialog.c:138
BOOL WINAPI InternetQueryOptionA(HINTERNET hInternet, DWORD dwOption, LPVOID lpBuffer, LPDWORD lpdwBufferLength)
Definition: internet.c:2730
static CDowloadingAppsListView DownloadsListView
Definition: loaddlg.cpp:363
BOOL WINAPI DECLSPEC_HOTPATCH ShellExecuteExW(LPSHELLEXECUTEINFOW sei)
Definition: shlexec.cpp:2263
ULONG SizeInBytes
Definition: loaddlg.cpp:99
BOOL UrlHasBeenCopied
Definition: loaddlg.cpp:486
#define DT_VCENTER
Definition: winuser.h:543
#define SW_SHOW
Definition: winuser.h:769
#define WM_SETTEXT
Definition: winuser.h:1599
#define FORMAT_MESSAGE_FROM_SYSTEM
Definition: winbase.h:420
VOID LoadList(ATL::CSimpleArray< DownloadInfo > arrInfo)
Definition: loaddlg.cpp:259
#define IDS_STATUS_FINISHED
Definition: resource.h:201
#define FORMAT_MESSAGE_FROM_HMODULE
Definition: winbase.h:419
#define DialogBoxW(i, t, p, f)
Definition: winuser.h:4374
#define ICU_ESCAPE
Definition: winhttp.h:48
Status
Definition: gdiplustypes.h:24
VOID SetDownloadStatus(INT ItemIndex, DownloadStatus Status)
Definition: loaddlg.cpp:267
#define GCLP_HICONSM
Definition: winuser.h:670
#define EVENTLOG_SUCCESS
Definition: winnt_old.h:2701
GLsizeiptr size
Definition: glext.h:5919
BOOL WriteLogMessage(WORD wType, DWORD dwEventID, LPCWSTR lpMsg)
Definition: misc.cpp:250
LPWSTR lpszScheme
Definition: wininet.h:212
SETTINGS_INFO SettingsInfo
Definition: winmain.cpp:20
int WINAPI MessageBoxW(_In_opt_ HWND, _In_opt_ LPCWSTR, _In_opt_ LPCWSTR, _In_ UINT)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
HDC BeginPaint(LPPAINTSTRUCT lpPaint)
Definition: atlwin.h:297
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:79
BOOL WINAPI CopyFileW(IN LPCWSTR lpExistingFileName, IN LPCWSTR lpNewFileName, IN BOOL bFailIfExists)
Definition: copy.c:439
_In_ WDFCOLLECTION _In_ ULONG Index
#define END_MSG_MAP()
Definition: atlwin.h:1848
uint64_t ULONGLONG
Definition: typedefs.h:67
#define _countof(array)
Definition: sndvol32.h:68
#define IDS_UNABLE_TO_QUERY_CERT
Definition: resource.h:111
#define WM_CLOSE
Definition: winuser.h:1603
INTERNET_SCHEME nScheme
Definition: wininet.h:214
GLfloat param
Definition: glext.h:5796
#define MAX_PATH
Definition: compat.h:34
#define WINAPI
Definition: msvc.h:6
PCXSTR GetString() const
Definition: atlsimpstr.h:361
#define IDS_STATUS_DOWNLOADED
Definition: resource.h:196
VOID SetMarquee(BOOL Enable)
Definition: loaddlg.cpp:126
#define LVS_SINGLESEL
Definition: commctrl.h:2266
LRESULT OnSetText(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: loaddlg.cpp:225
PVOID HANDLE
Definition: typedefs.h:73
unsigned long DWORD
Definition: ntddk_ex.h:95
#define ICU_NO_ENCODE
Definition: winhttp.h:290
#define HTTP_STATUS_OK
Definition: winhttp.h:240
_In_opt_ PFILE_OBJECT _In_opt_ PETHREAD Thread
Definition: fltkernel.h:2653
BOOL GetStorageDirectory(ATL::CStringW &lpDirectory)
Definition: misc.cpp:180
GLdouble GLdouble GLdouble GLdouble q
Definition: gl.h:2063
static INT_PTR CALLBACK DownloadDlgProc(HWND Dlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: loaddlg.cpp:396
#define INVALID_FILE_ATTRIBUTES
Definition: vfdcmd.c:23
#define IDS_UNABLE_TO_DOWNLOAD2
Definition: resource.h:110
ATL::CStringW szName
Definition: loaddlg.cpp:97
GLbitfield flags
Definition: glext.h:7161
#define DEFAULT_GUI_FONT
Definition: wingdi.h:908
#define WM_PAINT
Definition: winuser.h:1602
#define IDC_DOWNLOAD_PROGRESS
Definition: resource.h:41
GLuint GLuint end
Definition: gl.h:1545
static VOID UpdateProgress(HWND hDlg, ULONG ulProgress, ULONG ulProgressMax, ULONG ulStatusCode, LPCWSTR szStatusText)
Definition: loaddlg.cpp:488
#define INTERNET_OPEN_TYPE_DIRECT
Definition: wininet.h:522
HWND hMainWnd
Definition: magnifier.c:32
BOOL WINAPI HttpQueryInfoW(HINTERNET hHttpRequest, DWORD dwInfoLevel, LPVOID lpBuffer, LPDWORD lpdwBufferLength, LPDWORD lpdwIndex)
Definition: http.c:3870
#define IDS_INTEG_CHECK_TITLE
Definition: resource.h:112
int InsertItem(const LV_ITEM *pitem)
Definition: rosctrls.h:96
static const WCHAR L[]
Definition: oid.c:1250
BOOL DownloadListOfApplications(const ATL::CSimpleArray< CAvailableApplicationInfo > &AppsList, BOOL bIsModal)
Definition: loaddlg.cpp:1016
#define GCLP_HICON
Definition: winuser.h:669
#define MB_ICONERROR
Definition: winuser.h:781
#define CreateDialogW(h, n, w, f)
Definition: winuser.h:4256
GLenum GLsizei len
Definition: glext.h:6722
VOID DownloadApplicationsDB(LPCWSTR lpUrl, BOOL IsOfficial)
Definition: loaddlg.cpp:1042
#define WM_COMMAND
Definition: winuser.h:1722
#define wcsrchr
Definition: compat.h:16
_In_ HANDLE hFile
Definition: mswsock.h:90
#define IDS_DL_DIALOG_DB_UNOFFICIAL_DOWNLOAD_DISP
Definition: resource.h:219
#define SelectFont(hdc, hfont)
Definition: windowsx.h:491
#define HTTP_QUERY_STATUS_CODE
Definition: wininet.h:1542
TCHAR szAppName[128]
Definition: solitaire.cpp:17
LRESULT OnPaint(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: loaddlg.cpp:180
#define IDS_STATUS_WAITING
Definition: resource.h:200
#define FORMAT_MESSAGE_IGNORE_INSERTS
Definition: winbase.h:417
static HDC hDC
Definition: 3dtext.c:33
ULONG_PTR SIZE_T
Definition: typedefs.h:80
int Replace(PCXSTR pszOld, PCXSTR pszNew)
Definition: cstringt.h:774
#define INTERNET_FLAG_PASSIVE
Definition: wininet.h:65
#define DT_SINGLELINE
Definition: winuser.h:540
#define INTERNET_FLAG_PRAGMA_NOCACHE
Definition: wininet.h:85
#define LVCF_FMT
Definition: commctrl.h:2586
#define CREATE_ALWAYS
Definition: disk.h:72
WCHAR szProxyServer[MAX_PATH]
Definition: settings.h:20
HINSTANCE hInst
Definition: dxdiag.c:13
DWORD dwStatus
Definition: mediaobj.idl:95
PRTL_UNICODE_STRING_BUFFER Path
#define WS_EX_CLIENTEDGE
Definition: winuser.h:384
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
#define INTERNET_OPEN_TYPE_PRECONFIG
Definition: wininet.h:521
int WINAPI GetWindowTextW(HWND hWnd, LPWSTR lpString, int nMaxCount)
Definition: window.c:1412
BOOL WINAPI DeleteDC(_In_ HDC)
#define INTERNET_OPTION_SECURITY_FLAGS
Definition: wininet.h:725
HWND Create(HWND hwndParent)
Definition: loaddlg.cpp:245
BOOL ModifyStyle(DWORD dwRemove, DWORD dwAdd, UINT nFlags=0)
Definition: atlwin.h:943
BOOL AddItem(INT ItemIndex, LPWSTR lpText)
Definition: loaddlg.cpp:273
LPCWSTR lpParameters
Definition: shellapi.h:331
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1577
BOOL WINAPI InternetReadFile(HINTERNET hFile, LPVOID lpBuffer, DWORD dwNumOfBytesToRead, LPDWORD pdwNumOfBytesRead)
Definition: internet.c:2154
ATL::CStringW m_szProgressText
Definition: loaddlg.cpp:119
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
Definition: window.h:371
#define SetWindowText
Definition: winuser.h:5832
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
#define MB_OK
Definition: winuser.h:784
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define HTTP_QUERY_FLAG_NUMBER
Definition: wininet.h:1606
BOOL bDelInstaller
Definition: settings.h:11
_In_ WDFCOLLECTION _In_ WDFOBJECT Item
#define BEGIN_MSG_MAP(theClass)
Definition: atlwin.h:1829
#define DPRINT1
Definition: precomp.h:8
#define CreateFileW
Definition: compat.h:600
Definition: misc.h:63
#define MESSAGE_HANDLER(msg, func)
Definition: atlwin.h:1857
static VOID Add(DownloadInfo info)
Definition: loaddlg.cpp:384
BOOL WINAPI InternetCrackUrlW(const WCHAR *lpszUrl, DWORD dwUrlLength, DWORD dwFlags, URL_COMPONENTSW *lpUC)
Definition: internet.c:1625
#define IDS_UNABLE_PATH
Definition: resource.h:121
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
static const WCHAR szName[]
Definition: msipriv.h:1194
ATL::CStringW LoadStatusString(DownloadStatus StatusParam)
Definition: loaddlg.cpp:76
#define APPLICATION_DATABASE_NAME
Definition: defines.h:33
HICON hIconSm
Definition: msconfig.c:44
LRESULT SendMessage(UINT message, WPARAM wParam=0, LPARAM lParam=0)
Definition: atlwin.h:1051
unsigned int ULONG
Definition: retypes.h:1
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
Definition: loader.c:838
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
LONG bottom
Definition: windef.h:309
#define DT_CENTER
Definition: winuser.h:527
int InsertColumn(int iCol, LV_COLUMN *pcol)
Definition: rosctrls.h:52
WCHAR szNoProxyFor[MAX_PATH]
Definition: settings.h:21
#define malloc
Definition: debug_ros.c:4
#define SECURITY_FLAG_SECURE
Definition: winhttp.h:285
#define LVS_NOSORTHEADER
Definition: commctrl.h:2285
#define SetWindowLongPtrW
Definition: winuser.h:5321
static HBITMAP
Definition: button.c:44
#define ICU_DECODE
Definition: winhttp.h:291
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define WM_ERASEBKGND
Definition: winuser.h:1607
VOID AddRow(INT RowIndex, LPCWSTR szAppName, const DownloadStatus Status)
Definition: loaddlg.cpp:286
ATL::CSimpleArray< DownloadInfo > AppInfo
Definition: loaddlg.cpp:111
GLfloat GLfloat p
Definition: glext.h:8902
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define IDCANCEL
Definition: winuser.h:825
#define LVIF_STATE
Definition: commctrl.h:2312
LONG_PTR LRESULT
Definition: windef.h:209
#define INFINITE
Definition: serial.h:102
HINTERNET WINAPI InternetOpenW(LPCWSTR lpszAgent, DWORD dwAccessType, LPCWSTR lpszProxy, LPCWSTR lpszProxyBypass, DWORD dwFlags)
Definition: internet.c:979
Arabic default style
Definition: afstyles.h:93
#define WS_VISIBLE
Definition: pedump.c:620
#define memset(x, y, z)
Definition: compat.h:39
BOOL AddColumn(INT Index, INT Width, INT Format)
Definition: loaddlg.cpp:294
static BOOL bModal
Definition: loaddlg.cpp:366
#define WM_INITDIALOG
Definition: winuser.h:1721
LPARAM lParam
Definition: combotst.c:139
#define GetClassLongPtrW
Definition: winuser.h:4539
#define SRCCOPY
Definition: wingdi.h:332
HDC hdcMem
Definition: welcome.c:104
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 LANG_USER_DEFAULT
Definition: tnerror.cpp:50
#define ICON_BIG
Definition: tnclass.cpp:51
static CDownloaderProgress ProgressBar
Definition: loaddlg.cpp:364
#define INTERNET_FLAG_KEEP_CONNECTION
Definition: wininet.h:72
ACPI_BUFFER *RetBuffer ACPI_BUFFER *RetBuffer char ACPI_WALK_RESOURCE_CALLBACK void *Context ACPI_BUFFER *RetBuffer UINT16 ACPI_RESOURCE **ResourcePtr ACPI_GENERIC_ADDRESS *Reg UINT32 *ReturnValue UINT8 UINT8 *Slp_TypB ACPI_PHYSICAL_ADDRESS PhysicalAddress64 UINT32 UINT32 *TimeElapsed UINT32 ACPI_STATUS const char * Format
Definition: acpixf.h:1216
DownloadStatus
Definition: loaddlg.cpp:66