ReactOS 0.4.16-dev-974-g5022a45
fmode_initializer.cpp File Reference
#include <corecrt_internal.h>
Include dependency graph for fmode_initializer.cpp:

Go to the source code of this file.

Functions

int __cdecl __acrt_initialize_fmode ()
 
 _CRTALLOC (".CRT$XIC") _PIFV const __acrt_fmode_initializer
 

Function Documentation

◆ __acrt_initialize_fmode()

int __cdecl __acrt_initialize_fmode ( )

Definition at line 27 of file txtmode.cpp.

28{
29 // The initial mode for _fmode is initialized during pre_c_initializer() in vcstartup, so that it can be overridden with a linkopt.
30 // The default value is provided by _get_startup_file_mode(), but this value is not used to initialize both _fmode states.
31 // (ex: if exe is Prog-Mode, OS-Mode _fmode is uninitialized, if exe is OS-Mode, Prog-Mode _fmode is uninitialized)
32
33 // To fix this, we adjust zero-value _fmode to _O_TEXT, since that is the default.
34 // Only the exe can use the linkopt, so the state that is not being initialized could not have requested _O_BINARY.
35
36 int * const fmode_states = _fmode.dangerous_get_state_array();
37 for (unsigned int i = 0; i != __crt_state_management::state_index_count; ++i)
38 {
39 int& fmode_state = fmode_states[i];
40 if (fmode_state == 0)
41 {
42 fmode_state = _O_TEXT;
43 }
44 }
45
46 return 0;
47}
#define _O_TEXT
Definition: cabinet.h:50
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
__crt_state_management::dual_state_global< int > _fmode
Definition: txtmode.cpp:15

◆ _CRTALLOC()

_CRTALLOC ( ".CRT$XIC"  ) const