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
|
|
|
|
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
|
|
|
|
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
|
|
|
|
2021-08-11 20:13:01 +02:00
|
|
|
#define TIMEOUT_INFINITE _I64_MAX
|
|
|
|
|
2021-12-10 18:27:35 +01:00
|
|
|
#define u64_from_user_ptr(ptr) ((ULONGLONG)(uintptr_t)(ptr))
|
|
|
|
|
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,
|
2021-08-05 04:20:48 +02:00
|
|
|
.iAddressFamily = AF_INET,
|
|
|
|
.iMaxSockAddr = sizeof(struct sockaddr_in),
|
|
|
|
.iMinSockAddr = sizeof(struct sockaddr_in),
|
|
|
|
.iSocketType = SOCK_STREAM,
|
|
|
|
.iProtocol = IPPROTO_TCP,
|
2021-08-05 04:20:47 +02:00
|
|
|
.szProtocol = L"TCP/IP",
|
2020-09-29 05:35:02 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
.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,
|
2021-08-05 04:20:48 +02:00
|
|
|
.iAddressFamily = AF_INET,
|
|
|
|
.iMaxSockAddr = sizeof(struct sockaddr_in),
|
|
|
|
.iMinSockAddr = sizeof(struct sockaddr_in),
|
|
|
|
.iSocketType = SOCK_DGRAM,
|
|
|
|
.iProtocol = IPPROTO_UDP,
|
2020-09-29 05:35:02 +02:00
|
|
|
.dwMessageSize = 0xffbb,
|
2021-08-05 04:20:47 +02:00
|
|
|
.szProtocol = L"UDP/IP",
|
2020-09-29 05:35:02 +02:00
|
|
|
},
|
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,
|
2021-08-05 04:20:48 +02:00
|
|
|
.iAddressFamily = AF_INET6,
|
|
|
|
.iMaxSockAddr = sizeof(struct sockaddr_in6),
|
|
|
|
.iMinSockAddr = sizeof(struct sockaddr_in6),
|
|
|
|
.iSocketType = SOCK_STREAM,
|
|
|
|
.iProtocol = IPPROTO_TCP,
|
2021-08-05 04:20:47 +02:00
|
|
|
.szProtocol = L"TCP/IPv6",
|
2020-09-29 05:35:04 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
.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,
|
2021-08-05 04:20:48 +02:00
|
|
|
.iAddressFamily = AF_INET6,
|
|
|
|
.iMaxSockAddr = sizeof(struct sockaddr_in6),
|
|
|
|
.iMinSockAddr = sizeof(struct sockaddr_in6),
|
|
|
|
.iSocketType = SOCK_DGRAM,
|
|
|
|
.iProtocol = IPPROTO_UDP,
|
2020-09-29 05:35:04 +02:00
|
|
|
.dwMessageSize = 0xffbb,
|
2021-08-05 04:20:47 +02:00
|
|
|
.szProtocol = L"UDP/IPv6",
|
2020-09-29 05:35:04 +02:00
|
|
|
},
|
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,
|
2021-08-05 04:20:48 +02:00
|
|
|
.iAddressFamily = AF_IPX,
|
|
|
|
.iMaxSockAddr = sizeof(struct sockaddr),
|
|
|
|
.iMinSockAddr = sizeof(struct sockaddr_ipx),
|
|
|
|
.iSocketType = SOCK_DGRAM,
|
|
|
|
.iProtocol = NSPROTO_IPX,
|
2020-09-29 05:35:02 +02:00
|
|
|
.iProtocolMaxOffset = 255,
|
|
|
|
.dwMessageSize = 0x240,
|
2021-08-05 04:20:47 +02:00
|
|
|
.szProtocol = L"IPX",
|
2020-09-29 05:35:02 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
.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,
|
2021-08-05 04:20:48 +02:00
|
|
|
.iAddressFamily = AF_IPX,
|
|
|
|
.iMaxSockAddr = sizeof(struct sockaddr),
|
|
|
|
.iMinSockAddr = sizeof(struct sockaddr_ipx),
|
|
|
|
.iSocketType = SOCK_SEQPACKET,
|
|
|
|
.iProtocol = NSPROTO_SPX,
|
2020-09-29 05:35:02 +02:00
|
|
|
.dwMessageSize = UINT_MAX,
|
2021-08-05 04:20:47 +02:00
|
|
|
.szProtocol = L"SPX",
|
2020-09-29 05:35:02 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
.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,
|
2021-08-05 04:20:48 +02:00
|
|
|
.iAddressFamily = AF_IPX,
|
|
|
|
.iMaxSockAddr = sizeof(struct sockaddr),
|
|
|
|
.iMinSockAddr = sizeof(struct sockaddr_ipx),
|
|
|
|
.iSocketType = SOCK_SEQPACKET,
|
|
|
|
.iProtocol = NSPROTO_SPXII,
|
2020-09-29 05:35:02 +02:00
|
|
|
.dwMessageSize = UINT_MAX,
|
2021-08-05 04:20:47 +02:00
|
|
|
.szProtocol = L"SPX II",
|
2020-09-29 05:35:02 +02:00
|
|
|
},
|
|
|
|
};
|
|
|
|
|
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-08-05 04:20:48 +02:00
|
|
|
const char *debugstr_sockaddr( const struct 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)
|
|
|
|
{
|
2021-08-05 04:20:48 +02:00
|
|
|
case AF_INET:
|
2015-08-10 16:08:44 +02:00
|
|
|
{
|
|
|
|
char buf[16];
|
|
|
|
const char *p;
|
2021-08-05 04:20:48 +02:00
|
|
|
struct sockaddr_in *sin = (struct sockaddr_in *)a;
|
2015-08-10 16:08:44 +02:00
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
p = inet_ntop( AF_INET, &sin->sin_addr, buf, sizeof(buf) );
|
2015-08-10 16:08:44 +02:00
|
|
|
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));
|
|
|
|
}
|
2021-08-05 04:20:48 +02:00
|
|
|
case AF_INET6:
|
2009-08-03 18:33:02 +02:00
|
|
|
{
|
|
|
|
char buf[46];
|
|
|
|
const char *p;
|
2021-08-05 04:20:48 +02:00
|
|
|
struct sockaddr_in6 *sin = (struct sockaddr_in6 *)a;
|
2009-08-03 18:33:02 +02:00
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
p = inet_ntop( AF_INET6, &sin->sin6_addr, buf, sizeof(buf) );
|
2009-08-03 18:33:02 +02:00
|
|
|
if (!p)
|
|
|
|
p = "(unknown IPv6 address)";
|
2022-02-05 02:35:37 +01:00
|
|
|
return wine_dbg_sprintf("{ family AF_INET6, address %s, flow label %#lx, port %d, scope %lu }",
|
2021-07-23 18:39:11 +02:00
|
|
|
p, sin->sin6_flowinfo, ntohs(sin->sin6_port), sin->sin6_scope_id );
|
2009-08-03 18:33:02 +02:00
|
|
|
}
|
2021-08-05 04:20:48 +02:00
|
|
|
case AF_IPX:
|
2013-12-27 21:28:05 +01:00
|
|
|
{
|
|
|
|
int i;
|
|
|
|
char netnum[16], nodenum[16];
|
2021-08-05 04:20:48 +02:00
|
|
|
struct sockaddr_ipx *sin = (struct sockaddr_ipx *)a;
|
2013-12-27 21:28:05 +01:00
|
|
|
|
|
|
|
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);
|
|
|
|
}
|
2021-08-05 04:20:48 +02:00
|
|
|
case AF_IRDA:
|
2009-08-12 18:15:17 +02:00
|
|
|
{
|
|
|
|
DWORD addr;
|
|
|
|
|
|
|
|
memcpy( &addr, ((const SOCKADDR_IRDA *)a)->irdaDeviceID, sizeof(addr) );
|
|
|
|
addr = ntohl( addr );
|
2022-02-05 02:35:37 +01:00
|
|
|
return wine_dbg_sprintf("{ family AF_IRDA, addr %08lx, name %s }",
|
2009-08-12 18:15:17 +02:00
|
|
|
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)
|
|
|
|
{
|
2021-08-05 04:20:48 +02:00
|
|
|
DEBUG_SOCKLEVEL(SOL_SOCKET);
|
2015-04-02 05:17:39 +02:00
|
|
|
switch(optname)
|
|
|
|
{
|
2021-08-05 04:20:48 +02:00
|
|
|
DEBUG_SOCKOPT(SO_ACCEPTCONN);
|
|
|
|
DEBUG_SOCKOPT(SO_BROADCAST);
|
|
|
|
DEBUG_SOCKOPT(SO_BSP_STATE);
|
|
|
|
DEBUG_SOCKOPT(SO_CONDITIONAL_ACCEPT);
|
|
|
|
DEBUG_SOCKOPT(SO_CONNECT_TIME);
|
|
|
|
DEBUG_SOCKOPT(SO_DEBUG);
|
|
|
|
DEBUG_SOCKOPT(SO_DONTLINGER);
|
|
|
|
DEBUG_SOCKOPT(SO_DONTROUTE);
|
|
|
|
DEBUG_SOCKOPT(SO_ERROR);
|
|
|
|
DEBUG_SOCKOPT(SO_EXCLUSIVEADDRUSE);
|
|
|
|
DEBUG_SOCKOPT(SO_GROUP_ID);
|
|
|
|
DEBUG_SOCKOPT(SO_GROUP_PRIORITY);
|
|
|
|
DEBUG_SOCKOPT(SO_KEEPALIVE);
|
|
|
|
DEBUG_SOCKOPT(SO_LINGER);
|
|
|
|
DEBUG_SOCKOPT(SO_MAX_MSG_SIZE);
|
|
|
|
DEBUG_SOCKOPT(SO_OOBINLINE);
|
|
|
|
DEBUG_SOCKOPT(SO_OPENTYPE);
|
|
|
|
DEBUG_SOCKOPT(SO_PROTOCOL_INFOA);
|
|
|
|
DEBUG_SOCKOPT(SO_PROTOCOL_INFOW);
|
|
|
|
DEBUG_SOCKOPT(SO_RCVBUF);
|
|
|
|
DEBUG_SOCKOPT(SO_RCVTIMEO);
|
|
|
|
DEBUG_SOCKOPT(SO_REUSEADDR);
|
|
|
|
DEBUG_SOCKOPT(SO_SNDBUF);
|
|
|
|
DEBUG_SOCKOPT(SO_SNDTIMEO);
|
|
|
|
DEBUG_SOCKOPT(SO_TYPE);
|
|
|
|
DEBUG_SOCKOPT(SO_UPDATE_CONNECT_CONTEXT);
|
2015-04-02 05:17:39 +02:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
DEBUG_SOCKLEVEL(NSPROTO_IPX);
|
2015-04-02 05:17:39 +02:00
|
|
|
switch(optname)
|
|
|
|
{
|
2021-08-05 04:20:48 +02:00
|
|
|
DEBUG_SOCKOPT(IPX_PTYPE);
|
|
|
|
DEBUG_SOCKOPT(IPX_FILTERPTYPE);
|
|
|
|
DEBUG_SOCKOPT(IPX_DSTYPE);
|
|
|
|
DEBUG_SOCKOPT(IPX_RECVHDR);
|
|
|
|
DEBUG_SOCKOPT(IPX_MAXSIZE);
|
|
|
|
DEBUG_SOCKOPT(IPX_ADDRESS);
|
|
|
|
DEBUG_SOCKOPT(IPX_MAX_ADAPTER_NUM);
|
2015-04-02 05:17:39 +02:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
DEBUG_SOCKLEVEL(SOL_IRLMP);
|
2015-04-02 05:17:39 +02:00
|
|
|
switch(optname)
|
|
|
|
{
|
2021-08-05 04:20:48 +02:00
|
|
|
DEBUG_SOCKOPT(IRLMP_ENUMDEVICES);
|
2015-04-02 05:17:39 +02:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
DEBUG_SOCKLEVEL(IPPROTO_TCP);
|
2015-04-02 05:17:39 +02:00
|
|
|
switch(optname)
|
|
|
|
{
|
2021-08-05 04:20:48 +02:00
|
|
|
DEBUG_SOCKOPT(TCP_BSDURGENT);
|
|
|
|
DEBUG_SOCKOPT(TCP_EXPEDITED_1122);
|
|
|
|
DEBUG_SOCKOPT(TCP_NODELAY);
|
2015-04-02 05:17:39 +02:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
DEBUG_SOCKLEVEL(IPPROTO_IP);
|
2015-04-02 05:17:39 +02:00
|
|
|
switch(optname)
|
|
|
|
{
|
2021-08-05 04:20:48 +02:00
|
|
|
DEBUG_SOCKOPT(IP_ADD_MEMBERSHIP);
|
|
|
|
DEBUG_SOCKOPT(IP_DONTFRAGMENT);
|
|
|
|
DEBUG_SOCKOPT(IP_DROP_MEMBERSHIP);
|
|
|
|
DEBUG_SOCKOPT(IP_HDRINCL);
|
|
|
|
DEBUG_SOCKOPT(IP_MULTICAST_IF);
|
|
|
|
DEBUG_SOCKOPT(IP_MULTICAST_LOOP);
|
|
|
|
DEBUG_SOCKOPT(IP_MULTICAST_TTL);
|
|
|
|
DEBUG_SOCKOPT(IP_OPTIONS);
|
|
|
|
DEBUG_SOCKOPT(IP_PKTINFO);
|
|
|
|
DEBUG_SOCKOPT(IP_RECEIVE_BROADCAST);
|
2021-09-29 08:40:55 +02:00
|
|
|
DEBUG_SOCKOPT(IP_RECVTOS);
|
2021-09-29 08:40:54 +02:00
|
|
|
DEBUG_SOCKOPT(IP_RECVTTL);
|
2021-08-05 04:20:48 +02:00
|
|
|
DEBUG_SOCKOPT(IP_TOS);
|
|
|
|
DEBUG_SOCKOPT(IP_TTL);
|
|
|
|
DEBUG_SOCKOPT(IP_UNICAST_IF);
|
2015-04-02 05:17:39 +02:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
DEBUG_SOCKLEVEL(IPPROTO_IPV6);
|
2015-04-02 05:17:39 +02:00
|
|
|
switch(optname)
|
|
|
|
{
|
2021-08-05 04:20:48 +02:00
|
|
|
DEBUG_SOCKOPT(IPV6_ADD_MEMBERSHIP);
|
|
|
|
DEBUG_SOCKOPT(IPV6_DROP_MEMBERSHIP);
|
|
|
|
DEBUG_SOCKOPT(IPV6_HOPLIMIT);
|
|
|
|
DEBUG_SOCKOPT(IPV6_MULTICAST_IF);
|
|
|
|
DEBUG_SOCKOPT(IPV6_MULTICAST_HOPS);
|
|
|
|
DEBUG_SOCKOPT(IPV6_MULTICAST_LOOP);
|
|
|
|
DEBUG_SOCKOPT(IPV6_PKTINFO);
|
2021-08-13 07:56:13 +02:00
|
|
|
DEBUG_SOCKOPT(IPV6_RECVTCLASS);
|
2021-08-05 04:20:48 +02:00
|
|
|
DEBUG_SOCKOPT(IPV6_UNICAST_HOPS);
|
|
|
|
DEBUG_SOCKOPT(IPV6_V6ONLY);
|
|
|
|
DEBUG_SOCKOPT(IPV6_UNICAST_IF);
|
|
|
|
DEBUG_SOCKOPT(IPV6_DONTFRAG);
|
2015-04-02 05:17:39 +02:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
#undef DEBUG_SOCKLEVEL
|
|
|
|
#undef DEBUG_SOCKOPT
|
|
|
|
|
|
|
|
if (!strlevel)
|
2021-08-05 04:20:48 +02:00
|
|
|
strlevel = wine_dbg_sprintf("0x%x", level);
|
2015-04-02 05:17:39 +02:00
|
|
|
if (!stropt)
|
2021-08-05 04:20:48 +02:00
|
|
|
stropt = wine_dbg_sprintf("0x%x", optname);
|
2015-04-02 05:17:39 +02:00
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
return wine_dbg_sprintf("level %s, name %s", strlevel, stropt);
|
2015-04-02 05:17:39 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
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);
|
2022-02-05 02:35:37 +01:00
|
|
|
return wine_dbg_sprintf("%p (%lu)", optval, value);
|
2015-04-02 05:17:39 +02:00
|
|
|
}
|
|
|
|
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);
|
2021-08-19 06:25:48 +02:00
|
|
|
if (!(new_array = 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;
|
|
|
|
|
2021-08-24 14:50:39 +02:00
|
|
|
if (!socket) return FALSE;
|
|
|
|
|
2021-05-27 06:36:54 +02:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-08-03 02:37:37 +02:00
|
|
|
static BOOL socket_list_remove( SOCKET socket )
|
2020-09-10 23:17:14 +02:00
|
|
|
{
|
|
|
|
unsigned int i;
|
|
|
|
|
2021-08-24 14:50:39 +02:00
|
|
|
if (!socket) return FALSE;
|
|
|
|
|
2020-09-10 23:17:14 +02:00
|
|
|
EnterCriticalSection(&cs_socket_list);
|
|
|
|
for (i = 0; i < socket_list_size; ++i)
|
|
|
|
{
|
|
|
|
if (socket_list[i] == socket)
|
|
|
|
{
|
|
|
|
socket_list[i] = 0;
|
2021-08-03 02:37:37 +02:00
|
|
|
LeaveCriticalSection( &cs_socket_list );
|
|
|
|
return TRUE;
|
2020-09-10 23:17:14 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
LeaveCriticalSection(&cs_socket_list);
|
2021-08-03 02:37:37 +02:00
|
|
|
return FALSE;
|
2020-09-10 23:17:14 +02:00
|
|
|
}
|
|
|
|
|
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
|
|
|
|
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
|
|
|
}
|
|
|
|
|
2002-04-17 18:46:49 +02:00
|
|
|
|
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
|
|
|
{
|
2021-08-19 06:25:48 +02:00
|
|
|
struct per_thread_data *data = NtCurrentTeb()->WinSockData;
|
|
|
|
|
|
|
|
if (!data)
|
2004-12-22 19:23:49 +01:00
|
|
|
{
|
2021-08-19 06:25:48 +02:00
|
|
|
data = calloc( 1, sizeof(*data) );
|
|
|
|
NtCurrentTeb()->WinSockData = data;
|
2004-12-22 19:23:49 +01:00
|
|
|
}
|
2021-08-19 06:25:48 +02:00
|
|
|
return data;
|
2004-12-22 19:23:49 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static void free_per_thread_data(void)
|
1999-10-23 18:53:34 +02:00
|
|
|
{
|
2021-08-19 06:25:48 +02:00
|
|
|
struct per_thread_data *data = NtCurrentTeb()->WinSockData;
|
2004-12-22 19:23:49 +01:00
|
|
|
|
2021-08-19 06:25:48 +02:00
|
|
|
if (!data) return;
|
2004-12-22 19:23:49 +01:00
|
|
|
|
2021-08-19 06:25:48 +02:00
|
|
|
CloseHandle( data->sync_event );
|
2021-05-18 04:29:56 +02:00
|
|
|
|
2001-02-20 02:57:13 +01:00
|
|
|
/* delete scratch buffers */
|
2021-08-19 06:25:48 +02:00
|
|
|
free( data->he_buffer );
|
|
|
|
free( data->se_buffer );
|
|
|
|
free( data->pe_buffer );
|
1999-10-23 18:53:34 +02:00
|
|
|
|
2021-08-19 06:25:48 +02:00
|
|
|
free( data );
|
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;
|
|
|
|
}
|
|
|
|
|
2021-08-04 06:53:33 +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-08-04 06:53:33 +02:00
|
|
|
switch (reason)
|
|
|
|
{
|
|
|
|
case DLL_PROCESS_ATTACH:
|
2021-08-11 20:40:23 +02:00
|
|
|
return !NtQueryVirtualMemory( GetCurrentProcess(), instance, MemoryWineUnixFuncs,
|
|
|
|
&ws_unix_handle, sizeof(ws_unix_handle), NULL );
|
2021-08-04 06:53:33 +02:00
|
|
|
|
|
|
|
case DLL_THREAD_DETACH:
|
2004-12-22 19:23:49 +01:00
|
|
|
free_per_thread_data();
|
2021-08-04 06:53:33 +02:00
|
|
|
}
|
1999-10-23 18:53:34 +02:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
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
|
|
|
* WSAStartup (WS2_32.115)
|
1997-08-24 18:00:30 +02:00
|
|
|
*/
|
2022-02-01 07:20:47 +01:00
|
|
|
int WINAPI WSAStartup( WORD version, WSADATA *data )
|
2000-06-18 19:23:17 +02:00
|
|
|
{
|
2022-02-01 07:20:47 +01:00
|
|
|
TRACE( "version %#x\n", version );
|
2000-06-18 19:23:17 +02:00
|
|
|
|
2022-02-01 07:20:47 +01:00
|
|
|
if (data)
|
|
|
|
{
|
2022-02-01 07:20:48 +01:00
|
|
|
if (!LOBYTE(version) || LOBYTE(version) > 2
|
|
|
|
|| (LOBYTE(version) == 2 && HIBYTE(version) > 2))
|
|
|
|
data->wVersion = MAKEWORD(2, 2);
|
|
|
|
else if (LOBYTE(version) == 1 && HIBYTE(version) > 1)
|
|
|
|
data->wVersion = MAKEWORD(1, 1);
|
|
|
|
else
|
|
|
|
data->wVersion = version;
|
2022-02-01 07:20:47 +01:00
|
|
|
data->wHighVersion = MAKEWORD(2, 2);
|
|
|
|
strcpy( data->szDescription, "WinSock 2.0" );
|
|
|
|
strcpy( data->szSystemStatus, "Running" );
|
2022-02-01 07:20:49 +01:00
|
|
|
data->iMaxSockets = (LOBYTE(version) == 1 ? 32767 : 0);
|
2022-02-01 07:20:50 +01:00
|
|
|
data->iMaxUdpDg = (LOBYTE(version) == 1 ? 65467 : 0);
|
2022-02-01 07:20:47 +01:00
|
|
|
/* don't fill lpVendorInfo */
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!LOBYTE(version))
|
2000-06-18 19:23:17 +02:00
|
|
|
return WSAVERNOTSUPPORTED;
|
|
|
|
|
2022-02-01 07:20:51 +01:00
|
|
|
if (!data) return WSAEFAULT;
|
2000-06-18 19:23:17 +02:00
|
|
|
|
2001-02-20 02:57:13 +01:00
|
|
|
num_startup++;
|
2022-02-01 07:20:47 +01:00
|
|
|
TRACE( "increasing startup count to %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
|
|
|
|
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
|
|
|
|
2022-02-05 02:35:37 +01:00
|
|
|
TRACE( "unicode %d, socket %#Ix, pid %#lx, info %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)
|
|
|
|
*/
|
2021-08-05 04:20:48 +02:00
|
|
|
SOCKET WINAPI accept( SOCKET s, struct 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;
|
2021-08-11 20:13:01 +02:00
|
|
|
ULONG 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
|
|
|
|
2022-02-05 02:35:37 +01:00
|
|
|
TRACE( "socket %#Ix\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)
|
|
|
|
{
|
2022-02-09 18:34:45 +01:00
|
|
|
TRACE( "failed, status %#lx\n", status );
|
2020-10-19 18:21:19 +02:00
|
|
|
WSASetLastError( NtStatusToWSAError( status ) );
|
|
|
|
return INVALID_SOCKET;
|
2018-11-20 15:53:30 +01:00
|
|
|
}
|
2009-09-25 07:59:16 +02:00
|
|
|
|
2021-08-11 20:13:01 +02:00
|
|
|
ret = accept_handle;
|
2020-10-19 18:21:19 +02:00
|
|
|
if (!socket_list_add( ret ))
|
|
|
|
{
|
|
|
|
CloseHandle( SOCKET2HANDLE(ret) );
|
|
|
|
return INVALID_SOCKET;
|
|
|
|
}
|
2021-08-05 04:20:48 +02:00
|
|
|
if (addr && len && getpeername( ret, addr, len ))
|
2020-10-19 18:21:19 +02:00
|
|
|
{
|
2021-08-05 04:20:48 +02:00
|
|
|
closesocket( ret );
|
2020-10-19 18:21:19 +02:00
|
|
|
return INVALID_SOCKET;
|
|
|
|
}
|
|
|
|
|
2022-02-05 02:35:37 +01:00
|
|
|
TRACE( "returning %#Ix\n", ret );
|
2020-10-19 18:21:19 +02:00
|
|
|
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
|
|
|
|
2022-02-05 02:35:37 +01:00
|
|
|
TRACE( "listener %#Ix, acceptor %#Ix, dest %p, recv_len %lu, local_len %lu, remote_len %lu, ret_len %p, "
|
2020-10-19 18:21:18 +02:00
|
|
|
"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) );
|
2022-02-09 18:34:45 +01:00
|
|
|
TRACE( "status %#lx.\n", status );
|
2020-10-19 18:21:18 +02:00
|
|
|
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-12-10 18:27:37 +01:00
|
|
|
struct afd_transmit_params params = {{{0}}};
|
2021-05-28 01:57:30 +02:00
|
|
|
IO_STATUS_BLOCK iosb, *piosb = &iosb;
|
|
|
|
HANDLE event = NULL;
|
|
|
|
void *cvalue = NULL;
|
2015-10-07 20:14:56 +02:00
|
|
|
NTSTATUS status;
|
|
|
|
|
2022-02-05 02:35:37 +01:00
|
|
|
TRACE( "socket %#Ix, file %p, file_len %lu, buffer_size %lu, overlapped %p, buffers %p, flags %#lx\n",
|
2021-05-28 01:57:30 +02:00
|
|
|
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-12-10 18:27:37 +01:00
|
|
|
params.file = HandleToULong( file );
|
2021-05-28 01:57:30 +02:00
|
|
|
params.file_len = file_len;
|
|
|
|
params.buffer_size = buffer_size;
|
2021-12-10 18:27:37 +01:00
|
|
|
if (buffers)
|
|
|
|
{
|
|
|
|
params.head_ptr = u64_from_user_ptr(buffers->Head);
|
|
|
|
params.head_len = buffers->HeadLength;
|
|
|
|
params.tail_ptr = u64_from_user_ptr(buffers->Tail);
|
|
|
|
params.tail_len = buffers->TailLength;
|
|
|
|
}
|
2021-05-28 01:57:30 +02:00
|
|
|
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 ) );
|
2022-02-09 18:34:45 +01:00
|
|
|
TRACE( "status %#lx.\n", status );
|
2021-05-28 01:57:30 +02:00
|
|
|
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
|
|
|
|
*/
|
2021-08-05 04:20:48 +02:00
|
|
|
static void WINAPI WS2_GetAcceptExSockaddrs( void *buffer, DWORD data_size, DWORD local_size, DWORD remote_size,
|
|
|
|
struct sockaddr **local_addr, LPINT local_addr_len,
|
|
|
|
struct sockaddr **remote_addr, LPINT remote_addr_len )
|
2010-09-21 03:30:28 +02:00
|
|
|
{
|
|
|
|
char *cbuf = buffer;
|
2022-02-05 02:35:37 +01:00
|
|
|
|
|
|
|
TRACE( "buffer %p, data_size %lu, local_size %lu, remote_size %lu,"
|
|
|
|
" local_addr %p, local_addr_len %p, remote_addr %p, remote_addr_len %p\n",
|
|
|
|
buffer, data_size, local_size, remote_size,
|
|
|
|
local_addr, local_addr_len, remote_addr, remote_addr_len );
|
|
|
|
|
2010-09-21 03:30:28 +02:00
|
|
|
cbuf += data_size;
|
|
|
|
|
|
|
|
*local_addr_len = *(int *) cbuf;
|
2021-08-05 04:20:48 +02:00
|
|
|
*local_addr = (struct sockaddr *)(cbuf + sizeof(int));
|
2010-09-21 03:30:28 +02:00
|
|
|
|
|
|
|
cbuf += local_size;
|
|
|
|
|
|
|
|
*remote_addr_len = *(int *) cbuf;
|
2021-08-05 04:20:48 +02:00
|
|
|
*remote_addr = (struct sockaddr *)(cbuf + sizeof(int));
|
2010-09-21 03:30:28 +02:00
|
|
|
}
|
|
|
|
|
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,
|
2021-08-05 04:20:48 +02:00
|
|
|
struct sockaddr *addr, int *addr_len, OVERLAPPED *overlapped,
|
2021-05-27 06:36:51 +02:00
|
|
|
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;
|
|
|
|
|
2022-02-05 02:35:37 +01:00
|
|
|
TRACE( "socket %#Ix, buffers %p, buffer_count %lu, flags %#lx, addr %p, "
|
2021-05-27 06:36:51 +02:00
|
|
|
"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;
|
|
|
|
}
|
|
|
|
|
2021-12-10 18:27:35 +01:00
|
|
|
params.control_ptr = u64_from_user_ptr(control);
|
|
|
|
params.addr_ptr = u64_from_user_ptr(addr);
|
|
|
|
params.addr_len_ptr = u64_from_user_ptr(addr_len);
|
|
|
|
params.ws_flags_ptr = u64_from_user_ptr(flags);
|
2021-05-27 06:36:51 +02:00
|
|
|
params.force_async = !!overlapped;
|
|
|
|
params.count = buffer_count;
|
2021-12-10 18:27:35 +01:00
|
|
|
params.buffers_ptr = u64_from_user_ptr(buffers);
|
2021-05-27 06:36:51 +02:00
|
|
|
|
|
|
|
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 ) );
|
2022-02-09 18:34:45 +01:00
|
|
|
TRACE( "status %#lx.\n", status );
|
2021-05-27 06:36:51 +02:00
|
|
|
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,
|
2021-08-05 04:20:48 +02:00
|
|
|
const struct sockaddr *addr, int addr_len, OVERLAPPED *overlapped,
|
2021-05-27 06:36:54 +02:00
|
|
|
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;
|
|
|
|
|
2022-02-05 02:35:37 +01:00
|
|
|
TRACE( "socket %#Ix, buffers %p, buffer_count %lu, flags %#lx, addr %p, "
|
2021-05-27 06:36:54 +02:00
|
|
|
"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;
|
|
|
|
}
|
|
|
|
|
2021-12-10 18:27:36 +01:00
|
|
|
params.addr_ptr = u64_from_user_ptr( addr );
|
2021-05-27 06:36:54 +02:00
|
|
|
params.addr_len = addr_len;
|
|
|
|
params.ws_flags = flags;
|
|
|
|
params.force_async = !!overlapped;
|
|
|
|
params.count = buffer_count;
|
2021-12-10 18:27:36 +01:00
|
|
|
params.buffers_ptr = u64_from_user_ptr( buffers );
|
2021-05-27 06:36:54 +02:00
|
|
|
|
|
|
|
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 ) );
|
2022-02-09 18:34:45 +01:00
|
|
|
TRACE( "status %#lx.\n", status );
|
2021-05-27 06:36:54 +02:00
|
|
|
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-08-05 04:20:48 +02:00
|
|
|
int WINAPI bind( SOCKET s, const struct 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;
|
2021-08-05 04:20:48 +02:00
|
|
|
struct sockaddr *ret_addr;
|
2021-06-16 06:13:32 +02:00
|
|
|
IO_STATUS_BLOCK io;
|
|
|
|
HANDLE sync_event;
|
|
|
|
NTSTATUS status;
|
2012-09-27 00:38:09 +02:00
|
|
|
|
2022-02-05 02:35:37 +01:00
|
|
|
TRACE( "socket %#Ix, addr %s\n", s, debugstr_sockaddr(addr) );
|
2021-06-04 23:24:16 +02:00
|
|
|
|
2021-07-22 03:34:51 +02:00
|
|
|
if (!addr)
|
2021-06-04 23:24:16 +02:00
|
|
|
{
|
2021-10-18 07:45:29 +02:00
|
|
|
SetLastError( WSAEFAULT );
|
2021-06-16 06:13:32 +02:00
|
|
|
return -1;
|
2012-09-27 00:38:09 +02:00
|
|
|
}
|
|
|
|
|
2021-07-22 03:34:51 +02:00
|
|
|
switch (addr->sa_family)
|
|
|
|
{
|
2021-08-05 04:20:48 +02:00
|
|
|
case AF_INET:
|
|
|
|
if (len < sizeof(struct sockaddr_in))
|
2021-07-22 03:34:51 +02:00
|
|
|
{
|
|
|
|
SetLastError( WSAEFAULT );
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
case AF_INET6:
|
|
|
|
if (len < sizeof(struct sockaddr_in6))
|
2021-07-22 03:34:51 +02:00
|
|
|
{
|
|
|
|
SetLastError( WSAEFAULT );
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
case AF_IPX:
|
|
|
|
if (len < sizeof(struct sockaddr_ipx))
|
2021-07-22 03:34:51 +02:00
|
|
|
{
|
|
|
|
SetLastError( WSAEFAULT );
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
case AF_IRDA:
|
2021-07-22 03:34:51 +02:00
|
|
|
if (len < sizeof(SOCKADDR_IRDA))
|
|
|
|
{
|
|
|
|
SetLastError( WSAEFAULT );
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
FIXME( "unknown protocol %u\n", addr->sa_family );
|
|
|
|
SetLastError( WSAEAFNOSUPPORT );
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
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-08-19 06:25:48 +02:00
|
|
|
params = malloc( sizeof(int) + len );
|
|
|
|
ret_addr = malloc( len );
|
2021-06-16 06:13:32 +02:00
|
|
|
if (!params || !ret_addr)
|
|
|
|
{
|
2021-08-19 06:25:48 +02:00
|
|
|
free( params );
|
|
|
|
free( ret_addr );
|
2021-06-16 06:13:32 +02:00
|
|
|
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
|
|
|
|
2022-02-09 18:34:45 +01:00
|
|
|
if (status) TRACE( "failed, status %#lx.\n", status );
|
|
|
|
else TRACE( "successfully bound to address %s\n", debugstr_sockaddr( ret_addr ));
|
2022-01-06 02:03:23 +01:00
|
|
|
|
2021-08-19 06:25:48 +02:00
|
|
|
free( params );
|
|
|
|
free( ret_addr );
|
2021-06-16 06:13:32 +02:00
|
|
|
|
2021-07-22 03:34:52 +02:00
|
|
|
SetLastError( NtStatusToWSAError( status ) );
|
2021-06-16 06:13:32 +02:00
|
|
|
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
|
|
|
/***********************************************************************
|
2021-08-03 02:37:37 +02:00
|
|
|
* closesocket (ws2_32.3)
|
1997-08-24 18:00:30 +02:00
|
|
|
*/
|
2021-08-05 04:20:48 +02:00
|
|
|
int WINAPI closesocket( SOCKET s )
|
1997-08-24 18:00:30 +02:00
|
|
|
{
|
2022-02-05 02:35:37 +01:00
|
|
|
TRACE( "%#Ix\n", s );
|
2021-08-03 02:37:37 +02:00
|
|
|
|
|
|
|
if (!num_startup)
|
2015-03-05 07:35:06 +01:00
|
|
|
{
|
2021-08-03 02:37:37 +02:00
|
|
|
SetLastError( WSANOTINITIALISED );
|
|
|
|
return -1;
|
2015-03-05 07:35:06 +01:00
|
|
|
}
|
2021-08-03 02:37:37 +02:00
|
|
|
|
|
|
|
if (!socket_list_remove( s ))
|
|
|
|
{
|
|
|
|
SetLastError( WSAENOTSOCK );
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
CloseHandle( (HANDLE)s );
|
|
|
|
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
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* connect (ws2_32.4)
|
|
|
|
*/
|
2021-08-05 04:20:48 +02:00
|
|
|
int WINAPI connect( SOCKET s, const struct 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;
|
|
|
|
|
2022-02-05 02:35:37 +01:00
|
|
|
TRACE( "socket %#Ix, 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-08-19 06:25:48 +02:00
|
|
|
if (!(params = malloc( 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-08-19 06:25:48 +02:00
|
|
|
free( params );
|
2021-05-18 04:30:01 +02:00
|
|
|
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 ) );
|
2022-02-09 18:34:45 +01:00
|
|
|
TRACE( "failed, status %#lx.\n", 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)
|
|
|
|
*/
|
2021-08-05 04:20:48 +02:00
|
|
|
int WINAPI WSAConnect( SOCKET s, const struct sockaddr *name, int namelen,
|
2005-01-14 20:54:38 +01:00
|
|
|
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");
|
2021-08-05 04:20:48 +02:00
|
|
|
return connect( s, name, namelen );
|
2002-04-24 00:03:42 +02:00
|
|
|
}
|
|
|
|
|
2010-08-04 05:14:52 +02:00
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
static BOOL WINAPI WS2_ConnectEx( SOCKET s, const struct sockaddr *name, int namelen,
|
2021-05-18 04:30:00 +02:00
|
|
|
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
|
|
|
|
2022-02-05 02:35:37 +01:00
|
|
|
TRACE( "socket %#Ix, ptr %p %s, length %d, send_buffer %p, send_len %lu, overlapped %p\n",
|
2021-05-18 04:30:00 +02:00
|
|
|
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-08-19 06:25:48 +02:00
|
|
|
if (!(params = malloc( 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-08-19 06:25:48 +02:00
|
|
|
free( params );
|
2021-05-18 04:30:00 +02:00
|
|
|
if (ret_len) *ret_len = overlapped->InternalHigh;
|
|
|
|
SetLastError( NtStatusToWSAError( status ) );
|
2022-02-09 18:34:45 +01:00
|
|
|
TRACE( "status %#lx.\n", status );
|
2021-05-18 04:30:00 +02:00
|
|
|
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;
|
|
|
|
|
2022-02-05 02:35:37 +01:00
|
|
|
TRACE( "socket %#Ix, overlapped %p, flags %#lx, reserved %#lx\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 ) );
|
2022-02-09 18:34:45 +01:00
|
|
|
TRACE( "status %#lx.\n", status );
|
2021-05-19 05:35:50 +02:00
|
|
|
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-08-05 04:20:48 +02:00
|
|
|
int WINAPI getpeername( SOCKET s, struct 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
|
|
|
|
2022-02-05 02:35:37 +01:00
|
|
|
TRACE( "socket %#Ix, 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 ) );
|
2022-02-09 18:34:45 +01:00
|
|
|
TRACE( "status %#lx.\n", status );
|
2021-06-17 06:33:12 +02:00
|
|
|
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-08-05 04:20:48 +02:00
|
|
|
int WINAPI getsockname( SOCKET s, struct 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
|
|
|
|
2022-02-05 02:35:37 +01:00
|
|
|
TRACE( "socket %#Ix, 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 ) );
|
2022-02-09 18:34:45 +01:00
|
|
|
TRACE( "status %#lx.\n", status );
|
2021-06-16 06:13:32 +02:00
|
|
|
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 ) );
|
2022-02-09 18:34:45 +01:00
|
|
|
TRACE( "status %#lx.\n", status );
|
2021-06-23 18:23:43 +02:00
|
|
|
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
|
|
|
*/
|
2021-08-05 04:20:48 +02:00
|
|
|
int WINAPI getsockopt( SOCKET s, int level, int optname, char *optval, int *optlen )
|
1997-08-24 18:00:30 +02:00
|
|
|
{
|
2004-10-06 20:52:51 +02:00
|
|
|
INT ret = 0;
|
2001-12-14 23:48:38 +01:00
|
|
|
|
2022-02-05 02:35:37 +01:00
|
|
|
TRACE( "socket %#Ix, %s, optval %p, optlen %p (%d)\n",
|
|
|
|
s, debugstr_sockopt(level, optname), optval, optlen, optlen ? *optlen : 0 );
|
2006-12-04 09:46:10 +01:00
|
|
|
|
2021-08-24 14:50:37 +02:00
|
|
|
if ((level != SOL_SOCKET || optname != SO_OPENTYPE) &&
|
|
|
|
!socket_list_find( s ))
|
|
|
|
{
|
|
|
|
SetLastError( WSAENOTSOCK );
|
|
|
|
return SOCKET_ERROR;
|
|
|
|
}
|
|
|
|
|
2006-12-04 09:46:10 +01:00
|
|
|
switch(level)
|
|
|
|
{
|
2021-08-05 04:20:48 +02:00
|
|
|
case 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-08-05 04:20:48 +02:00
|
|
|
case SO_ACCEPTCONN:
|
2021-06-23 18:23:43 +02:00
|
|
|
return server_getsockopt( s, IOCTL_AFD_WINE_GET_SO_ACCEPTCONN, optval, optlen );
|
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
case SO_BROADCAST:
|
2021-06-23 18:23:44 +02:00
|
|
|
return server_getsockopt( s, IOCTL_AFD_WINE_GET_SO_BROADCAST, optval, optlen );
|
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
case SO_BSP_STATE:
|
2014-12-08 23:55:45 +01:00
|
|
|
{
|
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;
|
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
if (infow.iAddressFamily == AF_INET)
|
|
|
|
addr_size = sizeof(struct sockaddr_in);
|
|
|
|
else if (infow.iAddressFamily == AF_INET6)
|
|
|
|
addr_size = sizeof(struct sockaddr_in6);
|
2021-06-22 17:24:11 +02:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
csinfo->LocalAddr.lpSockaddr = (struct sockaddr *)(csinfo + 1);
|
|
|
|
csinfo->RemoteAddr.lpSockaddr = (struct sockaddr *)((char *)(csinfo + 1) + addr_size);
|
2021-06-22 17:24:11 +02:00
|
|
|
|
|
|
|
csinfo->LocalAddr.iSockaddrLength = addr_size;
|
2021-08-05 04:20:48 +02:00
|
|
|
if (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;
|
2021-08-05 04:20:48 +02:00
|
|
|
if (getpeername( s, csinfo->RemoteAddr.lpSockaddr, &csinfo->RemoteAddr.iSockaddrLength ) < 0)
|
2021-06-22 17:24:11 +02:00
|
|
|
{
|
|
|
|
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
|
|
|
|
2021-08-19 06:25:50 +02:00
|
|
|
case SO_CONNECT_TIME:
|
|
|
|
if (!optlen || !optval)
|
|
|
|
{
|
|
|
|
SetLastError( WSAEFAULT );
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
return server_getsockopt( s, IOCTL_AFD_WINE_GET_SO_CONNECT_TIME, optval, optlen );
|
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
case SO_DEBUG:
|
2021-06-23 18:23:47 +02:00
|
|
|
WARN( "returning 0 for SO_DEBUG\n" );
|
|
|
|
*(DWORD *)optval = 0;
|
|
|
|
SetLastError( 0 );
|
|
|
|
return 0;
|
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
case SO_DONTLINGER:
|
2006-12-04 09:46:10 +01:00
|
|
|
{
|
2021-08-05 04:20:48 +02:00
|
|
|
struct linger linger;
|
2021-06-25 05:32:47 +02:00
|
|
|
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-08-05 04:20:48 +02:00
|
|
|
if (!(ret = getsockopt( s, SOL_SOCKET, 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
|
|
|
|
2006-12-04 09:46:10 +01:00
|
|
|
/* As mentioned in setsockopt, Windows ignores this, so we
|
|
|
|
* always return true here */
|
2021-08-05 04:20:48 +02:00
|
|
|
case SO_DONTROUTE:
|
2006-12-04 09:46:10 +01:00
|
|
|
if (!optlen || *optlen < sizeof(BOOL) || !optval)
|
|
|
|
{
|
|
|
|
SetLastError(WSAEFAULT);
|
|
|
|
return SOCKET_ERROR;
|
|
|
|
}
|
|
|
|
*(BOOL *)optval = TRUE;
|
|
|
|
*optlen = sizeof(BOOL);
|
|
|
|
return 0;
|
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
case 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-08-05 04:20:48 +02:00
|
|
|
case SO_KEEPALIVE:
|
2021-06-24 07:00:14 +02:00
|
|
|
return server_getsockopt( s, IOCTL_AFD_WINE_GET_SO_KEEPALIVE, optval, optlen );
|
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
case 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;
|
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
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
|
|
|
}
|
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
case SO_MAX_MSG_SIZE:
|
2006-12-04 09:46:10 +01:00
|
|
|
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-08-05 04:20:48 +02:00
|
|
|
case SO_OOBINLINE:
|
2021-06-25 05:32:49 +02:00
|
|
|
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. */
|
2021-08-05 04:20:48 +02:00
|
|
|
case SO_OPENTYPE:
|
2006-12-04 09:46:10 +01:00
|
|
|
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;
|
2021-08-05 04:20:48 +02:00
|
|
|
|
|
|
|
case SO_PROTOCOL_INFOA:
|
|
|
|
case SO_PROTOCOL_INFOW:
|
2013-09-10 05:56:47 +02:00
|
|
|
{
|
|
|
|
int size;
|
|
|
|
WSAPROTOCOL_INFOW infow;
|
2004-09-14 02:48:15 +02:00
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
ret = ws_protocol_info(s, optname == SO_PROTOCOL_INFOW, &infow, &size);
|
2013-09-10 05:56:47 +02:00
|
|
|
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
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
case SO_RCVBUF:
|
2021-06-26 03:21:08 +02:00
|
|
|
return server_getsockopt( s, IOCTL_AFD_WINE_GET_SO_RCVBUF, optval, optlen );
|
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
case SO_RCVTIMEO:
|
2021-06-29 18:43:20 +02:00
|
|
|
return server_getsockopt( s, IOCTL_AFD_WINE_GET_SO_RCVTIMEO, optval, optlen );
|
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
case SO_REUSEADDR:
|
2021-06-29 18:43:21 +02:00
|
|
|
return server_getsockopt( s, IOCTL_AFD_WINE_GET_SO_REUSEADDR, optval, optlen );
|
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
case SO_SNDBUF:
|
2021-06-30 06:25:42 +02:00
|
|
|
return server_getsockopt( s, IOCTL_AFD_WINE_GET_SO_SNDBUF, optval, optlen );
|
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
case 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
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
case SO_TYPE:
|
2013-09-18 22:36:25 +02:00
|
|
|
{
|
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) */
|
2021-08-05 04:20:48 +02:00
|
|
|
}/* end case SOL_SOCKET */
|
2021-07-31 01:55:36 +02:00
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
case NSPROTO_IPX:
|
2006-12-04 09:46:10 +01:00
|
|
|
{
|
2021-08-05 04:20:48 +02:00
|
|
|
struct sockaddr_ipx addr;
|
2006-12-04 09:46:10 +01:00
|
|
|
IPX_ADDRESS_DATA *data;
|
|
|
|
int namelen;
|
|
|
|
switch(optname)
|
|
|
|
{
|
2021-08-05 04:20:48 +02:00
|
|
|
case 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");
|
2021-08-05 04:20:48 +02:00
|
|
|
namelen = sizeof(struct sockaddr_ipx);
|
|
|
|
memset( &addr, 0, sizeof(struct sockaddr_ipx) );
|
|
|
|
getsockname( s, (struct sockaddr *)&addr, &namelen );
|
2006-12-04 09:46:10 +01:00
|
|
|
|
|
|
|
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;
|
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
case 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;
|
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
case IPX_PTYPE:
|
2021-07-31 01:55:36 +02:00
|
|
|
return server_getsockopt( s, IOCTL_AFD_WINE_GET_IPX_PTYPE, optval, optlen );
|
|
|
|
|
2006-12-04 09:46:10 +01:00
|
|
|
default:
|
|
|
|
FIXME("IPX optname:%x\n", optname);
|
|
|
|
return SOCKET_ERROR;
|
|
|
|
}/* end switch(optname) */
|
2021-08-05 04:20:48 +02:00
|
|
|
} /* end case NSPROTO_IPX */
|
2009-08-12 18:15:33 +02:00
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
case SOL_IRLMP:
|
2009-08-12 18:15:33 +02:00
|
|
|
switch(optname)
|
|
|
|
{
|
2021-08-05 04:20:48 +02:00
|
|
|
case IRLMP_ENUMDEVICES:
|
2021-07-31 01:55:38 +02:00
|
|
|
return server_getsockopt( s, IOCTL_AFD_WINE_GET_IRLMP_ENUMDEVICES, optval, optlen );
|
2009-08-12 18:15:33 +02:00
|
|
|
|
|
|
|
default:
|
|
|
|
FIXME("IrDA optname:0x%x\n", optname);
|
|
|
|
return SOCKET_ERROR;
|
|
|
|
}
|
2021-08-05 04:20:48 +02:00
|
|
|
break; /* case SOL_IRLMP */
|
2009-08-12 18:15:33 +02:00
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
/* Levels IPPROTO_TCP and IPPROTO_IP convert directly */
|
|
|
|
case IPPROTO_TCP:
|
2006-12-04 09:46:10 +01:00
|
|
|
switch(optname)
|
|
|
|
{
|
2021-08-05 04:20:48 +02:00
|
|
|
case TCP_NODELAY:
|
2021-07-31 01:55:39 +02:00
|
|
|
return server_getsockopt( s, IOCTL_AFD_WINE_GET_TCP_NODELAY, optval, optlen );
|
|
|
|
|
|
|
|
default:
|
|
|
|
FIXME( "unrecognized TCP option %#x\n", optname );
|
|
|
|
SetLastError( WSAENOPROTOOPT );
|
|
|
|
return -1;
|
2004-10-06 20:52:51 +02:00
|
|
|
}
|
2006-12-04 09:46:10 +01:00
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
case IPPROTO_IP:
|
2006-12-04 09:46:10 +01:00
|
|
|
switch(optname)
|
|
|
|
{
|
2021-08-05 04:20:48 +02:00
|
|
|
case IP_DONTFRAGMENT:
|
2021-07-02 00:10:27 +02:00
|
|
|
return server_getsockopt( s, IOCTL_AFD_WINE_GET_IP_DONTFRAGMENT, optval, optlen );
|
|
|
|
|
2021-08-18 07:50:48 +02:00
|
|
|
case IP_HDRINCL:
|
|
|
|
return server_getsockopt( s, IOCTL_AFD_WINE_GET_IP_HDRINCL, optval, optlen );
|
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
case IP_MULTICAST_IF:
|
2021-07-08 03:16:40 +02:00
|
|
|
return server_getsockopt( s, IOCTL_AFD_WINE_GET_IP_MULTICAST_IF, optval, optlen );
|
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
case IP_MULTICAST_LOOP:
|
2021-07-08 03:16:42 +02:00
|
|
|
return server_getsockopt( s, IOCTL_AFD_WINE_GET_IP_MULTICAST_LOOP, optval, optlen );
|
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
case IP_MULTICAST_TTL:
|
2021-07-09 04:24:46 +02:00
|
|
|
return server_getsockopt( s, IOCTL_AFD_WINE_GET_IP_MULTICAST_TTL, optval, optlen );
|
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
case IP_OPTIONS:
|
2021-07-09 04:24:48 +02:00
|
|
|
return server_getsockopt( s, IOCTL_AFD_WINE_GET_IP_OPTIONS, optval, optlen );
|
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
case IP_PKTINFO:
|
2021-07-10 02:40:39 +02:00
|
|
|
return server_getsockopt( s, IOCTL_AFD_WINE_GET_IP_PKTINFO, optval, optlen );
|
|
|
|
|
2021-09-29 08:40:55 +02:00
|
|
|
case IP_RECVTOS:
|
|
|
|
return server_getsockopt( s, IOCTL_AFD_WINE_GET_IP_RECVTOS, optval, optlen );
|
|
|
|
|
2021-09-29 08:40:54 +02:00
|
|
|
case IP_RECVTTL:
|
|
|
|
return server_getsockopt( s, IOCTL_AFD_WINE_GET_IP_RECVTTL, optval, optlen );
|
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
case IP_TOS:
|
2021-07-10 02:40:41 +02:00
|
|
|
return server_getsockopt( s, IOCTL_AFD_WINE_GET_IP_TOS, optval, optlen );
|
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
case IP_TTL:
|
2021-07-10 02:40:43 +02:00
|
|
|
return server_getsockopt( s, IOCTL_AFD_WINE_GET_IP_TTL, optval, optlen );
|
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
case IP_UNICAST_IF:
|
2021-07-27 07:13:34 +02:00
|
|
|
return server_getsockopt( s, IOCTL_AFD_WINE_GET_IP_UNICAST_IF, optval, optlen );
|
2021-07-01 03:24:38 +02:00
|
|
|
|
|
|
|
default:
|
|
|
|
FIXME( "unrecognized IP option %u\n", optname );
|
|
|
|
/* fall through */
|
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
case IP_ADD_MEMBERSHIP:
|
|
|
|
case IP_DROP_MEMBERSHIP:
|
2021-07-01 03:24:38 +02:00
|
|
|
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
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
case IPPROTO_IPV6:
|
2010-04-01 23:50:54 +02:00
|
|
|
switch(optname)
|
|
|
|
{
|
2021-08-05 04:20:48 +02:00
|
|
|
case IPV6_DONTFRAG:
|
2021-07-28 17:17:06 +02:00
|
|
|
return server_getsockopt( s, IOCTL_AFD_WINE_GET_IPV6_DONTFRAG, optval, optlen );
|
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
case IPV6_HOPLIMIT:
|
2021-08-03 07:08:38 +02:00
|
|
|
return server_getsockopt( s, IOCTL_AFD_WINE_GET_IPV6_RECVHOPLIMIT, optval, optlen );
|
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
case IPV6_MULTICAST_HOPS:
|
2021-07-28 17:17:09 +02:00
|
|
|
return server_getsockopt( s, IOCTL_AFD_WINE_GET_IPV6_MULTICAST_HOPS, optval, optlen );
|
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
case IPV6_MULTICAST_IF:
|
2021-07-28 23:18:10 +02:00
|
|
|
return server_getsockopt( s, IOCTL_AFD_WINE_GET_IPV6_MULTICAST_IF, optval, optlen );
|
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
case IPV6_MULTICAST_LOOP:
|
2021-07-28 23:18:12 +02:00
|
|
|
return server_getsockopt( s, IOCTL_AFD_WINE_GET_IPV6_MULTICAST_LOOP, optval, optlen );
|
|
|
|
|
2021-08-18 07:50:50 +02:00
|
|
|
case IPV6_PROTECTION_LEVEL:
|
|
|
|
if (!optlen || *optlen < sizeof(UINT) || !optval)
|
|
|
|
{
|
|
|
|
SetLastError( WSAEFAULT );
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
*optlen = sizeof(UINT);
|
|
|
|
*optval = PROTECTION_LEVEL_UNRESTRICTED;
|
|
|
|
FIXME("IPV6_PROTECTION_LEVEL is ignored!\n");
|
|
|
|
return 0;
|
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
case IPV6_PKTINFO:
|
2021-08-03 07:08:39 +02:00
|
|
|
return server_getsockopt( s, IOCTL_AFD_WINE_GET_IPV6_RECVPKTINFO, optval, optlen );
|
|
|
|
|
2021-08-13 07:56:13 +02:00
|
|
|
case IPV6_RECVTCLASS:
|
|
|
|
return server_getsockopt( s, IOCTL_AFD_WINE_GET_IPV6_RECVTCLASS, optval, optlen );
|
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
case IPV6_UNICAST_HOPS:
|
2021-07-30 07:00:42 +02:00
|
|
|
return server_getsockopt( s, IOCTL_AFD_WINE_GET_IPV6_UNICAST_HOPS, optval, optlen );
|
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
case IPV6_UNICAST_IF:
|
2021-07-30 07:00:44 +02:00
|
|
|
return server_getsockopt( s, IOCTL_AFD_WINE_GET_IPV6_UNICAST_IF, optval, optlen );
|
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
case IPV6_V6ONLY:
|
2021-07-30 07:00:46 +02:00
|
|
|
return server_getsockopt( s, IOCTL_AFD_WINE_GET_IPV6_V6ONLY, optval, optlen );
|
2021-07-01 03:24:38 +02:00
|
|
|
|
|
|
|
default:
|
|
|
|
FIXME( "unrecognized IPv6 option %u\n", optname );
|
|
|
|
/* fall through */
|
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
case IPV6_ADD_MEMBERSHIP:
|
|
|
|
case IPV6_DROP_MEMBERSHIP:
|
2021-07-01 03:24:38 +02:00
|
|
|
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
|
|
|
{
|
2021-08-05 04:20:48 +02:00
|
|
|
const char *buf_type, *family;
|
2011-01-08 16:47:59 +01:00
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
#define IOCTL_NAME(x) case x: return #x
|
2016-09-06 20:30:35 +02:00
|
|
|
switch (code)
|
|
|
|
{
|
2021-08-05 04:20:48 +02:00
|
|
|
IOCTL_NAME(FIONBIO);
|
|
|
|
IOCTL_NAME(FIONREAD);
|
|
|
|
IOCTL_NAME(SIOCATMARK);
|
|
|
|
/* IOCTL_NAME(SIO_ACQUIRE_PORT_RESERVATION); */
|
|
|
|
IOCTL_NAME(SIO_ADDRESS_LIST_CHANGE);
|
|
|
|
IOCTL_NAME(SIO_ADDRESS_LIST_QUERY);
|
|
|
|
IOCTL_NAME(SIO_ASSOCIATE_HANDLE);
|
|
|
|
/* IOCTL_NAME(SIO_ASSOCIATE_PORT_RESERVATION);
|
|
|
|
IOCTL_NAME(SIO_BASE_HANDLE);
|
|
|
|
IOCTL_NAME(SIO_BSP_HANDLE);
|
|
|
|
IOCTL_NAME(SIO_BSP_HANDLE_SELECT);
|
|
|
|
IOCTL_NAME(SIO_BSP_HANDLE_POLL);
|
|
|
|
IOCTL_NAME(SIO_CHK_QOS); */
|
|
|
|
IOCTL_NAME(SIO_ENABLE_CIRCULAR_QUEUEING);
|
|
|
|
IOCTL_NAME(SIO_FIND_ROUTE);
|
|
|
|
IOCTL_NAME(SIO_FLUSH);
|
|
|
|
IOCTL_NAME(SIO_GET_BROADCAST_ADDRESS);
|
|
|
|
IOCTL_NAME(SIO_GET_EXTENSION_FUNCTION_POINTER);
|
|
|
|
IOCTL_NAME(SIO_GET_GROUP_QOS);
|
|
|
|
IOCTL_NAME(SIO_GET_INTERFACE_LIST);
|
|
|
|
/* IOCTL_NAME(SIO_GET_INTERFACE_LIST_EX); */
|
|
|
|
IOCTL_NAME(SIO_GET_QOS);
|
|
|
|
IOCTL_NAME(SIO_IDEAL_SEND_BACKLOG_CHANGE);
|
|
|
|
IOCTL_NAME(SIO_IDEAL_SEND_BACKLOG_QUERY);
|
|
|
|
IOCTL_NAME(SIO_KEEPALIVE_VALS);
|
|
|
|
IOCTL_NAME(SIO_MULTIPOINT_LOOPBACK);
|
|
|
|
IOCTL_NAME(SIO_MULTICAST_SCOPE);
|
|
|
|
/* IOCTL_NAME(SIO_QUERY_RSS_SCALABILITY_INFO);
|
|
|
|
IOCTL_NAME(SIO_QUERY_WFP_ALE_ENDPOINT_HANDLE); */
|
|
|
|
IOCTL_NAME(SIO_RCVALL);
|
|
|
|
IOCTL_NAME(SIO_RCVALL_IGMPMCAST);
|
|
|
|
IOCTL_NAME(SIO_RCVALL_MCAST);
|
|
|
|
/* IOCTL_NAME(SIO_RELEASE_PORT_RESERVATION); */
|
|
|
|
IOCTL_NAME(SIO_ROUTING_INTERFACE_CHANGE);
|
|
|
|
IOCTL_NAME(SIO_ROUTING_INTERFACE_QUERY);
|
|
|
|
IOCTL_NAME(SIO_SET_COMPATIBILITY_MODE);
|
|
|
|
IOCTL_NAME(SIO_SET_GROUP_QOS);
|
|
|
|
IOCTL_NAME(SIO_SET_QOS);
|
|
|
|
IOCTL_NAME(SIO_TRANSLATE_HANDLE);
|
|
|
|
IOCTL_NAME(SIO_UDP_CONNRESET);
|
2016-09-06 20:30:35 +02:00
|
|
|
}
|
|
|
|
#undef IOCTL_NAME
|
|
|
|
|
|
|
|
/* If this is not a known code split its bits */
|
|
|
|
switch(code & 0x18000000)
|
2010-09-24 23:20:14 +02:00
|
|
|
{
|
2021-08-05 04:20:48 +02:00
|
|
|
case IOC_WS2:
|
2011-01-08 16:47:59 +01:00
|
|
|
family = "IOC_WS2";
|
|
|
|
break;
|
2021-08-05 04:20:48 +02:00
|
|
|
case IOC_PROTOCOL:
|
2011-01-08 16:47:59 +01:00
|
|
|
family = "IOC_PROTOCOL";
|
|
|
|
break;
|
2021-08-05 04:20:48 +02:00
|
|
|
case IOC_VENDOR:
|
2011-01-08 16:47:59 +01:00
|
|
|
family = "IOC_VENDOR";
|
|
|
|
break;
|
2021-08-05 04:20:48 +02:00
|
|
|
default: /* IOC_UNIX */
|
2010-09-24 23:20:14 +02:00
|
|
|
{
|
2021-08-05 04:20:48 +02:00
|
|
|
BYTE size = (code >> 16) & IOCPARM_MASK;
|
2016-09-06 20:30:35 +02:00
|
|
|
char x = (code & 0xff00) >> 8;
|
|
|
|
BYTE y = code & 0xff;
|
2010-09-24 23:20:14 +02:00
|
|
|
char args[14];
|
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
switch (code & (IOC_VOID | IOC_INOUT))
|
2010-09-24 23:20:14 +02:00
|
|
|
{
|
2021-08-05 04:20:48 +02:00
|
|
|
case IOC_VOID:
|
2010-09-24 23:20:14 +02:00
|
|
|
buf_type = "_IO";
|
|
|
|
sprintf(args, "%d, %d", x, y);
|
|
|
|
break;
|
2021-08-05 04:20:48 +02:00
|
|
|
case IOC_IN:
|
2010-09-24 23:20:14 +02:00
|
|
|
buf_type = "_IOW";
|
|
|
|
sprintf(args, "'%c', %d, %d", x, y, size);
|
|
|
|
break;
|
2021-08-05 04:20:48 +02:00
|
|
|
case IOC_OUT:
|
2010-09-24 23:20:14 +02:00
|
|
|
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
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
/* We are different from IOC_UNIX. */
|
|
|
|
switch (code & (IOC_VOID | IOC_INOUT))
|
2011-01-08 16:47:59 +01:00
|
|
|
{
|
2021-08-05 04:20:48 +02:00
|
|
|
case IOC_VOID:
|
2011-01-08 16:47:59 +01:00
|
|
|
buf_type = "_WSAIO";
|
2010-09-24 23:20:14 +02:00
|
|
|
break;
|
2021-08-05 04:20:48 +02:00
|
|
|
case IOC_INOUT:
|
2011-01-08 16:47:59 +01:00
|
|
|
buf_type = "_WSAIORW";
|
2010-09-24 23:20:14 +02:00
|
|
|
break;
|
2021-08-05 04:20:48 +02:00
|
|
|
case IOC_IN:
|
2011-01-08 16:47:59 +01:00
|
|
|
buf_type = "_WSAIOW";
|
|
|
|
break;
|
2021-08-05 04:20:48 +02:00
|
|
|
case IOC_OUT:
|
2011-01-08 16:47:59 +01:00
|
|
|
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)
|
|
|
|
{
|
2022-02-05 02:35:37 +01:00
|
|
|
FIXME("Unsupported ioctl %#lx (device=%#lx access=%#lx func=%#lx method=%#lx)\n",
|
2014-03-18 19:45:17 +01:00
|
|
|
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
|
|
|
|
2022-02-09 18:34:45 +01:00
|
|
|
TRACE( "status %#lx.\n", status );
|
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 )
|
|
|
|
{
|
2022-02-05 02:35:37 +01:00
|
|
|
TRACE( "socket %#Ix, %s, in_buff %p, in_size %#lx, out_buff %p,"
|
|
|
|
" out_size %#lx, ret_size %p, overlapped %p, completion %p\n",
|
|
|
|
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)
|
|
|
|
{
|
2021-08-05 04:20:48 +02:00
|
|
|
case 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
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
case 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 );
|
2021-08-05 04:20:48 +02:00
|
|
|
if (!ret) *ret_size = sizeof(u_long);
|
2021-06-03 00:04:00 +02:00
|
|
|
return ret ? -1 : 0;
|
2011-09-13 14:07:00 +02:00
|
|
|
}
|
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
case SIOCATMARK:
|
2011-04-19 11:57:37 +02:00
|
|
|
{
|
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 );
|
2021-08-05 04:20:48 +02:00
|
|
|
if (!ret) *ret_size = sizeof(u_long);
|
2021-06-03 00:04:02 +02:00
|
|
|
return ret ? -1 : 0;
|
2011-04-19 11:57:37 +02:00
|
|
|
}
|
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
case SIO_GET_INTERFACE_LIST:
|
2021-06-08 02:53:10 +02:00
|
|
|
{
|
|
|
|
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-08-05 04:20:48 +02:00
|
|
|
case SIO_ADDRESS_LIST_QUERY:
|
2021-06-04 23:24:17 +02:00
|
|
|
{
|
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)
|
|
|
|
{
|
2021-08-19 06:25:48 +02:00
|
|
|
IP_ADAPTER_INFO *p, *table = malloc( 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))
|
|
|
|
{
|
2021-08-19 06:25:48 +02:00
|
|
|
free( 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;
|
2021-08-19 06:25:48 +02:00
|
|
|
free( 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
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
sockaddr[i].sin_family = AF_INET;
|
2014-10-07 08:41:12 +02:00
|
|
|
sockaddr[i].sin_port = 0;
|
2021-08-05 04:20:48 +02:00
|
|
|
sockaddr[i].sin_addr.s_addr = inet_addr( p->IpAddressList.IpAddress.String );
|
2014-10-07 08:41:12 +02:00
|
|
|
i++;
|
2006-12-18 19:37:52 +01:00
|
|
|
}
|
2006-11-27 20:09:46 +01:00
|
|
|
|
2021-08-19 06:25:48 +02:00
|
|
|
free( 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
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
case SIO_GET_EXTENSION_FUNCTION_POINTER:
|
2017-03-02 06:38:15 +01:00
|
|
|
{
|
|
|
|
#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
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
case SIO_KEEPALIVE_VALS:
|
2017-03-02 06:38:15 +01:00
|
|
|
{
|
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-08-05 04:20:48 +02:00
|
|
|
case SIO_ROUTING_INTERFACE_QUERY:
|
2021-06-09 07:04:45 +02:00
|
|
|
{
|
2021-08-05 04:20:48 +02:00
|
|
|
struct sockaddr *daddr = (struct sockaddr *)in_buff;
|
|
|
|
struct sockaddr_in *daddr_in = (struct sockaddr_in *)daddr;
|
|
|
|
struct sockaddr_in *saddr_in = out_buff;
|
2021-06-09 07:04:45 +02:00
|
|
|
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
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
if (!in_buff || in_size < sizeof(struct sockaddr) ||
|
|
|
|
!out_buff || out_size < sizeof(struct sockaddr_in))
|
2021-06-09 07:04:45 +02:00
|
|
|
{
|
|
|
|
SetLastError( WSAEFAULT );
|
|
|
|
return -1;
|
|
|
|
}
|
2021-08-05 04:20:48 +02:00
|
|
|
if (daddr->sa_family != AF_INET)
|
2021-06-09 07:04:45 +02:00
|
|
|
{
|
|
|
|
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
|
|
|
}
|
2021-08-19 06:25:48 +02:00
|
|
|
ipAddrTable = malloc( size );
|
2021-06-09 07:04:45 +02:00
|
|
|
if (GetIpAddrTable( ipAddrTable, &size, FALSE ))
|
|
|
|
{
|
2021-08-19 06:25:48 +02:00
|
|
|
free( 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)
|
|
|
|
{
|
2022-02-05 02:35:37 +01:00
|
|
|
ERR( "no matching IP address for interface %lu\n", row.dwForwardIfIndex );
|
2021-08-19 06:25:48 +02:00
|
|
|
free( ipAddrTable );
|
2021-06-09 07:04:46 +02:00
|
|
|
SetLastError( WSAEFAULT );
|
|
|
|
return -1;
|
2021-06-09 07:04:45 +02:00
|
|
|
}
|
2021-08-05 04:20:48 +02:00
|
|
|
saddr_in->sin_family = AF_INET;
|
2021-06-09 07:04:45 +02:00
|
|
|
saddr_in->sin_addr.S_un.S_addr = ipAddrTable->table[found_index].dwAddr;
|
|
|
|
saddr_in->sin_port = 0;
|
2021-08-19 06:25:48 +02:00
|
|
|
free( 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 );
|
2021-08-05 04:20:48 +02:00
|
|
|
if (!ret) *ret_size = sizeof(struct sockaddr_in);
|
2021-06-09 07:04:46 +02:00
|
|
|
SetLastError( ret );
|
|
|
|
return ret ? -1 : 0;
|
2021-06-09 07:04:45 +02:00
|
|
|
}
|
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
case 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-08-05 04:20:48 +02:00
|
|
|
case SIO_UDP_CONNRESET:
|
2021-06-10 19:36:38 +02:00
|
|
|
{
|
|
|
|
NTSTATUS status = STATUS_SUCCESS;
|
|
|
|
DWORD ret;
|
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
FIXME( "SIO_UDP_CONNRESET stub\n" );
|
2021-06-10 19:36:38 +02:00
|
|
|
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-08-05 04:20:48 +02:00
|
|
|
case SIO_BASE_HANDLE:
|
2021-06-10 19:36:39 +02:00
|
|
|
{
|
|
|
|
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 */
|
2021-08-05 04:20:48 +02:00
|
|
|
case LOWORD(FIONBIO): /* Netscape tries to use this */
|
|
|
|
case SIO_SET_COMPATIBILITY_MODE:
|
2021-06-09 07:04:47 +02:00
|
|
|
{
|
|
|
|
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
|
|
|
*/
|
2021-08-05 04:20:48 +02:00
|
|
|
int WINAPI ioctlsocket( SOCKET s, LONG cmd, 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;
|
2021-08-05 04:20:48 +02:00
|
|
|
return WSAIoctl( s, cmd, argp, sizeof(u_long), argp, sizeof(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-08-05 04:20:48 +02:00
|
|
|
int WINAPI 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
|
|
|
|
2022-02-05 02:35:37 +01:00
|
|
|
TRACE( "socket %#Ix, 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 ) );
|
2022-02-09 18:34:45 +01:00
|
|
|
TRACE( "status %#lx.\n", status );
|
2021-05-14 05:54:40 +02:00
|
|
|
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
|
|
|
*/
|
2021-08-05 04:20:48 +02:00
|
|
|
int WINAPI 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
|
|
|
*/
|
2021-08-05 04:20:48 +02:00
|
|
|
int WINAPI recvfrom( SOCKET s, char *buf, int len, int flags, struct 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 */
|
2021-08-05 04:20:48 +02:00
|
|
|
static int add_fd_to_set( SOCKET fd, struct 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-12-29 22:46:00 +01:00
|
|
|
set->fd_array[set->fd_count++] = fd;
|
|
|
|
return 1;
|
2021-06-20 18:05:54 +02:00
|
|
|
}
|
2015-03-29 05:53:58 +02:00
|
|
|
|
|
|
|
|
2021-06-20 18:05:54 +02:00
|
|
|
/***********************************************************************
|
|
|
|
* select (ws2_32.18)
|
|
|
|
*/
|
2021-08-05 04:20:48 +02:00
|
|
|
int WINAPI select( int count, fd_set *read_ptr, fd_set *write_ptr,
|
|
|
|
fd_set *except_ptr, const struct timeval *timeout)
|
2021-06-20 18:05:54 +02:00
|
|
|
{
|
2021-12-29 22:46:00 +01:00
|
|
|
struct fd_set *read_input = NULL;
|
|
|
|
struct afd_poll_params *params;
|
|
|
|
unsigned int poll_count = 0;
|
2021-06-20 18:05:54 +02:00
|
|
|
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 );
|
|
|
|
|
|
|
|
if (!(sync_event = get_sync_event())) return -1;
|
|
|
|
|
2021-12-29 22:46:00 +01:00
|
|
|
if (read_ptr) poll_count += read_ptr->fd_count;
|
|
|
|
if (write_ptr) poll_count += write_ptr->fd_count;
|
|
|
|
if (except_ptr) poll_count += except_ptr->fd_count;
|
|
|
|
|
|
|
|
if (!poll_count)
|
|
|
|
{
|
|
|
|
SetLastError( WSAEINVAL );
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
params_size = offsetof( struct afd_poll_params, sockets[poll_count] );
|
|
|
|
if (!(params = calloc( params_size, 1 )))
|
|
|
|
{
|
|
|
|
SetLastError( WSAENOBUFS );
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2021-06-20 18:05:54 +02:00
|
|
|
if (timeout)
|
2022-01-14 02:16:14 +01:00
|
|
|
params->timeout = (LONGLONG)timeout->tv_sec * -10000000 + (LONGLONG)timeout->tv_usec * -10;
|
2021-06-20 18:05:54 +02:00
|
|
|
else
|
|
|
|
params->timeout = TIMEOUT_INFINITE;
|
2006-11-06 12:28:53 +01:00
|
|
|
|
2021-12-29 22:46:00 +01:00
|
|
|
if (read_ptr)
|
2006-11-06 12:28:53 +01:00
|
|
|
{
|
2021-12-29 22:46:00 +01:00
|
|
|
unsigned int read_size = offsetof( struct fd_set, fd_array[read_ptr->fd_count] );
|
|
|
|
|
|
|
|
if (!(read_input = malloc( read_size )))
|
|
|
|
{
|
|
|
|
free( params );
|
|
|
|
SetLastError( WSAENOBUFS );
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
memcpy( read_input, read_ptr, read_size );
|
|
|
|
|
|
|
|
for (i = 0; i < read_ptr->fd_count; ++i)
|
|
|
|
{
|
|
|
|
params->sockets[params->count].socket = read_ptr->fd_array[i];
|
|
|
|
params->sockets[params->count].flags = AFD_POLL_READ | AFD_POLL_ACCEPT | AFD_POLL_HUP;
|
|
|
|
++params->count;
|
|
|
|
poll_socket = read_ptr->fd_array[i];
|
|
|
|
}
|
2006-11-06 12:28:53 +01:00
|
|
|
}
|
2021-06-20 18:05:54 +02:00
|
|
|
|
2021-12-29 22:45:59 +01:00
|
|
|
if (write_ptr)
|
2006-11-06 12:28:53 +01:00
|
|
|
{
|
2021-12-29 22:45:59 +01:00
|
|
|
for (i = 0; i < write_ptr->fd_count; ++i)
|
|
|
|
{
|
|
|
|
params->sockets[params->count].socket = write_ptr->fd_array[i];
|
|
|
|
params->sockets[params->count].flags = AFD_POLL_WRITE;
|
|
|
|
++params->count;
|
|
|
|
poll_socket = write_ptr->fd_array[i];
|
|
|
|
}
|
2006-11-06 12:28:53 +01:00
|
|
|
}
|
2021-06-20 18:05:54 +02:00
|
|
|
|
2021-12-29 22:45:59 +01:00
|
|
|
if (except_ptr)
|
2006-11-06 12:28:53 +01:00
|
|
|
{
|
2021-12-29 22:45:59 +01:00
|
|
|
for (i = 0; i < except_ptr->fd_count; ++i)
|
|
|
|
{
|
|
|
|
params->sockets[params->count].socket = except_ptr->fd_array[i];
|
|
|
|
params->sockets[params->count].flags = AFD_POLL_OOB | AFD_POLL_CONNECT_ERR;
|
|
|
|
++params->count;
|
|
|
|
poll_socket = except_ptr->fd_array[i];
|
|
|
|
}
|
2006-11-06 12:28:53 +01:00
|
|
|
}
|
2015-05-22 04:55:03 +02:00
|
|
|
|
2021-12-29 22:46:00 +01:00
|
|
|
assert( params->count == poll_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)
|
2021-12-29 22:46:00 +01:00
|
|
|
{
|
|
|
|
free( read_input );
|
|
|
|
free( params );
|
2021-06-20 18:05:54 +02:00
|
|
|
return -1;
|
2021-12-29 22:46:00 +01:00
|
|
|
}
|
2021-06-20 18:05:54 +02:00
|
|
|
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 */
|
2021-12-29 22:46:00 +01:00
|
|
|
if (read_ptr) read_ptr->fd_count = 0;
|
|
|
|
if (write_ptr) write_ptr->fd_count = 0;
|
|
|
|
if (except_ptr) except_ptr->fd_count = 0;
|
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-12-29 22:46:00 +01:00
|
|
|
if (read_input)
|
2021-06-20 18:05:54 +02:00
|
|
|
{
|
2021-12-29 22:46:00 +01:00
|
|
|
for (j = 0; j < read_input->fd_count; ++j)
|
2021-06-20 18:05:54 +02:00
|
|
|
{
|
2021-12-29 22:46:00 +01:00
|
|
|
if (read_input->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;
|
|
|
|
}
|
2021-06-20 18:05:54 +02:00
|
|
|
}
|
|
|
|
}
|
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-12-29 22:45:59 +01:00
|
|
|
if (flags & AFD_POLL_WRITE)
|
|
|
|
ret_count += add_fd_to_set( s, write_ptr );
|
1997-08-24 18:00:30 +02:00
|
|
|
|
2021-12-29 22:45:59 +01:00
|
|
|
if (flags & (AFD_POLL_OOB | AFD_POLL_CONNECT_ERR))
|
|
|
|
ret_count += add_fd_to_set( s, except_ptr );
|
2021-06-20 18:05:54 +02:00
|
|
|
}
|
|
|
|
}
|
1997-09-28 19:43:24 +02:00
|
|
|
|
2021-12-29 22:46:00 +01:00
|
|
|
free( read_input );
|
|
|
|
free( params );
|
|
|
|
|
2021-06-20 18:05:54 +02:00
|
|
|
SetLastError( NtStatusToWSAError( status ) );
|
2022-02-09 18:34:45 +01:00
|
|
|
TRACE( "status %#lx.\n", status );
|
2021-06-20 18:05:54 +02:00
|
|
|
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] );
|
2021-08-19 06:25:48 +02:00
|
|
|
if (!(params = calloc( params_size, 1 )))
|
2015-12-22 14:15:41 +01:00
|
|
|
{
|
|
|
|
SetLastError(WSAENOBUFS);
|
|
|
|
return SOCKET_ERROR;
|
|
|
|
}
|
|
|
|
|
2022-01-14 02:16:15 +01:00
|
|
|
params->timeout = (timeout >= 0 ? (LONGLONG)timeout * -10000 : TIMEOUT_INFINITE);
|
2021-06-20 18:05:53 +02:00
|
|
|
|
|
|
|
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 ))
|
|
|
|
{
|
2021-08-05 04:20:48 +02:00
|
|
|
fds[i].revents = POLLNVAL;
|
2021-06-20 18:05:53 +02:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
poll_socket = fds[i].fd;
|
|
|
|
params->sockets[params->count].socket = fds[i].fd;
|
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
if (fds[i].events & POLLRDNORM)
|
2021-06-20 18:05:53 +02:00
|
|
|
flags |= AFD_POLL_ACCEPT | AFD_POLL_READ;
|
2021-08-05 04:20:48 +02:00
|
|
|
if (fds[i].events & POLLRDBAND)
|
2021-06-20 18:05:53 +02:00
|
|
|
flags |= AFD_POLL_OOB;
|
2021-08-05 04:20:48 +02:00
|
|
|
if (fds[i].events & POLLWRNORM)
|
2021-06-20 18:05:53 +02:00
|
|
|
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 );
|
2021-08-19 06:25:48 +02:00
|
|
|
free( params );
|
2021-06-20 18:05:53 +02:00
|
|
|
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-08-19 06:25:48 +02:00
|
|
|
free( params );
|
2021-06-20 18:05:53 +02:00
|
|
|
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))
|
2021-08-05 04:20:48 +02:00
|
|
|
revents |= POLLRDNORM;
|
2021-06-20 18:05:53 +02:00
|
|
|
if (params->sockets[j].flags & AFD_POLL_OOB)
|
2021-08-05 04:20:48 +02:00
|
|
|
revents |= POLLRDBAND;
|
2021-06-20 18:05:53 +02:00
|
|
|
if (params->sockets[j].flags & AFD_POLL_WRITE)
|
2021-08-05 04:20:48 +02:00
|
|
|
revents |= POLLWRNORM;
|
2021-06-20 18:05:53 +02:00
|
|
|
if (params->sockets[j].flags & AFD_POLL_HUP)
|
2021-08-05 04:20:48 +02:00
|
|
|
revents |= POLLHUP;
|
2021-06-20 18:05:53 +02:00
|
|
|
if (params->sockets[j].flags & (AFD_POLL_RESET | AFD_POLL_CONNECT_ERR))
|
2021-08-05 04:20:48 +02:00
|
|
|
revents |= POLLERR;
|
2021-06-20 18:05:53 +02:00
|
|
|
if (params->sockets[j].flags & AFD_POLL_CLOSE)
|
2021-08-05 04:20:48 +02:00
|
|
|
revents |= POLLNVAL;
|
2021-06-20 18:05:53 +02:00
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
fds[i].revents = revents & (fds[i].events | POLLHUP | POLLERR | POLLNVAL);
|
2021-06-20 18:05:53 +02:00
|
|
|
|
|
|
|
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-08-19 06:25:48 +02:00
|
|
|
free( params );
|
2021-06-20 18:05:53 +02:00
|
|
|
|
|
|
|
SetLastError( NtStatusToWSAError( status ) );
|
2022-02-09 18:34:45 +01:00
|
|
|
TRACE( "status %#lx.\n", status );
|
2021-06-20 18:05:53 +02:00
|
|
|
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
|
|
|
*/
|
2021-08-05 04:20:48 +02:00
|
|
|
int WINAPI 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 )
|
|
|
|
{
|
2021-08-05 04:20:48 +02:00
|
|
|
return 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,
|
2021-08-05 04:20:48 +02:00
|
|
|
const struct sockaddr *to, int tolen,
|
2010-07-18 02:53:06 +02:00
|
|
|
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
|
|
|
*/
|
2021-08-05 04:20:48 +02:00
|
|
|
int WINAPI sendto( SOCKET s, const char *buf, int len, int flags, const struct 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 ) );
|
2022-02-09 18:34:45 +01:00
|
|
|
TRACE( "status %#lx.\n", status );
|
2021-06-23 18:23:45 +02:00
|
|
|
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
|
|
|
*/
|
2021-08-05 04:20:48 +02:00
|
|
|
int WINAPI setsockopt( SOCKET s, int level, int optname, const char *optval, int optlen )
|
1997-08-24 18:00:30 +02:00
|
|
|
{
|
2022-02-05 02:35:37 +01:00
|
|
|
TRACE( "socket %#Ix, %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
|
|
|
{
|
2021-08-05 04:20:48 +02:00
|
|
|
case SOL_SOCKET:
|
2006-12-05 11:35:18 +01:00
|
|
|
switch(optname)
|
2001-12-14 23:48:38 +01:00
|
|
|
{
|
2021-08-05 04:20:48 +02:00
|
|
|
case SO_BROADCAST:
|
2021-06-23 18:23:45 +02:00
|
|
|
return server_setsockopt( s, IOCTL_AFD_WINE_SET_SO_BROADCAST, optval, optlen );
|
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
case SO_DONTLINGER:
|
2021-06-25 05:32:48 +02:00
|
|
|
{
|
2021-08-05 04:20:48 +02:00
|
|
|
struct linger linger;
|
2021-06-25 05:32:48 +02:00
|
|
|
|
|
|
|
if (!optval)
|
|
|
|
{
|
|
|
|
SetLastError( WSAEFAULT );
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
linger.l_onoff = !*(const BOOL *)optval;
|
|
|
|
linger.l_linger = 0;
|
2021-08-05 04:20:48 +02:00
|
|
|
return setsockopt( s, SOL_SOCKET, SO_LINGER, (char *)&linger, sizeof(linger) );
|
2021-06-25 05:32:48 +02:00
|
|
|
}
|
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
case SO_ERROR:
|
2021-06-24 07:00:13 +02:00
|
|
|
FIXME( "SO_ERROR, stub!\n" );
|
|
|
|
SetLastError( WSAENOPROTOOPT );
|
|
|
|
return -1;
|
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
case SO_KEEPALIVE:
|
2021-06-24 07:00:15 +02:00
|
|
|
return server_setsockopt( s, IOCTL_AFD_WINE_SET_SO_KEEPALIVE, optval, optlen );
|
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
case SO_LINGER:
|
2021-06-25 05:32:46 +02:00
|
|
|
return server_setsockopt( s, IOCTL_AFD_WINE_SET_SO_LINGER, optval, optlen );
|
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
case SO_OOBINLINE:
|
2021-06-25 05:32:50 +02:00
|
|
|
return server_setsockopt( s, IOCTL_AFD_WINE_SET_SO_OOBINLINE, optval, optlen );
|
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
case SO_RCVBUF:
|
2021-06-26 03:21:07 +02:00
|
|
|
return server_setsockopt( s, IOCTL_AFD_WINE_SET_SO_RCVBUF, optval, optlen );
|
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
case SO_RCVTIMEO:
|
2021-06-29 18:43:20 +02:00
|
|
|
return server_setsockopt( s, IOCTL_AFD_WINE_SET_SO_RCVTIMEO, optval, optlen );
|
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
case SO_REUSEADDR:
|
2021-06-29 18:43:22 +02:00
|
|
|
return server_setsockopt( s, IOCTL_AFD_WINE_SET_SO_REUSEADDR, optval, optlen );
|
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
case 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-08-05 04:20:48 +02:00
|
|
|
case SO_SNDTIMEO:
|
2021-06-30 06:25:43 +02:00
|
|
|
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. */
|
2021-08-05 04:20:48 +02:00
|
|
|
case SO_DEBUG:
|
2006-12-05 11:35:18 +01:00
|
|
|
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.*/
|
2021-08-05 04:20:48 +02:00
|
|
|
case SO_DONTROUTE:
|
2006-12-05 11:35:18 +01:00
|
|
|
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. */
|
2021-08-05 04:20:48 +02:00
|
|
|
case SO_EXCLUSIVEADDRUSE:
|
2006-12-05 11:35:18 +01:00
|
|
|
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. */
|
2021-08-05 04:20:48 +02:00
|
|
|
case 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. */
|
2021-08-05 04:20:48 +02:00
|
|
|
case SO_UPDATE_ACCEPT_CONTEXT:
|
2010-09-28 04:59:58 +02:00
|
|
|
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. */
|
2021-08-05 04:20:48 +02:00
|
|
|
case SO_OPENTYPE:
|
2006-12-05 11:35:18 +01:00
|
|
|
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;
|
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
case SO_RANDOMIZE_PORT:
|
|
|
|
FIXME("Ignoring SO_RANDOMIZE_PORT\n");
|
2018-02-26 04:06:36 +01:00
|
|
|
return 0;
|
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
case SO_PORT_SCALABILITY:
|
|
|
|
FIXME("Ignoring SO_PORT_SCALABILITY\n");
|
2018-02-26 04:06:36 +01:00
|
|
|
return 0;
|
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
case SO_REUSE_UNICASTPORT:
|
|
|
|
FIXME("Ignoring SO_REUSE_UNICASTPORT\n");
|
2018-02-26 04:06:36 +01:00
|
|
|
return 0;
|
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
case SO_REUSE_MULTICASTPORT:
|
|
|
|
FIXME("Ignoring SO_REUSE_MULTICASTPORT\n");
|
2018-02-26 04:06:36 +01:00
|
|
|
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 */
|
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
case SO_ACCEPTCONN:
|
|
|
|
case SO_TYPE:
|
2006-12-05 11:35:18 +01:00
|
|
|
SetLastError(WSAENOPROTOOPT);
|
|
|
|
return SOCKET_ERROR;
|
2003-12-02 05:19:56 +01:00
|
|
|
}
|
2021-08-05 04:20:48 +02:00
|
|
|
break; /* case SOL_SOCKET */
|
2006-12-05 11:35:18 +01:00
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
case NSPROTO_IPX:
|
2006-12-05 11:35:18 +01:00
|
|
|
switch(optname)
|
2003-12-02 05:19:56 +01:00
|
|
|
{
|
2021-08-05 04:20:48 +02:00
|
|
|
case IPX_PTYPE:
|
2021-07-31 01:55:37 +02:00
|
|
|
return server_setsockopt( s, IOCTL_AFD_WINE_SET_IPX_PTYPE, optval, optlen );
|
2006-12-05 11:35:18 +01:00
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
case 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);
|
2021-08-17 06:58:28 +02:00
|
|
|
SetLastError(WSAENOPROTOOPT);
|
2006-12-05 11:35:18 +01:00
|
|
|
return SOCKET_ERROR;
|
2000-10-13 19:05:35 +02:00
|
|
|
}
|
2021-08-05 04:20:48 +02:00
|
|
|
break; /* case NSPROTO_IPX */
|
2000-10-13 19:05:35 +02:00
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
case IPPROTO_TCP:
|
2006-12-05 11:35:18 +01:00
|
|
|
switch(optname)
|
|
|
|
{
|
2021-08-05 04:20:48 +02:00
|
|
|
case TCP_NODELAY:
|
2022-02-03 11:28:27 +01:00
|
|
|
{
|
|
|
|
INT nodelay = *optval;
|
|
|
|
if (optlen <= 0) {
|
|
|
|
SetLastError(WSAEFAULT);
|
|
|
|
return SOCKET_ERROR;
|
|
|
|
}
|
|
|
|
return server_setsockopt( s, IOCTL_AFD_WINE_SET_TCP_NODELAY, (char*)&nodelay, sizeof(nodelay) );
|
|
|
|
}
|
2006-12-05 11:35:18 +01:00
|
|
|
default:
|
|
|
|
FIXME("Unknown IPPROTO_TCP optname 0x%08x\n", optname);
|
2021-08-17 06:58:28 +02:00
|
|
|
SetLastError(WSAENOPROTOOPT);
|
2006-12-05 11:35:18 +01:00
|
|
|
return SOCKET_ERROR;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
case IPPROTO_IP:
|
2006-12-05 11:35:18 +01:00
|
|
|
switch(optname)
|
|
|
|
{
|
2021-08-05 04:20:48 +02:00
|
|
|
case IP_ADD_MEMBERSHIP:
|
2021-07-01 03:24:39 +02:00
|
|
|
return server_setsockopt( s, IOCTL_AFD_WINE_SET_IP_ADD_MEMBERSHIP, optval, optlen );
|
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
case 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 );
|
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
case 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-08-05 04:20:48 +02:00
|
|
|
case IP_DONTFRAGMENT:
|
2021-07-02 00:10:28 +02:00
|
|
|
return server_setsockopt( s, IOCTL_AFD_WINE_SET_IP_DONTFRAGMENT, optval, optlen );
|
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
case IP_DROP_MEMBERSHIP:
|
2021-07-07 06:48:44 +02:00
|
|
|
return server_setsockopt( s, IOCTL_AFD_WINE_SET_IP_DROP_MEMBERSHIP, optval, optlen );
|
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
case 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-08-05 04:20:48 +02:00
|
|
|
case IP_HDRINCL:
|
2021-07-08 03:16:39 +02:00
|
|
|
return server_setsockopt( s, IOCTL_AFD_WINE_SET_IP_HDRINCL, optval, optlen );
|
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
case IP_MULTICAST_IF:
|
2021-07-08 03:16:41 +02:00
|
|
|
return server_setsockopt( s, IOCTL_AFD_WINE_SET_IP_MULTICAST_IF, optval, optlen );
|
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
case IP_MULTICAST_LOOP:
|
2021-07-09 04:24:45 +02:00
|
|
|
return server_setsockopt( s, IOCTL_AFD_WINE_SET_IP_MULTICAST_LOOP, optval, optlen );
|
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
case IP_MULTICAST_TTL:
|
2021-07-09 04:24:47 +02:00
|
|
|
return server_setsockopt( s, IOCTL_AFD_WINE_SET_IP_MULTICAST_TTL, optval, optlen );
|
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
case IP_OPTIONS:
|
2021-07-09 04:24:49 +02:00
|
|
|
return server_setsockopt( s, IOCTL_AFD_WINE_SET_IP_OPTIONS, optval, optlen );
|
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
case IP_PKTINFO:
|
2021-07-10 02:40:40 +02:00
|
|
|
return server_setsockopt( s, IOCTL_AFD_WINE_SET_IP_PKTINFO, optval, optlen );
|
|
|
|
|
2021-09-29 08:40:55 +02:00
|
|
|
case IP_RECVTOS:
|
|
|
|
return server_setsockopt( s, IOCTL_AFD_WINE_SET_IP_RECVTOS, optval, optlen );
|
|
|
|
|
2021-09-29 08:40:54 +02:00
|
|
|
case IP_RECVTTL:
|
|
|
|
return server_setsockopt( s, IOCTL_AFD_WINE_SET_IP_RECVTTL, optval, optlen );
|
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
case IP_TOS:
|
2021-07-10 02:40:42 +02:00
|
|
|
return server_setsockopt( s, IOCTL_AFD_WINE_SET_IP_TOS, optval, optlen );
|
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
case IP_TTL:
|
2021-07-27 07:13:32 +02:00
|
|
|
return server_setsockopt( s, IOCTL_AFD_WINE_SET_IP_TTL, optval, optlen );
|
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
case IP_UNBLOCK_SOURCE:
|
2021-07-27 07:13:33 +02:00
|
|
|
return server_setsockopt( s, IOCTL_AFD_WINE_SET_IP_UNBLOCK_SOURCE, optval, optlen );
|
2019-10-18 19:32:53 +02:00
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
case IP_UNICAST_IF:
|
2021-07-27 07:13:35 +02:00
|
|
|
return server_setsockopt( s, IOCTL_AFD_WINE_SET_IP_UNICAST_IF, optval, optlen );
|
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);
|
2021-08-17 06:58:28 +02:00
|
|
|
SetLastError(WSAENOPROTOOPT);
|
2006-12-05 11:35:18 +01:00
|
|
|
return SOCKET_ERROR;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
case IPPROTO_IPV6:
|
2010-03-31 00:07:24 +02:00
|
|
|
switch(optname)
|
|
|
|
{
|
2021-08-05 04:20:48 +02:00
|
|
|
case IPV6_ADD_MEMBERSHIP:
|
2021-07-28 17:17:05 +02:00
|
|
|
return server_setsockopt( s, IOCTL_AFD_WINE_SET_IPV6_ADD_MEMBERSHIP, optval, optlen );
|
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
case IPV6_DONTFRAG:
|
2021-07-28 17:17:07 +02:00
|
|
|
return server_setsockopt( s, IOCTL_AFD_WINE_SET_IPV6_DONTFRAG, optval, optlen );
|
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
case IPV6_DROP_MEMBERSHIP:
|
2021-07-28 17:17:08 +02:00
|
|
|
return server_setsockopt( s, IOCTL_AFD_WINE_SET_IPV6_DROP_MEMBERSHIP, optval, optlen );
|
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
case IPV6_HOPLIMIT:
|
2021-08-03 07:08:38 +02:00
|
|
|
return server_setsockopt( s, IOCTL_AFD_WINE_SET_IPV6_RECVHOPLIMIT, optval, optlen );
|
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
case IPV6_MULTICAST_HOPS:
|
2021-07-28 23:18:09 +02:00
|
|
|
return server_setsockopt( s, IOCTL_AFD_WINE_SET_IPV6_MULTICAST_HOPS, optval, optlen );
|
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
case IPV6_MULTICAST_IF:
|
2021-07-28 23:18:11 +02:00
|
|
|
return server_setsockopt( s, IOCTL_AFD_WINE_SET_IPV6_MULTICAST_IF, optval, optlen );
|
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
case IPV6_MULTICAST_LOOP:
|
2021-07-28 23:18:13 +02:00
|
|
|
return server_setsockopt( s, IOCTL_AFD_WINE_SET_IPV6_MULTICAST_LOOP, optval, optlen );
|
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
case IPV6_PKTINFO:
|
2021-08-03 07:08:39 +02:00
|
|
|
return server_setsockopt( s, IOCTL_AFD_WINE_SET_IPV6_RECVPKTINFO, optval, optlen );
|
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
case IPV6_PROTECTION_LEVEL:
|
2012-04-01 10:23:17 +02:00
|
|
|
FIXME("IPV6_PROTECTION_LEVEL is ignored!\n");
|
|
|
|
return 0;
|
2021-07-30 07:00:43 +02:00
|
|
|
|
2021-08-13 07:56:13 +02:00
|
|
|
case IPV6_RECVTCLASS:
|
|
|
|
return server_setsockopt( s, IOCTL_AFD_WINE_SET_IPV6_RECVTCLASS, optval, optlen );
|
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
case IPV6_UNICAST_HOPS:
|
2021-07-30 07:00:43 +02:00
|
|
|
return server_setsockopt( s, IOCTL_AFD_WINE_SET_IPV6_UNICAST_HOPS, optval, optlen );
|
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
case IPV6_UNICAST_IF:
|
2021-07-30 07:00:45 +02:00
|
|
|
return server_setsockopt( s, IOCTL_AFD_WINE_SET_IPV6_UNICAST_IF, optval, optlen );
|
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
case IPV6_V6ONLY:
|
2021-07-30 07:00:47 +02:00
|
|
|
return server_setsockopt( s, IOCTL_AFD_WINE_SET_IPV6_V6ONLY, optval, optlen );
|
2017-01-12 06:27:08 +01:00
|
|
|
|
2010-03-31 00:07:24 +02:00
|
|
|
default:
|
|
|
|
FIXME("Unknown IPPROTO_IPV6 optname 0x%08x\n", optname);
|
2021-08-17 06:58:28 +02:00
|
|
|
SetLastError(WSAENOPROTOOPT);
|
2010-03-31 00:07:24 +02:00
|
|
|
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) */
|
1997-08-24 18:00:30 +02:00
|
|
|
}
|
|
|
|
|
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-08-05 04:20:48 +02:00
|
|
|
int WINAPI 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
|
|
|
|
2022-02-05 02:35:37 +01:00
|
|
|
TRACE( "socket %#Ix, 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 ) );
|
2022-02-09 18:34:45 +01:00
|
|
|
TRACE( "status %#lx.\n", status );
|
2021-05-19 05:35:51 +02:00
|
|
|
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
|
|
|
*/
|
2021-08-05 04:20:48 +02:00
|
|
|
SOCKET WINAPI 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
|
|
|
|
2022-02-05 02:35:37 +01:00
|
|
|
TRACE( "socket %#Ix, 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 ) );
|
2022-02-09 18:34:45 +01:00
|
|
|
TRACE( "status %#lx.\n", status );
|
2021-06-15 17:39:45 +02:00
|
|
|
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;
|
|
|
|
|
2022-02-05 02:35:37 +01:00
|
|
|
TRACE( "socket %#Ix, event %p, mask %#lx\n", s, event, mask );
|
2021-06-14 07:41:50 +02:00
|
|
|
|
|
|
|
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 ) );
|
2022-02-09 18:34:45 +01:00
|
|
|
TRACE( "status %#lx.\n", status );
|
2021-06-14 07:41:50 +02:00
|
|
|
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
|
|
|
|
2022-02-05 02:35:37 +01:00
|
|
|
TRACE( "socket %#Ix, overlapped %p, transfer %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) );
|
2022-02-09 18:34:45 +01:00
|
|
|
TRACE( "status %#lx.\n", 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
|
|
|
|
2022-02-05 02:35:37 +01:00
|
|
|
TRACE( "socket %#Ix, window %p, message %#x, mask %#lx\n", s, window, message, mask );
|
1997-08-24 18:00:30 +02:00
|
|
|
|
2021-08-11 20:13:01 +02:00
|
|
|
params.handle = s;
|
|
|
|
params.window = HandleToULong( window );
|
2021-06-15 17:39:48 +02:00
|
|
|
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 ) );
|
2022-02-09 18:34:45 +01:00
|
|
|
TRACE( "status %#lx.\n", status );
|
2021-06-15 17:39:48 +02:00
|
|
|
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;
|
|
|
|
|
|
|
|
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
|
|
|
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
|
|
|
|
2022-02-05 02:35:37 +01:00
|
|
|
TRACE( "family %d, type %d, protocol %d, info %p, group %u, flags %#lx\n",
|
|
|
|
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)
|
|
|
|
{
|
2022-02-05 02:35:36 +01:00
|
|
|
WARN( "not initialised\n" );
|
|
|
|
SetLastError( WSANOTINITIALISED );
|
|
|
|
return -1;
|
2013-09-17 15:01:07 +02:00
|
|
|
}
|
|
|
|
|
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;
|
2022-02-05 02:35:37 +01:00
|
|
|
TRACE( "got duplicate %#Ix\n", ret );
|
2020-09-10 23:17:14 +02:00
|
|
|
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
|
|
|
|
2021-08-05 04:20:47 +02:00
|
|
|
RtlInitUnicodeString(&string, L"\\Device\\Afd");
|
2020-09-20 00:13:37 +02:00
|
|
|
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
|
|
|
{
|
2022-02-05 02:35:37 +01:00
|
|
|
WARN( "failed to create socket, status %#lx\n", status );
|
2020-09-20 00:13:37 +02:00
|
|
|
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
|
|
|
{
|
2022-02-05 02:35:37 +01:00
|
|
|
WARN( "failed to initialize socket, status %#lx\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
|
|
|
{
|
2021-08-05 04:20:48 +02:00
|
|
|
if (type == SOCK_RAW)
|
2020-09-20 00:13:37 +02:00
|
|
|
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);
|
2022-02-05 02:35:37 +01:00
|
|
|
TRACE( "created %#Ix\n", ret );
|
2020-09-20 00:13:37 +02:00
|
|
|
|
|
|
|
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
|
|
|
}
|
2021-10-18 07:45:28 +02:00
|
|
|
WSASetLastError(0);
|
2020-09-20 00:13:37 +02:00
|
|
|
return ret;
|
2000-06-18 19:23:17 +02:00
|
|
|
}
|
|
|
|
|
2003-12-11 06:16:48 +01:00
|
|
|
/***********************************************************************
|
|
|
|
* WSAJoinLeaf (WS2_32.58)
|
|
|
|
*
|
|
|
|
*/
|
2021-08-05 04:20:48 +02:00
|
|
|
SOCKET WINAPI WSAJoinLeaf( SOCKET s, const struct sockaddr *addr, int addrlen, WSABUF *caller_data,
|
|
|
|
WSABUF *callee_data, QOS *socket_qos, QOS *group_qos, DWORD flags)
|
2003-12-11 06:16:48 +01:00
|
|
|
{
|
|
|
|
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
|
|
|
*/
|
2021-08-05 04:20:48 +02:00
|
|
|
int WINAPI __WSAFDIsSet( SOCKET s, 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;
|
|
|
|
}
|
|
|
|
|
|
|
|
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,
|
2021-08-05 04:20:48 +02:00
|
|
|
DWORD *lpNumberOfBytesRecvd, DWORD *lpFlags, struct sockaddr *lpFrom,
|
2010-07-18 02:53:06 +02:00
|
|
|
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-08-05 04:20:48 +02:00
|
|
|
SOCKET WINAPI WSAAccept( SOCKET s, struct sockaddr *addr, int *addrlen,
|
2021-06-18 03:58:21 +02:00
|
|
|
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;
|
2021-08-05 04:20:48 +02:00
|
|
|
struct sockaddr src_addr, dst_addr;
|
2021-06-18 03:58:21 +02:00
|
|
|
GROUP group;
|
|
|
|
SOCKET cs;
|
2002-01-14 19:33:44 +01:00
|
|
|
|
2022-02-05 02:35:37 +01:00
|
|
|
TRACE( "socket %#Ix, addr %p, addrlen %p, callback %p, context %#Ix\n",
|
2021-06-18 03:58:21 +02:00
|
|
|
s, addr, addrlen, callback, context );
|
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
cs = accept( s, addr, addrlen );
|
2021-06-18 03:58:21 +02:00
|
|
|
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);
|
2021-08-05 04:20:48 +02:00
|
|
|
getpeername( cs, &src_addr, &size );
|
2021-06-18 03:58:21 +02:00
|
|
|
caller_id.buf = (char *)&src_addr;
|
|
|
|
caller_id.len = size;
|
|
|
|
}
|
|
|
|
caller_data.buf = NULL;
|
|
|
|
caller_data.len = 0;
|
|
|
|
|
|
|
|
size = sizeof(dst_addr);
|
2021-08-05 04:20:48 +02:00
|
|
|
getsockname( cs, &dst_addr, &size );
|
2021-06-18 03:58:21 +02:00
|
|
|
|
|
|
|
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 );
|
2022-02-09 18:34:45 +01:00
|
|
|
TRACE( "callback returned %d.\n", ret );
|
2021-06-18 03:58:21 +02:00
|
|
|
switch (ret)
|
|
|
|
{
|
|
|
|
case CF_ACCEPT:
|
|
|
|
return cs;
|
|
|
|
|
|
|
|
case CF_DEFER:
|
2021-06-18 03:58:23 +02:00
|
|
|
{
|
2021-08-11 20:13:01 +02:00
|
|
|
ULONG server_handle = cs;
|
2021-06-18 03:58:23 +02:00
|
|
|
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 );
|
2021-10-08 06:01:14 +02:00
|
|
|
closesocket( cs );
|
2021-06-18 03:58:23 +02:00
|
|
|
SetLastError( status ? RtlNtStatusToDosError( status ) : WSATRY_AGAIN );
|
2022-02-09 18:34:45 +01:00
|
|
|
TRACE( "status %#lx.\n", status );
|
2021-06-18 03:58:23 +02:00
|
|
|
return -1;
|
|
|
|
}
|
2021-06-18 03:58:21 +02:00
|
|
|
|
|
|
|
case CF_REJECT:
|
2021-08-05 04:20:48 +02:00
|
|
|
closesocket( cs );
|
2021-06-18 03:58:21 +02:00
|
|
|
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)
|
|
|
|
*/
|
2022-02-05 02:35:37 +01:00
|
|
|
BOOL WINAPI WSAGetQOSByName( SOCKET s, WSABUF *name, QOS *qos )
|
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
|
|
|
{
|
2022-02-05 02:35:37 +01:00
|
|
|
FIXME( "socket %#Ix, name %p, qos %p, stub!\n", s, name, qos );
|
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)
|
|
|
|
*/
|
2022-02-05 02:35:37 +01:00
|
|
|
int WINAPI WSARecvDisconnect( SOCKET s, WSABUF *data )
|
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
|
|
|
{
|
2022-02-05 02:35:37 +01:00
|
|
|
TRACE( "socket %#Ix, data %p\n", s, data );
|
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
|
|
|
|
2021-08-05 04:20:48 +02:00
|
|
|
return 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
|
|
|
}
|