Git conversion: Make reactos the root directory, move rosapps, rostests, wallpapers into modules, and delete rossubsys.

This commit is contained in:
Colin Finck 2017-10-03 07:45:34 +00:00
parent b94e2d8ca0
commit c2c66aff7d
24198 changed files with 0 additions and 37285 deletions

48
sdk/lib/tdilib/handle.c Normal file
View file

@ -0,0 +1,48 @@
/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS TDI interface
* FILE: handle.c
* PURPOSE: TDI transport handle management
*/
#include "precomp.h"
const PWCHAR TcpFileName = L"\\Device\\Tcp";
NTSTATUS openTcpFile(PHANDLE tcpFile, ACCESS_MASK DesiredAccess)
{
UNICODE_STRING fileName;
OBJECT_ATTRIBUTES objectAttributes;
IO_STATUS_BLOCK ioStatusBlock;
NTSTATUS status;
RtlInitUnicodeString( &fileName, TcpFileName );
InitializeObjectAttributes( &objectAttributes,
&fileName,
OBJ_CASE_INSENSITIVE,
NULL,
NULL );
status = NtOpenFile( tcpFile,
DesiredAccess | SYNCHRONIZE,
&objectAttributes,
&ioStatusBlock,
FILE_SHARE_READ | FILE_SHARE_WRITE,
FILE_SYNCHRONOUS_IO_NONALERT);
/* String does not need to be freed: it points to the constant
* string we provided */
if (!NT_SUCCESS(status))
*tcpFile = INVALID_HANDLE_VALUE;
return status;
}
VOID closeTcpFile( HANDLE h )
{
ASSERT(h != INVALID_HANDLE_VALUE);
NtClose( h );
}