ReactOS  0.4.12-dev-714-gfaac916
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 <rosctrls.h>
43 #include <windowsx.h>
44 
45 #include "rosui.h"
46 #include "dialogs.h"
47 #include "misc.h"
48 
49 #ifdef USE_CERT_PINNING
50 #define CERT_ISSUER_INFO "US\r\nLet's Encrypt\r\nLet's Encrypt Authority X3"
51 #define CERT_SUBJECT_INFO "rapps.reactos.org"
52 #endif
53 
55 {
62 };
63 
65 {
66  ATL::CStringW szString;
67  szString.LoadStringW(StatusParam);
68  return szString;
69 }
70 
72 {
75  :szUrl(AppInfo.m_szUrlDownload), szName(AppInfo.m_szName), szSHA1(AppInfo.m_szSHA1)
76  {
77  }
78 
82 };
83 
85 {
88  : Dialog(dlg), AppInfo(info), szCaption(caption)
89  {
90  }
91 
95 };
96 
97 
99  public CComObjectRootEx<CComMultiThreadModelNoCS>,
100  public IBindStatusCallback
101 {
105 
106 public:
108  {
109  //DestroyWindow(m_hDialog);
110  }
111 
112  HRESULT Initialize(HWND Dlg, BOOL *pbCancelled)
113  {
114  m_hDialog = Dlg;
115  m_pbCancelled = pbCancelled;
117  return S_OK;
118  }
119 
122  IBinding *pib)
123  {
124  return S_OK;
125  }
126 
128  LONG *pnPriority)
129  {
130  return S_OK;
131  }
132 
134  DWORD reserved)
135  {
136  return S_OK;
137  }
138 
140  ULONG ulProgress,
141  ULONG ulProgressMax,
142  ULONG ulStatusCode,
143  LPCWSTR szStatusText)
144  {
145  HWND Item;
146  LONG r;
147 
149  if (Item)
150  {
151  WCHAR szProgress[100];
152 
153  /* format the bits and bytes into pretty and accessible units... */
155 
156  /* use our subclassed progress bar text subroutine */
157  ATL::CStringW m_ProgressText;
158 
159  if (ulProgressMax)
160  {
161  /* total size is known */
162  WCHAR szProgressMax[100];
163  UINT uiPercentage = ((ULONGLONG) ulProgress * 100) / ulProgressMax;
164 
165  /* send the current progress to the progress bar */
166  SendMessageW(Item, PBM_SETPOS, uiPercentage, 0);
167 
168  /* format total download size */
169  StrFormatByteSizeW(ulProgressMax, szProgressMax, _countof(szProgressMax));
170 
171  /* generate the text on progress bar */
172  m_ProgressText.Format(L"%u%% \x2014 %ls / %ls",
173  uiPercentage,
174  szProgress,
175  szProgressMax);
176  }
177  else
178  {
179  /* send the current progress to the progress bar */
180  SendMessageW(Item, PBM_SETPOS, 0, 0);
181 
182  /* total size is not known, display only current size */
183  m_ProgressText.Format(L"%ls...",
184  szProgress);
185  }
186  /* and finally display it */
187  SendMessageW(Item, WM_SETTEXT, 0, (LPARAM) m_ProgressText.GetString());
188  }
189 
191  if (Item && szStatusText && wcslen(szStatusText) > 0 && m_UrlHasBeenCopied == FALSE)
192  {
193  SIZE_T len = wcslen(szStatusText) + 1;
195  DWORD dummyLen;
196 
197  /* beautify our url for display purposes */
198  if (!InternetCanonicalizeUrlW(szStatusText, buf.GetBuffer(len), &dummyLen, ICU_DECODE | ICU_NO_ENCODE))
199  {
200  /* just use the original */
201  buf.ReleaseBuffer();
202  buf = szStatusText;
203  }
204  else
205  {
206  buf.ReleaseBuffer();
207  }
208 
209  /* paste it into our dialog and don't do it again in this instance */
210  SendMessageW(Item, WM_SETTEXT, 0, (LPARAM) buf.GetString());
212  }
213 
216  if (r || GetLastError() != ERROR_SUCCESS)
217  {
218  *m_pbCancelled = TRUE;
219  return E_ABORT;
220  }
221 
222  return S_OK;
223  }
224 
226  HRESULT hresult,
227  LPCWSTR szError)
228  {
229  return S_OK;
230  }
231 
233  DWORD *grfBINDF,
234  BINDINFO *pbindinfo)
235  {
236  return S_OK;
237  }
238 
240  DWORD grfBSCF,
241  DWORD dwSize,
242  FORMATETC *pformatetc,
243  STGMEDIUM *pstgmed)
244  {
245  return S_OK;
246  }
247 
249  REFIID riid,
250  IUnknown *punk)
251  {
252  return S_OK;
253  }
254 
256  COM_INTERFACE_ENTRY_IID(IID_IBindStatusCallback, IBindStatusCallback)
257  END_COM_MAP()
258 };
259 
261  : public CUiWindow<CListView>
262 {
263 public:
265  {
266  RECT r = {10, 150, 320, 350};
269 
271 
272  AddColumn(0, 150, LVCFMT_LEFT);
273  AddColumn(1, 120, LVCFMT_LEFT);
274 
275  return hwnd;
276  }
277 
279  {
280  for (INT i = 0; i < arrInfo.GetSize(); ++i)
281  {
282  AddRow(i, arrInfo[i].szName.GetString(), DLSTATUS_WAITING);
283  }
284  }
285 
287  {
290  ListView_SetItemText(hListView, ItemIndex, 1, const_cast<LPWSTR>(szBuffer.GetString()));
291  }
292 
293  BOOL AddItem(INT ItemIndex, LPWSTR lpText)
294  {
295  LVITEMW Item;
296 
297  ZeroMemory(&Item, sizeof(Item));
298 
299  Item.mask = LVIF_TEXT | LVIF_STATE;
300  Item.pszText = lpText;
301  Item.iItem = ItemIndex;
302 
303  return InsertItem(&Item);
304  }
305 
307  {
309  AddItem(RowIndex,
310  const_cast<LPWSTR>(szAppName));
311  SetDownloadStatus(RowIndex, Status);
312  }
313 
315  {
316  LVCOLUMNW Column;
317  ZeroMemory(&Column, sizeof(Column));
318 
319  Column.mask = LVCF_FMT | LVCF_WIDTH | LVCF_SUBITEM;
320  Column.iSubItem = Index;
321  Column.cx = Width;
322  Column.fmt = Format;
323 
324  return (InsertColumn(Index, &Column) == -1) ? FALSE : TRUE;
325  }
326 };
327 
328 extern "C"
330 {
331  return ShellObjectCreatorInit<CDownloadDialog>(Dlg, pbCancelled, riid, ppv);
332 }
333 
334 #ifdef USE_CERT_PINNING
335 typedef CHeapPtr<char, CLocalAllocator> CLocalPtr;
336 
337 static BOOL CertGetSubjectAndIssuer(HINTERNET hFile, CLocalPtr& subjectInfo, CLocalPtr& issuerInfo)
338 {
339  DWORD certInfoLength;
341  DWORD size, flags;
342 
343  size = sizeof(flags);
345  {
346  return FALSE;
347  }
348 
350  {
351  return FALSE;
352  }
353 
354  /* Despite what the header indicates, the implementation of INTERNET_CERTIFICATE_INFO is not Unicode-aware. */
355  certInfoLength = sizeof(certInfo);
358  &certInfo,
359  &certInfoLength))
360  {
361  return FALSE;
362  }
363 
364  subjectInfo.Attach(certInfo.lpszSubjectInfo);
365  issuerInfo.Attach(certInfo.lpszIssuerInfo);
366 
367  if (certInfo.lpszProtocolName)
368  LocalFree(certInfo.lpszProtocolName);
369  if (certInfo.lpszSignatureAlgName)
371  if (certInfo.lpszEncryptionAlgName)
373 
374  return certInfo.lpszSubjectInfo && certInfo.lpszIssuerInfo;
375 }
376 #endif
377 
379 {
380  ATL::CStringW szMsgText;
381  if (szMsgText.LoadStringW(StringID))
382  {
384  }
385 }
386 
387 // CDownloadManager
390 
392 {
394  AppsToInstallList.Add(DLInfo);
395  LaunchDownloadDialog(bIsModal);
396 }
397 
399 {
400  static WCHAR szCaption[MAX_PATH];
401 
402  switch (uMsg)
403  {
404  case WM_INITDIALOG:
405  {
406  HICON hIconSm, hIconBg;
407  ATL::CStringW szTempCaption;
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 
418  SetWindowLongW(Dlg, GWLP_USERDATA, 0);
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
424  SendMessageW(Item, PBM_SETRANGE, 0, MAKELPARAM(0, 100));
425  SendMessageW(Item, PBM_SETPOS, 0, 0);
426 
428  }
429 
430  // Add a ListView
432  if (!hListView)
433  {
434  return FALSE;
435  }
437 
438  // Get a dlg string for later use
439  GetWindowTextW(Dlg, szCaption, _countof(szCaption));
440 
441  // Hide a placeholder from displaying
442  szTempCaption = szCaption;
443  szTempCaption.Replace(L"%ls", L"");
444  SetWindowText(Dlg, szTempCaption.GetString());
445 
446  ShowWindow(Dlg, SW_SHOW);
447 
448  // Start download process
449  DownloadParam *param = new DownloadParam(Dlg, AppsToInstallList, szCaption);
450  DWORD ThreadId;
451  HANDLE Thread = CreateThread(NULL, 0, ThreadFunc, (LPVOID) param, 0, &ThreadId);
452 
453  if (!Thread)
454  {
455  return FALSE;
456  }
457 
460  return TRUE;
461  }
462 
463  case WM_COMMAND:
464  if (wParam == IDCANCEL)
465  {
466  SetWindowLongW(Dlg, GWLP_USERDATA, 1);
467  PostMessageW(Dlg, WM_CLOSE, 0, 0);
468  }
469  return FALSE;
470 
471  case WM_CLOSE:
472  EndDialog(Dlg, 0);
473  //DestroyWindow(Dlg);
474  return TRUE;
475 
476  default:
477  return FALSE;
478  }
479 }
480 
482  UINT uMsg,
483  WPARAM wParam,
484  LPARAM lParam,
487 {
488  static ATL::CStringW szProgressText;
489 
490  switch (uMsg)
491  {
492  case WM_SETTEXT:
493  {
494  if (lParam)
495  {
496  szProgressText = (PCWSTR) lParam;
497  }
498  return TRUE;
499  }
500 
501  case WM_ERASEBKGND:
502  case WM_PAINT:
503  {
504  PAINTSTRUCT ps;
505  HDC hDC = BeginPaint(hWnd, &ps), hdcMem;
506  HBITMAP hbmMem;
507  HANDLE hOld;
508  RECT myRect;
509  UINT win_width, win_height;
510 
511  GetClientRect(hWnd, &myRect);
512 
513  /* grab the progress bar rect size */
514  win_width = myRect.right - myRect.left;
515  win_height = myRect.bottom - myRect.top;
516 
517  /* create an off-screen DC for double-buffering */
519  hbmMem = CreateCompatibleBitmap(hDC, win_width, win_height);
520 
521  hOld = SelectObject(hdcMem, hbmMem);
522 
523  /* call the original draw code and redirect it to our memory buffer */
525 
526  /* draw our nifty progress text over it */
528  DrawShadowText(hdcMem, szProgressText.GetString(), szProgressText.GetLength(),
529  &myRect,
533  1, 1);
534 
535  /* transfer the off-screen DC to the screen */
536  BitBlt(hDC, 0, 0, win_width, win_height, hdcMem, 0, 0, SRCCOPY);
537 
538  /* free the off-screen DC */
539  SelectObject(hdcMem, hOld);
540  DeleteObject(hbmMem);
541  DeleteDC(hdcMem);
542 
543  EndPaint(hWnd, &ps);
544  return 0;
545  }
546 
547  /* Raymond Chen says that we should safely unsubclass all the things!
548  (http://blogs.msdn.com/b/oldnewthing/archive/2003/11/11/55653.aspx) */
549 
550  case WM_NCDESTROY:
551  {
552  szProgressText.Empty();
554  }
555  /* Fall-through */
556  default:
557  return DefSubclassProc(hWnd, uMsg, wParam, lParam);
558  }
559 }
560 
562 {
563  if (!Item)
564  return;
565 
567  if (!style)
568  return;
569 
571  return;
572 
574 }
575 
577 {
580  PWSTR p, q;
581 
582  HWND hDlg = static_cast<DownloadParam*>(param)->Dialog;
583  HWND Item;
584  INT iAppId;
585 
586  ULONG dwContentLen, dwBytesWritten, dwBytesRead, dwStatus;
587  ULONG dwCurrentBytesRead = 0;
588  ULONG dwStatusLen = sizeof(dwStatus);
589 
590  BOOL bCancelled = FALSE;
591  BOOL bTempfile = FALSE;
592  BOOL bCab = FALSE;
593 
594  HINTERNET hOpen = NULL;
595  HINTERNET hFile = NULL;
597 
598  unsigned char lpBuffer[4096];
599  LPCWSTR lpszAgent = L"RApps/1.0";
600  URL_COMPONENTS urlComponents;
601  size_t urlLength, filenameLength;
602 
603  const ATL::CSimpleArray<DownloadInfo> &InfoArray = static_cast<DownloadParam*>(param)->AppInfo;
604  LPCWSTR szCaption = static_cast<DownloadParam*>(param)->szCaption;
605  ATL::CStringW szNewCaption;
606 
608 
609  if (InfoArray.GetSize() <= 0)
610  {
612  goto end;
613  }
614 
615  for (iAppId = 0; iAppId < InfoArray.GetSize(); ++iAppId)
616  {
617  // Reset progress bar
618  Item = GetDlgItem(hDlg, IDC_DOWNLOAD_PROGRESS);
619  if (Item)
620  {
621  SetProgressMarquee(Item, FALSE);
622  SendMessageW(Item, WM_SETTEXT, 0, (LPARAM) L"");
623  SendMessageW(Item, PBM_SETPOS, 0, 0);
624  }
625 
626  // is this URL an update package for RAPPS? if so store it in a different place
627  if (InfoArray[iAppId].szUrl == APPLICATION_DATABASE_URL)
628  {
629  bCab = TRUE;
631  goto end;
632  }
633  else
634  {
635  bCab = FALSE;
637  }
638 
639  // Change caption to show the currently downloaded app
640  if (!bCab)
641  {
642  szNewCaption.Format(szCaption, InfoArray[iAppId].szName.GetString());
643  }
644  else
645  {
646  szNewCaption.LoadStringW(IDS_DL_DIALOG_DB_DOWNLOAD_DISP);
647  }
648 
649  SetWindowTextW(hDlg, szNewCaption.GetString());
650 
651  // build the path for the download
652  p = wcsrchr(InfoArray[iAppId].szUrl.GetString(), L'/');
653  q = wcsrchr(InfoArray[iAppId].szUrl.GetString(), L'?');
654 
655  // do we have a final slash separator?
656  if (!p)
657  goto end;
658 
659  // prepare the tentative length of the filename, maybe we've to remove part of it later on
660  filenameLength = wcslen(p) * sizeof(WCHAR);
661 
662  /* do we have query arguments in the target URL after the filename? account for them
663  (e.g. https://example.org/myfile.exe?no_adware_plz) */
664  if (q && q > p && (q - p) > 0)
665  filenameLength -= wcslen(q - 1) * sizeof(WCHAR);
666 
667  // is the path valid? can we access it?
668  if (GetFileAttributesW(Path.GetString()) == INVALID_FILE_ATTRIBUTES)
669  {
670  if (!CreateDirectoryW(Path.GetString(), NULL))
671  goto end;
672  }
673 
674  // append a \ to the provided file system path, and the filename portion from the URL after that
675  Path += L"\\";
676  Path += (LPWSTR) (p + 1);
677 
678  if (!bCab && InfoArray[iAppId].szSHA1[0] && GetFileAttributesW(Path.GetString()) != INVALID_FILE_ATTRIBUTES)
679  {
680  // only open it in case of total correctness
681  if (VerifyInteg(InfoArray[iAppId].szSHA1.GetString(), Path))
682  goto run;
683  }
684 
685  // Add the download URL
686  SetDlgItemTextW(hDlg, IDC_DOWNLOAD_STATUS, InfoArray[iAppId].szUrl.GetString());
687 
689 
690  // download it
691  bTempfile = TRUE;
693 
694  if (dl == NULL)
695  goto end;
696 
697  /* FIXME: this should just be using the system-wide proxy settings */
698  switch (SettingsInfo.Proxy)
699  {
700  case 0: // preconfig
701  default:
702  hOpen = InternetOpenW(lpszAgent, INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0);
703  break;
704  case 1: // direct (no proxy)
705  hOpen = InternetOpenW(lpszAgent, INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0);
706  break;
707  case 2: // use proxy
709  break;
710  }
711 
712  if (!hOpen)
713  goto end;
714 
715  dwStatusLen = sizeof(dwStatus);
716 
717  memset(&urlComponents, 0, sizeof(urlComponents));
718  urlComponents.dwStructSize = sizeof(urlComponents);
719 
720  urlLength = InfoArray[iAppId].szUrl.GetLength();
721  urlComponents.dwSchemeLength = urlLength + 1;
722  urlComponents.lpszScheme = (LPWSTR) malloc(urlComponents.dwSchemeLength * sizeof(WCHAR));
723  urlComponents.dwHostNameLength = urlLength + 1;
724  urlComponents.lpszHostName = (LPWSTR) malloc(urlComponents.dwHostNameLength * sizeof(WCHAR));
725 
726  if (!InternetCrackUrlW(InfoArray[iAppId].szUrl, urlLength + 1, ICU_DECODE | ICU_ESCAPE, &urlComponents))
727  goto end;
728 
729  dwContentLen = 0;
730 
731  if (urlComponents.nScheme == INTERNET_SCHEME_HTTP || urlComponents.nScheme == INTERNET_SCHEME_HTTPS)
732  {
733  hFile = InternetOpenUrlW(hOpen, InfoArray[iAppId].szUrl.GetString(), NULL, 0,
734  dwUrlConnectFlags,
735  0);
736  if (!hFile)
737  {
739  goto end;
740  }
741 
742  // query connection
744  goto end;
745 
746  if (dwStatus != HTTP_STATUS_OK)
747  {
749  goto end;
750  }
751 
752  // query content length
754  }
755 
756  if (urlComponents.nScheme == INTERNET_SCHEME_FTP)
757  {
758  // force passive mode on FTP
759  hFile = InternetOpenUrlW(hOpen, InfoArray[iAppId].szUrl.GetString(), NULL, 0,
760  dwUrlConnectFlags | INTERNET_FLAG_PASSIVE,
761  0);
762  if (!hFile)
763  {
765  goto end;
766  }
767 
768  dwContentLen = FtpGetFileSize(hFile, &dwStatus);
769  }
770 
771  if (!dwContentLen)
772  {
773  // content-length is not known, enable marquee mode
774  SetProgressMarquee(Item, TRUE);
775  }
776 
777  free(urlComponents.lpszScheme);
778  free(urlComponents.lpszHostName);
779 
780 #ifdef USE_CERT_PINNING
781  // are we using HTTPS to download the RAPPS update package? check if the certificate is original
782  if ((urlComponents.nScheme == INTERNET_SCHEME_HTTPS) &&
783  (wcscmp(InfoArray[iAppId].szUrl, APPLICATION_DATABASE_URL) == 0))
784  {
785  CLocalPtr subjectName, issuerName;
786  CStringW szMsgText;
787  bool bAskQuestion = false;
788  if (!CertGetSubjectAndIssuer(hFile, subjectName, issuerName))
789  {
790  szMsgText.LoadStringW(IDS_UNABLE_TO_QUERY_CERT);
791  bAskQuestion = true;
792  }
793  else
794  {
795  if (strcmp(subjectName, CERT_SUBJECT_INFO) ||
796  strcmp(issuerName, CERT_ISSUER_INFO))
797  {
798  szMsgText.Format(IDS_MISMATCH_CERT_INFO, (char*)subjectName, (const char*)issuerName);
799  bAskQuestion = true;
800  }
801  }
802 
803  if (bAskQuestion)
804  {
805  if (MessageBoxW(hMainWnd, szMsgText.GetString(), NULL, MB_YESNO | MB_ICONERROR) != IDYES)
806  {
807  goto end;
808  }
809  }
810  }
811 #endif
812 
814 
815  if (hOut == INVALID_HANDLE_VALUE)
816  goto end;
817 
818  dwCurrentBytesRead = 0;
819  do
820  {
821  if (!InternetReadFile(hFile, lpBuffer, _countof(lpBuffer), &dwBytesRead))
822  {
824  goto end;
825  }
826 
827  if (!WriteFile(hOut, &lpBuffer[0], dwBytesRead, &dwBytesWritten, NULL))
828  {
830  goto end;
831  }
832 
833  dwCurrentBytesRead += dwBytesRead;
834  dl->OnProgress(dwCurrentBytesRead, dwContentLen, 0, InfoArray[iAppId].szUrl.GetString());
835  } while (dwBytesRead && !bCancelled);
836 
837  CloseHandle(hOut);
838  hOut = INVALID_HANDLE_VALUE;
839 
840  if (bCancelled)
841  goto end;
842 
843  if (!dwContentLen)
844  {
845  // set progress bar to 100%
846  SetProgressMarquee(Item, FALSE);
847 
848  dwContentLen = dwCurrentBytesRead;
849  dl->OnProgress(dwCurrentBytesRead, dwContentLen, 0, InfoArray[iAppId].szUrl.GetString());
850  }
851 
852  /* if this thing isn't a RAPPS update and it has a SHA-1 checksum
853  verify its integrity by using the native advapi32.A_SHA1 functions */
854  if (!bCab && InfoArray[iAppId].szSHA1[0] != 0)
855  {
856  ATL::CStringW szMsgText;
857 
858  // change a few strings in the download dialog to reflect the verification process
859  if (!szMsgText.LoadStringW(IDS_INTEG_CHECK_TITLE))
860  goto end;
861 
862  SetWindowTextW(hDlg, szMsgText.GetString());
864 
865  // this may take a while, depending on the file size
866  if (!VerifyInteg(InfoArray[iAppId].szSHA1.GetString(), Path.GetString()))
867  {
868  if (!szMsgText.LoadStringW(IDS_INTEG_CHECK_FAIL))
869  goto end;
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 (!bCab)
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 && !bCab))
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 
931 {
932  if (AppsList.GetSize() == 0)
933  return FALSE;
934 
935  // Initialize shared variables
936  for (INT i = 0; i < AppsList.GetSize(); ++i)
937  {
938  AppsToInstallList.Add(AppsList[i]); // implicit conversion to DownloadInfo
939  }
940 
941  // Create a dialog and issue a download process
942  LaunchDownloadDialog(bIsModal);
943 
944  return TRUE;
945 }
946 
948 {
949  if (!pAppInfo)
950  return FALSE;
951 
952  Download(*pAppInfo, bIsModal);
953  return TRUE;
954 }
955 
957 {
958  static DownloadInfo DatabaseDLInfo;
959  DatabaseDLInfo.szUrl = lpUrl;
960  DatabaseDLInfo.szName.LoadStringW(IDS_DL_DIALOG_DB_DISP);
961  Download(DatabaseDLInfo, TRUE);
962 }
963 
964 //TODO: Reuse the dialog
966 {
967  if (bIsModal)
968  {
971  hMainWnd,
973  }
974  else
975  {
978  hMainWnd,
980  }
981 }
982 // CDownloadManager
#define HTTP_QUERY_CONTENT_LENGTH
Definition: wininet.h:1528
int GetLength() const
Definition: atlsimpstr.h:356
static LRESULT CALLBACK DownloadProgressProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, UINT_PTR uIdSubclass, DWORD_PTR dwRefData)
Definition: loaddlg.cpp:481
HRESULT Initialize(HWND Dlg, BOOL *pbCancelled)
Definition: loaddlg.cpp:112
BOOL WINAPI CreateDirectoryW(IN LPCWSTR lpPathName, IN LPSECURITY_ATTRIBUTES lpSecurityAttributes)
Definition: dir.c:90
#define HDC
Definition: msvc.h:22
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:55
DWORD dwHostNameLength
Definition: winhttp.h:470
#define IDS_DL_DIALOG_DB_DOWNLOAD_DISP
Definition: resource.h:205
static HICON
Definition: imagelist.c:84
#define REFIID
Definition: guiddef.h:113
#define TRUE
Definition: types.h:120
#define CloseHandle
Definition: compat.h:398
#define APPLICATION_DATABASE_URL
Definition: defines.h:32
#define IDS_STATUS_INSTALLED
Definition: resource.h:181
HRESULT WINAPI CDownloadDialog_Constructor(HWND Dlg, BOOL *pbCancelled, REFIID riid, LPVOID *ppv)
Definition: loaddlg.cpp:329
#define PBS_MARQUEE
Definition: commctrl.h:2170
#define LVCF_WIDTH
Definition: commctrl.h:2559
BOOL VerifyInteg(LPCWSTR lpSHA1Hash, LPCWSTR lpFileName)
Definition: integrity.cpp:14
#define HBITMAP
Definition: msvc.h:28
BOOL Add(const T &t)
Definition: atlsimpcoll.h:58
#define ERROR_SUCCESS
Definition: deptool.c:10
#define IDS_DL_DIALOG_DB_DISP
Definition: resource.h:204
#define IDYES
Definition: winuser.h:829
static VOID Download(const DownloadInfo &DLInfo, BOOL bIsModal=FALSE)
Definition: loaddlg.cpp:391
#define LVS_NOCOLUMNHEADER
Definition: commctrl.h:2256
#define IDD_DOWNLOAD_DIALOG
Definition: resource.h:60
#define GetStockFont(i)
Definition: windowsx.h:283
#define LVS_SHOWSELALWAYS
Definition: commctrl.h:2239
HBITMAP WINAPI CreateCompatibleBitmap(_In_ HDC hdc, _In_ INT cx, _In_ INT cy)
#define PBM_SETMARQUEE
Definition: commctrl.h:2171
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define SEE_MASK_NOCLOSEPROCESS
Definition: shellapi.h:31
__wchar_t WCHAR
Definition: xmlstorage.h:180
REFIID riid
Definition: precomp.h:44
static BYTE subjectName[]
Definition: cert.c:63
uint16_t * PWSTR
Definition: typedefs.h:54
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define LVS_REPORT
Definition: commctrl.h:2234
#define _countof(array)
Definition: fontsub.cpp:30
#define free
Definition: debug_ros.c:5
_In_ SUBCLASSPROC _In_ UINT_PTR _In_ DWORD_PTR dwRefData
Definition: commctrl.h:5027
#define MAKELPARAM(l, h)
Definition: winuser.h:3915
#define IDS_MISMATCH_CERT_INFO
Definition: resource.h:114
#define INTERNET_OPTION_SECURITY_CERTIFICATE_STRUCT
Definition: wininet.h:726
_In_ ULONGLONG _In_ ULONGLONG _In_ BOOLEAN Enable
Definition: ntddpcm.h:140
#define CALLBACK
Definition: compat.h:27
HWND hWnd
Definition: settings.c:17
REFIID LPVOID * ppv
Definition: atlbase.h:39
LONG top
Definition: windef.h:292
LPCWSTR szCaption
Definition: loaddlg.cpp:94
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
#define INTERNET_OPEN_TYPE_PROXY
Definition: wininet.h:523
#define LVCFMT_LEFT
Definition: commctrl.h:2570
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1497
static VOID LaunchDownloadDialog(BOOL)
Definition: loaddlg.cpp:965
#define INVALID_HANDLE_VALUE
Definition: compat.h:391
#define IDS_UNABLE_TO_WRITE
Definition: resource.h:109
#define COLOR_CAPTIONTEXT
Definition: winuser.h:912
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
#define ZeroMemory
Definition: winbase.h:1635
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
void __cdecl Format(UINT nFormatID,...)
Definition: cstringt.h:668
#define PBM_SETPOS
Definition: commctrl.h:2156
virtual HRESULT STDMETHODCALLTYPE OnStartBinding(DWORD dwReserved, IBinding *pib)
Definition: loaddlg.cpp:120
BOOL WINAPI InternetCloseHandle(HINTERNET hInternet)
Definition: internet.c:1437
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
BOOL WINAPI InternetCanonicalizeUrlW(LPCWSTR lpszUrl, LPWSTR lpszBuffer, LPDWORD lpdwBufferLength, DWORD dwFlags)
Definition: internet.c:2027
#define IDS_STATUS_DOWNLOADING
Definition: resource.h:185
BOOL WINAPI SetWindowTextW(_In_ HWND, _In_opt_ LPCWSTR)
GLuint GLuint end
Definition: gl.h:1545
#define WS_CHILD
Definition: pedump.c:617
#define IDS_STATUS_INSTALLING
Definition: resource.h:186
#define GetWindowLongPtrW
Definition: winuser.h:4698
LONG left
Definition: windef.h:291
#define FILE_SHARE_WRITE
Definition: nt_native.h:681
#define IDS_UNABLE_TO_DOWNLOAD
Definition: resource.h:103
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
int32_t INT_PTR
Definition: typedefs.h:62
#define WCHAR
Definition: msvc.h:43
LONG right
Definition: windef.h:293
#define DT_NOPREFIX
Definition: winuser.h:537
#define IID_PPV_ARG(Itype, ppType)
int GetSize() const
Definition: atlsimpcoll.h:104
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
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: vga.c:416
DownloadInfo(const CAvailableApplicationInfo &AppInfo)
Definition: loaddlg.cpp:74
int32_t INT
Definition: typedefs.h:56
#define SetWindowLongPtr
Definition: treelist.c:70
DWORD WINAPI GetSysColor(_In_ int)
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
WPARAM wParam
Definition: combotst.c:138
PBOOL m_pbCancelled
Definition: loaddlg.cpp:103
#define FILE_SHARE_READ
Definition: compat.h:125
#define COLOR_3DSHADOW
Definition: winuser.h:921
UINT_PTR WPARAM
Definition: windef.h:207
#define ICON_SMALL
Definition: tnclass.cpp:48
#define IDC_DOWNLOAD_STATUS
Definition: resource.h:40
WCHAR szDownloadDir[MAX_PATH]
Definition: winmain.h:10
BOOL WINAPI SetDlgItemTextW(_In_ HWND, _In_ int, _In_ LPCWSTR)
#define LVIF_TEXT
Definition: commctrl.h:2281
#define LVCF_SUBITEM
Definition: commctrl.h:2561
ATL::CStringW szSHA1
Definition: loaddlg.cpp:81
HINTERNET WINAPI InternetOpenUrlW(HINTERNET hInternet, LPCWSTR lpszUrl, LPCWSTR lpszHeaders, DWORD dwHeadersLength, DWORD dwFlags, DWORD_PTR dwContext)
Definition: internet.c:3608
#define PBM_SETRANGE
Definition: commctrl.h:2155
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:87
virtual HRESULT STDMETHODCALLTYPE OnStopBinding(HRESULT hresult, LPCWSTR szError)
Definition: loaddlg.cpp:225
DWORD dwSchemeLength
Definition: winhttp.h:467
VOID MessageBox_LoadString(HWND hMainWnd, INT StringID)
Definition: loaddlg.cpp:378
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 m_UrlHasBeenCopied
Definition: loaddlg.cpp:104
#define MB_YESNO
Definition: winuser.h:811
DWORD WINAPI FtpGetFileSize(HINTERNET hFile, LPDWORD lpdwFileSizeHigh)
Definition: ftp.c:1754
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED _In_opt_ LPTRANSMIT_FILE_BUFFERS _In_ DWORD dwReserved
Definition: mswsock.h:90
long LONG
Definition: pedump.c:60
ATL::CStringW szUrl
Definition: loaddlg.cpp:79
LONG_PTR LPARAM
Definition: windef.h:208
DWORD WINAPI GetFileAttributesW(LPCWSTR lpFileName)
Definition: fileinfo.c:802
LONG WINAPI SetWindowLongW(_In_ HWND, _In_ int, _In_ LONG)
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)
#define GENERIC_WRITE
Definition: nt_native.h:90
static TAGREF LPCWSTR LPDWORD LPVOID lpBuffer
Definition: db.cpp:163
#define IDS_INTEG_CHECK_FAIL
Definition: resource.h:107
r reserved
Definition: btrfs.c:2655
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
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
Definition: thread.c:112
smooth NULL
Definition: ftsmooth.c:416
static HWND hwndParent
Definition: cryptui.c:300
SETTINGS_INFO SettingsInfo
Definition: winmain.cpp:19
static const WCHAR szProgress[]
Definition: dialog.c:138
BOOL WINAPI InternetQueryOptionA(HINTERNET hInternet, DWORD dwOption, LPVOID lpBuffer, LPDWORD lpdwBufferLength)
Definition: internet.c:2609
_Check_return_ _CRTIMP _CONST_RETURN wchar_t *__cdecl wcsrchr(_In_z_ const wchar_t *_Str, _In_ wchar_t _Ch)
INTERNET_SCHEME nScheme
Definition: winhttp.h:468
static CDowloadingAppsListView DownloadsListView
Definition: dialogs.h:15
BOOL WINAPI DECLSPEC_HOTPATCH ShellExecuteExW(LPSHELLEXECUTEINFOW sei)
Definition: shlexec.cpp:2225
static VOID SetProgressMarquee(HWND Item, BOOL Enable)
Definition: loaddlg.cpp:561
LRESULT WINAPI DefSubclassProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: commctrl.c:1496
#define IDS_UNABLE_TO_INSTALL
Definition: resource.h:112
#define DT_VCENTER
Definition: winuser.h:543
#define SW_SHOW
Definition: winuser.h:769
BOOL * PBOOL
Definition: windef.h:161
#define WM_SETTEXT
Definition: winuser.h:1599
VOID LoadList(ATL::CSimpleArray< DownloadInfo > arrInfo)
Definition: loaddlg.cpp:278
#define IDS_STATUS_FINISHED
Definition: resource.h:188
#define DialogBoxW(i, t, p, f)
Definition: winuser.h:4268
virtual HRESULT STDMETHODCALLTYPE OnObjectAvailable(REFIID riid, IUnknown *punk)
Definition: loaddlg.cpp:248
#define IDS_INTERRUPTED_DOWNLOAD
Definition: resource.h:108
BOOL WINAPI SetWindowSubclass(HWND hWnd, SUBCLASSPROC pfnSubclass, UINT_PTR uIDSubclass, DWORD_PTR dwRef)
Definition: commctrl.c:1261
#define ICU_ESCAPE
Definition: winhttp.h:48
#define ListView_SetItemText(hwndLV, i, iSubItem_, pszText_)
Definition: commctrl.h:2663
#define BEGIN_COM_MAP(x)
Definition: atlcom.h:541
VOID SetDownloadStatus(INT ItemIndex, DownloadStatus Status)
Definition: loaddlg.cpp:286
#define GCLP_HICONSM
Definition: winuser.h:670
unsigned int BOOL
Definition: ntddk_ex.h:94
GLsizeiptr size
Definition: glext.h:5919
int WINAPI MessageBoxW(_In_opt_ HWND, _In_opt_ LPCWSTR, _In_opt_ LPCWSTR, _In_ UINT)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
LONG HRESULT
Definition: typedefs.h:77
uint64_t ULONGLONG
Definition: typedefs.h:65
static const WCHAR szStatus[]
Definition: http.c:73
#define IDS_UNABLE_TO_QUERY_CERT
Definition: resource.h:105
LPWSTR pszText
Definition: commctrl.h:2337
#define WM_CLOSE
Definition: winuser.h:1603
#define WM_NCDESTROY
Definition: winuser.h:1666
GLfloat param
Definition: glext.h:5796
#define MAX_PATH
Definition: compat.h:26
PCXSTR GetString() const
Definition: atlsimpstr.h:361
unsigned int UINT
Definition: ndis.h:50
static const UCHAR Index[8]
Definition: usbohci.c:18
#define IDS_STATUS_DOWNLOADED
Definition: resource.h:183
#define STDMETHODCALLTYPE
Definition: bdasup.h:9
#define LVS_SINGLESEL
Definition: commctrl.h:2238
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:187
#define SetLastError(x)
Definition: compat.h:409
GLdouble GLdouble GLdouble GLdouble q
Definition: gl.h:2063
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
static INT_PTR CALLBACK DownloadDlgProc(HWND Dlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: loaddlg.cpp:398
#define INVALID_FILE_ATTRIBUTES
Definition: vfdcmd.c:23
#define IDS_UNABLE_TO_DOWNLOAD2
Definition: resource.h:104
ATL::CStringW szName
Definition: loaddlg.cpp:80
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:2332
#define IDC_DOWNLOAD_PROGRESS
Definition: resource.h:39
#define INTERNET_OPEN_TYPE_DIRECT
Definition: wininet.h:522
HWND hMainWnd
Definition: magnifier.c:33
DWORD dwStructSize
Definition: winhttp.h:465
BOOL WINAPI HttpQueryInfoW(HINTERNET hHttpRequest, DWORD dwInfoLevel, LPVOID lpBuffer, LPDWORD lpdwBufferLength, LPDWORD lpdwIndex)
Definition: http.c:3807
#define IDS_INTEG_CHECK_TITLE
Definition: resource.h:106
int InsertItem(const LV_ITEM *pitem)
Definition: rosctrls.h:96
static const WCHAR L[]
Definition: oid.c:1250
#define GCLP_HICON
Definition: winuser.h:669
#define MB_ICONERROR
Definition: winuser.h:781
#define CreateDialogW(h, n, w, f)
Definition: winuser.h:4150
GLenum GLsizei len
Definition: glext.h:6722
#define WM_COMMAND
Definition: winuser.h:1716
#define E_ABORT
Definition: winerror.h:2366
uint32_t DWORD_PTR
Definition: typedefs.h:63
_In_ HANDLE hFile
Definition: mswsock.h:90
static BOOL DownloadListOfApplications(const ATL::CSimpleArray< CAvailableApplicationInfo > &AppsList, BOOL bIsModal=FALSE)
Definition: loaddlg.cpp:930
LPWSTR lpszHostName
Definition: winhttp.h:469
static ATL::CSimpleArray< DownloadInfo > AppsToInstallList
Definition: dialogs.h:14
#define WINAPI
Definition: msvc.h:20
#define SelectFont(hdc, hfont)
Definition: windowsx.h:486
#define HTTP_QUERY_STATUS_CODE
Definition: wininet.h:1542
Status
Definition: gdiplustypes.h:24
virtual HRESULT STDMETHODCALLTYPE OnLowResource(DWORD reserved)
Definition: loaddlg.cpp:133
TCHAR szAppName[128]
Definition: solitaire.cpp:16
#define GWL_STYLE
Definition: winuser.h:846
#define IDS_STATUS_WAITING
Definition: resource.h:187
static HDC hDC
Definition: 3dtext.c:33
ULONG_PTR SIZE_T
Definition: typedefs.h:78
int Replace(PCXSTR pszOld, PCXSTR pszNew)
Definition: cstringt.h:696
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define INTERNET_FLAG_PASSIVE
Definition: wininet.h:65
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
#define DT_SINGLELINE
Definition: winuser.h:540
#define INTERNET_FLAG_PRAGMA_NOCACHE
Definition: wininet.h:85
#define LVCF_FMT
Definition: commctrl.h:2558
HWND hListView
Definition: gui.cpp:29
#define S_OK
Definition: intsafe.h:59
#define CREATE_ALWAYS
Definition: disk.h:72
WCHAR szProxyServer[MAX_PATH]
Definition: winmain.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
BOOL WINAPI RemoveWindowSubclass(HWND hWnd, SUBCLASSPROC pfnSubclass, UINT_PTR uID)
Definition: commctrl.c:1390
#define INTERNET_OPEN_TYPE_PRECONFIG
Definition: wininet.h:521
virtual HRESULT STDMETHODCALLTYPE GetBindInfo(DWORD *grfBINDF, BINDINFO *pbindinfo)
Definition: loaddlg.cpp:232
int WINAPI GetWindowTextW(HWND hWnd, LPWSTR lpString, int nMaxCount)
Definition: window.c:1378
BOOL WINAPI DeleteDC(_In_ HDC)
#define INTERNET_OPTION_SECURITY_FLAGS
Definition: wininet.h:725
HWND Create(HWND hwndParent)
Definition: loaddlg.cpp:264
BOOL AddItem(INT ItemIndex, LPWSTR lpText)
Definition: loaddlg.cpp:293
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:2175
#define COM_INTERFACE_ENTRY_IID(iid, x)
Definition: atlcom.h:561
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
Definition: window.h:371
static BOOL DownloadApplication(CAvailableApplicationInfo *pAppInfo, BOOL bIsModal=FALSE)
Definition: loaddlg.cpp:947
static VOID DownloadApplicationsDB(LPCWSTR lpUrl)
Definition: loaddlg.cpp:956
static DWORD WINAPI ThreadFunc(LPVOID Context)
Definition: loaddlg.cpp:576
#define SetWindowText
Definition: winuser.h:5723
#define MB_OK
Definition: winuser.h:784
#define HTTP_QUERY_FLAG_NUMBER
Definition: wininet.h:1606
BOOL bDelInstaller
Definition: winmain.h:11
#define CreateFileW
Definition: compat.h:400
virtual HRESULT STDMETHODCALLTYPE OnDataAvailable(DWORD grfBSCF, DWORD dwSize, FORMATETC *pformatetc, STGMEDIUM *pstgmed)
Definition: loaddlg.cpp:239
BOOL WINAPI InternetCrackUrlW(const WCHAR *lpszUrl, DWORD dwUrlLength, DWORD dwFlags, URL_COMPONENTSW *lpUC)
Definition: internet.c:1645
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:64
HICON hIconSm
Definition: msconfig.c:44
unsigned int ULONG
Definition: retypes.h:1
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
virtual HRESULT STDMETHODCALLTYPE OnProgress(ULONG ulProgress, ULONG ulProgressMax, ULONG ulStatusCode, LPCWSTR szStatusText)
Definition: loaddlg.cpp:139
LONG bottom
Definition: windef.h:294
virtual HRESULT STDMETHODCALLTYPE GetPriority(LONG *pnPriority)
Definition: loaddlg.cpp:127
#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:21
#define malloc
Definition: debug_ros.c:4
#define SECURITY_FLAG_SECURE
Definition: winhttp.h:285
#define LVS_NOSORTHEADER
Definition: commctrl.h:2257
#define ICU_DECODE
Definition: winhttp.h:291
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define GetWindowLongPtr
Definition: treelist.c:73
#define END_COM_MAP()
Definition: atlcom.h:552
#define WM_ERASEBKGND
Definition: winuser.h:1607
VOID AddRow(INT RowIndex, LPCWSTR szAppName, const DownloadStatus Status)
Definition: loaddlg.cpp:306
ATL::CSimpleArray< DownloadInfo > AppInfo
Definition: loaddlg.cpp:93
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:2284
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:1002
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:314
#define WM_INITDIALOG
Definition: winuser.h:1715
LPARAM lParam
Definition: combotst.c:139
_In_ SUBCLASSPROC _In_ UINT_PTR uIdSubclass
Definition: commctrl.h:5027
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define GetClassLongPtrW
Definition: winuser.h:4433
#define SRCCOPY
Definition: wingdi.h:332
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:54
HDC hdcMem
Definition: welcome.c:104
LPWSTR lpszScheme
Definition: winhttp.h:466
#define ICON_BIG
Definition: tnclass.cpp:51
#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:1194
DownloadStatus
Definition: loaddlg.cpp:54