$treeview $search $mathjax
Stratagus  2.2.7
$projectbrief
$projectbrief
$searchbox
-->
         _________ __                 __
        /   _____//  |_____________ _/  |______     ____  __ __  ______
        \_____  \\   __\_  __ \__  \\   __\__  \   / ___\|  |  \/  ___/
        /        \|  |  |  | \// __ \|  |  / __ \_/ /_/  >  |  /\___ \
       /_______  /|__|  |__|  (____  /__| (____  /\___  /|____//____  >
               \/                  \/          \//_____/            \/
    ______________________                           ______________________
                          T H E   W A R   B E G I N S
                   Stratagus - A free fantasy real time strategy game engine

src/win32/attachconsole.cpp File Reference

#include <windows.h>
#include <io.h>
#include <fcntl.h>
#include <stdio.h>

Typedefs

typedef int FAR WINAPI proto_AttachConsole (int)
typedef int FAR WINAPI proto_NtQueryObject (HANDLE, int, void *, unsigned long int, unsigned long int *)

Functions

static int WINAPI_CheckIfConsoleHandle (HANDLE handle)
 Check if HANDLE is attached to console.
static void WINAPI_ReopenFileFromHandle (HANDLE handle, FILE *file, const char *mode)
 Try to reopen FILE* from WINAPI HANDLE.
static void WINAPI_SetStdHandleFromFile (int type, FILE *file)
 Try to set std HANDLE from FILE*.
static void WINAPI_AttachConsole (void)
 Try attach console of parent process for std input/output in Windows NT, 2000, XP or new.
 __attribute__ ((constructor)) static void initialize(void)
 This section set that WINAPI_AttachConsole() will be called at application startup before main().

Variables

static int fixmode = 0
static HINSTANCE lib_kernel32 = NULL
static HINSTANCE lib_ntdll = NULL
static proto_AttachConsolefunc_AttachConsole = NULL
static proto_NtQueryObjectfunc_NtQueryObject = NULL

Typedef Documentation

typedef int FAR WINAPI proto_AttachConsole(int)

typedef int FAR WINAPI proto_NtQueryObject(HANDLE, int, void *, unsigned long int, unsigned long int *)


Function Documentation

__attribute__ ( (constructor)   ) 

This section set that WINAPI_AttachConsole() will be called at application startup before main().

static void WINAPI_AttachConsole ( void   )  [static]

Try attach console of parent process for std input/output in Windows NT, 2000, XP or new.

static int WINAPI_CheckIfConsoleHandle ( HANDLE  handle  )  [static]

Check if HANDLE is attached to console.

static void WINAPI_ReopenFileFromHandle ( HANDLE  handle,
FILE *  file,
const char *  mode 
) [static]

Try to reopen FILE* from WINAPI HANDLE.

static void WINAPI_SetStdHandleFromFile ( int  type,
FILE *  file 
) [static]

Try to set std HANDLE from FILE*.


Variable Documentation

int fixmode = 0 [static]

HINSTANCE lib_kernel32 = NULL [static]

HINSTANCE lib_ntdll = NULL [static]

(C) Copyright 1998-2012 by The Stratagus Project under the GNU General Public License.
All trademarks and copyrights on this page are owned by their respective owners.