| Server IP : 209.209.40.120 / Your IP : 216.73.217.112 Web Server : Microsoft-IIS/10.0 System : Windows NT NEWWWW 10.0 build 17763 (Windows Server 2019) i586 User : NEWWWW$ ( 0) PHP Version : 8.3.30 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/Program Files (x86)/Windows Kits/10/Source/10.0.19041.0/ucrt/stdio/ |
Upload File : |
//
// getw.cpp
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// Defines _getw(), which reads a binary integer to a stream.
//
#include <corecrt_internal_stdio.h>
// Reads a binary int value from the stream, byte-by-byte. On success, returns
// the value written; on failure (error or eof), returns EOF. Note, however,
// that the value may be EOF--that is, after all, a valid integer--so be sure to
// test ferror() and feof() to check for error conditions.
extern "C" int __cdecl _getw(FILE* const stream)
{
_VALIDATE_RETURN(stream != nullptr, EINVAL, EOF);
int return_value = EOF;
_lock_file(stream);
__try
{
int value = 0;
char* const first = reinterpret_cast<char*>(&value);
char* const last = first + sizeof(value);
for (char* it = first; it != last; ++it)
{
*it = static_cast<char>(_getc_nolock(stream));
}
if (feof(stream))
__leave;
if (ferror(stream))
__leave;
return_value = value;
}
__finally
{
_unlock_file(stream);
}
return return_value;
}