Watt-32 tcp/ip  2.2 dev-rel.10
Functions | Variables
winmisc.c File Reference

Go to the source code of this file.

Functions

static void (MS_CDECL *orig_abort_handler)(int)
 
 __declspec (dllimport)
 
static BOOL is_gui_app (void)
 
int MS_CDECL gui_printf (const char *fmt,...)
 
static void win32_exit (void)
 
char *W32_CALL win_strerror (DWORD err)
 
BOOL GetFileVersion (const char *file_name, char *version_buf, size_t version_buf_len)
 Returns the version of a PE image (.sys, .dll or .exe).
 
static void MS_CDECL new_abort_handler (int sig)
 
static void init_win_abort (void)
 
static void CALLBACK pre_err_handler (INT_PTR arg)
 
static int init_win_bugtrap (void)
 
BOOL init_win_misc (void)
 
static BOOL WinDnsQueryCommon (WORD type, const void *what, void *result, size_t size)
 
BOOL WinDnsQuery_A4 (const char *name, DWORD *ip)
 
BOOL WinDnsQuery_A6 (const char *name, void *ip)
 
BOOL WinDnsQuery_PTR4 (DWORD ip, TCHAR *name, size_t size)
 
BOOL WinDnsQuery_PTR6 (const void *ip, TCHAR *name, size_t size)
 
BOOL WinDnsCachePut_A4 (const char *name, DWORD ip4)
 
BOOL WinDnsCachePut_A6 (const char *name, const void *ip6)
 
int __stdcall WSAStartup (WORD version_required, WSADATA *wsa_data)
 
int __stdcall WSACleanup (void)
 
int __stdcall __WSAFDIsSet (int s, winsock_fd_set *fd)
 
static BOOL CALLBACK callback (LPSTR cp)
 
static void enum_codepages (void)
 
 __declspec (naked)
 
static int is_real_key (const INPUT_RECORD *k)
 
int W32_NAMESPACE() kbhit (void)
 
static int do_getch (HANDLE h)
 
int W32_NAMESPACE() getch (void)
 
char *W32_NAMESPACE() itoa (int value, char *buf, int radix)
 
static double filetime_sec (const FILETIME *filetime)
 
void print_thread_times (HANDLE thread)
 
void print_process_times (void)
 
static const char * wide_string (const wchar_t *in_str, UINT cp)
 
static const wchar_t * ascii_string (const char *in_str, UINT cp)
 
const wchar_t * astring_acp (const char *in_str)
 
const wchar_t * astring_utf8 (const char *in_str)
 
const char * wstring_acp (const wchar_t *in_str)
 
const char * wstring_utf8 (const wchar_t *in_str)
 

Variables

CRITICAL_SECTION _watt_crit_sect
 
BOOL _watt_is_win9x = FALSE
 
BOOL _watt_is_wow64 = FALSE
 
BOOL _watt_use_bugtrap = TRUE
 
BOOL _watt_is_gui_app = FALSE
 
HANDLE stdin_hnd = INVALID_HANDLE_VALUE
 
HANDLE stdout_hnd = INVALID_HANDLE_VALUE
 
CONSOLE_SCREEN_BUFFER_INFO console_info
 

Detailed Description

Various stuff for Windows only.

Copyright (c) 2004 Gisle Vanem gvane.nosp@m.m@ya.nosp@m.hoo.n.nosp@m.o

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. All advertising materials mentioning features or use of this software must display the following acknowledgement: This product includes software developed by Gisle Vanem Bergen, Norway.

THIS SOFTWARE IS PROVIDED BY ME (Gisle Vanem) AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL I OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Definition in file winmisc.c.

Function Documentation

static void MS_CDECL new_abort_handler ( int  sig)
static
Todo:
: show a better MessageBox(). Show backtrace from where abort() was called; skip the 2 first CRT locations (raise, abort). Indent the printout 2 spaces.

Definition at line 313 of file winmisc.c.