ReactOS  0.4.13-dev-698-g77671f0
proto.c File Reference
#include "precomp.h"
Include dependency graph for proto.c:

Go to the source code of this file.

Functions

NTSTATUS TiGetProtocolNumber (PUNICODE_STRING FileName, PULONG Protocol)
 

Function Documentation

◆ TiGetProtocolNumber()

NTSTATUS TiGetProtocolNumber ( PUNICODE_STRING  FileName,
PULONG  Protocol 
)

Definition at line 3 of file proto.c.

14 {
17  ULONG Value;
18  PWSTR Name;
19 
20  TI_DbgPrint(MAX_TRACE, ("Called. FileName (%wZ).\n", FileName));
21 
22  Name = FileName->Buffer;
23 
24  if (*Name++ != (WCHAR)L'\\')
25  return STATUS_UNSUCCESSFUL;
26 
27  if (*Name == L'\0')
28  return STATUS_UNSUCCESSFUL;
29 
31 
33  if (!NT_SUCCESS(Status) || ((Value > 255)))
34  return STATUS_UNSUCCESSFUL;
35 
36  *Protocol = Value;
37 
38  return STATUS_SUCCESS;
39 }
_In_opt_ ULONG _Out_ PULONG Value
Definition: rtlfuncs.h:2343
#define TI_DbgPrint(_t_, _x_)
Definition: debug.h:45
static const BYTE us[]
Definition: encode.c:689
uint16_t * PWSTR
Definition: typedefs.h:54
LONG NTSTATUS
Definition: precomp.h:26
struct NameRec_ * Name
Definition: cdprocs.h:464
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
static const WCHAR L[]
Definition: oid.c:1250
Status
Definition: gdiplustypes.h:24
#define MAX_TRACE
Definition: debug.h:16
NTSYSAPI NTSTATUS NTAPI RtlUnicodeStringToInteger(PUNICODE_STRING String, ULONG Base, PULONG Value)
unsigned int ULONG
Definition: retypes.h:1
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
return STATUS_SUCCESS
Definition: btrfs.c:2777

Referenced by RunTest(), and TiCreateFileObject().