亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? ioinit.c

?? C標(biāo)準(zhǔn)庫(kù)源代碼,能提高對(duì)C的理解,不錯(cuò)的哦
?? C
字號(hào):
/***
*ioinit.c - Initialization for lowio functions
*
*       Copyright (c) 1992-1997, Microsoft Corporation. All rights reserved.
*
*Purpose:
*       Contains initialization and termination routines for lowio.
*       Currently, this includes:
*           1. Initial allocation of array(s) of ioinfo structs.
*           2. Processing of inherited file info from parent process.
*           3. Special case initialization of the first three ioinfo structs,
*              the ones that correspond to handles 0, 1 and 2.
*
*******************************************************************************/

#include <cruntime.h>
#include <windows.h>
#include <internal.h>
#include <malloc.h>
#include <msdos.h>
#include <rterr.h>
#include <stdlib.h>
#include <dbgint.h>

/*
 * Special static ioinfo structure. This is referred to only by the
 * _pioinfo_safe() macro, and its derivatives, in internal.h. These, in term
 * are used in certain stdio-level functions to more gracefully handle a FILE
 * with -1 in the _file field.
 */
_CRTIMP ioinfo __badioinfo = {
        0xffffffff,  /* osfhnd */
        0,           /* osfile */
#ifdef _MT
        10,          /* pipech */
        0            /* lockinitflag */
#else  /* _MT */
        10
#endif  /* _MT */
        };

/*
 * Number of ioinfo structs allocated at any given time. This number ranges
 * from a minimum of IOINFO_ARRAY_ELTS to a maximum of _NHANDLE_ (==
 * IOINFO_ARRAY_ELTS * IOINFO_ARRAYS) in steps of IOINFO_ARRAY_ELTS.
 */
int _nhandle;

/*
 * Array of pointers to arrays of ioinfo structs.
 */
_CRTIMP ioinfo * __pioinfo[IOINFO_ARRAYS];

/*
 * macro used to map 0, 1 and 2 to right value for call to GetStdHandle
 */
#define stdhndl(fh)  ( (fh == 0) ? STD_INPUT_HANDLE : ((fh == 1) ? \
                       STD_OUTPUT_HANDLE : STD_ERROR_HANDLE) )

/***
*_ioinit() -
*
*Purpose:
*       Allocates and initializes initial array(s) of ioinfo structs. Then,
*       obtains and processes information on inherited file handles from the
*       parent process (e.g., cmd.exe).
*
*       Obtains the StartupInfo structure from the OS. The inherited file
*       handle information is pointed to by the lpReserved2 field. The format
*       of the information is as follows:
*
*           bytes 0 thru 3          - integer value, say N, which is the
*                                     number of handles information is passed
*                                     about
*
*           bytes 4 thru N+3        - the N values for osfile
*
*           bytes N+4 thru 5*N+3    - N double-words, the N OS HANDLE values
*                                     being passed
*
*       Next, osfhnd and osfile for the first three ioinfo structs,
*       corrsponding to handles 0, 1 and 2, are initialized as follows:
*
*           If the value in osfhnd is INVALID_HANDLE_VALUE, then try to
*           obtain a HANDLE by calling GetStdHandle, and call GetFileType to
*           help set osfile. Otherwise, assume _osfhndl and _osfile are
*           valid, but force it to text mode (standard input/output/error
*           are to always start out in text mode).
*
*       Notes:
*           1. In general, not all of the passed info from the parent process
*              will describe open handles! If, for example, only C handle 1
*              (STDOUT) and C handle 6 are open in the parent, info for C
*              handles 0 thru 6 is passed to the the child.
*
*           2. Care is taken not to 'overflow' the arrays of ioinfo structs.
*
*           3. See exec\dospawn.c for the encoding of the file handle info
*              to be passed to a child process.
*
*Entry:
*       No parameters: reads the STARTUPINFO structure.
*
*Exit:
*       No return value.
*
*Exceptions:
*
*******************************************************************************/

void __cdecl _ioinit (
        void
        )
{
        STARTUPINFO StartupInfo;
        int cfi_len;
        int fh;
        int i;
        ioinfo *pio;
        char *posfile;
        UNALIGNED long *posfhnd;
        long stdfh;
        DWORD htype;

        /*
         * Allocate and initialize the first array of ioinfo structs. This
         * array is pointed to by __pioinfo[0]
         */
        if ( (pio = _malloc_crt( IOINFO_ARRAY_ELTS * sizeof(ioinfo) ))
             == NULL )
        {
            _amsg_exit( _RT_LOWIOINIT );
        }

        __pioinfo[0] = pio;
        _nhandle = IOINFO_ARRAY_ELTS;

        for ( ; pio < __pioinfo[0] + IOINFO_ARRAY_ELTS ; pio++ ) {
            pio->osfile = 0;
            pio->osfhnd = (long)INVALID_HANDLE_VALUE;
            pio->pipech = 10;                   /* linefeed/newline char */
#ifdef _MT
            pio->lockinitflag = 0;              /* uninitialized lock */
#endif  /* _MT */
        }

        /*
         * Process inherited file handle information, if any
         */
        GetStartupInfo( &StartupInfo );

        if ( (StartupInfo.cbReserved2 != 0) &&
             (StartupInfo.lpReserved2 != NULL) )
        {
            /*
             * Get the number of handles inherited.
             */
            cfi_len = *(UNALIGNED int *)(StartupInfo.lpReserved2);

            /*
             * Set pointers to the start of the passed file info and OS
             * HANDLE values.
             */
            posfile = (char *)(StartupInfo.lpReserved2) + sizeof( int );
            posfhnd = (UNALIGNED long *)(posfile + cfi_len);

            /*
             * Ensure cfi_len does not exceed the number of supported
             * handles!
             */
            cfi_len = __min( cfi_len, _NHANDLE_ );

            /*
             * Allocate sufficient arrays of ioinfo structs to hold inherited
             * file information.
             */
            for ( i = 1 ; _nhandle < cfi_len ; i++ ) {

                /*
                 * Allocate another array of ioinfo structs
                 */
                if ( (pio = _malloc_crt( IOINFO_ARRAY_ELTS * sizeof(ioinfo) ))
                    == NULL )
                {
                    /*
                     * No room for another array of ioinfo structs, reduce
                     * the number of inherited handles we process.
                     */
                    cfi_len = _nhandle;
                    break;
                }

                /*
                 * Update __pioinfo[] and _nhandle
                 */
                __pioinfo[i] = pio;
                _nhandle += IOINFO_ARRAY_ELTS;

                for ( ; pio < __pioinfo[i] + IOINFO_ARRAY_ELTS ; pio++ ) {
                    pio->osfile = 0;
                    pio->osfhnd = (long)INVALID_HANDLE_VALUE;
                    pio->pipech = 10;
#ifdef _MT
                    pio->lockinitflag = 0;
#endif  /* _MT */
                }
            }

            /*
             * Validate and copy the passed file information
             */
            for ( fh = 0 ; fh < cfi_len ; fh++, posfile++, posfhnd++ ) {
                /*
                 * Copy the passed file info iff it appears to describe
                 * an open, valid file or device.
                 *
                 * Note that GetFileType cannot be called for pipe handles
                 * since it may 'hang' if there is blocked read pending on
                 * the pipe in the parent.
                 */
                if ( (*posfhnd != (long)INVALID_HANDLE_VALUE) &&
                     (*posfile & FOPEN) &&
                     ((*posfile & FPIPE) ||
                      (GetFileType( (HANDLE)*posfhnd ) != FILE_TYPE_UNKNOWN)) )
                {
                    pio = _pioinfo( fh );
                    pio->osfhnd = *posfhnd;
                    pio->osfile = *posfile;
                }
            }
        }

        /*
         * If valid HANDLE-s for standard input, output and error were not
         * inherited, try to obtain them directly from the OS. Also, set the
         * appropriate bits in the osfile fields.
         */
        for ( fh = 0 ; fh < 3 ; fh++ ) {

            pio = __pioinfo[0] + fh;

            if ( pio->osfhnd == (long)INVALID_HANDLE_VALUE ) {
                /*
                 * mark the handle as open in text mode.
                 */
                pio->osfile = (char)(FOPEN | FTEXT);

                if ( ((stdfh = (long)GetStdHandle( stdhndl(fh) ))
                     != (long)INVALID_HANDLE_VALUE) && ((htype =
                     GetFileType( (HANDLE)stdfh )) != FILE_TYPE_UNKNOWN) )
                {
                    /*
                     * obtained a valid HANDLE from GetStdHandle
                     */
                    pio->osfhnd = stdfh;

                    /*
                     * finish setting osfile: determine if it is a character
                     * device or pipe.
                     */
                    if ( (htype & 0xFF) == FILE_TYPE_CHAR )
                        pio->osfile |= FDEV;
                    else if ( (htype & 0xFF) == FILE_TYPE_PIPE )
                        pio->osfile |= FPIPE;
                }
                else {
                    /*
                     * if there is no valid HANDLE, treat the CRT handle as
                     * being open in text mode on a device (with
                     * INVALID_HANDLE_VALUE underlying it).
                     */
                    pio->osfile |= FDEV;
                }
            }
            else  {
                /*
                 * handle was passed to us by parent process. make
                 * sure it is text mode.
                 */
                pio->osfile |= FTEXT;
            }
        }

        /*
         * Set the number of supported HANDLE-s to _nhandle
         */
        (void)SetHandleCount( (unsigned)_nhandle );
}


/***
*_ioterm() -
*
*Purpose:
*       Free the memory holding the ioinfo arrays.
*
*       In the multi-thread case, first walk each array of ioinfo structs and
*       delete any all initialized critical sections (locks).
*
*Entry:
*       No parameters.
*
*Exit:
*       No return value.
*
*Exceptions:
*
*******************************************************************************/

void __cdecl _ioterm (
        void
        )
{
        int i;
#ifdef _MT
        ioinfo *pio;
#endif  /* _MT */

        for ( i = 0 ; i < IOINFO_ARRAYS ; i++ ) {

            if ( __pioinfo[i] != NULL ) {
#ifdef _MT
                /*
                 * Delete any initialized critical sections.
                 */
                for ( pio = __pioinfo[i] ;
                      pio < __pioinfo[i] + IOINFO_ARRAY_ELTS ;
                      pio++ )
                {
                    if ( pio->lockinitflag )
                        DeleteCriticalSection( &(pio->lock) );
                }
#endif  /* _MT */
                /*
                 * Free the memory which held the ioinfo array.
                 */
                _free_crt( __pioinfo[i] );
                __pioinfo[i] = NULL;
            }
        }
}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩欧美国产系列| 日韩欧美中文字幕制服| 性欧美疯狂xxxxbbbb| 精品国产污网站| 91在线观看高清| 久久精品国产77777蜜臀| 国产精品理论片在线观看| 色哟哟一区二区三区| 日韩国产一二三区| 亚洲欧洲色图综合| 欧美一级精品在线| 色天使色偷偷av一区二区| 韩国精品主播一区二区在线观看 | 成人va在线观看| 五月天激情小说综合| 国产亚洲一区二区在线观看| 久久色中文字幕| 色中色一区二区| 激情综合网最新| 亚洲v精品v日韩v欧美v专区 | 日韩女优av电影| 99久久久久久99| 天天爽夜夜爽夜夜爽精品视频| 欧美激情一区二区三区全黄| 337p亚洲精品色噜噜狠狠| 99国产精品视频免费观看| 国产自产2019最新不卡| 午夜欧美电影在线观看| 亚洲免费观看高清完整版在线 | 成人欧美一区二区三区| 精品国产乱码久久久久久闺蜜| 在线亚洲免费视频| 美腿丝袜在线亚洲一区| 亚洲h在线观看| 亚洲激情六月丁香| 国产精品久久久久久久久晋中| 精品久久人人做人人爰| 91精品欧美综合在线观看最新| 91同城在线观看| 人人精品人人爱| 日精品一区二区三区| 中文字幕亚洲成人| 亚洲丝袜自拍清纯另类| 亚洲欧洲中文日韩久久av乱码| 一区二区中文字幕在线| 亚洲欧洲美洲综合色网| 亚洲少妇中出一区| 一区二区三区中文字幕| 亚洲成人资源在线| 美女视频黄免费的久久| 国产一区二区三区久久久 | 波多野结衣在线一区| 成人激情图片网| 色综合久久久久综合99| 欧美性猛片aaaaaaa做受| 欧美日韩成人综合天天影院| 7777精品伊人久久久大香线蕉 | 人人爽香蕉精品| 国产综合色精品一区二区三区| 国产美女精品人人做人人爽| 成人avav影音| 在线精品观看国产| 日韩一区二区在线观看| 久久精品欧美日韩精品| 亚洲欧洲日韩av| 日韩av电影免费观看高清完整版在线观看 | 国产精品99久久久久久久女警| 丁香网亚洲国际| 欧美性三三影院| 亚洲精品在线电影| 综合欧美亚洲日本| 成人一道本在线| 欧美日韩一区二区三区不卡| 欧美一区欧美二区| 国产精品色在线观看| 亚洲成a人在线观看| 国产精品99久久不卡二区| 色婷婷av一区二区三区gif | 日韩视频免费观看高清完整版在线观看 | 韩国一区二区在线观看| 色综合婷婷久久| 精品欧美乱码久久久久久| 亚洲欧美色图小说| 久久99国产精品免费网站| 91啪在线观看| 精品国产凹凸成av人网站| 亚洲伊人色欲综合网| 国产精品综合在线视频| 欧美日韩国产中文| 中文字幕av一区二区三区免费看 | 国产综合久久久久影院| 91久久精品一区二区二区| 2014亚洲片线观看视频免费| 夜夜操天天操亚洲| 成人综合婷婷国产精品久久蜜臀| 欧美老人xxxx18| 亚洲欧美日韩国产一区二区三区| 免费xxxx性欧美18vr| 色综合 综合色| 欧美激情在线一区二区三区| 麻豆一区二区三| 欧美系列在线观看| 亚洲视频在线一区观看| 国产另类ts人妖一区二区| 欧美精品免费视频| 亚洲精品亚洲人成人网| 成人免费视频caoporn| 日韩精品一区二区三区中文不卡 | 亚洲天堂免费在线观看视频| 精品中文字幕一区二区小辣椒| 色激情天天射综合网| 久久精品网站免费观看| 免费高清成人在线| 欧美日本一道本| 亚洲自拍都市欧美小说| 91丨九色丨黑人外教| 国产精品美女一区二区在线观看| 在线免费观看成人短视频| 国产精品美女久久久久久久久| 久久精品99国产精品日本| 欧美顶级少妇做爰| 亚洲午夜免费电影| 欧亚洲嫩模精品一区三区| 最新日韩av在线| 97久久久精品综合88久久| 国产女同性恋一区二区| 国产剧情一区二区| 久久综合久久综合久久综合| 开心九九激情九九欧美日韩精美视频电影| 欧美日韩一区高清| 天天做天天摸天天爽国产一区| 在线观看91精品国产入口| 一区二区三区日韩欧美| 在线观看av一区| 亚洲午夜在线电影| 欧美久久久影院| 首页综合国产亚洲丝袜| 欧美日韩aaaaa| 视频在线观看一区| 这里只有精品免费| 五月天久久比比资源色| 欧美精品精品一区| 美国毛片一区二区三区| 日韩精品一区二区三区视频| 精品一区二区三区日韩| 久久蜜臀精品av| 成人av电影在线播放| 亚洲同性gay激情无套| 91久久香蕉国产日韩欧美9色| 一区二区三区中文在线观看| 欧美日韩中文一区| 日韩中文字幕91| 精品国产百合女同互慰| 成人在线视频首页| 亚洲精品久久嫩草网站秘色| 欧美日韩视频在线一区二区| 日韩国产精品久久久| 精品久久久久久久人人人人传媒| 国内成+人亚洲+欧美+综合在线| 久久久久久久久97黄色工厂| 成人av免费在线观看| 亚洲午夜精品一区二区三区他趣| 91麻豆精品国产91久久久资源速度| 奇米色一区二区| 国产欧美精品一区二区色综合| 91网站在线播放| 日本美女一区二区三区视频| 久久久久国产一区二区三区四区| 99久久精品免费看| 丝袜美腿亚洲综合| 中文字幕欧美激情| 欧美午夜精品免费| 国产一区二区不卡| 亚洲视频精选在线| 5月丁香婷婷综合| 成人免费毛片嘿嘿连载视频| 亚洲一二三区在线观看| 精品国产91久久久久久久妲己| k8久久久一区二区三区 | 奇米影视7777精品一区二区| 国产亚洲成aⅴ人片在线观看| 色婷婷国产精品| 激情久久五月天| 亚洲乱码一区二区三区在线观看| 欧美一区二区精美| 99re6这里只有精品视频在线观看| 午夜成人免费电影| 国产精品久久久久久久午夜片| 欧美日韩国产影片| 成人激情校园春色| 久久精品国产一区二区三区免费看| 最新日韩在线视频| 精品国产免费一区二区三区香蕉 | 日韩欧美国产不卡| 日本乱人伦一区| 懂色av一区二区三区蜜臀 | 香蕉av福利精品导航| 中文字幕第一区| 久久综合一区二区| 91精品国产色综合久久不卡电影 |