ReactOS  0.4.15-dev-318-g99b52df
loaddlg.cpp
Go to the documentation of this file.
1 /*
2  * PROJECT: ReactOS Applications Manager
3  * LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
4  * FILE: base/applications/rapps/loaddlg.cpp
5  * PURPOSE: Displaying a download dialog
6  * COPYRIGHT: Copyright 2001 John R. Sheets (for CodeWeavers)
7  * Copyright 2004 Mike McCormack (for CodeWeavers)
8  * Copyright 2005 Ge van Geldorp (gvg@reactos.org)
9  * Copyright 2009 Dmitry Chapyshev (dmitry@reactos.org)
10  * Copyright 2015 Ismael Ferreras Morezuelas (swyterzone+ros@gmail.com)
11  * Copyright 2017 Alexander Shaposhnikov (sanchaez@reactos.org)
12  */
13 
14  /*
15  * Based on Wine dlls/shdocvw/shdocvw_main.c
16  *
17  * This library is free software; you can redistribute it and/or
18  * modify it under the terms of the GNU Lesser General Public
19  * License as published by the Free Software Foundation; either
20  * version 2.1 of the License, or (at your option) any later version.
21  *
22  * This library is distributed in the hope that it will be useful,
23  * but WITHOUT ANY WARRANTY; without even the implied warranty of
24  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
25  * Lesser General Public License for more details.
26  *
27  * You should have received a copy of the GNU Lesser General Public
28  * License along with this library; if not, write to the Free Software
29  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
30  */
31 #include "rapps.h"
32 
33 #include <shlobj_undoc.h>
34 #include <shlguid_undoc.h>
35 
36 #include <atlbase.h>
37 #include <atlcom.h>
38 #include <atlwin.h>
39 #include <wininet.h>
40 #include <shellutils.h>
41 
42 #include <debug.h>
43 
44 #include <rosctrls.h>
45 #include <windowsx.h>
46 #include <process.h>
47 #undef SubclassWindow
48 
49 #include "rosui.h"
50 #include "dialogs.h"
51 #include "misc.h"
52 
53 #ifdef USE_CERT_PINNING
54 #define CERT_ISSUER_INFO "US\r\nLet's Encrypt\r\nLet's Encrypt Authority X3"
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  SendMessage(PBM_SETPOS, uiPercentage, 0);
154 
155  /* format total download size */
156  StrFormatByteSizeW(ulProgressMax, szProgressMax, _countof(szProgressMax));
157 
158  /* generate the text on progress bar */
159  ProgressText.Format(L"%u%% \x2014 %ls / %ls",
160  uiPercentage,
161  szProgress,
162  szProgressMax);
163  }
164  else
165  {
166  /* send the current progress to the progress bar */
167  SendMessage(PBM_SETPOS, 0, 0);
168 
169  /* total size is not known, display only current size */
170  ProgressText.Format(L"%ls...", szProgress);
171  }
172 
173  /* and finally display it */
174  SendMessage(WM_SETTEXT, 0, (LPARAM) ProgressText.GetString());
175  }
176 
178  {
179  PAINTSTRUCT ps;
180  HDC hDC = BeginPaint(&ps), hdcMem;
181  HBITMAP hbmMem;
182  HANDLE hOld;
183  RECT myRect;
184  UINT win_width, win_height;
185 
186  GetClientRect(&myRect);
187 
188  /* grab the progress bar rect size */
189  win_width = myRect.right - myRect.left;
190  win_height = myRect.bottom - myRect.top;
191 
192  /* create an off-screen DC for double-buffering */
194  hbmMem = CreateCompatibleBitmap(hDC, win_width, win_height);
195 
196  hOld = SelectObject(hdcMem, hbmMem);
197 
198  /* call the original draw code and redirect it to our memory buffer */
199  DefWindowProc(uMsg, (WPARAM) hdcMem, lParam);
200 
201  /* draw our nifty progress text over it */
204  &myRect,
208  1, 1);
209 
210  /* transfer the off-screen DC to the screen */
211  BitBlt(hDC, 0, 0, win_width, win_height, hdcMem, 0, 0, SRCCOPY);
212 
213  /* free the off-screen DC */
214  SelectObject(hdcMem, hOld);
215  DeleteObject(hbmMem);
216  DeleteDC(hdcMem);
217 
218  EndPaint(&ps);
219  return 0;
220  }
221 
223  {
224  if (lParam)
225  {
227  }
228  return 0;
229  }
230 
235  END_MSG_MAP()
236 };
237 
239  : public CListView
240 {
241 public:
243  {
244  RECT r = {10, 150, 320, 350};
247 
249 
250  AddColumn(0, 150, LVCFMT_LEFT);
251  AddColumn(1, 120, LVCFMT_LEFT);
252 
253  return hwnd;
254  }
255 
257  {
258  for (INT i = 0; i < arrInfo.GetSize(); ++i)
259  {
260  AddRow(i, arrInfo[i].szName.GetString(), DLSTATUS_WAITING);
261  }
262  }
263 
265  {
267  SetItemText(ItemIndex, 1, szBuffer.GetString());
268  }
269 
270  BOOL AddItem(INT ItemIndex, LPWSTR lpText)
271  {
272  LVITEMW Item;
273 
274  ZeroMemory(&Item, sizeof(Item));
275 
276  Item.mask = LVIF_TEXT | LVIF_STATE;
277  Item.pszText = lpText;
278  Item.iItem = ItemIndex;
279 
280  return InsertItem(&Item);
281  }
282 
284  {
286  AddItem(RowIndex,
287  const_cast<LPWSTR>(szAppName));
288  SetDownloadStatus(RowIndex, Status);
289  }
290 
292  {
293  LVCOLUMNW Column;
294  ZeroMemory(&Column, sizeof(Column));
295 
296  Column.mask = LVCF_FMT | LVCF_WIDTH | LVCF_SUBITEM;
297  Column.iSubItem = Index;
298  Column.cx = Width;
299  Column.fmt = Format;
300 
301  return (InsertColumn(Index, &Column) == -1) ? FALSE : TRUE;
302  }
303 };
304 
305 #ifdef USE_CERT_PINNING
306 typedef CHeapPtr<char, CLocalAllocator> CLocalPtr;
307 
308 static BOOL CertGetSubjectAndIssuer(HINTERNET hFile, CLocalPtr& subjectInfo, CLocalPtr& issuerInfo)
309 {
310  DWORD certInfoLength;
312  DWORD size, flags;
313 
314  size = sizeof(flags);
316  {
317  return FALSE;
318  }
319 
321  {
322  return FALSE;
323  }
324 
325  /* Despite what the header indicates, the implementation of INTERNET_CERTIFICATE_INFO is not Unicode-aware. */
326  certInfoLength = sizeof(certInfo);
329  &certInfo,
330  &certInfoLength))
331  {
332  return FALSE;
333  }
334 
335  subjectInfo.Attach(certInfo.lpszSubjectInfo);
336  issuerInfo.Attach(certInfo.lpszIssuerInfo);
337 
338  if (certInfo.lpszProtocolName)
339  LocalFree(certInfo.lpszProtocolName);
340  if (certInfo.lpszSignatureAlgName)
342  if (certInfo.lpszEncryptionAlgName)
344 
345  return certInfo.lpszSubjectInfo && certInfo.lpszIssuerInfo;
346 }
347 #endif
348 
350 {
351  ATL::CStringW szMsgText;
352  if (szMsgText.LoadStringW(StringID))
353  {
355  }
356 }
357 
358 // Download dialog (loaddlg.cpp)
360 {
364  static BOOL bCancelled;
365  static BOOL bModal;
366  static VOID UpdateProgress(HWND hDlg, ULONG ulProgress, ULONG ulProgressMax, ULONG ulStatusCode, LPCWSTR szStatusText);
367 public:
368  static VOID Add(DownloadInfo info);
369  static VOID Download(const DownloadInfo& DLInfo, BOOL bIsModal = FALSE);
371  static unsigned int WINAPI ThreadFunc(LPVOID Context);
373 };
374 
375 
376 // CDownloadManager
382 
384 {
386 }
387 
389 {
391  AppsToInstallList.Add(DLInfo);
392  LaunchDownloadDialog(bIsModal);
393 }
394 
396 {
397  static WCHAR szCaption[MAX_PATH];
398 
399  switch (uMsg)
400  {
401  case WM_INITDIALOG:
402  {
403  HICON hIconSm, hIconBg;
404  ATL::CStringW szTempCaption;
405 
406  bCancelled = FALSE;
407 
410 
411  if (hIconBg && hIconSm)
412  {
413  SendMessageW(Dlg, WM_SETICON, ICON_BIG, (LPARAM) hIconBg);
414  SendMessageW(Dlg, WM_SETICON, ICON_SMALL, (LPARAM) hIconSm);
415  }
416 
419  if (Item)
420  {
421  // initialize the default values for our nifty progress bar
422  // and subclass it so that it learns to print a status text
426  }
427 
428  // Add a ListView
429  HWND hListView = DownloadsListView.Create(Dlg);
430  if (!hListView)
431  {
432  return FALSE;
433  }
435 
436  // Get a dlg string for later use
437  GetWindowTextW(Dlg, szCaption, _countof(szCaption));
438 
439  // Hide a placeholder from displaying
440  szTempCaption = szCaption;
441  szTempCaption.Replace(L"%ls", L"");
442  SetWindowText(Dlg, szTempCaption.GetString());
443 
444  ShowWindow(Dlg, SW_SHOW);
445 
446  // Start download process
447  DownloadParam *param = new DownloadParam(Dlg, AppsToInstallList, szCaption);
448  unsigned int ThreadId;
449  HANDLE Thread = (HANDLE)_beginthreadex(NULL, 0, ThreadFunc, (void *) param, 0, &ThreadId);
450 
451  if (!Thread)
452  {
453  return FALSE;
454  }
455 
458  return TRUE;
459  }
460 
461  case WM_COMMAND:
462  if (wParam == IDCANCEL)
463  {
464  bCancelled = TRUE;
465  PostMessageW(Dlg, WM_CLOSE, 0, 0);
466  }
467  return FALSE;
468 
469  case WM_CLOSE:
471  {
472  ::EndDialog(Dlg, 0);
473  }
474  else
475  {
476  ::DestroyWindow(Dlg);
477  }
478  return TRUE;
479 
480  default:
481  return FALSE;
482  }
483 }
484 
486 
488  HWND hDlg,
489  ULONG ulProgress,
490  ULONG ulProgressMax,
491  ULONG ulStatusCode,
492  LPCWSTR szStatusText)
493 {
494  HWND Item;
495 
496  ProgressBar.SetProgress(ulProgress, ulProgressMax);
497 
498  Item = GetDlgItem(hDlg, IDC_DOWNLOAD_STATUS);
499  if (Item && szStatusText && wcslen(szStatusText) > 0 && UrlHasBeenCopied == FALSE)
500  {
501  SIZE_T len = wcslen(szStatusText) + 1;
503  DWORD dummyLen;
504 
505  /* beautify our url for display purposes */
506  if (!InternetCanonicalizeUrlW(szStatusText, buf.GetBuffer(len), &dummyLen, ICU_DECODE | ICU_NO_ENCODE))
507  {
508  /* just use the original */
509  buf.ReleaseBuffer();
510  buf = szStatusText;
511  }
512  else
513  {
514  buf.ReleaseBuffer();
515  }
516 
517  /* paste it into our dialog and don't do it again in this instance */
518  SendMessageW(Item, WM_SETTEXT, 0, (LPARAM) buf.GetString());
520  }
521 }
522 
524  HWND hWndOwner,
525  DWORD dwLastError)
526 {
527  LPWSTR lpMsg;
528 
532  NULL,
533  dwLastError,
535  (LPWSTR)&lpMsg,
536  0, NULL))
537  {
538  return;
539  }
540 
541  MessageBoxW(hWndOwner, lpMsg, NULL, MB_OK | MB_ICONERROR);
542  LocalFree(lpMsg);
543 }
544 
546 {
548  PWSTR p, q;
549 
550  HWND hDlg = static_cast<DownloadParam*>(param)->Dialog;
551  HWND Item;
552  INT iAppId;
553 
554  ULONG dwContentLen, dwBytesWritten, dwBytesRead, dwStatus;
555  ULONG dwCurrentBytesRead = 0;
556  ULONG dwStatusLen = sizeof(dwStatus);
557 
558  BOOL bTempfile = FALSE;
559 
560  HINTERNET hOpen = NULL;
561  HINTERNET hFile = NULL;
563 
564  unsigned char lpBuffer[4096];
565  LPCWSTR lpszAgent = L"RApps/1.0";
566  URL_COMPONENTSW urlComponents;
567  size_t urlLength, filenameLength;
568 
569  const ATL::CSimpleArray<DownloadInfo> &InfoArray = static_cast<DownloadParam*>(param)->AppInfo;
570  LPCWSTR szCaption = static_cast<DownloadParam*>(param)->szCaption;
571  ATL::CStringW szNewCaption;
572 
574 
575  if (InfoArray.GetSize() <= 0)
576  {
578  goto end;
579  }
580 
581  for (iAppId = 0; iAppId < InfoArray.GetSize(); ++iAppId)
582  {
583  // Reset progress bar
584  Item = GetDlgItem(hDlg, IDC_DOWNLOAD_PROGRESS);
585  if (Item)
586  {
590  }
591 
592  // is this URL an update package for RAPPS? if so store it in a different place
593  if (InfoArray[iAppId].DLType != DLTYPE_APPLICATION)
594  {
596  {
598  goto end;
599  }
600  }
601  else
602  {
604  }
605 
606  // Change caption to show the currently downloaded app
607  switch(InfoArray[iAppId].DLType)
608  {
609  case DLTYPE_APPLICATION:
610  szNewCaption.Format(szCaption, InfoArray[iAppId].szName.GetString());
611  break;
612  case DLTYPE_DBUPDATE:
613  szNewCaption.LoadStringW(IDS_DL_DIALOG_DB_DOWNLOAD_DISP);
614  break;
616  szNewCaption.LoadStringW(IDS_DL_DIALOG_DB_UNOFFICIAL_DOWNLOAD_DISP);
617  break;
618  }
619 
620 
621  SetWindowTextW(hDlg, szNewCaption.GetString());
622 
623  // build the path for the download
624  p = wcsrchr(InfoArray[iAppId].szUrl.GetString(), L'/');
625  q = wcsrchr(InfoArray[iAppId].szUrl.GetString(), L'?');
626 
627  // do we have a final slash separator?
628  if (!p)
629  {
631  goto end;
632  }
633 
634  // prepare the tentative length of the filename, maybe we've to remove part of it later on
635  filenameLength = wcslen(p) * sizeof(WCHAR);
636 
637  /* do we have query arguments in the target URL after the filename? account for them
638  (e.g. https://example.org/myfile.exe?no_adware_plz) */
639  if (q && q > p && (q - p) > 0)
640  filenameLength -= wcslen(q - 1) * sizeof(WCHAR);
641 
642  // is the path valid? can we access it?
643  if (GetFileAttributesW(Path.GetString()) == INVALID_FILE_ATTRIBUTES)
644  {
645  if (!CreateDirectoryW(Path.GetString(), NULL))
646  {
648  goto end;
649  }
650  }
651 
652  // append a \ to the provided file system path, and the filename portion from the URL after that
653  Path += L"\\";
654  Path += (LPWSTR) (p + 1);
655 
656  if ((InfoArray[iAppId].DLType == DLTYPE_APPLICATION) && InfoArray[iAppId].szSHA1[0] && GetFileAttributesW(Path.GetString()) != INVALID_FILE_ATTRIBUTES)
657  {
658  // only open it in case of total correctness
659  if (VerifyInteg(InfoArray[iAppId].szSHA1.GetString(), Path))
660  goto run;
661  }
662 
663  // Add the download URL
664  SetDlgItemTextW(hDlg, IDC_DOWNLOAD_STATUS, InfoArray[iAppId].szUrl.GetString());
665 
667 
668  // download it
670  bTempfile = TRUE;
671 
672  /* FIXME: this should just be using the system-wide proxy settings */
673  switch (SettingsInfo.Proxy)
674  {
675  case 0: // preconfig
676  default:
677  hOpen = InternetOpenW(lpszAgent, INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0);
678  break;
679  case 1: // direct (no proxy)
680  hOpen = InternetOpenW(lpszAgent, INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0);
681  break;
682  case 2: // use proxy
684  break;
685  }
686 
687  if (!hOpen)
688  {
690  goto end;
691  }
692 
693  dwStatusLen = sizeof(dwStatus);
694 
695  memset(&urlComponents, 0, sizeof(urlComponents));
696  urlComponents.dwStructSize = sizeof(urlComponents);
697 
698  urlLength = InfoArray[iAppId].szUrl.GetLength();
699  urlComponents.dwSchemeLength = urlLength + 1;
700  urlComponents.lpszScheme = (LPWSTR) malloc(urlComponents.dwSchemeLength * sizeof(WCHAR));
701 
702  if (!InternetCrackUrlW(InfoArray[iAppId].szUrl, urlLength + 1, ICU_DECODE | ICU_ESCAPE, &urlComponents))
703  {
705  goto end;
706  }
707 
708  dwContentLen = 0;
709 
710  if (urlComponents.nScheme == INTERNET_SCHEME_HTTP || urlComponents.nScheme == INTERNET_SCHEME_HTTPS)
711  {
712  hFile = InternetOpenUrlW(hOpen, InfoArray[iAppId].szUrl.GetString(), NULL, 0,
713  dwUrlConnectFlags,
714  0);
715  if (!hFile)
716  {
718  goto end;
719  }
720 
721  // query connection
723  {
725  goto end;
726  }
727 
728  if (dwStatus != HTTP_STATUS_OK)
729  {
731  goto end;
732  }
733 
734  // query content length
736  }
737  else if (urlComponents.nScheme == INTERNET_SCHEME_FTP)
738  {
739  // force passive mode on FTP
740  hFile = InternetOpenUrlW(hOpen, InfoArray[iAppId].szUrl.GetString(), NULL, 0,
741  dwUrlConnectFlags | INTERNET_FLAG_PASSIVE,
742  0);
743  if (!hFile)
744  {
746  goto end;
747  }
748 
749  dwContentLen = FtpGetFileSize(hFile, &dwStatus);
750  }
751 
752  if (!dwContentLen)
753  {
754  // Someone was nice enough to add this, let's use it
755  if (InfoArray[iAppId].SizeInBytes)
756  {
757  dwContentLen = InfoArray[iAppId].SizeInBytes;
758  }
759  else
760  {
761  // content-length is not known, enable marquee mode
763  }
764  }
765 
766  free(urlComponents.lpszScheme);
767 
768 #ifdef USE_CERT_PINNING
769  // are we using HTTPS to download the RAPPS update package? check if the certificate is original
770  if ((urlComponents.nScheme == INTERNET_SCHEME_HTTPS) &&
771  (InfoArray[iAppId].DLType == DLTYPE_DBUPDATE))
772  {
773  CLocalPtr subjectName, issuerName;
774  CStringW szMsgText;
775  bool bAskQuestion = false;
776  if (!CertGetSubjectAndIssuer(hFile, subjectName, issuerName))
777  {
778  szMsgText.LoadStringW(IDS_UNABLE_TO_QUERY_CERT);
779  bAskQuestion = true;
780  }
781  else
782  {
783  if (strcmp(subjectName, CERT_SUBJECT_INFO) ||
784  strcmp(issuerName, CERT_ISSUER_INFO))
785  {
786  szMsgText.Format(IDS_MISMATCH_CERT_INFO, (char*)subjectName, (const char*)issuerName);
787  bAskQuestion = true;
788  }
789  }
790 
791  if (bAskQuestion)
792  {
793  if (MessageBoxW(hMainWnd, szMsgText.GetString(), NULL, MB_YESNO | MB_ICONERROR) != IDYES)
794  {
795  goto end;
796  }
797  }
798  }
799 #endif
800 
802 
803  if (hOut == INVALID_HANDLE_VALUE)
804  {
806  goto end;
807  }
808 
809  dwCurrentBytesRead = 0;
810  do
811  {
812  if (!InternetReadFile(hFile, lpBuffer, _countof(lpBuffer), &dwBytesRead))
813  {
815  goto end;
816  }
817 
818  if (!WriteFile(hOut, &lpBuffer[0], dwBytesRead, &dwBytesWritten, NULL))
819  {
821  goto end;
822  }
823 
824  dwCurrentBytesRead += dwBytesRead;
825  UpdateProgress(hDlg, dwCurrentBytesRead, dwContentLen, 0, InfoArray[iAppId].szUrl.GetString());
826  } while (dwBytesRead && !bCancelled);
827 
828  CloseHandle(hOut);
829  hOut = INVALID_HANDLE_VALUE;
830 
831  if (bCancelled)
832  {
833  DPRINT1("Operation cancelled\n");
834  goto end;
835  }
836 
837  if (!dwContentLen)
838  {
839  // set progress bar to 100%
841 
842  dwContentLen = dwCurrentBytesRead;
843  UpdateProgress(hDlg, dwCurrentBytesRead, dwContentLen, 0, InfoArray[iAppId].szUrl.GetString());
844  }
845 
846  /* if this thing isn't a RAPPS update and it has a SHA-1 checksum
847  verify its integrity by using the native advapi32.A_SHA1 functions */
848  if ((InfoArray[iAppId].DLType == DLTYPE_APPLICATION) && InfoArray[iAppId].szSHA1[0] != 0)
849  {
850  ATL::CStringW szMsgText;
851 
852  // change a few strings in the download dialog to reflect the verification process
853  if (!szMsgText.LoadStringW(IDS_INTEG_CHECK_TITLE))
854  {
855  DPRINT1("Unable to load string\n");
856  goto end;
857  }
858 
859  SetWindowTextW(hDlg, szMsgText.GetString());
861 
862  // this may take a while, depending on the file size
863  if (!VerifyInteg(InfoArray[iAppId].szSHA1.GetString(), Path.GetString()))
864  {
865  if (!szMsgText.LoadStringW(IDS_INTEG_CHECK_FAIL))
866  {
867  DPRINT1("Unable to load string\n");
868  goto end;
869  }
870 
871  MessageBoxW(hDlg, szMsgText.GetString(), NULL, MB_OK | MB_ICONERROR);
872  goto end;
873  }
874  }
875 
876 run:
878 
879  // run it
880  if (InfoArray[iAppId].DLType == DLTYPE_APPLICATION)
881  {
882  SHELLEXECUTEINFOW shExInfo = {0};
883  shExInfo.cbSize = sizeof(shExInfo);
884  shExInfo.fMask = SEE_MASK_NOCLOSEPROCESS;
885  shExInfo.lpVerb = L"open";
886  shExInfo.lpFile = Path.GetString();
887  shExInfo.lpParameters = L"";
888  shExInfo.nShow = SW_SHOW;
889 
890  if (ShellExecuteExW(&shExInfo))
891  {
892  //reflect installation progress in the titlebar
893  //TODO: make a separate string with a placeholder to include app name?
895  SetWindowTextW(hDlg, szMsgText.GetString());
896 
898 
899  //TODO: issue an install operation separately so that the apps could be downloaded in the background
901  CloseHandle(shExInfo.hProcess);
902  }
903  else
904  {
906  }
907  }
908 
909 end:
910  if (hOut != INVALID_HANDLE_VALUE)
911  CloseHandle(hOut);
912 
914  InternetCloseHandle(hOpen);
915 
916  if (bTempfile)
917  {
918  if (bCancelled || (SettingsInfo.bDelInstaller && (InfoArray[iAppId].DLType == DLTYPE_APPLICATION)))
919  DeleteFileW(Path.GetString());
920  }
921 
923  }
924 
925  delete static_cast<DownloadParam*>(param);
926  SendMessageW(hDlg, WM_CLOSE, 0, 0);
927  return 0;
928 }
929 
930 //TODO: Reuse the dialog
932 {
933  CDownloadManager::bModal = bIsModal;
934  if (bIsModal)
935  {
938  hMainWnd,
940  }
941  else
942  {
945  hMainWnd,
947  }
948 }
949 // CDownloadManager
950 
951 
953 {
954  if (AppsList.GetSize() == 0)
955  return FALSE;
956 
957  // Initialize shared variables
958  for (INT i = 0; i < AppsList.GetSize(); ++i)
959  {
960  CDownloadManager::Add(AppsList[i]); // implicit conversion to DownloadInfo
961  }
962 
963  // Create a dialog and issue a download process
965 
966  return TRUE;
967 }
968 
970 {
971  if (!pAppInfo)
972  return FALSE;
973 
974  CDownloadManager::Download(*pAppInfo, bIsModal);
975  return TRUE;
976 }
977 
979 {
980  static DownloadInfo DatabaseDLInfo;
981  DatabaseDLInfo.szUrl = lpUrl;
982  DatabaseDLInfo.szName.LoadStringW(IDS_DL_DIALOG_DB_DISP);
983  DatabaseDLInfo.DLType = IsOfficial ? DLTYPE_DBUPDATE : DLTYPE_DBUPDATE_UNOFFICIAL;
984  CDownloadManager::Download(DatabaseDLInfo, TRUE);
985 }
986 
#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:2376
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:56
#define IDS_DL_DIALOG_DB_DOWNLOAD_DISP
Definition: resource.h:213
DownloadType
Definition: loaddlg.cpp:59
static HICON
Definition: imagelist.c:84
#define TRUE
Definition: types.h:120
#define CloseHandle
Definition: compat.h:407
BOOL DownloadApplication(CAvailableApplicationInfo *pAppInfo, BOOL bIsModal)
Definition: loaddlg.cpp:969
#define IDS_STATUS_INSTALLED
Definition: resource.h:189
#define PBS_MARQUEE
Definition: commctrl.h:2194
#define LVCF_WIDTH
Definition: commctrl.h:2583
BOOL VerifyInteg(LPCWSTR lpSHA1Hash, LPCWSTR lpFileName)
Definition: integrity.cpp:14
BOOL Add(const T &t)
Definition: atlsimpcoll.h:58
#define IDS_DL_DIALOG_DB_DISP
Definition: resource.h:212
#define IDYES
Definition: winuser.h:829
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
static VOID Download(const DownloadInfo &DLInfo, BOOL bIsModal=FALSE)
Definition: loaddlg.cpp:388
#define LVS_NOCOLUMNHEADER
Definition: commctrl.h:2280
DWORD dwStructSize
Definition: wininet.h:211
#define IDD_DOWNLOAD_DIALOG
Definition: resource.h:64
#define GetStockFont(i)
Definition: windowsx.h:283
#define LVS_SHOWSELALWAYS
Definition: commctrl.h:2263
HBITMAP WINAPI CreateCompatibleBitmap(_In_ HDC hdc, _In_ INT cx, _In_ INT cy)
#define PBM_SETMARQUEE
Definition: commctrl.h:2195
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define SEE_MASK_NOCLOSEPROCESS
Definition: shellapi.h:31
static BYTE subjectName[]
Definition: cert.c:63
uint16_t * PWSTR
Definition: typedefs.h:55
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define LVS_REPORT
Definition: commctrl.h:2258
static BOOL bCancelled
Definition: loaddlg.cpp:364
#define free
Definition: debug_ros.c:5
static unsigned int WINAPI ThreadFunc(LPVOID Context)
Definition: loaddlg.cpp:545
#define MAKELPARAM(l, h)
Definition: winuser.h:3983
#define IDS_MISMATCH_CERT_INFO
Definition: resource.h:118
#define INTERNET_OPTION_SECURITY_CERTIFICATE_STRUCT
Definition: wininet.h:726
_In_ ULONGLONG _In_ ULONGLONG _In_ BOOLEAN Enable
Definition: ntddpcm.h:140
static HDC
Definition: imagelist.c:92
#define CALLBACK
Definition: compat.h:27
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:2594
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1497
static VOID LaunchDownloadDialog(BOOL)
Definition: loaddlg.cpp:931
#define INVALID_HANDLE_VALUE
Definition: compat.h:400
#define COLOR_CAPTIONTEXT
Definition: winuser.h:912
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
#define ZeroMemory
Definition: winbase.h:1648
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
VOID SetProgress(ULONG ulProgress, ULONG ulProgressMax)
Definition: loaddlg.cpp:136
void __cdecl Format(UINT nFormatID,...)
Definition: cstringt.h:688
#define PBM_SETPOS
Definition: commctrl.h:2180
BOOL WINAPI InternetCloseHandle(HINTERNET hInternet)
Definition: internet.c:1436
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
BOOL WINAPI InternetCanonicalizeUrlW(LPCWSTR lpszUrl, LPWSTR lpszBuffer, LPDWORD lpdwBufferLength, DWORD dwFlags)
Definition: internet.c:2026
#define IDS_STATUS_DOWNLOADING
Definition: resource.h:193
BOOL WINAPI SetWindowTextW(_In_ HWND, _In_opt_ LPCWSTR)
UINT_PTR WPARAM
Definition: windef.h:207
GLuint GLuint end
Definition: gl.h:1545
void EndPaint(LPPAINTSTRUCT lpPaint)
Definition: atlwin.h:495
#define WS_CHILD
Definition: pedump.c:617
#define IDS_STATUS_INSTALLING
Definition: resource.h:194
LONG left
Definition: windef.h:306
#define FILE_SHARE_WRITE
Definition: nt_native.h:681
#define IDS_UNABLE_TO_DOWNLOAD
Definition: resource.h:107
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
int32_t INT_PTR
Definition: typedefs.h:63
_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
VOID ShowLastError(HWND hWndOwner, DWORD dwLastError)
Definition: loaddlg.cpp:523
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:57
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:1522
#define FILE_SHARE_READ
Definition: compat.h:125
#define COLOR_3DSHADOW
Definition: winuser.h:921
#define ICON_SMALL
Definition: tnclass.cpp:48
#define IDC_DOWNLOAD_STATUS
Definition: resource.h:41
WCHAR szDownloadDir[MAX_PATH]
Definition: winmain.h:11
BOOL WINAPI SetDlgItemTextW(_In_ HWND, _In_ int, _In_ LPCWSTR)
#define LVIF_TEXT
Definition: commctrl.h:2305
#define LVCF_SUBITEM
Definition: commctrl.h:2585
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:3605
#define PBM_SETRANGE
Definition: commctrl.h:2179
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:349
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
BOOL SubclassWindow(HWND hWnd)
Definition: atlwin.h:1483
DWORD dwSchemeLength
Definition: wininet.h:213
BOOL SetItemText(int i, int subItem, LPCWSTR text)
Definition: rosctrls.h:186
#define MB_YESNO
Definition: winuser.h:811
DWORD WINAPI FtpGetFileSize(HINTERNET hFile, LPDWORD lpdwFileSizeHigh)
Definition: ftp.c:1754
unsigned int BOOL
Definition: ntddk_ex.h:94
ATL::CStringW szUrl
Definition: loaddlg.cpp:96
DWORD WINAPI GetFileAttributesW(LPCWSTR lpFileName)
Definition: fileinfo.c:802
#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:173
#define FORMAT_MESSAGE_ALLOCATE_BUFFER
Definition: winbase.h:400
#define IDS_INTEG_CHECK_FAIL
Definition: resource.h:111
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 VOID NTAPI BitBlt(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Width, _In_ ULONG Height, _In_ PUCHAR Buffer, _In_ ULONG BitsPerPixel, _In_ ULONG Delta)
Definition: common.c:49
smooth NULL
Definition: ftsmooth.c:416
static HWND hwndParent
Definition: cryptui.c:300
SETTINGS_INFO SettingsInfo
Definition: winmain.cpp:18
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:2607
_Check_return_ _CRTIMP _CONST_RETURN wchar_t *__cdecl wcsrchr(_In_z_ const wchar_t *_Str, _In_ wchar_t _Ch)
static CDowloadingAppsListView DownloadsListView
Definition: loaddlg.cpp:362
BOOL WINAPI DECLSPEC_HOTPATCH ShellExecuteExW(LPSHELLEXECUTEINFOW sei)
Definition: shlexec.cpp:2263
ULONG SizeInBytes
Definition: loaddlg.cpp:99
BOOL UrlHasBeenCopied
Definition: loaddlg.cpp:485
#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:404
VOID LoadList(ATL::CSimpleArray< DownloadInfo > arrInfo)
Definition: loaddlg.cpp:256
#define IDS_STATUS_FINISHED
Definition: resource.h:196
#define DialogBoxW(i, t, p, f)
Definition: winuser.h:4374
#define ICU_ESCAPE
Definition: winhttp.h:48
VOID SetDownloadStatus(INT ItemIndex, DownloadStatus Status)
Definition: loaddlg.cpp:264
#define GCLP_HICONSM
Definition: winuser.h:670
GLsizeiptr size
Definition: glext.h:5919
LPWSTR lpszScheme
Definition: wininet.h:212
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
#define END_MSG_MAP()
Definition: atlwin.h:1799
uint64_t ULONGLONG
Definition: typedefs.h:66
#define _countof(array)
Definition: sndvol32.h:68
static const WCHAR szStatus[]
Definition: http.c:74
#define IDS_UNABLE_TO_QUERY_CERT
Definition: resource.h:109
LPWSTR pszText
Definition: commctrl.h:2361
#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:26
#define WINAPI
Definition: msvc.h:6
PCXSTR GetString() const
Definition: atlsimpstr.h:361
static const UCHAR Index[8]
Definition: usbohci.c:18
#define IDS_STATUS_DOWNLOADED
Definition: resource.h:191
VOID SetMarquee(BOOL Enable)
Definition: loaddlg.cpp:126
#define LVS_SINGLESEL
Definition: commctrl.h:2262
LRESULT OnSetText(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: loaddlg.cpp:222
PVOID HANDLE
Definition: typedefs.h:72
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:172
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:395
#define INVALID_FILE_ATTRIBUTES
Definition: vfdcmd.c:23
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
UINT mask
Definition: commctrl.h:2356
#define IDC_DOWNLOAD_PROGRESS
Definition: resource.h:40
static VOID UpdateProgress(HWND hDlg, ULONG ulProgress, ULONG ulProgressMax, ULONG ulStatusCode, LPCWSTR szStatusText)
Definition: loaddlg.cpp:487
#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:3883
#define IDS_INTEG_CHECK_TITLE
Definition: resource.h:110
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:952
#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:978
#define WM_COMMAND
Definition: winuser.h:1722
_In_ HANDLE hFile
Definition: mswsock.h:90
static ATL::CSimpleArray< DownloadInfo > AppsToInstallList
Definition: loaddlg.cpp:361
#define IDS_DL_DIALOG_DB_UNOFFICIAL_DOWNLOAD_DISP
Definition: resource.h:214
#define SelectFont(hdc, hfont)
Definition: windowsx.h:491
#define HTTP_QUERY_STATUS_CODE
Definition: wininet.h:1542
Status
Definition: gdiplustypes.h:24
TCHAR szAppName[128]
Definition: solitaire.cpp:16
LRESULT OnPaint(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: loaddlg.cpp:177
#define IDS_STATUS_WAITING
Definition: resource.h:195
#define FORMAT_MESSAGE_IGNORE_INSERTS
Definition: winbase.h:401
static HDC hDC
Definition: 3dtext.c:33
ULONG_PTR SIZE_T
Definition: typedefs.h:79
int Replace(PCXSTR pszOld, PCXSTR pszNew)
Definition: cstringt.h:746
#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:2582
#define CREATE_ALWAYS
Definition: disk.h:72
WCHAR szProxyServer[MAX_PATH]
Definition: winmain.h:21
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
#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:242
BOOL ModifyStyle(DWORD dwRemove, DWORD dwAdd, UINT nFlags=0)
Definition: atlwin.h:940
BOOL AddItem(INT ItemIndex, LPWSTR lpText)
Definition: loaddlg.cpp:270
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:2174
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 MB_OK
Definition: winuser.h:784
#define HTTP_QUERY_FLAG_NUMBER
Definition: wininet.h:1606
BOOL bDelInstaller
Definition: winmain.h:12
#define BEGIN_MSG_MAP(theClass)
Definition: atlwin.h:1780
#define DPRINT1
Definition: precomp.h:8
#define CreateFileW
Definition: compat.h:409
#define MESSAGE_HANDLER(msg, func)
Definition: atlwin.h:1808
static VOID Add(DownloadInfo info)
Definition: loaddlg.cpp:383
BOOL WINAPI InternetCrackUrlW(const WCHAR *lpszUrl, DWORD dwUrlLength, DWORD dwFlags, URL_COMPONENTSW *lpUC)
Definition: internet.c:1644
#define IDS_UNABLE_PATH
Definition: resource.h:119
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
HICON hIconSm
Definition: msconfig.c:44
LRESULT SendMessage(UINT message, WPARAM wParam=0, LPARAM lParam=0)
Definition: atlwin.h:1048
unsigned int ULONG
Definition: retypes.h:1
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: winmain.h:22
#define malloc
Definition: debug_ros.c:4
#define SECURITY_FLAG_SECURE
Definition: winhttp.h:285
#define LVS_NOSORTHEADER
Definition: commctrl.h:2281
#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:283
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:2308
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:1001
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:291
static BOOL bModal
Definition: loaddlg.cpp:365
#define WM_INITDIALOG
Definition: winuser.h:1721
LPARAM lParam
Definition: combotst.c:139
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define GetClassLongPtrW
Definition: winuser.h:4539
#define SRCCOPY
Definition: wingdi.h:332
HDC hdcMem
Definition: welcome.c:104
#define LANG_USER_DEFAULT
Definition: tnerror.cpp:50
#define ICON_BIG
Definition: tnclass.cpp:51
static CDownloaderProgress ProgressBar
Definition: loaddlg.cpp:363
#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