CD
std::vector<char> buf;
DWORD size;
GetTokenInformation(nullptr, &size);
buf.resize(size);
GetTokenInformation(buf.data(), &size);
auto* info = (TOKEN_INFO*)buf.data(); // <- !!!UB!!!!
Size: a a a
CD
std::vector<char> buf;
DWORD size;
GetTokenInformation(nullptr, &size);
buf.resize(size);
GetTokenInformation(buf.data(), &size);
auto* info = (TOKEN_INFO*)buf.data(); // <- !!!UB!!!!
A
ПК
CD
void GetTokenInfo(char* buf, size_t size) {
new(buf) TOKEN_INFO{};
}
A
A
void GetTokenInfo(char* buf, size_t size) {
new(buf) TOKEN_INFO{};
}
CD
AT
CD
CD
CD
A
CD
CD
A
CD