-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.h
39 lines (35 loc) · 971 Bytes
/
main.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#pragma once
#include <wuapi.h>
#include <iostream>
#include <ATLComTime.h>
#include <wuerror.h>
// Search
struct Search {
IUpdateSession* iUpdate;
IUpdateSearcher* searcher;
ISearchResult* results;
};
// Updates
struct Updates {
IUpdateCollection* UpdatesList;
IUpdate* Item;
VARIANT_BOOL InCache;
LONG Size;
BSTR Name;
DATE retdate;
OperationResultCode RC;
};
// Parameters
struct ArgParameters {
std::string CriteriaFP;
bool QuietMode = false;
};
// Functions and methods
int printUInfo(Updates upd, IUpdateCollection* ToDownloadList);
void syncDownloadUpdates(Updates upd, IUpdateCollection* ToDownloadList, IUpdateDownloader* iDownloader);
void installUpdates(Updates updates);
static void signalHandler(int s);
static void showUsage(char* name);
static int parseArgs(int argc, char* argv[], ArgParameters* params);
static BSTR getCriteria(std::string path);
int checkHR(HRESULT hr);