ReactOS  0.4.13-dev-1181-gb6654c0
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 
19  RtlInitUnicodeString( &fileName, TcpFileName );
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 INVALID_HANDLE_VALUE
Definition: compat.h:391
#define FILE_SHARE_WRITE
Definition: nt_native.h:681
#define FILE_SHARE_READ
Definition: compat.h:125
smooth NULL
Definition: ftsmooth.c:416
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:3951
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define OBJ_CASE_INSENSITIVE
Definition: winternl.h:228
#define SYNCHRONIZE
Definition: nt_native.h:61
const PWCHAR TcpFileName
Definition: handle.c:10
_In_ PIO_STACK_LOCATION _Inout_ PFILE_OBJECT _Inout_ PVCB _Outptr_result_maybenull_ PDCB _In_ PDCB _In_ PDIRENT _In_ ULONG _In_ ULONG _In_ PUNICODE_STRING _In_ PACCESS_MASK DesiredAccess
Definition: create.c:4157
#define FILE_SYNCHRONOUS_IO_NONALERT
Definition: from_kernel.h:31
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define InitializeObjectAttributes(p, n, a, r, s)
Definition: reg.c:106
static SERVICE_STATUS status
Definition: service.c:31
Definition: ps.c:97

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().