MCPcopy Create free account
hub / github.com/SafeBreach-Labs/PoolParty / w_QueryInformation

Function w_QueryInformation

PoolParty/Native.hpp:287–305  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

285
286template <typename TQueryFunction, typename... TQueryFunctionArgs>
287std::vector<BYTE> w_QueryInformation(const std::string QueryFunctionName, TQueryFunction QueryFunction, TQueryFunctionArgs... QueryFunctionArgs)
288{
289 ULONG InformationLength = 0;
290 auto Ntstatus = STATUS_INFO_LENGTH_MISMATCH;
291 std::vector<BYTE> Information;
292
293 do
294 {
295 Information.resize(InformationLength);
296 Ntstatus = QueryFunction(QueryFunctionArgs..., Information.data(), InformationLength, &InformationLength);
297 } while (STATUS_INFO_LENGTH_MISMATCH == Ntstatus);
298
299 if (!NT_SUCCESS(Ntstatus))
300 {
301 throw std::runtime_error(GetLastErrorString(QueryFunctionName, RtlNtStatusToDosError(Ntstatus)));
302 }
303
304 return Information;
305}

Callers

nothing calls this directly

Calls 1

GetLastErrorStringFunction · 0.85

Tested by

no test coverage detected