File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -35,6 +35,25 @@ details. */
3535#include " winf.h"
3636#include " psapi.h"
3737
38+ #include < windows.h>
39+ #include < wincon.h>
40+ typedef HRESULT (WINAPI *pAllocConsoleWithOptions)(
41+ const ALLOC_CONSOLE_OPTIONS *,
42+ ALLOC_CONSOLE_RESULT *
43+ );
44+ HRESULT CallAllocConsoleWithOptions (const ALLOC_CONSOLE_OPTIONS * opt,
45+ ALLOC_CONSOLE_RESULT * res)
46+ {
47+ HMODULE h = GetModuleHandleW (L" kernel32.dll" );
48+ if (!h)
49+ return HRESULT_FROM_WIN32 (GetLastError ());
50+ auto fn = (pAllocConsoleWithOptions)
51+ GetProcAddress (h, " AllocConsoleWithOptions" );
52+ if (!fn)
53+ return HRESULT_FROM_WIN32 (ERROR_CALL_NOT_IMPLEMENTED );
54+ return fn (opt, res);
55+ }
56+
3857/* Don't make this bigger than NT_MAX_PATH as long as the temporary buffer
3958 is allocated using tmp_pathbuf!!! */
4059#define CONVERT_LIMIT NT_MAX_PATH
You can’t perform that action at this time.
0 commit comments