ReactOS  0.4.15-dev-3456-g4a17d4b
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 }
#define TI_DbgPrint(_t_, _x_)
Definition: debug.h:45
static const BYTE us[]
Definition: encode.c:689
uint16_t * PWSTR
Definition: typedefs.h:56
LONG NTSTATUS
Definition: precomp.h:26
#define L(x)
Definition: ntvdm.h:50
struct NameRec_ * Name
Definition: cdprocs.h:459
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
Definition: wdfregistry.h:406
Status
Definition: gdiplustypes.h:24
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
#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)
#define STATUS_SUCCESS
Definition: shellext.h:65

Referenced by RunTest(), and TiCreateFileObject().