ReactOS 0.4.15-dev-8058-ga7cbb60
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{
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'\\')
26
27 if (*Name == L'\0')
29
31
33 if (!NT_SUCCESS(Status) || ((Value > 255)))
35
36 *Protocol = Value;
37
38 return STATUS_SUCCESS;
39}
struct NameRec_ * Name
Definition: cdprocs.h:460
LONG NTSTATUS
Definition: precomp.h:26
#define MAX_TRACE
Definition: debug.h:16
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define TI_DbgPrint(_t_, _x_)
Definition: debug.h:45
Status
Definition: gdiplustypes.h:25
static const BYTE us[]
Definition: encode.c:689
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
NTSYSAPI NTSTATUS NTAPI RtlUnicodeStringToInteger(PUNICODE_STRING String, ULONG Base, PULONG Value)
#define L(x)
Definition: ntvdm.h:50
NTSTATUS TiGetProtocolNumber(PUNICODE_STRING FileName, PULONG Protocol)
Definition: proto.c:3
#define STATUS_SUCCESS
Definition: shellext.h:65
uint16_t * PWSTR
Definition: typedefs.h:56
uint32_t * PULONG
Definition: typedefs.h:59
uint32_t ULONG
Definition: typedefs.h:59
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
Definition: wdfregistry.h:413
__wchar_t WCHAR
Definition: xmlstorage.h:180