Exemplo n.º 1
0
Arquivo: Log.cpp Projeto: illlust/game
void Log::OpenConsole()
{
	Lock lock(this);

	_logconsole = true;

	if (!_console)
	{
		if (_reference++ == 0)
		{
#ifndef _CONSOLE
			if (!AllocConsole())
				LOG_LAST_ERROR(GetLastError());
#endif // _CONSOLE
			_console = GetStdHandle(STD_OUTPUT_HANDLE);
		}
	}
}
Exemplo n.º 2
0
VOID
HOSTFXR_UTILITY::FindDotNetFolders(
    const std::filesystem::path &path,
    _Out_ std::vector<std::wstring> &pvFolders
)
{
    WIN32_FIND_DATAW data = {};
    const auto searchPattern = std::wstring(path) + L"\\*";
    HandleWrapper<FindFileHandleTraits> handle = FindFirstFileExW(searchPattern.c_str(), FindExInfoStandard, &data, FindExSearchNameMatch, nullptr, 0);
    if (handle == INVALID_HANDLE_VALUE)
    {
        LOG_LAST_ERROR();
        return;
    }

    do
    {
        pvFolders.emplace_back(data.cFileName);
    } while (FindNextFileW(handle, &data));
}