MCPcopy Create free account
hub / github.com/ByteCorum/DragonBurn / GetFullTempPath

Method GetFullTempPath

DragonBurn-kernel/utils.cpp:9–20  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7#include "nt.h"
8
9std::wstring kdmUtils::GetFullTempPath() {
10 wchar_t temp_directory[MAX_PATH + 1] = { 0 };
11 const uint32_t get_temp_path_ret = GetTempPathW(sizeof(temp_directory) / 2, temp_directory);
12 if (!get_temp_path_ret || get_temp_path_ret > MAX_PATH + 1) {
13 Log::Error("Failed to get temp path", false);
14 return L"";
15 }
16 if (temp_directory[wcslen(temp_directory) - 1] == L'\\')
17 temp_directory[wcslen(temp_directory) - 1] = 0x0;
18
19 return std::wstring(temp_directory);
20}
21
22bool kdmUtils::ReadFileToMemory(const std::wstring& file_path, std::vector<BYTE>* out_buffer) {
23 std::ifstream file_ifstream(file_path, std::ios::binary);

Callers

nothing calls this directly

Calls 1

ErrorFunction · 0.50

Tested by

no test coverage detected