ReactOS 0.4.15-dev-7906-g1b85a5f
iphlpapi_reactos.c File Reference
#include "iphlpapi_private.h"
Include dependency graph for iphlpapi_reactos.c:

Go to the source code of this file.

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (iphlpapi)
 
DWORD TCPSendIoctl (HANDLE hDevice, DWORD dwIoControlCode, LPVOID lpInBuffer, PULONG pInBufferSize, LPVOID lpOutBuffer, PULONG pOutBufferSize)
 

Function Documentation

◆ TCPSendIoctl()

DWORD TCPSendIoctl ( HANDLE  hDevice,
DWORD  dwIoControlCode,
LPVOID  lpInBuffer,
PULONG  pInBufferSize,
LPVOID  lpOutBuffer,
PULONG  pOutBufferSize 
)

Definition at line 13 of file iphlpapi_reactos.c.

14{
15 BOOL Hack = FALSE;
19
20 /* FIXME: We don't have a global handle opened to \Device\Ip, so open one each time
21 * we need. In a future, it would be cool, just to pass it to TCPSendIoctl using the first arg
22 */
23 if (hDevice == INVALID_HANDLE_VALUE)
24 {
25 UNICODE_STRING DevName = RTL_CONSTANT_STRING(L"\\Device\\Ip");
27
28 FIXME("Using the handle hack\n");
29 Hack = TRUE;
30
32 &DevName,
34 NULL,
35 NULL);
36
39 0, NULL, 0);
40 if (!NT_SUCCESS(Status))
41 {
43 }
44 }
45
46 /* Sync event */
48 if (Event == NULL)
49 {
50 /* FIXME: See upper */
51 if (Hack)
52 {
53 CloseHandle(hDevice);
54 }
55 return GetLastError();
56 }
57
58 /* Reinit, and call the networking stack */
61 Status = NtDeviceIoControlFile(hDevice, Event, NULL, NULL, &IoStatusBlock, dwIoControlCode, lpInBuffer, *pInBufferSize, lpOutBuffer, *pOutBufferSize);
63 {
66 }
67
68 /* Close & return size info */
70 *pOutBufferSize = IoStatusBlock.Information;
71
72 /* FIXME: See upper */
73 if (Hack)
74 {
75 CloseHandle(hDevice);
76 }
77
78 /* Return result */
79 if (!NT_SUCCESS(Status))
80 {
82 }
83
84 return ERROR_SUCCESS;
85}
LONG NTSTATUS
Definition: precomp.h:26
#define FIXME(fmt,...)
Definition: debug.h:111
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
Definition: conport.c:36
#define ERROR_SUCCESS
Definition: deptool.c:10
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define CloseHandle
Definition: compat.h:739
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:137
#define FILE_SHARE_READ
Definition: compat.h:136
unsigned int BOOL
Definition: ntddk_ex.h:94
#define FILE_OPEN_IF
Definition: from_kernel.h:56
Status
Definition: gdiplustypes.h:25
#define OBJ_CASE_INSENSITIVE
Definition: winternl.h:228
NTSYSAPI ULONG WINAPI RtlNtStatusToDosError(NTSTATUS)
static OUT PIO_STATUS_BLOCK IoStatusBlock
Definition: pipe.c:75
#define InitializeObjectAttributes(p, n, a, r, s)
Definition: reg.c:106
#define FILE_SHARE_WRITE
Definition: nt_native.h:681
NTSYSAPI NTSTATUS NTAPI NtDeviceIoControlFile(IN HANDLE hFile, IN HANDLE hEvent OPTIONAL, IN PIO_APC_ROUTINE IoApcRoutine OPTIONAL, IN PVOID IoApcContext OPTIONAL, OUT PIO_STATUS_BLOCK pIoStatusBlock, IN ULONG DeviceIoControlCode, IN PVOID InBuffer OPTIONAL, IN ULONG InBufferLength, OUT PVOID OutBuffer OPTIONAL, IN ULONG OutBufferLength)
NTSYSAPI NTSTATUS NTAPI NtWaitForSingleObject(IN HANDLE hObject, IN BOOLEAN bAlertable, IN PLARGE_INTEGER Timeout)
NTSTATUS NTAPI NtCreateFile(OUT PHANDLE FileHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes, OUT PIO_STATUS_BLOCK IoStatusBlock, IN PLARGE_INTEGER AllocationSize OPTIONAL, IN ULONG FileAttributes, IN ULONG ShareAccess, IN ULONG CreateDisposition, IN ULONG CreateOptions, IN PVOID EaBuffer OPTIONAL, IN ULONG EaLength)
#define GENERIC_EXECUTE
Definition: nt_native.h:91
#define STATUS_PENDING
Definition: ntstatus.h:82
#define L(x)
Definition: ntvdm.h:50
#define STATUS_SUCCESS
Definition: shellext.h:65
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventW(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCWSTR lpName OPTIONAL)
Definition: synch.c:651
#define RTL_CONSTANT_STRING(s)
Definition: tunneltest.c:14
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
_In_ DWORD dwIoControlCode
Definition: winddi.h:1700

Referenced by SendARP().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( iphlpapi  )