New upstream version 18.0.1+dfsg1
This commit is contained in:
parent
6efda2859e
commit
f2cf6cce50
1337 changed files with 41178 additions and 84670 deletions
40
UI/win-update/win-update-helpers.cpp
Normal file
40
UI/win-update/win-update-helpers.cpp
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
#include "win-update-helpers.hpp"
|
||||
|
||||
void FreeProvider(HCRYPTPROV prov)
|
||||
{
|
||||
CryptReleaseContext(prov, 0);
|
||||
}
|
||||
|
||||
void FreeHash(HCRYPTHASH hash)
|
||||
{
|
||||
CryptDestroyHash(hash);
|
||||
}
|
||||
|
||||
void FreeKey(HCRYPTKEY key)
|
||||
{
|
||||
CryptDestroyKey(key);
|
||||
}
|
||||
|
||||
std::string vstrprintf(const char *format, va_list args)
|
||||
{
|
||||
if (!format)
|
||||
return std::string();
|
||||
|
||||
std::string str;
|
||||
int size = (int)vsnprintf(nullptr, 0, format, args);
|
||||
str.resize(size);
|
||||
vsnprintf(&str[0], size, format, args);
|
||||
return str;
|
||||
}
|
||||
|
||||
std::string strprintf(const char *format, ...)
|
||||
{
|
||||
std::string str;
|
||||
va_list args;
|
||||
|
||||
va_start(args, format);
|
||||
str = vstrprintf(format, args);
|
||||
va_end(args);
|
||||
|
||||
return str;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue