Release 961201
Sat Nov 30 19:21:17 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [configure]
Re-generated with autoconf 2.11. Let me know if you have
problems.
* [controls/listbox.c] [controls/oldlbox.c]
Listboxes rewritten from scratch. Moved old code still used by
comboboxes to oldlbox.c
* [misc/registry.c]
Use temporary file when saving registry.
* [windows/dialog.c]
Implemented Win32 version of DlgDirList() and DlgDirListComboBox().
* [windows/winproc.c]
Added translation for listbox Win32 messages.
Sat Nov 30 21:00:00 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [controls/widgets.c] [controls/button.c]
Fixed some incompatibilities with CTL3D DLL.
* [windows/dialog.c]
Made dialog windows fit into the desktop.
* [misc/winsock.c] [misc/winsock_async.c]
New Winsock engine.
* [windows/message.c]
GetMessage() fixes.
* [windows/queue.c] [windows/hook.c] [windows/win.c]
SetMessageQueue() fixes.
Fri Nov 29 10:25:12 1996 Slaven Rezic <eserte@cs.tu-berlin.de>
* [objects/text.c]
DrawText16(): Fixed return value.
Tue Nov 26 14:47:09 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/profile.c] [*/*]
Added Win32 profile functions, updated to new naming standard.
* [objects/font.c] [if1632/thunk.c] [include/windows.h]
Added EnumFonts32*, EnumFontFamiliesEx*, changed prototypes and
structures.
* [misc/ole2nls.c] [if1632/thunk.c]
Added EnumSystemLocales() (winhelp.exe).
* [misc/registry.c]
Added Windows 3.1 registry loader supplied by Tor Sjxwall, tor@sn.no
* [win32/file.c]
Partially fixed CreateFileMapping(), added UnmapViewOfFile().
Sat Nov 23 23:36:05 1996 Ronan Waide <waider@waider.ie>
* [misc/shell.c]
Fixed some FIXMEs relating to ShellExec() and FindExecutable().
* [misc/main.c]
Implemented a few more of the SystemParametersInfo() cases.
Tue Nov 19 01:24:34 1996 Philippe De Muyter <phdm@info.ucl.ac.be>
* [include/keyboard.h]
New file, new macro WINE_VKEY_MAPPINGS (using code taken from event.c).
* [include/windows.h]
New [VK_A, VK_Z] and [VK_0, VK9] macros.
* [misc/keyboard.c]
Fixes in KeyTable and ToAscii.
* [objects/font.c]
FONT_init : Give default value for MSWIN "system" font.
FONT_MatchFont : Do not try every size of a font family if the
family does not exist.
* [windows/event.c]
lastEventChar hack removed.
KeyStateTable replaced by InputKeyStateTable (maintained in event.c)
and QueueKeyStateTable (maintained in message.c).
EVENT_key : Corrections to the extended bit setting.
* [windows/message.c] [windows/keyboard.c]
Implementation of a new QueueKeyStateTable : table of key states
valid when messages are retrieved by GetMessage or PeekMessage,
and valid for TranslateMessage.
TranslateMessage : Convert WM*KEY messages using QueueKeyStateTable
and ToAscii.
Mon Nov 18 16:59:01 1996 Robert Pouliot <krynos@clic.net>
* [graphics/Makefile.in] [graphics/wing.c]
[if1632/wing.spec]
Some functions for WinG support, mostly empty stubs.
* [misc/crtdll.c] [if1632/crtdll.spec]
Many functions added to CRTDLL, mostly calls to Unix C library.
1996-12-01 18:17:47 +01:00
|
|
|
/*
|
|
|
|
* based on Windows Sockets 1.1 specs
|
2002-06-01 01:06:46 +02:00
|
|
|
*
|
2002-03-10 00:29:33 +01:00
|
|
|
* Copyright (C) 1993,1994,1996,1997 John Brezak, Erik Bos, Alex Korobka.
|
2013-09-04 03:51:58 +02:00
|
|
|
* Copyright (C) 2001 Stefan Leichter
|
|
|
|
* Copyright (C) 2004 Hans Leidekker
|
2005-11-16 12:21:57 +01:00
|
|
|
* Copyright (C) 2005 Marcus Meissner
|
2008-04-24 13:45:10 +02:00
|
|
|
* Copyright (C) 2006-2008 Kai Blin
|
2002-03-10 00:29:33 +01:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
2006-05-18 14:49:52 +02:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
1997-06-16 19:43:53 +02:00
|
|
|
*
|
2002-06-01 01:06:46 +02:00
|
|
|
* NOTE: If you make any changes to fix a particular app, make sure
|
|
|
|
* they don't break something else like Netscape or telnet and ftp
|
Release 980201
Sun Feb 1 13:24:54 1998 Alexandre Julliard <julliard@lrc.epfl.ch>
* [files/drive.c]
Added Device= parameter to drive configuration.
* [if1632/relay.c]
Throw() and Catch() now use the correct CATCHBUF layout (untested).
* [tools/build.c] [include/stackframe.h] [loader/task.c]
Moved 16-bit stack pointer into thread database.
Save current %fs while running 16-bit code.
Fri Jan 30 09:25:49 1998 Martin Boehme <boehme@informatik.mu-luebeck.de>
* [graphics/mapping.c]
Made DPtoLP32 and LPtoDP32 respect world transforms.
* [graphics/path.c] [graphics/painting.c] [if1632/gdi.spec]
[include/path.h]
More path support.
* [include/gdi.h] [include/windows.h] [objects/dc.c]
[relay/gdi32.spec]
Support for Get/SetArcDirection and Get/SetWorldTransform
* [windows/hook.c]
Fixed a bug in HOOK_Map16To32Common.
Thu Jan 29 23:43:18 1998 Douglas Ridgway <ridgway@taiga.gmcl.com>
* [graphics/metafiledrv/init.c] [objects/metafile.c]
Documentation for metafile related API calls. Fixed a bug to avoid
documenting it.
* [include/windows.h]
Declaration for LoadImage.
Thu Jan 29 21:44:45 1998 Huw D M Davies <h.davies1@physics.oxford.ac.uk>
* [graphics/win16drv/*]
Changes to printing code to enable use of printer fonts with the
win3.1 postscript driver. Remember to add printer=on to [wine]
section of wine.conf . You will also need to disable truetype
fonts from control panel. Winword 6.0 and Write seem to be happy
with this...
* [include/bitmap.h]
Fix Widthbytes for 15bpp displays.
Tue Jan 27 20:54:08 1998 Kristian Nielsen <kristian.nielsen@risoe.dk>
* [tsx11/*] [include/ts*] [tools/make_X11wrappers]
Implemented thread-safe X11 wrappers.
Tue Jan 27 13:54:09 1998 Constantine Sapuntzakis <csapuntz@tma-1.lcs.mit.edu>
* [windows/queue.c]
Forgot to convert thdb to thread_id.
* [misc/registry.c]
Sped up Windows 95 registry reading. Changed code to traverse
registry as a tree rather than read in all possible keys
(including dead ones).
Tue Jan 27 12:46:09 1998 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [loader/pe_image.c][Makefile.in][scheduler/thread.c]
[libtest/hello5.c]
Don't exit() on failed to load referenced dlls.
Fixed static tls allocation for multiple threads.
WINELIB should now be able to load PE dlls. A sample
winelib program, that dynamically loads a internal dll
is included.
* [graphics/ddraw.c][include/ddraw.h][include/d3d.h]
Cleaned up and enhanced further. Added several DirectX5
interface definitions and DirectSurface3 implementation.
Stubs for D3D (NOT coming soon, just there so it fails safely).
* [multimedia/dsound.c][include/dsound.h]
Actually works now for a lot of cases. Some DirectX5 stuff
added. Still lacking several features.
* [windows/dinput.c][include/dinput.h]
Started implementing DirectInput. Doesn't work yet, don't
know why.
* [if1632/thunk.c][misc/callbacks.c]
[win32/kernel.c][include/callbacks.h]
Added WOWCallback16Ex, WOWHandle32.
* [misc/cpu.c]
Fixed GetSystemInfo, IsProcessorFeaturePresent.
* [multimedia/joystick.c][multimedia/time.c]
Several fixes. Small hack to get timerevents in timeGetTime() loops.
Tue Jan 20 11:26:27 1998 Slaven Rezic <eserte@cs.tu-berlin.de>
* [configure.in]
Fixed check for union semun on FreeBSD systems.
Sun Jan 18 23:05:04 1998 Karl Backstrm <karl_b@geocities.com>
* [misc/ole2nls.c] [programs/progman/Sw.rc] [programs/winhelp/Sw.rc]
[resources/sysres_Sw.rc]
Added/updated Swedish language support.
Sun Jan 18 18:49:01 1998 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [misc/winsock.c] [misc/winsock_dns.c] [windows/event.c]
[windows/win.c] [windows/dce.c] [windows/winpos.c]
Bug fixes.
Sun Jan 18 12:45:23 1997 Andreas Mohr <100.30936@germany.net>
* [msdos/int25.c] [msdos/int26.c]
Implemented "native" absolute disk read/write access.
* [msdos/int13.c] [msdos/ioports.c]
Enhanced GET DRIVE PARAMETERS (int13 AH=08).
* [graphics/win16drv/prtdrv.c] [if1632/gdi.spec]
Fixed typos, implemented dmEnumDFonts,
Started implementation of dmRealizeObject.
* [if1632/compobj.spec] [ole/compobj.c] [relay32/ole32.spec]
Stubs CoCreateInstance, CoFreeUnusedLibraries, implemented
CoFileTimeNow.
* [if1632/kernel.spec] [include/windows.h] [memory/global.c]
[memory/string.c] [misc/kernel.c] [misc/Makefile.in]
[misc/toolhelp.c] [msdos/int21.c]
Implemented GlobalHandleNoRIP, GetFreeMemInfo, DebugFillBuffer,
stubs GetSetKernelDOSProc, DiagQuery, DiagOutput, ToolHelpHook
(Undocumented Windows).
* [if1632/user.spec] [if1632/win32s16.spec] [misc/win32s16.c]
Misc stubs.
* [if1632/winaspi.spec] [misc/aspi.c]
Implemented GetASPIDLLVersion.
* [if1632/wprocs.spec] [msdos/int20.c] [msdos/Makefile.in]
Added handler for Int 0x20 (terminate program, _very_ old-fashioned).
* [misc/w32scomb.c]
Implemented Get16DLLAddress() partially
(big thanks to Marcus and Alexandre).
* [relay32/Makefile.in] [relay32/builtin32.c] [relay32/dplay.spec]
Added built-in DPLAY.DLL.
* [relay32/winmm.spec] [multimedia/joystick.c]
Added joySetThreshold.
* [misc/windebug.c]
Added WinNotify.
* [win32/console.c]
Stubs CreateConsoleScreenBuffer, SetConsoleActiveScreenBuffer,
WriteConsoleOutput32A.
* [windows/user.c]
Stub SetEventHook.
Sat Jan 17 19:30:35 1998 Matthew Toseland <Paul.Toseland@btinternet.com>
* [windows/painting.c]
Fixed broken restore-to-maximized.
Mon Jan 12 21:25:32 1998 Perceval - Marc Huguet Puig <mhp@tinet.fut.es>
* [documentation/wine.man] [include/options.h]
[misc/main.c] [ole/ole2nls.c] [resources/sysres.c]
[resources/sysres_Ca.rc] [resources/Makefile.in]
Added language catalan. (Afegit l'idioma catal).
1998-02-01 19:33:27 +01:00
|
|
|
* clients and servers (www.winsite.com got a lot of those).
|
Release 961201
Sat Nov 30 19:21:17 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [configure]
Re-generated with autoconf 2.11. Let me know if you have
problems.
* [controls/listbox.c] [controls/oldlbox.c]
Listboxes rewritten from scratch. Moved old code still used by
comboboxes to oldlbox.c
* [misc/registry.c]
Use temporary file when saving registry.
* [windows/dialog.c]
Implemented Win32 version of DlgDirList() and DlgDirListComboBox().
* [windows/winproc.c]
Added translation for listbox Win32 messages.
Sat Nov 30 21:00:00 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [controls/widgets.c] [controls/button.c]
Fixed some incompatibilities with CTL3D DLL.
* [windows/dialog.c]
Made dialog windows fit into the desktop.
* [misc/winsock.c] [misc/winsock_async.c]
New Winsock engine.
* [windows/message.c]
GetMessage() fixes.
* [windows/queue.c] [windows/hook.c] [windows/win.c]
SetMessageQueue() fixes.
Fri Nov 29 10:25:12 1996 Slaven Rezic <eserte@cs.tu-berlin.de>
* [objects/text.c]
DrawText16(): Fixed return value.
Tue Nov 26 14:47:09 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/profile.c] [*/*]
Added Win32 profile functions, updated to new naming standard.
* [objects/font.c] [if1632/thunk.c] [include/windows.h]
Added EnumFonts32*, EnumFontFamiliesEx*, changed prototypes and
structures.
* [misc/ole2nls.c] [if1632/thunk.c]
Added EnumSystemLocales() (winhelp.exe).
* [misc/registry.c]
Added Windows 3.1 registry loader supplied by Tor Sjxwall, tor@sn.no
* [win32/file.c]
Partially fixed CreateFileMapping(), added UnmapViewOfFile().
Sat Nov 23 23:36:05 1996 Ronan Waide <waider@waider.ie>
* [misc/shell.c]
Fixed some FIXMEs relating to ShellExec() and FindExecutable().
* [misc/main.c]
Implemented a few more of the SystemParametersInfo() cases.
Tue Nov 19 01:24:34 1996 Philippe De Muyter <phdm@info.ucl.ac.be>
* [include/keyboard.h]
New file, new macro WINE_VKEY_MAPPINGS (using code taken from event.c).
* [include/windows.h]
New [VK_A, VK_Z] and [VK_0, VK9] macros.
* [misc/keyboard.c]
Fixes in KeyTable and ToAscii.
* [objects/font.c]
FONT_init : Give default value for MSWIN "system" font.
FONT_MatchFont : Do not try every size of a font family if the
family does not exist.
* [windows/event.c]
lastEventChar hack removed.
KeyStateTable replaced by InputKeyStateTable (maintained in event.c)
and QueueKeyStateTable (maintained in message.c).
EVENT_key : Corrections to the extended bit setting.
* [windows/message.c] [windows/keyboard.c]
Implementation of a new QueueKeyStateTable : table of key states
valid when messages are retrieved by GetMessage or PeekMessage,
and valid for TranslateMessage.
TranslateMessage : Convert WM*KEY messages using QueueKeyStateTable
and ToAscii.
Mon Nov 18 16:59:01 1996 Robert Pouliot <krynos@clic.net>
* [graphics/Makefile.in] [graphics/wing.c]
[if1632/wing.spec]
Some functions for WinG support, mostly empty stubs.
* [misc/crtdll.c] [if1632/crtdll.spec]
Many functions added to CRTDLL, mostly calls to Unix C library.
1996-12-01 18:17:47 +01:00
|
|
|
*/
|
2001-11-14 22:26:23 +01:00
|
|
|
|
2001-11-06 21:57:11 +01:00
|
|
|
#include "config.h"
|
2001-10-14 18:25:47 +02:00
|
|
|
#include "wine/port.h"
|
1998-04-13 14:21:30 +02:00
|
|
|
|
2021-05-01 02:09:58 +02:00
|
|
|
#include "ws2_32_private.h"
|
Release 961201
Sat Nov 30 19:21:17 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [configure]
Re-generated with autoconf 2.11. Let me know if you have
problems.
* [controls/listbox.c] [controls/oldlbox.c]
Listboxes rewritten from scratch. Moved old code still used by
comboboxes to oldlbox.c
* [misc/registry.c]
Use temporary file when saving registry.
* [windows/dialog.c]
Implemented Win32 version of DlgDirList() and DlgDirListComboBox().
* [windows/winproc.c]
Added translation for listbox Win32 messages.
Sat Nov 30 21:00:00 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [controls/widgets.c] [controls/button.c]
Fixed some incompatibilities with CTL3D DLL.
* [windows/dialog.c]
Made dialog windows fit into the desktop.
* [misc/winsock.c] [misc/winsock_async.c]
New Winsock engine.
* [windows/message.c]
GetMessage() fixes.
* [windows/queue.c] [windows/hook.c] [windows/win.c]
SetMessageQueue() fixes.
Fri Nov 29 10:25:12 1996 Slaven Rezic <eserte@cs.tu-berlin.de>
* [objects/text.c]
DrawText16(): Fixed return value.
Tue Nov 26 14:47:09 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/profile.c] [*/*]
Added Win32 profile functions, updated to new naming standard.
* [objects/font.c] [if1632/thunk.c] [include/windows.h]
Added EnumFonts32*, EnumFontFamiliesEx*, changed prototypes and
structures.
* [misc/ole2nls.c] [if1632/thunk.c]
Added EnumSystemLocales() (winhelp.exe).
* [misc/registry.c]
Added Windows 3.1 registry loader supplied by Tor Sjxwall, tor@sn.no
* [win32/file.c]
Partially fixed CreateFileMapping(), added UnmapViewOfFile().
Sat Nov 23 23:36:05 1996 Ronan Waide <waider@waider.ie>
* [misc/shell.c]
Fixed some FIXMEs relating to ShellExec() and FindExecutable().
* [misc/main.c]
Implemented a few more of the SystemParametersInfo() cases.
Tue Nov 19 01:24:34 1996 Philippe De Muyter <phdm@info.ucl.ac.be>
* [include/keyboard.h]
New file, new macro WINE_VKEY_MAPPINGS (using code taken from event.c).
* [include/windows.h]
New [VK_A, VK_Z] and [VK_0, VK9] macros.
* [misc/keyboard.c]
Fixes in KeyTable and ToAscii.
* [objects/font.c]
FONT_init : Give default value for MSWIN "system" font.
FONT_MatchFont : Do not try every size of a font family if the
family does not exist.
* [windows/event.c]
lastEventChar hack removed.
KeyStateTable replaced by InputKeyStateTable (maintained in event.c)
and QueueKeyStateTable (maintained in message.c).
EVENT_key : Corrections to the extended bit setting.
* [windows/message.c] [windows/keyboard.c]
Implementation of a new QueueKeyStateTable : table of key states
valid when messages are retrieved by GetMessage or PeekMessage,
and valid for TranslateMessage.
TranslateMessage : Convert WM*KEY messages using QueueKeyStateTable
and ToAscii.
Mon Nov 18 16:59:01 1996 Robert Pouliot <krynos@clic.net>
* [graphics/Makefile.in] [graphics/wing.c]
[if1632/wing.spec]
Some functions for WinG support, mostly empty stubs.
* [misc/crtdll.c] [if1632/crtdll.spec]
Many functions added to CRTDLL, mostly calls to Unix C library.
1996-12-01 18:17:47 +01:00
|
|
|
|
2012-10-27 12:39:59 +02:00
|
|
|
#if defined(linux) && !defined(IP_UNICAST_IF)
|
|
|
|
#define IP_UNICAST_IF 50
|
|
|
|
#endif
|
2004-09-07 22:47:03 +02:00
|
|
|
|
2011-06-30 04:38:17 +02:00
|
|
|
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
|
2003-01-23 22:20:36 +01:00
|
|
|
# define sipx_network sipx_addr.x_net
|
2003-01-28 02:07:09 +01:00
|
|
|
# define sipx_node sipx_addr.x_host.c_host
|
2003-01-23 22:20:36 +01:00
|
|
|
#endif /* __FreeBSD__ */
|
2000-07-23 21:28:24 +02:00
|
|
|
|
2015-10-07 20:19:42 +02:00
|
|
|
#define FILE_USE_FILE_POINTER_POSITION ((LONGLONG)-2)
|
|
|
|
|
2002-03-10 00:29:33 +01:00
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(winsock);
|
2009-12-08 14:09:05 +01:00
|
|
|
WINE_DECLARE_DEBUG_CHANNEL(winediag);
|
1999-04-19 16:56:29 +02:00
|
|
|
|
2020-09-29 05:35:02 +02:00
|
|
|
static const WSAPROTOCOL_INFOW supported_protocols[] =
|
|
|
|
{
|
|
|
|
{
|
|
|
|
.dwServiceFlags1 = XP1_IFS_HANDLES | XP1_EXPEDITED_DATA | XP1_GRACEFUL_CLOSE
|
|
|
|
| XP1_GUARANTEED_ORDER | XP1_GUARANTEED_DELIVERY,
|
|
|
|
.dwProviderFlags = PFL_MATCHES_PROTOCOL_ZERO,
|
|
|
|
.ProviderId = {0xe70f1aa0, 0xab8b, 0x11cf, {0x8c, 0xa3, 0x00, 0x80, 0x5f, 0x48, 0xa1, 0x92}},
|
|
|
|
.dwCatalogEntryId = 1001,
|
|
|
|
.ProtocolChain.ChainLen = 1,
|
|
|
|
.iVersion = 2,
|
|
|
|
.iAddressFamily = WS_AF_INET,
|
|
|
|
.iMaxSockAddr = sizeof(struct WS_sockaddr_in),
|
|
|
|
.iMinSockAddr = sizeof(struct WS_sockaddr_in),
|
|
|
|
.iSocketType = WS_SOCK_STREAM,
|
|
|
|
.iProtocol = WS_IPPROTO_TCP,
|
|
|
|
.szProtocol = {'T','C','P','/','I','P',0},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
.dwServiceFlags1 = XP1_IFS_HANDLES | XP1_SUPPORT_BROADCAST
|
|
|
|
| XP1_SUPPORT_MULTIPOINT | XP1_MESSAGE_ORIENTED | XP1_CONNECTIONLESS,
|
|
|
|
.dwProviderFlags = PFL_MATCHES_PROTOCOL_ZERO,
|
|
|
|
.ProviderId = {0xe70f1aa0, 0xab8b, 0x11cf, {0x8c, 0xa3, 0x00, 0x80, 0x5f, 0x48, 0xa1, 0x92}},
|
|
|
|
.dwCatalogEntryId = 1002,
|
|
|
|
.ProtocolChain.ChainLen = 1,
|
|
|
|
.iVersion = 2,
|
|
|
|
.iAddressFamily = WS_AF_INET,
|
|
|
|
.iMaxSockAddr = sizeof(struct WS_sockaddr_in),
|
|
|
|
.iMinSockAddr = sizeof(struct WS_sockaddr_in),
|
|
|
|
.iSocketType = WS_SOCK_DGRAM,
|
|
|
|
.iProtocol = WS_IPPROTO_UDP,
|
|
|
|
.dwMessageSize = 0xffbb,
|
|
|
|
.szProtocol = {'U','D','P','/','I','P',0},
|
|
|
|
},
|
2020-09-29 05:35:04 +02:00
|
|
|
{
|
|
|
|
.dwServiceFlags1 = XP1_IFS_HANDLES | XP1_EXPEDITED_DATA | XP1_GRACEFUL_CLOSE
|
|
|
|
| XP1_GUARANTEED_ORDER | XP1_GUARANTEED_DELIVERY,
|
|
|
|
.dwProviderFlags = PFL_MATCHES_PROTOCOL_ZERO,
|
|
|
|
.ProviderId = {0xf9eab0c0, 0x26d4, 0x11d0, {0xbb, 0xbf, 0x00, 0xaa, 0x00, 0x6c, 0x34, 0xe4}},
|
|
|
|
.dwCatalogEntryId = 1004,
|
|
|
|
.ProtocolChain.ChainLen = 1,
|
|
|
|
.iVersion = 2,
|
|
|
|
.iAddressFamily = WS_AF_INET6,
|
|
|
|
.iMaxSockAddr = sizeof(struct WS_sockaddr_in6),
|
|
|
|
.iMinSockAddr = sizeof(struct WS_sockaddr_in6),
|
|
|
|
.iSocketType = WS_SOCK_STREAM,
|
|
|
|
.iProtocol = WS_IPPROTO_TCP,
|
|
|
|
.szProtocol = {'T','C','P','/','I','P','v','6',0},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
.dwServiceFlags1 = XP1_IFS_HANDLES | XP1_SUPPORT_BROADCAST
|
|
|
|
| XP1_SUPPORT_MULTIPOINT | XP1_MESSAGE_ORIENTED | XP1_CONNECTIONLESS,
|
|
|
|
.dwProviderFlags = PFL_MATCHES_PROTOCOL_ZERO,
|
|
|
|
.ProviderId = {0xf9eab0c0, 0x26d4, 0x11d0, {0xbb, 0xbf, 0x00, 0xaa, 0x00, 0x6c, 0x34, 0xe4}},
|
|
|
|
.dwCatalogEntryId = 1005,
|
|
|
|
.ProtocolChain.ChainLen = 1,
|
|
|
|
.iVersion = 2,
|
|
|
|
.iAddressFamily = WS_AF_INET6,
|
|
|
|
.iMaxSockAddr = sizeof(struct WS_sockaddr_in6),
|
|
|
|
.iMinSockAddr = sizeof(struct WS_sockaddr_in6),
|
|
|
|
.iSocketType = WS_SOCK_DGRAM,
|
|
|
|
.iProtocol = WS_IPPROTO_UDP,
|
|
|
|
.dwMessageSize = 0xffbb,
|
|
|
|
.szProtocol = {'U','D','P','/','I','P','v','6',0},
|
|
|
|
},
|
2020-09-29 05:35:02 +02:00
|
|
|
{
|
|
|
|
.dwServiceFlags1 = XP1_PARTIAL_MESSAGE | XP1_SUPPORT_BROADCAST
|
|
|
|
| XP1_SUPPORT_MULTIPOINT | XP1_MESSAGE_ORIENTED | XP1_CONNECTIONLESS,
|
|
|
|
.dwProviderFlags = PFL_MATCHES_PROTOCOL_ZERO,
|
|
|
|
.ProviderId = {0x11058240, 0xbe47, 0x11cf, {0x95, 0xc8, 0x00, 0x80, 0x5f, 0x48, 0xa1, 0x92}},
|
|
|
|
.dwCatalogEntryId = 1030,
|
|
|
|
.ProtocolChain.ChainLen = 1,
|
|
|
|
.iVersion = 2,
|
|
|
|
.iAddressFamily = WS_AF_IPX,
|
|
|
|
.iMaxSockAddr = sizeof(struct WS_sockaddr),
|
|
|
|
.iMinSockAddr = sizeof(struct WS_sockaddr_ipx),
|
|
|
|
.iSocketType = WS_SOCK_DGRAM,
|
|
|
|
.iProtocol = WS_NSPROTO_IPX,
|
|
|
|
.iProtocolMaxOffset = 255,
|
|
|
|
.dwMessageSize = 0x240,
|
|
|
|
.szProtocol = {'I','P','X',0},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
.dwServiceFlags1 = XP1_IFS_HANDLES | XP1_PSEUDO_STREAM | XP1_MESSAGE_ORIENTED
|
|
|
|
| XP1_GUARANTEED_ORDER | XP1_GUARANTEED_DELIVERY,
|
|
|
|
.dwProviderFlags = PFL_MATCHES_PROTOCOL_ZERO,
|
|
|
|
.ProviderId = {0x11058241, 0xbe47, 0x11cf, {0x95, 0xc8, 0x00, 0x80, 0x5f, 0x48, 0xa1, 0x92}},
|
|
|
|
.dwCatalogEntryId = 1031,
|
|
|
|
.ProtocolChain.ChainLen = 1,
|
|
|
|
.iVersion = 2,
|
|
|
|
.iAddressFamily = WS_AF_IPX,
|
|
|
|
.iMaxSockAddr = sizeof(struct WS_sockaddr),
|
|
|
|
.iMinSockAddr = sizeof(struct WS_sockaddr_ipx),
|
|
|
|
.iSocketType = WS_SOCK_SEQPACKET,
|
|
|
|
.iProtocol = WS_NSPROTO_SPX,
|
|
|
|
.dwMessageSize = UINT_MAX,
|
|
|
|
.szProtocol = {'S','P','X',0},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
.dwServiceFlags1 = XP1_IFS_HANDLES | XP1_GRACEFUL_CLOSE | XP1_PSEUDO_STREAM
|
|
|
|
| XP1_MESSAGE_ORIENTED | XP1_GUARANTEED_ORDER | XP1_GUARANTEED_DELIVERY,
|
|
|
|
.dwProviderFlags = PFL_MATCHES_PROTOCOL_ZERO,
|
|
|
|
.ProviderId = {0x11058241, 0xbe47, 0x11cf, {0x95, 0xc8, 0x00, 0x80, 0x5f, 0x48, 0xa1, 0x92}},
|
|
|
|
.dwCatalogEntryId = 1033,
|
|
|
|
.ProtocolChain.ChainLen = 1,
|
|
|
|
.iVersion = 2,
|
|
|
|
.iAddressFamily = WS_AF_IPX,
|
|
|
|
.iMaxSockAddr = sizeof(struct WS_sockaddr),
|
|
|
|
.iMinSockAddr = sizeof(struct WS_sockaddr_ipx),
|
|
|
|
.iSocketType = WS_SOCK_SEQPACKET,
|
|
|
|
.iProtocol = WS_NSPROTO_SPXII,
|
|
|
|
.dwMessageSize = UINT_MAX,
|
|
|
|
.szProtocol = {'S','P','X',' ','I','I',0},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
2020-09-10 23:17:14 +02:00
|
|
|
DECLARE_CRITICAL_SECTION(cs_socket_list);
|
2000-09-24 21:41:57 +02:00
|
|
|
|
2020-09-10 23:17:14 +02:00
|
|
|
static SOCKET *socket_list;
|
|
|
|
static unsigned int socket_list_size;
|
2020-06-10 20:22:51 +02:00
|
|
|
|
2021-05-01 02:09:58 +02:00
|
|
|
const char *debugstr_sockaddr( const struct WS_sockaddr *a )
|
2003-11-29 00:14:02 +01:00
|
|
|
{
|
|
|
|
if (!a) return "(nil)";
|
2009-08-03 18:33:02 +02:00
|
|
|
switch (a->sa_family)
|
|
|
|
{
|
|
|
|
case WS_AF_INET:
|
2015-08-10 16:08:44 +02:00
|
|
|
{
|
|
|
|
char buf[16];
|
|
|
|
const char *p;
|
|
|
|
struct WS_sockaddr_in *sin = (struct WS_sockaddr_in *)a;
|
|
|
|
|
|
|
|
p = WS_inet_ntop( WS_AF_INET, &sin->sin_addr, buf, sizeof(buf) );
|
|
|
|
if (!p)
|
|
|
|
p = "(unknown IPv4 address)";
|
|
|
|
|
2009-08-03 18:33:02 +02:00
|
|
|
return wine_dbg_sprintf("{ family AF_INET, address %s, port %d }",
|
2015-08-10 16:08:44 +02:00
|
|
|
p, ntohs(sin->sin_port));
|
|
|
|
}
|
2009-08-03 18:33:02 +02:00
|
|
|
case WS_AF_INET6:
|
|
|
|
{
|
|
|
|
char buf[46];
|
|
|
|
const char *p;
|
|
|
|
struct WS_sockaddr_in6 *sin = (struct WS_sockaddr_in6 *)a;
|
|
|
|
|
|
|
|
p = WS_inet_ntop( WS_AF_INET6, &sin->sin6_addr, buf, sizeof(buf) );
|
|
|
|
if (!p)
|
|
|
|
p = "(unknown IPv6 address)";
|
|
|
|
return wine_dbg_sprintf("{ family AF_INET6, address %s, port %d }",
|
|
|
|
p, ntohs(sin->sin6_port));
|
|
|
|
}
|
2013-12-27 21:28:05 +01:00
|
|
|
case WS_AF_IPX:
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
char netnum[16], nodenum[16];
|
|
|
|
struct WS_sockaddr_ipx *sin = (struct WS_sockaddr_ipx *)a;
|
|
|
|
|
|
|
|
for (i = 0;i < 4; i++) sprintf(netnum + i * 2, "%02X", (unsigned char) sin->sa_netnum[i]);
|
|
|
|
for (i = 0;i < 6; i++) sprintf(nodenum + i * 2, "%02X", (unsigned char) sin->sa_nodenum[i]);
|
|
|
|
|
|
|
|
return wine_dbg_sprintf("{ family AF_IPX, address %s.%s, ipx socket %d }",
|
|
|
|
netnum, nodenum, sin->sa_socket);
|
|
|
|
}
|
2009-08-12 18:15:17 +02:00
|
|
|
case WS_AF_IRDA:
|
|
|
|
{
|
|
|
|
DWORD addr;
|
|
|
|
|
|
|
|
memcpy( &addr, ((const SOCKADDR_IRDA *)a)->irdaDeviceID, sizeof(addr) );
|
|
|
|
addr = ntohl( addr );
|
|
|
|
return wine_dbg_sprintf("{ family AF_IRDA, addr %08x, name %s }",
|
|
|
|
addr,
|
|
|
|
((const SOCKADDR_IRDA *)a)->irdaServiceName);
|
|
|
|
}
|
2009-08-03 18:33:02 +02:00
|
|
|
default:
|
|
|
|
return wine_dbg_sprintf("{ family %d }", a->sa_family);
|
|
|
|
}
|
2003-11-29 00:14:02 +01:00
|
|
|
}
|
Release 961201
Sat Nov 30 19:21:17 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [configure]
Re-generated with autoconf 2.11. Let me know if you have
problems.
* [controls/listbox.c] [controls/oldlbox.c]
Listboxes rewritten from scratch. Moved old code still used by
comboboxes to oldlbox.c
* [misc/registry.c]
Use temporary file when saving registry.
* [windows/dialog.c]
Implemented Win32 version of DlgDirList() and DlgDirListComboBox().
* [windows/winproc.c]
Added translation for listbox Win32 messages.
Sat Nov 30 21:00:00 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [controls/widgets.c] [controls/button.c]
Fixed some incompatibilities with CTL3D DLL.
* [windows/dialog.c]
Made dialog windows fit into the desktop.
* [misc/winsock.c] [misc/winsock_async.c]
New Winsock engine.
* [windows/message.c]
GetMessage() fixes.
* [windows/queue.c] [windows/hook.c] [windows/win.c]
SetMessageQueue() fixes.
Fri Nov 29 10:25:12 1996 Slaven Rezic <eserte@cs.tu-berlin.de>
* [objects/text.c]
DrawText16(): Fixed return value.
Tue Nov 26 14:47:09 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/profile.c] [*/*]
Added Win32 profile functions, updated to new naming standard.
* [objects/font.c] [if1632/thunk.c] [include/windows.h]
Added EnumFonts32*, EnumFontFamiliesEx*, changed prototypes and
structures.
* [misc/ole2nls.c] [if1632/thunk.c]
Added EnumSystemLocales() (winhelp.exe).
* [misc/registry.c]
Added Windows 3.1 registry loader supplied by Tor Sjxwall, tor@sn.no
* [win32/file.c]
Partially fixed CreateFileMapping(), added UnmapViewOfFile().
Sat Nov 23 23:36:05 1996 Ronan Waide <waider@waider.ie>
* [misc/shell.c]
Fixed some FIXMEs relating to ShellExec() and FindExecutable().
* [misc/main.c]
Implemented a few more of the SystemParametersInfo() cases.
Tue Nov 19 01:24:34 1996 Philippe De Muyter <phdm@info.ucl.ac.be>
* [include/keyboard.h]
New file, new macro WINE_VKEY_MAPPINGS (using code taken from event.c).
* [include/windows.h]
New [VK_A, VK_Z] and [VK_0, VK9] macros.
* [misc/keyboard.c]
Fixes in KeyTable and ToAscii.
* [objects/font.c]
FONT_init : Give default value for MSWIN "system" font.
FONT_MatchFont : Do not try every size of a font family if the
family does not exist.
* [windows/event.c]
lastEventChar hack removed.
KeyStateTable replaced by InputKeyStateTable (maintained in event.c)
and QueueKeyStateTable (maintained in message.c).
EVENT_key : Corrections to the extended bit setting.
* [windows/message.c] [windows/keyboard.c]
Implementation of a new QueueKeyStateTable : table of key states
valid when messages are retrieved by GetMessage or PeekMessage,
and valid for TranslateMessage.
TranslateMessage : Convert WM*KEY messages using QueueKeyStateTable
and ToAscii.
Mon Nov 18 16:59:01 1996 Robert Pouliot <krynos@clic.net>
* [graphics/Makefile.in] [graphics/wing.c]
[if1632/wing.spec]
Some functions for WinG support, mostly empty stubs.
* [misc/crtdll.c] [if1632/crtdll.spec]
Many functions added to CRTDLL, mostly calls to Unix C library.
1996-12-01 18:17:47 +01:00
|
|
|
|
2015-04-02 05:17:39 +02:00
|
|
|
static inline const char *debugstr_sockopt(int level, int optname)
|
|
|
|
{
|
|
|
|
const char *stropt = NULL, *strlevel = NULL;
|
|
|
|
|
|
|
|
#define DEBUG_SOCKLEVEL(x) case (x): strlevel = #x
|
|
|
|
#define DEBUG_SOCKOPT(x) case (x): stropt = #x; break
|
|
|
|
|
|
|
|
switch(level)
|
|
|
|
{
|
|
|
|
DEBUG_SOCKLEVEL(WS_SOL_SOCKET);
|
|
|
|
switch(optname)
|
|
|
|
{
|
|
|
|
DEBUG_SOCKOPT(WS_SO_ACCEPTCONN);
|
|
|
|
DEBUG_SOCKOPT(WS_SO_BROADCAST);
|
|
|
|
DEBUG_SOCKOPT(WS_SO_BSP_STATE);
|
|
|
|
DEBUG_SOCKOPT(WS_SO_CONDITIONAL_ACCEPT);
|
|
|
|
DEBUG_SOCKOPT(WS_SO_CONNECT_TIME);
|
|
|
|
DEBUG_SOCKOPT(WS_SO_DEBUG);
|
|
|
|
DEBUG_SOCKOPT(WS_SO_DONTLINGER);
|
|
|
|
DEBUG_SOCKOPT(WS_SO_DONTROUTE);
|
|
|
|
DEBUG_SOCKOPT(WS_SO_ERROR);
|
|
|
|
DEBUG_SOCKOPT(WS_SO_EXCLUSIVEADDRUSE);
|
|
|
|
DEBUG_SOCKOPT(WS_SO_GROUP_ID);
|
|
|
|
DEBUG_SOCKOPT(WS_SO_GROUP_PRIORITY);
|
|
|
|
DEBUG_SOCKOPT(WS_SO_KEEPALIVE);
|
|
|
|
DEBUG_SOCKOPT(WS_SO_LINGER);
|
|
|
|
DEBUG_SOCKOPT(WS_SO_MAX_MSG_SIZE);
|
|
|
|
DEBUG_SOCKOPT(WS_SO_OOBINLINE);
|
|
|
|
DEBUG_SOCKOPT(WS_SO_OPENTYPE);
|
|
|
|
DEBUG_SOCKOPT(WS_SO_PROTOCOL_INFOA);
|
|
|
|
DEBUG_SOCKOPT(WS_SO_PROTOCOL_INFOW);
|
|
|
|
DEBUG_SOCKOPT(WS_SO_RCVBUF);
|
|
|
|
DEBUG_SOCKOPT(WS_SO_RCVTIMEO);
|
|
|
|
DEBUG_SOCKOPT(WS_SO_REUSEADDR);
|
|
|
|
DEBUG_SOCKOPT(WS_SO_SNDBUF);
|
|
|
|
DEBUG_SOCKOPT(WS_SO_SNDTIMEO);
|
|
|
|
DEBUG_SOCKOPT(WS_SO_TYPE);
|
2015-11-23 13:15:33 +01:00
|
|
|
DEBUG_SOCKOPT(WS_SO_UPDATE_CONNECT_CONTEXT);
|
2015-04-02 05:17:39 +02:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
DEBUG_SOCKLEVEL(WS_NSPROTO_IPX);
|
|
|
|
switch(optname)
|
|
|
|
{
|
|
|
|
DEBUG_SOCKOPT(WS_IPX_PTYPE);
|
|
|
|
DEBUG_SOCKOPT(WS_IPX_FILTERPTYPE);
|
|
|
|
DEBUG_SOCKOPT(WS_IPX_DSTYPE);
|
|
|
|
DEBUG_SOCKOPT(WS_IPX_RECVHDR);
|
|
|
|
DEBUG_SOCKOPT(WS_IPX_MAXSIZE);
|
|
|
|
DEBUG_SOCKOPT(WS_IPX_ADDRESS);
|
|
|
|
DEBUG_SOCKOPT(WS_IPX_MAX_ADAPTER_NUM);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
DEBUG_SOCKLEVEL(WS_SOL_IRLMP);
|
|
|
|
switch(optname)
|
|
|
|
{
|
|
|
|
DEBUG_SOCKOPT(WS_IRLMP_ENUMDEVICES);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
DEBUG_SOCKLEVEL(WS_IPPROTO_TCP);
|
|
|
|
switch(optname)
|
|
|
|
{
|
|
|
|
DEBUG_SOCKOPT(WS_TCP_BSDURGENT);
|
|
|
|
DEBUG_SOCKOPT(WS_TCP_EXPEDITED_1122);
|
|
|
|
DEBUG_SOCKOPT(WS_TCP_NODELAY);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
DEBUG_SOCKLEVEL(WS_IPPROTO_IP);
|
|
|
|
switch(optname)
|
|
|
|
{
|
|
|
|
DEBUG_SOCKOPT(WS_IP_ADD_MEMBERSHIP);
|
2015-11-23 13:15:33 +01:00
|
|
|
DEBUG_SOCKOPT(WS_IP_DONTFRAGMENT);
|
2015-04-02 05:17:39 +02:00
|
|
|
DEBUG_SOCKOPT(WS_IP_DROP_MEMBERSHIP);
|
|
|
|
DEBUG_SOCKOPT(WS_IP_HDRINCL);
|
|
|
|
DEBUG_SOCKOPT(WS_IP_MULTICAST_IF);
|
|
|
|
DEBUG_SOCKOPT(WS_IP_MULTICAST_LOOP);
|
|
|
|
DEBUG_SOCKOPT(WS_IP_MULTICAST_TTL);
|
|
|
|
DEBUG_SOCKOPT(WS_IP_OPTIONS);
|
|
|
|
DEBUG_SOCKOPT(WS_IP_PKTINFO);
|
2015-11-23 13:15:33 +01:00
|
|
|
DEBUG_SOCKOPT(WS_IP_RECEIVE_BROADCAST);
|
2015-04-02 05:17:39 +02:00
|
|
|
DEBUG_SOCKOPT(WS_IP_TOS);
|
|
|
|
DEBUG_SOCKOPT(WS_IP_TTL);
|
|
|
|
DEBUG_SOCKOPT(WS_IP_UNICAST_IF);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
DEBUG_SOCKLEVEL(WS_IPPROTO_IPV6);
|
|
|
|
switch(optname)
|
|
|
|
{
|
|
|
|
DEBUG_SOCKOPT(WS_IPV6_ADD_MEMBERSHIP);
|
|
|
|
DEBUG_SOCKOPT(WS_IPV6_DROP_MEMBERSHIP);
|
|
|
|
DEBUG_SOCKOPT(WS_IPV6_MULTICAST_IF);
|
|
|
|
DEBUG_SOCKOPT(WS_IPV6_MULTICAST_HOPS);
|
|
|
|
DEBUG_SOCKOPT(WS_IPV6_MULTICAST_LOOP);
|
|
|
|
DEBUG_SOCKOPT(WS_IPV6_UNICAST_HOPS);
|
|
|
|
DEBUG_SOCKOPT(WS_IPV6_V6ONLY);
|
|
|
|
DEBUG_SOCKOPT(WS_IPV6_UNICAST_IF);
|
|
|
|
DEBUG_SOCKOPT(WS_IPV6_DONTFRAG);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
#undef DEBUG_SOCKLEVEL
|
|
|
|
#undef DEBUG_SOCKOPT
|
|
|
|
|
|
|
|
if (!strlevel)
|
|
|
|
strlevel = wine_dbg_sprintf("WS_0x%x", level);
|
|
|
|
if (!stropt)
|
|
|
|
stropt = wine_dbg_sprintf("WS_0x%x", optname);
|
|
|
|
|
|
|
|
return wine_dbg_sprintf("level %s, name %s", strlevel + 3, stropt + 3);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline const char *debugstr_optval(const char *optval, int optlenval)
|
|
|
|
{
|
|
|
|
if (optval && !IS_INTRESOURCE(optval) && optlenval >= 1 && optlenval <= sizeof(DWORD))
|
|
|
|
{
|
|
|
|
DWORD value = 0;
|
|
|
|
memcpy(&value, optval, optlenval);
|
|
|
|
return wine_dbg_sprintf("%p (%u)", optval, value);
|
|
|
|
}
|
|
|
|
return wine_dbg_sprintf("%p", optval);
|
|
|
|
}
|
|
|
|
|
2002-10-30 21:26:32 +01:00
|
|
|
/* HANDLE<->SOCKET conversion (SOCKET is UINT_PTR). */
|
|
|
|
#define SOCKET2HANDLE(s) ((HANDLE)(s))
|
|
|
|
#define HANDLE2SOCKET(h) ((SOCKET)(h))
|
|
|
|
|
2020-09-10 23:17:14 +02:00
|
|
|
static BOOL socket_list_add(SOCKET socket)
|
|
|
|
{
|
|
|
|
unsigned int i, new_size;
|
|
|
|
SOCKET *new_array;
|
|
|
|
|
|
|
|
EnterCriticalSection(&cs_socket_list);
|
|
|
|
for (i = 0; i < socket_list_size; ++i)
|
|
|
|
{
|
|
|
|
if (!socket_list[i])
|
|
|
|
{
|
|
|
|
socket_list[i] = socket;
|
|
|
|
LeaveCriticalSection(&cs_socket_list);
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
new_size = max(socket_list_size * 2, 8);
|
|
|
|
if (!(new_array = heap_realloc(socket_list, new_size * sizeof(*socket_list))))
|
2020-09-21 11:57:36 +02:00
|
|
|
{
|
|
|
|
LeaveCriticalSection(&cs_socket_list);
|
2020-09-10 23:17:14 +02:00
|
|
|
return FALSE;
|
2020-09-21 11:57:36 +02:00
|
|
|
}
|
2020-09-10 23:17:14 +02:00
|
|
|
socket_list = new_array;
|
|
|
|
memset(socket_list + socket_list_size, 0, (new_size - socket_list_size) * sizeof(*socket_list));
|
|
|
|
socket_list[socket_list_size] = socket;
|
|
|
|
socket_list_size = new_size;
|
|
|
|
LeaveCriticalSection(&cs_socket_list);
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2021-05-27 06:36:54 +02:00
|
|
|
|
|
|
|
static BOOL socket_list_find( SOCKET socket )
|
|
|
|
{
|
|
|
|
unsigned int i;
|
|
|
|
|
|
|
|
EnterCriticalSection( &cs_socket_list );
|
|
|
|
for (i = 0; i < socket_list_size; ++i)
|
|
|
|
{
|
|
|
|
if (socket_list[i] == socket)
|
|
|
|
{
|
|
|
|
LeaveCriticalSection( &cs_socket_list );
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
LeaveCriticalSection( &cs_socket_list );
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2020-09-10 23:17:14 +02:00
|
|
|
static void socket_list_remove(SOCKET socket)
|
|
|
|
{
|
|
|
|
unsigned int i;
|
|
|
|
|
|
|
|
EnterCriticalSection(&cs_socket_list);
|
|
|
|
for (i = 0; i < socket_list_size; ++i)
|
|
|
|
{
|
|
|
|
if (socket_list[i] == socket)
|
|
|
|
{
|
|
|
|
socket_list[i] = 0;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
LeaveCriticalSection(&cs_socket_list);
|
|
|
|
}
|
|
|
|
|
1999-10-23 18:53:34 +02:00
|
|
|
#define WS_MAX_SOCKETS_PER_PROCESS 128 /* reasonable guess */
|
|
|
|
#define WS_MAX_UDP_DATAGRAM 1024
|
2003-07-22 02:58:44 +02:00
|
|
|
static INT WINAPI WSA_DefaultBlockingHook( FARPROC x );
|
1999-10-23 18:53:34 +02:00
|
|
|
|
2021-05-01 02:09:59 +02:00
|
|
|
int num_startup;
|
2007-05-24 16:41:17 +02:00
|
|
|
static FARPROC blocking_hook = (FARPROC)WSA_DefaultBlockingHook;
|
1999-10-23 18:53:34 +02:00
|
|
|
|
|
|
|
/* function prototypes */
|
2013-09-11 15:05:18 +02:00
|
|
|
static int ws_protocol_info(SOCKET s, int unicode, WSAPROTOCOL_INFOW *buffer, int *size);
|
2000-08-04 00:19:09 +02:00
|
|
|
|
2003-04-05 00:29:52 +02:00
|
|
|
#define MAP_OPTION(opt) { WS_##opt, opt }
|
|
|
|
|
|
|
|
static const int ws_sock_map[][2] =
|
|
|
|
{
|
|
|
|
MAP_OPTION( SO_DEBUG ),
|
2006-10-11 15:16:31 +02:00
|
|
|
MAP_OPTION( SO_ACCEPTCONN ),
|
2003-04-05 00:29:52 +02:00
|
|
|
MAP_OPTION( SO_REUSEADDR ),
|
|
|
|
MAP_OPTION( SO_KEEPALIVE ),
|
|
|
|
MAP_OPTION( SO_DONTROUTE ),
|
|
|
|
MAP_OPTION( SO_BROADCAST ),
|
|
|
|
MAP_OPTION( SO_LINGER ),
|
|
|
|
MAP_OPTION( SO_OOBINLINE ),
|
|
|
|
MAP_OPTION( SO_SNDBUF ),
|
|
|
|
MAP_OPTION( SO_RCVBUF ),
|
|
|
|
MAP_OPTION( SO_ERROR ),
|
|
|
|
MAP_OPTION( SO_TYPE ),
|
1999-03-24 15:53:55 +01:00
|
|
|
#ifdef SO_RCVTIMEO
|
2003-04-05 00:29:52 +02:00
|
|
|
MAP_OPTION( SO_RCVTIMEO ),
|
2000-09-16 22:51:40 +02:00
|
|
|
#endif
|
|
|
|
#ifdef SO_SNDTIMEO
|
2003-04-05 00:29:52 +02:00
|
|
|
MAP_OPTION( SO_SNDTIMEO ),
|
1999-03-09 18:31:42 +01:00
|
|
|
#endif
|
|
|
|
};
|
|
|
|
|
2003-04-05 00:29:52 +02:00
|
|
|
static const int ws_tcp_map[][2] =
|
2003-04-05 00:04:47 +02:00
|
|
|
{
|
2003-04-05 00:29:52 +02:00
|
|
|
#ifdef TCP_NODELAY
|
|
|
|
MAP_OPTION( TCP_NODELAY ),
|
|
|
|
#endif
|
2003-04-05 00:04:47 +02:00
|
|
|
};
|
|
|
|
|
2003-04-05 00:29:52 +02:00
|
|
|
static const int ws_ip_map[][2] =
|
2003-04-05 00:04:47 +02:00
|
|
|
{
|
2003-04-05 00:29:52 +02:00
|
|
|
MAP_OPTION( IP_MULTICAST_IF ),
|
|
|
|
MAP_OPTION( IP_MULTICAST_TTL ),
|
|
|
|
MAP_OPTION( IP_MULTICAST_LOOP ),
|
|
|
|
MAP_OPTION( IP_ADD_MEMBERSHIP ),
|
|
|
|
MAP_OPTION( IP_DROP_MEMBERSHIP ),
|
2019-10-18 19:32:53 +02:00
|
|
|
MAP_OPTION( IP_ADD_SOURCE_MEMBERSHIP ),
|
|
|
|
MAP_OPTION( IP_DROP_SOURCE_MEMBERSHIP ),
|
|
|
|
MAP_OPTION( IP_BLOCK_SOURCE ),
|
|
|
|
MAP_OPTION( IP_UNBLOCK_SOURCE ),
|
2003-04-05 00:29:52 +02:00
|
|
|
MAP_OPTION( IP_OPTIONS ),
|
2003-10-14 07:27:43 +02:00
|
|
|
#ifdef IP_HDRINCL
|
2003-04-05 00:29:52 +02:00
|
|
|
MAP_OPTION( IP_HDRINCL ),
|
2003-10-14 07:27:43 +02:00
|
|
|
#endif
|
2003-04-05 00:29:52 +02:00
|
|
|
MAP_OPTION( IP_TOS ),
|
|
|
|
MAP_OPTION( IP_TTL ),
|
2019-08-01 06:11:28 +02:00
|
|
|
#if defined(IP_PKTINFO)
|
2010-12-06 01:08:54 +01:00
|
|
|
MAP_OPTION( IP_PKTINFO ),
|
2019-08-01 06:11:28 +02:00
|
|
|
#elif defined(IP_RECVDSTADDR)
|
|
|
|
{ WS_IP_PKTINFO, IP_RECVDSTADDR },
|
2010-12-06 01:08:54 +01:00
|
|
|
#endif
|
2012-04-09 21:06:08 +02:00
|
|
|
#ifdef IP_UNICAST_IF
|
|
|
|
MAP_OPTION( IP_UNICAST_IF ),
|
|
|
|
#endif
|
2003-04-05 00:04:47 +02:00
|
|
|
};
|
|
|
|
|
2010-03-31 00:07:24 +02:00
|
|
|
static const int ws_ipv6_map[][2] =
|
|
|
|
{
|
|
|
|
#ifdef IPV6_ADD_MEMBERSHIP
|
|
|
|
MAP_OPTION( IPV6_ADD_MEMBERSHIP ),
|
|
|
|
#endif
|
|
|
|
#ifdef IPV6_DROP_MEMBERSHIP
|
|
|
|
MAP_OPTION( IPV6_DROP_MEMBERSHIP ),
|
|
|
|
#endif
|
|
|
|
MAP_OPTION( IPV6_MULTICAST_IF ),
|
|
|
|
MAP_OPTION( IPV6_MULTICAST_HOPS ),
|
|
|
|
MAP_OPTION( IPV6_MULTICAST_LOOP ),
|
|
|
|
MAP_OPTION( IPV6_UNICAST_HOPS ),
|
|
|
|
MAP_OPTION( IPV6_V6ONLY ),
|
2012-04-09 21:06:30 +02:00
|
|
|
#ifdef IPV6_UNICAST_IF
|
|
|
|
MAP_OPTION( IPV6_UNICAST_IF ),
|
|
|
|
#endif
|
2010-03-31 00:07:24 +02:00
|
|
|
};
|
|
|
|
|
2005-11-16 12:21:57 +01:00
|
|
|
static const int ws_socktype_map[][2] =
|
|
|
|
{
|
|
|
|
MAP_OPTION( SOCK_DGRAM ),
|
|
|
|
MAP_OPTION( SOCK_STREAM ),
|
|
|
|
MAP_OPTION( SOCK_RAW ),
|
2008-05-26 10:02:42 +02:00
|
|
|
{FROM_PROTOCOL_INFO, FROM_PROTOCOL_INFO},
|
2005-11-16 12:21:57 +01:00
|
|
|
};
|
|
|
|
|
2021-05-01 02:09:58 +02:00
|
|
|
UINT sock_get_error( int err )
|
2010-03-22 19:56:21 +01:00
|
|
|
{
|
|
|
|
switch(err)
|
2009-10-07 14:49:17 +02:00
|
|
|
{
|
|
|
|
case EINTR: return WSAEINTR;
|
|
|
|
case EPERM:
|
|
|
|
case EACCES: return WSAEACCES;
|
|
|
|
case EFAULT: return WSAEFAULT;
|
|
|
|
case EINVAL: return WSAEINVAL;
|
|
|
|
case EMFILE: return WSAEMFILE;
|
2021-05-06 04:41:48 +02:00
|
|
|
case EINPROGRESS:
|
2009-10-07 14:49:17 +02:00
|
|
|
case EWOULDBLOCK: return WSAEWOULDBLOCK;
|
|
|
|
case EALREADY: return WSAEALREADY;
|
2015-04-14 07:02:51 +02:00
|
|
|
case EBADF:
|
2009-10-07 14:49:17 +02:00
|
|
|
case ENOTSOCK: return WSAENOTSOCK;
|
|
|
|
case EDESTADDRREQ: return WSAEDESTADDRREQ;
|
|
|
|
case EMSGSIZE: return WSAEMSGSIZE;
|
|
|
|
case EPROTOTYPE: return WSAEPROTOTYPE;
|
|
|
|
case ENOPROTOOPT: return WSAENOPROTOOPT;
|
|
|
|
case EPROTONOSUPPORT: return WSAEPROTONOSUPPORT;
|
|
|
|
case ESOCKTNOSUPPORT: return WSAESOCKTNOSUPPORT;
|
|
|
|
case EOPNOTSUPP: return WSAEOPNOTSUPP;
|
|
|
|
case EPFNOSUPPORT: return WSAEPFNOSUPPORT;
|
|
|
|
case EAFNOSUPPORT: return WSAEAFNOSUPPORT;
|
|
|
|
case EADDRINUSE: return WSAEADDRINUSE;
|
|
|
|
case EADDRNOTAVAIL: return WSAEADDRNOTAVAIL;
|
|
|
|
case ENETDOWN: return WSAENETDOWN;
|
|
|
|
case ENETUNREACH: return WSAENETUNREACH;
|
|
|
|
case ENETRESET: return WSAENETRESET;
|
|
|
|
case ECONNABORTED: return WSAECONNABORTED;
|
|
|
|
case EPIPE:
|
|
|
|
case ECONNRESET: return WSAECONNRESET;
|
|
|
|
case ENOBUFS: return WSAENOBUFS;
|
|
|
|
case EISCONN: return WSAEISCONN;
|
|
|
|
case ENOTCONN: return WSAENOTCONN;
|
|
|
|
case ESHUTDOWN: return WSAESHUTDOWN;
|
|
|
|
case ETOOMANYREFS: return WSAETOOMANYREFS;
|
|
|
|
case ETIMEDOUT: return WSAETIMEDOUT;
|
|
|
|
case ECONNREFUSED: return WSAECONNREFUSED;
|
|
|
|
case ELOOP: return WSAELOOP;
|
|
|
|
case ENAMETOOLONG: return WSAENAMETOOLONG;
|
|
|
|
case EHOSTDOWN: return WSAEHOSTDOWN;
|
|
|
|
case EHOSTUNREACH: return WSAEHOSTUNREACH;
|
|
|
|
case ENOTEMPTY: return WSAENOTEMPTY;
|
|
|
|
#ifdef EPROCLIM
|
|
|
|
case EPROCLIM: return WSAEPROCLIM;
|
|
|
|
#endif
|
|
|
|
#ifdef EUSERS
|
|
|
|
case EUSERS: return WSAEUSERS;
|
|
|
|
#endif
|
|
|
|
#ifdef EDQUOT
|
|
|
|
case EDQUOT: return WSAEDQUOT;
|
|
|
|
#endif
|
|
|
|
#ifdef ESTALE
|
|
|
|
case ESTALE: return WSAESTALE;
|
|
|
|
#endif
|
|
|
|
#ifdef EREMOTE
|
|
|
|
case EREMOTE: return WSAEREMOTE;
|
|
|
|
#endif
|
|
|
|
|
2010-03-22 19:56:21 +01:00
|
|
|
/* just in case we ever get here and there are no problems */
|
2009-10-07 14:49:17 +02:00
|
|
|
case 0: return 0;
|
2010-03-22 19:56:21 +01:00
|
|
|
default:
|
|
|
|
WARN("Unknown errno %d!\n", err);
|
2009-10-07 14:49:17 +02:00
|
|
|
return WSAEOPNOTSUPP;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-03-22 19:56:21 +01:00
|
|
|
static UINT wsaErrno(void)
|
2009-10-07 14:49:17 +02:00
|
|
|
{
|
2010-03-22 19:56:21 +01:00
|
|
|
int loc_errno = errno;
|
|
|
|
WARN("errno %d, (%s).\n", loc_errno, strerror(loc_errno));
|
2009-10-07 14:49:17 +02:00
|
|
|
|
2010-03-22 19:56:21 +01:00
|
|
|
return sock_get_error( loc_errno );
|
|
|
|
}
|
|
|
|
|
2021-05-07 00:54:05 +02:00
|
|
|
static DWORD NtStatusToWSAError( NTSTATUS status )
|
2002-04-25 23:34:24 +02:00
|
|
|
{
|
2021-05-07 00:54:05 +02:00
|
|
|
static const struct
|
|
|
|
{
|
|
|
|
NTSTATUS status;
|
|
|
|
DWORD error;
|
|
|
|
}
|
|
|
|
errors[] =
|
|
|
|
{
|
|
|
|
{STATUS_PENDING, ERROR_IO_PENDING},
|
|
|
|
|
|
|
|
{STATUS_BUFFER_OVERFLOW, WSAEMSGSIZE},
|
|
|
|
|
|
|
|
{STATUS_NOT_IMPLEMENTED, WSAEOPNOTSUPP},
|
|
|
|
{STATUS_ACCESS_VIOLATION, WSAEFAULT},
|
|
|
|
{STATUS_PAGEFILE_QUOTA, WSAENOBUFS},
|
|
|
|
{STATUS_INVALID_HANDLE, WSAENOTSOCK},
|
|
|
|
{STATUS_NO_SUCH_DEVICE, WSAENETDOWN},
|
|
|
|
{STATUS_NO_SUCH_FILE, WSAENETDOWN},
|
|
|
|
{STATUS_NO_MEMORY, WSAENOBUFS},
|
|
|
|
{STATUS_CONFLICTING_ADDRESSES, WSAENOBUFS},
|
|
|
|
{STATUS_ACCESS_DENIED, WSAEACCES},
|
|
|
|
{STATUS_BUFFER_TOO_SMALL, WSAEFAULT},
|
|
|
|
{STATUS_OBJECT_TYPE_MISMATCH, WSAENOTSOCK},
|
|
|
|
{STATUS_OBJECT_NAME_NOT_FOUND, WSAENETDOWN},
|
|
|
|
{STATUS_OBJECT_PATH_NOT_FOUND, WSAENETDOWN},
|
|
|
|
{STATUS_SHARING_VIOLATION, WSAEADDRINUSE},
|
|
|
|
{STATUS_QUOTA_EXCEEDED, WSAENOBUFS},
|
|
|
|
{STATUS_TOO_MANY_PAGING_FILES, WSAENOBUFS},
|
|
|
|
{STATUS_INSUFFICIENT_RESOURCES, WSAENOBUFS},
|
|
|
|
{STATUS_WORKING_SET_QUOTA, WSAENOBUFS},
|
|
|
|
{STATUS_DEVICE_NOT_READY, WSAEWOULDBLOCK},
|
|
|
|
{STATUS_PIPE_DISCONNECTED, WSAESHUTDOWN},
|
|
|
|
{STATUS_IO_TIMEOUT, WSAETIMEDOUT},
|
|
|
|
{STATUS_NOT_SUPPORTED, WSAEOPNOTSUPP},
|
|
|
|
{STATUS_REMOTE_NOT_LISTENING, WSAECONNREFUSED},
|
|
|
|
{STATUS_BAD_NETWORK_PATH, WSAENETUNREACH},
|
|
|
|
{STATUS_NETWORK_BUSY, WSAENETDOWN},
|
|
|
|
{STATUS_INVALID_NETWORK_RESPONSE, WSAENETDOWN},
|
|
|
|
{STATUS_UNEXPECTED_NETWORK_ERROR, WSAENETDOWN},
|
|
|
|
{STATUS_REQUEST_NOT_ACCEPTED, WSAEWOULDBLOCK},
|
|
|
|
{STATUS_CANCELLED, ERROR_OPERATION_ABORTED},
|
|
|
|
{STATUS_COMMITMENT_LIMIT, WSAENOBUFS},
|
|
|
|
{STATUS_LOCAL_DISCONNECT, WSAECONNABORTED},
|
|
|
|
{STATUS_REMOTE_DISCONNECT, WSAECONNRESET},
|
|
|
|
{STATUS_REMOTE_RESOURCES, WSAENOBUFS},
|
|
|
|
{STATUS_LINK_FAILED, WSAECONNRESET},
|
|
|
|
{STATUS_LINK_TIMEOUT, WSAETIMEDOUT},
|
|
|
|
{STATUS_INVALID_CONNECTION, WSAENOTCONN},
|
|
|
|
{STATUS_INVALID_ADDRESS, WSAEADDRNOTAVAIL},
|
|
|
|
{STATUS_INVALID_BUFFER_SIZE, WSAEMSGSIZE},
|
|
|
|
{STATUS_INVALID_ADDRESS_COMPONENT, WSAEADDRNOTAVAIL},
|
|
|
|
{STATUS_TOO_MANY_ADDRESSES, WSAENOBUFS},
|
|
|
|
{STATUS_ADDRESS_ALREADY_EXISTS, WSAEADDRINUSE},
|
|
|
|
{STATUS_CONNECTION_DISCONNECTED, WSAECONNRESET},
|
|
|
|
{STATUS_CONNECTION_RESET, WSAECONNRESET},
|
|
|
|
{STATUS_TRANSACTION_ABORTED, WSAECONNABORTED},
|
|
|
|
{STATUS_CONNECTION_REFUSED, WSAECONNREFUSED},
|
|
|
|
{STATUS_GRACEFUL_DISCONNECT, WSAEDISCON},
|
|
|
|
{STATUS_CONNECTION_ACTIVE, WSAEISCONN},
|
|
|
|
{STATUS_NETWORK_UNREACHABLE, WSAENETUNREACH},
|
|
|
|
{STATUS_HOST_UNREACHABLE, WSAEHOSTUNREACH},
|
|
|
|
{STATUS_PROTOCOL_UNREACHABLE, WSAENETUNREACH},
|
|
|
|
{STATUS_PORT_UNREACHABLE, WSAECONNRESET},
|
|
|
|
{STATUS_REQUEST_ABORTED, WSAEINTR},
|
|
|
|
{STATUS_CONNECTION_ABORTED, WSAECONNABORTED},
|
|
|
|
{STATUS_DATATYPE_MISALIGNMENT_ERROR,WSAEFAULT},
|
|
|
|
{STATUS_HOST_DOWN, WSAEHOSTDOWN},
|
|
|
|
{0x80070000 | ERROR_IO_INCOMPLETE, ERROR_IO_INCOMPLETE},
|
|
|
|
{0xc0010000 | ERROR_IO_INCOMPLETE, ERROR_IO_INCOMPLETE},
|
|
|
|
{0xc0070000 | ERROR_IO_INCOMPLETE, ERROR_IO_INCOMPLETE},
|
|
|
|
};
|
|
|
|
|
|
|
|
unsigned int i;
|
|
|
|
|
|
|
|
for (i = 0; i < ARRAY_SIZE(errors); ++i)
|
|
|
|
{
|
|
|
|
if (errors[i].status == status)
|
|
|
|
return errors[i].error;
|
2002-04-25 23:34:24 +02:00
|
|
|
}
|
2021-05-07 00:54:05 +02:00
|
|
|
|
|
|
|
return NT_SUCCESS(status) ? RtlNtStatusToDosErrorNoTeb(status) : WSAEINVAL;
|
2002-04-25 23:34:24 +02:00
|
|
|
}
|
|
|
|
|
2001-02-27 03:09:16 +01:00
|
|
|
/* set last error code from NT status without mapping WSA errors */
|
2007-03-23 16:11:35 +01:00
|
|
|
static inline unsigned int set_error( unsigned int err )
|
2000-01-24 22:58:06 +01:00
|
|
|
{
|
2001-02-27 03:09:16 +01:00
|
|
|
if (err)
|
2000-01-24 22:58:06 +01:00
|
|
|
{
|
2005-01-14 20:54:38 +01:00
|
|
|
err = NtStatusToWSAError( err );
|
2001-02-27 03:09:16 +01:00
|
|
|
SetLastError( err );
|
2000-01-24 22:58:06 +01:00
|
|
|
}
|
2001-02-27 03:09:16 +01:00
|
|
|
return err;
|
2000-01-24 22:58:06 +01:00
|
|
|
}
|
|
|
|
|
2007-04-10 22:32:46 +02:00
|
|
|
static inline int get_sock_fd( SOCKET s, DWORD access, unsigned int *options )
|
1999-10-23 18:53:34 +02:00
|
|
|
{
|
2002-03-23 21:43:52 +01:00
|
|
|
int fd;
|
2007-04-10 22:32:46 +02:00
|
|
|
if (set_error( wine_server_handle_to_fd( SOCKET2HANDLE(s), access, &fd, options ) ))
|
2002-10-30 21:26:32 +01:00
|
|
|
return -1;
|
2002-03-23 21:43:52 +01:00
|
|
|
return fd;
|
1999-10-23 18:53:34 +02:00
|
|
|
}
|
|
|
|
|
2007-03-23 16:11:35 +01:00
|
|
|
static inline void release_sock_fd( SOCKET s, int fd )
|
2002-04-17 18:46:49 +02:00
|
|
|
{
|
2021-04-05 13:18:39 +02:00
|
|
|
close( fd );
|
2002-04-17 18:46:49 +02:00
|
|
|
}
|
|
|
|
|
2016-12-07 07:27:26 +01:00
|
|
|
static BOOL set_dont_fragment(SOCKET s, int level, BOOL value)
|
|
|
|
{
|
|
|
|
int fd, optname;
|
|
|
|
|
|
|
|
if (level == IPPROTO_IP)
|
|
|
|
{
|
|
|
|
#ifdef IP_DONTFRAG
|
|
|
|
optname = IP_DONTFRAG;
|
|
|
|
#elif defined(IP_MTU_DISCOVER) && defined(IP_PMTUDISC_DO) && defined(IP_PMTUDISC_DONT)
|
|
|
|
optname = IP_MTU_DISCOVER;
|
|
|
|
value = value ? IP_PMTUDISC_DO : IP_PMTUDISC_DONT;
|
|
|
|
#else
|
|
|
|
static int once;
|
|
|
|
if (!once++)
|
|
|
|
FIXME("IP_DONTFRAGMENT for IPv4 not supported in this platform\n");
|
|
|
|
return TRUE; /* fake success */
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
#ifdef IPV6_DONTFRAG
|
|
|
|
optname = IPV6_DONTFRAG;
|
|
|
|
#elif defined(IPV6_MTU_DISCOVER) && defined(IPV6_PMTUDISC_DO) && defined(IPV6_PMTUDISC_DONT)
|
|
|
|
optname = IPV6_MTU_DISCOVER;
|
|
|
|
value = value ? IPV6_PMTUDISC_DO : IPV6_PMTUDISC_DONT;
|
|
|
|
#else
|
|
|
|
static int once;
|
|
|
|
if (!once++)
|
|
|
|
FIXME("IP_DONTFRAGMENT for IPv6 not supported in this platform\n");
|
|
|
|
return TRUE; /* fake success */
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
fd = get_sock_fd(s, 0, NULL);
|
|
|
|
if (fd == -1) return FALSE;
|
|
|
|
|
|
|
|
if (!setsockopt(fd, level, optname, &value, sizeof(value)))
|
|
|
|
value = TRUE;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
WSASetLastError(wsaErrno());
|
|
|
|
value = FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
release_sock_fd(s, fd);
|
|
|
|
return value;
|
|
|
|
}
|
|
|
|
|
|
|
|
static BOOL get_dont_fragment(SOCKET s, int level, BOOL *out)
|
|
|
|
{
|
|
|
|
int fd, optname, value, not_expected;
|
|
|
|
socklen_t optlen = sizeof(value);
|
|
|
|
|
|
|
|
if (level == IPPROTO_IP)
|
|
|
|
{
|
|
|
|
#ifdef IP_DONTFRAG
|
|
|
|
optname = IP_DONTFRAG;
|
|
|
|
not_expected = 0;
|
|
|
|
#elif defined(IP_MTU_DISCOVER) && defined(IP_PMTUDISC_DONT)
|
|
|
|
optname = IP_MTU_DISCOVER;
|
|
|
|
not_expected = IP_PMTUDISC_DONT;
|
|
|
|
#else
|
|
|
|
static int once;
|
|
|
|
if (!once++)
|
|
|
|
FIXME("IP_DONTFRAGMENT for IPv4 not supported in this platform\n");
|
|
|
|
return TRUE; /* fake success */
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
#ifdef IPV6_DONTFRAG
|
|
|
|
optname = IPV6_DONTFRAG;
|
|
|
|
not_expected = 0;
|
|
|
|
#elif defined(IPV6_MTU_DISCOVER) && defined(IPV6_PMTUDISC_DONT)
|
|
|
|
optname = IPV6_MTU_DISCOVER;
|
|
|
|
not_expected = IPV6_PMTUDISC_DONT;
|
|
|
|
#else
|
|
|
|
static int once;
|
|
|
|
if (!once++)
|
|
|
|
FIXME("IP_DONTFRAGMENT for IPv6 not supported in this platform\n");
|
2016-12-09 06:11:49 +01:00
|
|
|
return TRUE; /* fake success */
|
2016-12-07 07:27:26 +01:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
fd = get_sock_fd(s, 0, NULL);
|
|
|
|
if (fd == -1) return FALSE;
|
|
|
|
|
|
|
|
if (!getsockopt(fd, level, optname, &value, &optlen))
|
|
|
|
{
|
|
|
|
*out = value != not_expected;
|
|
|
|
value = TRUE;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
WSASetLastError(wsaErrno());
|
|
|
|
value = FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
release_sock_fd(s, fd);
|
|
|
|
return value;
|
|
|
|
}
|
|
|
|
|
2021-05-01 02:09:59 +02:00
|
|
|
struct per_thread_data *get_per_thread_data(void)
|
2004-12-22 19:23:49 +01:00
|
|
|
{
|
2005-05-14 13:09:21 +02:00
|
|
|
struct per_thread_data * ptb = NtCurrentTeb()->WinSockData;
|
2004-12-22 19:23:49 +01:00
|
|
|
/* lazy initialization */
|
|
|
|
if (!ptb)
|
|
|
|
{
|
|
|
|
ptb = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*ptb) );
|
2005-05-14 13:09:21 +02:00
|
|
|
NtCurrentTeb()->WinSockData = ptb;
|
2004-12-22 19:23:49 +01:00
|
|
|
}
|
|
|
|
return ptb;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void free_per_thread_data(void)
|
1999-10-23 18:53:34 +02:00
|
|
|
{
|
2005-05-14 13:09:21 +02:00
|
|
|
struct per_thread_data * ptb = NtCurrentTeb()->WinSockData;
|
2004-12-22 19:23:49 +01:00
|
|
|
|
|
|
|
if (!ptb) return;
|
|
|
|
|
2021-05-18 04:29:56 +02:00
|
|
|
CloseHandle( ptb->sync_event );
|
|
|
|
|
2001-02-20 02:57:13 +01:00
|
|
|
/* delete scratch buffers */
|
2004-12-22 19:23:49 +01:00
|
|
|
HeapFree( GetProcessHeap(), 0, ptb->he_buffer );
|
|
|
|
HeapFree( GetProcessHeap(), 0, ptb->se_buffer );
|
|
|
|
HeapFree( GetProcessHeap(), 0, ptb->pe_buffer );
|
1999-10-23 18:53:34 +02:00
|
|
|
|
2004-12-22 19:23:49 +01:00
|
|
|
HeapFree( GetProcessHeap(), 0, ptb );
|
2005-05-14 13:09:21 +02:00
|
|
|
NtCurrentTeb()->WinSockData = NULL;
|
1999-10-23 18:53:34 +02:00
|
|
|
}
|
|
|
|
|
2021-05-18 04:29:56 +02:00
|
|
|
static HANDLE get_sync_event(void)
|
|
|
|
{
|
|
|
|
struct per_thread_data *data;
|
|
|
|
|
|
|
|
if (!(data = get_per_thread_data())) return NULL;
|
|
|
|
if (!data->sync_event)
|
|
|
|
data->sync_event = CreateEventW( NULL, TRUE, FALSE, NULL );
|
|
|
|
return data->sync_event;
|
|
|
|
}
|
|
|
|
|
2000-03-28 22:22:59 +02:00
|
|
|
/***********************************************************************
|
2002-11-05 00:53:41 +01:00
|
|
|
* DllMain (WS2_32.init)
|
2000-03-28 22:22:59 +02:00
|
|
|
*/
|
2021-04-30 18:38:09 +02:00
|
|
|
BOOL WINAPI DllMain( HINSTANCE instance, DWORD reason, void *reserved )
|
1999-10-23 18:53:34 +02:00
|
|
|
{
|
2021-04-30 18:38:09 +02:00
|
|
|
if (reason == DLL_THREAD_DETACH)
|
2004-12-22 19:23:49 +01:00
|
|
|
free_per_thread_data();
|
1999-10-23 18:53:34 +02:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
1997-08-24 18:00:30 +02:00
|
|
|
/***********************************************************************
|
|
|
|
* convert_sockopt()
|
|
|
|
*
|
|
|
|
* Converts socket flags from Windows format.
|
2000-09-16 22:51:40 +02:00
|
|
|
* Return 1 if converted, 0 if not (error).
|
1997-08-24 18:00:30 +02:00
|
|
|
*/
|
2000-09-16 22:51:40 +02:00
|
|
|
static int convert_sockopt(INT *level, INT *optname)
|
Release 961201
Sat Nov 30 19:21:17 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [configure]
Re-generated with autoconf 2.11. Let me know if you have
problems.
* [controls/listbox.c] [controls/oldlbox.c]
Listboxes rewritten from scratch. Moved old code still used by
comboboxes to oldlbox.c
* [misc/registry.c]
Use temporary file when saving registry.
* [windows/dialog.c]
Implemented Win32 version of DlgDirList() and DlgDirListComboBox().
* [windows/winproc.c]
Added translation for listbox Win32 messages.
Sat Nov 30 21:00:00 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [controls/widgets.c] [controls/button.c]
Fixed some incompatibilities with CTL3D DLL.
* [windows/dialog.c]
Made dialog windows fit into the desktop.
* [misc/winsock.c] [misc/winsock_async.c]
New Winsock engine.
* [windows/message.c]
GetMessage() fixes.
* [windows/queue.c] [windows/hook.c] [windows/win.c]
SetMessageQueue() fixes.
Fri Nov 29 10:25:12 1996 Slaven Rezic <eserte@cs.tu-berlin.de>
* [objects/text.c]
DrawText16(): Fixed return value.
Tue Nov 26 14:47:09 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/profile.c] [*/*]
Added Win32 profile functions, updated to new naming standard.
* [objects/font.c] [if1632/thunk.c] [include/windows.h]
Added EnumFonts32*, EnumFontFamiliesEx*, changed prototypes and
structures.
* [misc/ole2nls.c] [if1632/thunk.c]
Added EnumSystemLocales() (winhelp.exe).
* [misc/registry.c]
Added Windows 3.1 registry loader supplied by Tor Sjxwall, tor@sn.no
* [win32/file.c]
Partially fixed CreateFileMapping(), added UnmapViewOfFile().
Sat Nov 23 23:36:05 1996 Ronan Waide <waider@waider.ie>
* [misc/shell.c]
Fixed some FIXMEs relating to ShellExec() and FindExecutable().
* [misc/main.c]
Implemented a few more of the SystemParametersInfo() cases.
Tue Nov 19 01:24:34 1996 Philippe De Muyter <phdm@info.ucl.ac.be>
* [include/keyboard.h]
New file, new macro WINE_VKEY_MAPPINGS (using code taken from event.c).
* [include/windows.h]
New [VK_A, VK_Z] and [VK_0, VK9] macros.
* [misc/keyboard.c]
Fixes in KeyTable and ToAscii.
* [objects/font.c]
FONT_init : Give default value for MSWIN "system" font.
FONT_MatchFont : Do not try every size of a font family if the
family does not exist.
* [windows/event.c]
lastEventChar hack removed.
KeyStateTable replaced by InputKeyStateTable (maintained in event.c)
and QueueKeyStateTable (maintained in message.c).
EVENT_key : Corrections to the extended bit setting.
* [windows/message.c] [windows/keyboard.c]
Implementation of a new QueueKeyStateTable : table of key states
valid when messages are retrieved by GetMessage or PeekMessage,
and valid for TranslateMessage.
TranslateMessage : Convert WM*KEY messages using QueueKeyStateTable
and ToAscii.
Mon Nov 18 16:59:01 1996 Robert Pouliot <krynos@clic.net>
* [graphics/Makefile.in] [graphics/wing.c]
[if1632/wing.spec]
Some functions for WinG support, mostly empty stubs.
* [misc/crtdll.c] [if1632/crtdll.spec]
Many functions added to CRTDLL, mostly calls to Unix C library.
1996-12-01 18:17:47 +01:00
|
|
|
{
|
2008-12-10 22:55:35 +01:00
|
|
|
unsigned int i;
|
Release 961201
Sat Nov 30 19:21:17 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [configure]
Re-generated with autoconf 2.11. Let me know if you have
problems.
* [controls/listbox.c] [controls/oldlbox.c]
Listboxes rewritten from scratch. Moved old code still used by
comboboxes to oldlbox.c
* [misc/registry.c]
Use temporary file when saving registry.
* [windows/dialog.c]
Implemented Win32 version of DlgDirList() and DlgDirListComboBox().
* [windows/winproc.c]
Added translation for listbox Win32 messages.
Sat Nov 30 21:00:00 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [controls/widgets.c] [controls/button.c]
Fixed some incompatibilities with CTL3D DLL.
* [windows/dialog.c]
Made dialog windows fit into the desktop.
* [misc/winsock.c] [misc/winsock_async.c]
New Winsock engine.
* [windows/message.c]
GetMessage() fixes.
* [windows/queue.c] [windows/hook.c] [windows/win.c]
SetMessageQueue() fixes.
Fri Nov 29 10:25:12 1996 Slaven Rezic <eserte@cs.tu-berlin.de>
* [objects/text.c]
DrawText16(): Fixed return value.
Tue Nov 26 14:47:09 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/profile.c] [*/*]
Added Win32 profile functions, updated to new naming standard.
* [objects/font.c] [if1632/thunk.c] [include/windows.h]
Added EnumFonts32*, EnumFontFamiliesEx*, changed prototypes and
structures.
* [misc/ole2nls.c] [if1632/thunk.c]
Added EnumSystemLocales() (winhelp.exe).
* [misc/registry.c]
Added Windows 3.1 registry loader supplied by Tor Sjxwall, tor@sn.no
* [win32/file.c]
Partially fixed CreateFileMapping(), added UnmapViewOfFile().
Sat Nov 23 23:36:05 1996 Ronan Waide <waider@waider.ie>
* [misc/shell.c]
Fixed some FIXMEs relating to ShellExec() and FindExecutable().
* [misc/main.c]
Implemented a few more of the SystemParametersInfo() cases.
Tue Nov 19 01:24:34 1996 Philippe De Muyter <phdm@info.ucl.ac.be>
* [include/keyboard.h]
New file, new macro WINE_VKEY_MAPPINGS (using code taken from event.c).
* [include/windows.h]
New [VK_A, VK_Z] and [VK_0, VK9] macros.
* [misc/keyboard.c]
Fixes in KeyTable and ToAscii.
* [objects/font.c]
FONT_init : Give default value for MSWIN "system" font.
FONT_MatchFont : Do not try every size of a font family if the
family does not exist.
* [windows/event.c]
lastEventChar hack removed.
KeyStateTable replaced by InputKeyStateTable (maintained in event.c)
and QueueKeyStateTable (maintained in message.c).
EVENT_key : Corrections to the extended bit setting.
* [windows/message.c] [windows/keyboard.c]
Implementation of a new QueueKeyStateTable : table of key states
valid when messages are retrieved by GetMessage or PeekMessage,
and valid for TranslateMessage.
TranslateMessage : Convert WM*KEY messages using QueueKeyStateTable
and ToAscii.
Mon Nov 18 16:59:01 1996 Robert Pouliot <krynos@clic.net>
* [graphics/Makefile.in] [graphics/wing.c]
[if1632/wing.spec]
Some functions for WinG support, mostly empty stubs.
* [misc/crtdll.c] [if1632/crtdll.spec]
Many functions added to CRTDLL, mostly calls to Unix C library.
1996-12-01 18:17:47 +01:00
|
|
|
switch (*level)
|
|
|
|
{
|
|
|
|
case WS_SOL_SOCKET:
|
|
|
|
*level = SOL_SOCKET;
|
2018-09-12 21:03:54 +02:00
|
|
|
for(i = 0; i < ARRAY_SIZE(ws_sock_map); i++) {
|
2003-04-05 00:29:52 +02:00
|
|
|
if( ws_sock_map[i][0] == *optname )
|
|
|
|
{
|
|
|
|
*optname = ws_sock_map[i][1];
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
2000-09-16 22:51:40 +02:00
|
|
|
FIXME("Unknown SOL_SOCKET optname 0x%x\n", *optname);
|
Release 961201
Sat Nov 30 19:21:17 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [configure]
Re-generated with autoconf 2.11. Let me know if you have
problems.
* [controls/listbox.c] [controls/oldlbox.c]
Listboxes rewritten from scratch. Moved old code still used by
comboboxes to oldlbox.c
* [misc/registry.c]
Use temporary file when saving registry.
* [windows/dialog.c]
Implemented Win32 version of DlgDirList() and DlgDirListComboBox().
* [windows/winproc.c]
Added translation for listbox Win32 messages.
Sat Nov 30 21:00:00 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [controls/widgets.c] [controls/button.c]
Fixed some incompatibilities with CTL3D DLL.
* [windows/dialog.c]
Made dialog windows fit into the desktop.
* [misc/winsock.c] [misc/winsock_async.c]
New Winsock engine.
* [windows/message.c]
GetMessage() fixes.
* [windows/queue.c] [windows/hook.c] [windows/win.c]
SetMessageQueue() fixes.
Fri Nov 29 10:25:12 1996 Slaven Rezic <eserte@cs.tu-berlin.de>
* [objects/text.c]
DrawText16(): Fixed return value.
Tue Nov 26 14:47:09 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/profile.c] [*/*]
Added Win32 profile functions, updated to new naming standard.
* [objects/font.c] [if1632/thunk.c] [include/windows.h]
Added EnumFonts32*, EnumFontFamiliesEx*, changed prototypes and
structures.
* [misc/ole2nls.c] [if1632/thunk.c]
Added EnumSystemLocales() (winhelp.exe).
* [misc/registry.c]
Added Windows 3.1 registry loader supplied by Tor Sjxwall, tor@sn.no
* [win32/file.c]
Partially fixed CreateFileMapping(), added UnmapViewOfFile().
Sat Nov 23 23:36:05 1996 Ronan Waide <waider@waider.ie>
* [misc/shell.c]
Fixed some FIXMEs relating to ShellExec() and FindExecutable().
* [misc/main.c]
Implemented a few more of the SystemParametersInfo() cases.
Tue Nov 19 01:24:34 1996 Philippe De Muyter <phdm@info.ucl.ac.be>
* [include/keyboard.h]
New file, new macro WINE_VKEY_MAPPINGS (using code taken from event.c).
* [include/windows.h]
New [VK_A, VK_Z] and [VK_0, VK9] macros.
* [misc/keyboard.c]
Fixes in KeyTable and ToAscii.
* [objects/font.c]
FONT_init : Give default value for MSWIN "system" font.
FONT_MatchFont : Do not try every size of a font family if the
family does not exist.
* [windows/event.c]
lastEventChar hack removed.
KeyStateTable replaced by InputKeyStateTable (maintained in event.c)
and QueueKeyStateTable (maintained in message.c).
EVENT_key : Corrections to the extended bit setting.
* [windows/message.c] [windows/keyboard.c]
Implementation of a new QueueKeyStateTable : table of key states
valid when messages are retrieved by GetMessage or PeekMessage,
and valid for TranslateMessage.
TranslateMessage : Convert WM*KEY messages using QueueKeyStateTable
and ToAscii.
Mon Nov 18 16:59:01 1996 Robert Pouliot <krynos@clic.net>
* [graphics/Makefile.in] [graphics/wing.c]
[if1632/wing.spec]
Some functions for WinG support, mostly empty stubs.
* [misc/crtdll.c] [if1632/crtdll.spec]
Many functions added to CRTDLL, mostly calls to Unix C library.
1996-12-01 18:17:47 +01:00
|
|
|
break;
|
|
|
|
case WS_IPPROTO_TCP:
|
1999-03-09 18:31:42 +01:00
|
|
|
*level = IPPROTO_TCP;
|
2018-09-12 21:03:54 +02:00
|
|
|
for(i = 0; i < ARRAY_SIZE(ws_tcp_map); i++) {
|
2003-04-05 00:29:52 +02:00
|
|
|
if ( ws_tcp_map[i][0] == *optname )
|
|
|
|
{
|
|
|
|
*optname = ws_tcp_map[i][1];
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
2000-09-16 22:51:40 +02:00
|
|
|
FIXME("Unknown IPPROTO_TCP optname 0x%x\n", *optname);
|
1999-03-09 18:31:42 +01:00
|
|
|
break;
|
2003-04-05 00:04:47 +02:00
|
|
|
case WS_IPPROTO_IP:
|
|
|
|
*level = IPPROTO_IP;
|
2018-09-12 21:03:54 +02:00
|
|
|
for(i = 0; i < ARRAY_SIZE(ws_ip_map); i++) {
|
2003-04-05 00:29:52 +02:00
|
|
|
if (ws_ip_map[i][0] == *optname )
|
|
|
|
{
|
|
|
|
*optname = ws_ip_map[i][1];
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
2003-04-05 00:04:47 +02:00
|
|
|
FIXME("Unknown IPPROTO_IP optname 0x%x\n", *optname);
|
|
|
|
break;
|
2010-03-31 00:07:24 +02:00
|
|
|
case WS_IPPROTO_IPV6:
|
|
|
|
*level = IPPROTO_IPV6;
|
2018-09-12 21:03:54 +02:00
|
|
|
for(i = 0; i < ARRAY_SIZE(ws_ipv6_map); i++) {
|
2010-03-31 00:07:24 +02:00
|
|
|
if (ws_ipv6_map[i][0] == *optname )
|
|
|
|
{
|
|
|
|
*optname = ws_ipv6_map[i][1];
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
FIXME("Unknown IPPROTO_IPV6 optname 0x%x\n", *optname);
|
|
|
|
break;
|
2003-04-05 00:04:47 +02:00
|
|
|
default: FIXME("Unimplemented or unknown socket level\n");
|
Release 961201
Sat Nov 30 19:21:17 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [configure]
Re-generated with autoconf 2.11. Let me know if you have
problems.
* [controls/listbox.c] [controls/oldlbox.c]
Listboxes rewritten from scratch. Moved old code still used by
comboboxes to oldlbox.c
* [misc/registry.c]
Use temporary file when saving registry.
* [windows/dialog.c]
Implemented Win32 version of DlgDirList() and DlgDirListComboBox().
* [windows/winproc.c]
Added translation for listbox Win32 messages.
Sat Nov 30 21:00:00 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [controls/widgets.c] [controls/button.c]
Fixed some incompatibilities with CTL3D DLL.
* [windows/dialog.c]
Made dialog windows fit into the desktop.
* [misc/winsock.c] [misc/winsock_async.c]
New Winsock engine.
* [windows/message.c]
GetMessage() fixes.
* [windows/queue.c] [windows/hook.c] [windows/win.c]
SetMessageQueue() fixes.
Fri Nov 29 10:25:12 1996 Slaven Rezic <eserte@cs.tu-berlin.de>
* [objects/text.c]
DrawText16(): Fixed return value.
Tue Nov 26 14:47:09 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/profile.c] [*/*]
Added Win32 profile functions, updated to new naming standard.
* [objects/font.c] [if1632/thunk.c] [include/windows.h]
Added EnumFonts32*, EnumFontFamiliesEx*, changed prototypes and
structures.
* [misc/ole2nls.c] [if1632/thunk.c]
Added EnumSystemLocales() (winhelp.exe).
* [misc/registry.c]
Added Windows 3.1 registry loader supplied by Tor Sjxwall, tor@sn.no
* [win32/file.c]
Partially fixed CreateFileMapping(), added UnmapViewOfFile().
Sat Nov 23 23:36:05 1996 Ronan Waide <waider@waider.ie>
* [misc/shell.c]
Fixed some FIXMEs relating to ShellExec() and FindExecutable().
* [misc/main.c]
Implemented a few more of the SystemParametersInfo() cases.
Tue Nov 19 01:24:34 1996 Philippe De Muyter <phdm@info.ucl.ac.be>
* [include/keyboard.h]
New file, new macro WINE_VKEY_MAPPINGS (using code taken from event.c).
* [include/windows.h]
New [VK_A, VK_Z] and [VK_0, VK9] macros.
* [misc/keyboard.c]
Fixes in KeyTable and ToAscii.
* [objects/font.c]
FONT_init : Give default value for MSWIN "system" font.
FONT_MatchFont : Do not try every size of a font family if the
family does not exist.
* [windows/event.c]
lastEventChar hack removed.
KeyStateTable replaced by InputKeyStateTable (maintained in event.c)
and QueueKeyStateTable (maintained in message.c).
EVENT_key : Corrections to the extended bit setting.
* [windows/message.c] [windows/keyboard.c]
Implementation of a new QueueKeyStateTable : table of key states
valid when messages are retrieved by GetMessage or PeekMessage,
and valid for TranslateMessage.
TranslateMessage : Convert WM*KEY messages using QueueKeyStateTable
and ToAscii.
Mon Nov 18 16:59:01 1996 Robert Pouliot <krynos@clic.net>
* [graphics/Makefile.in] [graphics/wing.c]
[if1632/wing.spec]
Some functions for WinG support, mostly empty stubs.
* [misc/crtdll.c] [if1632/crtdll.spec]
Many functions added to CRTDLL, mostly calls to Unix C library.
1996-12-01 18:17:47 +01:00
|
|
|
}
|
2000-09-16 22:51:40 +02:00
|
|
|
return 0;
|
Release 961201
Sat Nov 30 19:21:17 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [configure]
Re-generated with autoconf 2.11. Let me know if you have
problems.
* [controls/listbox.c] [controls/oldlbox.c]
Listboxes rewritten from scratch. Moved old code still used by
comboboxes to oldlbox.c
* [misc/registry.c]
Use temporary file when saving registry.
* [windows/dialog.c]
Implemented Win32 version of DlgDirList() and DlgDirListComboBox().
* [windows/winproc.c]
Added translation for listbox Win32 messages.
Sat Nov 30 21:00:00 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [controls/widgets.c] [controls/button.c]
Fixed some incompatibilities with CTL3D DLL.
* [windows/dialog.c]
Made dialog windows fit into the desktop.
* [misc/winsock.c] [misc/winsock_async.c]
New Winsock engine.
* [windows/message.c]
GetMessage() fixes.
* [windows/queue.c] [windows/hook.c] [windows/win.c]
SetMessageQueue() fixes.
Fri Nov 29 10:25:12 1996 Slaven Rezic <eserte@cs.tu-berlin.de>
* [objects/text.c]
DrawText16(): Fixed return value.
Tue Nov 26 14:47:09 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/profile.c] [*/*]
Added Win32 profile functions, updated to new naming standard.
* [objects/font.c] [if1632/thunk.c] [include/windows.h]
Added EnumFonts32*, EnumFontFamiliesEx*, changed prototypes and
structures.
* [misc/ole2nls.c] [if1632/thunk.c]
Added EnumSystemLocales() (winhelp.exe).
* [misc/registry.c]
Added Windows 3.1 registry loader supplied by Tor Sjxwall, tor@sn.no
* [win32/file.c]
Partially fixed CreateFileMapping(), added UnmapViewOfFile().
Sat Nov 23 23:36:05 1996 Ronan Waide <waider@waider.ie>
* [misc/shell.c]
Fixed some FIXMEs relating to ShellExec() and FindExecutable().
* [misc/main.c]
Implemented a few more of the SystemParametersInfo() cases.
Tue Nov 19 01:24:34 1996 Philippe De Muyter <phdm@info.ucl.ac.be>
* [include/keyboard.h]
New file, new macro WINE_VKEY_MAPPINGS (using code taken from event.c).
* [include/windows.h]
New [VK_A, VK_Z] and [VK_0, VK9] macros.
* [misc/keyboard.c]
Fixes in KeyTable and ToAscii.
* [objects/font.c]
FONT_init : Give default value for MSWIN "system" font.
FONT_MatchFont : Do not try every size of a font family if the
family does not exist.
* [windows/event.c]
lastEventChar hack removed.
KeyStateTable replaced by InputKeyStateTable (maintained in event.c)
and QueueKeyStateTable (maintained in message.c).
EVENT_key : Corrections to the extended bit setting.
* [windows/message.c] [windows/keyboard.c]
Implementation of a new QueueKeyStateTable : table of key states
valid when messages are retrieved by GetMessage or PeekMessage,
and valid for TranslateMessage.
TranslateMessage : Convert WM*KEY messages using QueueKeyStateTable
and ToAscii.
Mon Nov 18 16:59:01 1996 Robert Pouliot <krynos@clic.net>
* [graphics/Makefile.in] [graphics/wing.c]
[if1632/wing.spec]
Some functions for WinG support, mostly empty stubs.
* [misc/crtdll.c] [if1632/crtdll.spec]
Many functions added to CRTDLL, mostly calls to Unix C library.
1996-12-01 18:17:47 +01:00
|
|
|
}
|
|
|
|
|
2021-05-01 02:09:58 +02:00
|
|
|
int
|
2005-11-16 12:21:57 +01:00
|
|
|
convert_socktype_w2u(int windowssocktype) {
|
2008-12-10 22:55:35 +01:00
|
|
|
unsigned int i;
|
2005-11-16 12:21:57 +01:00
|
|
|
|
2018-09-12 21:03:54 +02:00
|
|
|
for (i = 0; i < ARRAY_SIZE(ws_socktype_map); i++)
|
2005-11-16 12:21:57 +01:00
|
|
|
if (ws_socktype_map[i][0] == windowssocktype)
|
|
|
|
return ws_socktype_map[i][1];
|
|
|
|
FIXME("unhandled Windows socket type %d\n", windowssocktype);
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2021-05-01 02:09:58 +02:00
|
|
|
int
|
2005-11-16 12:21:57 +01:00
|
|
|
convert_socktype_u2w(int unixsocktype) {
|
2008-12-10 22:55:35 +01:00
|
|
|
unsigned int i;
|
2005-11-16 12:21:57 +01:00
|
|
|
|
2018-09-12 21:03:54 +02:00
|
|
|
for (i = 0; i < ARRAY_SIZE(ws_socktype_map); i++)
|
2005-11-16 12:21:57 +01:00
|
|
|
if (ws_socktype_map[i][1] == unixsocktype)
|
|
|
|
return ws_socktype_map[i][0];
|
|
|
|
FIXME("unhandled UNIX socket type %d\n", unixsocktype);
|
|
|
|
return -1;
|
|
|
|
}
|
1999-05-24 10:13:02 +02:00
|
|
|
|
2013-12-31 01:24:56 +01:00
|
|
|
static int set_ipx_packettype(int sock, int ptype)
|
|
|
|
{
|
|
|
|
#ifdef HAS_IPX
|
|
|
|
int fd = get_sock_fd( sock, 0, NULL ), ret = 0;
|
|
|
|
TRACE("trying to set IPX_PTYPE: %d (fd: %d)\n", ptype, fd);
|
|
|
|
|
2014-01-04 17:49:40 +01:00
|
|
|
if (fd == -1) return SOCKET_ERROR;
|
|
|
|
|
2013-12-31 01:24:56 +01:00
|
|
|
/* We try to set the ipx type on ipx socket level. */
|
|
|
|
#ifdef SOL_IPX
|
|
|
|
if(setsockopt(fd, SOL_IPX, IPX_TYPE, &ptype, sizeof(ptype)) == -1)
|
|
|
|
{
|
|
|
|
ERR("IPX: could not set ipx option type; expect weird behaviour\n");
|
|
|
|
ret = SOCKET_ERROR;
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
{
|
|
|
|
struct ipx val;
|
|
|
|
/* Should we retrieve val using a getsockopt call and then
|
|
|
|
* set the modified one? */
|
|
|
|
val.ipx_pt = ptype;
|
|
|
|
setsockopt(fd, 0, SO_DEFAULT_HEADERS, &val, sizeof(struct ipx));
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
release_sock_fd( sock, fd );
|
|
|
|
return ret;
|
|
|
|
#else
|
|
|
|
WARN("IPX support is not enabled, can't set packet type\n");
|
|
|
|
return SOCKET_ERROR;
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2002-06-01 01:06:46 +02:00
|
|
|
/* ----------------------------------- API -----
|
Release 961201
Sat Nov 30 19:21:17 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [configure]
Re-generated with autoconf 2.11. Let me know if you have
problems.
* [controls/listbox.c] [controls/oldlbox.c]
Listboxes rewritten from scratch. Moved old code still used by
comboboxes to oldlbox.c
* [misc/registry.c]
Use temporary file when saving registry.
* [windows/dialog.c]
Implemented Win32 version of DlgDirList() and DlgDirListComboBox().
* [windows/winproc.c]
Added translation for listbox Win32 messages.
Sat Nov 30 21:00:00 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [controls/widgets.c] [controls/button.c]
Fixed some incompatibilities with CTL3D DLL.
* [windows/dialog.c]
Made dialog windows fit into the desktop.
* [misc/winsock.c] [misc/winsock_async.c]
New Winsock engine.
* [windows/message.c]
GetMessage() fixes.
* [windows/queue.c] [windows/hook.c] [windows/win.c]
SetMessageQueue() fixes.
Fri Nov 29 10:25:12 1996 Slaven Rezic <eserte@cs.tu-berlin.de>
* [objects/text.c]
DrawText16(): Fixed return value.
Tue Nov 26 14:47:09 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/profile.c] [*/*]
Added Win32 profile functions, updated to new naming standard.
* [objects/font.c] [if1632/thunk.c] [include/windows.h]
Added EnumFonts32*, EnumFontFamiliesEx*, changed prototypes and
structures.
* [misc/ole2nls.c] [if1632/thunk.c]
Added EnumSystemLocales() (winhelp.exe).
* [misc/registry.c]
Added Windows 3.1 registry loader supplied by Tor Sjxwall, tor@sn.no
* [win32/file.c]
Partially fixed CreateFileMapping(), added UnmapViewOfFile().
Sat Nov 23 23:36:05 1996 Ronan Waide <waider@waider.ie>
* [misc/shell.c]
Fixed some FIXMEs relating to ShellExec() and FindExecutable().
* [misc/main.c]
Implemented a few more of the SystemParametersInfo() cases.
Tue Nov 19 01:24:34 1996 Philippe De Muyter <phdm@info.ucl.ac.be>
* [include/keyboard.h]
New file, new macro WINE_VKEY_MAPPINGS (using code taken from event.c).
* [include/windows.h]
New [VK_A, VK_Z] and [VK_0, VK9] macros.
* [misc/keyboard.c]
Fixes in KeyTable and ToAscii.
* [objects/font.c]
FONT_init : Give default value for MSWIN "system" font.
FONT_MatchFont : Do not try every size of a font family if the
family does not exist.
* [windows/event.c]
lastEventChar hack removed.
KeyStateTable replaced by InputKeyStateTable (maintained in event.c)
and QueueKeyStateTable (maintained in message.c).
EVENT_key : Corrections to the extended bit setting.
* [windows/message.c] [windows/keyboard.c]
Implementation of a new QueueKeyStateTable : table of key states
valid when messages are retrieved by GetMessage or PeekMessage,
and valid for TranslateMessage.
TranslateMessage : Convert WM*KEY messages using QueueKeyStateTable
and ToAscii.
Mon Nov 18 16:59:01 1996 Robert Pouliot <krynos@clic.net>
* [graphics/Makefile.in] [graphics/wing.c]
[if1632/wing.spec]
Some functions for WinG support, mostly empty stubs.
* [misc/crtdll.c] [if1632/crtdll.spec]
Many functions added to CRTDLL, mostly calls to Unix C library.
1996-12-01 18:17:47 +01:00
|
|
|
*
|
|
|
|
* Init / cleanup / error checking.
|
|
|
|
*/
|
|
|
|
|
1997-08-24 18:00:30 +02:00
|
|
|
/***********************************************************************
|
2001-07-02 21:59:40 +02:00
|
|
|
* WSAStartup (WS2_32.115)
|
1997-08-24 18:00:30 +02:00
|
|
|
*/
|
2001-09-14 02:19:52 +02:00
|
|
|
int WINAPI WSAStartup(WORD wVersionRequested, LPWSADATA lpWSAData)
|
2000-06-18 19:23:17 +02:00
|
|
|
{
|
|
|
|
TRACE("verReq=%x\n", wVersionRequested);
|
|
|
|
|
2000-07-09 13:19:35 +02:00
|
|
|
if (LOBYTE(wVersionRequested) < 1)
|
2000-06-18 19:23:17 +02:00
|
|
|
return WSAVERNOTSUPPORTED;
|
|
|
|
|
|
|
|
if (!lpWSAData) return WSAEINVAL;
|
|
|
|
|
2001-02-20 02:57:13 +01:00
|
|
|
num_startup++;
|
2000-06-18 19:23:17 +02:00
|
|
|
|
2000-07-10 12:57:46 +02:00
|
|
|
/* that's the whole of the negotiation for now */
|
|
|
|
lpWSAData->wVersion = wVersionRequested;
|
2002-08-29 03:48:55 +02:00
|
|
|
/* return winsock information */
|
|
|
|
lpWSAData->wHighVersion = 0x0202;
|
|
|
|
strcpy(lpWSAData->szDescription, "WinSock 2.0" );
|
|
|
|
strcpy(lpWSAData->szSystemStatus, "Running" );
|
|
|
|
lpWSAData->iMaxSockets = WS_MAX_SOCKETS_PER_PROCESS;
|
|
|
|
lpWSAData->iMaxUdpDg = WS_MAX_UDP_DATAGRAM;
|
|
|
|
/* don't do anything with lpWSAData->lpVendorInfo */
|
|
|
|
/* (some apps don't allocate the space for this field) */
|
2000-07-10 12:57:46 +02:00
|
|
|
|
2014-07-03 16:18:28 +02:00
|
|
|
TRACE("succeeded starts: %d\n", num_startup);
|
2000-06-18 19:23:17 +02:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
1997-08-24 18:00:30 +02:00
|
|
|
/***********************************************************************
|
2001-07-11 20:56:41 +02:00
|
|
|
* WSACleanup (WS2_32.116)
|
1997-08-24 18:00:30 +02:00
|
|
|
*/
|
1999-02-26 12:11:13 +01:00
|
|
|
INT WINAPI WSACleanup(void)
|
Release 961201
Sat Nov 30 19:21:17 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [configure]
Re-generated with autoconf 2.11. Let me know if you have
problems.
* [controls/listbox.c] [controls/oldlbox.c]
Listboxes rewritten from scratch. Moved old code still used by
comboboxes to oldlbox.c
* [misc/registry.c]
Use temporary file when saving registry.
* [windows/dialog.c]
Implemented Win32 version of DlgDirList() and DlgDirListComboBox().
* [windows/winproc.c]
Added translation for listbox Win32 messages.
Sat Nov 30 21:00:00 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [controls/widgets.c] [controls/button.c]
Fixed some incompatibilities with CTL3D DLL.
* [windows/dialog.c]
Made dialog windows fit into the desktop.
* [misc/winsock.c] [misc/winsock_async.c]
New Winsock engine.
* [windows/message.c]
GetMessage() fixes.
* [windows/queue.c] [windows/hook.c] [windows/win.c]
SetMessageQueue() fixes.
Fri Nov 29 10:25:12 1996 Slaven Rezic <eserte@cs.tu-berlin.de>
* [objects/text.c]
DrawText16(): Fixed return value.
Tue Nov 26 14:47:09 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/profile.c] [*/*]
Added Win32 profile functions, updated to new naming standard.
* [objects/font.c] [if1632/thunk.c] [include/windows.h]
Added EnumFonts32*, EnumFontFamiliesEx*, changed prototypes and
structures.
* [misc/ole2nls.c] [if1632/thunk.c]
Added EnumSystemLocales() (winhelp.exe).
* [misc/registry.c]
Added Windows 3.1 registry loader supplied by Tor Sjxwall, tor@sn.no
* [win32/file.c]
Partially fixed CreateFileMapping(), added UnmapViewOfFile().
Sat Nov 23 23:36:05 1996 Ronan Waide <waider@waider.ie>
* [misc/shell.c]
Fixed some FIXMEs relating to ShellExec() and FindExecutable().
* [misc/main.c]
Implemented a few more of the SystemParametersInfo() cases.
Tue Nov 19 01:24:34 1996 Philippe De Muyter <phdm@info.ucl.ac.be>
* [include/keyboard.h]
New file, new macro WINE_VKEY_MAPPINGS (using code taken from event.c).
* [include/windows.h]
New [VK_A, VK_Z] and [VK_0, VK9] macros.
* [misc/keyboard.c]
Fixes in KeyTable and ToAscii.
* [objects/font.c]
FONT_init : Give default value for MSWIN "system" font.
FONT_MatchFont : Do not try every size of a font family if the
family does not exist.
* [windows/event.c]
lastEventChar hack removed.
KeyStateTable replaced by InputKeyStateTable (maintained in event.c)
and QueueKeyStateTable (maintained in message.c).
EVENT_key : Corrections to the extended bit setting.
* [windows/message.c] [windows/keyboard.c]
Implementation of a new QueueKeyStateTable : table of key states
valid when messages are retrieved by GetMessage or PeekMessage,
and valid for TranslateMessage.
TranslateMessage : Convert WM*KEY messages using QueueKeyStateTable
and ToAscii.
Mon Nov 18 16:59:01 1996 Robert Pouliot <krynos@clic.net>
* [graphics/Makefile.in] [graphics/wing.c]
[if1632/wing.spec]
Some functions for WinG support, mostly empty stubs.
* [misc/crtdll.c] [if1632/crtdll.spec]
Many functions added to CRTDLL, mostly calls to Unix C library.
1996-12-01 18:17:47 +01:00
|
|
|
{
|
2020-09-10 23:17:15 +02:00
|
|
|
TRACE("decreasing startup count from %d\n", num_startup);
|
|
|
|
if (num_startup)
|
|
|
|
{
|
|
|
|
if (!--num_startup)
|
|
|
|
{
|
|
|
|
unsigned int i;
|
|
|
|
|
|
|
|
for (i = 0; i < socket_list_size; ++i)
|
|
|
|
CloseHandle(SOCKET2HANDLE(socket_list[i]));
|
|
|
|
memset(socket_list, 0, socket_list_size * sizeof(*socket_list));
|
|
|
|
}
|
2001-02-20 02:57:13 +01:00
|
|
|
return 0;
|
2005-11-29 17:06:35 +01:00
|
|
|
}
|
2000-03-04 20:29:42 +01:00
|
|
|
SetLastError(WSANOTINITIALISED);
|
1999-10-23 18:53:34 +02:00
|
|
|
return SOCKET_ERROR;
|
1997-08-24 18:00:30 +02:00
|
|
|
}
|
Release 961201
Sat Nov 30 19:21:17 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [configure]
Re-generated with autoconf 2.11. Let me know if you have
problems.
* [controls/listbox.c] [controls/oldlbox.c]
Listboxes rewritten from scratch. Moved old code still used by
comboboxes to oldlbox.c
* [misc/registry.c]
Use temporary file when saving registry.
* [windows/dialog.c]
Implemented Win32 version of DlgDirList() and DlgDirListComboBox().
* [windows/winproc.c]
Added translation for listbox Win32 messages.
Sat Nov 30 21:00:00 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [controls/widgets.c] [controls/button.c]
Fixed some incompatibilities with CTL3D DLL.
* [windows/dialog.c]
Made dialog windows fit into the desktop.
* [misc/winsock.c] [misc/winsock_async.c]
New Winsock engine.
* [windows/message.c]
GetMessage() fixes.
* [windows/queue.c] [windows/hook.c] [windows/win.c]
SetMessageQueue() fixes.
Fri Nov 29 10:25:12 1996 Slaven Rezic <eserte@cs.tu-berlin.de>
* [objects/text.c]
DrawText16(): Fixed return value.
Tue Nov 26 14:47:09 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/profile.c] [*/*]
Added Win32 profile functions, updated to new naming standard.
* [objects/font.c] [if1632/thunk.c] [include/windows.h]
Added EnumFonts32*, EnumFontFamiliesEx*, changed prototypes and
structures.
* [misc/ole2nls.c] [if1632/thunk.c]
Added EnumSystemLocales() (winhelp.exe).
* [misc/registry.c]
Added Windows 3.1 registry loader supplied by Tor Sjxwall, tor@sn.no
* [win32/file.c]
Partially fixed CreateFileMapping(), added UnmapViewOfFile().
Sat Nov 23 23:36:05 1996 Ronan Waide <waider@waider.ie>
* [misc/shell.c]
Fixed some FIXMEs relating to ShellExec() and FindExecutable().
* [misc/main.c]
Implemented a few more of the SystemParametersInfo() cases.
Tue Nov 19 01:24:34 1996 Philippe De Muyter <phdm@info.ucl.ac.be>
* [include/keyboard.h]
New file, new macro WINE_VKEY_MAPPINGS (using code taken from event.c).
* [include/windows.h]
New [VK_A, VK_Z] and [VK_0, VK9] macros.
* [misc/keyboard.c]
Fixes in KeyTable and ToAscii.
* [objects/font.c]
FONT_init : Give default value for MSWIN "system" font.
FONT_MatchFont : Do not try every size of a font family if the
family does not exist.
* [windows/event.c]
lastEventChar hack removed.
KeyStateTable replaced by InputKeyStateTable (maintained in event.c)
and QueueKeyStateTable (maintained in message.c).
EVENT_key : Corrections to the extended bit setting.
* [windows/message.c] [windows/keyboard.c]
Implementation of a new QueueKeyStateTable : table of key states
valid when messages are retrieved by GetMessage or PeekMessage,
and valid for TranslateMessage.
TranslateMessage : Convert WM*KEY messages using QueueKeyStateTable
and ToAscii.
Mon Nov 18 16:59:01 1996 Robert Pouliot <krynos@clic.net>
* [graphics/Makefile.in] [graphics/wing.c]
[if1632/wing.spec]
Some functions for WinG support, mostly empty stubs.
* [misc/crtdll.c] [if1632/crtdll.spec]
Many functions added to CRTDLL, mostly calls to Unix C library.
1996-12-01 18:17:47 +01:00
|
|
|
|
|
|
|
|
1997-08-24 18:00:30 +02:00
|
|
|
/***********************************************************************
|
2001-07-02 21:59:40 +02:00
|
|
|
* WSAGetLastError (WS2_32.111)
|
1997-08-24 18:00:30 +02:00
|
|
|
*/
|
1999-02-26 12:11:13 +01:00
|
|
|
INT WINAPI WSAGetLastError(void)
|
1997-08-24 18:00:30 +02:00
|
|
|
{
|
1999-05-12 12:34:03 +02:00
|
|
|
return GetLastError();
|
Release 961201
Sat Nov 30 19:21:17 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [configure]
Re-generated with autoconf 2.11. Let me know if you have
problems.
* [controls/listbox.c] [controls/oldlbox.c]
Listboxes rewritten from scratch. Moved old code still used by
comboboxes to oldlbox.c
* [misc/registry.c]
Use temporary file when saving registry.
* [windows/dialog.c]
Implemented Win32 version of DlgDirList() and DlgDirListComboBox().
* [windows/winproc.c]
Added translation for listbox Win32 messages.
Sat Nov 30 21:00:00 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [controls/widgets.c] [controls/button.c]
Fixed some incompatibilities with CTL3D DLL.
* [windows/dialog.c]
Made dialog windows fit into the desktop.
* [misc/winsock.c] [misc/winsock_async.c]
New Winsock engine.
* [windows/message.c]
GetMessage() fixes.
* [windows/queue.c] [windows/hook.c] [windows/win.c]
SetMessageQueue() fixes.
Fri Nov 29 10:25:12 1996 Slaven Rezic <eserte@cs.tu-berlin.de>
* [objects/text.c]
DrawText16(): Fixed return value.
Tue Nov 26 14:47:09 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/profile.c] [*/*]
Added Win32 profile functions, updated to new naming standard.
* [objects/font.c] [if1632/thunk.c] [include/windows.h]
Added EnumFonts32*, EnumFontFamiliesEx*, changed prototypes and
structures.
* [misc/ole2nls.c] [if1632/thunk.c]
Added EnumSystemLocales() (winhelp.exe).
* [misc/registry.c]
Added Windows 3.1 registry loader supplied by Tor Sjxwall, tor@sn.no
* [win32/file.c]
Partially fixed CreateFileMapping(), added UnmapViewOfFile().
Sat Nov 23 23:36:05 1996 Ronan Waide <waider@waider.ie>
* [misc/shell.c]
Fixed some FIXMEs relating to ShellExec() and FindExecutable().
* [misc/main.c]
Implemented a few more of the SystemParametersInfo() cases.
Tue Nov 19 01:24:34 1996 Philippe De Muyter <phdm@info.ucl.ac.be>
* [include/keyboard.h]
New file, new macro WINE_VKEY_MAPPINGS (using code taken from event.c).
* [include/windows.h]
New [VK_A, VK_Z] and [VK_0, VK9] macros.
* [misc/keyboard.c]
Fixes in KeyTable and ToAscii.
* [objects/font.c]
FONT_init : Give default value for MSWIN "system" font.
FONT_MatchFont : Do not try every size of a font family if the
family does not exist.
* [windows/event.c]
lastEventChar hack removed.
KeyStateTable replaced by InputKeyStateTable (maintained in event.c)
and QueueKeyStateTable (maintained in message.c).
EVENT_key : Corrections to the extended bit setting.
* [windows/message.c] [windows/keyboard.c]
Implementation of a new QueueKeyStateTable : table of key states
valid when messages are retrieved by GetMessage or PeekMessage,
and valid for TranslateMessage.
TranslateMessage : Convert WM*KEY messages using QueueKeyStateTable
and ToAscii.
Mon Nov 18 16:59:01 1996 Robert Pouliot <krynos@clic.net>
* [graphics/Makefile.in] [graphics/wing.c]
[if1632/wing.spec]
Some functions for WinG support, mostly empty stubs.
* [misc/crtdll.c] [if1632/crtdll.spec]
Many functions added to CRTDLL, mostly calls to Unix C library.
1996-12-01 18:17:47 +01:00
|
|
|
}
|
|
|
|
|
1997-08-24 18:00:30 +02:00
|
|
|
/***********************************************************************
|
2001-07-02 21:59:40 +02:00
|
|
|
* WSASetLastError (WS2_32.112)
|
1997-08-24 18:00:30 +02:00
|
|
|
*/
|
1999-05-12 12:34:03 +02:00
|
|
|
void WINAPI WSASetLastError(INT iError) {
|
|
|
|
SetLastError(iError);
|
1997-08-24 18:00:30 +02:00
|
|
|
}
|
Release 961201
Sat Nov 30 19:21:17 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [configure]
Re-generated with autoconf 2.11. Let me know if you have
problems.
* [controls/listbox.c] [controls/oldlbox.c]
Listboxes rewritten from scratch. Moved old code still used by
comboboxes to oldlbox.c
* [misc/registry.c]
Use temporary file when saving registry.
* [windows/dialog.c]
Implemented Win32 version of DlgDirList() and DlgDirListComboBox().
* [windows/winproc.c]
Added translation for listbox Win32 messages.
Sat Nov 30 21:00:00 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [controls/widgets.c] [controls/button.c]
Fixed some incompatibilities with CTL3D DLL.
* [windows/dialog.c]
Made dialog windows fit into the desktop.
* [misc/winsock.c] [misc/winsock_async.c]
New Winsock engine.
* [windows/message.c]
GetMessage() fixes.
* [windows/queue.c] [windows/hook.c] [windows/win.c]
SetMessageQueue() fixes.
Fri Nov 29 10:25:12 1996 Slaven Rezic <eserte@cs.tu-berlin.de>
* [objects/text.c]
DrawText16(): Fixed return value.
Tue Nov 26 14:47:09 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/profile.c] [*/*]
Added Win32 profile functions, updated to new naming standard.
* [objects/font.c] [if1632/thunk.c] [include/windows.h]
Added EnumFonts32*, EnumFontFamiliesEx*, changed prototypes and
structures.
* [misc/ole2nls.c] [if1632/thunk.c]
Added EnumSystemLocales() (winhelp.exe).
* [misc/registry.c]
Added Windows 3.1 registry loader supplied by Tor Sjxwall, tor@sn.no
* [win32/file.c]
Partially fixed CreateFileMapping(), added UnmapViewOfFile().
Sat Nov 23 23:36:05 1996 Ronan Waide <waider@waider.ie>
* [misc/shell.c]
Fixed some FIXMEs relating to ShellExec() and FindExecutable().
* [misc/main.c]
Implemented a few more of the SystemParametersInfo() cases.
Tue Nov 19 01:24:34 1996 Philippe De Muyter <phdm@info.ucl.ac.be>
* [include/keyboard.h]
New file, new macro WINE_VKEY_MAPPINGS (using code taken from event.c).
* [include/windows.h]
New [VK_A, VK_Z] and [VK_0, VK9] macros.
* [misc/keyboard.c]
Fixes in KeyTable and ToAscii.
* [objects/font.c]
FONT_init : Give default value for MSWIN "system" font.
FONT_MatchFont : Do not try every size of a font family if the
family does not exist.
* [windows/event.c]
lastEventChar hack removed.
KeyStateTable replaced by InputKeyStateTable (maintained in event.c)
and QueueKeyStateTable (maintained in message.c).
EVENT_key : Corrections to the extended bit setting.
* [windows/message.c] [windows/keyboard.c]
Implementation of a new QueueKeyStateTable : table of key states
valid when messages are retrieved by GetMessage or PeekMessage,
and valid for TranslateMessage.
TranslateMessage : Convert WM*KEY messages using QueueKeyStateTable
and ToAscii.
Mon Nov 18 16:59:01 1996 Robert Pouliot <krynos@clic.net>
* [graphics/Makefile.in] [graphics/wing.c]
[if1632/wing.spec]
Some functions for WinG support, mostly empty stubs.
* [misc/crtdll.c] [if1632/crtdll.spec]
Many functions added to CRTDLL, mostly calls to Unix C library.
1996-12-01 18:17:47 +01:00
|
|
|
|
2009-08-12 18:14:27 +02:00
|
|
|
static inline BOOL supported_pf(int pf)
|
|
|
|
{
|
|
|
|
switch (pf)
|
|
|
|
{
|
|
|
|
case WS_AF_INET:
|
|
|
|
case WS_AF_INET6:
|
|
|
|
return TRUE;
|
2013-06-17 21:56:52 +02:00
|
|
|
#ifdef HAS_IPX
|
2009-08-12 18:14:27 +02:00
|
|
|
case WS_AF_IPX:
|
|
|
|
return TRUE;
|
|
|
|
#endif
|
2013-06-17 21:56:52 +02:00
|
|
|
#ifdef HAS_IRDA
|
2009-08-12 18:14:27 +02:00
|
|
|
case WS_AF_IRDA:
|
|
|
|
return TRUE;
|
2001-10-08 22:36:03 +02:00
|
|
|
#endif
|
2009-08-12 18:14:27 +02:00
|
|
|
default:
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
}
|
2001-10-08 22:36:03 +02:00
|
|
|
|
2000-12-02 00:58:28 +01:00
|
|
|
/**********************************************************************/
|
|
|
|
|
2017-02-27 02:25:43 +01:00
|
|
|
/* Returns the length of the converted address if successful, 0 if it was too
|
|
|
|
* small to start with or unknown family or invalid address buffer.
|
2001-10-08 22:36:03 +02:00
|
|
|
*/
|
2021-05-01 02:10:00 +02:00
|
|
|
unsigned int ws_sockaddr_ws2u( const struct WS_sockaddr *wsaddr, int wsaddrlen,
|
|
|
|
union generic_unix_sockaddr *uaddr )
|
Release 961201
Sat Nov 30 19:21:17 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [configure]
Re-generated with autoconf 2.11. Let me know if you have
problems.
* [controls/listbox.c] [controls/oldlbox.c]
Listboxes rewritten from scratch. Moved old code still used by
comboboxes to oldlbox.c
* [misc/registry.c]
Use temporary file when saving registry.
* [windows/dialog.c]
Implemented Win32 version of DlgDirList() and DlgDirListComboBox().
* [windows/winproc.c]
Added translation for listbox Win32 messages.
Sat Nov 30 21:00:00 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [controls/widgets.c] [controls/button.c]
Fixed some incompatibilities with CTL3D DLL.
* [windows/dialog.c]
Made dialog windows fit into the desktop.
* [misc/winsock.c] [misc/winsock_async.c]
New Winsock engine.
* [windows/message.c]
GetMessage() fixes.
* [windows/queue.c] [windows/hook.c] [windows/win.c]
SetMessageQueue() fixes.
Fri Nov 29 10:25:12 1996 Slaven Rezic <eserte@cs.tu-berlin.de>
* [objects/text.c]
DrawText16(): Fixed return value.
Tue Nov 26 14:47:09 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/profile.c] [*/*]
Added Win32 profile functions, updated to new naming standard.
* [objects/font.c] [if1632/thunk.c] [include/windows.h]
Added EnumFonts32*, EnumFontFamiliesEx*, changed prototypes and
structures.
* [misc/ole2nls.c] [if1632/thunk.c]
Added EnumSystemLocales() (winhelp.exe).
* [misc/registry.c]
Added Windows 3.1 registry loader supplied by Tor Sjxwall, tor@sn.no
* [win32/file.c]
Partially fixed CreateFileMapping(), added UnmapViewOfFile().
Sat Nov 23 23:36:05 1996 Ronan Waide <waider@waider.ie>
* [misc/shell.c]
Fixed some FIXMEs relating to ShellExec() and FindExecutable().
* [misc/main.c]
Implemented a few more of the SystemParametersInfo() cases.
Tue Nov 19 01:24:34 1996 Philippe De Muyter <phdm@info.ucl.ac.be>
* [include/keyboard.h]
New file, new macro WINE_VKEY_MAPPINGS (using code taken from event.c).
* [include/windows.h]
New [VK_A, VK_Z] and [VK_0, VK9] macros.
* [misc/keyboard.c]
Fixes in KeyTable and ToAscii.
* [objects/font.c]
FONT_init : Give default value for MSWIN "system" font.
FONT_MatchFont : Do not try every size of a font family if the
family does not exist.
* [windows/event.c]
lastEventChar hack removed.
KeyStateTable replaced by InputKeyStateTable (maintained in event.c)
and QueueKeyStateTable (maintained in message.c).
EVENT_key : Corrections to the extended bit setting.
* [windows/message.c] [windows/keyboard.c]
Implementation of a new QueueKeyStateTable : table of key states
valid when messages are retrieved by GetMessage or PeekMessage,
and valid for TranslateMessage.
TranslateMessage : Convert WM*KEY messages using QueueKeyStateTable
and ToAscii.
Mon Nov 18 16:59:01 1996 Robert Pouliot <krynos@clic.net>
* [graphics/Makefile.in] [graphics/wing.c]
[if1632/wing.spec]
Some functions for WinG support, mostly empty stubs.
* [misc/crtdll.c] [if1632/crtdll.spec]
Many functions added to CRTDLL, mostly calls to Unix C library.
1996-12-01 18:17:47 +01:00
|
|
|
{
|
2007-05-30 20:11:58 +02:00
|
|
|
unsigned int uaddrlen = 0;
|
|
|
|
|
2017-02-27 02:25:43 +01:00
|
|
|
if (!wsaddr)
|
|
|
|
return 0;
|
|
|
|
|
2001-10-08 22:36:03 +02:00
|
|
|
switch (wsaddr->sa_family)
|
|
|
|
{
|
2013-06-17 21:56:52 +02:00
|
|
|
#ifdef HAS_IPX
|
2001-10-08 22:36:03 +02:00
|
|
|
case WS_AF_IPX:
|
|
|
|
{
|
2005-06-27 11:53:46 +02:00
|
|
|
const struct WS_sockaddr_ipx* wsipx=(const struct WS_sockaddr_ipx*)wsaddr;
|
2007-05-30 20:11:58 +02:00
|
|
|
struct sockaddr_ipx* uipx = (struct sockaddr_ipx *)uaddr;
|
2001-10-08 22:36:03 +02:00
|
|
|
|
2001-11-14 22:26:23 +01:00
|
|
|
if (wsaddrlen<sizeof(struct WS_sockaddr_ipx))
|
2007-05-30 20:11:58 +02:00
|
|
|
return 0;
|
2001-10-08 22:36:03 +02:00
|
|
|
|
2007-05-30 20:11:58 +02:00
|
|
|
uaddrlen = sizeof(struct sockaddr_ipx);
|
2007-07-24 14:52:27 +02:00
|
|
|
memset( uaddr, 0, uaddrlen );
|
2001-10-08 22:36:03 +02:00
|
|
|
uipx->sipx_family=AF_IPX;
|
|
|
|
uipx->sipx_port=wsipx->sa_socket;
|
2002-06-01 01:06:46 +02:00
|
|
|
/* copy sa_netnum and sa_nodenum to sipx_network and sipx_node
|
2001-10-08 22:36:03 +02:00
|
|
|
* in one go
|
|
|
|
*/
|
|
|
|
memcpy(&uipx->sipx_network,wsipx->sa_netnum,sizeof(uipx->sipx_network)+sizeof(uipx->sipx_node));
|
2003-01-23 22:20:36 +01:00
|
|
|
#ifdef IPX_FRAME_NONE
|
2001-10-08 22:36:03 +02:00
|
|
|
uipx->sipx_type=IPX_FRAME_NONE;
|
2003-01-23 22:20:36 +01:00
|
|
|
#endif
|
2007-05-30 20:11:58 +02:00
|
|
|
break;
|
2001-10-08 22:36:03 +02:00
|
|
|
}
|
|
|
|
#endif
|
2005-11-16 12:21:57 +01:00
|
|
|
case WS_AF_INET6: {
|
2007-05-30 20:11:58 +02:00
|
|
|
struct sockaddr_in6* uin6 = (struct sockaddr_in6 *)uaddr;
|
2006-11-23 23:39:34 +01:00
|
|
|
const struct WS_sockaddr_in6* win6 = (const struct WS_sockaddr_in6*)wsaddr;
|
2005-11-16 12:21:57 +01:00
|
|
|
|
|
|
|
/* Note: Windows has 2 versions of the sockaddr_in6 struct, one with
|
2008-03-01 05:36:46 +01:00
|
|
|
* scope_id, one without.
|
2005-11-16 12:21:57 +01:00
|
|
|
*/
|
2006-02-20 13:33:09 +01:00
|
|
|
if (wsaddrlen >= sizeof(struct WS_sockaddr_in6_old)) {
|
2007-05-30 20:11:58 +02:00
|
|
|
uaddrlen = sizeof(struct sockaddr_in6);
|
2007-07-24 14:52:27 +02:00
|
|
|
memset( uaddr, 0, uaddrlen );
|
2005-11-16 12:21:57 +01:00
|
|
|
uin6->sin6_family = AF_INET6;
|
|
|
|
uin6->sin6_port = win6->sin6_port;
|
|
|
|
uin6->sin6_flowinfo = win6->sin6_flowinfo;
|
2006-02-20 13:33:09 +01:00
|
|
|
#ifdef HAVE_STRUCT_SOCKADDR_IN6_SIN6_SCOPE_ID
|
|
|
|
if (wsaddrlen >= sizeof(struct WS_sockaddr_in6)) uin6->sin6_scope_id = win6->sin6_scope_id;
|
|
|
|
#endif
|
2005-11-16 12:21:57 +01:00
|
|
|
memcpy(&uin6->sin6_addr,&win6->sin6_addr,16); /* 16 bytes = 128 address bits */
|
2007-05-30 20:11:58 +02:00
|
|
|
break;
|
2005-11-16 12:21:57 +01:00
|
|
|
}
|
|
|
|
FIXME("bad size %d for WS_sockaddr_in6\n",wsaddrlen);
|
2007-05-30 20:11:58 +02:00
|
|
|
return 0;
|
2005-11-16 12:21:57 +01:00
|
|
|
}
|
|
|
|
case WS_AF_INET: {
|
2007-05-30 20:11:58 +02:00
|
|
|
struct sockaddr_in* uin = (struct sockaddr_in *)uaddr;
|
2006-11-23 23:39:34 +01:00
|
|
|
const struct WS_sockaddr_in* win = (const struct WS_sockaddr_in*)wsaddr;
|
2001-10-08 22:36:03 +02:00
|
|
|
|
2005-11-16 12:21:57 +01:00
|
|
|
if (wsaddrlen<sizeof(struct WS_sockaddr_in))
|
2007-05-30 20:11:58 +02:00
|
|
|
return 0;
|
|
|
|
uaddrlen = sizeof(struct sockaddr_in);
|
2007-07-24 14:52:27 +02:00
|
|
|
memset( uaddr, 0, uaddrlen );
|
2005-11-16 12:21:57 +01:00
|
|
|
uin->sin_family = AF_INET;
|
|
|
|
uin->sin_port = win->sin_port;
|
|
|
|
memcpy(&uin->sin_addr,&win->sin_addr,4); /* 4 bytes = 32 address bits */
|
2007-05-30 20:11:58 +02:00
|
|
|
break;
|
2006-01-03 12:11:07 +01:00
|
|
|
}
|
2013-06-17 21:56:52 +02:00
|
|
|
#ifdef HAS_IRDA
|
2009-08-12 18:14:41 +02:00
|
|
|
case WS_AF_IRDA: {
|
|
|
|
struct sockaddr_irda *uin = (struct sockaddr_irda *)uaddr;
|
|
|
|
const SOCKADDR_IRDA *win = (const SOCKADDR_IRDA *)wsaddr;
|
|
|
|
|
|
|
|
if (wsaddrlen < sizeof(SOCKADDR_IRDA))
|
|
|
|
return 0;
|
|
|
|
uaddrlen = sizeof(struct sockaddr_irda);
|
|
|
|
memset( uaddr, 0, uaddrlen );
|
|
|
|
uin->sir_family = AF_IRDA;
|
|
|
|
if (!strncmp( win->irdaServiceName, "LSAP-SEL", strlen( "LSAP-SEL" ) ))
|
|
|
|
{
|
2010-08-19 22:02:35 +02:00
|
|
|
unsigned int lsap_sel = 0;
|
2009-08-12 18:14:41 +02:00
|
|
|
|
|
|
|
sscanf( win->irdaServiceName, "LSAP-SEL%u", &lsap_sel );
|
|
|
|
uin->sir_lsap_sel = lsap_sel;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
uin->sir_lsap_sel = LSAP_ANY;
|
|
|
|
memcpy( uin->sir_name, win->irdaServiceName, 25 );
|
|
|
|
}
|
|
|
|
memcpy( &uin->sir_addr, win->irdaDeviceID, sizeof(uin->sir_addr) );
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif
|
2006-01-03 12:11:07 +01:00
|
|
|
case WS_AF_UNSPEC: {
|
|
|
|
/* Try to determine the needed space by the passed windows sockaddr space */
|
|
|
|
switch (wsaddrlen) {
|
2013-12-03 14:25:04 +01:00
|
|
|
default: /* likely an ipv4 address */
|
2006-01-03 12:11:07 +01:00
|
|
|
case sizeof(struct WS_sockaddr_in):
|
2007-05-30 20:11:58 +02:00
|
|
|
uaddrlen = sizeof(struct sockaddr_in);
|
2006-01-03 12:11:07 +01:00
|
|
|
break;
|
2013-06-17 21:56:52 +02:00
|
|
|
#ifdef HAS_IPX
|
2006-01-03 12:11:07 +01:00
|
|
|
case sizeof(struct WS_sockaddr_ipx):
|
2007-05-30 20:11:58 +02:00
|
|
|
uaddrlen = sizeof(struct sockaddr_ipx);
|
2006-01-03 12:11:07 +01:00
|
|
|
break;
|
2009-08-12 18:14:41 +02:00
|
|
|
#endif
|
2013-06-17 21:56:52 +02:00
|
|
|
#ifdef HAS_IRDA
|
2009-08-12 18:14:41 +02:00
|
|
|
case sizeof(SOCKADDR_IRDA):
|
|
|
|
uaddrlen = sizeof(struct sockaddr_irda);
|
|
|
|
break;
|
2006-01-03 12:11:07 +01:00
|
|
|
#endif
|
|
|
|
case sizeof(struct WS_sockaddr_in6):
|
|
|
|
case sizeof(struct WS_sockaddr_in6_old):
|
2007-05-30 20:11:58 +02:00
|
|
|
uaddrlen = sizeof(struct sockaddr_in6);
|
2006-01-03 12:11:07 +01:00
|
|
|
break;
|
|
|
|
}
|
2007-05-30 20:11:58 +02:00
|
|
|
memset( uaddr, 0, uaddrlen );
|
|
|
|
break;
|
2005-11-16 12:21:57 +01:00
|
|
|
}
|
|
|
|
default:
|
|
|
|
FIXME("Unknown address family %d, return NULL.\n", wsaddr->sa_family);
|
2007-05-30 20:11:58 +02:00
|
|
|
return 0;
|
2002-06-13 21:09:55 +02:00
|
|
|
}
|
2007-05-30 20:11:58 +02:00
|
|
|
return uaddrlen;
|
2001-10-08 22:36:03 +02:00
|
|
|
}
|
|
|
|
|
2007-06-14 15:27:29 +02:00
|
|
|
static BOOL is_sockaddr_bound(const struct sockaddr *uaddr, int uaddrlen)
|
|
|
|
{
|
|
|
|
switch (uaddr->sa_family)
|
|
|
|
{
|
2013-06-17 21:56:52 +02:00
|
|
|
#ifdef HAS_IPX
|
2007-06-14 15:27:29 +02:00
|
|
|
case AF_IPX:
|
2013-12-27 21:32:29 +01:00
|
|
|
{
|
|
|
|
static const struct sockaddr_ipx emptyAddr;
|
|
|
|
struct sockaddr_ipx *ipx = (struct sockaddr_ipx*) uaddr;
|
2014-01-05 19:40:32 +01:00
|
|
|
return ipx->sipx_port
|
|
|
|
|| memcmp(&ipx->sipx_network, &emptyAddr.sipx_network, sizeof(emptyAddr.sipx_network))
|
|
|
|
|| memcmp(&ipx->sipx_node, &emptyAddr.sipx_node, sizeof(emptyAddr.sipx_node));
|
2013-12-27 21:32:29 +01:00
|
|
|
}
|
2007-06-14 15:27:29 +02:00
|
|
|
#endif
|
|
|
|
case AF_INET6:
|
|
|
|
{
|
|
|
|
static const struct sockaddr_in6 emptyAddr;
|
|
|
|
const struct sockaddr_in6 *in6 = (const struct sockaddr_in6*) uaddr;
|
|
|
|
return in6->sin6_port || memcmp(&in6->sin6_addr, &emptyAddr.sin6_addr, sizeof(struct in6_addr));
|
|
|
|
}
|
|
|
|
case AF_INET:
|
|
|
|
{
|
|
|
|
static const struct sockaddr_in emptyAddr;
|
|
|
|
const struct sockaddr_in *in = (const struct sockaddr_in*) uaddr;
|
|
|
|
return in->sin_port || memcmp(&in->sin_addr, &emptyAddr.sin_addr, sizeof(struct in_addr));
|
|
|
|
}
|
|
|
|
case AF_UNSPEC:
|
|
|
|
return FALSE;
|
|
|
|
default:
|
|
|
|
FIXME("unknown address family %d\n", uaddr->sa_family);
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-03-29 05:53:36 +02:00
|
|
|
/* Returns -1 if getsockname fails, 0 if not bound, 1 otherwise */
|
|
|
|
static int is_fd_bound(int fd, union generic_unix_sockaddr *uaddr, socklen_t *uaddrlen)
|
|
|
|
{
|
|
|
|
union generic_unix_sockaddr inaddr;
|
|
|
|
socklen_t inlen;
|
|
|
|
int res;
|
|
|
|
|
|
|
|
if (!uaddr) uaddr = &inaddr;
|
|
|
|
if (!uaddrlen) uaddrlen = &inlen;
|
|
|
|
|
|
|
|
*uaddrlen = sizeof(inaddr);
|
|
|
|
res = getsockname(fd, &uaddr->addr, uaddrlen);
|
|
|
|
if (!res) res = is_sockaddr_bound(&uaddr->addr, *uaddrlen);
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
2001-10-08 22:36:03 +02:00
|
|
|
/* Returns 0 if successful, -1 if the buffer is too small */
|
2021-05-01 02:09:58 +02:00
|
|
|
int ws_sockaddr_u2ws(const struct sockaddr *uaddr, struct WS_sockaddr *wsaddr, int *wsaddrlen)
|
2001-10-08 22:36:03 +02:00
|
|
|
{
|
|
|
|
int res;
|
|
|
|
|
|
|
|
switch(uaddr->sa_family)
|
|
|
|
{
|
2013-06-17 21:56:52 +02:00
|
|
|
#ifdef HAS_IPX
|
2001-10-08 22:36:03 +02:00
|
|
|
case AF_IPX:
|
|
|
|
{
|
2005-06-27 11:53:46 +02:00
|
|
|
const struct sockaddr_ipx* uipx=(const struct sockaddr_ipx*)uaddr;
|
2001-11-14 22:26:23 +01:00
|
|
|
struct WS_sockaddr_ipx* wsipx=(struct WS_sockaddr_ipx*)wsaddr;
|
2001-10-08 22:36:03 +02:00
|
|
|
|
|
|
|
res=-1;
|
|
|
|
switch (*wsaddrlen) /* how much can we copy? */
|
|
|
|
{
|
|
|
|
default:
|
|
|
|
res=0; /* enough */
|
2007-05-30 20:11:58 +02:00
|
|
|
*wsaddrlen = sizeof(*wsipx);
|
2001-10-08 22:36:03 +02:00
|
|
|
wsipx->sa_socket=uipx->sipx_port;
|
|
|
|
/* fall through */
|
|
|
|
case 13:
|
|
|
|
case 12:
|
|
|
|
memcpy(wsipx->sa_nodenum,uipx->sipx_node,sizeof(wsipx->sa_nodenum));
|
|
|
|
/* fall through */
|
|
|
|
case 11:
|
|
|
|
case 10:
|
|
|
|
case 9:
|
|
|
|
case 8:
|
|
|
|
case 7:
|
|
|
|
case 6:
|
|
|
|
memcpy(wsipx->sa_netnum,&uipx->sipx_network,sizeof(wsipx->sa_netnum));
|
|
|
|
/* fall through */
|
|
|
|
case 5:
|
|
|
|
case 4:
|
|
|
|
case 3:
|
|
|
|
case 2:
|
2002-01-15 21:26:28 +01:00
|
|
|
wsipx->sa_family=WS_AF_IPX;
|
2001-10-08 22:36:03 +02:00
|
|
|
/* fall through */
|
|
|
|
case 1:
|
|
|
|
case 0:
|
|
|
|
/* way too small */
|
2002-01-21 18:59:38 +01:00
|
|
|
break;
|
2001-10-08 22:36:03 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
2009-08-12 18:15:05 +02:00
|
|
|
#endif
|
2013-06-17 21:56:52 +02:00
|
|
|
#ifdef HAS_IRDA
|
2009-08-12 18:15:05 +02:00
|
|
|
case AF_IRDA: {
|
|
|
|
const struct sockaddr_irda *uin = (const struct sockaddr_irda *)uaddr;
|
|
|
|
SOCKADDR_IRDA *win = (SOCKADDR_IRDA *)wsaddr;
|
|
|
|
|
|
|
|
if (*wsaddrlen < sizeof(SOCKADDR_IRDA))
|
|
|
|
return -1;
|
|
|
|
win->irdaAddressFamily = WS_AF_IRDA;
|
|
|
|
memcpy( win->irdaDeviceID, &uin->sir_addr, sizeof(win->irdaDeviceID) );
|
|
|
|
if (uin->sir_lsap_sel != LSAP_ANY)
|
|
|
|
sprintf( win->irdaServiceName, "LSAP-SEL%u", uin->sir_lsap_sel );
|
|
|
|
else
|
|
|
|
memcpy( win->irdaServiceName, uin->sir_name,
|
|
|
|
sizeof(win->irdaServiceName) );
|
|
|
|
return 0;
|
|
|
|
}
|
1998-11-08 16:42:40 +01:00
|
|
|
#endif
|
2005-11-16 12:21:57 +01:00
|
|
|
case AF_INET6: {
|
2006-11-23 23:39:34 +01:00
|
|
|
const struct sockaddr_in6* uin6 = (const struct sockaddr_in6*)uaddr;
|
2005-11-16 12:21:57 +01:00
|
|
|
struct WS_sockaddr_in6_old* win6old = (struct WS_sockaddr_in6_old*)wsaddr;
|
|
|
|
|
|
|
|
if (*wsaddrlen < sizeof(struct WS_sockaddr_in6_old))
|
|
|
|
return -1;
|
2006-02-20 13:33:09 +01:00
|
|
|
win6old->sin6_family = WS_AF_INET6;
|
|
|
|
win6old->sin6_port = uin6->sin6_port;
|
|
|
|
win6old->sin6_flowinfo = uin6->sin6_flowinfo;
|
|
|
|
memcpy(&win6old->sin6_addr,&uin6->sin6_addr,16); /* 16 bytes = 128 address bits */
|
|
|
|
#ifdef HAVE_STRUCT_SOCKADDR_IN6_SIN6_SCOPE_ID
|
2005-11-16 12:21:57 +01:00
|
|
|
if (*wsaddrlen >= sizeof(struct WS_sockaddr_in6)) {
|
2006-02-20 13:33:09 +01:00
|
|
|
struct WS_sockaddr_in6* win6 = (struct WS_sockaddr_in6*)wsaddr;
|
2005-11-16 12:21:57 +01:00
|
|
|
win6->sin6_scope_id = uin6->sin6_scope_id;
|
|
|
|
*wsaddrlen = sizeof(struct WS_sockaddr_in6);
|
|
|
|
}
|
2009-10-17 01:53:53 +02:00
|
|
|
else
|
|
|
|
*wsaddrlen = sizeof(struct WS_sockaddr_in6_old);
|
|
|
|
#else
|
|
|
|
*wsaddrlen = sizeof(struct WS_sockaddr_in6_old);
|
2006-02-20 13:33:09 +01:00
|
|
|
#endif
|
2005-11-16 12:21:57 +01:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case AF_INET: {
|
2006-11-23 23:39:34 +01:00
|
|
|
const struct sockaddr_in* uin = (const struct sockaddr_in*)uaddr;
|
2005-11-16 12:21:57 +01:00
|
|
|
struct WS_sockaddr_in* win = (struct WS_sockaddr_in*)wsaddr;
|
2001-10-08 22:36:03 +02:00
|
|
|
|
2005-11-16 12:21:57 +01:00
|
|
|
if (*wsaddrlen < sizeof(struct WS_sockaddr_in))
|
|
|
|
return -1;
|
|
|
|
win->sin_family = WS_AF_INET;
|
|
|
|
win->sin_port = uin->sin_port;
|
|
|
|
memcpy(&win->sin_addr,&uin->sin_addr,4); /* 4 bytes = 32 address bits */
|
2008-07-12 21:37:39 +02:00
|
|
|
memset(win->sin_zero, 0, 8); /* Make sure the null padding is null */
|
2005-11-21 12:56:42 +01:00
|
|
|
*wsaddrlen = sizeof(struct WS_sockaddr_in);
|
2005-11-16 12:21:57 +01:00
|
|
|
return 0;
|
|
|
|
}
|
2006-01-03 12:11:07 +01:00
|
|
|
case AF_UNSPEC: {
|
|
|
|
memset(wsaddr,0,*wsaddrlen);
|
|
|
|
return 0;
|
|
|
|
}
|
2001-10-08 22:36:03 +02:00
|
|
|
default:
|
2005-11-16 12:21:57 +01:00
|
|
|
FIXME("Unknown address family %d\n", uaddr->sa_family);
|
|
|
|
return -1;
|
2001-10-08 22:36:03 +02:00
|
|
|
}
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
2013-09-08 06:47:46 +02:00
|
|
|
static INT WS_DuplicateSocket(BOOL unicode, SOCKET s, DWORD dwProcessId, LPWSAPROTOCOL_INFOW lpProtocolInfo)
|
|
|
|
{
|
|
|
|
HANDLE hProcess;
|
2013-09-11 15:05:18 +02:00
|
|
|
int size;
|
|
|
|
WSAPROTOCOL_INFOW infow;
|
2013-09-08 06:47:46 +02:00
|
|
|
|
|
|
|
TRACE("(unicode %d, socket %04lx, processid %x, buffer %p)\n",
|
|
|
|
unicode, s, dwProcessId, lpProtocolInfo);
|
2013-09-11 15:05:18 +02:00
|
|
|
|
|
|
|
if (!ws_protocol_info(s, unicode, &infow, &size))
|
|
|
|
return SOCKET_ERROR;
|
|
|
|
|
|
|
|
if (!(hProcess = OpenProcess(PROCESS_DUP_HANDLE, FALSE, dwProcessId)))
|
|
|
|
{
|
|
|
|
SetLastError(WSAEINVAL);
|
|
|
|
return SOCKET_ERROR;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!lpProtocolInfo)
|
|
|
|
{
|
|
|
|
CloseHandle(hProcess);
|
|
|
|
SetLastError(WSAEFAULT);
|
|
|
|
return SOCKET_ERROR;
|
|
|
|
}
|
|
|
|
|
2013-09-08 06:47:46 +02:00
|
|
|
/* I don't know what the real Windoze does next, this is a hack */
|
|
|
|
/* ...we could duplicate and then use ConvertToGlobalHandle on the duplicate, then let
|
|
|
|
* the target use the global duplicate, or we could copy a reference to us to the structure
|
|
|
|
* and let the target duplicate it from us, but let's do it as simple as possible */
|
2013-09-11 15:05:18 +02:00
|
|
|
memcpy(lpProtocolInfo, &infow, size);
|
2013-09-08 06:47:46 +02:00
|
|
|
DuplicateHandle(GetCurrentProcess(), SOCKET2HANDLE(s),
|
2013-09-11 15:05:18 +02:00
|
|
|
hProcess, (LPHANDLE)&lpProtocolInfo->dwServiceFlags3,
|
2013-09-08 06:47:46 +02:00
|
|
|
0, FALSE, DUPLICATE_SAME_ACCESS);
|
|
|
|
CloseHandle(hProcess);
|
|
|
|
lpProtocolInfo->dwServiceFlags4 = 0xff00ff00; /* magic */
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2013-09-10 05:56:47 +02:00
|
|
|
static BOOL ws_protocol_info(SOCKET s, int unicode, WSAPROTOCOL_INFOW *buffer, int *size)
|
|
|
|
{
|
2021-06-20 18:05:56 +02:00
|
|
|
struct afd_get_info_params params;
|
|
|
|
IO_STATUS_BLOCK io;
|
2013-09-10 05:56:47 +02:00
|
|
|
NTSTATUS status;
|
2020-09-29 05:35:05 +02:00
|
|
|
unsigned int i;
|
2013-09-10 05:56:47 +02:00
|
|
|
|
|
|
|
*size = unicode ? sizeof(WSAPROTOCOL_INFOW) : sizeof(WSAPROTOCOL_INFOA);
|
|
|
|
memset(buffer, 0, *size);
|
|
|
|
|
2021-06-20 18:05:56 +02:00
|
|
|
status = NtDeviceIoControlFile( (HANDLE)s, NULL, NULL, NULL, &io,
|
|
|
|
IOCTL_AFD_WINE_GET_INFO, NULL, 0, ¶ms, sizeof(params) );
|
2013-09-10 05:56:47 +02:00
|
|
|
if (status)
|
|
|
|
{
|
2021-06-20 18:05:56 +02:00
|
|
|
SetLastError( NtStatusToWSAError( status ) );
|
2013-09-10 05:56:47 +02:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2020-09-29 05:35:05 +02:00
|
|
|
for (i = 0; i < ARRAY_SIZE(supported_protocols); ++i)
|
|
|
|
{
|
|
|
|
const WSAPROTOCOL_INFOW *info = &supported_protocols[i];
|
2021-06-20 18:05:56 +02:00
|
|
|
if (params.family == info->iAddressFamily &&
|
|
|
|
params.type == info->iSocketType &&
|
|
|
|
params.protocol >= info->iProtocol &&
|
|
|
|
params.protocol <= info->iProtocol + info->iProtocolMaxOffset)
|
2020-09-29 05:35:05 +02:00
|
|
|
{
|
|
|
|
if (unicode)
|
|
|
|
*buffer = *info;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
WSAPROTOCOL_INFOA *bufferA = (WSAPROTOCOL_INFOA *)buffer;
|
|
|
|
memcpy( bufferA, info, offsetof( WSAPROTOCOL_INFOW, szProtocol ) );
|
|
|
|
WideCharToMultiByte( CP_ACP, 0, info->szProtocol, -1,
|
|
|
|
bufferA->szProtocol, sizeof(bufferA->szProtocol), NULL, NULL );
|
|
|
|
}
|
2021-06-20 18:05:56 +02:00
|
|
|
buffer->iProtocol = params.protocol;
|
2020-09-29 05:35:05 +02:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
}
|
2021-06-20 18:05:56 +02:00
|
|
|
FIXME( "Could not fill protocol information for family %d, type %d, protocol %d.\n",
|
|
|
|
params.family, params.type, params.protocol );
|
2013-09-10 05:56:47 +02:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2007-05-31 17:48:07 +02:00
|
|
|
|
2002-04-25 23:34:24 +02:00
|
|
|
|
2001-10-08 22:36:03 +02:00
|
|
|
/***********************************************************************
|
|
|
|
* accept (WS2_32.1)
|
|
|
|
*/
|
2020-10-19 18:21:19 +02:00
|
|
|
SOCKET WINAPI WS_accept( SOCKET s, struct WS_sockaddr *addr, int *len )
|
2001-10-08 22:36:03 +02:00
|
|
|
{
|
2020-10-02 06:13:58 +02:00
|
|
|
IO_STATUS_BLOCK io;
|
|
|
|
NTSTATUS status;
|
|
|
|
obj_handle_t accept_handle;
|
2020-10-19 18:21:19 +02:00
|
|
|
HANDLE sync_event;
|
|
|
|
SOCKET ret;
|
Release 961201
Sat Nov 30 19:21:17 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [configure]
Re-generated with autoconf 2.11. Let me know if you have
problems.
* [controls/listbox.c] [controls/oldlbox.c]
Listboxes rewritten from scratch. Moved old code still used by
comboboxes to oldlbox.c
* [misc/registry.c]
Use temporary file when saving registry.
* [windows/dialog.c]
Implemented Win32 version of DlgDirList() and DlgDirListComboBox().
* [windows/winproc.c]
Added translation for listbox Win32 messages.
Sat Nov 30 21:00:00 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [controls/widgets.c] [controls/button.c]
Fixed some incompatibilities with CTL3D DLL.
* [windows/dialog.c]
Made dialog windows fit into the desktop.
* [misc/winsock.c] [misc/winsock_async.c]
New Winsock engine.
* [windows/message.c]
GetMessage() fixes.
* [windows/queue.c] [windows/hook.c] [windows/win.c]
SetMessageQueue() fixes.
Fri Nov 29 10:25:12 1996 Slaven Rezic <eserte@cs.tu-berlin.de>
* [objects/text.c]
DrawText16(): Fixed return value.
Tue Nov 26 14:47:09 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/profile.c] [*/*]
Added Win32 profile functions, updated to new naming standard.
* [objects/font.c] [if1632/thunk.c] [include/windows.h]
Added EnumFonts32*, EnumFontFamiliesEx*, changed prototypes and
structures.
* [misc/ole2nls.c] [if1632/thunk.c]
Added EnumSystemLocales() (winhelp.exe).
* [misc/registry.c]
Added Windows 3.1 registry loader supplied by Tor Sjxwall, tor@sn.no
* [win32/file.c]
Partially fixed CreateFileMapping(), added UnmapViewOfFile().
Sat Nov 23 23:36:05 1996 Ronan Waide <waider@waider.ie>
* [misc/shell.c]
Fixed some FIXMEs relating to ShellExec() and FindExecutable().
* [misc/main.c]
Implemented a few more of the SystemParametersInfo() cases.
Tue Nov 19 01:24:34 1996 Philippe De Muyter <phdm@info.ucl.ac.be>
* [include/keyboard.h]
New file, new macro WINE_VKEY_MAPPINGS (using code taken from event.c).
* [include/windows.h]
New [VK_A, VK_Z] and [VK_0, VK9] macros.
* [misc/keyboard.c]
Fixes in KeyTable and ToAscii.
* [objects/font.c]
FONT_init : Give default value for MSWIN "system" font.
FONT_MatchFont : Do not try every size of a font family if the
family does not exist.
* [windows/event.c]
lastEventChar hack removed.
KeyStateTable replaced by InputKeyStateTable (maintained in event.c)
and QueueKeyStateTable (maintained in message.c).
EVENT_key : Corrections to the extended bit setting.
* [windows/message.c] [windows/keyboard.c]
Implementation of a new QueueKeyStateTable : table of key states
valid when messages are retrieved by GetMessage or PeekMessage,
and valid for TranslateMessage.
TranslateMessage : Convert WM*KEY messages using QueueKeyStateTable
and ToAscii.
Mon Nov 18 16:59:01 1996 Robert Pouliot <krynos@clic.net>
* [graphics/Makefile.in] [graphics/wing.c]
[if1632/wing.spec]
Some functions for WinG support, mostly empty stubs.
* [misc/crtdll.c] [if1632/crtdll.spec]
Many functions added to CRTDLL, mostly calls to Unix C library.
1996-12-01 18:17:47 +01:00
|
|
|
|
2020-10-19 18:21:19 +02:00
|
|
|
TRACE("%#lx\n", s);
|
2005-10-24 23:41:34 +02:00
|
|
|
|
2021-05-18 04:29:56 +02:00
|
|
|
if (!(sync_event = get_sync_event())) return INVALID_SOCKET;
|
2021-05-18 04:29:57 +02:00
|
|
|
status = NtDeviceIoControlFile( (HANDLE)s, sync_event, NULL, NULL, &io, IOCTL_AFD_WINE_ACCEPT,
|
|
|
|
NULL, 0, &accept_handle, sizeof(accept_handle) );
|
2020-10-19 18:21:19 +02:00
|
|
|
if (status == STATUS_PENDING)
|
2018-11-20 15:53:30 +01:00
|
|
|
{
|
2020-10-19 18:21:19 +02:00
|
|
|
if (WaitForSingleObject( sync_event, INFINITE ) == WAIT_FAILED)
|
|
|
|
return SOCKET_ERROR;
|
|
|
|
status = io.u.Status;
|
|
|
|
}
|
|
|
|
if (status)
|
|
|
|
{
|
|
|
|
WARN("failed; status %#x\n", status);
|
|
|
|
WSASetLastError( NtStatusToWSAError( status ) );
|
|
|
|
return INVALID_SOCKET;
|
2018-11-20 15:53:30 +01:00
|
|
|
}
|
2009-09-25 07:59:16 +02:00
|
|
|
|
2020-10-19 18:21:19 +02:00
|
|
|
ret = HANDLE2SOCKET(wine_server_ptr_handle( accept_handle ));
|
|
|
|
if (!socket_list_add( ret ))
|
|
|
|
{
|
|
|
|
CloseHandle( SOCKET2HANDLE(ret) );
|
|
|
|
return INVALID_SOCKET;
|
|
|
|
}
|
|
|
|
if (addr && len && WS_getpeername( ret, addr, len ))
|
|
|
|
{
|
|
|
|
WS_closesocket( ret );
|
|
|
|
return INVALID_SOCKET;
|
|
|
|
}
|
|
|
|
|
|
|
|
TRACE("returning %#lx\n", ret);
|
|
|
|
return ret;
|
Release 961201
Sat Nov 30 19:21:17 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [configure]
Re-generated with autoconf 2.11. Let me know if you have
problems.
* [controls/listbox.c] [controls/oldlbox.c]
Listboxes rewritten from scratch. Moved old code still used by
comboboxes to oldlbox.c
* [misc/registry.c]
Use temporary file when saving registry.
* [windows/dialog.c]
Implemented Win32 version of DlgDirList() and DlgDirListComboBox().
* [windows/winproc.c]
Added translation for listbox Win32 messages.
Sat Nov 30 21:00:00 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [controls/widgets.c] [controls/button.c]
Fixed some incompatibilities with CTL3D DLL.
* [windows/dialog.c]
Made dialog windows fit into the desktop.
* [misc/winsock.c] [misc/winsock_async.c]
New Winsock engine.
* [windows/message.c]
GetMessage() fixes.
* [windows/queue.c] [windows/hook.c] [windows/win.c]
SetMessageQueue() fixes.
Fri Nov 29 10:25:12 1996 Slaven Rezic <eserte@cs.tu-berlin.de>
* [objects/text.c]
DrawText16(): Fixed return value.
Tue Nov 26 14:47:09 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/profile.c] [*/*]
Added Win32 profile functions, updated to new naming standard.
* [objects/font.c] [if1632/thunk.c] [include/windows.h]
Added EnumFonts32*, EnumFontFamiliesEx*, changed prototypes and
structures.
* [misc/ole2nls.c] [if1632/thunk.c]
Added EnumSystemLocales() (winhelp.exe).
* [misc/registry.c]
Added Windows 3.1 registry loader supplied by Tor Sjxwall, tor@sn.no
* [win32/file.c]
Partially fixed CreateFileMapping(), added UnmapViewOfFile().
Sat Nov 23 23:36:05 1996 Ronan Waide <waider@waider.ie>
* [misc/shell.c]
Fixed some FIXMEs relating to ShellExec() and FindExecutable().
* [misc/main.c]
Implemented a few more of the SystemParametersInfo() cases.
Tue Nov 19 01:24:34 1996 Philippe De Muyter <phdm@info.ucl.ac.be>
* [include/keyboard.h]
New file, new macro WINE_VKEY_MAPPINGS (using code taken from event.c).
* [include/windows.h]
New [VK_A, VK_Z] and [VK_0, VK9] macros.
* [misc/keyboard.c]
Fixes in KeyTable and ToAscii.
* [objects/font.c]
FONT_init : Give default value for MSWIN "system" font.
FONT_MatchFont : Do not try every size of a font family if the
family does not exist.
* [windows/event.c]
lastEventChar hack removed.
KeyStateTable replaced by InputKeyStateTable (maintained in event.c)
and QueueKeyStateTable (maintained in message.c).
EVENT_key : Corrections to the extended bit setting.
* [windows/message.c] [windows/keyboard.c]
Implementation of a new QueueKeyStateTable : table of key states
valid when messages are retrieved by GetMessage or PeekMessage,
and valid for TranslateMessage.
TranslateMessage : Convert WM*KEY messages using QueueKeyStateTable
and ToAscii.
Mon Nov 18 16:59:01 1996 Robert Pouliot <krynos@clic.net>
* [graphics/Makefile.in] [graphics/wing.c]
[if1632/wing.spec]
Some functions for WinG support, mostly empty stubs.
* [misc/crtdll.c] [if1632/crtdll.spec]
Many functions added to CRTDLL, mostly calls to Unix C library.
1996-12-01 18:17:47 +01:00
|
|
|
}
|
|
|
|
|
2010-09-21 03:30:28 +02:00
|
|
|
/***********************************************************************
|
|
|
|
* AcceptEx
|
|
|
|
*/
|
2020-10-19 18:21:18 +02:00
|
|
|
static BOOL WINAPI WS2_AcceptEx( SOCKET listener, SOCKET acceptor, void *dest, DWORD recv_len,
|
|
|
|
DWORD local_len, DWORD remote_len, DWORD *ret_len, OVERLAPPED *overlapped)
|
2010-09-21 03:30:28 +02:00
|
|
|
{
|
2020-10-19 18:21:18 +02:00
|
|
|
struct afd_accept_into_params params =
|
|
|
|
{
|
|
|
|
.accept_handle = acceptor,
|
|
|
|
.recv_len = recv_len,
|
|
|
|
.local_len = local_len,
|
|
|
|
};
|
|
|
|
void *cvalue = NULL;
|
|
|
|
NTSTATUS status;
|
2010-09-21 03:30:28 +02:00
|
|
|
|
2020-10-19 18:21:18 +02:00
|
|
|
TRACE( "listener %#lx, acceptor %#lx, dest %p, recv_len %u, local_len %u, remote_len %u, ret_len %p, "
|
|
|
|
"overlapped %p\n", listener, acceptor, dest, recv_len, local_len, remote_len, ret_len, overlapped );
|
2010-09-21 03:30:28 +02:00
|
|
|
|
2019-02-22 13:59:28 +01:00
|
|
|
if (!overlapped)
|
2010-09-21 03:30:28 +02:00
|
|
|
{
|
2019-02-22 13:59:28 +01:00
|
|
|
SetLastError(WSA_INVALID_PARAMETER);
|
2010-09-21 03:30:28 +02:00
|
|
|
return FALSE;
|
|
|
|
}
|
2020-10-19 18:21:18 +02:00
|
|
|
|
|
|
|
if (!((ULONG_PTR)overlapped->hEvent & 1)) cvalue = overlapped;
|
2019-02-22 13:59:28 +01:00
|
|
|
overlapped->Internal = STATUS_PENDING;
|
2020-10-19 18:21:18 +02:00
|
|
|
overlapped->InternalHigh = 0;
|
2010-09-21 03:30:28 +02:00
|
|
|
|
2019-02-22 13:59:28 +01:00
|
|
|
if (!dest)
|
2010-09-21 03:30:28 +02:00
|
|
|
{
|
2019-02-22 13:59:28 +01:00
|
|
|
SetLastError(WSAEINVAL);
|
2010-09-21 03:30:28 +02:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2020-10-19 18:21:18 +02:00
|
|
|
if (!remote_len)
|
2010-09-21 03:30:28 +02:00
|
|
|
{
|
|
|
|
SetLastError(WSAEFAULT);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2020-10-19 18:21:18 +02:00
|
|
|
status = NtDeviceIoControlFile( SOCKET2HANDLE(listener), overlapped->hEvent, NULL, cvalue,
|
2021-05-14 05:54:37 +02:00
|
|
|
(IO_STATUS_BLOCK *)overlapped, IOCTL_AFD_WINE_ACCEPT_INTO, ¶ms, sizeof(params),
|
2020-10-19 18:21:18 +02:00
|
|
|
dest, recv_len + local_len + remote_len );
|
2010-09-21 03:30:28 +02:00
|
|
|
|
2020-10-19 18:21:18 +02:00
|
|
|
if (ret_len) *ret_len = overlapped->InternalHigh;
|
|
|
|
WSASetLastError( NtStatusToWSAError(status) );
|
|
|
|
return !status;
|
2010-09-21 03:30:28 +02:00
|
|
|
}
|
|
|
|
|
2021-05-28 01:57:30 +02:00
|
|
|
|
|
|
|
static BOOL WINAPI WS2_TransmitFile( SOCKET s, HANDLE file, DWORD file_len, DWORD buffer_size,
|
|
|
|
OVERLAPPED *overlapped, TRANSMIT_FILE_BUFFERS *buffers, DWORD flags )
|
2015-10-07 20:14:56 +02:00
|
|
|
{
|
2021-05-28 01:57:30 +02:00
|
|
|
struct afd_transmit_params params = {0};
|
|
|
|
IO_STATUS_BLOCK iosb, *piosb = &iosb;
|
|
|
|
HANDLE event = NULL;
|
|
|
|
void *cvalue = NULL;
|
2015-10-07 20:14:56 +02:00
|
|
|
NTSTATUS status;
|
|
|
|
|
2021-05-28 01:57:30 +02:00
|
|
|
TRACE( "socket %#lx, file %p, file_len %u, buffer_size %u, overlapped %p, buffers %p, flags %#x\n",
|
|
|
|
s, file, file_len, buffer_size, overlapped, buffers, flags );
|
2015-10-07 20:14:56 +02:00
|
|
|
|
2021-05-28 01:57:30 +02:00
|
|
|
if (overlapped)
|
2015-10-07 20:14:56 +02:00
|
|
|
{
|
2021-05-28 01:57:30 +02:00
|
|
|
piosb = (IO_STATUS_BLOCK *)overlapped;
|
|
|
|
if (!((ULONG_PTR)overlapped->hEvent & 1)) cvalue = overlapped;
|
|
|
|
event = overlapped->hEvent;
|
|
|
|
overlapped->Internal = STATUS_PENDING;
|
|
|
|
overlapped->InternalHigh = 0;
|
|
|
|
params.offset.u.LowPart = overlapped->u.s.Offset;
|
|
|
|
params.offset.u.HighPart = overlapped->u.s.OffsetHigh;
|
2015-10-07 20:14:56 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2021-05-28 01:57:30 +02:00
|
|
|
if (!(event = get_sync_event())) return -1;
|
|
|
|
params.offset.QuadPart = FILE_USE_FILE_POINTER_POSITION;
|
2015-10-07 20:14:56 +02:00
|
|
|
}
|
|
|
|
|
2021-05-28 01:57:30 +02:00
|
|
|
params.file = file;
|
|
|
|
params.file_len = file_len;
|
|
|
|
params.buffer_size = buffer_size;
|
|
|
|
if (buffers) params.buffers = *buffers;
|
|
|
|
params.flags = flags;
|
2015-10-07 20:14:56 +02:00
|
|
|
|
2021-05-28 01:57:30 +02:00
|
|
|
status = NtDeviceIoControlFile( (HANDLE)s, event, NULL, cvalue, piosb,
|
|
|
|
IOCTL_AFD_WINE_TRANSMIT, ¶ms, sizeof(params), NULL, 0 );
|
|
|
|
if (status == STATUS_PENDING && !overlapped)
|
2015-10-07 20:19:42 +02:00
|
|
|
{
|
2021-05-28 01:57:30 +02:00
|
|
|
if (WaitForSingleObject( event, INFINITE ) == WAIT_FAILED)
|
|
|
|
return FALSE;
|
|
|
|
status = piosb->u.Status;
|
2015-10-07 20:19:42 +02:00
|
|
|
}
|
2021-05-28 01:57:30 +02:00
|
|
|
SetLastError( NtStatusToWSAError( status ) );
|
|
|
|
return !status;
|
2015-10-07 20:19:42 +02:00
|
|
|
}
|
|
|
|
|
2014-01-17 01:52:50 +01:00
|
|
|
|
2010-09-21 03:30:28 +02:00
|
|
|
/***********************************************************************
|
|
|
|
* GetAcceptExSockaddrs
|
|
|
|
*/
|
2010-09-28 20:12:39 +02:00
|
|
|
static void WINAPI WS2_GetAcceptExSockaddrs(PVOID buffer, DWORD data_size, DWORD local_size, DWORD remote_size,
|
2010-09-21 03:30:28 +02:00
|
|
|
struct WS_sockaddr **local_addr, LPINT local_addr_len,
|
|
|
|
struct WS_sockaddr **remote_addr, LPINT remote_addr_len)
|
|
|
|
{
|
|
|
|
char *cbuf = buffer;
|
|
|
|
TRACE("(%p, %d, %d, %d, %p, %p, %p, %p)\n", buffer, data_size, local_size, remote_size, local_addr,
|
|
|
|
local_addr_len, remote_addr, remote_addr_len );
|
|
|
|
cbuf += data_size;
|
|
|
|
|
|
|
|
*local_addr_len = *(int *) cbuf;
|
|
|
|
*local_addr = (struct WS_sockaddr *)(cbuf + sizeof(int));
|
|
|
|
|
|
|
|
cbuf += local_size;
|
|
|
|
|
|
|
|
*remote_addr_len = *(int *) cbuf;
|
|
|
|
*remote_addr = (struct WS_sockaddr *)(cbuf + sizeof(int));
|
|
|
|
}
|
|
|
|
|
2021-05-27 06:36:51 +02:00
|
|
|
|
|
|
|
static void WINAPI socket_apc( void *apc_user, IO_STATUS_BLOCK *io, ULONG reserved )
|
|
|
|
{
|
|
|
|
LPWSAOVERLAPPED_COMPLETION_ROUTINE func = apc_user;
|
|
|
|
func( NtStatusToWSAError( io->u.Status ), io->Information, (OVERLAPPED *)io, 0 );
|
|
|
|
}
|
|
|
|
|
|
|
|
static int WS2_recv_base( SOCKET s, WSABUF *buffers, DWORD buffer_count, DWORD *ret_size, DWORD *flags,
|
|
|
|
struct WS_sockaddr *addr, int *addr_len, OVERLAPPED *overlapped,
|
|
|
|
LPWSAOVERLAPPED_COMPLETION_ROUTINE completion, WSABUF *control )
|
|
|
|
{
|
|
|
|
IO_STATUS_BLOCK iosb, *piosb = &iosb;
|
|
|
|
struct afd_recvmsg_params params;
|
|
|
|
PIO_APC_ROUTINE apc = NULL;
|
|
|
|
HANDLE event = NULL;
|
|
|
|
void *cvalue = NULL;
|
|
|
|
NTSTATUS status;
|
|
|
|
|
|
|
|
TRACE( "socket %#lx, buffers %p, buffer_count %u, flags %#x, addr %p, "
|
|
|
|
"addr_len %d, overlapped %p, completion %p, control %p\n",
|
|
|
|
s, buffers, buffer_count, *flags, addr, addr_len ? *addr_len : -1, overlapped, completion, control );
|
|
|
|
|
|
|
|
if (overlapped)
|
|
|
|
{
|
|
|
|
piosb = (IO_STATUS_BLOCK *)overlapped;
|
|
|
|
if (!((ULONG_PTR)overlapped->hEvent & 1)) cvalue = overlapped;
|
|
|
|
event = overlapped->hEvent;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (!(event = get_sync_event())) return -1;
|
|
|
|
}
|
|
|
|
piosb->u.Status = STATUS_PENDING;
|
|
|
|
|
|
|
|
if (completion)
|
|
|
|
{
|
|
|
|
event = NULL;
|
|
|
|
cvalue = completion;
|
|
|
|
apc = socket_apc;
|
|
|
|
}
|
|
|
|
|
|
|
|
params.control = control;
|
|
|
|
params.addr = addr;
|
|
|
|
params.addr_len = addr_len;
|
|
|
|
params.ws_flags = flags;
|
|
|
|
params.force_async = !!overlapped;
|
|
|
|
params.count = buffer_count;
|
|
|
|
params.buffers = buffers;
|
|
|
|
|
|
|
|
status = NtDeviceIoControlFile( (HANDLE)s, event, apc, cvalue, piosb,
|
|
|
|
IOCTL_AFD_WINE_RECVMSG, ¶ms, sizeof(params), NULL, 0 );
|
|
|
|
if (status == STATUS_PENDING && !overlapped)
|
|
|
|
{
|
|
|
|
if (WaitForSingleObject( event, INFINITE ) == WAIT_FAILED)
|
|
|
|
return -1;
|
|
|
|
status = piosb->u.Status;
|
|
|
|
}
|
|
|
|
if (!status && ret_size) *ret_size = piosb->Information;
|
|
|
|
SetLastError( NtStatusToWSAError( status ) );
|
|
|
|
return status ? -1 : 0;
|
|
|
|
}
|
|
|
|
|
2021-05-27 06:36:54 +02:00
|
|
|
static int WS2_sendto( SOCKET s, WSABUF *buffers, DWORD buffer_count, DWORD *ret_size, DWORD flags,
|
|
|
|
const struct WS_sockaddr *addr, int addr_len, OVERLAPPED *overlapped,
|
|
|
|
LPWSAOVERLAPPED_COMPLETION_ROUTINE completion )
|
|
|
|
{
|
|
|
|
IO_STATUS_BLOCK iosb, *piosb = &iosb;
|
|
|
|
struct afd_sendmsg_params params;
|
|
|
|
PIO_APC_ROUTINE apc = NULL;
|
|
|
|
HANDLE event = NULL;
|
|
|
|
void *cvalue = NULL;
|
|
|
|
NTSTATUS status;
|
|
|
|
|
|
|
|
TRACE( "socket %#lx, buffers %p, buffer_count %u, flags %#x, addr %p, "
|
|
|
|
"addr_len %d, overlapped %p, completion %p\n",
|
|
|
|
s, buffers, buffer_count, flags, addr, addr_len, overlapped, completion );
|
|
|
|
|
|
|
|
if (!socket_list_find( s ))
|
|
|
|
{
|
|
|
|
SetLastError( WSAENOTSOCK );
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!overlapped && !ret_size)
|
|
|
|
{
|
|
|
|
SetLastError( WSAEFAULT );
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (overlapped)
|
|
|
|
{
|
|
|
|
piosb = (IO_STATUS_BLOCK *)overlapped;
|
|
|
|
if (!((ULONG_PTR)overlapped->hEvent & 1)) cvalue = overlapped;
|
|
|
|
event = overlapped->hEvent;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (!(event = get_sync_event())) return -1;
|
|
|
|
}
|
|
|
|
piosb->u.Status = STATUS_PENDING;
|
|
|
|
|
|
|
|
if (completion)
|
|
|
|
{
|
|
|
|
event = NULL;
|
|
|
|
cvalue = completion;
|
|
|
|
apc = socket_apc;
|
|
|
|
}
|
|
|
|
|
|
|
|
params.addr = addr;
|
|
|
|
params.addr_len = addr_len;
|
|
|
|
params.ws_flags = flags;
|
|
|
|
params.force_async = !!overlapped;
|
|
|
|
params.count = buffer_count;
|
|
|
|
params.buffers = buffers;
|
|
|
|
|
|
|
|
status = NtDeviceIoControlFile( (HANDLE)s, event, apc, cvalue, piosb,
|
|
|
|
IOCTL_AFD_WINE_SENDMSG, ¶ms, sizeof(params), NULL, 0 );
|
|
|
|
if (status == STATUS_PENDING && !overlapped)
|
|
|
|
{
|
|
|
|
if (WaitForSingleObject( event, INFINITE ) == WAIT_FAILED)
|
|
|
|
return -1;
|
|
|
|
status = piosb->u.Status;
|
|
|
|
}
|
|
|
|
if (!status && ret_size) *ret_size = piosb->Information;
|
|
|
|
SetLastError( NtStatusToWSAError( status ) );
|
|
|
|
return status ? -1 : 0;
|
|
|
|
}
|
|
|
|
|
2021-05-27 06:36:51 +02:00
|
|
|
|
2013-10-01 04:56:53 +02:00
|
|
|
/***********************************************************************
|
|
|
|
* WSASendMsg
|
|
|
|
*/
|
|
|
|
int WINAPI WSASendMsg( SOCKET s, LPWSAMSG msg, DWORD dwFlags, LPDWORD lpNumberOfBytesSent,
|
|
|
|
LPWSAOVERLAPPED lpOverlapped,
|
|
|
|
LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine)
|
|
|
|
{
|
|
|
|
if (!msg)
|
|
|
|
{
|
|
|
|
SetLastError( WSAEFAULT );
|
|
|
|
return SOCKET_ERROR;
|
|
|
|
}
|
|
|
|
|
|
|
|
return WS2_sendto( s, msg->lpBuffers, msg->dwBufferCount, lpNumberOfBytesSent,
|
|
|
|
dwFlags, msg->name, msg->namelen,
|
|
|
|
lpOverlapped, lpCompletionRoutine );
|
|
|
|
}
|
|
|
|
|
2010-12-06 01:08:54 +01:00
|
|
|
/***********************************************************************
|
|
|
|
* WSARecvMsg
|
|
|
|
*
|
|
|
|
* Perform a receive operation that is capable of returning message
|
|
|
|
* control headers. It is important to note that the WSAMSG parameter
|
|
|
|
* must remain valid throughout the operation, even when an overlapped
|
|
|
|
* receive is performed.
|
|
|
|
*/
|
|
|
|
static int WINAPI WS2_WSARecvMsg( SOCKET s, LPWSAMSG msg, LPDWORD lpNumberOfBytesRecvd,
|
|
|
|
LPWSAOVERLAPPED lpOverlapped,
|
|
|
|
LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine )
|
|
|
|
{
|
|
|
|
if (!msg)
|
|
|
|
{
|
|
|
|
SetLastError( WSAEFAULT );
|
|
|
|
return SOCKET_ERROR;
|
|
|
|
}
|
|
|
|
|
|
|
|
return WS2_recv_base( s, msg->lpBuffers, msg->dwBufferCount, lpNumberOfBytesRecvd,
|
|
|
|
&msg->dwFlags, msg->name, &msg->namelen,
|
|
|
|
lpOverlapped, lpCompletionRoutine, &msg->Control );
|
|
|
|
}
|
|
|
|
|
2021-06-16 06:13:32 +02:00
|
|
|
|
2012-09-27 00:38:09 +02:00
|
|
|
/***********************************************************************
|
2021-06-16 06:13:32 +02:00
|
|
|
* bind (ws2_32.2)
|
2012-09-27 00:38:09 +02:00
|
|
|
*/
|
2021-06-16 06:13:32 +02:00
|
|
|
int WINAPI WS_bind( SOCKET s, const struct WS_sockaddr *addr, int len )
|
2012-09-27 00:38:09 +02:00
|
|
|
{
|
2021-06-16 06:13:32 +02:00
|
|
|
struct afd_bind_params *params;
|
|
|
|
struct WS_sockaddr *ret_addr;
|
|
|
|
IO_STATUS_BLOCK io;
|
|
|
|
HANDLE sync_event;
|
|
|
|
NTSTATUS status;
|
2012-09-27 00:38:09 +02:00
|
|
|
|
2021-06-16 06:13:32 +02:00
|
|
|
TRACE( "socket %#lx, addr %s\n", s, debugstr_sockaddr(addr) );
|
2021-06-04 23:24:16 +02:00
|
|
|
|
2021-06-16 06:13:32 +02:00
|
|
|
if (!addr || (addr->sa_family && !supported_pf( addr->sa_family )))
|
2021-06-04 23:24:16 +02:00
|
|
|
{
|
2021-06-16 06:13:32 +02:00
|
|
|
SetLastError( WSAEAFNOSUPPORT );
|
|
|
|
return -1;
|
2012-09-27 00:38:09 +02:00
|
|
|
}
|
|
|
|
|
2021-06-16 06:13:32 +02:00
|
|
|
if (!(sync_event = get_sync_event())) return -1;
|
1997-08-24 18:00:30 +02:00
|
|
|
|
2021-06-16 06:13:32 +02:00
|
|
|
params = HeapAlloc( GetProcessHeap(), 0, sizeof(int) + len );
|
|
|
|
ret_addr = HeapAlloc( GetProcessHeap(), 0, len );
|
|
|
|
if (!params || !ret_addr)
|
|
|
|
{
|
|
|
|
HeapFree( GetProcessHeap(), 0, params );
|
|
|
|
HeapFree( GetProcessHeap(), 0, ret_addr );
|
|
|
|
SetLastError( WSAENOBUFS );
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
params->unknown = 0;
|
|
|
|
memcpy( ¶ms->addr, addr, len );
|
Release 961201
Sat Nov 30 19:21:17 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [configure]
Re-generated with autoconf 2.11. Let me know if you have
problems.
* [controls/listbox.c] [controls/oldlbox.c]
Listboxes rewritten from scratch. Moved old code still used by
comboboxes to oldlbox.c
* [misc/registry.c]
Use temporary file when saving registry.
* [windows/dialog.c]
Implemented Win32 version of DlgDirList() and DlgDirListComboBox().
* [windows/winproc.c]
Added translation for listbox Win32 messages.
Sat Nov 30 21:00:00 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [controls/widgets.c] [controls/button.c]
Fixed some incompatibilities with CTL3D DLL.
* [windows/dialog.c]
Made dialog windows fit into the desktop.
* [misc/winsock.c] [misc/winsock_async.c]
New Winsock engine.
* [windows/message.c]
GetMessage() fixes.
* [windows/queue.c] [windows/hook.c] [windows/win.c]
SetMessageQueue() fixes.
Fri Nov 29 10:25:12 1996 Slaven Rezic <eserte@cs.tu-berlin.de>
* [objects/text.c]
DrawText16(): Fixed return value.
Tue Nov 26 14:47:09 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/profile.c] [*/*]
Added Win32 profile functions, updated to new naming standard.
* [objects/font.c] [if1632/thunk.c] [include/windows.h]
Added EnumFonts32*, EnumFontFamiliesEx*, changed prototypes and
structures.
* [misc/ole2nls.c] [if1632/thunk.c]
Added EnumSystemLocales() (winhelp.exe).
* [misc/registry.c]
Added Windows 3.1 registry loader supplied by Tor Sjxwall, tor@sn.no
* [win32/file.c]
Partially fixed CreateFileMapping(), added UnmapViewOfFile().
Sat Nov 23 23:36:05 1996 Ronan Waide <waider@waider.ie>
* [misc/shell.c]
Fixed some FIXMEs relating to ShellExec() and FindExecutable().
* [misc/main.c]
Implemented a few more of the SystemParametersInfo() cases.
Tue Nov 19 01:24:34 1996 Philippe De Muyter <phdm@info.ucl.ac.be>
* [include/keyboard.h]
New file, new macro WINE_VKEY_MAPPINGS (using code taken from event.c).
* [include/windows.h]
New [VK_A, VK_Z] and [VK_0, VK9] macros.
* [misc/keyboard.c]
Fixes in KeyTable and ToAscii.
* [objects/font.c]
FONT_init : Give default value for MSWIN "system" font.
FONT_MatchFont : Do not try every size of a font family if the
family does not exist.
* [windows/event.c]
lastEventChar hack removed.
KeyStateTable replaced by InputKeyStateTable (maintained in event.c)
and QueueKeyStateTable (maintained in message.c).
EVENT_key : Corrections to the extended bit setting.
* [windows/message.c] [windows/keyboard.c]
Implementation of a new QueueKeyStateTable : table of key states
valid when messages are retrieved by GetMessage or PeekMessage,
and valid for TranslateMessage.
TranslateMessage : Convert WM*KEY messages using QueueKeyStateTable
and ToAscii.
Mon Nov 18 16:59:01 1996 Robert Pouliot <krynos@clic.net>
* [graphics/Makefile.in] [graphics/wing.c]
[if1632/wing.spec]
Some functions for WinG support, mostly empty stubs.
* [misc/crtdll.c] [if1632/crtdll.spec]
Many functions added to CRTDLL, mostly calls to Unix C library.
1996-12-01 18:17:47 +01:00
|
|
|
|
2021-06-16 06:13:32 +02:00
|
|
|
status = NtDeviceIoControlFile( (HANDLE)s, sync_event, NULL, NULL, &io, IOCTL_AFD_BIND,
|
|
|
|
params, sizeof(int) + len, ret_addr, len );
|
|
|
|
if (status == STATUS_PENDING)
|
1998-11-01 20:27:22 +01:00
|
|
|
{
|
2021-06-16 06:13:32 +02:00
|
|
|
if (WaitForSingleObject( sync_event, INFINITE ) == WAIT_FAILED)
|
|
|
|
return -1;
|
|
|
|
status = io.u.Status;
|
2001-10-08 22:36:03 +02:00
|
|
|
}
|
2021-06-16 06:13:32 +02:00
|
|
|
|
|
|
|
HeapFree( GetProcessHeap(), 0, params );
|
|
|
|
HeapFree( GetProcessHeap(), 0, ret_addr );
|
|
|
|
|
|
|
|
SetLastError( status == STATUS_INVALID_PARAMETER ? WSAEFAULT : NtStatusToWSAError( status ) );
|
|
|
|
return status ? -1 : 0;
|
Release 961201
Sat Nov 30 19:21:17 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [configure]
Re-generated with autoconf 2.11. Let me know if you have
problems.
* [controls/listbox.c] [controls/oldlbox.c]
Listboxes rewritten from scratch. Moved old code still used by
comboboxes to oldlbox.c
* [misc/registry.c]
Use temporary file when saving registry.
* [windows/dialog.c]
Implemented Win32 version of DlgDirList() and DlgDirListComboBox().
* [windows/winproc.c]
Added translation for listbox Win32 messages.
Sat Nov 30 21:00:00 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [controls/widgets.c] [controls/button.c]
Fixed some incompatibilities with CTL3D DLL.
* [windows/dialog.c]
Made dialog windows fit into the desktop.
* [misc/winsock.c] [misc/winsock_async.c]
New Winsock engine.
* [windows/message.c]
GetMessage() fixes.
* [windows/queue.c] [windows/hook.c] [windows/win.c]
SetMessageQueue() fixes.
Fri Nov 29 10:25:12 1996 Slaven Rezic <eserte@cs.tu-berlin.de>
* [objects/text.c]
DrawText16(): Fixed return value.
Tue Nov 26 14:47:09 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/profile.c] [*/*]
Added Win32 profile functions, updated to new naming standard.
* [objects/font.c] [if1632/thunk.c] [include/windows.h]
Added EnumFonts32*, EnumFontFamiliesEx*, changed prototypes and
structures.
* [misc/ole2nls.c] [if1632/thunk.c]
Added EnumSystemLocales() (winhelp.exe).
* [misc/registry.c]
Added Windows 3.1 registry loader supplied by Tor Sjxwall, tor@sn.no
* [win32/file.c]
Partially fixed CreateFileMapping(), added UnmapViewOfFile().
Sat Nov 23 23:36:05 1996 Ronan Waide <waider@waider.ie>
* [misc/shell.c]
Fixed some FIXMEs relating to ShellExec() and FindExecutable().
* [misc/main.c]
Implemented a few more of the SystemParametersInfo() cases.
Tue Nov 19 01:24:34 1996 Philippe De Muyter <phdm@info.ucl.ac.be>
* [include/keyboard.h]
New file, new macro WINE_VKEY_MAPPINGS (using code taken from event.c).
* [include/windows.h]
New [VK_A, VK_Z] and [VK_0, VK9] macros.
* [misc/keyboard.c]
Fixes in KeyTable and ToAscii.
* [objects/font.c]
FONT_init : Give default value for MSWIN "system" font.
FONT_MatchFont : Do not try every size of a font family if the
family does not exist.
* [windows/event.c]
lastEventChar hack removed.
KeyStateTable replaced by InputKeyStateTable (maintained in event.c)
and QueueKeyStateTable (maintained in message.c).
EVENT_key : Corrections to the extended bit setting.
* [windows/message.c] [windows/keyboard.c]
Implementation of a new QueueKeyStateTable : table of key states
valid when messages are retrieved by GetMessage or PeekMessage,
and valid for TranslateMessage.
TranslateMessage : Convert WM*KEY messages using QueueKeyStateTable
and ToAscii.
Mon Nov 18 16:59:01 1996 Robert Pouliot <krynos@clic.net>
* [graphics/Makefile.in] [graphics/wing.c]
[if1632/wing.spec]
Some functions for WinG support, mostly empty stubs.
* [misc/crtdll.c] [if1632/crtdll.spec]
Many functions added to CRTDLL, mostly calls to Unix C library.
1996-12-01 18:17:47 +01:00
|
|
|
}
|
|
|
|
|
2021-06-16 06:13:32 +02:00
|
|
|
|
1997-08-24 18:00:30 +02:00
|
|
|
/***********************************************************************
|
2001-07-02 21:59:40 +02:00
|
|
|
* closesocket (WS2_32.3)
|
1997-08-24 18:00:30 +02:00
|
|
|
*/
|
2001-11-14 22:26:23 +01:00
|
|
|
int WINAPI WS_closesocket(SOCKET s)
|
1997-08-24 18:00:30 +02:00
|
|
|
{
|
2015-03-05 07:35:06 +01:00
|
|
|
int res = SOCKET_ERROR, fd;
|
|
|
|
if (num_startup)
|
|
|
|
{
|
|
|
|
fd = get_sock_fd(s, FILE_READ_DATA, NULL);
|
|
|
|
if (fd >= 0)
|
|
|
|
{
|
|
|
|
release_sock_fd(s, fd);
|
2020-09-10 23:17:14 +02:00
|
|
|
socket_list_remove(s);
|
2015-03-05 07:35:06 +01:00
|
|
|
if (CloseHandle(SOCKET2HANDLE(s)))
|
|
|
|
res = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
SetLastError(WSANOTINITIALISED);
|
|
|
|
TRACE("(socket %04lx) -> %d\n", s, res);
|
|
|
|
return res;
|
Release 961201
Sat Nov 30 19:21:17 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [configure]
Re-generated with autoconf 2.11. Let me know if you have
problems.
* [controls/listbox.c] [controls/oldlbox.c]
Listboxes rewritten from scratch. Moved old code still used by
comboboxes to oldlbox.c
* [misc/registry.c]
Use temporary file when saving registry.
* [windows/dialog.c]
Implemented Win32 version of DlgDirList() and DlgDirListComboBox().
* [windows/winproc.c]
Added translation for listbox Win32 messages.
Sat Nov 30 21:00:00 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [controls/widgets.c] [controls/button.c]
Fixed some incompatibilities with CTL3D DLL.
* [windows/dialog.c]
Made dialog windows fit into the desktop.
* [misc/winsock.c] [misc/winsock_async.c]
New Winsock engine.
* [windows/message.c]
GetMessage() fixes.
* [windows/queue.c] [windows/hook.c] [windows/win.c]
SetMessageQueue() fixes.
Fri Nov 29 10:25:12 1996 Slaven Rezic <eserte@cs.tu-berlin.de>
* [objects/text.c]
DrawText16(): Fixed return value.
Tue Nov 26 14:47:09 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/profile.c] [*/*]
Added Win32 profile functions, updated to new naming standard.
* [objects/font.c] [if1632/thunk.c] [include/windows.h]
Added EnumFonts32*, EnumFontFamiliesEx*, changed prototypes and
structures.
* [misc/ole2nls.c] [if1632/thunk.c]
Added EnumSystemLocales() (winhelp.exe).
* [misc/registry.c]
Added Windows 3.1 registry loader supplied by Tor Sjxwall, tor@sn.no
* [win32/file.c]
Partially fixed CreateFileMapping(), added UnmapViewOfFile().
Sat Nov 23 23:36:05 1996 Ronan Waide <waider@waider.ie>
* [misc/shell.c]
Fixed some FIXMEs relating to ShellExec() and FindExecutable().
* [misc/main.c]
Implemented a few more of the SystemParametersInfo() cases.
Tue Nov 19 01:24:34 1996 Philippe De Muyter <phdm@info.ucl.ac.be>
* [include/keyboard.h]
New file, new macro WINE_VKEY_MAPPINGS (using code taken from event.c).
* [include/windows.h]
New [VK_A, VK_Z] and [VK_0, VK9] macros.
* [misc/keyboard.c]
Fixes in KeyTable and ToAscii.
* [objects/font.c]
FONT_init : Give default value for MSWIN "system" font.
FONT_MatchFont : Do not try every size of a font family if the
family does not exist.
* [windows/event.c]
lastEventChar hack removed.
KeyStateTable replaced by InputKeyStateTable (maintained in event.c)
and QueueKeyStateTable (maintained in message.c).
EVENT_key : Corrections to the extended bit setting.
* [windows/message.c] [windows/keyboard.c]
Implementation of a new QueueKeyStateTable : table of key states
valid when messages are retrieved by GetMessage or PeekMessage,
and valid for TranslateMessage.
TranslateMessage : Convert WM*KEY messages using QueueKeyStateTable
and ToAscii.
Mon Nov 18 16:59:01 1996 Robert Pouliot <krynos@clic.net>
* [graphics/Makefile.in] [graphics/wing.c]
[if1632/wing.spec]
Some functions for WinG support, mostly empty stubs.
* [misc/crtdll.c] [if1632/crtdll.spec]
Many functions added to CRTDLL, mostly calls to Unix C library.
1996-12-01 18:17:47 +01:00
|
|
|
}
|
|
|
|
|
2021-05-18 04:30:01 +02:00
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* connect (ws2_32.4)
|
|
|
|
*/
|
|
|
|
int WINAPI WS_connect( SOCKET s, const struct WS_sockaddr *addr, int len )
|
2010-08-01 05:21:31 +02:00
|
|
|
{
|
2021-05-18 04:30:01 +02:00
|
|
|
struct afd_connect_params *params;
|
|
|
|
IO_STATUS_BLOCK io;
|
|
|
|
HANDLE sync_event;
|
|
|
|
NTSTATUS status;
|
|
|
|
|
|
|
|
TRACE( "socket %#lx, addr %s, len %d\n", s, debugstr_sockaddr(addr), len );
|
2010-08-01 05:21:31 +02:00
|
|
|
|
2021-05-18 04:30:01 +02:00
|
|
|
if (!(sync_event = get_sync_event())) return -1;
|
2010-08-01 05:21:31 +02:00
|
|
|
|
2021-06-17 06:33:10 +02:00
|
|
|
if (!(params = HeapAlloc( GetProcessHeap(), 0, sizeof(*params) + len )))
|
1999-10-23 18:53:34 +02:00
|
|
|
{
|
2021-05-18 04:30:01 +02:00
|
|
|
SetLastError( ERROR_NOT_ENOUGH_MEMORY );
|
|
|
|
return -1;
|
Release 961201
Sat Nov 30 19:21:17 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [configure]
Re-generated with autoconf 2.11. Let me know if you have
problems.
* [controls/listbox.c] [controls/oldlbox.c]
Listboxes rewritten from scratch. Moved old code still used by
comboboxes to oldlbox.c
* [misc/registry.c]
Use temporary file when saving registry.
* [windows/dialog.c]
Implemented Win32 version of DlgDirList() and DlgDirListComboBox().
* [windows/winproc.c]
Added translation for listbox Win32 messages.
Sat Nov 30 21:00:00 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [controls/widgets.c] [controls/button.c]
Fixed some incompatibilities with CTL3D DLL.
* [windows/dialog.c]
Made dialog windows fit into the desktop.
* [misc/winsock.c] [misc/winsock_async.c]
New Winsock engine.
* [windows/message.c]
GetMessage() fixes.
* [windows/queue.c] [windows/hook.c] [windows/win.c]
SetMessageQueue() fixes.
Fri Nov 29 10:25:12 1996 Slaven Rezic <eserte@cs.tu-berlin.de>
* [objects/text.c]
DrawText16(): Fixed return value.
Tue Nov 26 14:47:09 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/profile.c] [*/*]
Added Win32 profile functions, updated to new naming standard.
* [objects/font.c] [if1632/thunk.c] [include/windows.h]
Added EnumFonts32*, EnumFontFamiliesEx*, changed prototypes and
structures.
* [misc/ole2nls.c] [if1632/thunk.c]
Added EnumSystemLocales() (winhelp.exe).
* [misc/registry.c]
Added Windows 3.1 registry loader supplied by Tor Sjxwall, tor@sn.no
* [win32/file.c]
Partially fixed CreateFileMapping(), added UnmapViewOfFile().
Sat Nov 23 23:36:05 1996 Ronan Waide <waider@waider.ie>
* [misc/shell.c]
Fixed some FIXMEs relating to ShellExec() and FindExecutable().
* [misc/main.c]
Implemented a few more of the SystemParametersInfo() cases.
Tue Nov 19 01:24:34 1996 Philippe De Muyter <phdm@info.ucl.ac.be>
* [include/keyboard.h]
New file, new macro WINE_VKEY_MAPPINGS (using code taken from event.c).
* [include/windows.h]
New [VK_A, VK_Z] and [VK_0, VK9] macros.
* [misc/keyboard.c]
Fixes in KeyTable and ToAscii.
* [objects/font.c]
FONT_init : Give default value for MSWIN "system" font.
FONT_MatchFont : Do not try every size of a font family if the
family does not exist.
* [windows/event.c]
lastEventChar hack removed.
KeyStateTable replaced by InputKeyStateTable (maintained in event.c)
and QueueKeyStateTable (maintained in message.c).
EVENT_key : Corrections to the extended bit setting.
* [windows/message.c] [windows/keyboard.c]
Implementation of a new QueueKeyStateTable : table of key states
valid when messages are retrieved by GetMessage or PeekMessage,
and valid for TranslateMessage.
TranslateMessage : Convert WM*KEY messages using QueueKeyStateTable
and ToAscii.
Mon Nov 18 16:59:01 1996 Robert Pouliot <krynos@clic.net>
* [graphics/Makefile.in] [graphics/wing.c]
[if1632/wing.spec]
Some functions for WinG support, mostly empty stubs.
* [misc/crtdll.c] [if1632/crtdll.spec]
Many functions added to CRTDLL, mostly calls to Unix C library.
1996-12-01 18:17:47 +01:00
|
|
|
}
|
2021-06-17 06:33:10 +02:00
|
|
|
params->addr_len = len;
|
2021-05-18 04:30:01 +02:00
|
|
|
params->synchronous = TRUE;
|
2021-06-17 06:33:10 +02:00
|
|
|
memcpy( params + 1, addr, len );
|
2001-10-08 22:36:03 +02:00
|
|
|
|
2021-05-18 04:30:01 +02:00
|
|
|
status = NtDeviceIoControlFile( (HANDLE)s, sync_event, NULL, NULL, &io, IOCTL_AFD_WINE_CONNECT,
|
2021-06-17 06:33:10 +02:00
|
|
|
params, sizeof(*params) + len, NULL, 0 );
|
2021-05-18 04:30:01 +02:00
|
|
|
HeapFree( GetProcessHeap(), 0, params );
|
|
|
|
if (status == STATUS_PENDING)
|
|
|
|
{
|
|
|
|
if (WaitForSingleObject( sync_event, INFINITE ) == WAIT_FAILED) return -1;
|
|
|
|
status = io.u.Status;
|
|
|
|
}
|
|
|
|
if (status)
|
|
|
|
{
|
2021-06-10 19:36:37 +02:00
|
|
|
/* NtStatusToWSAError() has no mapping for WSAEALREADY */
|
|
|
|
SetLastError( status == STATUS_ADDRESS_ALREADY_ASSOCIATED ? WSAEALREADY : NtStatusToWSAError( status ) );
|
2021-05-18 04:30:01 +02:00
|
|
|
return -1;
|
|
|
|
}
|
2001-10-08 22:36:03 +02:00
|
|
|
return 0;
|
Release 961201
Sat Nov 30 19:21:17 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [configure]
Re-generated with autoconf 2.11. Let me know if you have
problems.
* [controls/listbox.c] [controls/oldlbox.c]
Listboxes rewritten from scratch. Moved old code still used by
comboboxes to oldlbox.c
* [misc/registry.c]
Use temporary file when saving registry.
* [windows/dialog.c]
Implemented Win32 version of DlgDirList() and DlgDirListComboBox().
* [windows/winproc.c]
Added translation for listbox Win32 messages.
Sat Nov 30 21:00:00 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [controls/widgets.c] [controls/button.c]
Fixed some incompatibilities with CTL3D DLL.
* [windows/dialog.c]
Made dialog windows fit into the desktop.
* [misc/winsock.c] [misc/winsock_async.c]
New Winsock engine.
* [windows/message.c]
GetMessage() fixes.
* [windows/queue.c] [windows/hook.c] [windows/win.c]
SetMessageQueue() fixes.
Fri Nov 29 10:25:12 1996 Slaven Rezic <eserte@cs.tu-berlin.de>
* [objects/text.c]
DrawText16(): Fixed return value.
Tue Nov 26 14:47:09 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/profile.c] [*/*]
Added Win32 profile functions, updated to new naming standard.
* [objects/font.c] [if1632/thunk.c] [include/windows.h]
Added EnumFonts32*, EnumFontFamiliesEx*, changed prototypes and
structures.
* [misc/ole2nls.c] [if1632/thunk.c]
Added EnumSystemLocales() (winhelp.exe).
* [misc/registry.c]
Added Windows 3.1 registry loader supplied by Tor Sjxwall, tor@sn.no
* [win32/file.c]
Partially fixed CreateFileMapping(), added UnmapViewOfFile().
Sat Nov 23 23:36:05 1996 Ronan Waide <waider@waider.ie>
* [misc/shell.c]
Fixed some FIXMEs relating to ShellExec() and FindExecutable().
* [misc/main.c]
Implemented a few more of the SystemParametersInfo() cases.
Tue Nov 19 01:24:34 1996 Philippe De Muyter <phdm@info.ucl.ac.be>
* [include/keyboard.h]
New file, new macro WINE_VKEY_MAPPINGS (using code taken from event.c).
* [include/windows.h]
New [VK_A, VK_Z] and [VK_0, VK9] macros.
* [misc/keyboard.c]
Fixes in KeyTable and ToAscii.
* [objects/font.c]
FONT_init : Give default value for MSWIN "system" font.
FONT_MatchFont : Do not try every size of a font family if the
family does not exist.
* [windows/event.c]
lastEventChar hack removed.
KeyStateTable replaced by InputKeyStateTable (maintained in event.c)
and QueueKeyStateTable (maintained in message.c).
EVENT_key : Corrections to the extended bit setting.
* [windows/message.c] [windows/keyboard.c]
Implementation of a new QueueKeyStateTable : table of key states
valid when messages are retrieved by GetMessage or PeekMessage,
and valid for TranslateMessage.
TranslateMessage : Convert WM*KEY messages using QueueKeyStateTable
and ToAscii.
Mon Nov 18 16:59:01 1996 Robert Pouliot <krynos@clic.net>
* [graphics/Makefile.in] [graphics/wing.c]
[if1632/wing.spec]
Some functions for WinG support, mostly empty stubs.
* [misc/crtdll.c] [if1632/crtdll.spec]
Many functions added to CRTDLL, mostly calls to Unix C library.
1996-12-01 18:17:47 +01:00
|
|
|
}
|
|
|
|
|
2021-05-18 04:30:01 +02:00
|
|
|
|
2002-04-24 00:03:42 +02:00
|
|
|
/***********************************************************************
|
|
|
|
* WSAConnect (WS2_32.30)
|
|
|
|
*/
|
2005-01-14 20:54:38 +01:00
|
|
|
int WINAPI WSAConnect( SOCKET s, const struct WS_sockaddr* name, int namelen,
|
|
|
|
LPWSABUF lpCallerData, LPWSABUF lpCalleeData,
|
|
|
|
LPQOS lpSQOS, LPQOS lpGQOS )
|
2002-04-24 00:03:42 +02:00
|
|
|
{
|
|
|
|
if ( lpCallerData || lpCalleeData || lpSQOS || lpGQOS )
|
2005-01-14 20:54:38 +01:00
|
|
|
FIXME("unsupported parameters!\n");
|
|
|
|
return WS_connect( s, name, namelen );
|
2002-04-24 00:03:42 +02:00
|
|
|
}
|
|
|
|
|
2010-08-04 05:14:52 +02:00
|
|
|
|
2021-05-18 04:30:00 +02:00
|
|
|
static BOOL WINAPI WS2_ConnectEx( SOCKET s, const struct WS_sockaddr *name, int namelen,
|
|
|
|
void *send_buffer, DWORD send_len, DWORD *ret_len, OVERLAPPED *overlapped )
|
|
|
|
{
|
|
|
|
struct afd_connect_params *params;
|
|
|
|
void *cvalue = NULL;
|
|
|
|
NTSTATUS status;
|
2010-08-04 05:14:52 +02:00
|
|
|
|
2021-05-18 04:30:00 +02:00
|
|
|
TRACE( "socket %#lx, ptr %p %s, length %d, send_buffer %p, send_len %u, overlapped %p\n",
|
|
|
|
s, name, debugstr_sockaddr(name), namelen, send_buffer, send_len, overlapped );
|
2010-08-01 05:21:34 +02:00
|
|
|
|
2021-05-18 04:30:00 +02:00
|
|
|
if (!overlapped)
|
2010-08-01 05:21:34 +02:00
|
|
|
{
|
2021-05-18 04:30:00 +02:00
|
|
|
SetLastError( WSA_INVALID_PARAMETER );
|
|
|
|
return FALSE;
|
2010-08-01 05:21:34 +02:00
|
|
|
}
|
|
|
|
|
2021-05-18 04:30:00 +02:00
|
|
|
if (!((ULONG_PTR)overlapped->hEvent & 1)) cvalue = overlapped;
|
|
|
|
overlapped->Internal = STATUS_PENDING;
|
|
|
|
overlapped->InternalHigh = 0;
|
2010-08-01 05:21:34 +02:00
|
|
|
|
2021-06-17 06:33:10 +02:00
|
|
|
if (!(params = HeapAlloc( GetProcessHeap(), 0, sizeof(*params) + namelen + send_len )))
|
2010-08-01 05:21:34 +02:00
|
|
|
{
|
2021-05-18 04:30:00 +02:00
|
|
|
SetLastError( ERROR_NOT_ENOUGH_MEMORY );
|
|
|
|
return SOCKET_ERROR;
|
2010-08-01 05:21:34 +02:00
|
|
|
}
|
2021-06-17 06:33:10 +02:00
|
|
|
params->addr_len = namelen;
|
2021-05-18 04:30:00 +02:00
|
|
|
params->synchronous = FALSE;
|
2021-06-17 06:33:10 +02:00
|
|
|
memcpy( params + 1, name, namelen );
|
|
|
|
memcpy( (char *)(params + 1) + namelen, send_buffer, send_len );
|
2010-08-01 05:21:34 +02:00
|
|
|
|
2021-05-18 04:30:00 +02:00
|
|
|
status = NtDeviceIoControlFile( SOCKET2HANDLE(s), overlapped->hEvent, NULL, cvalue,
|
|
|
|
(IO_STATUS_BLOCK *)overlapped, IOCTL_AFD_WINE_CONNECT,
|
2021-06-17 06:33:10 +02:00
|
|
|
params, sizeof(*params) + namelen + send_len, NULL, 0 );
|
2021-05-18 04:30:00 +02:00
|
|
|
HeapFree( GetProcessHeap(), 0, params );
|
|
|
|
if (ret_len) *ret_len = overlapped->InternalHigh;
|
|
|
|
SetLastError( NtStatusToWSAError( status ) );
|
|
|
|
return !status;
|
2010-08-01 05:21:34 +02:00
|
|
|
}
|
|
|
|
|
2021-05-19 05:35:50 +02:00
|
|
|
|
|
|
|
static BOOL WINAPI WS2_DisconnectEx( SOCKET s, OVERLAPPED *overlapped, DWORD flags, DWORD reserved )
|
2016-04-20 16:03:57 +02:00
|
|
|
{
|
2021-05-19 05:35:50 +02:00
|
|
|
IO_STATUS_BLOCK iosb, *piosb = &iosb;
|
|
|
|
void *cvalue = NULL;
|
|
|
|
int how = SD_SEND;
|
|
|
|
HANDLE event = 0;
|
|
|
|
NTSTATUS status;
|
|
|
|
|
|
|
|
TRACE( "socket %#lx, overlapped %p, flags %#x, reserved %#x\n", s, overlapped, flags, reserved );
|
2016-04-20 16:03:57 +02:00
|
|
|
|
|
|
|
if (flags & TF_REUSE_SOCKET)
|
|
|
|
FIXME( "Reusing socket not supported yet\n" );
|
|
|
|
|
2021-05-19 05:35:50 +02:00
|
|
|
if (overlapped)
|
2016-04-20 16:03:57 +02:00
|
|
|
{
|
2021-05-19 05:35:50 +02:00
|
|
|
piosb = (IO_STATUS_BLOCK *)overlapped;
|
|
|
|
if (!((ULONG_PTR)overlapped->hEvent & 1)) cvalue = overlapped;
|
|
|
|
event = overlapped->hEvent;
|
|
|
|
overlapped->Internal = STATUS_PENDING;
|
|
|
|
overlapped->InternalHigh = 0;
|
2016-04-20 16:03:57 +02:00
|
|
|
}
|
|
|
|
|
2021-05-19 05:35:50 +02:00
|
|
|
status = NtDeviceIoControlFile( (HANDLE)s, event, NULL, cvalue, piosb,
|
|
|
|
IOCTL_AFD_WINE_SHUTDOWN, &how, sizeof(how), NULL, 0 );
|
|
|
|
if (!status && overlapped) status = STATUS_PENDING;
|
|
|
|
SetLastError( NtStatusToWSAError( status ) );
|
|
|
|
return !status;
|
2016-04-20 16:03:57 +02:00
|
|
|
}
|
2002-04-24 00:03:42 +02:00
|
|
|
|
2021-06-17 06:33:12 +02:00
|
|
|
|
1997-08-24 18:00:30 +02:00
|
|
|
/***********************************************************************
|
2021-06-17 06:33:12 +02:00
|
|
|
* getpeername (ws2_32.5)
|
1997-08-24 18:00:30 +02:00
|
|
|
*/
|
2021-06-17 06:33:12 +02:00
|
|
|
int WINAPI WS_getpeername( SOCKET s, struct WS_sockaddr *addr, int *len )
|
1997-08-24 18:00:30 +02:00
|
|
|
{
|
2021-06-17 06:33:12 +02:00
|
|
|
IO_STATUS_BLOCK io;
|
|
|
|
NTSTATUS status;
|
2001-10-08 22:36:03 +02:00
|
|
|
|
2021-06-17 06:33:12 +02:00
|
|
|
TRACE( "socket %#lx, addr %p, len %d\n", s, addr, len ? *len : 0 );
|
2002-06-13 21:09:55 +02:00
|
|
|
|
2021-06-17 06:33:12 +02:00
|
|
|
if (!socket_list_find( s ))
|
1997-08-24 18:00:30 +02:00
|
|
|
{
|
2021-06-17 06:33:12 +02:00
|
|
|
WSASetLastError( WSAENOTSOCK );
|
|
|
|
return -1;
|
|
|
|
}
|
2001-10-08 22:36:03 +02:00
|
|
|
|
2021-06-17 06:33:12 +02:00
|
|
|
if (!len)
|
|
|
|
{
|
|
|
|
SetLastError( WSAEFAULT );
|
|
|
|
return -1;
|
2001-10-08 22:36:03 +02:00
|
|
|
}
|
2021-06-17 06:33:12 +02:00
|
|
|
|
|
|
|
status = NtDeviceIoControlFile( (HANDLE)s, NULL, NULL, NULL, &io,
|
|
|
|
IOCTL_AFD_WINE_GETPEERNAME, NULL, 0, addr, *len );
|
|
|
|
if (!status)
|
|
|
|
*len = io.Information;
|
|
|
|
SetLastError( NtStatusToWSAError( status ) );
|
|
|
|
return status ? -1 : 0;
|
1997-08-24 18:00:30 +02:00
|
|
|
}
|
|
|
|
|
2015-04-09 05:09:29 +02:00
|
|
|
|
1997-08-24 18:00:30 +02:00
|
|
|
/***********************************************************************
|
2021-06-16 06:13:32 +02:00
|
|
|
* getsockname (ws2_32.6)
|
1997-08-24 18:00:30 +02:00
|
|
|
*/
|
2021-06-16 06:13:32 +02:00
|
|
|
int WINAPI WS_getsockname( SOCKET s, struct WS_sockaddr *addr, int *len )
|
Release 961201
Sat Nov 30 19:21:17 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [configure]
Re-generated with autoconf 2.11. Let me know if you have
problems.
* [controls/listbox.c] [controls/oldlbox.c]
Listboxes rewritten from scratch. Moved old code still used by
comboboxes to oldlbox.c
* [misc/registry.c]
Use temporary file when saving registry.
* [windows/dialog.c]
Implemented Win32 version of DlgDirList() and DlgDirListComboBox().
* [windows/winproc.c]
Added translation for listbox Win32 messages.
Sat Nov 30 21:00:00 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [controls/widgets.c] [controls/button.c]
Fixed some incompatibilities with CTL3D DLL.
* [windows/dialog.c]
Made dialog windows fit into the desktop.
* [misc/winsock.c] [misc/winsock_async.c]
New Winsock engine.
* [windows/message.c]
GetMessage() fixes.
* [windows/queue.c] [windows/hook.c] [windows/win.c]
SetMessageQueue() fixes.
Fri Nov 29 10:25:12 1996 Slaven Rezic <eserte@cs.tu-berlin.de>
* [objects/text.c]
DrawText16(): Fixed return value.
Tue Nov 26 14:47:09 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/profile.c] [*/*]
Added Win32 profile functions, updated to new naming standard.
* [objects/font.c] [if1632/thunk.c] [include/windows.h]
Added EnumFonts32*, EnumFontFamiliesEx*, changed prototypes and
structures.
* [misc/ole2nls.c] [if1632/thunk.c]
Added EnumSystemLocales() (winhelp.exe).
* [misc/registry.c]
Added Windows 3.1 registry loader supplied by Tor Sjxwall, tor@sn.no
* [win32/file.c]
Partially fixed CreateFileMapping(), added UnmapViewOfFile().
Sat Nov 23 23:36:05 1996 Ronan Waide <waider@waider.ie>
* [misc/shell.c]
Fixed some FIXMEs relating to ShellExec() and FindExecutable().
* [misc/main.c]
Implemented a few more of the SystemParametersInfo() cases.
Tue Nov 19 01:24:34 1996 Philippe De Muyter <phdm@info.ucl.ac.be>
* [include/keyboard.h]
New file, new macro WINE_VKEY_MAPPINGS (using code taken from event.c).
* [include/windows.h]
New [VK_A, VK_Z] and [VK_0, VK9] macros.
* [misc/keyboard.c]
Fixes in KeyTable and ToAscii.
* [objects/font.c]
FONT_init : Give default value for MSWIN "system" font.
FONT_MatchFont : Do not try every size of a font family if the
family does not exist.
* [windows/event.c]
lastEventChar hack removed.
KeyStateTable replaced by InputKeyStateTable (maintained in event.c)
and QueueKeyStateTable (maintained in message.c).
EVENT_key : Corrections to the extended bit setting.
* [windows/message.c] [windows/keyboard.c]
Implementation of a new QueueKeyStateTable : table of key states
valid when messages are retrieved by GetMessage or PeekMessage,
and valid for TranslateMessage.
TranslateMessage : Convert WM*KEY messages using QueueKeyStateTable
and ToAscii.
Mon Nov 18 16:59:01 1996 Robert Pouliot <krynos@clic.net>
* [graphics/Makefile.in] [graphics/wing.c]
[if1632/wing.spec]
Some functions for WinG support, mostly empty stubs.
* [misc/crtdll.c] [if1632/crtdll.spec]
Many functions added to CRTDLL, mostly calls to Unix C library.
1996-12-01 18:17:47 +01:00
|
|
|
{
|
2021-06-16 06:13:32 +02:00
|
|
|
IO_STATUS_BLOCK io;
|
|
|
|
NTSTATUS status;
|
2001-10-08 22:36:03 +02:00
|
|
|
|
2021-06-16 06:13:32 +02:00
|
|
|
TRACE( "socket %#lx, addr %p, len %d\n", s, addr, len ? *len : 0 );
|
Release 961201
Sat Nov 30 19:21:17 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [configure]
Re-generated with autoconf 2.11. Let me know if you have
problems.
* [controls/listbox.c] [controls/oldlbox.c]
Listboxes rewritten from scratch. Moved old code still used by
comboboxes to oldlbox.c
* [misc/registry.c]
Use temporary file when saving registry.
* [windows/dialog.c]
Implemented Win32 version of DlgDirList() and DlgDirListComboBox().
* [windows/winproc.c]
Added translation for listbox Win32 messages.
Sat Nov 30 21:00:00 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [controls/widgets.c] [controls/button.c]
Fixed some incompatibilities with CTL3D DLL.
* [windows/dialog.c]
Made dialog windows fit into the desktop.
* [misc/winsock.c] [misc/winsock_async.c]
New Winsock engine.
* [windows/message.c]
GetMessage() fixes.
* [windows/queue.c] [windows/hook.c] [windows/win.c]
SetMessageQueue() fixes.
Fri Nov 29 10:25:12 1996 Slaven Rezic <eserte@cs.tu-berlin.de>
* [objects/text.c]
DrawText16(): Fixed return value.
Tue Nov 26 14:47:09 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/profile.c] [*/*]
Added Win32 profile functions, updated to new naming standard.
* [objects/font.c] [if1632/thunk.c] [include/windows.h]
Added EnumFonts32*, EnumFontFamiliesEx*, changed prototypes and
structures.
* [misc/ole2nls.c] [if1632/thunk.c]
Added EnumSystemLocales() (winhelp.exe).
* [misc/registry.c]
Added Windows 3.1 registry loader supplied by Tor Sjxwall, tor@sn.no
* [win32/file.c]
Partially fixed CreateFileMapping(), added UnmapViewOfFile().
Sat Nov 23 23:36:05 1996 Ronan Waide <waider@waider.ie>
* [misc/shell.c]
Fixed some FIXMEs relating to ShellExec() and FindExecutable().
* [misc/main.c]
Implemented a few more of the SystemParametersInfo() cases.
Tue Nov 19 01:24:34 1996 Philippe De Muyter <phdm@info.ucl.ac.be>
* [include/keyboard.h]
New file, new macro WINE_VKEY_MAPPINGS (using code taken from event.c).
* [include/windows.h]
New [VK_A, VK_Z] and [VK_0, VK9] macros.
* [misc/keyboard.c]
Fixes in KeyTable and ToAscii.
* [objects/font.c]
FONT_init : Give default value for MSWIN "system" font.
FONT_MatchFont : Do not try every size of a font family if the
family does not exist.
* [windows/event.c]
lastEventChar hack removed.
KeyStateTable replaced by InputKeyStateTable (maintained in event.c)
and QueueKeyStateTable (maintained in message.c).
EVENT_key : Corrections to the extended bit setting.
* [windows/message.c] [windows/keyboard.c]
Implementation of a new QueueKeyStateTable : table of key states
valid when messages are retrieved by GetMessage or PeekMessage,
and valid for TranslateMessage.
TranslateMessage : Convert WM*KEY messages using QueueKeyStateTable
and ToAscii.
Mon Nov 18 16:59:01 1996 Robert Pouliot <krynos@clic.net>
* [graphics/Makefile.in] [graphics/wing.c]
[if1632/wing.spec]
Some functions for WinG support, mostly empty stubs.
* [misc/crtdll.c] [if1632/crtdll.spec]
Many functions added to CRTDLL, mostly calls to Unix C library.
1996-12-01 18:17:47 +01:00
|
|
|
|
2021-06-16 06:13:32 +02:00
|
|
|
if (!addr)
|
2002-06-13 21:09:55 +02:00
|
|
|
{
|
|
|
|
SetLastError( WSAEFAULT );
|
2021-06-16 06:13:32 +02:00
|
|
|
return -1;
|
2002-06-13 21:09:55 +02:00
|
|
|
}
|
|
|
|
|
2021-06-16 06:13:32 +02:00
|
|
|
status = NtDeviceIoControlFile( (HANDLE)s, NULL, NULL, NULL, &io, IOCTL_AFD_GETSOCKNAME, NULL, 0, addr, *len );
|
|
|
|
if (!status)
|
|
|
|
*len = io.Information;
|
|
|
|
WSASetLastError( NtStatusToWSAError( status ) );
|
|
|
|
return status ? -1 : 0;
|
Release 961201
Sat Nov 30 19:21:17 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [configure]
Re-generated with autoconf 2.11. Let me know if you have
problems.
* [controls/listbox.c] [controls/oldlbox.c]
Listboxes rewritten from scratch. Moved old code still used by
comboboxes to oldlbox.c
* [misc/registry.c]
Use temporary file when saving registry.
* [windows/dialog.c]
Implemented Win32 version of DlgDirList() and DlgDirListComboBox().
* [windows/winproc.c]
Added translation for listbox Win32 messages.
Sat Nov 30 21:00:00 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [controls/widgets.c] [controls/button.c]
Fixed some incompatibilities with CTL3D DLL.
* [windows/dialog.c]
Made dialog windows fit into the desktop.
* [misc/winsock.c] [misc/winsock_async.c]
New Winsock engine.
* [windows/message.c]
GetMessage() fixes.
* [windows/queue.c] [windows/hook.c] [windows/win.c]
SetMessageQueue() fixes.
Fri Nov 29 10:25:12 1996 Slaven Rezic <eserte@cs.tu-berlin.de>
* [objects/text.c]
DrawText16(): Fixed return value.
Tue Nov 26 14:47:09 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/profile.c] [*/*]
Added Win32 profile functions, updated to new naming standard.
* [objects/font.c] [if1632/thunk.c] [include/windows.h]
Added EnumFonts32*, EnumFontFamiliesEx*, changed prototypes and
structures.
* [misc/ole2nls.c] [if1632/thunk.c]
Added EnumSystemLocales() (winhelp.exe).
* [misc/registry.c]
Added Windows 3.1 registry loader supplied by Tor Sjxwall, tor@sn.no
* [win32/file.c]
Partially fixed CreateFileMapping(), added UnmapViewOfFile().
Sat Nov 23 23:36:05 1996 Ronan Waide <waider@waider.ie>
* [misc/shell.c]
Fixed some FIXMEs relating to ShellExec() and FindExecutable().
* [misc/main.c]
Implemented a few more of the SystemParametersInfo() cases.
Tue Nov 19 01:24:34 1996 Philippe De Muyter <phdm@info.ucl.ac.be>
* [include/keyboard.h]
New file, new macro WINE_VKEY_MAPPINGS (using code taken from event.c).
* [include/windows.h]
New [VK_A, VK_Z] and [VK_0, VK9] macros.
* [misc/keyboard.c]
Fixes in KeyTable and ToAscii.
* [objects/font.c]
FONT_init : Give default value for MSWIN "system" font.
FONT_MatchFont : Do not try every size of a font family if the
family does not exist.
* [windows/event.c]
lastEventChar hack removed.
KeyStateTable replaced by InputKeyStateTable (maintained in event.c)
and QueueKeyStateTable (maintained in message.c).
EVENT_key : Corrections to the extended bit setting.
* [windows/message.c] [windows/keyboard.c]
Implementation of a new QueueKeyStateTable : table of key states
valid when messages are retrieved by GetMessage or PeekMessage,
and valid for TranslateMessage.
TranslateMessage : Convert WM*KEY messages using QueueKeyStateTable
and ToAscii.
Mon Nov 18 16:59:01 1996 Robert Pouliot <krynos@clic.net>
* [graphics/Makefile.in] [graphics/wing.c]
[if1632/wing.spec]
Some functions for WinG support, mostly empty stubs.
* [misc/crtdll.c] [if1632/crtdll.spec]
Many functions added to CRTDLL, mostly calls to Unix C library.
1996-12-01 18:17:47 +01:00
|
|
|
}
|
|
|
|
|
2021-06-23 18:23:43 +02:00
|
|
|
|
|
|
|
static int server_getsockopt( SOCKET s, ULONG code, char *optval, int *optlen )
|
|
|
|
{
|
|
|
|
IO_STATUS_BLOCK io;
|
|
|
|
NTSTATUS status;
|
|
|
|
|
|
|
|
status = NtDeviceIoControlFile( (HANDLE)s, NULL, NULL, NULL, &io, code, NULL, 0, optval, *optlen );
|
|
|
|
if (!status) *optlen = io.Information;
|
|
|
|
SetLastError( NtStatusToWSAError( status ) );
|
|
|
|
return status ? -1 : 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
1997-08-24 18:00:30 +02:00
|
|
|
/***********************************************************************
|
2001-07-02 21:59:40 +02:00
|
|
|
* getsockopt (WS2_32.7)
|
1997-08-24 18:00:30 +02:00
|
|
|
*/
|
2002-06-01 01:06:46 +02:00
|
|
|
INT WINAPI WS_getsockopt(SOCKET s, INT level,
|
1999-02-26 12:11:13 +01:00
|
|
|
INT optname, char *optval, INT *optlen)
|
1997-08-24 18:00:30 +02:00
|
|
|
{
|
2001-12-14 23:48:38 +01:00
|
|
|
int fd;
|
2004-10-06 20:52:51 +02:00
|
|
|
INT ret = 0;
|
2001-12-14 23:48:38 +01:00
|
|
|
|
2015-04-02 05:17:39 +02:00
|
|
|
TRACE("(socket %04lx, %s, optval %s, optlen %p (%d))\n", s,
|
|
|
|
debugstr_sockopt(level, optname), debugstr_optval(optval, 0),
|
|
|
|
optlen, optlen ? *optlen : 0);
|
2006-12-04 09:46:10 +01:00
|
|
|
|
|
|
|
switch(level)
|
|
|
|
{
|
|
|
|
case WS_SOL_SOCKET:
|
2001-12-14 23:48:38 +01:00
|
|
|
{
|
2006-12-04 09:46:10 +01:00
|
|
|
switch(optname)
|
2001-12-14 23:48:38 +01:00
|
|
|
{
|
2021-06-23 18:23:43 +02:00
|
|
|
case WS_SO_ACCEPTCONN:
|
|
|
|
return server_getsockopt( s, IOCTL_AFD_WINE_GET_SO_ACCEPTCONN, optval, optlen );
|
|
|
|
|
2021-06-23 18:23:44 +02:00
|
|
|
case WS_SO_BROADCAST:
|
|
|
|
return server_getsockopt( s, IOCTL_AFD_WINE_GET_SO_BROADCAST, optval, optlen );
|
|
|
|
|
2014-12-08 23:55:45 +01:00
|
|
|
case WS_SO_BSP_STATE:
|
|
|
|
{
|
2021-06-22 17:24:11 +02:00
|
|
|
CSADDR_INFO *csinfo = (CSADDR_INFO *)optval;
|
2014-12-08 23:55:45 +01:00
|
|
|
WSAPROTOCOL_INFOW infow;
|
2021-06-22 17:24:11 +02:00
|
|
|
int addr_size;
|
2014-12-08 23:55:45 +01:00
|
|
|
|
2021-06-22 17:24:11 +02:00
|
|
|
if (!ws_protocol_info( s, TRUE, &infow, &addr_size ))
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
if (infow.iAddressFamily == WS_AF_INET)
|
|
|
|
addr_size = sizeof(struct sockaddr_in);
|
|
|
|
else if (infow.iAddressFamily == WS_AF_INET6)
|
|
|
|
addr_size = sizeof(struct sockaddr_in6);
|
|
|
|
else
|
|
|
|
{
|
|
|
|
FIXME( "family %d is unsupported for SO_BSP_STATE\n", infow.iAddressFamily );
|
|
|
|
SetLastError( WSAEAFNOSUPPORT );
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (*optlen < sizeof(CSADDR_INFO) + addr_size * 2)
|
|
|
|
{
|
|
|
|
ret = 0;
|
|
|
|
SetLastError( WSAEFAULT );
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
csinfo->LocalAddr.lpSockaddr = (struct WS_sockaddr *)(csinfo + 1);
|
|
|
|
csinfo->RemoteAddr.lpSockaddr = (struct WS_sockaddr *)((char *)(csinfo + 1) + addr_size);
|
|
|
|
|
|
|
|
csinfo->LocalAddr.iSockaddrLength = addr_size;
|
|
|
|
if (WS_getsockname( s, csinfo->LocalAddr.lpSockaddr, &csinfo->LocalAddr.iSockaddrLength ) < 0)
|
2014-12-08 23:55:45 +01:00
|
|
|
{
|
2021-06-22 17:24:11 +02:00
|
|
|
csinfo->LocalAddr.lpSockaddr = NULL;
|
|
|
|
csinfo->LocalAddr.iSockaddrLength = 0;
|
2014-12-08 23:55:45 +01:00
|
|
|
}
|
2021-06-22 17:24:11 +02:00
|
|
|
|
|
|
|
csinfo->RemoteAddr.iSockaddrLength = addr_size;
|
|
|
|
if (WS_getpeername( s, csinfo->RemoteAddr.lpSockaddr, &csinfo->RemoteAddr.iSockaddrLength ) < 0)
|
|
|
|
{
|
|
|
|
csinfo->RemoteAddr.lpSockaddr = NULL;
|
|
|
|
csinfo->RemoteAddr.iSockaddrLength = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
csinfo->iSocketType = infow.iSocketType;
|
|
|
|
csinfo->iProtocol = infow.iProtocol;
|
|
|
|
return 0;
|
2014-12-08 23:55:45 +01:00
|
|
|
}
|
2021-06-23 18:23:47 +02:00
|
|
|
|
|
|
|
case WS_SO_DEBUG:
|
|
|
|
WARN( "returning 0 for SO_DEBUG\n" );
|
|
|
|
*(DWORD *)optval = 0;
|
|
|
|
SetLastError( 0 );
|
|
|
|
return 0;
|
|
|
|
|
2006-12-04 09:46:10 +01:00
|
|
|
case WS_SO_DONTLINGER:
|
|
|
|
{
|
2021-06-25 05:32:47 +02:00
|
|
|
struct WS_linger linger;
|
|
|
|
int len = sizeof(linger);
|
|
|
|
int ret;
|
2006-12-04 09:46:10 +01:00
|
|
|
|
|
|
|
if (!optlen || *optlen < sizeof(BOOL)|| !optval)
|
|
|
|
{
|
|
|
|
SetLastError(WSAEFAULT);
|
|
|
|
return SOCKET_ERROR;
|
|
|
|
}
|
|
|
|
|
2021-06-25 05:32:47 +02:00
|
|
|
if (!(ret = WS_getsockopt( s, WS_SOL_SOCKET, WS_SO_LINGER, (char *)&linger, &len )))
|
2006-12-04 09:46:10 +01:00
|
|
|
{
|
2021-06-25 05:32:47 +02:00
|
|
|
*(BOOL *)optval = !linger.l_onoff;
|
2006-12-04 09:46:10 +01:00
|
|
|
*optlen = sizeof(BOOL);
|
|
|
|
}
|
|
|
|
return ret;
|
2001-12-14 23:48:38 +01:00
|
|
|
}
|
Release 961201
Sat Nov 30 19:21:17 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [configure]
Re-generated with autoconf 2.11. Let me know if you have
problems.
* [controls/listbox.c] [controls/oldlbox.c]
Listboxes rewritten from scratch. Moved old code still used by
comboboxes to oldlbox.c
* [misc/registry.c]
Use temporary file when saving registry.
* [windows/dialog.c]
Implemented Win32 version of DlgDirList() and DlgDirListComboBox().
* [windows/winproc.c]
Added translation for listbox Win32 messages.
Sat Nov 30 21:00:00 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [controls/widgets.c] [controls/button.c]
Fixed some incompatibilities with CTL3D DLL.
* [windows/dialog.c]
Made dialog windows fit into the desktop.
* [misc/winsock.c] [misc/winsock_async.c]
New Winsock engine.
* [windows/message.c]
GetMessage() fixes.
* [windows/queue.c] [windows/hook.c] [windows/win.c]
SetMessageQueue() fixes.
Fri Nov 29 10:25:12 1996 Slaven Rezic <eserte@cs.tu-berlin.de>
* [objects/text.c]
DrawText16(): Fixed return value.
Tue Nov 26 14:47:09 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/profile.c] [*/*]
Added Win32 profile functions, updated to new naming standard.
* [objects/font.c] [if1632/thunk.c] [include/windows.h]
Added EnumFonts32*, EnumFontFamiliesEx*, changed prototypes and
structures.
* [misc/ole2nls.c] [if1632/thunk.c]
Added EnumSystemLocales() (winhelp.exe).
* [misc/registry.c]
Added Windows 3.1 registry loader supplied by Tor Sjxwall, tor@sn.no
* [win32/file.c]
Partially fixed CreateFileMapping(), added UnmapViewOfFile().
Sat Nov 23 23:36:05 1996 Ronan Waide <waider@waider.ie>
* [misc/shell.c]
Fixed some FIXMEs relating to ShellExec() and FindExecutable().
* [misc/main.c]
Implemented a few more of the SystemParametersInfo() cases.
Tue Nov 19 01:24:34 1996 Philippe De Muyter <phdm@info.ucl.ac.be>
* [include/keyboard.h]
New file, new macro WINE_VKEY_MAPPINGS (using code taken from event.c).
* [include/windows.h]
New [VK_A, VK_Z] and [VK_0, VK9] macros.
* [misc/keyboard.c]
Fixes in KeyTable and ToAscii.
* [objects/font.c]
FONT_init : Give default value for MSWIN "system" font.
FONT_MatchFont : Do not try every size of a font family if the
family does not exist.
* [windows/event.c]
lastEventChar hack removed.
KeyStateTable replaced by InputKeyStateTable (maintained in event.c)
and QueueKeyStateTable (maintained in message.c).
EVENT_key : Corrections to the extended bit setting.
* [windows/message.c] [windows/keyboard.c]
Implementation of a new QueueKeyStateTable : table of key states
valid when messages are retrieved by GetMessage or PeekMessage,
and valid for TranslateMessage.
TranslateMessage : Convert WM*KEY messages using QueueKeyStateTable
and ToAscii.
Mon Nov 18 16:59:01 1996 Robert Pouliot <krynos@clic.net>
* [graphics/Makefile.in] [graphics/wing.c]
[if1632/wing.spec]
Some functions for WinG support, mostly empty stubs.
* [misc/crtdll.c] [if1632/crtdll.spec]
Many functions added to CRTDLL, mostly calls to Unix C library.
1996-12-01 18:17:47 +01:00
|
|
|
|
2011-01-26 17:01:09 +01:00
|
|
|
case WS_SO_CONNECT_TIME:
|
|
|
|
{
|
|
|
|
static int pretendtime = 0;
|
2011-12-19 15:42:08 +01:00
|
|
|
struct WS_sockaddr addr;
|
|
|
|
int len = sizeof(addr);
|
2011-01-26 17:01:09 +01:00
|
|
|
|
|
|
|
if (!optlen || *optlen < sizeof(DWORD) || !optval)
|
|
|
|
{
|
|
|
|
SetLastError(WSAEFAULT);
|
|
|
|
return SOCKET_ERROR;
|
|
|
|
}
|
2011-12-19 15:42:08 +01:00
|
|
|
if (WS_getpeername(s, &addr, &len) == SOCKET_ERROR)
|
|
|
|
*(DWORD *)optval = ~0u;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (!pretendtime) FIXME("WS_SO_CONNECT_TIME - faking results\n");
|
|
|
|
*(DWORD *)optval = pretendtime++;
|
|
|
|
}
|
2011-01-26 17:01:09 +01:00
|
|
|
*optlen = sizeof(DWORD);
|
|
|
|
return ret;
|
|
|
|
}
|
2006-12-04 09:46:10 +01:00
|
|
|
/* As mentioned in setsockopt, Windows ignores this, so we
|
|
|
|
* always return true here */
|
|
|
|
case WS_SO_DONTROUTE:
|
|
|
|
if (!optlen || *optlen < sizeof(BOOL) || !optval)
|
|
|
|
{
|
|
|
|
SetLastError(WSAEFAULT);
|
|
|
|
return SOCKET_ERROR;
|
|
|
|
}
|
|
|
|
*(BOOL *)optval = TRUE;
|
|
|
|
*optlen = sizeof(BOOL);
|
|
|
|
return 0;
|
|
|
|
|
2015-04-08 07:02:55 +02:00
|
|
|
case WS_SO_ERROR:
|
2021-06-24 07:00:11 +02:00
|
|
|
return server_getsockopt( s, IOCTL_AFD_WINE_GET_SO_ERROR, optval, optlen );
|
2015-04-08 07:02:55 +02:00
|
|
|
|
2021-06-24 07:00:14 +02:00
|
|
|
case WS_SO_KEEPALIVE:
|
|
|
|
return server_getsockopt( s, IOCTL_AFD_WINE_GET_SO_KEEPALIVE, optval, optlen );
|
|
|
|
|
2006-12-04 09:46:10 +01:00
|
|
|
case WS_SO_LINGER:
|
2006-11-28 18:43:49 +01:00
|
|
|
{
|
2021-07-01 03:24:36 +02:00
|
|
|
WSAPROTOCOL_INFOW info;
|
|
|
|
int size;
|
|
|
|
|
2006-12-04 09:46:10 +01:00
|
|
|
/* struct linger and LINGER have different sizes */
|
|
|
|
if (!optlen || *optlen < sizeof(LINGER) || !optval)
|
|
|
|
{
|
|
|
|
SetLastError(WSAEFAULT);
|
|
|
|
return SOCKET_ERROR;
|
|
|
|
}
|
|
|
|
|
2021-07-01 03:24:36 +02:00
|
|
|
if (!ws_protocol_info( s, TRUE, &info, &size ))
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
if (info.iSocketType == SOCK_DGRAM)
|
2011-10-04 05:10:25 +02:00
|
|
|
{
|
2021-06-25 05:32:45 +02:00
|
|
|
SetLastError( WSAENOPROTOOPT );
|
|
|
|
return -1;
|
2006-12-04 09:46:10 +01:00
|
|
|
}
|
2021-06-25 05:32:45 +02:00
|
|
|
|
|
|
|
return server_getsockopt( s, IOCTL_AFD_WINE_GET_SO_LINGER, optval, optlen );
|
2006-11-28 18:43:49 +01:00
|
|
|
}
|
|
|
|
|
2006-12-04 09:46:10 +01:00
|
|
|
case WS_SO_MAX_MSG_SIZE:
|
|
|
|
if (!optlen || *optlen < sizeof(int) || !optval)
|
|
|
|
{
|
|
|
|
SetLastError(WSAEFAULT);
|
|
|
|
return SOCKET_ERROR;
|
|
|
|
}
|
|
|
|
TRACE("getting global SO_MAX_MSG_SIZE = 65507\n");
|
|
|
|
*(int *)optval = 65507;
|
|
|
|
*optlen = sizeof(int);
|
|
|
|
return 0;
|
|
|
|
|
2021-06-25 05:32:49 +02:00
|
|
|
case WS_SO_OOBINLINE:
|
|
|
|
return server_getsockopt( s, IOCTL_AFD_WINE_GET_SO_OOBINLINE, optval, optlen );
|
|
|
|
|
2006-12-04 09:46:10 +01:00
|
|
|
/* SO_OPENTYPE does not require a valid socket handle. */
|
|
|
|
case WS_SO_OPENTYPE:
|
|
|
|
if (!optlen || *optlen < sizeof(int) || !optval)
|
|
|
|
{
|
|
|
|
SetLastError(WSAEFAULT);
|
|
|
|
return SOCKET_ERROR;
|
|
|
|
}
|
|
|
|
*(int *)optval = get_per_thread_data()->opentype;
|
|
|
|
*optlen = sizeof(int);
|
|
|
|
TRACE("getting global SO_OPENTYPE = 0x%x\n", *((int*)optval) );
|
|
|
|
return 0;
|
2013-09-10 05:56:47 +02:00
|
|
|
case WS_SO_PROTOCOL_INFOA:
|
|
|
|
case WS_SO_PROTOCOL_INFOW:
|
|
|
|
{
|
|
|
|
int size;
|
|
|
|
WSAPROTOCOL_INFOW infow;
|
2004-09-14 02:48:15 +02:00
|
|
|
|
2013-09-10 05:56:47 +02:00
|
|
|
ret = ws_protocol_info(s, optname == WS_SO_PROTOCOL_INFOW, &infow, &size);
|
|
|
|
if (ret)
|
|
|
|
{
|
|
|
|
if (!optlen || !optval || *optlen < size)
|
|
|
|
{
|
|
|
|
if(optlen) *optlen = size;
|
|
|
|
ret = 0;
|
|
|
|
SetLastError(WSAEFAULT);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
memcpy(optval, &infow, size);
|
|
|
|
}
|
|
|
|
return ret ? 0 : SOCKET_ERROR;
|
|
|
|
}
|
2021-06-26 03:21:08 +02:00
|
|
|
|
|
|
|
case WS_SO_RCVBUF:
|
|
|
|
return server_getsockopt( s, IOCTL_AFD_WINE_GET_SO_RCVBUF, optval, optlen );
|
|
|
|
|
2006-12-04 09:46:10 +01:00
|
|
|
case WS_SO_RCVTIMEO:
|
2021-06-29 18:43:20 +02:00
|
|
|
return server_getsockopt( s, IOCTL_AFD_WINE_GET_SO_RCVTIMEO, optval, optlen );
|
|
|
|
|
2021-06-29 18:43:21 +02:00
|
|
|
case WS_SO_REUSEADDR:
|
|
|
|
return server_getsockopt( s, IOCTL_AFD_WINE_GET_SO_REUSEADDR, optval, optlen );
|
|
|
|
|
2021-06-30 06:25:42 +02:00
|
|
|
case WS_SO_SNDBUF:
|
|
|
|
return server_getsockopt( s, IOCTL_AFD_WINE_GET_SO_SNDBUF, optval, optlen );
|
|
|
|
|
2006-12-04 09:46:10 +01:00
|
|
|
case WS_SO_SNDTIMEO:
|
2021-06-30 06:25:43 +02:00
|
|
|
return server_getsockopt( s, IOCTL_AFD_WINE_GET_SO_SNDTIMEO, optval, optlen );
|
2004-09-07 22:47:03 +02:00
|
|
|
|
2013-09-18 22:36:25 +02:00
|
|
|
case WS_SO_TYPE:
|
|
|
|
{
|
2021-07-01 03:24:35 +02:00
|
|
|
WSAPROTOCOL_INFOW info;
|
|
|
|
int size;
|
|
|
|
|
2013-09-18 22:36:25 +02:00
|
|
|
if (!optlen || *optlen < sizeof(int) || !optval)
|
|
|
|
{
|
|
|
|
SetLastError(WSAEFAULT);
|
|
|
|
return SOCKET_ERROR;
|
|
|
|
}
|
|
|
|
|
2021-07-01 03:24:35 +02:00
|
|
|
if (!ws_protocol_info( s, TRUE, &info, &size ))
|
|
|
|
return -1;
|
2013-09-18 22:36:25 +02:00
|
|
|
|
2021-07-01 03:24:35 +02:00
|
|
|
*(int *)optval = info.iSocketType;
|
|
|
|
return 0;
|
2013-09-18 22:36:25 +02:00
|
|
|
}
|
2021-07-01 03:24:35 +02:00
|
|
|
|
2006-12-04 09:46:10 +01:00
|
|
|
default:
|
|
|
|
TRACE("Unknown SOL_SOCKET optname: 0x%08x\n", optname);
|
|
|
|
SetLastError(WSAENOPROTOOPT);
|
|
|
|
return SOCKET_ERROR;
|
|
|
|
} /* end switch(optname) */
|
|
|
|
}/* end case WS_SOL_SOCKET */
|
2013-06-17 21:56:52 +02:00
|
|
|
#ifdef HAS_IPX
|
2013-12-27 16:48:40 +01:00
|
|
|
case WS_NSPROTO_IPX:
|
2006-12-04 09:46:10 +01:00
|
|
|
{
|
|
|
|
struct WS_sockaddr_ipx addr;
|
|
|
|
IPX_ADDRESS_DATA *data;
|
|
|
|
int namelen;
|
|
|
|
switch(optname)
|
|
|
|
{
|
2015-01-04 19:57:47 +01:00
|
|
|
case WS_IPX_PTYPE:
|
2006-12-04 09:46:10 +01:00
|
|
|
if ((fd = get_sock_fd( s, 0, NULL )) == -1) return SOCKET_ERROR;
|
|
|
|
#ifdef SOL_IPX
|
2013-03-06 13:26:59 +01:00
|
|
|
if(getsockopt(fd, SOL_IPX, IPX_TYPE, optval, (socklen_t *)optlen) == -1)
|
2006-12-04 09:46:10 +01:00
|
|
|
{
|
2004-10-06 20:52:51 +02:00
|
|
|
ret = SOCKET_ERROR;
|
|
|
|
}
|
2006-12-04 09:46:10 +01:00
|
|
|
#else
|
|
|
|
{
|
|
|
|
struct ipx val;
|
|
|
|
socklen_t len=sizeof(struct ipx);
|
|
|
|
if(getsockopt(fd, 0, SO_DEFAULT_HEADERS, &val, &len) == -1 )
|
|
|
|
ret = SOCKET_ERROR;
|
|
|
|
else
|
|
|
|
*optval = (int)val.ipx_pt;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
TRACE("ptype: %d (fd: %d)\n", *(int*)optval, fd);
|
|
|
|
release_sock_fd( s, fd );
|
|
|
|
return ret;
|
|
|
|
|
2015-01-04 19:57:47 +01:00
|
|
|
case WS_IPX_ADDRESS:
|
2006-12-04 09:46:10 +01:00
|
|
|
/*
|
|
|
|
* On a Win2000 system with one network card there are usually
|
|
|
|
* three ipx devices one with a speed of 28.8kbps, 10Mbps and 100Mbps.
|
|
|
|
* Using this call you can then retrieve info about this all.
|
|
|
|
* In case of Linux it is a bit different. Usually you have
|
|
|
|
* only "one" device active and further it is not possible to
|
|
|
|
* query things like the linkspeed.
|
|
|
|
*/
|
|
|
|
FIXME("IPX_ADDRESS\n");
|
|
|
|
namelen = sizeof(struct WS_sockaddr_ipx);
|
|
|
|
memset(&addr, 0, sizeof(struct WS_sockaddr_ipx));
|
|
|
|
WS_getsockname(s, (struct WS_sockaddr*)&addr, &namelen);
|
|
|
|
|
|
|
|
data = (IPX_ADDRESS_DATA*)optval;
|
2008-07-12 21:37:39 +02:00
|
|
|
memcpy(data->nodenum,addr.sa_nodenum,sizeof(data->nodenum));
|
|
|
|
memcpy(data->netnum,addr.sa_netnum,sizeof(data->netnum));
|
2006-12-04 09:46:10 +01:00
|
|
|
data->adapternum = 0;
|
|
|
|
data->wan = FALSE; /* We are not on a wan for now .. */
|
|
|
|
data->status = FALSE; /* Since we are not on a wan, the wan link isn't up */
|
|
|
|
data->maxpkt = 1467; /* This value is the default one, at least on Win2k/WinXP */
|
|
|
|
data->linkspeed = 100000; /* Set the line speed in 100bit/s to 10 Mbit;
|
|
|
|
* note 1MB = 1000kB in this case */
|
|
|
|
return 0;
|
|
|
|
|
2015-01-04 19:57:47 +01:00
|
|
|
case WS_IPX_MAX_ADAPTER_NUM:
|
2006-12-04 09:46:10 +01:00
|
|
|
FIXME("IPX_MAX_ADAPTER_NUM\n");
|
|
|
|
*(int*)optval = 1; /* As noted under IPX_ADDRESS we have just one card. */
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
default:
|
|
|
|
FIXME("IPX optname:%x\n", optname);
|
|
|
|
return SOCKET_ERROR;
|
|
|
|
}/* end switch(optname) */
|
2013-12-27 16:48:40 +01:00
|
|
|
} /* end case WS_NSPROTO_IPX */
|
2006-12-04 09:46:10 +01:00
|
|
|
#endif
|
2009-08-12 18:15:33 +02:00
|
|
|
|
2013-06-17 21:56:52 +02:00
|
|
|
#ifdef HAS_IRDA
|
2014-03-25 16:49:12 +01:00
|
|
|
#define MAX_IRDA_DEVICES 10
|
|
|
|
|
2009-08-12 18:15:33 +02:00
|
|
|
case WS_SOL_IRLMP:
|
|
|
|
switch(optname)
|
|
|
|
{
|
|
|
|
case WS_IRLMP_ENUMDEVICES:
|
|
|
|
{
|
|
|
|
char buf[sizeof(struct irda_device_list) +
|
|
|
|
(MAX_IRDA_DEVICES - 1) * sizeof(struct irda_device_info)];
|
2012-04-22 19:05:05 +02:00
|
|
|
int res;
|
2009-08-12 18:15:33 +02:00
|
|
|
socklen_t len = sizeof(buf);
|
|
|
|
|
|
|
|
if ( (fd = get_sock_fd( s, 0, NULL )) == -1)
|
|
|
|
return SOCKET_ERROR;
|
|
|
|
res = getsockopt( fd, SOL_IRLMP, IRLMP_ENUMDEVICES, buf, &len );
|
2013-12-31 01:24:43 +01:00
|
|
|
release_sock_fd( s, fd );
|
2009-08-12 18:15:33 +02:00
|
|
|
if (res < 0)
|
|
|
|
{
|
|
|
|
SetLastError(wsaErrno());
|
|
|
|
return SOCKET_ERROR;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
struct irda_device_list *src = (struct irda_device_list *)buf;
|
|
|
|
DEVICELIST *dst = (DEVICELIST *)optval;
|
2013-03-07 23:22:31 +01:00
|
|
|
INT needed = sizeof(DEVICELIST);
|
|
|
|
unsigned int i;
|
2009-08-12 18:15:33 +02:00
|
|
|
|
|
|
|
if (src->len > 0)
|
|
|
|
needed += (src->len - 1) * sizeof(IRDA_DEVICE_INFO);
|
|
|
|
if (*optlen < needed)
|
|
|
|
{
|
|
|
|
SetLastError(WSAEFAULT);
|
|
|
|
return SOCKET_ERROR;
|
|
|
|
}
|
|
|
|
*optlen = needed;
|
|
|
|
TRACE("IRLMP_ENUMDEVICES: %d devices found:\n", src->len);
|
|
|
|
dst->numDevice = src->len;
|
|
|
|
for (i = 0; i < src->len; i++)
|
|
|
|
{
|
|
|
|
TRACE("saddr = %08x, daddr = %08x, info = %s, hints = %02x%02x\n",
|
|
|
|
src->dev[i].saddr, src->dev[i].daddr,
|
|
|
|
src->dev[i].info, src->dev[i].hints[0],
|
|
|
|
src->dev[i].hints[1]);
|
|
|
|
memcpy( dst->Device[i].irdaDeviceID,
|
|
|
|
&src->dev[i].daddr,
|
|
|
|
sizeof(dst->Device[i].irdaDeviceID) ) ;
|
|
|
|
memcpy( dst->Device[i].irdaDeviceName,
|
2011-11-04 00:03:22 +01:00
|
|
|
src->dev[i].info,
|
2009-08-12 18:15:33 +02:00
|
|
|
sizeof(dst->Device[i].irdaDeviceName) ) ;
|
|
|
|
memcpy( &dst->Device[i].irdaDeviceHints1,
|
|
|
|
&src->dev[i].hints[0],
|
|
|
|
sizeof(dst->Device[i].irdaDeviceHints1) ) ;
|
|
|
|
memcpy( &dst->Device[i].irdaDeviceHints2,
|
|
|
|
&src->dev[i].hints[1],
|
|
|
|
sizeof(dst->Device[i].irdaDeviceHints2) ) ;
|
|
|
|
dst->Device[i].irdaCharSet = src->dev[i].charset;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
FIXME("IrDA optname:0x%x\n", optname);
|
|
|
|
return SOCKET_ERROR;
|
|
|
|
}
|
|
|
|
break; /* case WS_SOL_IRLMP */
|
2014-03-25 16:49:12 +01:00
|
|
|
#undef MAX_IRDA_DEVICES
|
2009-08-12 18:15:33 +02:00
|
|
|
#endif
|
|
|
|
|
2006-12-04 09:46:10 +01:00
|
|
|
/* Levels WS_IPPROTO_TCP and WS_IPPROTO_IP convert directly */
|
|
|
|
case WS_IPPROTO_TCP:
|
|
|
|
switch(optname)
|
|
|
|
{
|
|
|
|
case WS_TCP_NODELAY:
|
|
|
|
if ( (fd = get_sock_fd( s, 0, NULL )) == -1)
|
|
|
|
return SOCKET_ERROR;
|
|
|
|
convert_sockopt(&level, &optname);
|
2013-03-06 13:26:59 +01:00
|
|
|
if (getsockopt(fd, level, optname, optval, (socklen_t *)optlen) != 0 )
|
2006-12-04 09:46:10 +01:00
|
|
|
{
|
2015-04-14 07:02:51 +02:00
|
|
|
SetLastError(wsaErrno());
|
2004-10-06 20:52:51 +02:00
|
|
|
ret = SOCKET_ERROR;
|
|
|
|
}
|
2006-12-04 09:46:10 +01:00
|
|
|
release_sock_fd( s, fd );
|
|
|
|
return ret;
|
2004-10-06 20:52:51 +02:00
|
|
|
}
|
2006-12-04 09:46:10 +01:00
|
|
|
FIXME("Unknown IPPROTO_TCP optname 0x%08x\n", optname);
|
|
|
|
return SOCKET_ERROR;
|
|
|
|
|
|
|
|
case WS_IPPROTO_IP:
|
|
|
|
switch(optname)
|
|
|
|
{
|
2021-07-02 00:10:27 +02:00
|
|
|
case WS_IP_DONTFRAGMENT:
|
|
|
|
return server_getsockopt( s, IOCTL_AFD_WINE_GET_IP_DONTFRAGMENT, optval, optlen );
|
|
|
|
|
2006-12-04 09:46:10 +01:00
|
|
|
case WS_IP_HDRINCL:
|
2021-07-08 03:16:38 +02:00
|
|
|
return server_getsockopt( s, IOCTL_AFD_WINE_GET_IP_HDRINCL, optval, optlen );
|
|
|
|
|
2006-12-04 09:46:10 +01:00
|
|
|
case WS_IP_MULTICAST_IF:
|
2021-07-08 03:16:40 +02:00
|
|
|
return server_getsockopt( s, IOCTL_AFD_WINE_GET_IP_MULTICAST_IF, optval, optlen );
|
|
|
|
|
2006-12-04 09:46:10 +01:00
|
|
|
case WS_IP_MULTICAST_LOOP:
|
2021-07-08 03:16:42 +02:00
|
|
|
return server_getsockopt( s, IOCTL_AFD_WINE_GET_IP_MULTICAST_LOOP, optval, optlen );
|
|
|
|
|
2006-12-04 09:46:10 +01:00
|
|
|
case WS_IP_MULTICAST_TTL:
|
|
|
|
case WS_IP_OPTIONS:
|
2019-08-01 06:11:28 +02:00
|
|
|
#if defined(IP_PKTINFO) || defined(IP_RECVDSTADDR)
|
2010-12-06 01:08:54 +01:00
|
|
|
case WS_IP_PKTINFO:
|
|
|
|
#endif
|
2006-12-04 09:46:10 +01:00
|
|
|
case WS_IP_TOS:
|
|
|
|
case WS_IP_TTL:
|
2012-04-09 21:06:08 +02:00
|
|
|
#ifdef IP_UNICAST_IF
|
|
|
|
case WS_IP_UNICAST_IF:
|
|
|
|
#endif
|
2006-12-04 09:46:10 +01:00
|
|
|
if ( (fd = get_sock_fd( s, 0, NULL )) == -1)
|
|
|
|
return SOCKET_ERROR;
|
|
|
|
convert_sockopt(&level, &optname);
|
2013-03-06 13:26:59 +01:00
|
|
|
if (getsockopt(fd, level, optname, optval, (socklen_t *)optlen) != 0 )
|
2006-12-04 09:46:10 +01:00
|
|
|
{
|
2015-04-14 07:02:51 +02:00
|
|
|
SetLastError(wsaErrno());
|
2006-12-04 09:46:10 +01:00
|
|
|
ret = SOCKET_ERROR;
|
|
|
|
}
|
|
|
|
release_sock_fd( s, fd );
|
|
|
|
return ret;
|
2021-07-01 03:24:38 +02:00
|
|
|
|
|
|
|
default:
|
|
|
|
FIXME( "unrecognized IP option %u\n", optname );
|
|
|
|
/* fall through */
|
|
|
|
|
|
|
|
case WS_IP_ADD_MEMBERSHIP:
|
|
|
|
case WS_IP_DROP_MEMBERSHIP:
|
|
|
|
SetLastError( WSAENOPROTOOPT );
|
|
|
|
return -1;
|
2006-12-04 09:46:10 +01:00
|
|
|
}
|
Release 961201
Sat Nov 30 19:21:17 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [configure]
Re-generated with autoconf 2.11. Let me know if you have
problems.
* [controls/listbox.c] [controls/oldlbox.c]
Listboxes rewritten from scratch. Moved old code still used by
comboboxes to oldlbox.c
* [misc/registry.c]
Use temporary file when saving registry.
* [windows/dialog.c]
Implemented Win32 version of DlgDirList() and DlgDirListComboBox().
* [windows/winproc.c]
Added translation for listbox Win32 messages.
Sat Nov 30 21:00:00 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [controls/widgets.c] [controls/button.c]
Fixed some incompatibilities with CTL3D DLL.
* [windows/dialog.c]
Made dialog windows fit into the desktop.
* [misc/winsock.c] [misc/winsock_async.c]
New Winsock engine.
* [windows/message.c]
GetMessage() fixes.
* [windows/queue.c] [windows/hook.c] [windows/win.c]
SetMessageQueue() fixes.
Fri Nov 29 10:25:12 1996 Slaven Rezic <eserte@cs.tu-berlin.de>
* [objects/text.c]
DrawText16(): Fixed return value.
Tue Nov 26 14:47:09 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/profile.c] [*/*]
Added Win32 profile functions, updated to new naming standard.
* [objects/font.c] [if1632/thunk.c] [include/windows.h]
Added EnumFonts32*, EnumFontFamiliesEx*, changed prototypes and
structures.
* [misc/ole2nls.c] [if1632/thunk.c]
Added EnumSystemLocales() (winhelp.exe).
* [misc/registry.c]
Added Windows 3.1 registry loader supplied by Tor Sjxwall, tor@sn.no
* [win32/file.c]
Partially fixed CreateFileMapping(), added UnmapViewOfFile().
Sat Nov 23 23:36:05 1996 Ronan Waide <waider@waider.ie>
* [misc/shell.c]
Fixed some FIXMEs relating to ShellExec() and FindExecutable().
* [misc/main.c]
Implemented a few more of the SystemParametersInfo() cases.
Tue Nov 19 01:24:34 1996 Philippe De Muyter <phdm@info.ucl.ac.be>
* [include/keyboard.h]
New file, new macro WINE_VKEY_MAPPINGS (using code taken from event.c).
* [include/windows.h]
New [VK_A, VK_Z] and [VK_0, VK9] macros.
* [misc/keyboard.c]
Fixes in KeyTable and ToAscii.
* [objects/font.c]
FONT_init : Give default value for MSWIN "system" font.
FONT_MatchFont : Do not try every size of a font family if the
family does not exist.
* [windows/event.c]
lastEventChar hack removed.
KeyStateTable replaced by InputKeyStateTable (maintained in event.c)
and QueueKeyStateTable (maintained in message.c).
EVENT_key : Corrections to the extended bit setting.
* [windows/message.c] [windows/keyboard.c]
Implementation of a new QueueKeyStateTable : table of key states
valid when messages are retrieved by GetMessage or PeekMessage,
and valid for TranslateMessage.
TranslateMessage : Convert WM*KEY messages using QueueKeyStateTable
and ToAscii.
Mon Nov 18 16:59:01 1996 Robert Pouliot <krynos@clic.net>
* [graphics/Makefile.in] [graphics/wing.c]
[if1632/wing.spec]
Some functions for WinG support, mostly empty stubs.
* [misc/crtdll.c] [if1632/crtdll.spec]
Many functions added to CRTDLL, mostly calls to Unix C library.
1996-12-01 18:17:47 +01:00
|
|
|
|
2009-09-01 19:37:51 +02:00
|
|
|
case WS_IPPROTO_IPV6:
|
2010-04-01 23:50:54 +02:00
|
|
|
switch(optname)
|
|
|
|
{
|
|
|
|
case WS_IPV6_MULTICAST_IF:
|
|
|
|
case WS_IPV6_MULTICAST_HOPS:
|
|
|
|
case WS_IPV6_MULTICAST_LOOP:
|
|
|
|
case WS_IPV6_UNICAST_HOPS:
|
|
|
|
case WS_IPV6_V6ONLY:
|
2012-04-09 21:06:30 +02:00
|
|
|
#ifdef IPV6_UNICAST_IF
|
|
|
|
case WS_IPV6_UNICAST_IF:
|
|
|
|
#endif
|
2010-04-01 23:50:54 +02:00
|
|
|
if ( (fd = get_sock_fd( s, 0, NULL )) == -1)
|
|
|
|
return SOCKET_ERROR;
|
|
|
|
convert_sockopt(&level, &optname);
|
2013-03-06 13:26:59 +01:00
|
|
|
if (getsockopt(fd, level, optname, optval, (socklen_t *)optlen) != 0 )
|
2010-04-01 23:50:54 +02:00
|
|
|
{
|
2015-04-14 07:02:51 +02:00
|
|
|
SetLastError(wsaErrno());
|
2010-04-01 23:50:54 +02:00
|
|
|
ret = SOCKET_ERROR;
|
|
|
|
}
|
|
|
|
release_sock_fd( s, fd );
|
|
|
|
return ret;
|
|
|
|
case WS_IPV6_DONTFRAG:
|
2016-12-07 07:27:26 +01:00
|
|
|
return get_dont_fragment(s, IPPROTO_IPV6, (BOOL *)optval) ? 0 : SOCKET_ERROR;
|
2021-07-01 03:24:38 +02:00
|
|
|
|
|
|
|
default:
|
|
|
|
FIXME( "unrecognized IPv6 option %u\n", optname );
|
|
|
|
/* fall through */
|
|
|
|
|
|
|
|
case WS_IPV6_ADD_MEMBERSHIP:
|
|
|
|
case WS_IPV6_DROP_MEMBERSHIP:
|
|
|
|
SetLastError( WSAENOPROTOOPT );
|
|
|
|
return -1;
|
2010-04-01 23:50:54 +02:00
|
|
|
}
|
2009-09-01 19:37:51 +02:00
|
|
|
|
2006-12-04 09:46:10 +01:00
|
|
|
default:
|
2009-08-24 23:39:18 +02:00
|
|
|
WARN("Unknown level: 0x%08x\n", level);
|
|
|
|
SetLastError(WSAEINVAL);
|
2006-12-04 09:46:10 +01:00
|
|
|
return SOCKET_ERROR;
|
|
|
|
} /* end switch(level) */
|
|
|
|
}
|
2001-11-14 22:26:23 +01:00
|
|
|
|
Release 961201
Sat Nov 30 19:21:17 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [configure]
Re-generated with autoconf 2.11. Let me know if you have
problems.
* [controls/listbox.c] [controls/oldlbox.c]
Listboxes rewritten from scratch. Moved old code still used by
comboboxes to oldlbox.c
* [misc/registry.c]
Use temporary file when saving registry.
* [windows/dialog.c]
Implemented Win32 version of DlgDirList() and DlgDirListComboBox().
* [windows/winproc.c]
Added translation for listbox Win32 messages.
Sat Nov 30 21:00:00 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [controls/widgets.c] [controls/button.c]
Fixed some incompatibilities with CTL3D DLL.
* [windows/dialog.c]
Made dialog windows fit into the desktop.
* [misc/winsock.c] [misc/winsock_async.c]
New Winsock engine.
* [windows/message.c]
GetMessage() fixes.
* [windows/queue.c] [windows/hook.c] [windows/win.c]
SetMessageQueue() fixes.
Fri Nov 29 10:25:12 1996 Slaven Rezic <eserte@cs.tu-berlin.de>
* [objects/text.c]
DrawText16(): Fixed return value.
Tue Nov 26 14:47:09 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/profile.c] [*/*]
Added Win32 profile functions, updated to new naming standard.
* [objects/font.c] [if1632/thunk.c] [include/windows.h]
Added EnumFonts32*, EnumFontFamiliesEx*, changed prototypes and
structures.
* [misc/ole2nls.c] [if1632/thunk.c]
Added EnumSystemLocales() (winhelp.exe).
* [misc/registry.c]
Added Windows 3.1 registry loader supplied by Tor Sjxwall, tor@sn.no
* [win32/file.c]
Partially fixed CreateFileMapping(), added UnmapViewOfFile().
Sat Nov 23 23:36:05 1996 Ronan Waide <waider@waider.ie>
* [misc/shell.c]
Fixed some FIXMEs relating to ShellExec() and FindExecutable().
* [misc/main.c]
Implemented a few more of the SystemParametersInfo() cases.
Tue Nov 19 01:24:34 1996 Philippe De Muyter <phdm@info.ucl.ac.be>
* [include/keyboard.h]
New file, new macro WINE_VKEY_MAPPINGS (using code taken from event.c).
* [include/windows.h]
New [VK_A, VK_Z] and [VK_0, VK9] macros.
* [misc/keyboard.c]
Fixes in KeyTable and ToAscii.
* [objects/font.c]
FONT_init : Give default value for MSWIN "system" font.
FONT_MatchFont : Do not try every size of a font family if the
family does not exist.
* [windows/event.c]
lastEventChar hack removed.
KeyStateTable replaced by InputKeyStateTable (maintained in event.c)
and QueueKeyStateTable (maintained in message.c).
EVENT_key : Corrections to the extended bit setting.
* [windows/message.c] [windows/keyboard.c]
Implementation of a new QueueKeyStateTable : table of key states
valid when messages are retrieved by GetMessage or PeekMessage,
and valid for TranslateMessage.
TranslateMessage : Convert WM*KEY messages using QueueKeyStateTable
and ToAscii.
Mon Nov 18 16:59:01 1996 Robert Pouliot <krynos@clic.net>
* [graphics/Makefile.in] [graphics/wing.c]
[if1632/wing.spec]
Some functions for WinG support, mostly empty stubs.
* [misc/crtdll.c] [if1632/crtdll.spec]
Many functions added to CRTDLL, mostly calls to Unix C library.
1996-12-01 18:17:47 +01:00
|
|
|
|
2016-09-06 20:30:35 +02:00
|
|
|
static const char *debugstr_wsaioctl(DWORD code)
|
2010-09-24 23:20:14 +02:00
|
|
|
{
|
2016-09-06 20:30:35 +02:00
|
|
|
const char *name = NULL, *buf_type, *family;
|
2011-01-08 16:47:59 +01:00
|
|
|
|
2016-09-06 20:30:35 +02:00
|
|
|
#define IOCTL_NAME(x) case x: name = #x; break
|
|
|
|
switch (code)
|
|
|
|
{
|
|
|
|
IOCTL_NAME(WS_FIONBIO);
|
|
|
|
IOCTL_NAME(WS_FIONREAD);
|
|
|
|
IOCTL_NAME(WS_SIOCATMARK);
|
|
|
|
/* IOCTL_NAME(WS_SIO_ACQUIRE_PORT_RESERVATION); */
|
|
|
|
IOCTL_NAME(WS_SIO_ADDRESS_LIST_CHANGE);
|
|
|
|
IOCTL_NAME(WS_SIO_ADDRESS_LIST_QUERY);
|
|
|
|
IOCTL_NAME(WS_SIO_ASSOCIATE_HANDLE);
|
|
|
|
/* IOCTL_NAME(WS_SIO_ASSOCIATE_PORT_RESERVATION);
|
|
|
|
IOCTL_NAME(WS_SIO_BASE_HANDLE);
|
|
|
|
IOCTL_NAME(WS_SIO_BSP_HANDLE);
|
|
|
|
IOCTL_NAME(WS_SIO_BSP_HANDLE_SELECT);
|
|
|
|
IOCTL_NAME(WS_SIO_BSP_HANDLE_POLL);
|
|
|
|
IOCTL_NAME(WS_SIO_CHK_QOS); */
|
|
|
|
IOCTL_NAME(WS_SIO_ENABLE_CIRCULAR_QUEUEING);
|
|
|
|
IOCTL_NAME(WS_SIO_FIND_ROUTE);
|
|
|
|
IOCTL_NAME(WS_SIO_FLUSH);
|
|
|
|
IOCTL_NAME(WS_SIO_GET_BROADCAST_ADDRESS);
|
|
|
|
IOCTL_NAME(WS_SIO_GET_EXTENSION_FUNCTION_POINTER);
|
|
|
|
IOCTL_NAME(WS_SIO_GET_GROUP_QOS);
|
|
|
|
IOCTL_NAME(WS_SIO_GET_INTERFACE_LIST);
|
|
|
|
/* IOCTL_NAME(WS_SIO_GET_INTERFACE_LIST_EX); */
|
|
|
|
IOCTL_NAME(WS_SIO_GET_QOS);
|
2020-07-14 01:03:47 +02:00
|
|
|
IOCTL_NAME(WS_SIO_IDEAL_SEND_BACKLOG_CHANGE);
|
|
|
|
IOCTL_NAME(WS_SIO_IDEAL_SEND_BACKLOG_QUERY);
|
2016-09-06 20:30:35 +02:00
|
|
|
IOCTL_NAME(WS_SIO_KEEPALIVE_VALS);
|
|
|
|
IOCTL_NAME(WS_SIO_MULTIPOINT_LOOPBACK);
|
|
|
|
IOCTL_NAME(WS_SIO_MULTICAST_SCOPE);
|
|
|
|
/* IOCTL_NAME(WS_SIO_QUERY_RSS_SCALABILITY_INFO);
|
|
|
|
IOCTL_NAME(WS_SIO_QUERY_WFP_ALE_ENDPOINT_HANDLE); */
|
|
|
|
IOCTL_NAME(WS_SIO_RCVALL);
|
|
|
|
IOCTL_NAME(WS_SIO_RCVALL_IGMPMCAST);
|
|
|
|
IOCTL_NAME(WS_SIO_RCVALL_MCAST);
|
|
|
|
/* IOCTL_NAME(WS_SIO_RELEASE_PORT_RESERVATION); */
|
|
|
|
IOCTL_NAME(WS_SIO_ROUTING_INTERFACE_CHANGE);
|
|
|
|
IOCTL_NAME(WS_SIO_ROUTING_INTERFACE_QUERY);
|
|
|
|
IOCTL_NAME(WS_SIO_SET_COMPATIBILITY_MODE);
|
|
|
|
IOCTL_NAME(WS_SIO_SET_GROUP_QOS);
|
|
|
|
IOCTL_NAME(WS_SIO_SET_QOS);
|
|
|
|
IOCTL_NAME(WS_SIO_TRANSLATE_HANDLE);
|
|
|
|
IOCTL_NAME(WS_SIO_UDP_CONNRESET);
|
|
|
|
}
|
|
|
|
#undef IOCTL_NAME
|
|
|
|
|
|
|
|
if (name)
|
|
|
|
return name + 3;
|
|
|
|
|
|
|
|
/* If this is not a known code split its bits */
|
|
|
|
switch(code & 0x18000000)
|
2010-09-24 23:20:14 +02:00
|
|
|
{
|
2011-01-08 16:47:59 +01:00
|
|
|
case WS_IOC_WS2:
|
|
|
|
family = "IOC_WS2";
|
|
|
|
break;
|
|
|
|
case WS_IOC_PROTOCOL:
|
|
|
|
family = "IOC_PROTOCOL";
|
|
|
|
break;
|
|
|
|
case WS_IOC_VENDOR:
|
|
|
|
family = "IOC_VENDOR";
|
|
|
|
break;
|
|
|
|
default: /* WS_IOC_UNIX */
|
2010-09-24 23:20:14 +02:00
|
|
|
{
|
2016-09-06 20:30:35 +02:00
|
|
|
BYTE size = (code >> 16) & WS_IOCPARM_MASK;
|
|
|
|
char x = (code & 0xff00) >> 8;
|
|
|
|
BYTE y = code & 0xff;
|
2010-09-24 23:20:14 +02:00
|
|
|
char args[14];
|
|
|
|
|
2016-09-06 20:30:35 +02:00
|
|
|
switch (code & (WS_IOC_VOID|WS_IOC_INOUT))
|
2010-09-24 23:20:14 +02:00
|
|
|
{
|
|
|
|
case WS_IOC_VOID:
|
|
|
|
buf_type = "_IO";
|
|
|
|
sprintf(args, "%d, %d", x, y);
|
|
|
|
break;
|
|
|
|
case WS_IOC_IN:
|
|
|
|
buf_type = "_IOW";
|
|
|
|
sprintf(args, "'%c', %d, %d", x, y, size);
|
|
|
|
break;
|
|
|
|
case WS_IOC_OUT:
|
|
|
|
buf_type = "_IOR";
|
|
|
|
sprintf(args, "'%c', %d, %d", x, y, size);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
buf_type = "?";
|
|
|
|
sprintf(args, "'%c', %d, %d", x, y, size);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return wine_dbg_sprintf("%s(%s)", buf_type, args);
|
|
|
|
}
|
2011-01-08 16:47:59 +01:00
|
|
|
}
|
2010-09-24 23:20:14 +02:00
|
|
|
|
2011-01-08 16:47:59 +01:00
|
|
|
/* We are different from WS_IOC_UNIX. */
|
2016-09-06 20:30:35 +02:00
|
|
|
switch (code & (WS_IOC_VOID|WS_IOC_INOUT))
|
2011-01-08 16:47:59 +01:00
|
|
|
{
|
|
|
|
case WS_IOC_VOID:
|
|
|
|
buf_type = "_WSAIO";
|
2010-09-24 23:20:14 +02:00
|
|
|
break;
|
2011-01-08 16:47:59 +01:00
|
|
|
case WS_IOC_INOUT:
|
|
|
|
buf_type = "_WSAIORW";
|
2010-09-24 23:20:14 +02:00
|
|
|
break;
|
2011-01-08 16:47:59 +01:00
|
|
|
case WS_IOC_IN:
|
|
|
|
buf_type = "_WSAIOW";
|
|
|
|
break;
|
|
|
|
case WS_IOC_OUT:
|
|
|
|
buf_type = "_WSAIOR";
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
buf_type = "?";
|
2010-09-24 23:20:14 +02:00
|
|
|
break;
|
|
|
|
}
|
2011-01-08 16:47:59 +01:00
|
|
|
|
|
|
|
return wine_dbg_sprintf("%s(%s, %d)", buf_type, family,
|
2016-09-06 20:30:35 +02:00
|
|
|
(USHORT)(code & 0xffff));
|
2010-09-24 23:20:14 +02:00
|
|
|
}
|
|
|
|
|
2014-03-18 19:45:17 +01:00
|
|
|
/* do an ioctl call through the server */
|
|
|
|
static DWORD server_ioctl_sock( SOCKET s, DWORD code, LPVOID in_buff, DWORD in_size,
|
|
|
|
LPVOID out_buff, DWORD out_size, LPDWORD ret_size,
|
|
|
|
LPWSAOVERLAPPED overlapped,
|
|
|
|
LPWSAOVERLAPPED_COMPLETION_ROUTINE completion )
|
|
|
|
{
|
2021-06-01 05:16:36 +02:00
|
|
|
IO_STATUS_BLOCK iosb, *piosb = &iosb;
|
2014-03-18 19:45:17 +01:00
|
|
|
HANDLE handle = SOCKET2HANDLE( s );
|
2021-06-01 05:16:36 +02:00
|
|
|
PIO_APC_ROUTINE apc = NULL;
|
|
|
|
HANDLE event = NULL;
|
2016-10-12 17:11:34 +02:00
|
|
|
void *cvalue = NULL;
|
2014-03-18 19:45:17 +01:00
|
|
|
NTSTATUS status;
|
|
|
|
|
2021-06-01 05:16:36 +02:00
|
|
|
if (overlapped)
|
|
|
|
{
|
|
|
|
piosb = (IO_STATUS_BLOCK *)overlapped;
|
|
|
|
if (!((ULONG_PTR)overlapped->hEvent & 1)) cvalue = overlapped;
|
|
|
|
event = overlapped->hEvent;
|
|
|
|
}
|
2021-06-04 23:24:19 +02:00
|
|
|
else
|
|
|
|
{
|
|
|
|
if (!(event = get_sync_event())) return GetLastError();
|
|
|
|
}
|
2021-06-01 05:16:36 +02:00
|
|
|
|
2016-10-12 17:11:34 +02:00
|
|
|
if (completion)
|
|
|
|
{
|
2021-06-01 05:16:36 +02:00
|
|
|
event = NULL;
|
|
|
|
cvalue = completion;
|
|
|
|
apc = socket_apc;
|
2016-10-12 17:11:34 +02:00
|
|
|
}
|
2014-03-18 19:45:17 +01:00
|
|
|
|
2021-06-01 05:16:36 +02:00
|
|
|
status = NtDeviceIoControlFile( handle, event, apc, cvalue, piosb, code,
|
2014-03-18 19:45:17 +01:00
|
|
|
in_buff, in_size, out_buff, out_size );
|
2021-06-04 23:24:19 +02:00
|
|
|
if (status == STATUS_PENDING && !overlapped)
|
|
|
|
{
|
|
|
|
if (WaitForSingleObject( event, INFINITE ) == WAIT_FAILED)
|
|
|
|
return -1;
|
|
|
|
status = piosb->u.Status;
|
|
|
|
}
|
2014-03-18 19:45:17 +01:00
|
|
|
if (status == STATUS_NOT_SUPPORTED)
|
|
|
|
{
|
|
|
|
FIXME("Unsupported ioctl %x (device=%x access=%x func=%x method=%x)\n",
|
|
|
|
code, code >> 16, (code >> 14) & 3, (code >> 2) & 0xfff, code & 3);
|
|
|
|
}
|
|
|
|
else if (status == STATUS_SUCCESS)
|
2021-06-01 05:16:36 +02:00
|
|
|
*ret_size = piosb->Information;
|
2014-03-18 19:45:17 +01:00
|
|
|
|
|
|
|
return NtStatusToWSAError( status );
|
|
|
|
}
|
|
|
|
|
2021-01-18 12:33:00 +01:00
|
|
|
|
2000-07-23 21:28:24 +02:00
|
|
|
/**********************************************************************
|
2001-06-21 01:03:14 +02:00
|
|
|
* WSAIoctl (WS2_32.50)
|
2000-07-23 21:28:24 +02:00
|
|
|
*
|
|
|
|
*/
|
2011-04-19 11:34:42 +02:00
|
|
|
INT WINAPI WSAIoctl(SOCKET s, DWORD code, LPVOID in_buff, DWORD in_size, LPVOID out_buff,
|
|
|
|
DWORD out_size, LPDWORD ret_size, LPWSAOVERLAPPED overlapped,
|
|
|
|
LPWSAOVERLAPPED_COMPLETION_ROUTINE completion )
|
|
|
|
{
|
2014-10-08 00:27:19 +02:00
|
|
|
TRACE("%04lx, %s, %p, %d, %p, %d, %p, %p, %p\n",
|
2014-03-06 14:57:13 +01:00
|
|
|
s, debugstr_wsaioctl(code), in_buff, in_size, out_buff, out_size, ret_size, overlapped, completion);
|
2011-04-19 11:34:42 +02:00
|
|
|
|
2021-06-01 05:16:35 +02:00
|
|
|
if (!ret_size)
|
|
|
|
{
|
|
|
|
SetLastError( WSAEFAULT );
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2011-04-19 11:34:42 +02:00
|
|
|
switch (code)
|
|
|
|
{
|
|
|
|
case WS_FIONBIO:
|
2021-06-02 17:30:16 +02:00
|
|
|
{
|
|
|
|
DWORD ret;
|
|
|
|
|
|
|
|
if (IS_INTRESOURCE( in_buff ))
|
2011-04-19 11:57:37 +02:00
|
|
|
{
|
2021-06-02 17:30:16 +02:00
|
|
|
SetLastError( WSAEFAULT );
|
|
|
|
return -1;
|
2011-04-19 11:57:37 +02:00
|
|
|
}
|
2021-06-02 17:30:16 +02:00
|
|
|
|
2021-06-08 02:53:08 +02:00
|
|
|
/* Explicitly ignore the output buffer; WeChat tries to pass an address
|
|
|
|
* without write access. */
|
2021-06-02 17:30:16 +02:00
|
|
|
ret = server_ioctl_sock( s, IOCTL_AFD_WINE_FIONBIO, in_buff, in_size,
|
2021-06-08 02:53:08 +02:00
|
|
|
NULL, 0, ret_size, overlapped, completion );
|
2021-06-02 17:30:16 +02:00
|
|
|
SetLastError( ret );
|
|
|
|
return ret ? -1 : 0;
|
|
|
|
}
|
2006-10-03 11:46:11 +02:00
|
|
|
|
2011-04-19 11:57:37 +02:00
|
|
|
case WS_FIONREAD:
|
2011-09-13 14:07:00 +02:00
|
|
|
{
|
2021-06-03 00:04:00 +02:00
|
|
|
DWORD ret;
|
2018-02-25 07:01:05 +01:00
|
|
|
|
2021-06-03 00:04:00 +02:00
|
|
|
ret = server_ioctl_sock( s, IOCTL_AFD_WINE_FIONREAD, in_buff, in_size,
|
|
|
|
out_buff, out_size, ret_size, overlapped, completion );
|
|
|
|
SetLastError( ret );
|
|
|
|
if (!ret) *ret_size = sizeof(WS_u_long);
|
|
|
|
return ret ? -1 : 0;
|
2011-09-13 14:07:00 +02:00
|
|
|
}
|
|
|
|
|
2011-04-19 11:57:37 +02:00
|
|
|
case WS_SIOCATMARK:
|
|
|
|
{
|
2021-06-03 00:04:02 +02:00
|
|
|
DWORD ret;
|
2011-11-20 02:20:30 +01:00
|
|
|
|
2021-06-03 00:04:02 +02:00
|
|
|
ret = server_ioctl_sock( s, IOCTL_AFD_WINE_SIOCATMARK, in_buff, in_size,
|
|
|
|
out_buff, out_size, ret_size, overlapped, completion );
|
|
|
|
SetLastError( ret );
|
|
|
|
if (!ret) *ret_size = sizeof(WS_u_long);
|
|
|
|
return ret ? -1 : 0;
|
2011-04-19 11:57:37 +02:00
|
|
|
}
|
|
|
|
|
2021-06-08 02:53:10 +02:00
|
|
|
case WS_SIO_GET_INTERFACE_LIST:
|
|
|
|
{
|
|
|
|
DWORD ret;
|
2003-08-30 02:16:19 +02:00
|
|
|
|
2021-06-08 02:53:10 +02:00
|
|
|
ret = server_ioctl_sock( s, IOCTL_AFD_WINE_GET_INTERFACE_LIST, in_buff, in_size,
|
|
|
|
out_buff, out_size, ret_size, overlapped, completion );
|
|
|
|
SetLastError( ret );
|
|
|
|
if (ret && ret != ERROR_IO_PENDING) *ret_size = 0;
|
|
|
|
return ret ? -1 : 0;
|
|
|
|
}
|
2003-12-02 05:19:56 +01:00
|
|
|
|
2021-06-04 23:24:17 +02:00
|
|
|
case WS_SIO_ADDRESS_LIST_QUERY:
|
|
|
|
{
|
2021-06-10 19:36:38 +02:00
|
|
|
DWORD size, total;
|
2006-12-18 19:37:52 +01:00
|
|
|
|
|
|
|
TRACE("-> SIO_ADDRESS_LIST_QUERY request\n");
|
|
|
|
|
2014-10-03 09:19:22 +02:00
|
|
|
if (out_size && out_size < FIELD_OFFSET(SOCKET_ADDRESS_LIST, Address[0]))
|
|
|
|
{
|
|
|
|
*ret_size = 0;
|
2015-01-10 02:49:46 +01:00
|
|
|
SetLastError(WSAEINVAL);
|
2014-10-03 09:19:22 +02:00
|
|
|
return SOCKET_ERROR;
|
|
|
|
}
|
|
|
|
|
2006-12-18 19:37:52 +01:00
|
|
|
if (GetAdaptersInfo(NULL, &size) == ERROR_BUFFER_OVERFLOW)
|
|
|
|
{
|
|
|
|
IP_ADAPTER_INFO *p, *table = HeapAlloc(GetProcessHeap(), 0, size);
|
2021-06-04 23:24:17 +02:00
|
|
|
NTSTATUS status = STATUS_SUCCESS;
|
2014-10-07 08:41:12 +02:00
|
|
|
SOCKET_ADDRESS_LIST *sa_list;
|
|
|
|
SOCKADDR_IN *sockaddr;
|
|
|
|
SOCKET_ADDRESS *sa;
|
|
|
|
unsigned int i;
|
2021-06-04 23:24:17 +02:00
|
|
|
DWORD ret = 0;
|
2011-04-19 12:26:50 +02:00
|
|
|
DWORD num;
|
2006-12-18 19:37:52 +01:00
|
|
|
|
|
|
|
if (!table || GetAdaptersInfo(table, &size))
|
|
|
|
{
|
|
|
|
HeapFree(GetProcessHeap(), 0, table);
|
2021-06-04 23:24:17 +02:00
|
|
|
SetLastError( WSAEINVAL );
|
|
|
|
return -1;
|
2006-12-18 19:37:52 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
for (p = table, num = 0; p; p = p->Next)
|
|
|
|
if (p->IpAddressList.IpAddress.String[0]) num++;
|
|
|
|
|
2014-10-07 08:41:13 +02:00
|
|
|
total = FIELD_OFFSET(SOCKET_ADDRESS_LIST, Address[num]) + num * sizeof(*sockaddr);
|
2014-10-07 08:41:12 +02:00
|
|
|
if (total > out_size || !out_buff)
|
2006-12-18 19:37:52 +01:00
|
|
|
{
|
2014-10-03 09:19:21 +02:00
|
|
|
*ret_size = total;
|
2006-12-18 19:37:52 +01:00
|
|
|
HeapFree(GetProcessHeap(), 0, table);
|
2021-06-04 23:24:17 +02:00
|
|
|
SetLastError( WSAEFAULT );
|
|
|
|
return -1;
|
2006-12-18 19:37:52 +01:00
|
|
|
}
|
|
|
|
|
2014-10-07 08:41:12 +02:00
|
|
|
sa_list = out_buff;
|
|
|
|
sa = sa_list->Address;
|
2014-10-07 08:41:13 +02:00
|
|
|
sockaddr = (SOCKADDR_IN *)&sa[num];
|
2014-10-07 08:41:12 +02:00
|
|
|
sa_list->iAddressCount = num;
|
2006-12-18 19:37:52 +01:00
|
|
|
|
2014-10-07 08:41:12 +02:00
|
|
|
for (p = table, i = 0; p; p = p->Next)
|
|
|
|
{
|
|
|
|
if (!p->IpAddressList.IpAddress.String[0]) continue;
|
2006-12-18 19:37:52 +01:00
|
|
|
|
2014-10-07 08:41:12 +02:00
|
|
|
sa[i].lpSockaddr = (SOCKADDR *)&sockaddr[i];
|
|
|
|
sa[i].iSockaddrLength = sizeof(SOCKADDR);
|
2006-12-18 19:37:52 +01:00
|
|
|
|
2016-09-09 19:33:54 +02:00
|
|
|
sockaddr[i].sin_family = WS_AF_INET;
|
2014-10-07 08:41:12 +02:00
|
|
|
sockaddr[i].sin_port = 0;
|
|
|
|
sockaddr[i].sin_addr.WS_s_addr = inet_addr(p->IpAddressList.IpAddress.String);
|
|
|
|
i++;
|
2006-12-18 19:37:52 +01:00
|
|
|
}
|
2006-11-27 20:09:46 +01:00
|
|
|
|
2006-12-18 19:37:52 +01:00
|
|
|
HeapFree(GetProcessHeap(), 0, table);
|
2021-06-04 23:24:17 +02:00
|
|
|
|
|
|
|
ret = server_ioctl_sock( s, IOCTL_AFD_WINE_COMPLETE_ASYNC, &status, sizeof(status),
|
|
|
|
NULL, 0, ret_size, overlapped, completion );
|
|
|
|
*ret_size = total;
|
|
|
|
SetLastError( ret );
|
|
|
|
return ret ? -1 : 0;
|
2006-12-18 19:37:52 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
WARN("unable to get IP address list\n");
|
2021-06-04 23:24:17 +02:00
|
|
|
SetLastError( WSAEINVAL );
|
|
|
|
return -1;
|
2006-12-18 19:37:52 +01:00
|
|
|
}
|
2021-06-04 23:24:17 +02:00
|
|
|
}
|
2011-04-19 12:26:50 +02:00
|
|
|
|
2017-03-02 06:38:15 +01:00
|
|
|
case WS_SIO_GET_EXTENSION_FUNCTION_POINTER:
|
|
|
|
{
|
|
|
|
#define EXTENSION_FUNCTION(x, y) { x, y, #y },
|
|
|
|
static const struct
|
2010-05-08 21:10:58 +02:00
|
|
|
{
|
2017-03-02 06:38:15 +01:00
|
|
|
GUID guid;
|
|
|
|
void *func_ptr;
|
|
|
|
const char *name;
|
|
|
|
} guid_funcs[] = {
|
|
|
|
EXTENSION_FUNCTION(WSAID_CONNECTEX, WS2_ConnectEx)
|
|
|
|
EXTENSION_FUNCTION(WSAID_DISCONNECTEX, WS2_DisconnectEx)
|
|
|
|
EXTENSION_FUNCTION(WSAID_ACCEPTEX, WS2_AcceptEx)
|
|
|
|
EXTENSION_FUNCTION(WSAID_GETACCEPTEXSOCKADDRS, WS2_GetAcceptExSockaddrs)
|
|
|
|
EXTENSION_FUNCTION(WSAID_TRANSMITFILE, WS2_TransmitFile)
|
|
|
|
/* EXTENSION_FUNCTION(WSAID_TRANSMITPACKETS, WS2_TransmitPackets) */
|
|
|
|
EXTENSION_FUNCTION(WSAID_WSARECVMSG, WS2_WSARecvMsg)
|
|
|
|
EXTENSION_FUNCTION(WSAID_WSASENDMSG, WSASendMsg)
|
|
|
|
};
|
|
|
|
#undef EXTENSION_FUNCTION
|
|
|
|
unsigned int i;
|
|
|
|
|
2018-09-12 21:03:54 +02:00
|
|
|
for (i = 0; i < ARRAY_SIZE(guid_funcs); i++)
|
2010-05-08 21:10:58 +02:00
|
|
|
{
|
2017-03-02 06:38:15 +01:00
|
|
|
if (IsEqualGUID(&guid_funcs[i].guid, in_buff))
|
|
|
|
{
|
2021-06-02 17:30:19 +02:00
|
|
|
NTSTATUS status = STATUS_SUCCESS;
|
|
|
|
DWORD ret = 0;
|
2017-03-02 06:38:15 +01:00
|
|
|
|
2021-06-02 17:30:19 +02:00
|
|
|
TRACE( "returning %s\n", guid_funcs[i].name );
|
|
|
|
*(void **)out_buff = guid_funcs[i].func_ptr;
|
|
|
|
|
|
|
|
ret = server_ioctl_sock( s, IOCTL_AFD_WINE_COMPLETE_ASYNC, &status, sizeof(status),
|
|
|
|
NULL, 0, ret_size, overlapped, completion );
|
|
|
|
*ret_size = sizeof(void *);
|
|
|
|
SetLastError( ret );
|
|
|
|
return ret ? -1 : 0;
|
|
|
|
}
|
2010-05-08 21:10:58 +02:00
|
|
|
}
|
|
|
|
|
2017-03-02 06:38:15 +01:00
|
|
|
FIXME("SIO_GET_EXTENSION_FUNCTION_POINTER %s: stub\n", debugstr_guid(in_buff));
|
2021-06-03 00:03:58 +02:00
|
|
|
SetLastError( WSAEINVAL );
|
2021-06-02 17:30:19 +02:00
|
|
|
return -1;
|
2017-03-02 06:38:15 +01:00
|
|
|
}
|
2021-06-08 02:53:12 +02:00
|
|
|
|
2017-03-02 06:38:15 +01:00
|
|
|
case WS_SIO_KEEPALIVE_VALS:
|
|
|
|
{
|
2021-06-08 02:53:12 +02:00
|
|
|
DWORD ret;
|
2011-09-06 04:04:23 +02:00
|
|
|
|
2021-06-08 02:53:12 +02:00
|
|
|
ret = server_ioctl_sock( s, IOCTL_AFD_WINE_KEEPALIVE_VALS, in_buff, in_size,
|
|
|
|
out_buff, out_size, ret_size, overlapped, completion );
|
|
|
|
if (!overlapped || completion) *ret_size = 0;
|
|
|
|
SetLastError( ret );
|
|
|
|
return ret ? -1 : 0;
|
|
|
|
}
|
2008-12-08 14:27:24 +01:00
|
|
|
|
2021-06-09 07:04:45 +02:00
|
|
|
case WS_SIO_ROUTING_INTERFACE_QUERY:
|
|
|
|
{
|
|
|
|
struct WS_sockaddr *daddr = (struct WS_sockaddr *)in_buff;
|
|
|
|
struct WS_sockaddr_in *daddr_in = (struct WS_sockaddr_in *)daddr;
|
|
|
|
struct WS_sockaddr_in *saddr_in = out_buff;
|
|
|
|
MIB_IPFORWARDROW row;
|
|
|
|
PMIB_IPADDRTABLE ipAddrTable = NULL;
|
2021-06-09 07:04:46 +02:00
|
|
|
DWORD size, i, found_index, ret = 0;
|
|
|
|
NTSTATUS status = STATUS_SUCCESS;
|
2021-06-09 07:04:45 +02:00
|
|
|
|
|
|
|
TRACE( "-> WS_SIO_ROUTING_INTERFACE_QUERY request\n" );
|
|
|
|
|
|
|
|
if (!in_buff || in_size < sizeof(struct WS_sockaddr) ||
|
|
|
|
!out_buff || out_size < sizeof(struct WS_sockaddr_in))
|
|
|
|
{
|
|
|
|
SetLastError( WSAEFAULT );
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
if (daddr->sa_family != WS_AF_INET)
|
|
|
|
{
|
|
|
|
FIXME("unsupported address family %d\n", daddr->sa_family);
|
2021-06-09 07:04:46 +02:00
|
|
|
SetLastError( WSAEAFNOSUPPORT );
|
|
|
|
return -1;
|
2021-06-09 07:04:45 +02:00
|
|
|
}
|
|
|
|
if (GetBestRoute( daddr_in->sin_addr.S_un.S_addr, 0, &row ) != NOERROR ||
|
|
|
|
GetIpAddrTable( NULL, &size, FALSE ) != ERROR_INSUFFICIENT_BUFFER)
|
|
|
|
{
|
2021-06-09 07:04:46 +02:00
|
|
|
SetLastError( WSAEFAULT );
|
|
|
|
return -1;
|
2021-06-09 07:04:45 +02:00
|
|
|
}
|
|
|
|
ipAddrTable = HeapAlloc( GetProcessHeap(), 0, size );
|
|
|
|
if (GetIpAddrTable( ipAddrTable, &size, FALSE ))
|
|
|
|
{
|
|
|
|
HeapFree( GetProcessHeap(), 0, ipAddrTable );
|
2021-06-09 07:04:46 +02:00
|
|
|
SetLastError( WSAEFAULT );
|
|
|
|
return -1;
|
2021-06-09 07:04:45 +02:00
|
|
|
}
|
|
|
|
for (i = 0, found_index = ipAddrTable->dwNumEntries;
|
|
|
|
i < ipAddrTable->dwNumEntries; i++)
|
|
|
|
{
|
|
|
|
if (ipAddrTable->table[i].dwIndex == row.dwForwardIfIndex)
|
|
|
|
found_index = i;
|
|
|
|
}
|
|
|
|
if (found_index == ipAddrTable->dwNumEntries)
|
|
|
|
{
|
|
|
|
ERR("no matching IP address for interface %d\n",
|
|
|
|
row.dwForwardIfIndex);
|
|
|
|
HeapFree( GetProcessHeap(), 0, ipAddrTable );
|
2021-06-09 07:04:46 +02:00
|
|
|
SetLastError( WSAEFAULT );
|
|
|
|
return -1;
|
2021-06-09 07:04:45 +02:00
|
|
|
}
|
|
|
|
saddr_in->sin_family = WS_AF_INET;
|
|
|
|
saddr_in->sin_addr.S_un.S_addr = ipAddrTable->table[found_index].dwAddr;
|
|
|
|
saddr_in->sin_port = 0;
|
|
|
|
HeapFree( GetProcessHeap(), 0, ipAddrTable );
|
2021-06-09 07:04:46 +02:00
|
|
|
|
|
|
|
ret = server_ioctl_sock( s, IOCTL_AFD_WINE_COMPLETE_ASYNC, &status, sizeof(status),
|
|
|
|
NULL, 0, ret_size, overlapped, completion );
|
|
|
|
if (!ret) *ret_size = sizeof(struct WS_sockaddr_in);
|
|
|
|
SetLastError( ret );
|
|
|
|
return ret ? -1 : 0;
|
2021-06-09 07:04:45 +02:00
|
|
|
}
|
|
|
|
|
2020-09-25 05:21:01 +02:00
|
|
|
case WS_SIO_ADDRESS_LIST_CHANGE:
|
2021-06-02 17:30:16 +02:00
|
|
|
{
|
2021-06-04 23:24:18 +02:00
|
|
|
int force_async = !!overlapped;
|
2021-06-02 17:30:16 +02:00
|
|
|
DWORD ret;
|
|
|
|
|
2021-06-04 23:24:18 +02:00
|
|
|
ret = server_ioctl_sock( s, IOCTL_AFD_WINE_ADDRESS_LIST_CHANGE, &force_async, sizeof(force_async),
|
2021-06-02 17:30:16 +02:00
|
|
|
out_buff, out_size, ret_size, overlapped, completion );
|
|
|
|
SetLastError( ret );
|
|
|
|
return ret ? -1 : 0;
|
|
|
|
}
|
|
|
|
|
2021-06-10 19:36:38 +02:00
|
|
|
case WS_SIO_UDP_CONNRESET:
|
|
|
|
{
|
|
|
|
NTSTATUS status = STATUS_SUCCESS;
|
|
|
|
DWORD ret;
|
|
|
|
|
|
|
|
FIXME( "WS_SIO_UDP_CONNRESET stub\n" );
|
|
|
|
ret = server_ioctl_sock( s, IOCTL_AFD_WINE_COMPLETE_ASYNC, &status, sizeof(status),
|
|
|
|
NULL, 0, ret_size, overlapped, completion );
|
|
|
|
SetLastError( ret );
|
|
|
|
return ret ? -1 : 0;
|
|
|
|
}
|
|
|
|
|
2021-06-10 19:36:39 +02:00
|
|
|
case WS_SIO_BASE_HANDLE:
|
|
|
|
{
|
|
|
|
NTSTATUS status;
|
|
|
|
DWORD ret;
|
|
|
|
|
|
|
|
if (overlapped)
|
|
|
|
{
|
|
|
|
status = STATUS_NOT_SUPPORTED;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
status = STATUS_SUCCESS;
|
|
|
|
*(SOCKET *)out_buff = s;
|
|
|
|
}
|
|
|
|
ret = server_ioctl_sock( s, IOCTL_AFD_WINE_COMPLETE_ASYNC, &status, sizeof(status),
|
|
|
|
NULL, 0, ret_size, overlapped, completion );
|
|
|
|
if (overlapped) ret = ERROR_IO_PENDING;
|
|
|
|
if (!ret) *ret_size = sizeof(SOCKET);
|
|
|
|
SetLastError( ret );
|
|
|
|
return ret ? -1 : 0;
|
|
|
|
}
|
|
|
|
|
2011-04-19 11:57:37 +02:00
|
|
|
default:
|
2021-06-02 17:30:16 +02:00
|
|
|
FIXME( "unimplemented ioctl %s\n", debugstr_wsaioctl( code ) );
|
2021-06-09 07:04:47 +02:00
|
|
|
/* fall through */
|
|
|
|
case LOWORD(WS_FIONBIO): /* Netscape tries to use this */
|
|
|
|
case WS_SIO_SET_COMPATIBILITY_MODE:
|
|
|
|
{
|
|
|
|
NTSTATUS status = STATUS_NOT_SUPPORTED;
|
|
|
|
|
|
|
|
server_ioctl_sock( s, IOCTL_AFD_WINE_COMPLETE_ASYNC, &status, sizeof(status),
|
|
|
|
NULL, 0, ret_size, overlapped, completion );
|
|
|
|
if (overlapped)
|
|
|
|
{
|
|
|
|
SetLastError( ERROR_IO_PENDING );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
*ret_size = 0;
|
|
|
|
SetLastError( WSAEOPNOTSUPP );
|
|
|
|
}
|
|
|
|
return -1;
|
|
|
|
}
|
2011-04-19 11:57:37 +02:00
|
|
|
}
|
2000-07-23 21:28:24 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
1997-08-24 18:00:30 +02:00
|
|
|
/***********************************************************************
|
2001-07-02 21:59:40 +02:00
|
|
|
* ioctlsocket (WS2_32.10)
|
1997-08-24 18:00:30 +02:00
|
|
|
*/
|
2007-06-01 12:10:32 +02:00
|
|
|
int WINAPI WS_ioctlsocket(SOCKET s, LONG cmd, WS_u_long *argp)
|
Release 961201
Sat Nov 30 19:21:17 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [configure]
Re-generated with autoconf 2.11. Let me know if you have
problems.
* [controls/listbox.c] [controls/oldlbox.c]
Listboxes rewritten from scratch. Moved old code still used by
comboboxes to oldlbox.c
* [misc/registry.c]
Use temporary file when saving registry.
* [windows/dialog.c]
Implemented Win32 version of DlgDirList() and DlgDirListComboBox().
* [windows/winproc.c]
Added translation for listbox Win32 messages.
Sat Nov 30 21:00:00 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [controls/widgets.c] [controls/button.c]
Fixed some incompatibilities with CTL3D DLL.
* [windows/dialog.c]
Made dialog windows fit into the desktop.
* [misc/winsock.c] [misc/winsock_async.c]
New Winsock engine.
* [windows/message.c]
GetMessage() fixes.
* [windows/queue.c] [windows/hook.c] [windows/win.c]
SetMessageQueue() fixes.
Fri Nov 29 10:25:12 1996 Slaven Rezic <eserte@cs.tu-berlin.de>
* [objects/text.c]
DrawText16(): Fixed return value.
Tue Nov 26 14:47:09 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/profile.c] [*/*]
Added Win32 profile functions, updated to new naming standard.
* [objects/font.c] [if1632/thunk.c] [include/windows.h]
Added EnumFonts32*, EnumFontFamiliesEx*, changed prototypes and
structures.
* [misc/ole2nls.c] [if1632/thunk.c]
Added EnumSystemLocales() (winhelp.exe).
* [misc/registry.c]
Added Windows 3.1 registry loader supplied by Tor Sjxwall, tor@sn.no
* [win32/file.c]
Partially fixed CreateFileMapping(), added UnmapViewOfFile().
Sat Nov 23 23:36:05 1996 Ronan Waide <waider@waider.ie>
* [misc/shell.c]
Fixed some FIXMEs relating to ShellExec() and FindExecutable().
* [misc/main.c]
Implemented a few more of the SystemParametersInfo() cases.
Tue Nov 19 01:24:34 1996 Philippe De Muyter <phdm@info.ucl.ac.be>
* [include/keyboard.h]
New file, new macro WINE_VKEY_MAPPINGS (using code taken from event.c).
* [include/windows.h]
New [VK_A, VK_Z] and [VK_0, VK9] macros.
* [misc/keyboard.c]
Fixes in KeyTable and ToAscii.
* [objects/font.c]
FONT_init : Give default value for MSWIN "system" font.
FONT_MatchFont : Do not try every size of a font family if the
family does not exist.
* [windows/event.c]
lastEventChar hack removed.
KeyStateTable replaced by InputKeyStateTable (maintained in event.c)
and QueueKeyStateTable (maintained in message.c).
EVENT_key : Corrections to the extended bit setting.
* [windows/message.c] [windows/keyboard.c]
Implementation of a new QueueKeyStateTable : table of key states
valid when messages are retrieved by GetMessage or PeekMessage,
and valid for TranslateMessage.
TranslateMessage : Convert WM*KEY messages using QueueKeyStateTable
and ToAscii.
Mon Nov 18 16:59:01 1996 Robert Pouliot <krynos@clic.net>
* [graphics/Makefile.in] [graphics/wing.c]
[if1632/wing.spec]
Some functions for WinG support, mostly empty stubs.
* [misc/crtdll.c] [if1632/crtdll.spec]
Many functions added to CRTDLL, mostly calls to Unix C library.
1996-12-01 18:17:47 +01:00
|
|
|
{
|
2011-04-19 11:57:37 +02:00
|
|
|
DWORD ret_size;
|
|
|
|
return WSAIoctl( s, cmd, argp, sizeof(WS_u_long), argp, sizeof(WS_u_long), &ret_size, NULL, NULL );
|
Release 961201
Sat Nov 30 19:21:17 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [configure]
Re-generated with autoconf 2.11. Let me know if you have
problems.
* [controls/listbox.c] [controls/oldlbox.c]
Listboxes rewritten from scratch. Moved old code still used by
comboboxes to oldlbox.c
* [misc/registry.c]
Use temporary file when saving registry.
* [windows/dialog.c]
Implemented Win32 version of DlgDirList() and DlgDirListComboBox().
* [windows/winproc.c]
Added translation for listbox Win32 messages.
Sat Nov 30 21:00:00 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [controls/widgets.c] [controls/button.c]
Fixed some incompatibilities with CTL3D DLL.
* [windows/dialog.c]
Made dialog windows fit into the desktop.
* [misc/winsock.c] [misc/winsock_async.c]
New Winsock engine.
* [windows/message.c]
GetMessage() fixes.
* [windows/queue.c] [windows/hook.c] [windows/win.c]
SetMessageQueue() fixes.
Fri Nov 29 10:25:12 1996 Slaven Rezic <eserte@cs.tu-berlin.de>
* [objects/text.c]
DrawText16(): Fixed return value.
Tue Nov 26 14:47:09 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/profile.c] [*/*]
Added Win32 profile functions, updated to new naming standard.
* [objects/font.c] [if1632/thunk.c] [include/windows.h]
Added EnumFonts32*, EnumFontFamiliesEx*, changed prototypes and
structures.
* [misc/ole2nls.c] [if1632/thunk.c]
Added EnumSystemLocales() (winhelp.exe).
* [misc/registry.c]
Added Windows 3.1 registry loader supplied by Tor Sjxwall, tor@sn.no
* [win32/file.c]
Partially fixed CreateFileMapping(), added UnmapViewOfFile().
Sat Nov 23 23:36:05 1996 Ronan Waide <waider@waider.ie>
* [misc/shell.c]
Fixed some FIXMEs relating to ShellExec() and FindExecutable().
* [misc/main.c]
Implemented a few more of the SystemParametersInfo() cases.
Tue Nov 19 01:24:34 1996 Philippe De Muyter <phdm@info.ucl.ac.be>
* [include/keyboard.h]
New file, new macro WINE_VKEY_MAPPINGS (using code taken from event.c).
* [include/windows.h]
New [VK_A, VK_Z] and [VK_0, VK9] macros.
* [misc/keyboard.c]
Fixes in KeyTable and ToAscii.
* [objects/font.c]
FONT_init : Give default value for MSWIN "system" font.
FONT_MatchFont : Do not try every size of a font family if the
family does not exist.
* [windows/event.c]
lastEventChar hack removed.
KeyStateTable replaced by InputKeyStateTable (maintained in event.c)
and QueueKeyStateTable (maintained in message.c).
EVENT_key : Corrections to the extended bit setting.
* [windows/message.c] [windows/keyboard.c]
Implementation of a new QueueKeyStateTable : table of key states
valid when messages are retrieved by GetMessage or PeekMessage,
and valid for TranslateMessage.
TranslateMessage : Convert WM*KEY messages using QueueKeyStateTable
and ToAscii.
Mon Nov 18 16:59:01 1996 Robert Pouliot <krynos@clic.net>
* [graphics/Makefile.in] [graphics/wing.c]
[if1632/wing.spec]
Some functions for WinG support, mostly empty stubs.
* [misc/crtdll.c] [if1632/crtdll.spec]
Many functions added to CRTDLL, mostly calls to Unix C library.
1996-12-01 18:17:47 +01:00
|
|
|
}
|
|
|
|
|
2021-05-14 05:54:40 +02:00
|
|
|
|
1997-08-24 18:00:30 +02:00
|
|
|
/***********************************************************************
|
2021-05-14 05:54:40 +02:00
|
|
|
* listen (ws2_32.13)
|
1997-08-24 18:00:30 +02:00
|
|
|
*/
|
2021-05-14 05:54:40 +02:00
|
|
|
int WINAPI WS_listen( SOCKET s, int backlog )
|
1997-08-24 18:00:30 +02:00
|
|
|
{
|
2021-05-14 05:54:40 +02:00
|
|
|
struct afd_listen_params params = {.backlog = backlog};
|
|
|
|
IO_STATUS_BLOCK io;
|
|
|
|
NTSTATUS status;
|
1997-08-24 18:00:30 +02:00
|
|
|
|
2021-05-14 05:54:40 +02:00
|
|
|
TRACE( "socket %#lx, backlog %d\n", s, backlog );
|
2013-07-23 03:31:41 +02:00
|
|
|
|
2021-05-14 05:54:40 +02:00
|
|
|
status = NtDeviceIoControlFile( SOCKET2HANDLE(s), NULL, NULL, NULL, &io,
|
|
|
|
IOCTL_AFD_LISTEN, ¶ms, sizeof(params), NULL, 0 );
|
|
|
|
SetLastError( NtStatusToWSAError( status ) );
|
|
|
|
return status ? -1 : 0;
|
1997-08-24 18:00:30 +02:00
|
|
|
}
|
Release 961201
Sat Nov 30 19:21:17 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [configure]
Re-generated with autoconf 2.11. Let me know if you have
problems.
* [controls/listbox.c] [controls/oldlbox.c]
Listboxes rewritten from scratch. Moved old code still used by
comboboxes to oldlbox.c
* [misc/registry.c]
Use temporary file when saving registry.
* [windows/dialog.c]
Implemented Win32 version of DlgDirList() and DlgDirListComboBox().
* [windows/winproc.c]
Added translation for listbox Win32 messages.
Sat Nov 30 21:00:00 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [controls/widgets.c] [controls/button.c]
Fixed some incompatibilities with CTL3D DLL.
* [windows/dialog.c]
Made dialog windows fit into the desktop.
* [misc/winsock.c] [misc/winsock_async.c]
New Winsock engine.
* [windows/message.c]
GetMessage() fixes.
* [windows/queue.c] [windows/hook.c] [windows/win.c]
SetMessageQueue() fixes.
Fri Nov 29 10:25:12 1996 Slaven Rezic <eserte@cs.tu-berlin.de>
* [objects/text.c]
DrawText16(): Fixed return value.
Tue Nov 26 14:47:09 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/profile.c] [*/*]
Added Win32 profile functions, updated to new naming standard.
* [objects/font.c] [if1632/thunk.c] [include/windows.h]
Added EnumFonts32*, EnumFontFamiliesEx*, changed prototypes and
structures.
* [misc/ole2nls.c] [if1632/thunk.c]
Added EnumSystemLocales() (winhelp.exe).
* [misc/registry.c]
Added Windows 3.1 registry loader supplied by Tor Sjxwall, tor@sn.no
* [win32/file.c]
Partially fixed CreateFileMapping(), added UnmapViewOfFile().
Sat Nov 23 23:36:05 1996 Ronan Waide <waider@waider.ie>
* [misc/shell.c]
Fixed some FIXMEs relating to ShellExec() and FindExecutable().
* [misc/main.c]
Implemented a few more of the SystemParametersInfo() cases.
Tue Nov 19 01:24:34 1996 Philippe De Muyter <phdm@info.ucl.ac.be>
* [include/keyboard.h]
New file, new macro WINE_VKEY_MAPPINGS (using code taken from event.c).
* [include/windows.h]
New [VK_A, VK_Z] and [VK_0, VK9] macros.
* [misc/keyboard.c]
Fixes in KeyTable and ToAscii.
* [objects/font.c]
FONT_init : Give default value for MSWIN "system" font.
FONT_MatchFont : Do not try every size of a font family if the
family does not exist.
* [windows/event.c]
lastEventChar hack removed.
KeyStateTable replaced by InputKeyStateTable (maintained in event.c)
and QueueKeyStateTable (maintained in message.c).
EVENT_key : Corrections to the extended bit setting.
* [windows/message.c] [windows/keyboard.c]
Implementation of a new QueueKeyStateTable : table of key states
valid when messages are retrieved by GetMessage or PeekMessage,
and valid for TranslateMessage.
TranslateMessage : Convert WM*KEY messages using QueueKeyStateTable
and ToAscii.
Mon Nov 18 16:59:01 1996 Robert Pouliot <krynos@clic.net>
* [graphics/Makefile.in] [graphics/wing.c]
[if1632/wing.spec]
Some functions for WinG support, mostly empty stubs.
* [misc/crtdll.c] [if1632/crtdll.spec]
Many functions added to CRTDLL, mostly calls to Unix C library.
1996-12-01 18:17:47 +01:00
|
|
|
|
2021-05-14 05:54:40 +02:00
|
|
|
|
1997-08-24 18:00:30 +02:00
|
|
|
/***********************************************************************
|
2001-07-02 21:59:40 +02:00
|
|
|
* recv (WS2_32.16)
|
1997-08-24 18:00:30 +02:00
|
|
|
*/
|
2001-11-14 22:26:23 +01:00
|
|
|
int WINAPI WS_recv(SOCKET s, char *buf, int len, int flags)
|
Release 961201
Sat Nov 30 19:21:17 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [configure]
Re-generated with autoconf 2.11. Let me know if you have
problems.
* [controls/listbox.c] [controls/oldlbox.c]
Listboxes rewritten from scratch. Moved old code still used by
comboboxes to oldlbox.c
* [misc/registry.c]
Use temporary file when saving registry.
* [windows/dialog.c]
Implemented Win32 version of DlgDirList() and DlgDirListComboBox().
* [windows/winproc.c]
Added translation for listbox Win32 messages.
Sat Nov 30 21:00:00 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [controls/widgets.c] [controls/button.c]
Fixed some incompatibilities with CTL3D DLL.
* [windows/dialog.c]
Made dialog windows fit into the desktop.
* [misc/winsock.c] [misc/winsock_async.c]
New Winsock engine.
* [windows/message.c]
GetMessage() fixes.
* [windows/queue.c] [windows/hook.c] [windows/win.c]
SetMessageQueue() fixes.
Fri Nov 29 10:25:12 1996 Slaven Rezic <eserte@cs.tu-berlin.de>
* [objects/text.c]
DrawText16(): Fixed return value.
Tue Nov 26 14:47:09 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/profile.c] [*/*]
Added Win32 profile functions, updated to new naming standard.
* [objects/font.c] [if1632/thunk.c] [include/windows.h]
Added EnumFonts32*, EnumFontFamiliesEx*, changed prototypes and
structures.
* [misc/ole2nls.c] [if1632/thunk.c]
Added EnumSystemLocales() (winhelp.exe).
* [misc/registry.c]
Added Windows 3.1 registry loader supplied by Tor Sjxwall, tor@sn.no
* [win32/file.c]
Partially fixed CreateFileMapping(), added UnmapViewOfFile().
Sat Nov 23 23:36:05 1996 Ronan Waide <waider@waider.ie>
* [misc/shell.c]
Fixed some FIXMEs relating to ShellExec() and FindExecutable().
* [misc/main.c]
Implemented a few more of the SystemParametersInfo() cases.
Tue Nov 19 01:24:34 1996 Philippe De Muyter <phdm@info.ucl.ac.be>
* [include/keyboard.h]
New file, new macro WINE_VKEY_MAPPINGS (using code taken from event.c).
* [include/windows.h]
New [VK_A, VK_Z] and [VK_0, VK9] macros.
* [misc/keyboard.c]
Fixes in KeyTable and ToAscii.
* [objects/font.c]
FONT_init : Give default value for MSWIN "system" font.
FONT_MatchFont : Do not try every size of a font family if the
family does not exist.
* [windows/event.c]
lastEventChar hack removed.
KeyStateTable replaced by InputKeyStateTable (maintained in event.c)
and QueueKeyStateTable (maintained in message.c).
EVENT_key : Corrections to the extended bit setting.
* [windows/message.c] [windows/keyboard.c]
Implementation of a new QueueKeyStateTable : table of key states
valid when messages are retrieved by GetMessage or PeekMessage,
and valid for TranslateMessage.
TranslateMessage : Convert WM*KEY messages using QueueKeyStateTable
and ToAscii.
Mon Nov 18 16:59:01 1996 Robert Pouliot <krynos@clic.net>
* [graphics/Makefile.in] [graphics/wing.c]
[if1632/wing.spec]
Some functions for WinG support, mostly empty stubs.
* [misc/crtdll.c] [if1632/crtdll.spec]
Many functions added to CRTDLL, mostly calls to Unix C library.
1996-12-01 18:17:47 +01:00
|
|
|
{
|
2002-04-05 23:22:55 +02:00
|
|
|
DWORD n, dwFlags = flags;
|
2002-07-03 23:06:58 +02:00
|
|
|
WSABUF wsabuf;
|
|
|
|
|
|
|
|
wsabuf.len = len;
|
|
|
|
wsabuf.buf = buf;
|
1997-08-24 18:00:30 +02:00
|
|
|
|
2010-12-06 01:08:54 +01:00
|
|
|
if ( WS2_recv_base(s, &wsabuf, 1, &n, &dwFlags, NULL, NULL, NULL, NULL, NULL) == SOCKET_ERROR )
|
2002-04-05 23:22:55 +02:00
|
|
|
return SOCKET_ERROR;
|
|
|
|
else
|
|
|
|
return n;
|
Release 961201
Sat Nov 30 19:21:17 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [configure]
Re-generated with autoconf 2.11. Let me know if you have
problems.
* [controls/listbox.c] [controls/oldlbox.c]
Listboxes rewritten from scratch. Moved old code still used by
comboboxes to oldlbox.c
* [misc/registry.c]
Use temporary file when saving registry.
* [windows/dialog.c]
Implemented Win32 version of DlgDirList() and DlgDirListComboBox().
* [windows/winproc.c]
Added translation for listbox Win32 messages.
Sat Nov 30 21:00:00 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [controls/widgets.c] [controls/button.c]
Fixed some incompatibilities with CTL3D DLL.
* [windows/dialog.c]
Made dialog windows fit into the desktop.
* [misc/winsock.c] [misc/winsock_async.c]
New Winsock engine.
* [windows/message.c]
GetMessage() fixes.
* [windows/queue.c] [windows/hook.c] [windows/win.c]
SetMessageQueue() fixes.
Fri Nov 29 10:25:12 1996 Slaven Rezic <eserte@cs.tu-berlin.de>
* [objects/text.c]
DrawText16(): Fixed return value.
Tue Nov 26 14:47:09 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/profile.c] [*/*]
Added Win32 profile functions, updated to new naming standard.
* [objects/font.c] [if1632/thunk.c] [include/windows.h]
Added EnumFonts32*, EnumFontFamiliesEx*, changed prototypes and
structures.
* [misc/ole2nls.c] [if1632/thunk.c]
Added EnumSystemLocales() (winhelp.exe).
* [misc/registry.c]
Added Windows 3.1 registry loader supplied by Tor Sjxwall, tor@sn.no
* [win32/file.c]
Partially fixed CreateFileMapping(), added UnmapViewOfFile().
Sat Nov 23 23:36:05 1996 Ronan Waide <waider@waider.ie>
* [misc/shell.c]
Fixed some FIXMEs relating to ShellExec() and FindExecutable().
* [misc/main.c]
Implemented a few more of the SystemParametersInfo() cases.
Tue Nov 19 01:24:34 1996 Philippe De Muyter <phdm@info.ucl.ac.be>
* [include/keyboard.h]
New file, new macro WINE_VKEY_MAPPINGS (using code taken from event.c).
* [include/windows.h]
New [VK_A, VK_Z] and [VK_0, VK9] macros.
* [misc/keyboard.c]
Fixes in KeyTable and ToAscii.
* [objects/font.c]
FONT_init : Give default value for MSWIN "system" font.
FONT_MatchFont : Do not try every size of a font family if the
family does not exist.
* [windows/event.c]
lastEventChar hack removed.
KeyStateTable replaced by InputKeyStateTable (maintained in event.c)
and QueueKeyStateTable (maintained in message.c).
EVENT_key : Corrections to the extended bit setting.
* [windows/message.c] [windows/keyboard.c]
Implementation of a new QueueKeyStateTable : table of key states
valid when messages are retrieved by GetMessage or PeekMessage,
and valid for TranslateMessage.
TranslateMessage : Convert WM*KEY messages using QueueKeyStateTable
and ToAscii.
Mon Nov 18 16:59:01 1996 Robert Pouliot <krynos@clic.net>
* [graphics/Makefile.in] [graphics/wing.c]
[if1632/wing.spec]
Some functions for WinG support, mostly empty stubs.
* [misc/crtdll.c] [if1632/crtdll.spec]
Many functions added to CRTDLL, mostly calls to Unix C library.
1996-12-01 18:17:47 +01:00
|
|
|
}
|
|
|
|
|
1997-08-24 18:00:30 +02:00
|
|
|
/***********************************************************************
|
2001-07-02 21:59:40 +02:00
|
|
|
* recvfrom (WS2_32.17)
|
1997-08-24 18:00:30 +02:00
|
|
|
*/
|
2001-11-14 22:26:23 +01:00
|
|
|
int WINAPI WS_recvfrom(SOCKET s, char *buf, INT len, int flags,
|
2005-01-14 20:54:38 +01:00
|
|
|
struct WS_sockaddr *from, int *fromlen)
|
1997-08-24 18:00:30 +02:00
|
|
|
{
|
2002-04-05 23:22:55 +02:00
|
|
|
DWORD n, dwFlags = flags;
|
2002-07-03 23:06:58 +02:00
|
|
|
WSABUF wsabuf;
|
|
|
|
|
|
|
|
wsabuf.len = len;
|
|
|
|
wsabuf.buf = buf;
|
1997-08-24 18:00:30 +02:00
|
|
|
|
2010-12-06 01:08:54 +01:00
|
|
|
if ( WS2_recv_base(s, &wsabuf, 1, &n, &dwFlags, from, fromlen, NULL, NULL, NULL) == SOCKET_ERROR )
|
2002-04-05 23:22:55 +02:00
|
|
|
return SOCKET_ERROR;
|
2001-10-08 22:36:03 +02:00
|
|
|
else
|
2002-04-05 23:22:55 +02:00
|
|
|
return n;
|
Release 961201
Sat Nov 30 19:21:17 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [configure]
Re-generated with autoconf 2.11. Let me know if you have
problems.
* [controls/listbox.c] [controls/oldlbox.c]
Listboxes rewritten from scratch. Moved old code still used by
comboboxes to oldlbox.c
* [misc/registry.c]
Use temporary file when saving registry.
* [windows/dialog.c]
Implemented Win32 version of DlgDirList() and DlgDirListComboBox().
* [windows/winproc.c]
Added translation for listbox Win32 messages.
Sat Nov 30 21:00:00 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [controls/widgets.c] [controls/button.c]
Fixed some incompatibilities with CTL3D DLL.
* [windows/dialog.c]
Made dialog windows fit into the desktop.
* [misc/winsock.c] [misc/winsock_async.c]
New Winsock engine.
* [windows/message.c]
GetMessage() fixes.
* [windows/queue.c] [windows/hook.c] [windows/win.c]
SetMessageQueue() fixes.
Fri Nov 29 10:25:12 1996 Slaven Rezic <eserte@cs.tu-berlin.de>
* [objects/text.c]
DrawText16(): Fixed return value.
Tue Nov 26 14:47:09 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/profile.c] [*/*]
Added Win32 profile functions, updated to new naming standard.
* [objects/font.c] [if1632/thunk.c] [include/windows.h]
Added EnumFonts32*, EnumFontFamiliesEx*, changed prototypes and
structures.
* [misc/ole2nls.c] [if1632/thunk.c]
Added EnumSystemLocales() (winhelp.exe).
* [misc/registry.c]
Added Windows 3.1 registry loader supplied by Tor Sjxwall, tor@sn.no
* [win32/file.c]
Partially fixed CreateFileMapping(), added UnmapViewOfFile().
Sat Nov 23 23:36:05 1996 Ronan Waide <waider@waider.ie>
* [misc/shell.c]
Fixed some FIXMEs relating to ShellExec() and FindExecutable().
* [misc/main.c]
Implemented a few more of the SystemParametersInfo() cases.
Tue Nov 19 01:24:34 1996 Philippe De Muyter <phdm@info.ucl.ac.be>
* [include/keyboard.h]
New file, new macro WINE_VKEY_MAPPINGS (using code taken from event.c).
* [include/windows.h]
New [VK_A, VK_Z] and [VK_0, VK9] macros.
* [misc/keyboard.c]
Fixes in KeyTable and ToAscii.
* [objects/font.c]
FONT_init : Give default value for MSWIN "system" font.
FONT_MatchFont : Do not try every size of a font family if the
family does not exist.
* [windows/event.c]
lastEventChar hack removed.
KeyStateTable replaced by InputKeyStateTable (maintained in event.c)
and QueueKeyStateTable (maintained in message.c).
EVENT_key : Corrections to the extended bit setting.
* [windows/message.c] [windows/keyboard.c]
Implementation of a new QueueKeyStateTable : table of key states
valid when messages are retrieved by GetMessage or PeekMessage,
and valid for TranslateMessage.
TranslateMessage : Convert WM*KEY messages using QueueKeyStateTable
and ToAscii.
Mon Nov 18 16:59:01 1996 Robert Pouliot <krynos@clic.net>
* [graphics/Makefile.in] [graphics/wing.c]
[if1632/wing.spec]
Some functions for WinG support, mostly empty stubs.
* [misc/crtdll.c] [if1632/crtdll.spec]
Many functions added to CRTDLL, mostly calls to Unix C library.
1996-12-01 18:17:47 +01:00
|
|
|
}
|
|
|
|
|
2021-06-20 18:05:54 +02:00
|
|
|
|
|
|
|
/* as FD_SET(), but returns 1 if the fd was added, 0 otherwise */
|
|
|
|
static int add_fd_to_set( SOCKET fd, struct WS_fd_set *set )
|
2006-11-06 12:28:53 +01:00
|
|
|
{
|
2021-06-20 18:05:54 +02:00
|
|
|
unsigned int i;
|
2006-11-06 12:28:53 +01:00
|
|
|
|
2021-06-20 18:05:54 +02:00
|
|
|
for (i = 0; i < set->fd_count; ++i)
|
2010-10-18 12:42:16 +02:00
|
|
|
{
|
2021-06-20 18:05:54 +02:00
|
|
|
if (set->fd_array[i] == fd)
|
|
|
|
return 0;
|
2010-10-18 12:42:16 +02:00
|
|
|
}
|
2016-11-30 07:48:28 +01:00
|
|
|
|
2021-06-20 18:05:54 +02:00
|
|
|
if (set->fd_count < WS_FD_SETSIZE)
|
2010-09-20 14:56:55 +02:00
|
|
|
{
|
2021-06-20 18:05:54 +02:00
|
|
|
set->fd_array[set->fd_count++] = fd;
|
|
|
|
return 1;
|
2010-09-20 14:56:55 +02:00
|
|
|
}
|
2016-11-30 07:48:28 +01:00
|
|
|
|
2021-06-20 18:05:54 +02:00
|
|
|
return 0;
|
|
|
|
}
|
2015-03-29 05:53:58 +02:00
|
|
|
|
|
|
|
|
2021-06-20 18:05:54 +02:00
|
|
|
/***********************************************************************
|
|
|
|
* select (ws2_32.18)
|
|
|
|
*/
|
|
|
|
int WINAPI WS_select( int count, WS_fd_set *read_ptr, WS_fd_set *write_ptr,
|
|
|
|
WS_fd_set *except_ptr, const struct WS_timeval *timeout)
|
|
|
|
{
|
|
|
|
char buffer[offsetof( struct afd_poll_params, sockets[WS_FD_SETSIZE * 3] )] = {0};
|
|
|
|
struct afd_poll_params *params = (struct afd_poll_params *)buffer;
|
|
|
|
struct WS_fd_set read, write, except;
|
|
|
|
ULONG params_size, i, j;
|
|
|
|
SOCKET poll_socket = 0;
|
|
|
|
IO_STATUS_BLOCK io;
|
|
|
|
HANDLE sync_event;
|
|
|
|
int ret_count = 0;
|
|
|
|
NTSTATUS status;
|
2006-11-06 12:28:53 +01:00
|
|
|
|
2021-06-20 18:05:54 +02:00
|
|
|
TRACE( "read %p, write %p, except %p, timeout %p\n", read_ptr, write_ptr, except_ptr, timeout );
|
|
|
|
|
|
|
|
WS_FD_ZERO( &read );
|
|
|
|
WS_FD_ZERO( &write );
|
|
|
|
WS_FD_ZERO( &except );
|
|
|
|
if (read_ptr) read = *read_ptr;
|
|
|
|
if (write_ptr) write = *write_ptr;
|
|
|
|
if (except_ptr) except = *except_ptr;
|
|
|
|
|
|
|
|
if (!(sync_event = get_sync_event())) return -1;
|
|
|
|
|
|
|
|
if (timeout)
|
|
|
|
params->timeout = timeout->tv_sec * -10000000 + timeout->tv_usec * -10;
|
|
|
|
else
|
|
|
|
params->timeout = TIMEOUT_INFINITE;
|
2006-11-06 12:28:53 +01:00
|
|
|
|
2021-06-20 18:05:54 +02:00
|
|
|
for (i = 0; i < read.fd_count; ++i)
|
2006-11-06 12:28:53 +01:00
|
|
|
{
|
2021-06-20 18:05:54 +02:00
|
|
|
params->sockets[params->count].socket = read.fd_array[i];
|
|
|
|
params->sockets[params->count].flags = AFD_POLL_READ | AFD_POLL_ACCEPT | AFD_POLL_HUP;
|
|
|
|
++params->count;
|
|
|
|
poll_socket = read.fd_array[i];
|
2006-11-06 12:28:53 +01:00
|
|
|
}
|
2021-06-20 18:05:54 +02:00
|
|
|
|
|
|
|
for (i = 0; i < write.fd_count; ++i)
|
2006-11-06 12:28:53 +01:00
|
|
|
{
|
2021-06-20 18:05:54 +02:00
|
|
|
params->sockets[params->count].socket = write.fd_array[i];
|
|
|
|
params->sockets[params->count].flags = AFD_POLL_WRITE;
|
|
|
|
++params->count;
|
|
|
|
poll_socket = write.fd_array[i];
|
2006-11-06 12:28:53 +01:00
|
|
|
}
|
2021-06-20 18:05:54 +02:00
|
|
|
|
|
|
|
for (i = 0; i < except.fd_count; ++i)
|
2006-11-06 12:28:53 +01:00
|
|
|
{
|
2021-06-20 18:05:54 +02:00
|
|
|
params->sockets[params->count].socket = except.fd_array[i];
|
|
|
|
params->sockets[params->count].flags = AFD_POLL_OOB | AFD_POLL_CONNECT_ERR;
|
|
|
|
++params->count;
|
|
|
|
poll_socket = except.fd_array[i];
|
2006-11-06 12:28:53 +01:00
|
|
|
}
|
2015-05-22 04:55:03 +02:00
|
|
|
|
2021-06-20 18:05:54 +02:00
|
|
|
if (!params->count)
|
2015-05-22 04:55:03 +02:00
|
|
|
{
|
2021-06-20 18:05:54 +02:00
|
|
|
SetLastError( WSAEINVAL );
|
|
|
|
return -1;
|
2015-05-22 04:55:03 +02:00
|
|
|
}
|
|
|
|
|
2021-06-20 18:05:54 +02:00
|
|
|
params_size = offsetof( struct afd_poll_params, sockets[params->count] );
|
2006-11-06 12:28:53 +01:00
|
|
|
|
2021-06-20 18:05:54 +02:00
|
|
|
status = NtDeviceIoControlFile( (HANDLE)poll_socket, sync_event, NULL, NULL, &io,
|
|
|
|
IOCTL_AFD_POLL, params, params_size, params, params_size );
|
|
|
|
if (status == STATUS_PENDING)
|
2006-11-06 12:28:53 +01:00
|
|
|
{
|
2021-06-20 18:05:54 +02:00
|
|
|
if (WaitForSingleObject( sync_event, INFINITE ) == WAIT_FAILED)
|
|
|
|
return -1;
|
|
|
|
status = io.u.Status;
|
2006-11-06 12:28:53 +01:00
|
|
|
}
|
2021-06-20 18:05:54 +02:00
|
|
|
if (status == STATUS_TIMEOUT) status = STATUS_SUCCESS;
|
|
|
|
if (!status)
|
2006-11-06 12:28:53 +01:00
|
|
|
{
|
2021-06-20 18:05:54 +02:00
|
|
|
/* pointers may alias, so clear them all first */
|
|
|
|
if (read_ptr) WS_FD_ZERO( read_ptr );
|
|
|
|
if (write_ptr) WS_FD_ZERO( write_ptr );
|
|
|
|
if (except_ptr) WS_FD_ZERO( except_ptr );
|
2006-11-06 12:28:53 +01:00
|
|
|
|
2021-06-20 18:05:54 +02:00
|
|
|
for (i = 0; i < params->count; ++i)
|
|
|
|
{
|
|
|
|
unsigned int flags = params->sockets[i].flags;
|
|
|
|
SOCKET s = params->sockets[i].socket;
|
Release 961201
Sat Nov 30 19:21:17 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [configure]
Re-generated with autoconf 2.11. Let me know if you have
problems.
* [controls/listbox.c] [controls/oldlbox.c]
Listboxes rewritten from scratch. Moved old code still used by
comboboxes to oldlbox.c
* [misc/registry.c]
Use temporary file when saving registry.
* [windows/dialog.c]
Implemented Win32 version of DlgDirList() and DlgDirListComboBox().
* [windows/winproc.c]
Added translation for listbox Win32 messages.
Sat Nov 30 21:00:00 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [controls/widgets.c] [controls/button.c]
Fixed some incompatibilities with CTL3D DLL.
* [windows/dialog.c]
Made dialog windows fit into the desktop.
* [misc/winsock.c] [misc/winsock_async.c]
New Winsock engine.
* [windows/message.c]
GetMessage() fixes.
* [windows/queue.c] [windows/hook.c] [windows/win.c]
SetMessageQueue() fixes.
Fri Nov 29 10:25:12 1996 Slaven Rezic <eserte@cs.tu-berlin.de>
* [objects/text.c]
DrawText16(): Fixed return value.
Tue Nov 26 14:47:09 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/profile.c] [*/*]
Added Win32 profile functions, updated to new naming standard.
* [objects/font.c] [if1632/thunk.c] [include/windows.h]
Added EnumFonts32*, EnumFontFamiliesEx*, changed prototypes and
structures.
* [misc/ole2nls.c] [if1632/thunk.c]
Added EnumSystemLocales() (winhelp.exe).
* [misc/registry.c]
Added Windows 3.1 registry loader supplied by Tor Sjxwall, tor@sn.no
* [win32/file.c]
Partially fixed CreateFileMapping(), added UnmapViewOfFile().
Sat Nov 23 23:36:05 1996 Ronan Waide <waider@waider.ie>
* [misc/shell.c]
Fixed some FIXMEs relating to ShellExec() and FindExecutable().
* [misc/main.c]
Implemented a few more of the SystemParametersInfo() cases.
Tue Nov 19 01:24:34 1996 Philippe De Muyter <phdm@info.ucl.ac.be>
* [include/keyboard.h]
New file, new macro WINE_VKEY_MAPPINGS (using code taken from event.c).
* [include/windows.h]
New [VK_A, VK_Z] and [VK_0, VK9] macros.
* [misc/keyboard.c]
Fixes in KeyTable and ToAscii.
* [objects/font.c]
FONT_init : Give default value for MSWIN "system" font.
FONT_MatchFont : Do not try every size of a font family if the
family does not exist.
* [windows/event.c]
lastEventChar hack removed.
KeyStateTable replaced by InputKeyStateTable (maintained in event.c)
and QueueKeyStateTable (maintained in message.c).
EVENT_key : Corrections to the extended bit setting.
* [windows/message.c] [windows/keyboard.c]
Implementation of a new QueueKeyStateTable : table of key states
valid when messages are retrieved by GetMessage or PeekMessage,
and valid for TranslateMessage.
TranslateMessage : Convert WM*KEY messages using QueueKeyStateTable
and ToAscii.
Mon Nov 18 16:59:01 1996 Robert Pouliot <krynos@clic.net>
* [graphics/Makefile.in] [graphics/wing.c]
[if1632/wing.spec]
Some functions for WinG support, mostly empty stubs.
* [misc/crtdll.c] [if1632/crtdll.spec]
Many functions added to CRTDLL, mostly calls to Unix C library.
1996-12-01 18:17:47 +01:00
|
|
|
|
2021-06-20 18:05:54 +02:00
|
|
|
for (j = 0; j < read.fd_count; ++j)
|
|
|
|
{
|
|
|
|
if (read.fd_array[j] == s
|
|
|
|
&& (flags & (AFD_POLL_READ | AFD_POLL_ACCEPT | AFD_POLL_HUP | AFD_POLL_CLOSE)))
|
|
|
|
{
|
|
|
|
ret_count += add_fd_to_set( s, read_ptr );
|
|
|
|
flags &= ~AFD_POLL_CLOSE;
|
|
|
|
}
|
|
|
|
}
|
1997-08-24 18:00:30 +02:00
|
|
|
|
2021-06-20 18:05:54 +02:00
|
|
|
if (flags & AFD_POLL_CLOSE)
|
|
|
|
status = STATUS_INVALID_HANDLE;
|
1997-08-24 18:00:30 +02:00
|
|
|
|
2021-06-20 18:05:54 +02:00
|
|
|
for (j = 0; j < write.fd_count; ++j)
|
|
|
|
{
|
|
|
|
if (write.fd_array[j] == s && (flags & AFD_POLL_WRITE))
|
|
|
|
ret_count += add_fd_to_set( s, write_ptr );
|
|
|
|
}
|
1997-08-24 18:00:30 +02:00
|
|
|
|
2021-06-20 18:05:54 +02:00
|
|
|
for (j = 0; j < except.fd_count; ++j)
|
|
|
|
{
|
|
|
|
if (except.fd_array[j] == s && (flags & (AFD_POLL_OOB | AFD_POLL_CONNECT_ERR)))
|
|
|
|
ret_count += add_fd_to_set( s, except_ptr );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
1997-09-28 19:43:24 +02:00
|
|
|
|
2021-06-20 18:05:54 +02:00
|
|
|
SetLastError( NtStatusToWSAError( status ) );
|
|
|
|
return status ? -1 : ret_count;
|
Release 961201
Sat Nov 30 19:21:17 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [configure]
Re-generated with autoconf 2.11. Let me know if you have
problems.
* [controls/listbox.c] [controls/oldlbox.c]
Listboxes rewritten from scratch. Moved old code still used by
comboboxes to oldlbox.c
* [misc/registry.c]
Use temporary file when saving registry.
* [windows/dialog.c]
Implemented Win32 version of DlgDirList() and DlgDirListComboBox().
* [windows/winproc.c]
Added translation for listbox Win32 messages.
Sat Nov 30 21:00:00 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [controls/widgets.c] [controls/button.c]
Fixed some incompatibilities with CTL3D DLL.
* [windows/dialog.c]
Made dialog windows fit into the desktop.
* [misc/winsock.c] [misc/winsock_async.c]
New Winsock engine.
* [windows/message.c]
GetMessage() fixes.
* [windows/queue.c] [windows/hook.c] [windows/win.c]
SetMessageQueue() fixes.
Fri Nov 29 10:25:12 1996 Slaven Rezic <eserte@cs.tu-berlin.de>
* [objects/text.c]
DrawText16(): Fixed return value.
Tue Nov 26 14:47:09 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/profile.c] [*/*]
Added Win32 profile functions, updated to new naming standard.
* [objects/font.c] [if1632/thunk.c] [include/windows.h]
Added EnumFonts32*, EnumFontFamiliesEx*, changed prototypes and
structures.
* [misc/ole2nls.c] [if1632/thunk.c]
Added EnumSystemLocales() (winhelp.exe).
* [misc/registry.c]
Added Windows 3.1 registry loader supplied by Tor Sjxwall, tor@sn.no
* [win32/file.c]
Partially fixed CreateFileMapping(), added UnmapViewOfFile().
Sat Nov 23 23:36:05 1996 Ronan Waide <waider@waider.ie>
* [misc/shell.c]
Fixed some FIXMEs relating to ShellExec() and FindExecutable().
* [misc/main.c]
Implemented a few more of the SystemParametersInfo() cases.
Tue Nov 19 01:24:34 1996 Philippe De Muyter <phdm@info.ucl.ac.be>
* [include/keyboard.h]
New file, new macro WINE_VKEY_MAPPINGS (using code taken from event.c).
* [include/windows.h]
New [VK_A, VK_Z] and [VK_0, VK9] macros.
* [misc/keyboard.c]
Fixes in KeyTable and ToAscii.
* [objects/font.c]
FONT_init : Give default value for MSWIN "system" font.
FONT_MatchFont : Do not try every size of a font family if the
family does not exist.
* [windows/event.c]
lastEventChar hack removed.
KeyStateTable replaced by InputKeyStateTable (maintained in event.c)
and QueueKeyStateTable (maintained in message.c).
EVENT_key : Corrections to the extended bit setting.
* [windows/message.c] [windows/keyboard.c]
Implementation of a new QueueKeyStateTable : table of key states
valid when messages are retrieved by GetMessage or PeekMessage,
and valid for TranslateMessage.
TranslateMessage : Convert WM*KEY messages using QueueKeyStateTable
and ToAscii.
Mon Nov 18 16:59:01 1996 Robert Pouliot <krynos@clic.net>
* [graphics/Makefile.in] [graphics/wing.c]
[if1632/wing.spec]
Some functions for WinG support, mostly empty stubs.
* [misc/crtdll.c] [if1632/crtdll.spec]
Many functions added to CRTDLL, mostly calls to Unix C library.
1996-12-01 18:17:47 +01:00
|
|
|
}
|
|
|
|
|
2021-06-15 17:39:45 +02:00
|
|
|
|
|
|
|
static unsigned int afd_poll_flag_to_win32( unsigned int flags )
|
|
|
|
{
|
|
|
|
static const unsigned int map[] =
|
|
|
|
{
|
|
|
|
FD_READ, /* READ */
|
|
|
|
FD_OOB, /* OOB */
|
|
|
|
FD_WRITE, /* WRITE */
|
|
|
|
FD_CLOSE, /* HUP */
|
|
|
|
FD_CLOSE, /* RESET */
|
|
|
|
0, /* CLOSE */
|
|
|
|
FD_CONNECT, /* CONNECT */
|
|
|
|
FD_ACCEPT, /* ACCEPT */
|
|
|
|
FD_CONNECT, /* CONNECT_ERR */
|
|
|
|
};
|
|
|
|
|
|
|
|
unsigned int i, ret = 0;
|
|
|
|
|
|
|
|
for (i = 0; i < ARRAY_SIZE(map); ++i)
|
|
|
|
{
|
|
|
|
if (flags & (1 << i)) ret |= map[i];
|
|
|
|
}
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-12-22 14:15:41 +01:00
|
|
|
/***********************************************************************
|
2021-06-20 18:05:53 +02:00
|
|
|
* WSAPoll (ws2_32.@)
|
2015-12-22 14:15:41 +01:00
|
|
|
*/
|
2021-06-20 18:05:53 +02:00
|
|
|
int WINAPI WSAPoll( WSAPOLLFD *fds, ULONG count, int timeout )
|
2015-12-22 14:15:41 +01:00
|
|
|
{
|
2021-06-20 18:05:53 +02:00
|
|
|
struct afd_poll_params *params;
|
|
|
|
ULONG params_size, i, j;
|
|
|
|
SOCKET poll_socket = 0;
|
|
|
|
IO_STATUS_BLOCK io;
|
|
|
|
HANDLE sync_event;
|
|
|
|
int ret_count = 0;
|
|
|
|
NTSTATUS status;
|
2015-12-22 14:15:41 +01:00
|
|
|
|
|
|
|
if (!count)
|
|
|
|
{
|
|
|
|
SetLastError(WSAEINVAL);
|
|
|
|
return SOCKET_ERROR;
|
|
|
|
}
|
2021-06-20 18:05:53 +02:00
|
|
|
if (!fds)
|
2015-12-22 14:15:41 +01:00
|
|
|
{
|
|
|
|
SetLastError(WSAEFAULT);
|
|
|
|
return SOCKET_ERROR;
|
|
|
|
}
|
|
|
|
|
2021-06-20 18:05:53 +02:00
|
|
|
if (!(sync_event = get_sync_event())) return -1;
|
|
|
|
|
|
|
|
params_size = offsetof( struct afd_poll_params, sockets[count] );
|
|
|
|
if (!(params = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, params_size )))
|
2015-12-22 14:15:41 +01:00
|
|
|
{
|
|
|
|
SetLastError(WSAENOBUFS);
|
|
|
|
return SOCKET_ERROR;
|
|
|
|
}
|
|
|
|
|
2021-06-20 18:05:53 +02:00
|
|
|
params->timeout = (timeout >= 0 ? timeout * -10000 : TIMEOUT_INFINITE);
|
|
|
|
|
|
|
|
for (i = 0; i < count; ++i)
|
2015-12-22 14:15:41 +01:00
|
|
|
{
|
2021-06-20 18:05:53 +02:00
|
|
|
unsigned int flags = AFD_POLL_HUP | AFD_POLL_RESET | AFD_POLL_CONNECT_ERR;
|
|
|
|
|
|
|
|
if ((INT_PTR)fds[i].fd < 0 || !socket_list_find( fds[i].fd ))
|
|
|
|
{
|
|
|
|
fds[i].revents = WS_POLLNVAL;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
poll_socket = fds[i].fd;
|
|
|
|
params->sockets[params->count].socket = fds[i].fd;
|
|
|
|
|
|
|
|
if (fds[i].events & WS_POLLRDNORM)
|
|
|
|
flags |= AFD_POLL_ACCEPT | AFD_POLL_READ;
|
|
|
|
if (fds[i].events & WS_POLLRDBAND)
|
|
|
|
flags |= AFD_POLL_OOB;
|
|
|
|
if (fds[i].events & WS_POLLWRNORM)
|
|
|
|
flags |= AFD_POLL_WRITE;
|
|
|
|
params->sockets[params->count].flags = flags;
|
|
|
|
++params->count;
|
|
|
|
|
|
|
|
fds[i].revents = 0;
|
2015-12-22 14:15:41 +01:00
|
|
|
}
|
|
|
|
|
2021-06-20 18:05:53 +02:00
|
|
|
if (!poll_socket)
|
|
|
|
{
|
|
|
|
SetLastError( WSAENOTSOCK );
|
|
|
|
HeapFree( GetProcessHeap(), 0, params );
|
|
|
|
return -1;
|
|
|
|
}
|
2015-12-22 14:15:41 +01:00
|
|
|
|
2021-06-20 18:05:53 +02:00
|
|
|
status = NtDeviceIoControlFile( (HANDLE)poll_socket, sync_event, NULL, NULL, &io, IOCTL_AFD_POLL,
|
|
|
|
params, params_size, params, params_size );
|
|
|
|
if (status == STATUS_PENDING)
|
2015-12-22 14:15:41 +01:00
|
|
|
{
|
2021-06-20 18:05:53 +02:00
|
|
|
if (WaitForSingleObject( sync_event, INFINITE ) == WAIT_FAILED)
|
2015-12-22 14:15:41 +01:00
|
|
|
{
|
2021-06-20 18:05:53 +02:00
|
|
|
HeapFree( GetProcessHeap(), 0, params );
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
status = io.u.Status;
|
|
|
|
}
|
|
|
|
if (!status)
|
|
|
|
{
|
|
|
|
for (i = 0; i < count; ++i)
|
|
|
|
{
|
|
|
|
for (j = 0; j < params->count; ++j)
|
2016-09-13 20:38:15 +02:00
|
|
|
{
|
2021-06-20 18:05:53 +02:00
|
|
|
if (fds[i].fd == params->sockets[j].socket)
|
2016-09-13 20:38:15 +02:00
|
|
|
{
|
2021-06-20 18:05:53 +02:00
|
|
|
unsigned int revents = 0;
|
|
|
|
|
|
|
|
if (params->sockets[j].flags & (AFD_POLL_ACCEPT | AFD_POLL_READ))
|
|
|
|
revents |= WS_POLLRDNORM;
|
|
|
|
if (params->sockets[j].flags & AFD_POLL_OOB)
|
|
|
|
revents |= WS_POLLRDBAND;
|
|
|
|
if (params->sockets[j].flags & AFD_POLL_WRITE)
|
|
|
|
revents |= WS_POLLWRNORM;
|
|
|
|
if (params->sockets[j].flags & AFD_POLL_HUP)
|
|
|
|
revents |= WS_POLLHUP;
|
|
|
|
if (params->sockets[j].flags & (AFD_POLL_RESET | AFD_POLL_CONNECT_ERR))
|
|
|
|
revents |= WS_POLLERR;
|
|
|
|
if (params->sockets[j].flags & AFD_POLL_CLOSE)
|
|
|
|
revents |= WS_POLLNVAL;
|
|
|
|
|
|
|
|
fds[i].revents = revents & (fds[i].events | WS_POLLHUP | WS_POLLERR | WS_POLLNVAL);
|
|
|
|
|
|
|
|
if (fds[i].revents)
|
|
|
|
++ret_count;
|
2016-09-13 20:38:15 +02:00
|
|
|
}
|
|
|
|
}
|
2015-12-22 14:15:41 +01:00
|
|
|
}
|
|
|
|
}
|
2021-06-20 18:05:53 +02:00
|
|
|
if (status == STATUS_TIMEOUT) status = STATUS_SUCCESS;
|
2015-12-22 14:15:41 +01:00
|
|
|
|
2021-06-20 18:05:53 +02:00
|
|
|
HeapFree( GetProcessHeap(), 0, params );
|
|
|
|
|
|
|
|
SetLastError( NtStatusToWSAError( status ) );
|
|
|
|
return status ? -1 : ret_count;
|
2015-12-22 14:15:41 +01:00
|
|
|
}
|
|
|
|
|
Release 961201
Sat Nov 30 19:21:17 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [configure]
Re-generated with autoconf 2.11. Let me know if you have
problems.
* [controls/listbox.c] [controls/oldlbox.c]
Listboxes rewritten from scratch. Moved old code still used by
comboboxes to oldlbox.c
* [misc/registry.c]
Use temporary file when saving registry.
* [windows/dialog.c]
Implemented Win32 version of DlgDirList() and DlgDirListComboBox().
* [windows/winproc.c]
Added translation for listbox Win32 messages.
Sat Nov 30 21:00:00 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [controls/widgets.c] [controls/button.c]
Fixed some incompatibilities with CTL3D DLL.
* [windows/dialog.c]
Made dialog windows fit into the desktop.
* [misc/winsock.c] [misc/winsock_async.c]
New Winsock engine.
* [windows/message.c]
GetMessage() fixes.
* [windows/queue.c] [windows/hook.c] [windows/win.c]
SetMessageQueue() fixes.
Fri Nov 29 10:25:12 1996 Slaven Rezic <eserte@cs.tu-berlin.de>
* [objects/text.c]
DrawText16(): Fixed return value.
Tue Nov 26 14:47:09 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/profile.c] [*/*]
Added Win32 profile functions, updated to new naming standard.
* [objects/font.c] [if1632/thunk.c] [include/windows.h]
Added EnumFonts32*, EnumFontFamiliesEx*, changed prototypes and
structures.
* [misc/ole2nls.c] [if1632/thunk.c]
Added EnumSystemLocales() (winhelp.exe).
* [misc/registry.c]
Added Windows 3.1 registry loader supplied by Tor Sjxwall, tor@sn.no
* [win32/file.c]
Partially fixed CreateFileMapping(), added UnmapViewOfFile().
Sat Nov 23 23:36:05 1996 Ronan Waide <waider@waider.ie>
* [misc/shell.c]
Fixed some FIXMEs relating to ShellExec() and FindExecutable().
* [misc/main.c]
Implemented a few more of the SystemParametersInfo() cases.
Tue Nov 19 01:24:34 1996 Philippe De Muyter <phdm@info.ucl.ac.be>
* [include/keyboard.h]
New file, new macro WINE_VKEY_MAPPINGS (using code taken from event.c).
* [include/windows.h]
New [VK_A, VK_Z] and [VK_0, VK9] macros.
* [misc/keyboard.c]
Fixes in KeyTable and ToAscii.
* [objects/font.c]
FONT_init : Give default value for MSWIN "system" font.
FONT_MatchFont : Do not try every size of a font family if the
family does not exist.
* [windows/event.c]
lastEventChar hack removed.
KeyStateTable replaced by InputKeyStateTable (maintained in event.c)
and QueueKeyStateTable (maintained in message.c).
EVENT_key : Corrections to the extended bit setting.
* [windows/message.c] [windows/keyboard.c]
Implementation of a new QueueKeyStateTable : table of key states
valid when messages are retrieved by GetMessage or PeekMessage,
and valid for TranslateMessage.
TranslateMessage : Convert WM*KEY messages using QueueKeyStateTable
and ToAscii.
Mon Nov 18 16:59:01 1996 Robert Pouliot <krynos@clic.net>
* [graphics/Makefile.in] [graphics/wing.c]
[if1632/wing.spec]
Some functions for WinG support, mostly empty stubs.
* [misc/crtdll.c] [if1632/crtdll.spec]
Many functions added to CRTDLL, mostly calls to Unix C library.
1996-12-01 18:17:47 +01:00
|
|
|
|
1997-08-24 18:00:30 +02:00
|
|
|
/***********************************************************************
|
2001-07-02 21:59:40 +02:00
|
|
|
* send (WS2_32.19)
|
1997-08-24 18:00:30 +02:00
|
|
|
*/
|
2001-11-14 22:26:23 +01:00
|
|
|
int WINAPI WS_send(SOCKET s, const char *buf, int len, int flags)
|
1997-08-24 18:00:30 +02:00
|
|
|
{
|
2002-04-05 23:22:55 +02:00
|
|
|
DWORD n;
|
2002-07-03 23:06:58 +02:00
|
|
|
WSABUF wsabuf;
|
|
|
|
|
|
|
|
wsabuf.len = len;
|
|
|
|
wsabuf.buf = (char*) buf;
|
1997-08-24 18:00:30 +02:00
|
|
|
|
2010-07-18 02:53:06 +02:00
|
|
|
if ( WS2_sendto( s, &wsabuf, 1, &n, flags, NULL, 0, NULL, NULL) == SOCKET_ERROR )
|
2002-04-05 23:22:55 +02:00
|
|
|
return SOCKET_ERROR;
|
|
|
|
else
|
|
|
|
return n;
|
Release 961201
Sat Nov 30 19:21:17 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [configure]
Re-generated with autoconf 2.11. Let me know if you have
problems.
* [controls/listbox.c] [controls/oldlbox.c]
Listboxes rewritten from scratch. Moved old code still used by
comboboxes to oldlbox.c
* [misc/registry.c]
Use temporary file when saving registry.
* [windows/dialog.c]
Implemented Win32 version of DlgDirList() and DlgDirListComboBox().
* [windows/winproc.c]
Added translation for listbox Win32 messages.
Sat Nov 30 21:00:00 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [controls/widgets.c] [controls/button.c]
Fixed some incompatibilities with CTL3D DLL.
* [windows/dialog.c]
Made dialog windows fit into the desktop.
* [misc/winsock.c] [misc/winsock_async.c]
New Winsock engine.
* [windows/message.c]
GetMessage() fixes.
* [windows/queue.c] [windows/hook.c] [windows/win.c]
SetMessageQueue() fixes.
Fri Nov 29 10:25:12 1996 Slaven Rezic <eserte@cs.tu-berlin.de>
* [objects/text.c]
DrawText16(): Fixed return value.
Tue Nov 26 14:47:09 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/profile.c] [*/*]
Added Win32 profile functions, updated to new naming standard.
* [objects/font.c] [if1632/thunk.c] [include/windows.h]
Added EnumFonts32*, EnumFontFamiliesEx*, changed prototypes and
structures.
* [misc/ole2nls.c] [if1632/thunk.c]
Added EnumSystemLocales() (winhelp.exe).
* [misc/registry.c]
Added Windows 3.1 registry loader supplied by Tor Sjxwall, tor@sn.no
* [win32/file.c]
Partially fixed CreateFileMapping(), added UnmapViewOfFile().
Sat Nov 23 23:36:05 1996 Ronan Waide <waider@waider.ie>
* [misc/shell.c]
Fixed some FIXMEs relating to ShellExec() and FindExecutable().
* [misc/main.c]
Implemented a few more of the SystemParametersInfo() cases.
Tue Nov 19 01:24:34 1996 Philippe De Muyter <phdm@info.ucl.ac.be>
* [include/keyboard.h]
New file, new macro WINE_VKEY_MAPPINGS (using code taken from event.c).
* [include/windows.h]
New [VK_A, VK_Z] and [VK_0, VK9] macros.
* [misc/keyboard.c]
Fixes in KeyTable and ToAscii.
* [objects/font.c]
FONT_init : Give default value for MSWIN "system" font.
FONT_MatchFont : Do not try every size of a font family if the
family does not exist.
* [windows/event.c]
lastEventChar hack removed.
KeyStateTable replaced by InputKeyStateTable (maintained in event.c)
and QueueKeyStateTable (maintained in message.c).
EVENT_key : Corrections to the extended bit setting.
* [windows/message.c] [windows/keyboard.c]
Implementation of a new QueueKeyStateTable : table of key states
valid when messages are retrieved by GetMessage or PeekMessage,
and valid for TranslateMessage.
TranslateMessage : Convert WM*KEY messages using QueueKeyStateTable
and ToAscii.
Mon Nov 18 16:59:01 1996 Robert Pouliot <krynos@clic.net>
* [graphics/Makefile.in] [graphics/wing.c]
[if1632/wing.spec]
Some functions for WinG support, mostly empty stubs.
* [misc/crtdll.c] [if1632/crtdll.spec]
Many functions added to CRTDLL, mostly calls to Unix C library.
1996-12-01 18:17:47 +01:00
|
|
|
}
|
|
|
|
|
2001-04-10 23:22:34 +02:00
|
|
|
/***********************************************************************
|
2001-07-02 21:59:40 +02:00
|
|
|
* WSASend (WS2_32.72)
|
2001-04-10 23:22:34 +02:00
|
|
|
*/
|
|
|
|
INT WINAPI WSASend( SOCKET s, LPWSABUF lpBuffers, DWORD dwBufferCount,
|
|
|
|
LPDWORD lpNumberOfBytesSent, DWORD dwFlags,
|
|
|
|
LPWSAOVERLAPPED lpOverlapped,
|
|
|
|
LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine )
|
|
|
|
{
|
2010-07-18 02:53:06 +02:00
|
|
|
return WS2_sendto( s, lpBuffers, dwBufferCount, lpNumberOfBytesSent, dwFlags,
|
2005-01-14 20:54:38 +01:00
|
|
|
NULL, 0, lpOverlapped, lpCompletionRoutine );
|
2002-04-05 23:22:55 +02:00
|
|
|
}
|
2001-04-10 23:22:34 +02:00
|
|
|
|
2002-10-29 22:27:20 +01:00
|
|
|
/***********************************************************************
|
|
|
|
* WSASendDisconnect (WS2_32.73)
|
|
|
|
*/
|
|
|
|
INT WINAPI WSASendDisconnect( SOCKET s, LPWSABUF lpBuffers )
|
|
|
|
{
|
2005-01-14 20:54:38 +01:00
|
|
|
return WS_shutdown( s, SD_SEND );
|
2002-10-29 22:27:20 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-07-18 02:53:06 +02:00
|
|
|
/***********************************************************************
|
|
|
|
* WSASendTo (WS2_32.74)
|
|
|
|
*/
|
|
|
|
INT WINAPI WSASendTo( SOCKET s, LPWSABUF lpBuffers, DWORD dwBufferCount,
|
|
|
|
LPDWORD lpNumberOfBytesSent, DWORD dwFlags,
|
|
|
|
const struct WS_sockaddr *to, int tolen,
|
|
|
|
LPWSAOVERLAPPED lpOverlapped,
|
|
|
|
LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine )
|
|
|
|
{
|
2021-05-27 06:36:54 +02:00
|
|
|
/* Garena hooks WSASendTo(), so we need a wrapper */
|
2010-07-18 02:53:06 +02:00
|
|
|
return WS2_sendto( s, lpBuffers, dwBufferCount,
|
|
|
|
lpNumberOfBytesSent, dwFlags,
|
|
|
|
to, tolen,
|
|
|
|
lpOverlapped, lpCompletionRoutine );
|
|
|
|
}
|
|
|
|
|
1997-08-24 18:00:30 +02:00
|
|
|
/***********************************************************************
|
2001-07-02 21:59:40 +02:00
|
|
|
* sendto (WS2_32.20)
|
1997-08-24 18:00:30 +02:00
|
|
|
*/
|
2001-11-14 22:26:23 +01:00
|
|
|
int WINAPI WS_sendto(SOCKET s, const char *buf, int len, int flags,
|
|
|
|
const struct WS_sockaddr *to, int tolen)
|
1997-08-24 18:00:30 +02:00
|
|
|
{
|
2002-04-05 23:22:55 +02:00
|
|
|
DWORD n;
|
2002-07-03 23:06:58 +02:00
|
|
|
WSABUF wsabuf;
|
|
|
|
|
|
|
|
wsabuf.len = len;
|
|
|
|
wsabuf.buf = (char*) buf;
|
2001-10-08 22:36:03 +02:00
|
|
|
|
2010-07-18 02:53:06 +02:00
|
|
|
if ( WS2_sendto(s, &wsabuf, 1, &n, flags, to, tolen, NULL, NULL) == SOCKET_ERROR )
|
2002-04-05 23:22:55 +02:00
|
|
|
return SOCKET_ERROR;
|
2001-10-08 22:36:03 +02:00
|
|
|
else
|
2002-04-05 23:22:55 +02:00
|
|
|
return n;
|
Release 961201
Sat Nov 30 19:21:17 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [configure]
Re-generated with autoconf 2.11. Let me know if you have
problems.
* [controls/listbox.c] [controls/oldlbox.c]
Listboxes rewritten from scratch. Moved old code still used by
comboboxes to oldlbox.c
* [misc/registry.c]
Use temporary file when saving registry.
* [windows/dialog.c]
Implemented Win32 version of DlgDirList() and DlgDirListComboBox().
* [windows/winproc.c]
Added translation for listbox Win32 messages.
Sat Nov 30 21:00:00 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [controls/widgets.c] [controls/button.c]
Fixed some incompatibilities with CTL3D DLL.
* [windows/dialog.c]
Made dialog windows fit into the desktop.
* [misc/winsock.c] [misc/winsock_async.c]
New Winsock engine.
* [windows/message.c]
GetMessage() fixes.
* [windows/queue.c] [windows/hook.c] [windows/win.c]
SetMessageQueue() fixes.
Fri Nov 29 10:25:12 1996 Slaven Rezic <eserte@cs.tu-berlin.de>
* [objects/text.c]
DrawText16(): Fixed return value.
Tue Nov 26 14:47:09 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/profile.c] [*/*]
Added Win32 profile functions, updated to new naming standard.
* [objects/font.c] [if1632/thunk.c] [include/windows.h]
Added EnumFonts32*, EnumFontFamiliesEx*, changed prototypes and
structures.
* [misc/ole2nls.c] [if1632/thunk.c]
Added EnumSystemLocales() (winhelp.exe).
* [misc/registry.c]
Added Windows 3.1 registry loader supplied by Tor Sjxwall, tor@sn.no
* [win32/file.c]
Partially fixed CreateFileMapping(), added UnmapViewOfFile().
Sat Nov 23 23:36:05 1996 Ronan Waide <waider@waider.ie>
* [misc/shell.c]
Fixed some FIXMEs relating to ShellExec() and FindExecutable().
* [misc/main.c]
Implemented a few more of the SystemParametersInfo() cases.
Tue Nov 19 01:24:34 1996 Philippe De Muyter <phdm@info.ucl.ac.be>
* [include/keyboard.h]
New file, new macro WINE_VKEY_MAPPINGS (using code taken from event.c).
* [include/windows.h]
New [VK_A, VK_Z] and [VK_0, VK9] macros.
* [misc/keyboard.c]
Fixes in KeyTable and ToAscii.
* [objects/font.c]
FONT_init : Give default value for MSWIN "system" font.
FONT_MatchFont : Do not try every size of a font family if the
family does not exist.
* [windows/event.c]
lastEventChar hack removed.
KeyStateTable replaced by InputKeyStateTable (maintained in event.c)
and QueueKeyStateTable (maintained in message.c).
EVENT_key : Corrections to the extended bit setting.
* [windows/message.c] [windows/keyboard.c]
Implementation of a new QueueKeyStateTable : table of key states
valid when messages are retrieved by GetMessage or PeekMessage,
and valid for TranslateMessage.
TranslateMessage : Convert WM*KEY messages using QueueKeyStateTable
and ToAscii.
Mon Nov 18 16:59:01 1996 Robert Pouliot <krynos@clic.net>
* [graphics/Makefile.in] [graphics/wing.c]
[if1632/wing.spec]
Some functions for WinG support, mostly empty stubs.
* [misc/crtdll.c] [if1632/crtdll.spec]
Many functions added to CRTDLL, mostly calls to Unix C library.
1996-12-01 18:17:47 +01:00
|
|
|
}
|
|
|
|
|
2021-06-23 18:23:45 +02:00
|
|
|
|
|
|
|
static int server_setsockopt( SOCKET s, ULONG code, const char *optval, int optlen )
|
|
|
|
{
|
|
|
|
IO_STATUS_BLOCK io;
|
|
|
|
NTSTATUS status;
|
|
|
|
|
|
|
|
status = NtDeviceIoControlFile( (HANDLE)s, NULL, NULL, NULL, &io, code, (void *)optval, optlen, NULL, 0 );
|
|
|
|
SetLastError( NtStatusToWSAError( status ) );
|
|
|
|
return status ? -1 : 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
1997-08-24 18:00:30 +02:00
|
|
|
/***********************************************************************
|
2001-07-02 21:59:40 +02:00
|
|
|
* setsockopt (WS2_32.21)
|
1997-08-24 18:00:30 +02:00
|
|
|
*/
|
2002-06-01 01:06:46 +02:00
|
|
|
int WINAPI WS_setsockopt(SOCKET s, int level, int optname,
|
2010-08-15 18:42:17 +02:00
|
|
|
const char *optval, int optlen)
|
1997-08-24 18:00:30 +02:00
|
|
|
{
|
2001-12-14 23:48:38 +01:00
|
|
|
int fd;
|
2003-12-02 05:19:56 +01:00
|
|
|
int woptval;
|
2019-10-18 19:32:53 +02:00
|
|
|
struct ip_mreq_source mreq_source;
|
2003-12-02 05:19:56 +01:00
|
|
|
|
2015-04-02 05:17:39 +02:00
|
|
|
TRACE("(socket %04lx, %s, optval %s, optlen %d)\n", s,
|
|
|
|
debugstr_sockopt(level, optname), debugstr_optval(optval, optlen),
|
|
|
|
optlen);
|
2001-12-14 23:48:38 +01:00
|
|
|
|
2007-11-12 11:42:28 +01:00
|
|
|
/* some broken apps pass the value directly instead of a pointer to it */
|
2010-08-15 18:42:17 +02:00
|
|
|
if(optlen && IS_INTRESOURCE(optval))
|
2007-11-12 11:42:28 +01:00
|
|
|
{
|
|
|
|
SetLastError(WSAEFAULT);
|
|
|
|
return SOCKET_ERROR;
|
|
|
|
}
|
|
|
|
|
2006-12-05 11:35:18 +01:00
|
|
|
switch(level)
|
2001-12-14 23:48:38 +01:00
|
|
|
{
|
2006-12-05 11:35:18 +01:00
|
|
|
case WS_SOL_SOCKET:
|
|
|
|
switch(optname)
|
2001-12-14 23:48:38 +01:00
|
|
|
{
|
2021-06-23 18:23:45 +02:00
|
|
|
case WS_SO_BROADCAST:
|
|
|
|
return server_setsockopt( s, IOCTL_AFD_WINE_SET_SO_BROADCAST, optval, optlen );
|
|
|
|
|
2021-06-25 05:32:48 +02:00
|
|
|
case WS_SO_DONTLINGER:
|
|
|
|
{
|
|
|
|
struct WS_linger linger;
|
|
|
|
|
|
|
|
if (!optval)
|
|
|
|
{
|
|
|
|
SetLastError( WSAEFAULT );
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
linger.l_onoff = !*(const BOOL *)optval;
|
|
|
|
linger.l_linger = 0;
|
|
|
|
return WS_setsockopt( s, WS_SOL_SOCKET, WS_SO_LINGER, (char *)&linger, sizeof(linger) );
|
|
|
|
}
|
|
|
|
|
2021-06-24 07:00:13 +02:00
|
|
|
case WS_SO_ERROR:
|
|
|
|
FIXME( "SO_ERROR, stub!\n" );
|
|
|
|
SetLastError( WSAENOPROTOOPT );
|
|
|
|
return -1;
|
|
|
|
|
2021-06-24 07:00:15 +02:00
|
|
|
case WS_SO_KEEPALIVE:
|
|
|
|
return server_setsockopt( s, IOCTL_AFD_WINE_SET_SO_KEEPALIVE, optval, optlen );
|
|
|
|
|
2021-06-25 05:32:46 +02:00
|
|
|
case WS_SO_LINGER:
|
|
|
|
return server_setsockopt( s, IOCTL_AFD_WINE_SET_SO_LINGER, optval, optlen );
|
|
|
|
|
2021-06-25 05:32:50 +02:00
|
|
|
case WS_SO_OOBINLINE:
|
|
|
|
return server_setsockopt( s, IOCTL_AFD_WINE_SET_SO_OOBINLINE, optval, optlen );
|
|
|
|
|
2021-06-26 03:21:07 +02:00
|
|
|
case WS_SO_RCVBUF:
|
|
|
|
return server_setsockopt( s, IOCTL_AFD_WINE_SET_SO_RCVBUF, optval, optlen );
|
|
|
|
|
2021-06-29 18:43:20 +02:00
|
|
|
case WS_SO_RCVTIMEO:
|
|
|
|
return server_setsockopt( s, IOCTL_AFD_WINE_SET_SO_RCVTIMEO, optval, optlen );
|
|
|
|
|
2021-06-29 18:43:22 +02:00
|
|
|
case WS_SO_REUSEADDR:
|
|
|
|
return server_setsockopt( s, IOCTL_AFD_WINE_SET_SO_REUSEADDR, optval, optlen );
|
|
|
|
|
2018-11-19 09:33:31 +01:00
|
|
|
case WS_SO_SNDBUF:
|
2021-06-30 06:25:41 +02:00
|
|
|
return server_setsockopt( s, IOCTL_AFD_WINE_SET_SO_SNDBUF, optval, optlen );
|
2018-11-19 09:33:31 +01:00
|
|
|
|
2021-06-30 06:25:43 +02:00
|
|
|
case WS_SO_SNDTIMEO:
|
|
|
|
return server_setsockopt( s, IOCTL_AFD_WINE_SET_SO_SNDTIMEO, optval, optlen );
|
|
|
|
|
2006-12-05 11:35:18 +01:00
|
|
|
/* SO_DEBUG is a privileged operation, ignore it. */
|
|
|
|
case WS_SO_DEBUG:
|
|
|
|
TRACE("Ignoring SO_DEBUG\n");
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
/* For some reason the game GrandPrixLegends does set SO_DONTROUTE on its
|
|
|
|
* socket. According to MSDN, this option is silently ignored.*/
|
|
|
|
case WS_SO_DONTROUTE:
|
|
|
|
TRACE("Ignoring SO_DONTROUTE\n");
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
/* Stops two sockets from being bound to the same port. Always happens
|
|
|
|
* on unix systems, so just drop it. */
|
|
|
|
case WS_SO_EXCLUSIVEADDRUSE:
|
|
|
|
TRACE("Ignoring SO_EXCLUSIVEADDRUSE, is always set.\n");
|
|
|
|
return 0;
|
|
|
|
|
2010-08-15 18:42:17 +02:00
|
|
|
/* After a ConnectEx call succeeds, the socket can't be used with half of the
|
|
|
|
* normal winsock functions on windows. We don't have that problem. */
|
|
|
|
case WS_SO_UPDATE_CONNECT_CONTEXT:
|
2010-08-24 10:02:21 +02:00
|
|
|
TRACE("Ignoring SO_UPDATE_CONNECT_CONTEXT, since our sockets are normal\n");
|
2010-08-15 18:42:17 +02:00
|
|
|
return 0;
|
|
|
|
|
2010-09-28 04:59:58 +02:00
|
|
|
/* After a AcceptEx call succeeds, the socket can't be used with half of the
|
|
|
|
* normal winsock functions on windows. We don't have that problem. */
|
|
|
|
case WS_SO_UPDATE_ACCEPT_CONTEXT:
|
|
|
|
TRACE("Ignoring SO_UPDATE_ACCEPT_CONTEXT, since our sockets are normal\n");
|
|
|
|
return 0;
|
|
|
|
|
2006-12-05 11:35:18 +01:00
|
|
|
/* SO_OPENTYPE does not require a valid socket handle. */
|
|
|
|
case WS_SO_OPENTYPE:
|
|
|
|
if (!optlen || optlen < sizeof(int) || !optval)
|
|
|
|
{
|
|
|
|
SetLastError(WSAEFAULT);
|
|
|
|
return SOCKET_ERROR;
|
|
|
|
}
|
|
|
|
get_per_thread_data()->opentype = *(const int *)optval;
|
2010-03-28 16:43:07 +02:00
|
|
|
TRACE("setting global SO_OPENTYPE = 0x%x\n", *((const int*)optval) );
|
2006-12-05 11:35:18 +01:00
|
|
|
return 0;
|
|
|
|
|
2018-02-26 04:06:36 +01:00
|
|
|
case WS_SO_RANDOMIZE_PORT:
|
|
|
|
FIXME("Ignoring WS_SO_RANDOMIZE_PORT\n");
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
case WS_SO_PORT_SCALABILITY:
|
|
|
|
FIXME("Ignoring WS_SO_PORT_SCALABILITY\n");
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
case WS_SO_REUSE_UNICASTPORT:
|
|
|
|
FIXME("Ignoring WS_SO_REUSE_UNICASTPORT\n");
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
case WS_SO_REUSE_MULTICASTPORT:
|
|
|
|
FIXME("Ignoring WS_SO_REUSE_MULTICASTPORT\n");
|
|
|
|
return 0;
|
|
|
|
|
2006-12-05 11:35:18 +01:00
|
|
|
default:
|
|
|
|
TRACE("Unknown SOL_SOCKET optname: 0x%08x\n", optname);
|
2021-06-22 17:24:13 +02:00
|
|
|
/* fall through */
|
|
|
|
|
|
|
|
case WS_SO_ACCEPTCONN:
|
2021-06-22 17:24:15 +02:00
|
|
|
case WS_SO_TYPE:
|
2006-12-05 11:35:18 +01:00
|
|
|
SetLastError(WSAENOPROTOOPT);
|
|
|
|
return SOCKET_ERROR;
|
2003-12-02 05:19:56 +01:00
|
|
|
}
|
2006-12-05 11:35:18 +01:00
|
|
|
break; /* case WS_SOL_SOCKET */
|
|
|
|
|
2013-06-17 21:56:52 +02:00
|
|
|
#ifdef HAS_IPX
|
2013-12-27 16:48:40 +01:00
|
|
|
case WS_NSPROTO_IPX:
|
2006-12-05 11:35:18 +01:00
|
|
|
switch(optname)
|
2003-12-02 05:19:56 +01:00
|
|
|
{
|
2015-01-04 19:57:47 +01:00
|
|
|
case WS_IPX_PTYPE:
|
2013-12-31 01:24:56 +01:00
|
|
|
return set_ipx_packettype(s, *(int*)optval);
|
2006-12-05 11:35:18 +01:00
|
|
|
|
2015-01-04 19:57:47 +01:00
|
|
|
case WS_IPX_FILTERPTYPE:
|
2006-12-05 11:35:18 +01:00
|
|
|
/* Sets the receive filter packet type, at the moment we don't support it */
|
|
|
|
FIXME("IPX_FILTERPTYPE: %x\n", *optval);
|
|
|
|
/* Returning 0 is better for now than returning a SOCKET_ERROR */
|
2000-10-13 19:05:35 +02:00
|
|
|
return 0;
|
2006-12-05 11:35:18 +01:00
|
|
|
|
|
|
|
default:
|
|
|
|
FIXME("opt_name:%x\n", optname);
|
|
|
|
return SOCKET_ERROR;
|
2000-10-13 19:05:35 +02:00
|
|
|
}
|
2013-12-27 16:48:40 +01:00
|
|
|
break; /* case WS_NSPROTO_IPX */
|
2006-12-05 11:35:18 +01:00
|
|
|
#endif
|
2000-10-13 19:05:35 +02:00
|
|
|
|
2006-12-05 11:35:18 +01:00
|
|
|
/* Levels WS_IPPROTO_TCP and WS_IPPROTO_IP convert directly */
|
|
|
|
case WS_IPPROTO_TCP:
|
|
|
|
switch(optname)
|
|
|
|
{
|
|
|
|
case WS_TCP_NODELAY:
|
|
|
|
convert_sockopt(&level, &optname);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
FIXME("Unknown IPPROTO_TCP optname 0x%08x\n", optname);
|
|
|
|
return SOCKET_ERROR;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case WS_IPPROTO_IP:
|
|
|
|
switch(optname)
|
|
|
|
{
|
2021-07-01 03:24:39 +02:00
|
|
|
case WS_IP_ADD_MEMBERSHIP:
|
|
|
|
return server_setsockopt( s, IOCTL_AFD_WINE_SET_IP_ADD_MEMBERSHIP, optval, optlen );
|
|
|
|
|
2019-10-18 19:32:53 +02:00
|
|
|
case WS_IP_ADD_SOURCE_MEMBERSHIP:
|
2021-07-02 00:10:25 +02:00
|
|
|
return server_setsockopt( s, IOCTL_AFD_WINE_SET_IP_ADD_SOURCE_MEMBERSHIP, optval, optlen );
|
|
|
|
|
2019-10-18 19:32:53 +02:00
|
|
|
case WS_IP_BLOCK_SOURCE:
|
2021-07-02 00:10:26 +02:00
|
|
|
return server_setsockopt( s, IOCTL_AFD_WINE_SET_IP_BLOCK_SOURCE, optval, optlen );
|
|
|
|
|
2021-07-02 00:10:28 +02:00
|
|
|
case WS_IP_DONTFRAGMENT:
|
|
|
|
return server_setsockopt( s, IOCTL_AFD_WINE_SET_IP_DONTFRAGMENT, optval, optlen );
|
|
|
|
|
2021-07-07 06:48:44 +02:00
|
|
|
case WS_IP_DROP_MEMBERSHIP:
|
|
|
|
return server_setsockopt( s, IOCTL_AFD_WINE_SET_IP_DROP_MEMBERSHIP, optval, optlen );
|
|
|
|
|
2021-07-02 00:10:26 +02:00
|
|
|
case WS_IP_DROP_SOURCE_MEMBERSHIP:
|
2021-07-07 06:48:45 +02:00
|
|
|
return server_setsockopt( s, IOCTL_AFD_WINE_SET_IP_DROP_SOURCE_MEMBERSHIP, optval, optlen );
|
|
|
|
|
2021-07-08 03:16:39 +02:00
|
|
|
case WS_IP_HDRINCL:
|
|
|
|
return server_setsockopt( s, IOCTL_AFD_WINE_SET_IP_HDRINCL, optval, optlen );
|
|
|
|
|
2021-07-08 03:16:41 +02:00
|
|
|
case WS_IP_MULTICAST_IF:
|
|
|
|
return server_setsockopt( s, IOCTL_AFD_WINE_SET_IP_MULTICAST_IF, optval, optlen );
|
|
|
|
|
2019-10-18 19:32:53 +02:00
|
|
|
case WS_IP_UNBLOCK_SOURCE:
|
|
|
|
{
|
|
|
|
WS_IP_MREQ_SOURCE* val = (void*)optval;
|
|
|
|
mreq_source.imr_interface.s_addr = val->imr_interface.S_un.S_addr;
|
|
|
|
mreq_source.imr_multiaddr.s_addr = val->imr_multiaddr.S_un.S_addr;
|
|
|
|
mreq_source.imr_sourceaddr.s_addr = val->imr_sourceaddr.S_un.S_addr;
|
|
|
|
|
|
|
|
optval = (char*)&mreq_source;
|
|
|
|
optlen = sizeof(mreq_source);
|
|
|
|
|
|
|
|
convert_sockopt(&level, &optname);
|
|
|
|
break;
|
|
|
|
}
|
2006-12-05 11:35:18 +01:00
|
|
|
case WS_IP_MULTICAST_LOOP:
|
|
|
|
case WS_IP_MULTICAST_TTL:
|
|
|
|
case WS_IP_OPTIONS:
|
2019-08-01 06:11:28 +02:00
|
|
|
#if defined(IP_PKTINFO) || defined(IP_RECVDSTADDR)
|
2010-12-06 01:08:54 +01:00
|
|
|
case WS_IP_PKTINFO:
|
|
|
|
#endif
|
2006-12-05 11:35:18 +01:00
|
|
|
case WS_IP_TOS:
|
|
|
|
case WS_IP_TTL:
|
2012-04-09 21:06:08 +02:00
|
|
|
#ifdef IP_UNICAST_IF
|
|
|
|
case WS_IP_UNICAST_IF:
|
|
|
|
#endif
|
2006-12-05 11:35:18 +01:00
|
|
|
convert_sockopt(&level, &optname);
|
|
|
|
break;
|
2021-07-02 00:10:28 +02:00
|
|
|
|
2006-12-05 11:35:18 +01:00
|
|
|
default:
|
|
|
|
FIXME("Unknown IPPROTO_IP optname 0x%08x\n", optname);
|
|
|
|
return SOCKET_ERROR;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2010-03-31 00:07:24 +02:00
|
|
|
case WS_IPPROTO_IPV6:
|
|
|
|
switch(optname)
|
|
|
|
{
|
2010-04-02 19:54:44 +02:00
|
|
|
#ifdef IPV6_ADD_MEMBERSHIP
|
2010-03-31 00:07:24 +02:00
|
|
|
case WS_IPV6_ADD_MEMBERSHIP:
|
2010-04-02 19:54:44 +02:00
|
|
|
#endif
|
|
|
|
#ifdef IPV6_DROP_MEMBERSHIP
|
2010-03-31 00:07:24 +02:00
|
|
|
case WS_IPV6_DROP_MEMBERSHIP:
|
2010-04-02 19:54:44 +02:00
|
|
|
#endif
|
2010-03-31 00:07:24 +02:00
|
|
|
case WS_IPV6_MULTICAST_IF:
|
|
|
|
case WS_IPV6_MULTICAST_HOPS:
|
|
|
|
case WS_IPV6_MULTICAST_LOOP:
|
|
|
|
case WS_IPV6_UNICAST_HOPS:
|
2012-04-09 21:06:30 +02:00
|
|
|
#ifdef IPV6_UNICAST_IF
|
|
|
|
case WS_IPV6_UNICAST_IF:
|
|
|
|
#endif
|
2010-03-31 00:07:24 +02:00
|
|
|
convert_sockopt(&level, &optname);
|
|
|
|
break;
|
|
|
|
case WS_IPV6_DONTFRAG:
|
2016-12-07 07:27:26 +01:00
|
|
|
return set_dont_fragment(s, IPPROTO_IPV6, *(BOOL *)optval) ? 0 : SOCKET_ERROR;
|
2012-04-01 10:23:17 +02:00
|
|
|
case WS_IPV6_PROTECTION_LEVEL:
|
|
|
|
FIXME("IPV6_PROTECTION_LEVEL is ignored!\n");
|
|
|
|
return 0;
|
2017-01-12 06:27:08 +01:00
|
|
|
case WS_IPV6_V6ONLY:
|
|
|
|
{
|
|
|
|
union generic_unix_sockaddr uaddr;
|
|
|
|
socklen_t uaddrlen;
|
|
|
|
int bound;
|
|
|
|
|
|
|
|
fd = get_sock_fd( s, 0, NULL );
|
|
|
|
if (fd == -1) return SOCKET_ERROR;
|
|
|
|
|
|
|
|
bound = is_fd_bound(fd, &uaddr, &uaddrlen);
|
|
|
|
release_sock_fd( s, fd );
|
|
|
|
if (bound == 0 && uaddr.addr.sa_family == AF_INET)
|
|
|
|
{
|
|
|
|
/* Changing IPV6_V6ONLY succeeds on AF_INET (IPv4) socket
|
|
|
|
* on Windows (with IPv6 support) if the socket is unbound.
|
|
|
|
* It is essentially a noop, though Windows does store the value
|
|
|
|
*/
|
|
|
|
WARN("Silently ignoring IPPROTO_IPV6+IPV6_V6ONLY on AF_INET socket\n");
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
level = IPPROTO_IPV6;
|
|
|
|
optname = IPV6_V6ONLY;
|
|
|
|
break;
|
|
|
|
}
|
2010-03-31 00:07:24 +02:00
|
|
|
default:
|
|
|
|
FIXME("Unknown IPPROTO_IPV6 optname 0x%08x\n", optname);
|
|
|
|
return SOCKET_ERROR;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2006-12-05 11:35:18 +01:00
|
|
|
default:
|
2009-08-24 23:39:18 +02:00
|
|
|
WARN("Unknown level: 0x%08x\n", level);
|
|
|
|
SetLastError(WSAEINVAL);
|
2006-12-05 11:35:18 +01:00
|
|
|
return SOCKET_ERROR;
|
|
|
|
} /* end switch(level) */
|
2003-12-02 05:19:56 +01:00
|
|
|
|
2006-12-05 11:35:18 +01:00
|
|
|
/* avoid endianness issues if argument is a 16-bit int */
|
|
|
|
if (optval && optlen < sizeof(int))
|
|
|
|
{
|
|
|
|
woptval= *((const INT16 *) optval);
|
|
|
|
optval= (char*) &woptval;
|
2014-12-05 05:26:34 +01:00
|
|
|
woptval&= (1 << optlen * 8) - 1;
|
2006-12-05 11:35:18 +01:00
|
|
|
optlen=sizeof(int);
|
|
|
|
}
|
2003-12-02 05:19:56 +01:00
|
|
|
fd = get_sock_fd( s, 0, NULL );
|
|
|
|
if (fd == -1) return SOCKET_ERROR;
|
|
|
|
|
|
|
|
if (setsockopt(fd, level, optname, optval, optlen) == 0)
|
|
|
|
{
|
2013-01-11 17:22:59 +01:00
|
|
|
#ifdef __APPLE__
|
|
|
|
if (level == SOL_SOCKET && optname == SO_REUSEADDR &&
|
|
|
|
setsockopt(fd, level, SO_REUSEPORT, optval, optlen) != 0)
|
|
|
|
{
|
|
|
|
SetLastError(wsaErrno());
|
|
|
|
release_sock_fd( s, fd );
|
|
|
|
return SOCKET_ERROR;
|
|
|
|
}
|
|
|
|
#endif
|
2003-12-02 05:19:56 +01:00
|
|
|
release_sock_fd( s, fd );
|
|
|
|
return 0;
|
1997-08-24 18:00:30 +02:00
|
|
|
}
|
2003-12-02 05:19:56 +01:00
|
|
|
TRACE("Setting socket error, %d\n", wsaErrno());
|
|
|
|
SetLastError(wsaErrno());
|
|
|
|
release_sock_fd( s, fd );
|
2006-12-05 11:35:18 +01:00
|
|
|
|
1997-08-24 18:00:30 +02:00
|
|
|
return SOCKET_ERROR;
|
|
|
|
}
|
|
|
|
|
2021-05-19 05:35:51 +02:00
|
|
|
|
1997-08-24 18:00:30 +02:00
|
|
|
/***********************************************************************
|
2021-05-19 05:35:51 +02:00
|
|
|
* shutdown (ws2_32.22)
|
1997-08-24 18:00:30 +02:00
|
|
|
*/
|
2021-05-19 05:35:51 +02:00
|
|
|
int WINAPI WS_shutdown( SOCKET s, int how )
|
Release 961201
Sat Nov 30 19:21:17 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [configure]
Re-generated with autoconf 2.11. Let me know if you have
problems.
* [controls/listbox.c] [controls/oldlbox.c]
Listboxes rewritten from scratch. Moved old code still used by
comboboxes to oldlbox.c
* [misc/registry.c]
Use temporary file when saving registry.
* [windows/dialog.c]
Implemented Win32 version of DlgDirList() and DlgDirListComboBox().
* [windows/winproc.c]
Added translation for listbox Win32 messages.
Sat Nov 30 21:00:00 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [controls/widgets.c] [controls/button.c]
Fixed some incompatibilities with CTL3D DLL.
* [windows/dialog.c]
Made dialog windows fit into the desktop.
* [misc/winsock.c] [misc/winsock_async.c]
New Winsock engine.
* [windows/message.c]
GetMessage() fixes.
* [windows/queue.c] [windows/hook.c] [windows/win.c]
SetMessageQueue() fixes.
Fri Nov 29 10:25:12 1996 Slaven Rezic <eserte@cs.tu-berlin.de>
* [objects/text.c]
DrawText16(): Fixed return value.
Tue Nov 26 14:47:09 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/profile.c] [*/*]
Added Win32 profile functions, updated to new naming standard.
* [objects/font.c] [if1632/thunk.c] [include/windows.h]
Added EnumFonts32*, EnumFontFamiliesEx*, changed prototypes and
structures.
* [misc/ole2nls.c] [if1632/thunk.c]
Added EnumSystemLocales() (winhelp.exe).
* [misc/registry.c]
Added Windows 3.1 registry loader supplied by Tor Sjxwall, tor@sn.no
* [win32/file.c]
Partially fixed CreateFileMapping(), added UnmapViewOfFile().
Sat Nov 23 23:36:05 1996 Ronan Waide <waider@waider.ie>
* [misc/shell.c]
Fixed some FIXMEs relating to ShellExec() and FindExecutable().
* [misc/main.c]
Implemented a few more of the SystemParametersInfo() cases.
Tue Nov 19 01:24:34 1996 Philippe De Muyter <phdm@info.ucl.ac.be>
* [include/keyboard.h]
New file, new macro WINE_VKEY_MAPPINGS (using code taken from event.c).
* [include/windows.h]
New [VK_A, VK_Z] and [VK_0, VK9] macros.
* [misc/keyboard.c]
Fixes in KeyTable and ToAscii.
* [objects/font.c]
FONT_init : Give default value for MSWIN "system" font.
FONT_MatchFont : Do not try every size of a font family if the
family does not exist.
* [windows/event.c]
lastEventChar hack removed.
KeyStateTable replaced by InputKeyStateTable (maintained in event.c)
and QueueKeyStateTable (maintained in message.c).
EVENT_key : Corrections to the extended bit setting.
* [windows/message.c] [windows/keyboard.c]
Implementation of a new QueueKeyStateTable : table of key states
valid when messages are retrieved by GetMessage or PeekMessage,
and valid for TranslateMessage.
TranslateMessage : Convert WM*KEY messages using QueueKeyStateTable
and ToAscii.
Mon Nov 18 16:59:01 1996 Robert Pouliot <krynos@clic.net>
* [graphics/Makefile.in] [graphics/wing.c]
[if1632/wing.spec]
Some functions for WinG support, mostly empty stubs.
* [misc/crtdll.c] [if1632/crtdll.spec]
Many functions added to CRTDLL, mostly calls to Unix C library.
1996-12-01 18:17:47 +01:00
|
|
|
{
|
2021-05-19 05:35:51 +02:00
|
|
|
IO_STATUS_BLOCK io;
|
|
|
|
NTSTATUS status;
|
2002-04-25 23:34:24 +02:00
|
|
|
|
2021-05-19 05:35:51 +02:00
|
|
|
TRACE( "socket %#lx, how %u\n", s, how );
|
2002-04-25 23:34:24 +02:00
|
|
|
|
2021-05-19 05:35:51 +02:00
|
|
|
status = NtDeviceIoControlFile( (HANDLE)s, NULL, NULL, NULL, &io,
|
|
|
|
IOCTL_AFD_WINE_SHUTDOWN, &how, sizeof(how), NULL, 0 );
|
|
|
|
SetLastError( NtStatusToWSAError( status ) );
|
|
|
|
return status ? -1 : 0;
|
1997-08-24 18:00:30 +02:00
|
|
|
}
|
|
|
|
|
2021-05-19 05:35:51 +02:00
|
|
|
|
1997-08-24 18:00:30 +02:00
|
|
|
/***********************************************************************
|
2001-07-02 21:59:40 +02:00
|
|
|
* socket (WS2_32.23)
|
1997-08-24 18:00:30 +02:00
|
|
|
*/
|
2001-11-14 22:26:23 +01:00
|
|
|
SOCKET WINAPI WS_socket(int af, int type, int protocol)
|
Release 961201
Sat Nov 30 19:21:17 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [configure]
Re-generated with autoconf 2.11. Let me know if you have
problems.
* [controls/listbox.c] [controls/oldlbox.c]
Listboxes rewritten from scratch. Moved old code still used by
comboboxes to oldlbox.c
* [misc/registry.c]
Use temporary file when saving registry.
* [windows/dialog.c]
Implemented Win32 version of DlgDirList() and DlgDirListComboBox().
* [windows/winproc.c]
Added translation for listbox Win32 messages.
Sat Nov 30 21:00:00 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [controls/widgets.c] [controls/button.c]
Fixed some incompatibilities with CTL3D DLL.
* [windows/dialog.c]
Made dialog windows fit into the desktop.
* [misc/winsock.c] [misc/winsock_async.c]
New Winsock engine.
* [windows/message.c]
GetMessage() fixes.
* [windows/queue.c] [windows/hook.c] [windows/win.c]
SetMessageQueue() fixes.
Fri Nov 29 10:25:12 1996 Slaven Rezic <eserte@cs.tu-berlin.de>
* [objects/text.c]
DrawText16(): Fixed return value.
Tue Nov 26 14:47:09 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/profile.c] [*/*]
Added Win32 profile functions, updated to new naming standard.
* [objects/font.c] [if1632/thunk.c] [include/windows.h]
Added EnumFonts32*, EnumFontFamiliesEx*, changed prototypes and
structures.
* [misc/ole2nls.c] [if1632/thunk.c]
Added EnumSystemLocales() (winhelp.exe).
* [misc/registry.c]
Added Windows 3.1 registry loader supplied by Tor Sjxwall, tor@sn.no
* [win32/file.c]
Partially fixed CreateFileMapping(), added UnmapViewOfFile().
Sat Nov 23 23:36:05 1996 Ronan Waide <waider@waider.ie>
* [misc/shell.c]
Fixed some FIXMEs relating to ShellExec() and FindExecutable().
* [misc/main.c]
Implemented a few more of the SystemParametersInfo() cases.
Tue Nov 19 01:24:34 1996 Philippe De Muyter <phdm@info.ucl.ac.be>
* [include/keyboard.h]
New file, new macro WINE_VKEY_MAPPINGS (using code taken from event.c).
* [include/windows.h]
New [VK_A, VK_Z] and [VK_0, VK9] macros.
* [misc/keyboard.c]
Fixes in KeyTable and ToAscii.
* [objects/font.c]
FONT_init : Give default value for MSWIN "system" font.
FONT_MatchFont : Do not try every size of a font family if the
family does not exist.
* [windows/event.c]
lastEventChar hack removed.
KeyStateTable replaced by InputKeyStateTable (maintained in event.c)
and QueueKeyStateTable (maintained in message.c).
EVENT_key : Corrections to the extended bit setting.
* [windows/message.c] [windows/keyboard.c]
Implementation of a new QueueKeyStateTable : table of key states
valid when messages are retrieved by GetMessage or PeekMessage,
and valid for TranslateMessage.
TranslateMessage : Convert WM*KEY messages using QueueKeyStateTable
and ToAscii.
Mon Nov 18 16:59:01 1996 Robert Pouliot <krynos@clic.net>
* [graphics/Makefile.in] [graphics/wing.c]
[if1632/wing.spec]
Some functions for WinG support, mostly empty stubs.
* [misc/crtdll.c] [if1632/crtdll.spec]
Many functions added to CRTDLL, mostly calls to Unix C library.
1996-12-01 18:17:47 +01:00
|
|
|
{
|
2001-02-20 02:57:13 +01:00
|
|
|
TRACE("af=%d type=%d protocol=%d\n", af, type, protocol);
|
Release 961201
Sat Nov 30 19:21:17 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [configure]
Re-generated with autoconf 2.11. Let me know if you have
problems.
* [controls/listbox.c] [controls/oldlbox.c]
Listboxes rewritten from scratch. Moved old code still used by
comboboxes to oldlbox.c
* [misc/registry.c]
Use temporary file when saving registry.
* [windows/dialog.c]
Implemented Win32 version of DlgDirList() and DlgDirListComboBox().
* [windows/winproc.c]
Added translation for listbox Win32 messages.
Sat Nov 30 21:00:00 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [controls/widgets.c] [controls/button.c]
Fixed some incompatibilities with CTL3D DLL.
* [windows/dialog.c]
Made dialog windows fit into the desktop.
* [misc/winsock.c] [misc/winsock_async.c]
New Winsock engine.
* [windows/message.c]
GetMessage() fixes.
* [windows/queue.c] [windows/hook.c] [windows/win.c]
SetMessageQueue() fixes.
Fri Nov 29 10:25:12 1996 Slaven Rezic <eserte@cs.tu-berlin.de>
* [objects/text.c]
DrawText16(): Fixed return value.
Tue Nov 26 14:47:09 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/profile.c] [*/*]
Added Win32 profile functions, updated to new naming standard.
* [objects/font.c] [if1632/thunk.c] [include/windows.h]
Added EnumFonts32*, EnumFontFamiliesEx*, changed prototypes and
structures.
* [misc/ole2nls.c] [if1632/thunk.c]
Added EnumSystemLocales() (winhelp.exe).
* [misc/registry.c]
Added Windows 3.1 registry loader supplied by Tor Sjxwall, tor@sn.no
* [win32/file.c]
Partially fixed CreateFileMapping(), added UnmapViewOfFile().
Sat Nov 23 23:36:05 1996 Ronan Waide <waider@waider.ie>
* [misc/shell.c]
Fixed some FIXMEs relating to ShellExec() and FindExecutable().
* [misc/main.c]
Implemented a few more of the SystemParametersInfo() cases.
Tue Nov 19 01:24:34 1996 Philippe De Muyter <phdm@info.ucl.ac.be>
* [include/keyboard.h]
New file, new macro WINE_VKEY_MAPPINGS (using code taken from event.c).
* [include/windows.h]
New [VK_A, VK_Z] and [VK_0, VK9] macros.
* [misc/keyboard.c]
Fixes in KeyTable and ToAscii.
* [objects/font.c]
FONT_init : Give default value for MSWIN "system" font.
FONT_MatchFont : Do not try every size of a font family if the
family does not exist.
* [windows/event.c]
lastEventChar hack removed.
KeyStateTable replaced by InputKeyStateTable (maintained in event.c)
and QueueKeyStateTable (maintained in message.c).
EVENT_key : Corrections to the extended bit setting.
* [windows/message.c] [windows/keyboard.c]
Implementation of a new QueueKeyStateTable : table of key states
valid when messages are retrieved by GetMessage or PeekMessage,
and valid for TranslateMessage.
TranslateMessage : Convert WM*KEY messages using QueueKeyStateTable
and ToAscii.
Mon Nov 18 16:59:01 1996 Robert Pouliot <krynos@clic.net>
* [graphics/Makefile.in] [graphics/wing.c]
[if1632/wing.spec]
Some functions for WinG support, mostly empty stubs.
* [misc/crtdll.c] [if1632/crtdll.spec]
Many functions added to CRTDLL, mostly calls to Unix C library.
1996-12-01 18:17:47 +01:00
|
|
|
|
2015-04-07 01:56:29 +02:00
|
|
|
return WSASocketW( af, type, protocol, NULL, 0,
|
2005-01-14 20:54:38 +01:00
|
|
|
get_per_thread_data()->opentype ? 0 : WSA_FLAG_OVERLAPPED );
|
1997-08-24 18:00:30 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2000-06-23 17:47:36 +02:00
|
|
|
/***********************************************************************
|
2021-06-15 17:39:45 +02:00
|
|
|
* WSAEnumNetworkEvents (ws2_32.@)
|
2000-06-23 17:47:36 +02:00
|
|
|
*/
|
2021-06-15 17:39:45 +02:00
|
|
|
int WINAPI WSAEnumNetworkEvents( SOCKET s, WSAEVENT event, WSANETWORKEVENTS *ret_events )
|
Release 961201
Sat Nov 30 19:21:17 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [configure]
Re-generated with autoconf 2.11. Let me know if you have
problems.
* [controls/listbox.c] [controls/oldlbox.c]
Listboxes rewritten from scratch. Moved old code still used by
comboboxes to oldlbox.c
* [misc/registry.c]
Use temporary file when saving registry.
* [windows/dialog.c]
Implemented Win32 version of DlgDirList() and DlgDirListComboBox().
* [windows/winproc.c]
Added translation for listbox Win32 messages.
Sat Nov 30 21:00:00 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [controls/widgets.c] [controls/button.c]
Fixed some incompatibilities with CTL3D DLL.
* [windows/dialog.c]
Made dialog windows fit into the desktop.
* [misc/winsock.c] [misc/winsock_async.c]
New Winsock engine.
* [windows/message.c]
GetMessage() fixes.
* [windows/queue.c] [windows/hook.c] [windows/win.c]
SetMessageQueue() fixes.
Fri Nov 29 10:25:12 1996 Slaven Rezic <eserte@cs.tu-berlin.de>
* [objects/text.c]
DrawText16(): Fixed return value.
Tue Nov 26 14:47:09 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/profile.c] [*/*]
Added Win32 profile functions, updated to new naming standard.
* [objects/font.c] [if1632/thunk.c] [include/windows.h]
Added EnumFonts32*, EnumFontFamiliesEx*, changed prototypes and
structures.
* [misc/ole2nls.c] [if1632/thunk.c]
Added EnumSystemLocales() (winhelp.exe).
* [misc/registry.c]
Added Windows 3.1 registry loader supplied by Tor Sjxwall, tor@sn.no
* [win32/file.c]
Partially fixed CreateFileMapping(), added UnmapViewOfFile().
Sat Nov 23 23:36:05 1996 Ronan Waide <waider@waider.ie>
* [misc/shell.c]
Fixed some FIXMEs relating to ShellExec() and FindExecutable().
* [misc/main.c]
Implemented a few more of the SystemParametersInfo() cases.
Tue Nov 19 01:24:34 1996 Philippe De Muyter <phdm@info.ucl.ac.be>
* [include/keyboard.h]
New file, new macro WINE_VKEY_MAPPINGS (using code taken from event.c).
* [include/windows.h]
New [VK_A, VK_Z] and [VK_0, VK9] macros.
* [misc/keyboard.c]
Fixes in KeyTable and ToAscii.
* [objects/font.c]
FONT_init : Give default value for MSWIN "system" font.
FONT_MatchFont : Do not try every size of a font family if the
family does not exist.
* [windows/event.c]
lastEventChar hack removed.
KeyStateTable replaced by InputKeyStateTable (maintained in event.c)
and QueueKeyStateTable (maintained in message.c).
EVENT_key : Corrections to the extended bit setting.
* [windows/message.c] [windows/keyboard.c]
Implementation of a new QueueKeyStateTable : table of key states
valid when messages are retrieved by GetMessage or PeekMessage,
and valid for TranslateMessage.
TranslateMessage : Convert WM*KEY messages using QueueKeyStateTable
and ToAscii.
Mon Nov 18 16:59:01 1996 Robert Pouliot <krynos@clic.net>
* [graphics/Makefile.in] [graphics/wing.c]
[if1632/wing.spec]
Some functions for WinG support, mostly empty stubs.
* [misc/crtdll.c] [if1632/crtdll.spec]
Many functions added to CRTDLL, mostly calls to Unix C library.
1996-12-01 18:17:47 +01:00
|
|
|
{
|
2021-06-15 17:39:45 +02:00
|
|
|
struct afd_get_events_params params;
|
|
|
|
IO_STATUS_BLOCK io;
|
|
|
|
NTSTATUS status;
|
Release 961201
Sat Nov 30 19:21:17 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [configure]
Re-generated with autoconf 2.11. Let me know if you have
problems.
* [controls/listbox.c] [controls/oldlbox.c]
Listboxes rewritten from scratch. Moved old code still used by
comboboxes to oldlbox.c
* [misc/registry.c]
Use temporary file when saving registry.
* [windows/dialog.c]
Implemented Win32 version of DlgDirList() and DlgDirListComboBox().
* [windows/winproc.c]
Added translation for listbox Win32 messages.
Sat Nov 30 21:00:00 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [controls/widgets.c] [controls/button.c]
Fixed some incompatibilities with CTL3D DLL.
* [windows/dialog.c]
Made dialog windows fit into the desktop.
* [misc/winsock.c] [misc/winsock_async.c]
New Winsock engine.
* [windows/message.c]
GetMessage() fixes.
* [windows/queue.c] [windows/hook.c] [windows/win.c]
SetMessageQueue() fixes.
Fri Nov 29 10:25:12 1996 Slaven Rezic <eserte@cs.tu-berlin.de>
* [objects/text.c]
DrawText16(): Fixed return value.
Tue Nov 26 14:47:09 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/profile.c] [*/*]
Added Win32 profile functions, updated to new naming standard.
* [objects/font.c] [if1632/thunk.c] [include/windows.h]
Added EnumFonts32*, EnumFontFamiliesEx*, changed prototypes and
structures.
* [misc/ole2nls.c] [if1632/thunk.c]
Added EnumSystemLocales() (winhelp.exe).
* [misc/registry.c]
Added Windows 3.1 registry loader supplied by Tor Sjxwall, tor@sn.no
* [win32/file.c]
Partially fixed CreateFileMapping(), added UnmapViewOfFile().
Sat Nov 23 23:36:05 1996 Ronan Waide <waider@waider.ie>
* [misc/shell.c]
Fixed some FIXMEs relating to ShellExec() and FindExecutable().
* [misc/main.c]
Implemented a few more of the SystemParametersInfo() cases.
Tue Nov 19 01:24:34 1996 Philippe De Muyter <phdm@info.ucl.ac.be>
* [include/keyboard.h]
New file, new macro WINE_VKEY_MAPPINGS (using code taken from event.c).
* [include/windows.h]
New [VK_A, VK_Z] and [VK_0, VK9] macros.
* [misc/keyboard.c]
Fixes in KeyTable and ToAscii.
* [objects/font.c]
FONT_init : Give default value for MSWIN "system" font.
FONT_MatchFont : Do not try every size of a font family if the
family does not exist.
* [windows/event.c]
lastEventChar hack removed.
KeyStateTable replaced by InputKeyStateTable (maintained in event.c)
and QueueKeyStateTable (maintained in message.c).
EVENT_key : Corrections to the extended bit setting.
* [windows/message.c] [windows/keyboard.c]
Implementation of a new QueueKeyStateTable : table of key states
valid when messages are retrieved by GetMessage or PeekMessage,
and valid for TranslateMessage.
TranslateMessage : Convert WM*KEY messages using QueueKeyStateTable
and ToAscii.
Mon Nov 18 16:59:01 1996 Robert Pouliot <krynos@clic.net>
* [graphics/Makefile.in] [graphics/wing.c]
[if1632/wing.spec]
Some functions for WinG support, mostly empty stubs.
* [misc/crtdll.c] [if1632/crtdll.spec]
Many functions added to CRTDLL, mostly calls to Unix C library.
1996-12-01 18:17:47 +01:00
|
|
|
|
2021-06-15 17:39:45 +02:00
|
|
|
TRACE( "socket %#lx, event %p, events %p\n", s, event, ret_events );
|
2001-02-20 02:57:13 +01:00
|
|
|
|
2021-06-15 17:39:45 +02:00
|
|
|
ResetEvent( event );
|
|
|
|
|
|
|
|
status = NtDeviceIoControlFile( (HANDLE)s, NULL, NULL, NULL, &io, IOCTL_AFD_GET_EVENTS,
|
|
|
|
NULL, 0, ¶ms, sizeof(params) );
|
|
|
|
if (!status)
|
2010-03-22 19:56:21 +01:00
|
|
|
{
|
2021-06-15 17:39:45 +02:00
|
|
|
ret_events->lNetworkEvents = afd_poll_flag_to_win32( params.flags );
|
|
|
|
|
|
|
|
if (ret_events->lNetworkEvents & FD_READ)
|
|
|
|
ret_events->iErrorCode[FD_READ_BIT] = NtStatusToWSAError( params.status[AFD_POLL_BIT_READ] );
|
|
|
|
|
|
|
|
if (ret_events->lNetworkEvents & FD_WRITE)
|
|
|
|
ret_events->iErrorCode[FD_WRITE_BIT] = NtStatusToWSAError( params.status[AFD_POLL_BIT_WRITE] );
|
|
|
|
|
|
|
|
if (ret_events->lNetworkEvents & FD_OOB)
|
|
|
|
ret_events->iErrorCode[FD_OOB_BIT] = NtStatusToWSAError( params.status[AFD_POLL_BIT_OOB] );
|
|
|
|
|
|
|
|
if (ret_events->lNetworkEvents & FD_ACCEPT)
|
|
|
|
ret_events->iErrorCode[FD_ACCEPT_BIT] = NtStatusToWSAError( params.status[AFD_POLL_BIT_ACCEPT] );
|
|
|
|
|
|
|
|
if (ret_events->lNetworkEvents & FD_CONNECT)
|
|
|
|
ret_events->iErrorCode[FD_CONNECT_BIT] = NtStatusToWSAError( params.status[AFD_POLL_BIT_CONNECT_ERR] );
|
|
|
|
|
|
|
|
if (ret_events->lNetworkEvents & FD_CLOSE)
|
2018-02-19 23:10:39 +01:00
|
|
|
{
|
2021-06-15 17:39:45 +02:00
|
|
|
if (!(ret_events->iErrorCode[FD_CLOSE_BIT] = NtStatusToWSAError( params.status[AFD_POLL_BIT_HUP] )))
|
|
|
|
ret_events->iErrorCode[FD_CLOSE_BIT] = NtStatusToWSAError( params.status[AFD_POLL_BIT_RESET] );
|
2018-02-19 23:10:39 +01:00
|
|
|
}
|
2010-03-22 19:56:21 +01:00
|
|
|
}
|
2021-06-15 17:39:45 +02:00
|
|
|
SetLastError( NtStatusToWSAError( status ) );
|
|
|
|
return status ? -1 : 0;
|
1999-10-23 18:53:34 +02:00
|
|
|
}
|
1997-08-24 18:00:30 +02:00
|
|
|
|
2021-06-14 07:41:50 +02:00
|
|
|
|
|
|
|
static unsigned int afd_poll_flag_from_win32( unsigned int flags )
|
1999-10-23 18:53:34 +02:00
|
|
|
{
|
2021-06-14 07:41:50 +02:00
|
|
|
static const unsigned int map[] =
|
|
|
|
{
|
|
|
|
AFD_POLL_READ,
|
|
|
|
AFD_POLL_WRITE,
|
|
|
|
AFD_POLL_OOB,
|
|
|
|
AFD_POLL_ACCEPT,
|
|
|
|
AFD_POLL_CONNECT | AFD_POLL_CONNECT_ERR,
|
|
|
|
AFD_POLL_RESET | AFD_POLL_HUP,
|
|
|
|
};
|
1997-08-24 18:00:30 +02:00
|
|
|
|
2021-06-14 07:41:50 +02:00
|
|
|
unsigned int i, ret = 0;
|
2001-02-20 02:57:13 +01:00
|
|
|
|
2021-06-14 07:41:50 +02:00
|
|
|
for (i = 0; i < ARRAY_SIZE(map); ++i)
|
1999-10-23 18:53:34 +02:00
|
|
|
{
|
2021-06-14 07:41:50 +02:00
|
|
|
if (flags & (1 << i)) ret |= map[i];
|
1999-10-23 18:53:34 +02:00
|
|
|
}
|
2021-06-14 07:41:50 +02:00
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* WSAEventSelect (ws2_32.@)
|
|
|
|
*/
|
|
|
|
int WINAPI WSAEventSelect( SOCKET s, WSAEVENT event, LONG mask )
|
|
|
|
{
|
|
|
|
struct afd_event_select_params params;
|
|
|
|
IO_STATUS_BLOCK io;
|
|
|
|
NTSTATUS status;
|
|
|
|
|
|
|
|
TRACE( "socket %#lx, event %p, mask %#x\n", s, event, mask );
|
|
|
|
|
|
|
|
params.event = event;
|
|
|
|
params.mask = afd_poll_flag_from_win32( mask );
|
|
|
|
|
|
|
|
status = NtDeviceIoControlFile( (HANDLE)s, NULL, NULL, NULL, &io, IOCTL_AFD_EVENT_SELECT,
|
|
|
|
¶ms, sizeof(params), NULL, 0 );
|
|
|
|
SetLastError( NtStatusToWSAError( status ) );
|
|
|
|
return status ? -1 : 0;
|
1999-10-23 18:53:34 +02:00
|
|
|
}
|
1997-08-24 18:00:30 +02:00
|
|
|
|
2021-06-14 07:41:50 +02:00
|
|
|
|
2002-04-25 23:34:24 +02:00
|
|
|
/**********************************************************************
|
|
|
|
* WSAGetOverlappedResult (WS2_32.40)
|
|
|
|
*/
|
2005-01-14 20:54:38 +01:00
|
|
|
BOOL WINAPI WSAGetOverlappedResult( SOCKET s, LPWSAOVERLAPPED lpOverlapped,
|
|
|
|
LPDWORD lpcbTransfer, BOOL fWait,
|
|
|
|
LPDWORD lpdwFlags )
|
2002-04-25 23:34:24 +02:00
|
|
|
{
|
2007-06-04 23:03:20 +02:00
|
|
|
NTSTATUS status;
|
2002-04-25 23:34:24 +02:00
|
|
|
|
2007-05-24 16:41:17 +02:00
|
|
|
TRACE( "socket %04lx ovl %p trans %p, wait %d flags %p\n",
|
2005-01-14 20:54:38 +01:00
|
|
|
s, lpOverlapped, lpcbTransfer, fWait, lpdwFlags );
|
2002-04-25 23:34:24 +02:00
|
|
|
|
2005-01-14 20:54:38 +01:00
|
|
|
if ( lpOverlapped == NULL )
|
2002-04-25 23:34:24 +02:00
|
|
|
{
|
2005-01-14 20:54:38 +01:00
|
|
|
ERR( "Invalid pointer\n" );
|
2015-01-10 02:49:46 +01:00
|
|
|
SetLastError(WSA_INVALID_PARAMETER);
|
2002-04-25 23:34:24 +02:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2007-06-04 23:03:20 +02:00
|
|
|
status = lpOverlapped->Internal;
|
|
|
|
if (status == STATUS_PENDING)
|
2002-09-12 19:56:30 +02:00
|
|
|
{
|
2007-06-04 23:03:20 +02:00
|
|
|
if (!fWait)
|
|
|
|
{
|
|
|
|
SetLastError( WSA_IO_INCOMPLETE );
|
|
|
|
return FALSE;
|
|
|
|
}
|
2005-01-14 20:54:38 +01:00
|
|
|
|
2007-06-04 23:03:20 +02:00
|
|
|
if (WaitForSingleObject( lpOverlapped->hEvent ? lpOverlapped->hEvent : SOCKET2HANDLE(s),
|
|
|
|
INFINITE ) == WAIT_FAILED)
|
|
|
|
return FALSE;
|
|
|
|
status = lpOverlapped->Internal;
|
2002-09-12 19:56:30 +02:00
|
|
|
}
|
2002-10-30 21:26:32 +01:00
|
|
|
|
2002-04-25 23:34:24 +02:00
|
|
|
if ( lpcbTransfer )
|
|
|
|
*lpcbTransfer = lpOverlapped->InternalHigh;
|
|
|
|
|
|
|
|
if ( lpdwFlags )
|
2005-03-17 20:00:08 +01:00
|
|
|
*lpdwFlags = lpOverlapped->u.s.Offset;
|
2002-04-25 23:34:24 +02:00
|
|
|
|
2021-05-07 00:54:06 +02:00
|
|
|
SetLastError( NtStatusToWSAError(status) );
|
2021-05-07 00:54:07 +02:00
|
|
|
return NT_SUCCESS( status );
|
2002-04-25 23:34:24 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-07-02 21:59:40 +02:00
|
|
|
/***********************************************************************
|
2021-06-15 17:39:48 +02:00
|
|
|
* WSAAsyncSelect (ws2_32.@)
|
2001-07-02 21:59:40 +02:00
|
|
|
*/
|
2021-06-15 17:39:48 +02:00
|
|
|
int WINAPI WSAAsyncSelect( SOCKET s, HWND window, UINT message, LONG mask )
|
Release 961201
Sat Nov 30 19:21:17 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [configure]
Re-generated with autoconf 2.11. Let me know if you have
problems.
* [controls/listbox.c] [controls/oldlbox.c]
Listboxes rewritten from scratch. Moved old code still used by
comboboxes to oldlbox.c
* [misc/registry.c]
Use temporary file when saving registry.
* [windows/dialog.c]
Implemented Win32 version of DlgDirList() and DlgDirListComboBox().
* [windows/winproc.c]
Added translation for listbox Win32 messages.
Sat Nov 30 21:00:00 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [controls/widgets.c] [controls/button.c]
Fixed some incompatibilities with CTL3D DLL.
* [windows/dialog.c]
Made dialog windows fit into the desktop.
* [misc/winsock.c] [misc/winsock_async.c]
New Winsock engine.
* [windows/message.c]
GetMessage() fixes.
* [windows/queue.c] [windows/hook.c] [windows/win.c]
SetMessageQueue() fixes.
Fri Nov 29 10:25:12 1996 Slaven Rezic <eserte@cs.tu-berlin.de>
* [objects/text.c]
DrawText16(): Fixed return value.
Tue Nov 26 14:47:09 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/profile.c] [*/*]
Added Win32 profile functions, updated to new naming standard.
* [objects/font.c] [if1632/thunk.c] [include/windows.h]
Added EnumFonts32*, EnumFontFamiliesEx*, changed prototypes and
structures.
* [misc/ole2nls.c] [if1632/thunk.c]
Added EnumSystemLocales() (winhelp.exe).
* [misc/registry.c]
Added Windows 3.1 registry loader supplied by Tor Sjxwall, tor@sn.no
* [win32/file.c]
Partially fixed CreateFileMapping(), added UnmapViewOfFile().
Sat Nov 23 23:36:05 1996 Ronan Waide <waider@waider.ie>
* [misc/shell.c]
Fixed some FIXMEs relating to ShellExec() and FindExecutable().
* [misc/main.c]
Implemented a few more of the SystemParametersInfo() cases.
Tue Nov 19 01:24:34 1996 Philippe De Muyter <phdm@info.ucl.ac.be>
* [include/keyboard.h]
New file, new macro WINE_VKEY_MAPPINGS (using code taken from event.c).
* [include/windows.h]
New [VK_A, VK_Z] and [VK_0, VK9] macros.
* [misc/keyboard.c]
Fixes in KeyTable and ToAscii.
* [objects/font.c]
FONT_init : Give default value for MSWIN "system" font.
FONT_MatchFont : Do not try every size of a font family if the
family does not exist.
* [windows/event.c]
lastEventChar hack removed.
KeyStateTable replaced by InputKeyStateTable (maintained in event.c)
and QueueKeyStateTable (maintained in message.c).
EVENT_key : Corrections to the extended bit setting.
* [windows/message.c] [windows/keyboard.c]
Implementation of a new QueueKeyStateTable : table of key states
valid when messages are retrieved by GetMessage or PeekMessage,
and valid for TranslateMessage.
TranslateMessage : Convert WM*KEY messages using QueueKeyStateTable
and ToAscii.
Mon Nov 18 16:59:01 1996 Robert Pouliot <krynos@clic.net>
* [graphics/Makefile.in] [graphics/wing.c]
[if1632/wing.spec]
Some functions for WinG support, mostly empty stubs.
* [misc/crtdll.c] [if1632/crtdll.spec]
Many functions added to CRTDLL, mostly calls to Unix C library.
1996-12-01 18:17:47 +01:00
|
|
|
{
|
2021-06-15 17:39:48 +02:00
|
|
|
struct afd_message_select_params params;
|
|
|
|
IO_STATUS_BLOCK io;
|
|
|
|
NTSTATUS status;
|
1997-08-24 18:00:30 +02:00
|
|
|
|
2021-06-15 17:39:48 +02:00
|
|
|
TRACE( "socket %#lx, window %p, message %#x, mask %#x\n", s, window, message, mask );
|
1997-08-24 18:00:30 +02:00
|
|
|
|
2021-06-15 17:39:48 +02:00
|
|
|
params.handle = wine_server_obj_handle( (HANDLE)s );
|
|
|
|
params.window = wine_server_user_handle( window );
|
|
|
|
params.message = message;
|
|
|
|
params.mask = afd_poll_flag_from_win32( mask );
|
|
|
|
|
|
|
|
status = NtDeviceIoControlFile( (HANDLE)s, NULL, NULL, NULL, &io, IOCTL_AFD_WINE_MESSAGE_SELECT,
|
|
|
|
¶ms, sizeof(params), NULL, 0 );
|
|
|
|
SetLastError( NtStatusToWSAError( status ) );
|
|
|
|
return status ? -1 : 0;
|
Release 961201
Sat Nov 30 19:21:17 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [configure]
Re-generated with autoconf 2.11. Let me know if you have
problems.
* [controls/listbox.c] [controls/oldlbox.c]
Listboxes rewritten from scratch. Moved old code still used by
comboboxes to oldlbox.c
* [misc/registry.c]
Use temporary file when saving registry.
* [windows/dialog.c]
Implemented Win32 version of DlgDirList() and DlgDirListComboBox().
* [windows/winproc.c]
Added translation for listbox Win32 messages.
Sat Nov 30 21:00:00 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [controls/widgets.c] [controls/button.c]
Fixed some incompatibilities with CTL3D DLL.
* [windows/dialog.c]
Made dialog windows fit into the desktop.
* [misc/winsock.c] [misc/winsock_async.c]
New Winsock engine.
* [windows/message.c]
GetMessage() fixes.
* [windows/queue.c] [windows/hook.c] [windows/win.c]
SetMessageQueue() fixes.
Fri Nov 29 10:25:12 1996 Slaven Rezic <eserte@cs.tu-berlin.de>
* [objects/text.c]
DrawText16(): Fixed return value.
Tue Nov 26 14:47:09 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/profile.c] [*/*]
Added Win32 profile functions, updated to new naming standard.
* [objects/font.c] [if1632/thunk.c] [include/windows.h]
Added EnumFonts32*, EnumFontFamiliesEx*, changed prototypes and
structures.
* [misc/ole2nls.c] [if1632/thunk.c]
Added EnumSystemLocales() (winhelp.exe).
* [misc/registry.c]
Added Windows 3.1 registry loader supplied by Tor Sjxwall, tor@sn.no
* [win32/file.c]
Partially fixed CreateFileMapping(), added UnmapViewOfFile().
Sat Nov 23 23:36:05 1996 Ronan Waide <waider@waider.ie>
* [misc/shell.c]
Fixed some FIXMEs relating to ShellExec() and FindExecutable().
* [misc/main.c]
Implemented a few more of the SystemParametersInfo() cases.
Tue Nov 19 01:24:34 1996 Philippe De Muyter <phdm@info.ucl.ac.be>
* [include/keyboard.h]
New file, new macro WINE_VKEY_MAPPINGS (using code taken from event.c).
* [include/windows.h]
New [VK_A, VK_Z] and [VK_0, VK9] macros.
* [misc/keyboard.c]
Fixes in KeyTable and ToAscii.
* [objects/font.c]
FONT_init : Give default value for MSWIN "system" font.
FONT_MatchFont : Do not try every size of a font family if the
family does not exist.
* [windows/event.c]
lastEventChar hack removed.
KeyStateTable replaced by InputKeyStateTable (maintained in event.c)
and QueueKeyStateTable (maintained in message.c).
EVENT_key : Corrections to the extended bit setting.
* [windows/message.c] [windows/keyboard.c]
Implementation of a new QueueKeyStateTable : table of key states
valid when messages are retrieved by GetMessage or PeekMessage,
and valid for TranslateMessage.
TranslateMessage : Convert WM*KEY messages using QueueKeyStateTable
and ToAscii.
Mon Nov 18 16:59:01 1996 Robert Pouliot <krynos@clic.net>
* [graphics/Makefile.in] [graphics/wing.c]
[if1632/wing.spec]
Some functions for WinG support, mostly empty stubs.
* [misc/crtdll.c] [if1632/crtdll.spec]
Many functions added to CRTDLL, mostly calls to Unix C library.
1996-12-01 18:17:47 +01:00
|
|
|
}
|
|
|
|
|
2021-06-15 17:39:48 +02:00
|
|
|
|
2000-06-18 19:23:17 +02:00
|
|
|
/***********************************************************************
|
2001-07-02 21:59:40 +02:00
|
|
|
* WSACreateEvent (WS2_32.31)
|
2000-06-18 19:23:17 +02:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
WSAEVENT WINAPI WSACreateEvent(void)
|
|
|
|
{
|
2004-12-20 20:27:06 +01:00
|
|
|
/* Create a manual-reset event, with initial state: unsignaled */
|
2000-06-18 19:23:17 +02:00
|
|
|
TRACE("\n");
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2005-01-07 16:40:09 +01:00
|
|
|
return CreateEventW(NULL, TRUE, FALSE, NULL);
|
2000-06-18 19:23:17 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
2001-07-02 21:59:40 +02:00
|
|
|
* WSACloseEvent (WS2_32.29)
|
2000-06-18 19:23:17 +02:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
BOOL WINAPI WSACloseEvent(WSAEVENT event)
|
|
|
|
{
|
2002-10-30 21:26:32 +01:00
|
|
|
TRACE ("event=%p\n", event);
|
2000-06-18 19:23:17 +02:00
|
|
|
|
|
|
|
return CloseHandle(event);
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
2001-07-02 21:59:40 +02:00
|
|
|
* WSASocketA (WS2_32.78)
|
2000-06-18 19:23:17 +02:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
SOCKET WINAPI WSASocketA(int af, int type, int protocol,
|
|
|
|
LPWSAPROTOCOL_INFOA lpProtocolInfo,
|
|
|
|
GROUP g, DWORD dwFlags)
|
Stub implementations for WPUCompleteOverlappedRequest,
WSADuplicateSocketW, WSAEnumNameSpaceProviders{A,W}, WSAGetQOSByName,
WSAGetServiceClassInfo{A,W}, WSAGetServiceClassNameByClassId{A,W},
WSALookupServiceEnd, WSALookupServiceNext{A,W},
WSAProviderConfigChange, WSASetService{A,W}, WSCEnableNSProvider,
WSCGetProviderPath, WSCInstallNameSpace, WSCWriteProviderOrder.
Implementations for WSANtohl, WSANtohs, WSASocketA->W crosscall.
Avoid NULL dereferences in WSAStringToAddress{A,W} and
WSAAddressToString{A,W}.
2005-01-10 15:34:15 +01:00
|
|
|
{
|
|
|
|
INT len;
|
|
|
|
WSAPROTOCOL_INFOW info;
|
|
|
|
|
2006-10-12 14:53:44 +02:00
|
|
|
TRACE("af=%d type=%d protocol=%d protocol_info=%p group=%d flags=0x%x\n",
|
Stub implementations for WPUCompleteOverlappedRequest,
WSADuplicateSocketW, WSAEnumNameSpaceProviders{A,W}, WSAGetQOSByName,
WSAGetServiceClassInfo{A,W}, WSAGetServiceClassNameByClassId{A,W},
WSALookupServiceEnd, WSALookupServiceNext{A,W},
WSAProviderConfigChange, WSASetService{A,W}, WSCEnableNSProvider,
WSCGetProviderPath, WSCInstallNameSpace, WSCWriteProviderOrder.
Implementations for WSANtohl, WSANtohs, WSASocketA->W crosscall.
Avoid NULL dereferences in WSAStringToAddress{A,W} and
WSAAddressToString{A,W}.
2005-01-10 15:34:15 +01:00
|
|
|
af, type, protocol, lpProtocolInfo, g, dwFlags);
|
|
|
|
|
|
|
|
if (!lpProtocolInfo) return WSASocketW(af, type, protocol, NULL, g, dwFlags);
|
|
|
|
|
|
|
|
memcpy(&info, lpProtocolInfo, FIELD_OFFSET(WSAPROTOCOL_INFOW, szProtocol));
|
|
|
|
len = MultiByteToWideChar(CP_ACP, 0, lpProtocolInfo->szProtocol, -1,
|
2005-09-13 00:07:53 +02:00
|
|
|
info.szProtocol, WSAPROTOCOL_LEN + 1);
|
Stub implementations for WPUCompleteOverlappedRequest,
WSADuplicateSocketW, WSAEnumNameSpaceProviders{A,W}, WSAGetQOSByName,
WSAGetServiceClassInfo{A,W}, WSAGetServiceClassNameByClassId{A,W},
WSALookupServiceEnd, WSALookupServiceNext{A,W},
WSAProviderConfigChange, WSASetService{A,W}, WSCEnableNSProvider,
WSCGetProviderPath, WSCInstallNameSpace, WSCWriteProviderOrder.
Implementations for WSANtohl, WSANtohs, WSASocketA->W crosscall.
Avoid NULL dereferences in WSAStringToAddress{A,W} and
WSAAddressToString{A,W}.
2005-01-10 15:34:15 +01:00
|
|
|
|
|
|
|
if (!len)
|
|
|
|
{
|
2015-01-10 02:49:46 +01:00
|
|
|
SetLastError(WSAEINVAL);
|
Stub implementations for WPUCompleteOverlappedRequest,
WSADuplicateSocketW, WSAEnumNameSpaceProviders{A,W}, WSAGetQOSByName,
WSAGetServiceClassInfo{A,W}, WSAGetServiceClassNameByClassId{A,W},
WSALookupServiceEnd, WSALookupServiceNext{A,W},
WSAProviderConfigChange, WSASetService{A,W}, WSCEnableNSProvider,
WSCGetProviderPath, WSCInstallNameSpace, WSCWriteProviderOrder.
Implementations for WSANtohl, WSANtohs, WSASocketA->W crosscall.
Avoid NULL dereferences in WSAStringToAddress{A,W} and
WSAAddressToString{A,W}.
2005-01-10 15:34:15 +01:00
|
|
|
return SOCKET_ERROR;
|
|
|
|
}
|
|
|
|
|
|
|
|
return WSASocketW(af, type, protocol, &info, g, dwFlags);
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* WSASocketW (WS2_32.79)
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
SOCKET WINAPI WSASocketW(int af, int type, int protocol,
|
|
|
|
LPWSAPROTOCOL_INFOW lpProtocolInfo,
|
2020-09-20 00:13:37 +02:00
|
|
|
GROUP g, DWORD flags)
|
2000-06-18 19:23:17 +02:00
|
|
|
{
|
2020-09-20 00:13:37 +02:00
|
|
|
static const WCHAR afdW[] = {'\\','D','e','v','i','c','e','\\','A','f','d',0};
|
|
|
|
struct afd_create_params create_params;
|
|
|
|
OBJECT_ATTRIBUTES attr;
|
|
|
|
UNICODE_STRING string;
|
|
|
|
IO_STATUS_BLOCK io;
|
|
|
|
NTSTATUS status;
|
|
|
|
HANDLE handle;
|
2002-01-09 22:17:16 +01:00
|
|
|
SOCKET ret;
|
2013-09-16 06:44:22 +02:00
|
|
|
DWORD err;
|
2002-01-09 22:17:16 +01:00
|
|
|
|
2002-06-01 01:06:46 +02:00
|
|
|
/*
|
Stub implementations for WPUCompleteOverlappedRequest,
WSADuplicateSocketW, WSAEnumNameSpaceProviders{A,W}, WSAGetQOSByName,
WSAGetServiceClassInfo{A,W}, WSAGetServiceClassNameByClassId{A,W},
WSALookupServiceEnd, WSALookupServiceNext{A,W},
WSAProviderConfigChange, WSASetService{A,W}, WSCEnableNSProvider,
WSCGetProviderPath, WSCInstallNameSpace, WSCWriteProviderOrder.
Implementations for WSANtohl, WSANtohs, WSASocketA->W crosscall.
Avoid NULL dereferences in WSAStringToAddress{A,W} and
WSAAddressToString{A,W}.
2005-01-10 15:34:15 +01:00
|
|
|
FIXME: The "advanced" parameters of WSASocketW (lpProtocolInfo,
|
2002-01-09 22:17:16 +01:00
|
|
|
g, dwFlags except WSA_FLAG_OVERLAPPED) are ignored.
|
2000-06-18 19:23:17 +02:00
|
|
|
*/
|
2002-01-09 22:17:16 +01:00
|
|
|
|
2006-10-12 14:53:44 +02:00
|
|
|
TRACE("af=%d type=%d protocol=%d protocol_info=%p group=%d flags=0x%x\n",
|
2020-09-20 00:13:37 +02:00
|
|
|
af, type, protocol, lpProtocolInfo, g, flags );
|
2000-06-18 19:23:17 +02:00
|
|
|
|
2013-09-17 15:01:07 +02:00
|
|
|
if (!num_startup)
|
|
|
|
{
|
|
|
|
err = WSANOTINITIALISED;
|
|
|
|
goto done;
|
|
|
|
}
|
|
|
|
|
2002-06-13 21:09:55 +02:00
|
|
|
/* hack for WSADuplicateSocket */
|
2020-09-10 23:17:14 +02:00
|
|
|
if (lpProtocolInfo && lpProtocolInfo->dwServiceFlags4 == 0xff00ff00)
|
|
|
|
{
|
|
|
|
ret = lpProtocolInfo->dwServiceFlags3;
|
|
|
|
TRACE("\tgot duplicate %04lx\n", ret);
|
|
|
|
if (!socket_list_add(ret))
|
|
|
|
{
|
|
|
|
CloseHandle(SOCKET2HANDLE(ret));
|
|
|
|
return INVALID_SOCKET;
|
|
|
|
}
|
|
|
|
return ret;
|
2002-06-13 21:09:55 +02:00
|
|
|
}
|
|
|
|
|
2008-05-26 10:02:42 +02:00
|
|
|
if (lpProtocolInfo)
|
2002-01-09 22:17:16 +01:00
|
|
|
{
|
2013-09-17 15:00:24 +02:00
|
|
|
if (af == FROM_PROTOCOL_INFO || !af)
|
2008-05-26 10:02:42 +02:00
|
|
|
af = lpProtocolInfo->iAddressFamily;
|
2013-09-17 15:00:24 +02:00
|
|
|
if (type == FROM_PROTOCOL_INFO || !type)
|
2008-05-26 10:02:42 +02:00
|
|
|
type = lpProtocolInfo->iSocketType;
|
2013-09-17 15:00:24 +02:00
|
|
|
if (protocol == FROM_PROTOCOL_INFO || !protocol)
|
2008-05-26 10:02:42 +02:00
|
|
|
protocol = lpProtocolInfo->iProtocol;
|
2002-01-09 22:17:16 +01:00
|
|
|
}
|
|
|
|
|
2020-09-25 05:21:04 +02:00
|
|
|
if (!af && !protocol)
|
|
|
|
{
|
|
|
|
WSASetLastError(WSAEINVAL);
|
|
|
|
return INVALID_SOCKET;
|
|
|
|
}
|
|
|
|
|
2020-09-29 05:35:03 +02:00
|
|
|
if (!af && lpProtocolInfo)
|
2011-10-20 22:37:09 +02:00
|
|
|
{
|
2020-09-29 05:35:03 +02:00
|
|
|
WSASetLastError(WSAEAFNOSUPPORT);
|
|
|
|
return INVALID_SOCKET;
|
|
|
|
}
|
2013-09-17 15:00:37 +02:00
|
|
|
|
2020-09-29 05:35:03 +02:00
|
|
|
if (!af || !type || !protocol)
|
|
|
|
{
|
|
|
|
unsigned int i;
|
2013-09-17 15:00:37 +02:00
|
|
|
|
2020-09-29 05:35:03 +02:00
|
|
|
for (i = 0; i < ARRAY_SIZE(supported_protocols); ++i)
|
2011-10-20 22:37:09 +02:00
|
|
|
{
|
2020-09-29 05:35:03 +02:00
|
|
|
const WSAPROTOCOL_INFOW *info = &supported_protocols[i];
|
|
|
|
|
|
|
|
if (af && af != info->iAddressFamily) continue;
|
|
|
|
if (type && type != info->iSocketType) continue;
|
|
|
|
if (protocol && (protocol < info->iProtocol ||
|
|
|
|
protocol > info->iProtocol + info->iProtocolMaxOffset)) continue;
|
|
|
|
if (!protocol && !(info->dwProviderFlags & PFL_MATCHES_PROTOCOL_ZERO)) continue;
|
2013-09-17 15:00:37 +02:00
|
|
|
|
2020-09-29 05:35:03 +02:00
|
|
|
if (!af) af = supported_protocols[i].iAddressFamily;
|
|
|
|
if (!type) type = supported_protocols[i].iSocketType;
|
|
|
|
if (!protocol) protocol = supported_protocols[i].iProtocol;
|
2021-03-15 04:24:02 +01:00
|
|
|
break;
|
2011-10-20 22:37:09 +02:00
|
|
|
}
|
|
|
|
}
|
2002-01-09 22:17:16 +01:00
|
|
|
|
2020-09-20 00:13:37 +02:00
|
|
|
RtlInitUnicodeString(&string, afdW);
|
|
|
|
InitializeObjectAttributes(&attr, &string, (flags & WSA_FLAG_NO_HANDLE_INHERIT) ? 0 : OBJ_INHERIT, NULL, NULL);
|
2020-09-25 05:21:00 +02:00
|
|
|
if ((status = NtOpenFile(&handle, GENERIC_READ | GENERIC_WRITE | SYNCHRONIZE, &attr,
|
|
|
|
&io, 0, (flags & WSA_FLAG_OVERLAPPED) ? 0 : FILE_SYNCHRONOUS_IO_NONALERT)))
|
2002-01-09 22:17:16 +01:00
|
|
|
{
|
2020-09-20 00:13:37 +02:00
|
|
|
WARN("Failed to create socket, status %#x.\n", status);
|
|
|
|
WSASetLastError(NtStatusToWSAError(status));
|
|
|
|
return INVALID_SOCKET;
|
2002-01-09 22:17:16 +01:00
|
|
|
}
|
2016-10-30 02:26:43 +02:00
|
|
|
|
2020-09-30 17:37:50 +02:00
|
|
|
create_params.family = af;
|
|
|
|
create_params.type = type;
|
2020-09-20 00:13:37 +02:00
|
|
|
create_params.protocol = protocol;
|
2020-09-25 05:21:00 +02:00
|
|
|
create_params.flags = flags & ~(WSA_FLAG_NO_HANDLE_INHERIT | WSA_FLAG_OVERLAPPED);
|
2020-09-20 00:13:37 +02:00
|
|
|
if ((status = NtDeviceIoControlFile(handle, NULL, NULL, NULL, &io,
|
2021-05-14 05:54:37 +02:00
|
|
|
IOCTL_AFD_WINE_CREATE, &create_params, sizeof(create_params), NULL, 0)))
|
2020-09-20 00:13:37 +02:00
|
|
|
{
|
|
|
|
WARN("Failed to initialize socket, status %#x.\n", status);
|
2021-05-07 00:54:05 +02:00
|
|
|
err = RtlNtStatusToDosError( status );
|
2020-09-20 00:13:37 +02:00
|
|
|
if (err == WSAEACCES) /* raw socket denied */
|
2018-05-10 11:30:10 +02:00
|
|
|
{
|
2020-09-20 00:13:37 +02:00
|
|
|
if (type == SOCK_RAW)
|
|
|
|
ERR_(winediag)("Failed to create a socket of type SOCK_RAW, this requires special permissions.\n");
|
|
|
|
else
|
|
|
|
ERR_(winediag)("Failed to create socket, this requires special permissions.\n");
|
2018-05-10 11:30:10 +02:00
|
|
|
}
|
2020-09-20 00:13:37 +02:00
|
|
|
WSASetLastError(err);
|
|
|
|
NtClose(handle);
|
|
|
|
return INVALID_SOCKET;
|
|
|
|
}
|
|
|
|
|
|
|
|
ret = HANDLE2SOCKET(handle);
|
|
|
|
TRACE("\tcreated %04lx\n", ret );
|
|
|
|
|
|
|
|
if (!socket_list_add(ret))
|
2002-01-09 22:17:16 +01:00
|
|
|
{
|
2020-09-20 00:13:37 +02:00
|
|
|
CloseHandle(handle);
|
|
|
|
return INVALID_SOCKET;
|
2013-09-16 06:44:22 +02:00
|
|
|
}
|
2020-09-20 00:13:37 +02:00
|
|
|
return ret;
|
2002-01-09 22:17:16 +01:00
|
|
|
|
2013-09-17 15:00:52 +02:00
|
|
|
done:
|
2013-09-16 06:44:22 +02:00
|
|
|
WARN("\t\tfailed, error %d!\n", err);
|
|
|
|
SetLastError(err);
|
2002-01-09 22:17:16 +01:00
|
|
|
return INVALID_SOCKET;
|
2000-06-18 19:23:17 +02:00
|
|
|
}
|
|
|
|
|
2003-12-11 06:16:48 +01:00
|
|
|
/***********************************************************************
|
|
|
|
* WSAJoinLeaf (WS2_32.58)
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
SOCKET WINAPI WSAJoinLeaf(
|
|
|
|
SOCKET s,
|
|
|
|
const struct WS_sockaddr *addr,
|
|
|
|
int addrlen,
|
|
|
|
LPWSABUF lpCallerData,
|
|
|
|
LPWSABUF lpCalleeData,
|
|
|
|
LPQOS lpSQOS,
|
|
|
|
LPQOS lpGQOS,
|
|
|
|
DWORD dwFlags)
|
|
|
|
{
|
|
|
|
FIXME("stub.\n");
|
|
|
|
return INVALID_SOCKET;
|
|
|
|
}
|
2000-06-18 19:23:17 +02:00
|
|
|
|
1997-08-24 18:00:30 +02:00
|
|
|
/***********************************************************************
|
2001-07-02 21:59:40 +02:00
|
|
|
* __WSAFDIsSet (WS2_32.151)
|
1997-08-24 18:00:30 +02:00
|
|
|
*/
|
2001-11-14 22:26:23 +01:00
|
|
|
int WINAPI __WSAFDIsSet(SOCKET s, WS_fd_set *set)
|
1997-08-24 18:00:30 +02:00
|
|
|
{
|
2015-01-02 17:07:15 +01:00
|
|
|
int i = set->fd_count, ret = 0;
|
Release 971221
Fri Dec 19 10:50:46 1997 Douglas Ridgway <ridgway@winehq.com>
* [Make.rules.in] [Makefile.in] [documentation/Makefile.in]
[documentation/README.documentation]
First cut at Wine API documentation. No longer install reference
manual by default.
Wed Dec 17 21:32:23 1997 Andreas Mohr <100.30936@germany.net>
* [files/file.c]
Fixed GetTempFileName16() to use current path of requested drive
as needed.
* [if1632/Makefile.in] [if1632/builtin.c] [if1632/dciman32.spec]
[if1632/msvfw32.spec] [if1632/tapi32.spec] [if1632/wow32.spec]
Added misc DLLs needed by various apps.
Wed Dec 17 12:01:50 1997 Morten Eriksen <mortene@sim.no>
* [if1632/gdi32.spec] [include/windows.h] [objects/palette.c]
Inserted empty stub for CreateHalftonePalette.
Tue Dec 16 22:08:06 1997 Huw D M Davies <h.davies1@physics.oxford.ac.uk>
* [windows/mdi.c]
Use VK_TAB instead of VK_SEPARATOR in TranslateMDISysAccel().
* [graphics/metafiledrv/init.c]
DeleteDC() on a MetaDC doesn't do anything - it shouldn't. Therefore
fix cleanup of MetaDCs in CloseMetaFile(); they now actually get
removed from the GDI heap!
* [graphics/x11drv/xfont.c]
Preserve FO_MATCH_XYINDEP flag in XFONT_MatchFIList(). Should reduce
the number of bold-italic matches.
Tue Dec 16 20:11:43 1997 Bertho Stultiens <bertho@panter.soci.aau.dk>
* [graphics/painting.c]
Included an implementation of DrawState
* [if1632/thunk.c]
Changed many fprintfs into dprintf_thunk
* [include/cache.h] [graphics/cache.c]
New files to hold cached handles to regulary used GDI object.
* [include/windows.h]
Added DRAWSTATExx typedefs
Added DSS_DEFAULT define for DrawState
* [objects/text.c]
New implementation of GrayString()
* [controls/uitools.c]
Implemented DrawFrameControl() functions
Changed DrawEdge() behaviour to win95 implementation
Mon Dec 15 23:43:01 1997 Martin Boehme <boehme@informatik.mu-luebeck.de>
* [graphics/path.c] [include/path.h] [graphics/painting.c]
[if1632/gdi32.spec] [include/gdi.h] [include/windows.h]
[objects/dc.c]
Added preliminary support for GDI paths.
* [objects/dc.c]
Added DC_Init_DC_INFO function for initializing WIN_DC_INFO
structure.
* [include/windows.h] [include/gdi.h] [objects/gdiobj.c]
Added DEFAULT_GUI_FONT.
* [include/winerror.h]
Added a few error codes.
* [memory/heap.c]
Changed HeapAlloc to make the correct calls to SetLastError
(now conforms to NT's behaviour).
* [windows/win.c]
Changed WIN_CreateWindowEx to allow child windows with zero
width / height.
Sun Dec 14 12:01:07 1997 Alexandre Julliard <julliard@lrc.epfl.ch>
* [if1632/*] [relay32/*]
Moved all 32-bit relay stuff to relay32/
* [fi1632/thunk.c] [win32/kernel32.c]
Moved all KERNEL32 ordinal functions to kernel32.c
* [memory/selector.c]
Initialize selectors in AllocSelectorArray.
* [tools/build.c]
Generate C instead of assembly for Win32 relays.
Fixed stack corruption in CallTo16 functions, found by Bertho
Stultiens.
Sun Dec 14 10:55:00 1997 Andreas Mohr <100.30936@germany.net>
* [if1632/Makefile.in] [if1632/builtin.c] [if1632/ole2thk.spec]
Added built-in OLE2THK.DLL.
* [if1632/toolhelp.spec] [include/toolhelp.h] [memory/selector.c]
[misc/toolhelp.c]
Added stubs for StackTraceFirst(), StackTraceCSIPFirst(),
StackTraceNext(), UTSelectorOffsetToLinear()
and UTLinearToSelectorOffset().
Sat Dec 13 17:26:41 1997 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [misc/winsock.c]
32-bit API fixes for reported problems (thanks to Marcus
and David).
* [graphics/x11drv/xfont.c]
Little tweak in point size calculation.
* [windows/defwnd.c] [windows/dce.c] [windows/winhelp.c]
[windows/winproc.c] [windows/win.c]
Bug fixes.
Sat Dec 13 16:35:14 1997 Kai Morich <kai.morich@rhein-neckar.netsurf.de>
* [files/dos_fs.c]
OpenFile with empty filename and OF_PARSE returns current dir.
* [misc/commdlg.c]
Ignore initial dir if bogus.
* [files/file.c]
Locking an identic region in a file must not be an error.
* [misc/lstr.c]
Use wide char ctype functions.
Fri Dec 12 23:46:22 1997 Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>
* [file/drive.c]
First attempt for GetDiskFreeSpaceEx.
Fri Dec 12 23:18:41 1997 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [loader/pe_resource.c]
Fixed wrongly appearing menus problem (only use default lookups in
last resource subtree).
* [multimedia/*.c]
Added win32 support for time* and joy* lowlevel drivers,
(not excessively tested), some misc fixes and cleanups.
* [misc/shellord.c][misc/shell.c][ole/folders.c][ole/ifs.c]
[include/interfaces.h][include/shlobj.h]
Added some more undocumented SHELL32 functions, some shell folder
interface stubs added, SHGetMalloc, SHGetDesktopFolder,
SHGetSpecialFolderLocation, SHGetPathFromIDList stubs added,
IMalloc, IUnknown implemented.
* [windows/msgbox.c]
Implemented MessageBoxIndirect*, some internal changes.
* [if1632/thunk.c]
KERNEL_431 implemented.
* [objects/gdiobj.c]
GetCurrentObject implemented.
Wed Dec 3 01:09:17 1997 Gordon Chaffee <chaffee@apu.cs.berkeley.edu>
* [objects/dib.c]
Fix a couple small DIB problems.
* [controls/edit.c]
Fix a typo.
* [files/dos_fs.c]
Try normal readdir in case fs is specified as vfat but isn't.
* [files/profile.c]
Implementation of WritePrivateProfileSection32A from Uwe Bonnes.
* [misc/printdrv.c]
OpenPrinter32A stub, helps Word97 start.
* [objects/text.c]
Fixup implementation of GetTextCharsetInfo.
* [scheduler/process.c]
Fix environment variable expansion.
* [win32/code_page.c]
Make MultiByteToWideChar and WideCharToMultiByte conform in return
values and error conditions to those in Windows NT 4.0.
* [windows/message.c]
Fix broadcasting problems in Win32. The Win32 docs say to use
HWND_TOPMOST to broadcast to all Win32 Windows.
* [memory/virtual.c] [loader/pe_image.c]
Do not map in VirtualAlloc if address is specified and space is
not available. This is required by Win32.
* [include/pen.h] [include/x11drv.h] [objects/dc.c]
[objects/pen.c] [graphics/x11drv/pen.c]
Support for ExtCreatePen.
Tue Dec 2 20:22:06 1997 Morten Welinder <terra@diku.dk>
* [*/*.c] [*/*.h]
Add lots of prototypes.
* [if1632/kernel32.spec][include/windows.h][include/winnt.h]
[misc/cpu.c]
Define IsProcessorFeaturePresent.
* [misc/crtdll.c]
(CRTDLL__getcwd): Allocate enough memory for the terminating zero.
* [misc/ver.c]
Improve check for null component in _find_data[AW]. Plug leaks
in VerQueryValue*.
* [win32/console.c][if1632/kernel32.spec]
Add stubs for GetConsoleCursorInfo32, SetConsoleCursorInfo32.
* [windows/message.c][if1632/user32.spec][include/windows.h]
Define SendMessageTimeout*.
* [graphics/x11drv/xfont.c]
Change algorithm of __genericCheckSum to be alignment safe.
* [misc/main.c] [misc/winsock.c] [misc/winsock_dns.c]
Include winsock.h early to avoid Solaris problem.
* [include/windows.h]
Undef FSHIFT before we define it.
* [rc/winerc.c]
Include <fcntl.h> instead of <sys/fcntl.h>.
* [files/file.c]
Use strerror in FILE_SetDosError if available.
* [include/config.h.in] [configure.in]
Check for strerror.
* [objects/gdiobj.c]
Make static font structures aligned.
Mon Dec 1 10:10:21 1997 Karl Garrison <karlos@eznet.net>
* [win32/console.c] [if1632/kernel32.spec] [include/windows.h]
Added stub for GetNumberOfConsoleMouseButtons.
Added stub for PeekConsoleInput(A,W).
Fixed parameter list for WriteConsole(A,W).
GetNumberOfConsoleInputEvents now returns 0 events instead of 1
(since low-level console functions are not yet supported).
GetConsoleMode no longer returns ENABLE_WINDOW_INPUT and
ENABLE_MOUSE_INPUT since these are not currently implemented.
1997-12-21 20:17:50 +01:00
|
|
|
|
|
|
|
while (i--)
|
2015-01-02 17:07:15 +01:00
|
|
|
if (set->fd_array[i] == s)
|
|
|
|
{
|
|
|
|
ret = 1;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2015-01-09 00:48:11 +01:00
|
|
|
TRACE("(socket %04lx, fd_set %p, count %i) <- %d\n", s, set, set->fd_count, ret);
|
2015-01-02 17:07:15 +01:00
|
|
|
return ret;
|
1997-08-24 18:00:30 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
2001-07-02 21:59:40 +02:00
|
|
|
* WSAIsBlocking (WS2_32.114)
|
1997-08-24 18:00:30 +02:00
|
|
|
*/
|
1999-02-26 12:11:13 +01:00
|
|
|
BOOL WINAPI WSAIsBlocking(void)
|
Release 961201
Sat Nov 30 19:21:17 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [configure]
Re-generated with autoconf 2.11. Let me know if you have
problems.
* [controls/listbox.c] [controls/oldlbox.c]
Listboxes rewritten from scratch. Moved old code still used by
comboboxes to oldlbox.c
* [misc/registry.c]
Use temporary file when saving registry.
* [windows/dialog.c]
Implemented Win32 version of DlgDirList() and DlgDirListComboBox().
* [windows/winproc.c]
Added translation for listbox Win32 messages.
Sat Nov 30 21:00:00 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [controls/widgets.c] [controls/button.c]
Fixed some incompatibilities with CTL3D DLL.
* [windows/dialog.c]
Made dialog windows fit into the desktop.
* [misc/winsock.c] [misc/winsock_async.c]
New Winsock engine.
* [windows/message.c]
GetMessage() fixes.
* [windows/queue.c] [windows/hook.c] [windows/win.c]
SetMessageQueue() fixes.
Fri Nov 29 10:25:12 1996 Slaven Rezic <eserte@cs.tu-berlin.de>
* [objects/text.c]
DrawText16(): Fixed return value.
Tue Nov 26 14:47:09 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/profile.c] [*/*]
Added Win32 profile functions, updated to new naming standard.
* [objects/font.c] [if1632/thunk.c] [include/windows.h]
Added EnumFonts32*, EnumFontFamiliesEx*, changed prototypes and
structures.
* [misc/ole2nls.c] [if1632/thunk.c]
Added EnumSystemLocales() (winhelp.exe).
* [misc/registry.c]
Added Windows 3.1 registry loader supplied by Tor Sjxwall, tor@sn.no
* [win32/file.c]
Partially fixed CreateFileMapping(), added UnmapViewOfFile().
Sat Nov 23 23:36:05 1996 Ronan Waide <waider@waider.ie>
* [misc/shell.c]
Fixed some FIXMEs relating to ShellExec() and FindExecutable().
* [misc/main.c]
Implemented a few more of the SystemParametersInfo() cases.
Tue Nov 19 01:24:34 1996 Philippe De Muyter <phdm@info.ucl.ac.be>
* [include/keyboard.h]
New file, new macro WINE_VKEY_MAPPINGS (using code taken from event.c).
* [include/windows.h]
New [VK_A, VK_Z] and [VK_0, VK9] macros.
* [misc/keyboard.c]
Fixes in KeyTable and ToAscii.
* [objects/font.c]
FONT_init : Give default value for MSWIN "system" font.
FONT_MatchFont : Do not try every size of a font family if the
family does not exist.
* [windows/event.c]
lastEventChar hack removed.
KeyStateTable replaced by InputKeyStateTable (maintained in event.c)
and QueueKeyStateTable (maintained in message.c).
EVENT_key : Corrections to the extended bit setting.
* [windows/message.c] [windows/keyboard.c]
Implementation of a new QueueKeyStateTable : table of key states
valid when messages are retrieved by GetMessage or PeekMessage,
and valid for TranslateMessage.
TranslateMessage : Convert WM*KEY messages using QueueKeyStateTable
and ToAscii.
Mon Nov 18 16:59:01 1996 Robert Pouliot <krynos@clic.net>
* [graphics/Makefile.in] [graphics/wing.c]
[if1632/wing.spec]
Some functions for WinG support, mostly empty stubs.
* [misc/crtdll.c] [if1632/crtdll.spec]
Many functions added to CRTDLL, mostly calls to Unix C library.
1996-12-01 18:17:47 +01:00
|
|
|
{
|
|
|
|
/* By default WinSock should set all its sockets to non-blocking mode
|
2002-06-01 01:06:46 +02:00
|
|
|
* and poll in PeekMessage loop when processing "blocking" ones. This
|
|
|
|
* function is supposed to tell if the program is in this loop. Our
|
Release 961201
Sat Nov 30 19:21:17 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [configure]
Re-generated with autoconf 2.11. Let me know if you have
problems.
* [controls/listbox.c] [controls/oldlbox.c]
Listboxes rewritten from scratch. Moved old code still used by
comboboxes to oldlbox.c
* [misc/registry.c]
Use temporary file when saving registry.
* [windows/dialog.c]
Implemented Win32 version of DlgDirList() and DlgDirListComboBox().
* [windows/winproc.c]
Added translation for listbox Win32 messages.
Sat Nov 30 21:00:00 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [controls/widgets.c] [controls/button.c]
Fixed some incompatibilities with CTL3D DLL.
* [windows/dialog.c]
Made dialog windows fit into the desktop.
* [misc/winsock.c] [misc/winsock_async.c]
New Winsock engine.
* [windows/message.c]
GetMessage() fixes.
* [windows/queue.c] [windows/hook.c] [windows/win.c]
SetMessageQueue() fixes.
Fri Nov 29 10:25:12 1996 Slaven Rezic <eserte@cs.tu-berlin.de>
* [objects/text.c]
DrawText16(): Fixed return value.
Tue Nov 26 14:47:09 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/profile.c] [*/*]
Added Win32 profile functions, updated to new naming standard.
* [objects/font.c] [if1632/thunk.c] [include/windows.h]
Added EnumFonts32*, EnumFontFamiliesEx*, changed prototypes and
structures.
* [misc/ole2nls.c] [if1632/thunk.c]
Added EnumSystemLocales() (winhelp.exe).
* [misc/registry.c]
Added Windows 3.1 registry loader supplied by Tor Sjxwall, tor@sn.no
* [win32/file.c]
Partially fixed CreateFileMapping(), added UnmapViewOfFile().
Sat Nov 23 23:36:05 1996 Ronan Waide <waider@waider.ie>
* [misc/shell.c]
Fixed some FIXMEs relating to ShellExec() and FindExecutable().
* [misc/main.c]
Implemented a few more of the SystemParametersInfo() cases.
Tue Nov 19 01:24:34 1996 Philippe De Muyter <phdm@info.ucl.ac.be>
* [include/keyboard.h]
New file, new macro WINE_VKEY_MAPPINGS (using code taken from event.c).
* [include/windows.h]
New [VK_A, VK_Z] and [VK_0, VK9] macros.
* [misc/keyboard.c]
Fixes in KeyTable and ToAscii.
* [objects/font.c]
FONT_init : Give default value for MSWIN "system" font.
FONT_MatchFont : Do not try every size of a font family if the
family does not exist.
* [windows/event.c]
lastEventChar hack removed.
KeyStateTable replaced by InputKeyStateTable (maintained in event.c)
and QueueKeyStateTable (maintained in message.c).
EVENT_key : Corrections to the extended bit setting.
* [windows/message.c] [windows/keyboard.c]
Implementation of a new QueueKeyStateTable : table of key states
valid when messages are retrieved by GetMessage or PeekMessage,
and valid for TranslateMessage.
TranslateMessage : Convert WM*KEY messages using QueueKeyStateTable
and ToAscii.
Mon Nov 18 16:59:01 1996 Robert Pouliot <krynos@clic.net>
* [graphics/Makefile.in] [graphics/wing.c]
[if1632/wing.spec]
Some functions for WinG support, mostly empty stubs.
* [misc/crtdll.c] [if1632/crtdll.spec]
Many functions added to CRTDLL, mostly calls to Unix C library.
1996-12-01 18:17:47 +01:00
|
|
|
* blocking calls are truly blocking so we always return FALSE.
|
|
|
|
*
|
|
|
|
* Note: It is allowed to call this function without prior WSAStartup().
|
|
|
|
*/
|
|
|
|
|
1999-06-26 21:09:08 +02:00
|
|
|
TRACE("\n");
|
Release 961201
Sat Nov 30 19:21:17 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [configure]
Re-generated with autoconf 2.11. Let me know if you have
problems.
* [controls/listbox.c] [controls/oldlbox.c]
Listboxes rewritten from scratch. Moved old code still used by
comboboxes to oldlbox.c
* [misc/registry.c]
Use temporary file when saving registry.
* [windows/dialog.c]
Implemented Win32 version of DlgDirList() and DlgDirListComboBox().
* [windows/winproc.c]
Added translation for listbox Win32 messages.
Sat Nov 30 21:00:00 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [controls/widgets.c] [controls/button.c]
Fixed some incompatibilities with CTL3D DLL.
* [windows/dialog.c]
Made dialog windows fit into the desktop.
* [misc/winsock.c] [misc/winsock_async.c]
New Winsock engine.
* [windows/message.c]
GetMessage() fixes.
* [windows/queue.c] [windows/hook.c] [windows/win.c]
SetMessageQueue() fixes.
Fri Nov 29 10:25:12 1996 Slaven Rezic <eserte@cs.tu-berlin.de>
* [objects/text.c]
DrawText16(): Fixed return value.
Tue Nov 26 14:47:09 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/profile.c] [*/*]
Added Win32 profile functions, updated to new naming standard.
* [objects/font.c] [if1632/thunk.c] [include/windows.h]
Added EnumFonts32*, EnumFontFamiliesEx*, changed prototypes and
structures.
* [misc/ole2nls.c] [if1632/thunk.c]
Added EnumSystemLocales() (winhelp.exe).
* [misc/registry.c]
Added Windows 3.1 registry loader supplied by Tor Sjxwall, tor@sn.no
* [win32/file.c]
Partially fixed CreateFileMapping(), added UnmapViewOfFile().
Sat Nov 23 23:36:05 1996 Ronan Waide <waider@waider.ie>
* [misc/shell.c]
Fixed some FIXMEs relating to ShellExec() and FindExecutable().
* [misc/main.c]
Implemented a few more of the SystemParametersInfo() cases.
Tue Nov 19 01:24:34 1996 Philippe De Muyter <phdm@info.ucl.ac.be>
* [include/keyboard.h]
New file, new macro WINE_VKEY_MAPPINGS (using code taken from event.c).
* [include/windows.h]
New [VK_A, VK_Z] and [VK_0, VK9] macros.
* [misc/keyboard.c]
Fixes in KeyTable and ToAscii.
* [objects/font.c]
FONT_init : Give default value for MSWIN "system" font.
FONT_MatchFont : Do not try every size of a font family if the
family does not exist.
* [windows/event.c]
lastEventChar hack removed.
KeyStateTable replaced by InputKeyStateTable (maintained in event.c)
and QueueKeyStateTable (maintained in message.c).
EVENT_key : Corrections to the extended bit setting.
* [windows/message.c] [windows/keyboard.c]
Implementation of a new QueueKeyStateTable : table of key states
valid when messages are retrieved by GetMessage or PeekMessage,
and valid for TranslateMessage.
TranslateMessage : Convert WM*KEY messages using QueueKeyStateTable
and ToAscii.
Mon Nov 18 16:59:01 1996 Robert Pouliot <krynos@clic.net>
* [graphics/Makefile.in] [graphics/wing.c]
[if1632/wing.spec]
Some functions for WinG support, mostly empty stubs.
* [misc/crtdll.c] [if1632/crtdll.spec]
Many functions added to CRTDLL, mostly calls to Unix C library.
1996-12-01 18:17:47 +01:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
1997-08-24 18:00:30 +02:00
|
|
|
/***********************************************************************
|
2001-07-02 21:59:40 +02:00
|
|
|
* WSACancelBlockingCall (WS2_32.113)
|
1997-08-24 18:00:30 +02:00
|
|
|
*/
|
1999-02-26 12:11:13 +01:00
|
|
|
INT WINAPI WSACancelBlockingCall(void)
|
Release 961201
Sat Nov 30 19:21:17 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [configure]
Re-generated with autoconf 2.11. Let me know if you have
problems.
* [controls/listbox.c] [controls/oldlbox.c]
Listboxes rewritten from scratch. Moved old code still used by
comboboxes to oldlbox.c
* [misc/registry.c]
Use temporary file when saving registry.
* [windows/dialog.c]
Implemented Win32 version of DlgDirList() and DlgDirListComboBox().
* [windows/winproc.c]
Added translation for listbox Win32 messages.
Sat Nov 30 21:00:00 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [controls/widgets.c] [controls/button.c]
Fixed some incompatibilities with CTL3D DLL.
* [windows/dialog.c]
Made dialog windows fit into the desktop.
* [misc/winsock.c] [misc/winsock_async.c]
New Winsock engine.
* [windows/message.c]
GetMessage() fixes.
* [windows/queue.c] [windows/hook.c] [windows/win.c]
SetMessageQueue() fixes.
Fri Nov 29 10:25:12 1996 Slaven Rezic <eserte@cs.tu-berlin.de>
* [objects/text.c]
DrawText16(): Fixed return value.
Tue Nov 26 14:47:09 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/profile.c] [*/*]
Added Win32 profile functions, updated to new naming standard.
* [objects/font.c] [if1632/thunk.c] [include/windows.h]
Added EnumFonts32*, EnumFontFamiliesEx*, changed prototypes and
structures.
* [misc/ole2nls.c] [if1632/thunk.c]
Added EnumSystemLocales() (winhelp.exe).
* [misc/registry.c]
Added Windows 3.1 registry loader supplied by Tor Sjxwall, tor@sn.no
* [win32/file.c]
Partially fixed CreateFileMapping(), added UnmapViewOfFile().
Sat Nov 23 23:36:05 1996 Ronan Waide <waider@waider.ie>
* [misc/shell.c]
Fixed some FIXMEs relating to ShellExec() and FindExecutable().
* [misc/main.c]
Implemented a few more of the SystemParametersInfo() cases.
Tue Nov 19 01:24:34 1996 Philippe De Muyter <phdm@info.ucl.ac.be>
* [include/keyboard.h]
New file, new macro WINE_VKEY_MAPPINGS (using code taken from event.c).
* [include/windows.h]
New [VK_A, VK_Z] and [VK_0, VK9] macros.
* [misc/keyboard.c]
Fixes in KeyTable and ToAscii.
* [objects/font.c]
FONT_init : Give default value for MSWIN "system" font.
FONT_MatchFont : Do not try every size of a font family if the
family does not exist.
* [windows/event.c]
lastEventChar hack removed.
KeyStateTable replaced by InputKeyStateTable (maintained in event.c)
and QueueKeyStateTable (maintained in message.c).
EVENT_key : Corrections to the extended bit setting.
* [windows/message.c] [windows/keyboard.c]
Implementation of a new QueueKeyStateTable : table of key states
valid when messages are retrieved by GetMessage or PeekMessage,
and valid for TranslateMessage.
TranslateMessage : Convert WM*KEY messages using QueueKeyStateTable
and ToAscii.
Mon Nov 18 16:59:01 1996 Robert Pouliot <krynos@clic.net>
* [graphics/Makefile.in] [graphics/wing.c]
[if1632/wing.spec]
Some functions for WinG support, mostly empty stubs.
* [misc/crtdll.c] [if1632/crtdll.spec]
Many functions added to CRTDLL, mostly calls to Unix C library.
1996-12-01 18:17:47 +01:00
|
|
|
{
|
2001-02-20 02:57:13 +01:00
|
|
|
TRACE("\n");
|
|
|
|
return 0;
|
Release 961201
Sat Nov 30 19:21:17 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [configure]
Re-generated with autoconf 2.11. Let me know if you have
problems.
* [controls/listbox.c] [controls/oldlbox.c]
Listboxes rewritten from scratch. Moved old code still used by
comboboxes to oldlbox.c
* [misc/registry.c]
Use temporary file when saving registry.
* [windows/dialog.c]
Implemented Win32 version of DlgDirList() and DlgDirListComboBox().
* [windows/winproc.c]
Added translation for listbox Win32 messages.
Sat Nov 30 21:00:00 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [controls/widgets.c] [controls/button.c]
Fixed some incompatibilities with CTL3D DLL.
* [windows/dialog.c]
Made dialog windows fit into the desktop.
* [misc/winsock.c] [misc/winsock_async.c]
New Winsock engine.
* [windows/message.c]
GetMessage() fixes.
* [windows/queue.c] [windows/hook.c] [windows/win.c]
SetMessageQueue() fixes.
Fri Nov 29 10:25:12 1996 Slaven Rezic <eserte@cs.tu-berlin.de>
* [objects/text.c]
DrawText16(): Fixed return value.
Tue Nov 26 14:47:09 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/profile.c] [*/*]
Added Win32 profile functions, updated to new naming standard.
* [objects/font.c] [if1632/thunk.c] [include/windows.h]
Added EnumFonts32*, EnumFontFamiliesEx*, changed prototypes and
structures.
* [misc/ole2nls.c] [if1632/thunk.c]
Added EnumSystemLocales() (winhelp.exe).
* [misc/registry.c]
Added Windows 3.1 registry loader supplied by Tor Sjxwall, tor@sn.no
* [win32/file.c]
Partially fixed CreateFileMapping(), added UnmapViewOfFile().
Sat Nov 23 23:36:05 1996 Ronan Waide <waider@waider.ie>
* [misc/shell.c]
Fixed some FIXMEs relating to ShellExec() and FindExecutable().
* [misc/main.c]
Implemented a few more of the SystemParametersInfo() cases.
Tue Nov 19 01:24:34 1996 Philippe De Muyter <phdm@info.ucl.ac.be>
* [include/keyboard.h]
New file, new macro WINE_VKEY_MAPPINGS (using code taken from event.c).
* [include/windows.h]
New [VK_A, VK_Z] and [VK_0, VK9] macros.
* [misc/keyboard.c]
Fixes in KeyTable and ToAscii.
* [objects/font.c]
FONT_init : Give default value for MSWIN "system" font.
FONT_MatchFont : Do not try every size of a font family if the
family does not exist.
* [windows/event.c]
lastEventChar hack removed.
KeyStateTable replaced by InputKeyStateTable (maintained in event.c)
and QueueKeyStateTable (maintained in message.c).
EVENT_key : Corrections to the extended bit setting.
* [windows/message.c] [windows/keyboard.c]
Implementation of a new QueueKeyStateTable : table of key states
valid when messages are retrieved by GetMessage or PeekMessage,
and valid for TranslateMessage.
TranslateMessage : Convert WM*KEY messages using QueueKeyStateTable
and ToAscii.
Mon Nov 18 16:59:01 1996 Robert Pouliot <krynos@clic.net>
* [graphics/Makefile.in] [graphics/wing.c]
[if1632/wing.spec]
Some functions for WinG support, mostly empty stubs.
* [misc/crtdll.c] [if1632/crtdll.spec]
Many functions added to CRTDLL, mostly calls to Unix C library.
1996-12-01 18:17:47 +01:00
|
|
|
}
|
|
|
|
|
2003-07-22 02:58:44 +02:00
|
|
|
static INT WINAPI WSA_DefaultBlockingHook( FARPROC x )
|
|
|
|
{
|
|
|
|
FIXME("How was this called?\n");
|
|
|
|
return x();
|
|
|
|
}
|
|
|
|
|
1997-08-24 18:00:30 +02:00
|
|
|
|
|
|
|
/***********************************************************************
|
2001-07-11 20:56:41 +02:00
|
|
|
* WSASetBlockingHook (WS2_32.109)
|
1997-08-24 18:00:30 +02:00
|
|
|
*/
|
1999-02-26 12:11:13 +01:00
|
|
|
FARPROC WINAPI WSASetBlockingHook(FARPROC lpBlockFunc)
|
1997-05-25 15:58:18 +02:00
|
|
|
{
|
2001-02-20 02:57:13 +01:00
|
|
|
FARPROC prev = blocking_hook;
|
|
|
|
blocking_hook = lpBlockFunc;
|
|
|
|
TRACE("hook %p\n", lpBlockFunc);
|
|
|
|
return prev;
|
1997-05-25 15:58:18 +02:00
|
|
|
}
|
|
|
|
|
1997-08-24 18:00:30 +02:00
|
|
|
|
|
|
|
/***********************************************************************
|
2001-07-11 20:56:41 +02:00
|
|
|
* WSAUnhookBlockingHook (WS2_32.110)
|
1997-08-24 18:00:30 +02:00
|
|
|
*/
|
1999-02-26 12:11:13 +01:00
|
|
|
INT WINAPI WSAUnhookBlockingHook(void)
|
1997-06-16 19:43:53 +02:00
|
|
|
{
|
2007-05-24 16:41:17 +02:00
|
|
|
blocking_hook = (FARPROC)WSA_DefaultBlockingHook;
|
2001-02-20 02:57:13 +01:00
|
|
|
return 0;
|
1997-06-16 19:43:53 +02:00
|
|
|
}
|
|
|
|
|
Release 961201
Sat Nov 30 19:21:17 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [configure]
Re-generated with autoconf 2.11. Let me know if you have
problems.
* [controls/listbox.c] [controls/oldlbox.c]
Listboxes rewritten from scratch. Moved old code still used by
comboboxes to oldlbox.c
* [misc/registry.c]
Use temporary file when saving registry.
* [windows/dialog.c]
Implemented Win32 version of DlgDirList() and DlgDirListComboBox().
* [windows/winproc.c]
Added translation for listbox Win32 messages.
Sat Nov 30 21:00:00 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [controls/widgets.c] [controls/button.c]
Fixed some incompatibilities with CTL3D DLL.
* [windows/dialog.c]
Made dialog windows fit into the desktop.
* [misc/winsock.c] [misc/winsock_async.c]
New Winsock engine.
* [windows/message.c]
GetMessage() fixes.
* [windows/queue.c] [windows/hook.c] [windows/win.c]
SetMessageQueue() fixes.
Fri Nov 29 10:25:12 1996 Slaven Rezic <eserte@cs.tu-berlin.de>
* [objects/text.c]
DrawText16(): Fixed return value.
Tue Nov 26 14:47:09 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/profile.c] [*/*]
Added Win32 profile functions, updated to new naming standard.
* [objects/font.c] [if1632/thunk.c] [include/windows.h]
Added EnumFonts32*, EnumFontFamiliesEx*, changed prototypes and
structures.
* [misc/ole2nls.c] [if1632/thunk.c]
Added EnumSystemLocales() (winhelp.exe).
* [misc/registry.c]
Added Windows 3.1 registry loader supplied by Tor Sjxwall, tor@sn.no
* [win32/file.c]
Partially fixed CreateFileMapping(), added UnmapViewOfFile().
Sat Nov 23 23:36:05 1996 Ronan Waide <waider@waider.ie>
* [misc/shell.c]
Fixed some FIXMEs relating to ShellExec() and FindExecutable().
* [misc/main.c]
Implemented a few more of the SystemParametersInfo() cases.
Tue Nov 19 01:24:34 1996 Philippe De Muyter <phdm@info.ucl.ac.be>
* [include/keyboard.h]
New file, new macro WINE_VKEY_MAPPINGS (using code taken from event.c).
* [include/windows.h]
New [VK_A, VK_Z] and [VK_0, VK9] macros.
* [misc/keyboard.c]
Fixes in KeyTable and ToAscii.
* [objects/font.c]
FONT_init : Give default value for MSWIN "system" font.
FONT_MatchFont : Do not try every size of a font family if the
family does not exist.
* [windows/event.c]
lastEventChar hack removed.
KeyStateTable replaced by InputKeyStateTable (maintained in event.c)
and QueueKeyStateTable (maintained in message.c).
EVENT_key : Corrections to the extended bit setting.
* [windows/message.c] [windows/keyboard.c]
Implementation of a new QueueKeyStateTable : table of key states
valid when messages are retrieved by GetMessage or PeekMessage,
and valid for TranslateMessage.
TranslateMessage : Convert WM*KEY messages using QueueKeyStateTable
and ToAscii.
Mon Nov 18 16:59:01 1996 Robert Pouliot <krynos@clic.net>
* [graphics/Makefile.in] [graphics/wing.c]
[if1632/wing.spec]
Some functions for WinG support, mostly empty stubs.
* [misc/crtdll.c] [if1632/crtdll.spec]
Many functions added to CRTDLL, mostly calls to Unix C library.
1996-12-01 18:17:47 +01:00
|
|
|
|
2002-04-05 23:22:55 +02:00
|
|
|
/***********************************************************************
|
|
|
|
* WSARecv (WS2_32.67)
|
|
|
|
*/
|
2005-01-14 20:54:38 +01:00
|
|
|
int WINAPI WSARecv(SOCKET s, LPWSABUF lpBuffers, DWORD dwBufferCount,
|
|
|
|
LPDWORD NumberOfBytesReceived, LPDWORD lpFlags,
|
|
|
|
LPWSAOVERLAPPED lpOverlapped,
|
|
|
|
LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine)
|
2002-04-05 23:22:55 +02:00
|
|
|
{
|
2010-12-06 01:08:54 +01:00
|
|
|
return WS2_recv_base(s, lpBuffers, dwBufferCount, NumberOfBytesReceived, lpFlags,
|
|
|
|
NULL, NULL, lpOverlapped, lpCompletionRoutine, NULL);
|
2002-04-05 23:22:55 +02:00
|
|
|
}
|
|
|
|
|
2001-10-02 19:46:59 +02:00
|
|
|
|
2010-07-18 02:53:06 +02:00
|
|
|
/***********************************************************************
|
|
|
|
* WSARecvFrom (WS2_32.69)
|
|
|
|
*/
|
|
|
|
INT WINAPI WSARecvFrom( SOCKET s, LPWSABUF lpBuffers, DWORD dwBufferCount,
|
|
|
|
LPDWORD lpNumberOfBytesRecvd, LPDWORD lpFlags, struct WS_sockaddr *lpFrom,
|
|
|
|
LPINT lpFromlen, LPWSAOVERLAPPED lpOverlapped,
|
|
|
|
LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine )
|
|
|
|
|
|
|
|
{
|
2021-05-27 06:36:54 +02:00
|
|
|
/* Garena hooks WSARecvFrom(), so we need a wrapper */
|
2010-12-06 01:08:54 +01:00
|
|
|
return WS2_recv_base( s, lpBuffers, dwBufferCount,
|
2010-07-18 02:53:06 +02:00
|
|
|
lpNumberOfBytesRecvd, lpFlags,
|
|
|
|
lpFrom, lpFromlen,
|
2010-12-06 01:08:54 +01:00
|
|
|
lpOverlapped, lpCompletionRoutine, NULL );
|
2010-07-18 02:53:06 +02:00
|
|
|
}
|
|
|
|
|
2002-01-14 19:33:44 +01:00
|
|
|
|
2002-01-18 19:57:43 +01:00
|
|
|
/***********************************************************************
|
2021-06-18 03:58:21 +02:00
|
|
|
* WSAAccept (ws2_32.@)
|
2002-01-18 19:57:43 +01:00
|
|
|
*/
|
2021-06-18 03:58:21 +02:00
|
|
|
SOCKET WINAPI WSAAccept( SOCKET s, struct WS_sockaddr *addr, int *addrlen,
|
|
|
|
LPCONDITIONPROC callback, DWORD_PTR context )
|
2002-01-14 19:33:44 +01:00
|
|
|
{
|
2021-06-18 03:58:21 +02:00
|
|
|
int ret = 0, size;
|
|
|
|
WSABUF caller_id, caller_data, callee_id, callee_data;
|
|
|
|
struct WS_sockaddr src_addr, dst_addr;
|
|
|
|
GROUP group;
|
|
|
|
SOCKET cs;
|
2002-01-14 19:33:44 +01:00
|
|
|
|
2021-06-18 03:58:21 +02:00
|
|
|
TRACE( "socket %#lx, addr %p, addrlen %p, callback %p, context %#lx\n",
|
|
|
|
s, addr, addrlen, callback, context );
|
|
|
|
|
|
|
|
cs = WS_accept(s, addr, addrlen);
|
|
|
|
if (cs == SOCKET_ERROR) return SOCKET_ERROR;
|
|
|
|
if (!callback) return cs;
|
|
|
|
|
|
|
|
if (addr && addrlen)
|
|
|
|
{
|
|
|
|
caller_id.buf = (char *)addr;
|
|
|
|
caller_id.len = *addrlen;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
size = sizeof(src_addr);
|
|
|
|
WS_getpeername( cs, &src_addr, &size );
|
|
|
|
caller_id.buf = (char *)&src_addr;
|
|
|
|
caller_id.len = size;
|
|
|
|
}
|
|
|
|
caller_data.buf = NULL;
|
|
|
|
caller_data.len = 0;
|
|
|
|
|
|
|
|
size = sizeof(dst_addr);
|
|
|
|
WS_getsockname( cs, &dst_addr, &size );
|
|
|
|
|
|
|
|
callee_id.buf = (char *)&dst_addr;
|
|
|
|
callee_id.len = sizeof(dst_addr);
|
|
|
|
|
|
|
|
ret = (*callback)( &caller_id, &caller_data, NULL, NULL,
|
|
|
|
&callee_id, &callee_data, &group, context );
|
|
|
|
|
|
|
|
switch (ret)
|
|
|
|
{
|
|
|
|
case CF_ACCEPT:
|
|
|
|
return cs;
|
|
|
|
|
|
|
|
case CF_DEFER:
|
2021-06-18 03:58:23 +02:00
|
|
|
{
|
|
|
|
obj_handle_t server_handle = cs;
|
|
|
|
IO_STATUS_BLOCK io;
|
|
|
|
NTSTATUS status;
|
|
|
|
|
|
|
|
status = NtDeviceIoControlFile( (HANDLE)s, NULL, NULL, NULL, &io, IOCTL_AFD_WINE_DEFER,
|
|
|
|
&server_handle, sizeof(server_handle), NULL, 0 );
|
|
|
|
SetLastError( status ? RtlNtStatusToDosError( status ) : WSATRY_AGAIN );
|
|
|
|
return -1;
|
|
|
|
}
|
2021-06-18 03:58:21 +02:00
|
|
|
|
|
|
|
case CF_REJECT:
|
|
|
|
WS_closesocket( cs );
|
|
|
|
SetLastError( WSAECONNREFUSED );
|
|
|
|
return SOCKET_ERROR;
|
|
|
|
|
|
|
|
default:
|
|
|
|
FIXME( "Unknown return type from Condition function\n" );
|
|
|
|
SetLastError( WSAENOTSOCK );
|
|
|
|
return SOCKET_ERROR;
|
|
|
|
}
|
2002-01-14 19:33:44 +01:00
|
|
|
}
|
|
|
|
|
2021-06-18 03:58:21 +02:00
|
|
|
|
2002-06-13 21:09:55 +02:00
|
|
|
/***********************************************************************
|
|
|
|
* WSADuplicateSocketA (WS2_32.32)
|
|
|
|
*/
|
|
|
|
int WINAPI WSADuplicateSocketA( SOCKET s, DWORD dwProcessId, LPWSAPROTOCOL_INFOA lpProtocolInfo )
|
|
|
|
{
|
2013-09-08 06:47:46 +02:00
|
|
|
return WS_DuplicateSocket(FALSE, s, dwProcessId, (LPWSAPROTOCOL_INFOW) lpProtocolInfo);
|
2002-06-13 21:09:55 +02:00
|
|
|
}
|
2002-11-13 20:42:23 +01:00
|
|
|
|
Stub implementations for WPUCompleteOverlappedRequest,
WSADuplicateSocketW, WSAEnumNameSpaceProviders{A,W}, WSAGetQOSByName,
WSAGetServiceClassInfo{A,W}, WSAGetServiceClassNameByClassId{A,W},
WSALookupServiceEnd, WSALookupServiceNext{A,W},
WSAProviderConfigChange, WSASetService{A,W}, WSCEnableNSProvider,
WSCGetProviderPath, WSCInstallNameSpace, WSCWriteProviderOrder.
Implementations for WSANtohl, WSANtohs, WSASocketA->W crosscall.
Avoid NULL dereferences in WSAStringToAddress{A,W} and
WSAAddressToString{A,W}.
2005-01-10 15:34:15 +01:00
|
|
|
/***********************************************************************
|
|
|
|
* WSADuplicateSocketW (WS2_32.33)
|
|
|
|
*/
|
|
|
|
int WINAPI WSADuplicateSocketW( SOCKET s, DWORD dwProcessId, LPWSAPROTOCOL_INFOW lpProtocolInfo )
|
|
|
|
{
|
2013-09-08 06:47:46 +02:00
|
|
|
return WS_DuplicateSocket(TRUE, s, dwProcessId, lpProtocolInfo);
|
Stub implementations for WPUCompleteOverlappedRequest,
WSADuplicateSocketW, WSAEnumNameSpaceProviders{A,W}, WSAGetQOSByName,
WSAGetServiceClassInfo{A,W}, WSAGetServiceClassNameByClassId{A,W},
WSALookupServiceEnd, WSALookupServiceNext{A,W},
WSAProviderConfigChange, WSASetService{A,W}, WSCEnableNSProvider,
WSCGetProviderPath, WSCInstallNameSpace, WSCWriteProviderOrder.
Implementations for WSANtohl, WSANtohs, WSASocketA->W crosscall.
Avoid NULL dereferences in WSAStringToAddress{A,W} and
WSAAddressToString{A,W}.
2005-01-10 15:34:15 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* WSAGetQOSByName (WS2_32.41)
|
|
|
|
*/
|
|
|
|
BOOL WINAPI WSAGetQOSByName( SOCKET s, LPWSABUF lpQOSName, LPQOS lpQOS )
|
|
|
|
{
|
2007-05-24 16:41:17 +02:00
|
|
|
FIXME( "(0x%04lx %p %p) Stub!\n", s, lpQOSName, lpQOS );
|
Stub implementations for WPUCompleteOverlappedRequest,
WSADuplicateSocketW, WSAEnumNameSpaceProviders{A,W}, WSAGetQOSByName,
WSAGetServiceClassInfo{A,W}, WSAGetServiceClassNameByClassId{A,W},
WSALookupServiceEnd, WSALookupServiceNext{A,W},
WSAProviderConfigChange, WSASetService{A,W}, WSCEnableNSProvider,
WSCGetProviderPath, WSCInstallNameSpace, WSCWriteProviderOrder.
Implementations for WSANtohl, WSANtohs, WSASocketA->W crosscall.
Avoid NULL dereferences in WSAStringToAddress{A,W} and
WSAAddressToString{A,W}.
2005-01-10 15:34:15 +01:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* WSARecvDisconnect (WS2_32.68)
|
|
|
|
*/
|
|
|
|
INT WINAPI WSARecvDisconnect( SOCKET s, LPWSABUF disconnectdata )
|
|
|
|
{
|
2015-03-11 01:41:21 +01:00
|
|
|
TRACE( "(%04lx %p)\n", s, disconnectdata );
|
Stub implementations for WPUCompleteOverlappedRequest,
WSADuplicateSocketW, WSAEnumNameSpaceProviders{A,W}, WSAGetQOSByName,
WSAGetServiceClassInfo{A,W}, WSAGetServiceClassNameByClassId{A,W},
WSALookupServiceEnd, WSALookupServiceNext{A,W},
WSAProviderConfigChange, WSASetService{A,W}, WSCEnableNSProvider,
WSCGetProviderPath, WSCInstallNameSpace, WSCWriteProviderOrder.
Implementations for WSANtohl, WSANtohs, WSASocketA->W crosscall.
Avoid NULL dereferences in WSAStringToAddress{A,W} and
WSAAddressToString{A,W}.
2005-01-10 15:34:15 +01:00
|
|
|
|
2014-05-12 06:21:54 +02:00
|
|
|
return WS_shutdown( s, SD_RECEIVE );
|
Stub implementations for WPUCompleteOverlappedRequest,
WSADuplicateSocketW, WSAEnumNameSpaceProviders{A,W}, WSAGetQOSByName,
WSAGetServiceClassInfo{A,W}, WSAGetServiceClassNameByClassId{A,W},
WSALookupServiceEnd, WSALookupServiceNext{A,W},
WSAProviderConfigChange, WSASetService{A,W}, WSCEnableNSProvider,
WSCGetProviderPath, WSCInstallNameSpace, WSCWriteProviderOrder.
Implementations for WSANtohl, WSANtohs, WSASocketA->W crosscall.
Avoid NULL dereferences in WSAStringToAddress{A,W} and
WSAAddressToString{A,W}.
2005-01-10 15:34:15 +01:00
|
|
|
}
|
|
|
|
|
2013-09-04 03:51:58 +02:00
|
|
|
|
2020-09-29 05:35:02 +02:00
|
|
|
static BOOL protocol_matches_filter( const int *filter, int protocol )
|
|
|
|
{
|
|
|
|
if (!filter) return TRUE;
|
|
|
|
while (*filter)
|
|
|
|
{
|
|
|
|
if (protocol == *filter++) return TRUE;
|
|
|
|
}
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2013-09-04 03:51:58 +02:00
|
|
|
/*****************************************************************************
|
|
|
|
* WSAEnumProtocolsA [WS2_32.@]
|
|
|
|
*
|
|
|
|
* see function WSAEnumProtocolsW
|
|
|
|
*/
|
2020-09-29 05:35:02 +02:00
|
|
|
int WINAPI WSAEnumProtocolsA( int *filter, WSAPROTOCOL_INFOA *protocols, DWORD *size )
|
2013-09-04 03:51:58 +02:00
|
|
|
{
|
2020-09-29 05:35:02 +02:00
|
|
|
DWORD i, count = 0;
|
|
|
|
|
|
|
|
TRACE("filter %p, protocols %p, size %p\n", filter, protocols, size);
|
|
|
|
|
|
|
|
for (i = 0; i < ARRAY_SIZE(supported_protocols); ++i)
|
|
|
|
{
|
|
|
|
if (protocol_matches_filter( filter, supported_protocols[i].iProtocol ))
|
|
|
|
++count;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!protocols || *size < count * sizeof(WSAPROTOCOL_INFOA))
|
|
|
|
{
|
|
|
|
*size = count * sizeof(WSAPROTOCOL_INFOA);
|
|
|
|
WSASetLastError( WSAENOBUFS );
|
|
|
|
return SOCKET_ERROR;
|
|
|
|
}
|
|
|
|
|
|
|
|
count = 0;
|
|
|
|
for (i = 0; i < ARRAY_SIZE(supported_protocols); ++i)
|
|
|
|
{
|
|
|
|
if (protocol_matches_filter( filter, supported_protocols[i].iProtocol ))
|
|
|
|
{
|
|
|
|
memcpy( &protocols[count], &supported_protocols[i], offsetof( WSAPROTOCOL_INFOW, szProtocol ) );
|
|
|
|
WideCharToMultiByte( CP_ACP, 0, supported_protocols[i].szProtocol, -1,
|
|
|
|
protocols[count].szProtocol, sizeof(protocols[count].szProtocol), NULL, NULL );
|
|
|
|
++count;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return count;
|
2013-09-04 03:51:58 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/*****************************************************************************
|
|
|
|
* WSAEnumProtocolsW [WS2_32.@]
|
|
|
|
*
|
|
|
|
* Retrieves information about specified set of active network protocols.
|
|
|
|
*
|
|
|
|
* PARAMS
|
|
|
|
* protocols [I] Pointer to null-terminated array of protocol id's. NULL
|
|
|
|
* retrieves information on all available protocols.
|
|
|
|
* buffer [I] Pointer to a buffer to be filled with WSAPROTOCOL_INFO
|
|
|
|
* structures.
|
|
|
|
* len [I/O] Pointer to a variable specifying buffer size. On output
|
|
|
|
* the variable holds the number of bytes needed when the
|
|
|
|
* specified size is too small.
|
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
* Success: number of WSAPROTOCOL_INFO structures in buffer.
|
|
|
|
* Failure: SOCKET_ERROR
|
|
|
|
*
|
|
|
|
* NOTES
|
|
|
|
* NT4SP5 does not return SPX if protocols == NULL
|
|
|
|
*
|
|
|
|
* BUGS
|
|
|
|
* - NT4SP5 returns in addition these list of NETBIOS protocols
|
|
|
|
* (address family 17), each entry two times one for socket type 2 and 5
|
|
|
|
*
|
|
|
|
* iProtocol szProtocol
|
|
|
|
* 0x80000000 \Device\NwlnkNb
|
|
|
|
* 0xfffffffa \Device\NetBT_CBENT7
|
|
|
|
* 0xfffffffb \Device\Nbf_CBENT7
|
|
|
|
* 0xfffffffc \Device\NetBT_NdisWan5
|
|
|
|
* 0xfffffffd \Device\NetBT_El9202
|
|
|
|
* 0xfffffffe \Device\Nbf_El9202
|
|
|
|
* 0xffffffff \Device\Nbf_NdisWan4
|
|
|
|
*
|
|
|
|
* - there is no check that the operating system supports the returned
|
|
|
|
* protocols
|
|
|
|
*/
|
2020-09-29 05:35:02 +02:00
|
|
|
int WINAPI WSAEnumProtocolsW( int *filter, WSAPROTOCOL_INFOW *protocols, DWORD *size )
|
2013-09-04 03:51:58 +02:00
|
|
|
{
|
2020-09-29 05:35:02 +02:00
|
|
|
DWORD i, count = 0;
|
|
|
|
|
|
|
|
TRACE("filter %p, protocols %p, size %p\n", filter, protocols, size);
|
|
|
|
|
|
|
|
for (i = 0; i < ARRAY_SIZE(supported_protocols); ++i)
|
|
|
|
{
|
|
|
|
if (protocol_matches_filter( filter, supported_protocols[i].iProtocol ))
|
|
|
|
++count;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!protocols || *size < count * sizeof(WSAPROTOCOL_INFOW))
|
|
|
|
{
|
|
|
|
*size = count * sizeof(WSAPROTOCOL_INFOW);
|
|
|
|
WSASetLastError( WSAENOBUFS );
|
|
|
|
return SOCKET_ERROR;
|
|
|
|
}
|
|
|
|
|
|
|
|
count = 0;
|
|
|
|
for (i = 0; i < ARRAY_SIZE(supported_protocols); ++i)
|
|
|
|
{
|
|
|
|
if (protocol_matches_filter( filter, supported_protocols[i].iProtocol ))
|
|
|
|
protocols[count++] = supported_protocols[i];
|
|
|
|
}
|
|
|
|
return count;
|
2013-09-04 03:51:58 +02:00
|
|
|
}
|