68static int ConToCRTMode[] =
87#define CON_STREAM_SET_MODE(Stream, Mode, CacheCodePage) \
89 fflush((Stream)->fStream); \
90 if ((Mode) < ARRAYSIZE(ConToCRTMode)) \
91 _setmode(_fileno((Stream)->fStream), ConToCRTMode[(Mode)]); \
93 _setmode(_fileno((Stream)->fStream), _O_TEXT); \
111#define CON_STREAM_SET_MODE(Stream, Mode, CacheCodePage) \
113 (Stream)->Mode = (Mode); \
115 if ((Mode) == AnsiText) \
116 (Stream)->CodePage = CacheCodePage; \
117 else if ((Mode) == UTF8Text) \
118 (Stream)->CodePage = CP_UTF8; \
120 (Stream)->CodePage = INVALID_CP; \
164 if (!
Stream->IsInitialized)
221#warning The ConStreamSetCacheCodePage function does not make much sense with the CRT!
282 *
Stream->fStream = *fpOut;
#define INVALID_HANDLE_VALUE
BOOL WINAPI FlushFileBuffers(IN HANDLE hFile)
_Check_return_ _CRTIMP int __cdecl _fileno(_In_ FILE *_File)
_Check_return_ _CRTIMP FILE *__cdecl _fdopen(_In_ int _FileHandle, _In_z_ const char *_Mode)
INT __stdcall ConWrite(IN PCON_STREAM Stream, IN PCTCH szStr, IN DWORD len)
INT(__stdcall * CON_WRITE_FUNC)(IN PCON_STREAM Stream, IN PCTCH szStr, IN DWORD len)
static const PCON_STREAM StdStreams[]
_CRTIMP intptr_t __cdecl _get_osfhandle(_In_ int _FileHandle)
_CRTIMP int __cdecl _open_osfhandle(_In_ intptr_t _OSFileHandle, _In_ int _Flags)
#define IsConsoleHandle(h)
BOOL ConStreamInitEx(OUT PCON_STREAM Stream, IN PVOID Handle, IN CON_STREAM_MODE Mode, IN UINT CacheCodePage OPTIONAL, IN CON_WRITE_FUNC WriteFunc OPTIONAL)
BOOL ConStreamSetOSHandle(IN PCON_STREAM Stream, IN HANDLE Handle)
BOOL ConStreamSetCacheCodePage(IN PCON_STREAM Stream, IN UINT CacheCodePage)
#define CON_STREAM_SET_MODE(Stream, Mode, CacheCodePage)
BOOL ConStreamSetMode(IN PCON_STREAM Stream, IN CON_STREAM_MODE Mode, IN UINT CacheCodePage OPTIONAL)
BOOL ConStreamInit(OUT PCON_STREAM Stream, IN PVOID Handle, IN CON_STREAM_MODE Mode, IN UINT CacheCodePage OPTIONAL)
HANDLE ConStreamGetOSHandle(IN PCON_STREAM Stream)
enum _CON_STREAM_MODE CON_STREAM_MODE
PULONG MinorVersion OPTIONAL
VOID WINAPI InitializeCriticalSection(OUT LPCRITICAL_SECTION lpCriticalSection)