ReactOS 0.4.16-dev-122-g325d74c
handle.c File Reference
#include "precomp.h"
Include dependency graph for handle.c:

Go to the source code of this file.

Functions

NTSTATUS openTcpFile (PHANDLE tcpFile, ACCESS_MASK DesiredAccess)
 
VOID closeTcpFile (HANDLE h)
 

Variables

const PWCHAR TcpFileName = L"\\Device\\Tcp"
 

Function Documentation

◆ closeTcpFile()

◆ openTcpFile()

NTSTATUS openTcpFile ( PHANDLE  tcpFile,
ACCESS_MASK  DesiredAccess 
)

Definition at line 12 of file handle.c.

13{
14 UNICODE_STRING fileName;
15 OBJECT_ATTRIBUTES objectAttributes;
16 IO_STATUS_BLOCK ioStatusBlock;
18
20
21 InitializeObjectAttributes( &objectAttributes,
22 &fileName,
24 NULL,
25 NULL );
26
27 status = NtOpenFile( tcpFile,
29 &objectAttributes,
30 &ioStatusBlock,
33
34 /* String does not need to be freed: it points to the constant
35 * string we provided */
36
37 if (!NT_SUCCESS(status))
38 *tcpFile = INVALID_HANDLE_VALUE;
39
40 return status;
41}
LONG NTSTATUS
Definition: precomp.h:26
#define NULL
Definition: types.h:112
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
#define FILE_SHARE_READ
Definition: compat.h:136
#define FILE_SYNCHRONOUS_IO_NONALERT
Definition: from_kernel.h:31
#define OBJ_CASE_INSENSITIVE
Definition: winternl.h:228
#define InitializeObjectAttributes(p, n, a, r, s)
Definition: reg.c:106
NTSYSAPI NTSTATUS NTAPI NtOpenFile(OUT PHANDLE phFile, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes, OUT PIO_STATUS_BLOCK pIoStatusBlock, IN ULONG ShareMode, IN ULONG OpenMode)
Definition: file.c:3952
#define FILE_SHARE_WRITE
Definition: nt_native.h:681
#define SYNCHRONIZE
Definition: nt_native.h:61
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
const PWCHAR TcpFileName
Definition: handle.c:10
Definition: ps.c:97
_Must_inspect_result_ _In_ WDFDEVICE _In_ ULONG _In_ ACCESS_MASK DesiredAccess
Definition: wdfdevice.h:2658

Referenced by addIPAddress(), createIpForwardEntry(), deleteIpAddress(), deleteIpForwardEntry(), getAddrByIndexOrName(), getArpTable(), getInterfaceEntryByIndex(), getInterfaceEntryByName(), getInterfaceIndexByName(), getInterfaceIndexTableInt(), getInterfaceNameByIndex(), getInterfacePhysicalByIndex(), getInterfacePhysicalByName(), getNumArpEntries(), getNumInterfacesInt(), getNumRoutes(), getNumTcpEntries(), getNumUdpEntries(), getRouteTable(), getTcpTable(), getUdpTable(), SendRequest(), SetIpNetEntry(), WSHIoctl_GetInterfaceList(), and WSHNotify().

Variable Documentation

◆ TcpFileName

const PWCHAR TcpFileName = L"\\Device\\Tcp"

Definition at line 10 of file handle.c.

Referenced by openTcpFile().