ReactOS 0.4.17-dev-1321-g5c122a9
loaddlg.cpp
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS Applications Manager
3 * LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
4 * PURPOSE: Displaying a download dialog
5 * COPYRIGHT: Copyright 2001 John R. Sheets (for CodeWeavers)
6 * Copyright 2004 Mike McCormack (for CodeWeavers)
7 * Copyright 2005 Ge van Geldorp (gvg@reactos.org)
8 * Copyright 2009 Dmitry Chapyshev (dmitry@reactos.org)
9 * Copyright 2015 Ismael Ferreras Morezuelas (swyterzone+ros@gmail.com)
10 * Copyright 2017 Alexander Shaposhnikov (sanchaez@reactos.org)
11 */
12
13/*
14 * Based on Wine dlls/shdocvw/shdocvw_main.c
15 *
16 * This library is free software; you can redistribute it and/or
17 * modify it under the terms of the GNU Lesser General Public
18 * License as published by the Free Software Foundation; either
19 * version 2.1 of the License, or (at your option) any later version.
20 *
21 * This library is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
24 * Lesser General Public License for more details.
25 *
26 * You should have received a copy of the GNU Lesser General Public
27 * License along with this library; if not, write to the Free Software
28 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
29 */
30#include "rapps.h"
31
32#include <shlobj_undoc.h>
33#include <shlguid_undoc.h>
34
35#include <atlbase.h>
36#include <atlcom.h>
37#include <atlwin.h>
38#include <wininet.h>
39#include <shellutils.h>
40
41#include <debug.h>
42
43#include <ui/rosctrls.h>
44#include <windowsx.h>
45#include <shlwapi.h>
46#include <shlwapi_undoc.h>
47#include <process.h>
48#include <wincrypt.h>
49#undef SubclassWindow
50
51#include "rosui.h"
52#include "dialogs.h"
53#include "misc.h"
54#include "unattended.h"
55
56#ifdef USE_CERT_PINNING
57#include <cryptuiapi.h>
58
59struct RappsCertInfo
60{
61 PCCERT_CHAIN_CONTEXT pChainContext = nullptr;
62 CLocalPtr<char> subjectInfo;
63 CLocalPtr<char> issuerInfo;
64
65 ~RappsCertInfo()
66 {
67 if (pChainContext)
68 ::CertFreeCertificateChain(pChainContext);
69 }
70
71};
72
73// Allowlisted certificates from Let's encrypt.
74// Their root certificates are the ones we added here.
75// See https://letsencrypt.org/certificates/ for more details
76static const wchar_t *wszAllowedCertificates[] = {
77 L"96bcec06264976f37460779acf28c5a7cfe8a3c0aae11a8ffcee05c0bddf08c6", // ISRG Root X1
78 L"69729b8e15a86efc177a57afb7171dfc64add28c2fca8cf1507e34453ccb1470", // ISRG Root X2
79};
80
81static void
82ExtractCertDetails(CLocalPtr<char> &output, PCCERT_CONTEXT cert, DWORD type)
83{
85 output.Allocate(dwLen);
87}
88
89static bool
90IsTrustedPinnedCert(const RappsCertInfo &certInfo)
91{
92 CERT_SIMPLE_CHAIN *chain = certInfo.pChainContext->rgpChain[0];
93 if (chain->cElement < 2)
94 {
95 DPRINT1("Certificate chain is too short, cElement = %d\n", chain->cElement);
96 return false;
97 }
98 PCCERT_CONTEXT root = chain->rgpElement[chain->cElement - 1]->pCertContext;
99
100 BYTE hash[64];
101 DWORD hash_size = sizeof(hash);
102 if (!CryptHashCertificate(0, CALG_SHA_256, 0, root->pbCertEncoded, root->cbCertEncoded, hash, &hash_size))
103 {
104 DPRINT1("CryptHashCertificate failed with error %d\n", GetLastError());
105 return false;
106 }
107
108 WCHAR buf[(sizeof(hash) * 2) + 1]{};
109 for (UINT i = 0; i < hash_size; i++)
110 _swprintf(buf + 2 * i, L"%02x", ((unsigned char *)hash)[i]);
111
112 for (SIZE_T n = 0; n < _countof(wszAllowedCertificates); ++n)
113 {
114 if (!_wcsicmp(wszAllowedCertificates[n], buf))
115 return true;
116 }
117
118 return false;
119}
120#endif // USE_CERT_PINNING
121
123{
128
130{
138
141{
142 CStringW szString;
143 szString.LoadStringW(StatusParam);
144 return szString;
145}
146
147#define FILENAME_VALID_CHAR ( \
148 PATH_CHAR_CLASS_LETTER | \
149 PATH_CHAR_CLASS_DOT | \
150 PATH_CHAR_CLASS_SEMICOLON | \
151 PATH_CHAR_CLASS_COMMA | \
152 PATH_CHAR_CLASS_SPACE | \
153 PATH_CHAR_CLASS_OTHER_VALID)
154
155VOID
157{
159 DWORD cchPath = _countof(szPath);
160 UrlUnescapeW(const_cast<LPWSTR>((LPCWSTR)str), szPath, &cchPath, 0);
161
162 for (PWCHAR pch = szPath; *pch; ++pch)
163 {
165 *pch = L'_';
166 }
167
168 str = szPath;
169}
170
171static void
173{
175 DWORD cch = (DWORD)(wcslen(pszUrl) + 1);
176 if (InternetCanonicalizeUrlW(pszUrl, buf.GetBuffer(cch), &cch, ICU_DECODE | ICU_NO_ENCODE))
177 {
178 buf.ReleaseBuffer();
179 pszUrl = buf;
180 }
181 SetWindowTextW(hWnd, pszUrl);
182}
183
185{
187 {
188 }
189 DownloadInfo(const CAppInfo &AppInfo, UINT DAF = 0) : DLType(DLTYPE_APPLICATION), Flags(DAF)
190 {
192 szName = AppInfo.szDisplayName;
193 IType = AppInfo.GetInstallerType();
194 szPackageName = AppInfo.szIdentifier;
195
196 if (Flags & DAF_SILENT)
198
199 CConfigParser *cfg = static_cast<const CAvailableApplicationInfo&>(AppInfo).GetConfigParser();
200 if (cfg)
201 {
204 }
205 }
206
207 bool Equal(const DownloadInfo &other) const
208 {
209 return DLType == other.DLType && !lstrcmpW(szUrl, other.szUrl);
210 }
211
224};
225
226class CDownloaderProgress : public CWindowImpl<CDownloaderProgress, CWindow, CControlWinTraits>
227{
229
230 public:
232 {
233 }
234
235 VOID
237 {
238 if (Enable)
240 else
242
244 }
245
246 VOID
247 SetProgress(ULONG ulProgress, ULONG ulProgressMax)
248 {
249 WCHAR szProgress[100];
250
251 /* format the bits and bytes into pretty and accessible units... */
252 StrFormatByteSizeW(ulProgress, szProgress, _countof(szProgress));
253
254 /* use our subclassed progress bar text subroutine */
255 CStringW ProgressText;
256
257 if (ulProgressMax)
258 {
259 /* total size is known */
260 WCHAR szProgressMax[100];
261 UINT uiPercentage = ((ULONGLONG)ulProgress * 100) / ulProgressMax;
262
263 /* send the current progress to the progress bar */
264 if (!IsWindow())
265 return;
266 SendMessage(PBM_SETPOS, uiPercentage, 0);
267
268 /* format total download size */
269 StrFormatByteSizeW(ulProgressMax, szProgressMax, _countof(szProgressMax));
270
271 /* generate the text on progress bar */
272 ProgressText.Format(L"%u%% \x2014 %ls / %ls", uiPercentage, szProgress, szProgressMax);
273 }
274 else
275 {
276 /* send the current progress to the progress bar */
277 if (!IsWindow())
278 return;
279 SendMessage(PBM_SETPOS, 0, 0);
280
281 /* total size is not known, display only current size */
282 ProgressText.Format(L"%ls...", szProgress);
283 }
284
285 /* and finally display it */
286 if (!IsWindow())
287 return;
288 SetWindowText(ProgressText.GetString());
289 }
290
291 LRESULT
293 {
294 return TRUE;
295 }
296
297 LRESULT
299 {
300 PAINTSTRUCT ps;
301 HDC hDC = BeginPaint(&ps), hdcMem;
302 HBITMAP hbmMem;
303 HANDLE hOld;
304 RECT myRect;
305 UINT win_width, win_height;
306
307 GetClientRect(&myRect);
308
309 /* grab the progress bar rect size */
310 win_width = myRect.right - myRect.left;
311 win_height = myRect.bottom - myRect.top;
312
313 /* create an off-screen DC for double-buffering */
315 hbmMem = CreateCompatibleBitmap(hDC, win_width, win_height);
316
317 hOld = SelectObject(hdcMem, hbmMem);
318
319 /* call the original draw code and redirect it to our memory buffer */
321
322 /* draw our nifty progress text over it */
328
329 /* transfer the off-screen DC to the screen */
330 BitBlt(hDC, 0, 0, win_width, win_height, hdcMem, 0, 0, SRCCOPY);
331
332 /* free the off-screen DC */
333 SelectObject(hdcMem, hOld);
334 DeleteObject(hbmMem);
336
337 EndPaint(&ps);
338 return 0;
339 }
340
341 LRESULT
343 {
344 PCWSTR pszText = (PCWSTR)lParam;
345 if (pszText)
346 {
347 if (m_szProgressText != pszText)
348 {
349 m_szProgressText = pszText;
351 }
352 }
353 else
354 {
356 {
359 }
360 }
361 return TRUE;
362 }
363
369};
370
372{
373 public:
374 HWND
376 {
377 RECT r;
379 r.top = (2 * r.top + 1 * r.bottom) / 3; /* The vertical position at ratio 1 : 2 */
380 const INT MARGIN = 10;
381 ::InflateRect(&r, -MARGIN, -MARGIN);
382
385
387
388 AddColumn(0, 150, LVCFMT_LEFT);
389 AddColumn(1, 120, LVCFMT_LEFT);
390
391 return hwnd;
392 }
393
394 VOID
396 {
397 const INT base = GetItemCount();
398 for (INT i = Start; i < arrInfo.GetSize(); ++i)
399 {
400 AddRow(base + i - Start, arrInfo[i].szName, DLSTATUS_WAITING);
401 }
402 }
403
404 VOID
406 {
407 CStringW szBuffer = LoadStatusString(Status);
408 SetItemText(ItemIndex, 1, szBuffer.GetString());
409 }
410
411 BOOL
412 AddItem(INT ItemIndex, LPWSTR lpText)
413 {
415
416 ZeroMemory(&Item, sizeof(Item));
417
418 Item.mask = LVIF_TEXT | LVIF_STATE;
419 Item.pszText = lpText;
420 Item.iItem = ItemIndex;
421
422 return InsertItem(&Item);
423 }
424
425 VOID
427 {
428 CStringW szStatus = LoadStatusString(Status);
429 AddItem(RowIndex, const_cast<LPWSTR>(szAppName));
430 SetDownloadStatus(RowIndex, Status);
431 }
432
433 BOOL
435 {
436 LVCOLUMNW Column;
437 ZeroMemory(&Column, sizeof(Column));
438
440 Column.iSubItem = Index;
441 Column.cx = Width;
442 Column.fmt = Format;
443
444 return (InsertColumn(Index, &Column) == -1) ? FALSE : TRUE;
445 }
446};
447
448#ifdef USE_CERT_PINNING
449static BOOL
450CertGetSubjectAndIssuer(HINTERNET hFile, RappsCertInfo& certInfo)
451{
453
454 size = sizeof(flags);
456 {
457 return FALSE;
458 }
459
461 {
462 return FALSE;
463 }
464
465 certInfo.pChainContext = nullptr;
466 DWORD cbSize = sizeof(certInfo.pChainContext);
468 {
469 // pChainContext->rgpChain[0] is the chain for the end-entity cert
470 CERT_SIMPLE_CHAIN *chain = certInfo.pChainContext->rgpChain[0];
471
472 if (chain->cElement >= 2)
473 {
474 // This is the root of the chain, which is the cert we checked.
475 PCCERT_CONTEXT leaf = chain->rgpElement[0]->pCertContext;
476 // This is our leaf cert, used for the ssl connection
477 PCCERT_CONTEXT root = chain->rgpElement[chain->cElement - 1]->pCertContext;
478 ExtractCertDetails(certInfo.subjectInfo, leaf, 0);
479 ExtractCertDetails(certInfo.issuerInfo, root, 0);
480 return TRUE;
481 }
482 else
483 {
484 DPRINT1("Certificate chain is too short, cElement = %d\n", chain->cElement);
485 return FALSE;
486 }
487 }
488
489 return FALSE;
490}
491
492static void
493ShowCertChain(HWND hwndParent, const CERT_SIMPLE_CHAIN *pSimpleChain)
494{
496 if (!hMemStore)
497 return;
498
499 for (DWORD i = 0; i < pSimpleChain->cElement; i++)
500 {
502 hMemStore, pSimpleChain->rgpElement[i]->pCertContext, CERT_STORE_ADD_ALWAYS, NULL);
503 }
504
506 view.dwSize = sizeof(view);
507 view.hwndParent = hwndParent;
508 view.dwFlags = 0;
509 view.pCertContext = pSimpleChain->rgpElement[0]->pCertContext; // leaf
510 view.cStores = 1;
511 view.rghStores = &hMemStore;
512
513 BOOL fPropertiesChanged = FALSE;
514 CryptUIDlgViewCertificateW(&view, &fPropertiesChanged);
515
516 CertCloseStore(hMemStore, 0);
517}
518
519// The message box callback has no usable context parameter, and the message box
520// is modal on the calling thread, so pass the chain through a static.
521static const CERT_SIMPLE_CHAIN *g_pMismatchCertChain = NULL;
522
523static VOID CALLBACK
524CertMismatchHelpCallback(LPHELPINFO lpHelpInfo)
525{
526 // The help button keeps the message box open, so use it to show the certificate
527 if (g_pMismatchCertChain)
528 ShowCertChain(GetParent((HWND)lpHelpInfo->hItemHandle), g_pMismatchCertChain);
529}
530
531static BOOL
532AskContinueWithCert(HWND hwndOwner, LPCSTR pszText, const CERT_SIMPLE_CHAIN *pSimpleChain)
533{
534 MSGBOXPARAMSA params = { sizeof(params) };
535 params.hwndOwner = hwndOwner;
536 params.lpszText = pszText;
537 params.dwStyle = MB_YESNO | MB_ICONERROR;
538 if (pSimpleChain)
539 {
540 params.dwStyle |= MB_HELP;
541 params.lpfnMsgBoxCallback = CertMismatchHelpCallback;
542 }
543
544 g_pMismatchCertChain = pSimpleChain;
546 g_pMismatchCertChain = NULL;
547
548 return Result == IDYES;
549}
550#endif
551
552static inline VOID
553MessageBox_LoadString(HWND hOwnerWnd, INT StringID)
554{
555 CStringW szMsgText;
556 if (szMsgText.LoadStringW(StringID))
557 {
558 MessageBoxW(hOwnerWnd, szMsgText.GetString(), NULL, MB_OK | MB_ICONERROR);
559 }
560}
561
562static BOOL
563ShowLastError(HWND hWndOwner, BOOL bInetError, DWORD dwLastError)
564{
565 CLocalPtr<WCHAR> lpMsg;
566
567 if (!FormatMessageW(
570 (bInetError ? GetModuleHandleW(L"wininet.dll") : NULL), dwLastError, LANG_USER_DEFAULT, (LPWSTR)&lpMsg, 0,
571 NULL))
572 {
573 DPRINT1("FormatMessageW unexpected failure (err %d)\n", GetLastError());
574 return FALSE;
575 }
576
577 if (hWndOwner && !IsWindowVisible(hWndOwner))
578 hWndOwner = NULL;
579 MessageBoxW(hWndOwner, lpMsg, NULL, MB_OK | MB_ICONERROR);
580 return TRUE;
581}
582
583// Download dialog (loaddlg.cpp)
585
587 public CComCoClass<CDownloadManager, &CLSID_NULL>,
588 public CComObjectRootEx<CComMultiThreadModelNoCS>,
589 public IUnknown
590{
591public:
592 enum {
593 WM_ISCANCELLED = WM_APP, // Return BOOL
594 WM_SETSTATUS, // wParam DownloadStatus
595 WM_GETINSTANCE, // Return CDownloadManager*
596 WM_GETNEXT, // Return DownloadInfo* or NULL
597 };
598
600
601 static CDownloadManager*
603 {
604 if (!(Flags & DAF_MODAL))
605 {
607 if (pExisting)
608 {
609 pExisting->AddRef();
610 return pExisting;
611 }
612 }
614 if (FAILED(ShellObjectCreator(obj)))
615 return NULL;
616 obj->m_fDaf = Flags;
617 obj->m_bModal = !!(Flags & DAF_MODAL);
618 return obj.Detach();
619 }
620
621 static BOOL
623 {
625 if (!p)
626 return FALSE;
627 Obj.Attach(p);
628 return TRUE;
629 }
630
631 static CDownloadManager*
633 {
636 return NULL;
637 }
638
639 BOOL
641 {
643 }
644
645 BOOL
647 {
648 return m_fDaf & DAF_SILENT;
649 }
650
651 void StartWorkerThread();
652 void Add(const DownloadInfo &Info);
653 void Show();
656 void UpdateProgress(ULONG ulProgress, ULONG ulProgressMax);
657 static unsigned int CALLBACK ThreadFunc(void*ThreadParam);
659
664
676};
677
678void
680{
681 AddRef(); // To keep m_List alive in thread
682 unsigned int ThreadId;
683 HANDLE Thread = (HANDLE)_beginthreadex(NULL, 0, ThreadFunc, this, 0, &ThreadId);
684 if (Thread)
686 else
687 Release();
688}
689
690void
692{
693 const UINT count = m_List.GetSize(), start = count;
694 for (UINT i = 0; i < count; ++i)
695 {
696 if (Info.Equal(m_List[i]))
697 return; // Already in the list
698 }
699
700 if (!Info.szDependencies.IsEmpty())
701 {
702 CStringW deps = Info.szDependencies;
703 for (int pos = 1; pos > 0; deps = deps.Mid(pos + 1))
704 {
705 pos = deps.Find(L'|');
706 CStringW pkg = (pos > 0 ? deps.Left(pos) : deps).Trim();
707
708 // In the future a package might need to specify dependency version or WoW64
709 // information ("vcredist*x64" etc), for now, just remove possible modifiers.
710 int suffix = pkg.FindOneOf(L"*<=>:/\\?");
711 if (suffix > 0)
712 pkg = pkg.Left(suffix);
713
715 Deleter <CAvailableApplicationInfo*>del(pApp);
716 if (!pApp || pApp->IsInstalled())
717 continue;
718 // Add the dependency before the application in the list
719 Add(DownloadInfo(*pApp, DAF_SILENT));
720 }
721 }
722
723 m_List.Add(Info);
724 if (m_hDlg)
726}
727
728void
730{
731 HWND hDlg = NULL;
732 const BOOL bSilent = IsSilentDialog(), bModal = m_bModal;
733 if (bModal && !bSilent)
735 else if (!m_hDlg || !IsWindow(m_hDlg))
737
738 // A DialogBox dialog cannot be invisible, it is forced visible after WM_INITDIALOG returns.
739 // We therefore use a modeless dialog when we are both modal and silent.
740 for (MSG msg; bModal && bSilent && hDlg && GetMessageW(&msg, NULL, 0, 0);)
742}
743
746{
748 if (!pThis)
749 {
750 if (uMsg != WM_INITDIALOG)
751 return FALSE;
753 pThis = (CDownloadManager*)lParam;
754 }
755 return pThis->RealDlgProc(hDlg, uMsg, wParam, lParam);
756}
757
760{
761 switch (uMsg)
762 {
763 case WM_INITDIALOG:
764 {
765 g_Busy++;
766 AddRef();
767 m_hDlg = hDlg;
768 if (!m_bModal)
769 g_hDownloadWnd = hDlg;
770
771 HICON hIconSm, hIconBg;
772 if (hMainWnd)
773 {
776 }
777 if (!hMainWnd || (!hIconBg || !hIconSm))
778 {
780 }
781 SendMessageW(hDlg, WM_SETICON, ICON_BIG, (LPARAM)hIconBg);
782 SendMessageW(hDlg, WM_SETICON, ICON_SMALL, (LPARAM)hIconSm);
783
787 buf.Replace(L"%ls", L"");
788 SetWindowTextW(hDlg, buf); // "Downloading..."
789
791 if (hItem)
792 {
793 // initialize the default values for our nifty progress bar
794 // and subclass it so that it learns to print a status text
796 m_ProgressBar.SendMessageW(PBM_SETRANGE, 0, MAKELPARAM(0, 100));
797 m_ProgressBar.SendMessageW(PBM_SETPOS, 0, 0);
798 if (m_List.GetSize() > 0)
799 m_ProgressBar.SetProgress(0, m_List[0].SizeInBytes);
800 }
801
802 if (!m_ListView.Create(hDlg))
803 return FALSE;
805
808 // A silent dialog is never shown, so it must not take the keyboard focus.
809 // Otherwise the focus goes to the hidden Cancel button and keys typed into
810 // another window (e.g. a space in the console) cancel the download (CORE-20816).
811 return !IsSilentDialog();
812 }
813
814 case WM_COMMAND:
815 if (LOWORD(wParam) == IDCANCEL)
816 {
818 PostMessageW(hDlg, WM_CLOSE, 0, 0);
819 }
820 return FALSE;
821
822 case WM_CLOSE:
824 if (m_ProgressBar)
826 return m_bModal && !IsSilentDialog() ? ::EndDialog(hDlg, 0) : ::DestroyWindow(hDlg);
827
828 case WM_DESTROY:
829 if (g_hDownloadWnd == hDlg)
831 g_Busy--;
832 if (hMainWnd)
834 if (m_bModal && IsSilentDialog())
836 Release();
837 break;
838
839 case WM_ISCANCELLED:
840 return SetDlgMsgResult(hDlg, uMsg, m_bCancelled);
841
842 case WM_SETSTATUS:
844 break;
845
846 case WM_GETINSTANCE:
847 return SetDlgMsgResult(hDlg, uMsg, (INT_PTR)this);
848
849 case WM_GETNEXT:
850 {
851 DownloadInfo *pItem = NULL;
853 pItem = &m_List[m_Index++];
854 return SetDlgMsgResult(hDlg, uMsg, (INT_PTR)pItem);
855 }
856 }
857 return FALSE;
858}
859
860void
862{
863 m_ProgressBar.SetProgress(ulProgress, ulProgressMax);
864}
865
866unsigned int CALLBACK
868{
869 CDownloadManager *pThis = (CDownloadManager*)ThreadParam;
870 HWND hDlg = pThis->m_hDlg;
871 for (;;)
872 {
873 DownloadInfo *pItem = (DownloadInfo*)SendMessageW(hDlg, WM_GETNEXT, 0, 0);
874 if (!pItem)
875 break;
876 pThis->PerformDownloadAndInstall(*pItem);
877 }
878 SendMessageW(hDlg, WM_CLOSE, 0, 0);
879 return pThis->Release();
880}
881
882void
884{
885 const HWND hDlg = m_hDlg;
888
890 m_ProgressBar.SendMessageW(PBM_SETPOS, 0, 0);
891 m_ProgressBar.SetProgress(0, Info.SizeInBytes);
892
894 CPathW Path;
895 PCWSTR p;
896
897 ULONG dwContentLen, dwBytesWritten, dwBytesRead, dwStatus, dwStatusLen;
898 ULONG dwCurrentBytesRead = 0;
899 BOOL bTempfile = FALSE, bCancelled = FALSE;
900
901 HINTERNET hOpen = NULL;
904
905
906 LPCWSTR lpszAgent = L"RApps/1.1";
907 const DWORD dwUrlConnectFlags =
909 URL_COMPONENTSW urlComponents;
910 size_t urlLength;
911 unsigned char lpBuffer[4096];
912
913 // Change caption to show the currently downloaded app
914 switch (Info.DLType)
915 {
917 str.Format(m_szCaptionFmt, Info.szName.GetString());
918 break;
919 case DLTYPE_DBUPDATE:
921 break;
924 break;
925 }
926 SetWindowTextW(hDlg, str);
927
928 // is this URL an update package for RAPPS? if so store it in a different place
929 if (Info.DLType != DLTYPE_APPLICATION)
930 {
932 {
934 goto end;
935 }
936 }
937 else
938 {
940 }
941
942 // build the path for the download
943 p = wcsrchr(Info.szUrl.GetString(), L'/');
944
945 // do we have a final slash separator?
946 if (!p)
947 {
949 goto end;
950 }
951
952 // is the path valid? can we access it?
954 {
956 {
958 goto end;
959 }
960 }
961
962 switch (Info.DLType)
963 {
964 case DLTYPE_DBUPDATE:
967 break;
969 {
970 CStringW name = Info.szFileName;
971 if (name.IsEmpty())
972 name = p + 1; // use the filename retrieved from URL
974 Path += name;
975 break;
976 }
977 }
978
979 if ((Info.DLType == DLTYPE_APPLICATION) && Info.szSHA1[0] &&
981 {
982 // only open it in case of total correctness
983 if (VerifyInteg(Info.szSHA1.GetString(), Path))
984 goto run;
985 }
986
987 // Download it
989 /* FIXME: this should just be using the system-wide proxy settings */
990 switch (SettingsInfo.Proxy)
991 {
992 case 0: // preconfig
993 default:
994 hOpen = InternetOpenW(lpszAgent, INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0);
995 break;
996 case 1: // direct (no proxy)
997 hOpen = InternetOpenW(lpszAgent, INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0);
998 break;
999 case 2: // use proxy
1000 hOpen = InternetOpenW(
1002 break;
1003 }
1004
1005 if (!hOpen)
1006 {
1008 goto end;
1009 }
1010
1011 bTempfile = TRUE;
1012 dwContentLen = 0;
1013 dwStatusLen = sizeof(dwStatus);
1014 ZeroMemory(&urlComponents, sizeof(urlComponents));
1015 urlComponents.dwStructSize = sizeof(urlComponents);
1016
1017 urlLength = Info.szUrl.GetLength();
1018 urlComponents.dwSchemeLength = urlLength + 1;
1019 urlComponents.lpszScheme = (LPWSTR)malloc(urlComponents.dwSchemeLength * sizeof(WCHAR));
1020
1021 if (!InternetCrackUrlW(Info.szUrl, urlLength + 1, ICU_DECODE | ICU_ESCAPE, &urlComponents))
1022 {
1024 goto end;
1025 }
1026
1027 if (urlComponents.nScheme == INTERNET_SCHEME_HTTP || urlComponents.nScheme == INTERNET_SCHEME_HTTPS)
1028 {
1029 hFile = InternetOpenUrlW(hOpen, Info.szUrl, NULL, 0, dwUrlConnectFlags, 0);
1030 if (!hFile)
1031 {
1033 {
1034 /* Workaround for CORE-17377 */
1036 }
1037 goto end;
1038 }
1039
1040 // query connection
1042 {
1044 goto end;
1045 }
1046
1047 if (dwStatus != HTTP_STATUS_OK)
1048 {
1050 goto end;
1051 }
1052
1053 // query content length
1055 }
1056 else if (urlComponents.nScheme == INTERNET_SCHEME_FTP)
1057 {
1058 // force passive mode on FTP
1059 hFile =
1060 InternetOpenUrlW(hOpen, Info.szUrl, NULL, 0, dwUrlConnectFlags | INTERNET_FLAG_PASSIVE, 0);
1061 if (!hFile)
1062 {
1064 {
1065 /* Workaround for CORE-17377 */
1067 }
1068 goto end;
1069 }
1070
1071 dwContentLen = FtpGetFileSize(hFile, &dwStatus);
1072 }
1073 else if (urlComponents.nScheme == INTERNET_SCHEME_FILE)
1074 {
1075 // Add support for the file scheme so testing locally is simpler
1076 WCHAR LocalFilePath[MAX_PATH];
1077 DWORD cchPath = _countof(LocalFilePath);
1078 // Ideally we would use PathCreateFromUrlAlloc here, but that is not exported (yet)
1079 HRESULT hr = PathCreateFromUrlW(Info.szUrl, LocalFilePath, &cchPath, 0);
1080 if (SUCCEEDED(hr))
1081 {
1082 if (CopyFileW(LocalFilePath, Path, FALSE))
1083 {
1084 // Remove the readonly flag in case we are copying from a read-only medium
1088
1089 goto run;
1090 }
1091 else
1092 {
1094 goto end;
1095 }
1096 }
1097 else
1098 {
1100 goto end;
1101 }
1102 }
1103
1104 if (!dwContentLen)
1105 {
1106 // Someone was nice enough to add this, let's use it
1107 if (Info.SizeInBytes)
1108 {
1109 dwContentLen = Info.SizeInBytes;
1110 }
1111 else
1112 {
1113 // content-length is not known, enable marquee mode
1115 }
1116 }
1117
1118 free(urlComponents.lpszScheme);
1119
1120#ifdef USE_CERT_PINNING
1121 // are we using HTTPS to download the RAPPS update package? check if the certificate is original
1122 if ((urlComponents.nScheme == INTERNET_SCHEME_HTTPS) && (Info.DLType == DLTYPE_DBUPDATE))
1123 {
1124 CStringA szMsgText;
1125 RappsCertInfo certInfo;
1126 bool bAskQuestion = false;
1127 const CERT_SIMPLE_CHAIN *pSimpleChain = NULL;
1128 if (!CertGetSubjectAndIssuer(hFile, certInfo))
1129 {
1130 szMsgText.LoadStringW(IDS_UNABLE_TO_QUERY_CERT);
1131 bAskQuestion = true;
1132 }
1133 else if (!IsTrustedPinnedCert(certInfo))
1134 {
1135 szMsgText.Format(IDS_MISMATCH_CERT_INFO, (LPCSTR)certInfo.subjectInfo, (LPCSTR)certInfo.issuerInfo);
1136 pSimpleChain = certInfo.pChainContext->rgpChain[0];
1137 bAskQuestion = true;
1138 }
1139
1140 if (bAskQuestion)
1141 {
1142 if (!AskContinueWithCert(hDlg, szMsgText, pSimpleChain))
1143 {
1144 goto end;
1145 }
1146 }
1147 }
1148#endif
1149
1151 if (hOut == INVALID_HANDLE_VALUE)
1152 {
1154 goto end;
1155 }
1156
1157 dwCurrentBytesRead = 0;
1158 do
1159 {
1160 bCancelled = IsCancelled();
1161 if (bCancelled)
1162 break;
1163
1164 if (!InternetReadFile(hFile, lpBuffer, _countof(lpBuffer), &dwBytesRead))
1165 {
1167 goto end;
1168 }
1169
1170 if (!WriteFile(hOut, &lpBuffer[0], dwBytesRead, &dwBytesWritten, NULL))
1171 {
1173 goto end;
1174 }
1175
1176 dwCurrentBytesRead += dwBytesRead;
1177 UpdateProgress(dwCurrentBytesRead, dwContentLen);
1178
1179 } while (dwBytesRead);
1180
1181 CloseHandle(hOut);
1182 hOut = INVALID_HANDLE_VALUE;
1183
1184 if (bCancelled)
1185 {
1186 DPRINT1("Operation cancelled\n");
1187 goto end;
1188 }
1189
1190 if (!dwContentLen)
1191 {
1192 // set progress bar to 100%
1194
1195 dwContentLen = dwCurrentBytesRead;
1196 UpdateProgress(dwCurrentBytesRead, dwContentLen);
1197 }
1198
1199 /* if this thing isn't a RAPPS update and it has a SHA-1 checksum
1200 verify its integrity by using the native advapi32.A_SHA1 functions */
1201 if ((Info.DLType == DLTYPE_APPLICATION) && Info.szSHA1[0] != 0)
1202 {
1203 CStringW szMsgText;
1204
1205 // change a few strings in the download dialog to reflect the verification process
1206 if (!szMsgText.LoadStringW(IDS_INTEG_CHECK_TITLE))
1207 {
1208 DPRINT1("Unable to load string\n");
1209 goto end;
1210 }
1211
1212 SetWindowTextW(hDlg, szMsgText);
1214
1215 // this may take a while, depending on the file size
1216 if (!VerifyInteg(Info.szSHA1, Path))
1217 {
1218 if (!szMsgText.LoadStringW(IDS_INTEG_CHECK_FAIL))
1219 {
1220 DPRINT1("Unable to load string\n");
1221 goto end;
1222 }
1223
1224 MessageBoxW(hDlg, szMsgText, NULL, MB_OK | MB_ICONERROR);
1225 goto end;
1226 }
1227 }
1228
1229run:
1231
1232 // run it
1233 if (Info.DLType == DLTYPE_APPLICATION)
1234 {
1235 BOOL bSilentInstall = Info.Flags & DAF_SILENT;
1236 CStringW app, params, tempdir;
1237 SHELLEXECUTEINFOW shExInfo = { sizeof(shExInfo), SEE_MASK_NOCLOSEPROCESS, hDlg };
1238 shExInfo.lpVerb = L"open";
1239 shExInfo.lpFile = Path;
1240 shExInfo.lpParameters = L"";
1241 shExInfo.nShow = SW_SHOW;
1242
1243 if (Info.IType == INSTALLER_GENERATE)
1244 {
1245 params = L"/" CMD_KEY_GENINST + CStringW(bSilentInstall ? L" /S" : L"") +
1246 L" \"" + Info.szPackageName + L"\" \"" + shExInfo.lpFile + L"\"";
1247 shExInfo.lpParameters = params;
1248 shExInfo.lpFile = app.GetBuffer(MAX_PATH);
1249 GetModuleFileNameW(NULL, const_cast<LPWSTR>(shExInfo.lpFile), MAX_PATH);
1250 app.ReleaseBuffer();
1251 }
1252 else if (Info.IType == INSTALLER_EXEINZIP)
1253 {
1254 HRESULT hr = ExtractArchiveForExecution(Path, Info.szPackageName, tempdir, app);
1255 if (FAILED(hr))
1256 {
1257 ShowLastError(hDlg, FALSE, hr);
1258 goto end;
1259 }
1260 shExInfo.lpFile = app;
1261 }
1262
1263 if (bSilentInstall)
1264 {
1265 if (!Info.szSilentInstallArgs.IsEmpty())
1266 {
1267 // The package wants to force specific parameters
1268 shExInfo.lpParameters = Info.szSilentInstallArgs.GetString();
1269 }
1270 else
1271 {
1272 UINT extrainfo = 0;
1273 InstallerType it = Info.IExecType;
1274
1275 if (it == INSTALLER_UNKNOWN || it == INSTALLER_EXEINZIP)
1276 it = GuessInstallerType(shExInfo.lpFile, extrainfo);
1277
1278 if (GetSilentInstallParameters(it, extrainfo, shExInfo.lpFile, params))
1279 {
1280 shExInfo.lpParameters = params;
1281 if (it == INSTALLER_MSI)
1282 shExInfo.lpFile = L"msiexec.exe"; // params contains the .msi path
1283 }
1284 }
1285 }
1286
1287 /* FIXME: Do we want to log installer status? */
1288 WriteLogMessage(EVENTLOG_SUCCESS, MSG_SUCCESS_INSTALL, Info.szName);
1289
1290 if (ShellExecuteExW(&shExInfo))
1291 {
1292 // reflect installation progress in the titlebar
1293 // TODO: make a separate string with a placeholder to include app name?
1295 SetWindowTextW(hDlg, szMsgText);
1296
1298
1299 // TODO: issue an install operation separately so that the apps could be downloaded in the background
1300 if (shExInfo.hProcess)
1301 {
1303 CloseHandle(shExInfo.hProcess);
1305 }
1306 }
1307 else
1308 {
1310 }
1311
1312 if (!tempdir.IsEmpty())
1313 {
1314 DeleteDirectoryTree(tempdir, hDlg);
1315 }
1316 }
1317
1318end:
1319 if (hOut != INVALID_HANDLE_VALUE)
1320 CloseHandle(hOut);
1321
1322 if (hFile)
1324 InternetCloseHandle(hOpen);
1325
1326 if (bTempfile)
1327 {
1328 if (bCancelled || (SettingsInfo.bDelInstaller && Info.DLType == DLTYPE_APPLICATION))
1329 {
1330 // Don't delete .zip/.cab files so the user can extract from them
1331 if (bCancelled || Info.IType == INSTALLER_GENERATE || Info.IType == INSTALLER_EXEINZIP ||
1333 {
1335 }
1336 }
1337 }
1338
1340}
1341
1342BOOL
1344{
1345 if (AppsList.IsEmpty())
1346 return FALSE;
1347
1350 return FALSE;
1351
1352 for (POSITION it = AppsList.GetHeadPosition(); it;)
1353 {
1354 const CAppInfo *Info = AppsList.GetNext(it);
1355 pDM->Add(DownloadInfo(*Info, Flags));
1356 }
1357 pDM->Show();
1358 return TRUE;
1359}
1360
1361BOOL
1363{
1364 if (!pAppInfo)
1365 return FALSE;
1366
1368 list.AddTail(pAppInfo);
1370}
1371
1372VOID
1374{
1377 return;
1378
1379 DownloadInfo DatabaseDLInfo;
1380 DatabaseDLInfo.szUrl = lpUrl;
1381 DatabaseDLInfo.szName.LoadStringW(IDS_DL_DIALOG_DB_DISP);
1382 DatabaseDLInfo.DLType = IsOfficial ? DLTYPE_DBUPDATE : DLTYPE_DBUPDATE_UNOFFICIAL;
1383
1384 pDM->Add(DatabaseDLInfo);
1385 pDM->Show();
1386}
static HDC hDC
Definition: 3dtext.c:33
static _Out_opt_ PULONGLONG Start
#define DB_SAVEAS
Definition: appinfo.h:99
#define DB_DEPENDENCIES
Definition: appinfo.h:102
InstallerType
Definition: appinfo.h:82
@ INSTALLER_UNKNOWN
Definition: appinfo.h:83
@ INSTALLER_EXEINZIP
Definition: appinfo.h:84
@ INSTALLER_GENERATE
Definition: appinfo.h:85
@ INSTALLER_MSI
Definition: appinfo.h:86
#define msg(x)
Definition: auth_time.c:54
HWND hWnd
Definition: settings.c:17
#define IDI_MAIN
Definition: resource.h:4
#define APPLICATION_DATABASE_NAME
Definition: defines.h:41
BOOL WriteLogMessage(WORD wType, DWORD dwEventID, LPCWSTR lpMsg)
Definition: misc.cpp:323
BOOL GetStorageDirectory(CStringW &lpDirectory)
Definition: misc.cpp:241
BOOL OpensWithExplorer(PCWSTR Path)
Definition: misc.cpp:164
BOOL GetSilentInstallParameters(InstallerType InstallerType, UINT ExtraInfo, LPCWSTR Installer, CStringW &Parameters)
Definition: misc.cpp:714
BOOL DeleteDirectoryTree(LPCWSTR Dir, HWND hwnd=NULL)
Definition: misc.cpp:553
UINT ClassifyFile(PCWSTR Path)
Definition: misc.cpp:127
InstallerType GuessInstallerType(LPCWSTR Installer, UINT &ExtraInfo)
Definition: misc.cpp:637
#define IDD_DOWNLOAD_DIALOG
Definition: resource.h:66
#define IDS_UNABLE_TO_DOWNLOAD
Definition: resource.h:115
#define IDS_MISMATCH_CERT_INFO
Definition: resource.h:125
#define IDS_STATUS_FINISHED
Definition: resource.h:211
#define IDS_STATUS_WAITING
Definition: resource.h:210
#define IDS_DL_DIALOG_DB_DISP
Definition: resource.h:227
#define IDS_STATUS_INSTALLING
Definition: resource.h:209
#define IDS_UNABLE_TO_DOWNLOAD2
Definition: resource.h:116
#define IDC_DOWNLOAD_PROGRESS
Definition: resource.h:42
#define IDS_UNABLE_PATH
Definition: resource.h:126
#define IDS_STATUS_DOWNLOADED
Definition: resource.h:206
#define IDS_STATUS_DOWNLOADING
Definition: resource.h:208
#define IDS_UNABLE_TO_QUERY_CERT
Definition: resource.h:117
#define IDC_DOWNLOAD_STATUS
Definition: resource.h:43
#define IDS_STATUS_INSTALLED
Definition: resource.h:204
#define IDS_INTEG_CHECK_TITLE
Definition: resource.h:118
#define IDS_DL_DIALOG_DB_DOWNLOAD_DISP
Definition: resource.h:228
#define IDS_INTEG_CHECK_FAIL
Definition: resource.h:119
#define IDS_DL_DIALOG_DB_UNOFFICIAL_DOWNLOAD_DISP
Definition: resource.h:229
SETTINGS_INFO SettingsInfo
Definition: winmain.cpp:21
#define DPRINT1
Definition: precomp.h:8
static VOID del(LPHIST_ENTRY item)
Definition: history.c:199
bool IsEmpty() const
Definition: atlcoll.h:548
POSITION GetHeadPosition() const
Definition: atlcoll.h:554
E & GetNext(_Inout_ POSITION &pos)
Definition: atlcoll.h:566
int GetSize() const
Definition: atlsimpcoll.h:104
BOOL Add(const T &t)
Definition: atlsimpcoll.h:58
bool IsEmpty() const noexcept
Definition: atlsimpstr.h:394
void ReleaseBuffer(_In_ int nNewLength=-1)
Definition: atlsimpstr.h:387
PXSTR GetString() noexcept
Definition: atlsimpstr.h:367
int GetLength() const noexcept
Definition: atlsimpstr.h:362
void Empty() noexcept
Definition: atlsimpstr.h:253
CStringT Left(int nCount) const
Definition: cstringt.h:776
void __cdecl Format(UINT nFormatID,...)
Definition: cstringt.h:818
int Find(_In_ PCXSTR pszSub, _In_opt_ int iStart=0) const noexcept
Definition: cstringt.h:696
CStringT Mid(int iFirst, int nCount) const
Definition: cstringt.h:748
int FindOneOf(_In_ PCXSTR pszCharSet) const noexcept
Definition: cstringt.h:722
BOOL SubclassWindow(HWND hWnd)
Definition: atlwin.h:1578
HWND UnsubclassWindow(BOOL bForce=FALSE)
Definition: atlwin.h:1601
BOOL ModifyStyle(DWORD dwRemove, DWORD dwAdd, UINT nFlags=0)
Definition: atlwin.h:1034
BOOL IsWindow() const
Definition: atlwin.h:973
static CAvailableApplicationInfo * CreateAvailableAppInstance(const CStringW &PkgName, PCWSTR DBPath=NULL)
Definition: appdb.cpp:110
virtual VOID GetDownloadInfo(CStringW &Url, CStringW &Sha1, ULONG &SizeInBytes) const =0
CStringW szDisplayName
Definition: appinfo.h:123
virtual InstallerType GetInstallerInfo(CStringW &SilentParameters) const
Definition: appinfo.h:144
virtual InstallerType GetInstallerType(bool NestedType=false) const
Definition: appinfo.h:142
const CStringW szIdentifier
Definition: appinfo.h:119
bool IsInstalled(CStringW *pOutKeyName=NULL) const
Definition: appinfo.cpp:124
BOOL GetString(const CStringW &KeyName, CStringW &ResultString)
HWND Create(HWND hwndParent)
Definition: loaddlg.cpp:375
VOID SetDownloadStatus(INT ItemIndex, DownloadStatus Status)
Definition: loaddlg.cpp:405
VOID AddRow(INT RowIndex, LPCWSTR szAppName, const DownloadStatus Status)
Definition: loaddlg.cpp:426
BOOL AddColumn(INT Index, INT Width, INT Format)
Definition: loaddlg.cpp:434
VOID LoadList(ATL::CSimpleArray< DownloadInfo > arrInfo, UINT Start=0)
Definition: loaddlg.cpp:395
BOOL AddItem(INT ItemIndex, LPWSTR lpText)
Definition: loaddlg.cpp:412
static INT_PTR CALLBACK DlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: loaddlg.cpp:745
void PerformDownloadAndInstall(const DownloadInfo &Info)
Definition: loaddlg.cpp:883
static CDownloadManager * FindInstance()
Definition: loaddlg.cpp:632
void UpdateProgress(ULONG ulProgress, ULONG ulProgressMax)
Definition: loaddlg.cpp:861
static unsigned int CALLBACK ThreadFunc(void *ThreadParam)
Definition: loaddlg.cpp:867
WCHAR m_szCaptionFmt[100]
Definition: loaddlg.cpp:672
CDownloaderProgress m_ProgressBar
Definition: loaddlg.cpp:675
BOOL IsSilentDialog()
Definition: loaddlg.cpp:646
static CDownloadManager * CreateInstanceHelper(UINT Flags)
Definition: loaddlg.cpp:602
void StartWorkerThread()
Definition: loaddlg.cpp:679
ATL::CSimpleArray< DownloadInfo > m_List
Definition: loaddlg.cpp:673
BOOL IsCancelled()
Definition: loaddlg.cpp:640
CDowloadingAppsListView m_ListView
Definition: loaddlg.cpp:674
INT_PTR RealDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: loaddlg.cpp:759
static BOOL CreateInstance(BOOL Modal, CComPtr< CDownloadManager > &Obj)
Definition: loaddlg.cpp:622
void Add(const DownloadInfo &Info)
Definition: loaddlg.cpp:691
VOID SetMarquee(BOOL Enable)
Definition: loaddlg.cpp:236
VOID SetProgress(ULONG ulProgress, ULONG ulProgressMax)
Definition: loaddlg.cpp:247
CStringW m_szProgressText
Definition: loaddlg.cpp:228
LRESULT OnEraseBkgnd(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: loaddlg.cpp:292
LRESULT OnSetText(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: loaddlg.cpp:342
LRESULT OnPaint(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: loaddlg.cpp:298
T * m_pData
Definition: atlalloc.h:192
bool Allocate(_In_ size_t nElements=1)
Definition: atlalloc.h:143
int InsertItem(const LV_ITEM *pitem)
Definition: rosctrls.h:101
int GetItemCount()
Definition: rosctrls.h:126
int InsertColumn(int iCol, LV_COLUMN *pcol)
Definition: rosctrls.h:52
BOOL SetItemText(int i, int subItem, LPCWSTR text)
Definition: rosctrls.h:191
HWND Create(HWND hWndParent, _U_RECT rect, LPCTSTR szWindowName=NULL, DWORD dwStyle=0, DWORD dwExStyle=0, _U_MENUorID MenuOrID=0U, LPVOID lpCreateParam=NULL)
Definition: rosctrls.h:8
Definition: list.h:39
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
int WINAPI DrawShadowText(HDC hdc, LPCWSTR pszText, UINT cch, RECT *prc, DWORD dwFlags, COLORREF crText, COLORREF crShadow, int ixOffset, int iyOffset)
Definition: commctrl.c:1858
static HWND hwndParent
Definition: cryptui.c:299
#define free
Definition: debug_ros.c:5
#define malloc
Definition: debug_ros.c:4
HRESULT hr
Definition: delayimp.cpp:582
DLGPROC DlgProc
Definition: desk.c:122
_Check_return_ _In_ D3DDDI_VIDEO_PRESENT_TARGET_ID _In_ PDXGKARG_SYSTEM_DISPLAY_ENABLE_FLAGS _Out_ UINT * Width
Definition: dispmprt.h:1444
_In_ D3DDDI_VIDEO_PRESENT_TARGET_ID _In_ ULONG _In_ ULONG Flags
Definition: dispmprt.h:245
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
BOOL WINAPI CertAddCertificateContextToStore(HCERTSTORE hCertStore, PCCERT_CONTEXT pCertContext, DWORD dwAddDisposition, PCCERT_CONTEXT *ppStoreContext)
Definition: cert.c:284
BOOL WINAPI CryptHashCertificate(HCRYPTPROV_LEGACY hCryptProv, ALG_ID Algid, DWORD dwFlags, const BYTE *pbEncoded, DWORD cbEncoded, BYTE *pbComputedHash, DWORD *pcbComputedHash)
Definition: cert.c:2258
VOID WINAPI CertFreeCertificateChain(PCCERT_CHAIN_CONTEXT pChainContext)
Definition: chain.c:2956
HCERTSTORE WINAPI CertOpenStore(LPCSTR lpszStoreProvider, DWORD dwMsgAndCertEncodingType, HCRYPTPROV_LEGACY hCryptProv, DWORD dwFlags, const void *pvPara)
Definition: store.c:809
BOOL WINAPI CertCloseStore(HCERTSTORE hCertStore, DWORD dwFlags)
Definition: store.c:1121
DWORD WINAPI CertGetNameStringA(PCCERT_CONTEXT cert, DWORD type, DWORD flags, void *type_para, LPSTR name, DWORD name_len)
Definition: str.c:883
BOOL WINAPI CryptUIDlgViewCertificateW(PCCRYPTUI_VIEWCERTIFICATE_STRUCTW pCertViewInfo, BOOL *pfPropertiesChanged)
Definition: main.c:4370
#define CloseHandle
Definition: compat.h:739
#define wcsrchr
Definition: compat.h:16
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define MAX_PATH
Definition: compat.h:34
#define CreateFileW
Definition: compat.h:741
#define CALLBACK
Definition: compat.h:35
#define FILE_SHARE_READ
Definition: compat.h:136
BOOL WINAPI CopyFileW(IN LPCWSTR lpExistingFileName, IN LPCWSTR lpNewFileName, IN BOOL bFailIfExists)
Definition: copy.c:367
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
Definition: delete.c:39
BOOL WINAPI CreateDirectoryW(IN LPCWSTR lpPathName, IN LPSECURITY_ATTRIBUTES lpSecurityAttributes)
Definition: dir.c:58
DWORD WINAPI GetFileAttributesW(LPCWSTR lpFileName)
Definition: fileinfo.c:636
BOOL WINAPI SetFileAttributesW(LPCWSTR lpFileName, DWORD dwFileAttributes)
Definition: fileinfo.c:779
BOOL WINAPI WriteFile(_In_ HANDLE hFile, _In_reads_bytes_opt_(nNumberOfBytesToWrite) LPCVOID lpBuffer, _In_ DWORD nNumberOfBytesToWrite, _Out_opt_ LPDWORD lpNumberOfBytesWritten, _Inout_opt_ LPOVERLAPPED lpOverlapped)
Definition: rw.c:25
DWORD WINAPI GetModuleFileNameW(HINSTANCE hModule, LPWSTR lpFilename, DWORD nSize)
Definition: loader.c:600
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
Definition: loader.c:838
DWORD WINAPI FormatMessageW(DWORD dwFlags, LPCVOID lpSource, DWORD dwMessageId, DWORD dwLanguageId, LPWSTR lpBuffer, DWORD nSize, __ms_va_list *args)
Definition: format_msg.c:583
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
Definition: locale.c:4152
HRESULT WINAPI UrlUnescapeW(WCHAR *url, WCHAR *unescaped, DWORD *unescaped_len, DWORD flags)
Definition: path.c:2912
HRESULT WINAPI PathCreateFromUrlW(const WCHAR *url, WCHAR *path, DWORD *pcchPath, DWORD dwReserved)
Definition: path.c:3049
BOOL WINAPI PathIsValidCharW(WCHAR c, DWORD class)
Definition: path.c:2197
_ACRTIMP int __cdecl _wcsicmp(const wchar_t *, const wchar_t *)
Definition: wcs.c:164
_ACRTIMP size_t __cdecl wcslen(const wchar_t *)
Definition: wcs.c:2988
_ACRTIMP uintptr_t __cdecl _beginthreadex(void *, unsigned int, _beginthreadex_start_routine_t, void *, unsigned int, unsigned int *)
Definition: thread.c:207
LPWSTR WINAPI StrFormatByteSizeW(LONGLONG llBytes, LPWSTR lpszDest, UINT cchMax)
Definition: string.c:854
DWORD WINAPI FtpGetFileSize(HINTERNET hFile, LPDWORD lpdwFileSizeHigh)
Definition: ftp.c:1758
BOOL WINAPI HttpQueryInfoW(HINTERNET hHttpRequest, DWORD dwInfoLevel, LPVOID lpBuffer, LPDWORD lpdwBufferLength, LPDWORD lpdwIndex)
Definition: http.c:3967
BOOL WINAPI InternetQueryOptionA(HINTERNET hInternet, DWORD dwOption, LPVOID lpBuffer, LPDWORD lpdwBufferLength)
Definition: internet.c:3286
BOOL WINAPI InternetCrackUrlW(const WCHAR *lpszUrl, DWORD dwUrlLength, DWORD dwFlags, URL_COMPONENTSW *lpUC)
Definition: internet.c:2052
BOOL WINAPI InternetCanonicalizeUrlW(LPCWSTR lpszUrl, LPWSTR lpszBuffer, LPDWORD lpdwBufferLength, DWORD dwFlags)
Definition: internet.c:2437
BOOL WINAPI InternetReadFile(HINTERNET hFile, LPVOID lpBuffer, DWORD dwNumOfBytesToRead, LPDWORD pdwNumOfBytesRead)
Definition: internet.c:2609
HINTERNET WINAPI InternetOpenUrlW(HINTERNET hInternet, LPCWSTR lpszUrl, LPCWSTR lpszHeaders, DWORD dwHeadersLength, DWORD dwFlags, DWORD_PTR dwContext)
Definition: internet.c:4341
BOOL WINAPI InternetCloseHandle(HINTERNET hInternet)
Definition: internet.c:1841
HINTERNET WINAPI InternetOpenW(LPCWSTR lpszAgent, DWORD dwAccessType, LPCWSTR lpszProxy, LPCWSTR lpszProxyBypass, DWORD dwFlags)
Definition: internet.c:1334
static VOID BitBlt(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Width, _In_ ULONG Height, _In_reads_bytes_(Height *Stride) PUCHAR Buffer, _In_ ULONG BitsPerPixel, _In_ ULONG Stride)
Definition: common.c:42
#define L(x)
Definition: resources.c:13
#define INFINITE
Definition: serial.h:102
HINSTANCE hInst
Definition: dxdiag.c:13
#define WM_APP
Definition: eventvwr.h:73
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
_In_opt_ PFILE_OBJECT _In_opt_ PETHREAD Thread
Definition: fltkernel.h:2653
pKey DeleteObject()
Status
Definition: gdiplustypes.h:24
HRESULT ExtractArchiveForExecution(PCWSTR pszArchive, const CStringW &PackageName, CStringW &TempDir, CStringW &App)
Definition: geninst.cpp:845
GLuint start
Definition: gl.h:1545
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLuint GLuint end
Definition: gl.h:1545
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLdouble n
Definition: glext.h:7729
GLsizeiptr size
Definition: glext.h:5919
GLbitfield flags
Definition: glext.h:7161
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
GLfloat GLfloat p
Definition: glext.h:8902
GLenum const GLfloat * params
Definition: glext.h:5645
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
unsigned int UINT
Definition: sysinfo.c:13
UNICODE_STRING Path
ULONG AddRef()
ULONG Release()
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define FAILED(hr)
Definition: intsafe.h:51
#define HIBYTE(W)
Definition: jmemdos.c:486
#define BEGIN_COM_MAP(x)
Definition: atlcom.h:581
#define DECLARE_NOT_AGGREGATABLE(x)
Definition: atlcom.h:651
#define END_COM_MAP()
Definition: atlcom.h:592
#define DECLARE_NO_REGISTRY()
Definition: atlcom.h:639
#define MESSAGE_HANDLER(msg, func)
Definition: atlwin.h:1952
#define BEGIN_MSG_MAP(theClass)
Definition: atlwin.h:1924
#define END_MSG_MAP()
Definition: atlwin.h:1943
BOOL DownloadApplication(CAppInfo *pAppInfo)
Definition: loaddlg.cpp:1362
static void SetFriendlyUrl(HWND hWnd, LPCWSTR pszUrl)
Definition: loaddlg.cpp:172
HWND g_hDownloadWnd
Definition: loaddlg.cpp:584
VOID UrlUnescapeAndMakeFileNameValid(CStringW &str)
Definition: loaddlg.cpp:156
BOOL DownloadListOfApplications(const CAtlList< CAppInfo * > &AppsList, UINT Flags)
Definition: loaddlg.cpp:1343
static VOID MessageBox_LoadString(HWND hOwnerWnd, INT StringID)
Definition: loaddlg.cpp:553
DownloadStatus
Definition: loaddlg.cpp:130
@ DLSTATUS_DOWNLOADING
Definition: loaddlg.cpp:132
@ DLSTATUS_FINISHED
Definition: loaddlg.cpp:136
@ DLSTATUS_WAITING_INSTALL
Definition: loaddlg.cpp:133
@ DLSTATUS_WAITING
Definition: loaddlg.cpp:131
@ DLSTATUS_INSTALLED
Definition: loaddlg.cpp:135
@ DLSTATUS_INSTALLING
Definition: loaddlg.cpp:134
static BOOL ShowLastError(HWND hWndOwner, BOOL bInetError, DWORD dwLastError)
Definition: loaddlg.cpp:563
CStringW LoadStatusString(DownloadStatus StatusParam)
Definition: loaddlg.cpp:140
#define FILENAME_VALID_CHAR
Definition: loaddlg.cpp:147
DownloadType
Definition: loaddlg.cpp:123
@ DLTYPE_DBUPDATE_UNOFFICIAL
Definition: loaddlg.cpp:126
@ DLTYPE_DBUPDATE
Definition: loaddlg.cpp:125
@ DLTYPE_APPLICATION
Definition: loaddlg.cpp:124
VOID DownloadApplicationsDB(LPCWSTR lpUrl, BOOL IsOfficial)
Definition: loaddlg.cpp:1373
HWND hMainWnd
Definition: magnifier.c:32
#define ZeroMemory
Definition: minwinbase.h:31
LONG_PTR LPARAM
Definition: minwindef.h:175
LONG_PTR LRESULT
Definition: minwindef.h:176
UINT_PTR WPARAM
Definition: minwindef.h:174
#define pch(ap)
Definition: match.c:418
#define CREATE_ALWAYS
Definition: disk.h:72
LPCWSTR szPath
Definition: env.c:37
#define _swprintf(buf, format,...)
Definition: sprintf.c:56
static HBITMAP
Definition: button.c:44
static HDC
Definition: imagelist.c:88
static HICON
Definition: imagelist.c:80
static BYTE cert[]
Definition: msg.c:1374
static BOOL protected
Definition: protectdata.c:33
int other
Definition: msacm.c:1376
HICON hIconSm
Definition: msconfig.c:44
_In_ HANDLE hFile
Definition: mswsock.h:90
Definition: rosdlgs.h:6
CAtlStringW CStringW
Definition: atlstr.h:130
_Out_ LPWSTR lpBuffer
Definition: netsh.h:68
#define FILE_SHARE_WRITE
Definition: nt_native.h:681
#define FILE_ATTRIBUTE_READONLY
Definition: nt_native.h:702
#define DWORD
Definition: nt_native.h:44
#define GENERIC_WRITE
Definition: nt_native.h:90
_In_ ULONGLONG _In_ ULONGLONG _In_ BOOLEAN Enable
Definition: ntddpcm.h:142
#define LOWORD(l)
Definition: pedump.c:82
#define WS_CHILD
Definition: pedump.c:617
short WCHAR
Definition: pedump.c:58
#define WS_VISIBLE
Definition: pedump.c:620
static const WCHAR szName[]
Definition: powrprof.c:45
#define LVS_SINGLESEL
Definition: commctrl.h:2271
#define LVS_NOCOLUMNHEADER
Definition: commctrl.h:2289
#define PBS_MARQUEE
Definition: commctrl.h:2203
#define LVIF_STATE
Definition: commctrl.h:2317
#define LVS_SHOWSELALWAYS
Definition: commctrl.h:2272
#define LVS_REPORT
Definition: commctrl.h:2267
#define LVCF_WIDTH
Definition: commctrl.h:2592
#define PBM_SETPOS
Definition: commctrl.h:2189
#define PBM_SETRANGE
Definition: commctrl.h:2188
#define LVS_NOSORTHEADER
Definition: commctrl.h:2290
#define LVIF_TEXT
Definition: commctrl.h:2314
#define LVCF_FMT
Definition: commctrl.h:2591
#define LVCF_SUBITEM
Definition: commctrl.h:2594
#define LVCFMT_LEFT
Definition: commctrl.h:2603
#define PBM_SETMARQUEE
Definition: commctrl.h:2204
DWORD dwStatus
Definition: mediaobj.idl:95
#define WM_PAINT
Definition: winuser.h:1648
HWND WINAPI CreateDialogParamW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_opt_ HWND, _In_opt_ DLGPROC, _In_ LPARAM)
#define WM_ERASEBKGND
Definition: winuser.h:1653
DWORD WINAPI GetSysColor(_In_ int)
BOOL WINAPI IsWindow(_In_opt_ HWND)
#define SW_HIDE
Definition: winuser.h:779
#define WM_CLOSE
Definition: winuser.h:1649
#define DT_NOPREFIX
Definition: winuser.h:537
#define DWLP_USER
Definition: winuser.h:883
#define GetWindowLongPtrW
Definition: winuser.h:4983
#define GCLP_HICONSM
Definition: winuser.h:683
#define MAKELPARAM(l, h)
Definition: winuser.h:4116
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define DT_CENTER
Definition: winuser.h:527
#define IDCANCEL
Definition: winuser.h:842
BOOL WINAPI GetMessageW(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT)
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define GCLP_HICON
Definition: winuser.h:682
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
#define DT_SINGLELINE
Definition: winuser.h:540
#define WM_COMMAND
Definition: winuser.h:1768
#define COLOR_3DDKSHADOW
Definition: winuser.h:950
#define MB_HELP
Definition: winuser.h:805
#define WM_INITDIALOG
Definition: winuser.h:1767
#define MB_YESNO
Definition: winuser.h:828
int WINAPI MessageBoxW(_In_opt_ HWND hWnd, _In_opt_ LPCWSTR lpText, _In_opt_ LPCWSTR lpCaption, _In_ UINT uType)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
int WINAPI MessageBoxIndirectA(_In_ CONST MSGBOXPARAMSA *lpmbp)
#define MB_ICONERROR
Definition: winuser.h:798
BOOL WINAPI SetWindowTextW(_In_ HWND, _In_opt_ LPCWSTR)
#define WM_SETTEXT
Definition: winuser.h:1645
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
#define SendMessage
Definition: winuser.h:6009
#define MB_OK
Definition: winuser.h:801
#define DT_VCENTER
Definition: winuser.h:543
#define PostMessage
Definition: winuser.h:5998
HWND WINAPI GetParent(_In_ HWND)
#define GetClassLongPtrW
Definition: winuser.h:4718
#define SW_SHOW
Definition: winuser.h:786
#define WM_DESTROY
Definition: winuser.h:1637
#define WS_EX_CLIENTEDGE
Definition: winuser.h:384
#define SetWindowText
Definition: winuser.h:6023
#define DispatchMessage
Definition: winuser.h:5931
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define IDYES
Definition: winuser.h:846
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)
#define SetWindowLongPtrW
Definition: winuser.h:5512
BOOL WINAPI InflateRect(_Inout_ LPRECT, _In_ int, _In_ int)
#define COLOR_CAPTIONTEXT
Definition: winuser.h:933
BOOL WINAPI IsWindowVisible(_In_ HWND)
BOOL WINAPI DestroyWindow(_In_ HWND)
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE hInstance, _In_ LPCWSTR lpIconName)
Definition: cursoricon.c:2444
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
INT_PTR WINAPI DialogBoxParamW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_opt_ HWND, _In_opt_ DLGPROC, _In_ LPARAM)
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
@ DAF_MODAL
Definition: dialogs.h:14
@ DAF_SILENT
Definition: dialogs.h:13
#define WM_NOTIFY_OPERATIONCOMPLETED
Definition: rapps.h:19
#define WM_NOTIFY_INSTALLERFINISHED
Definition: rapps.h:20
LONG g_Busy
Definition: winmain.cpp:17
#define DefWindowProc
Definition: ros2win.h:31
const WCHAR * str
_In_ UINT _In_ UINT cch
Definition: shellapi.h:428
#define SEE_MASK_NOCLOSEPROCESS
Definition: shellapi.h:33
BOOL WINAPI DECLSPEC_HOTPATCH ShellExecuteExW(LPSHELLEXECUTEINFOW sei)
Definition: shlexec.cpp:2738
@ PERCEIVED_TYPE_COMPRESSED
Definition: shtypes.idl:177
#define _countof(array)
Definition: sndvol32.h:70
TCHAR szAppName[128]
Definition: solitaire.cpp:18
CStringW szName
Definition: loaddlg.cpp:217
DownloadType DLType
Definition: loaddlg.cpp:212
CStringW szDependencies
Definition: loaddlg.cpp:222
CStringW szPackageName
Definition: loaddlg.cpp:219
CStringW szUrl
Definition: loaddlg.cpp:216
DownloadInfo(const CAppInfo &AppInfo, UINT DAF=0)
Definition: loaddlg.cpp:189
ULONG SizeInBytes
Definition: loaddlg.cpp:223
InstallerType IType
Definition: loaddlg.cpp:213
CStringW szSilentInstallArgs
Definition: loaddlg.cpp:221
bool Equal(const DownloadInfo &other) const
Definition: loaddlg.cpp:207
CStringW szSHA1
Definition: loaddlg.cpp:218
InstallerType IExecType
Definition: loaddlg.cpp:214
CStringW szFileName
Definition: loaddlg.cpp:220
HWND hwndOwner
Definition: winuser.h:3432
Definition: dcommon.idl:28
long bottom
Definition: dcommon.idl:29
long right
Definition: dcommon.idl:29
long left
Definition: dcommon.idl:29
long top
Definition: dcommon.idl:29
WCHAR szDownloadDir[MAX_PATH]
Definition: settings.h:10
BOOL bDelInstaller
Definition: settings.h:11
WCHAR szNoProxyFor[MAX_PATH]
Definition: settings.h:22
WCHAR szProxyServer[MAX_PATH]
Definition: settings.h:21
DWORD dwStructSize
Definition: wininet.h:211
INTERNET_SCHEME nScheme
Definition: wininet.h:214
LPWSTR lpszScheme
Definition: wininet.h:212
DWORD dwSchemeLength
Definition: wininet.h:213
PCCERT_CONTEXT pCertContext
Definition: wincrypt.h:1028
PCERT_CHAIN_ELEMENT * rgpElement
Definition: wincrypt.h:1040
LPCWSTR lpParameters
Definition: shellapi.h:340
Definition: cookie.c:202
Definition: name.c:39
Definition: style.c:91
HANDLE hItemHandle
Definition: winuser.h:3423
UINT32 cbSize
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
struct sock * chain
Definition: tcpcore.h:1
#define ICON_BIG
Definition: tnclass.cpp:51
#define ICON_SMALL
Definition: tnclass.cpp:48
#define LANG_USER_DEFAULT
Definition: tnerror.cpp:50
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1829
const char * LPCSTR
Definition: typedefs.h:52
int32_t INT_PTR
Definition: typedefs.h:64
const uint16_t * PCWSTR
Definition: typedefs.h:57
const uint16_t * LPCWSTR
Definition: typedefs.h:57
uint16_t * LPWSTR
Definition: typedefs.h:56
PVOID HANDLE
Definition: typedefs.h:73
ULONG_PTR SIZE_T
Definition: typedefs.h:80
int32_t INT
Definition: typedefs.h:58
uint64_t ULONGLONG
Definition: typedefs.h:67
uint16_t * PWCHAR
Definition: typedefs.h:56
uint32_t ULONG
Definition: typedefs.h:59
#define CMD_KEY_GENINST
Definition: unattended.h:4
#define AddItem
Definition: userenv.h:209
#define INVALID_FILE_ATTRIBUTES
Definition: vfdcmd.c:23
SERVICE_STATUS_HANDLE hStatus
Definition: w32time.c:14
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
Definition: wdfchildlist.h:690
_In_ WDFCOLLECTION _In_ ULONG Index
_In_ WDFCOLLECTION _In_ WDFOBJECT Item
HDC hdcMem
Definition: welcome.c:104
int WINAPI GetWindowTextW(HWND hWnd, LPWSTR lpString, int nMaxCount)
Definition: window.c:1382
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define FORMAT_MESSAGE_IGNORE_INSERTS
Definition: winbase.h:397
#define FORMAT_MESSAGE_FROM_SYSTEM
Definition: winbase.h:400
#define FORMAT_MESSAGE_ALLOCATE_BUFFER
Definition: winbase.h:396
#define FORMAT_MESSAGE_FROM_HMODULE
Definition: winbase.h:399
#define CALG_SHA_256
Definition: wincrypt.h:2066
#define CERT_STORE_PROV_MEMORY
Definition: wincrypt.h:2455
#define CERT_NAME_RDN_TYPE
Definition: wincrypt.h:3656
#define CERT_STORE_ADD_ALWAYS
Definition: wincrypt.h:2654
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
#define SelectFont(hdc, hfont)
Definition: windowsx.h:516
#define SetDlgMsgResult(hwnd, msg, result)
Definition: windowsx.h:518
#define GetStockFont(i)
Definition: windowsx.h:308
#define DEFAULT_GUI_FONT
Definition: wingdi.h:909
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1546
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
#define SRCCOPY
Definition: wingdi.h:333
HBITMAP WINAPI CreateCompatibleBitmap(_In_ HDC hdc, _In_ INT cx, _In_ INT cy)
BOOL WINAPI DeleteDC(_In_ HDC)
#define HTTP_STATUS_OK
Definition: winhttp.h:301
#define INTERNET_SCHEME_FTP
Definition: winhttp.h:49
#define ICU_DECODE
Definition: winhttp.h:353
#define INTERNET_SCHEME_HTTP
Definition: winhttp.h:47
#define SECURITY_FLAG_SECURE
Definition: winhttp.h:347
#define ICU_NO_ENCODE
Definition: winhttp.h:352
#define INTERNET_SCHEME_HTTPS
Definition: winhttp.h:48
#define ICU_ESCAPE
Definition: winhttp.h:53
#define INTERNET_FLAG_PRAGMA_NOCACHE
Definition: wininet.h:85
#define INTERNET_OPTION_SECURITY_FLAGS
Definition: wininet.h:725
#define INTERNET_FLAG_DONT_CACHE
Definition: wininet.h:67
#define INTERNET_FLAG_KEEP_CONNECTION
Definition: wininet.h:72
#define INTERNET_FLAG_PASSIVE
Definition: wininet.h:65
#define HTTP_QUERY_FLAG_NUMBER
Definition: wininet.h:1606
#define INTERNET_OPTION_SERVER_CERT_CHAIN_CONTEXT
Definition: wininet.h:795
#define INTERNET_OPEN_TYPE_DIRECT
Definition: wininet.h:522
@ INTERNET_SCHEME_FILE
Definition: wininet.h:143
#define INTERNET_OPEN_TYPE_PROXY
Definition: wininet.h:523
#define HTTP_QUERY_STATUS_CODE
Definition: wininet.h:1542
#define INTERNET_OPEN_TYPE_PRECONFIG
Definition: wininet.h:521
#define HTTP_QUERY_CONTENT_LENGTH
Definition: wininet.h:1528
BOOL VerifyInteg(LPCWSTR lpSHA1Hash, LPCWSTR lpFileName)
Definition: integrity.cpp:14
#define EVENTLOG_SUCCESS
Definition: winnt_old.h:3102
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
Definition: wsk.h:409
unsigned char BYTE
Definition: xxhash.c:193