ReactOS  0.4.14-dev-317-g96040ec
proto.c
Go to the documentation of this file.
1 #include "precomp.h"
2 
6 /*
7  * FUNCTION: Returns the protocol number from a file name
8  * ARGUMENTS:
9  * FileName = Pointer to string with file name
10  * Protocol = Pointer to buffer to put protocol number in
11  * RETURNS:
12  * Status of operation
13  */
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
unsigned int * PULONG
Definition: retypes.h:1
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)
NTSTATUS TiGetProtocolNumber(PUNICODE_STRING FileName, PULONG Protocol)
Definition: proto.c:3
return STATUS_SUCCESS
Definition: btrfs.c:2938