2017-10-14 09:37:41 +08:00
|
|
|
#include <vcpkg/metrics.h>
|
|
|
|
|
|
|
|
#include <vcpkg/base/checks.h>
|
|
|
|
#include <vcpkg/base/files.h>
|
|
|
|
|
2016-09-19 11:50:08 +08:00
|
|
|
#include <Windows.h>
|
|
|
|
|
|
|
|
using namespace vcpkg;
|
|
|
|
|
2017-02-16 10:45:26 +08:00
|
|
|
int WINAPI WinMain(_In_ HINSTANCE, _In_opt_ HINSTANCE, _In_ LPSTR, _In_ int)
|
2016-09-19 11:50:08 +08:00
|
|
|
{
|
|
|
|
int argCount;
|
2017-04-28 09:55:00 +08:00
|
|
|
LPWSTR* szArgList = CommandLineToArgvW(GetCommandLineW(), &argCount);
|
2016-09-19 11:50:08 +08:00
|
|
|
|
2017-03-14 08:38:04 +08:00
|
|
|
Checks::check_exit(VCPKG_LINE_INFO, argCount == 2, "Requires exactly one argument, the path to the payload file");
|
2017-08-26 07:03:57 +08:00
|
|
|
auto v = Files::get_real_filesystem().read_contents(szArgList[1]).value_or_exit(VCPKG_LINE_INFO);
|
|
|
|
Metrics::g_metrics.lock()->upload(v);
|
2017-08-27 03:17:39 +08:00
|
|
|
LocalFree(szArgList);
|
|
|
|
return 0;
|
2016-09-19 11:50:08 +08:00
|
|
|
}
|