ReactOS  0.4.13-dev-563-g0561610
misc.c File Reference
#include "ntifs.h"
#include "ffsdrv.h"
Include dependency graph for misc.c:

Go to the source code of this file.

Functions

ULONG FFSLog2 (ULONG Value)
 
LARGE_INTEGER FFSSysTime (IN ULONG i_time)
 
ULONG FFSInodeTime (IN LARGE_INTEGER SysTime)
 
NTSTATUS FFSOEMToUnicode (IN OUT PUNICODE_STRING Unicode, IN POEM_STRING Oem)
 
NTSTATUS FFSUnicodeToOEM (IN OUT POEM_STRING Oem, IN PUNICODE_STRING Unicode)
 

Variables

PFFS_GLOBAL FFSGlobal
 

Function Documentation

◆ FFSInodeTime()

ULONG FFSInodeTime ( IN LARGE_INTEGER  SysTime)

Definition at line 66 of file misc.c.

68 {
69  ULONG FFSTime;
70 
71  PAGED_CODE();
72 
73  RtlTimeToSecondsSince1970(&SysTime, &FFSTime);
74 
75  return FFSTime;
76 }
BOOLEAN NTAPI RtlTimeToSecondsSince1970(PLARGE_INTEGER Time, PULONG ElapsedSeconds)
#define PAGED_CODE()
Definition: video.h:57
unsigned int ULONG
Definition: retypes.h:1

Referenced by FFSSetInformation(), FFSSupersedeOrOverWriteFile(), and FFSv1SaveInode().

◆ FFSLog2()

ULONG FFSLog2 ( ULONG  Value)

Definition at line 33 of file misc.c.

35 {
36  ULONG Order = 0;
37 
38  PAGED_CODE();
39 
40  ASSERT(Value > 0);
41 
42  while (Value)
43  {
44  Order++;
45  Value >>= 1;
46  }
47 
48  return (Order - 1);
49 }
_In_opt_ ULONG _Out_ PULONG Value
Definition: rtlfuncs.h:2327
#define PAGED_CODE()
Definition: video.h:57
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
unsigned int ULONG
Definition: retypes.h:1

Referenced by FFSMountVolume().

◆ FFSOEMToUnicode()

NTSTATUS FFSOEMToUnicode ( IN OUT PUNICODE_STRING  Unicode,
IN POEM_STRING  Oem 
)

Definition at line 80 of file misc.c.

83 {
85 
86  PAGED_CODE();
87 
89  Unicode,
90  Oem,
91  FALSE);
92 
93  if (!NT_SUCCESS(Status))
94  {
95  FFSBreakPoint();
96  goto errorout;
97  }
98 
99 errorout:
100 
101  return Status;
102 }
LONG NTSTATUS
Definition: precomp.h:26
#define PAGED_CODE()
Definition: video.h:57
#define FFSBreakPoint()
Definition: ffsdrv.h:43
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
NTSYSAPI NTSTATUS NTAPI RtlOemStringToUnicodeString(PUNICODE_STRING DestinationString, PCOEM_STRING SourceString, BOOLEAN AllocateDestinationString)
Status
Definition: gdiplustypes.h:24

Referenced by FFSInitializeVcb(), FFSQueryDirectory(), FFSv1ScanDir(), and FFSv2ScanDir().

◆ FFSSysTime()

LARGE_INTEGER FFSSysTime ( IN ULONG  i_time)

Definition at line 53 of file misc.c.

55 {
56  LARGE_INTEGER SysTime;
57 
58  PAGED_CODE();
59 
60  RtlSecondsSince1970ToTime(i_time, &SysTime);
61 
62  return SysTime;
63 }
NTSYSAPI VOID NTAPI RtlSecondsSince1970ToTime(_In_ ULONG SecondsSince1970, _Out_ PLARGE_INTEGER Time)
#define PAGED_CODE()
Definition: video.h:57

Referenced by FFSFastIoQueryBasicInfo(), FFSFastIoQueryNetworkOpenInfo(), FFSProcessDirEntry(), and FFSQueryInformation().

◆ FFSUnicodeToOEM()

NTSTATUS FFSUnicodeToOEM ( IN OUT POEM_STRING  Oem,
IN PUNICODE_STRING  Unicode 
)

Definition at line 106 of file misc.c.

109 {
111 
112  PAGED_CODE();
113 
115  Oem,
116  Unicode,
117  FALSE);
118 
119  if (!NT_SUCCESS(Status))
120  {
121  FFSBreakPoint();
122  goto errorout;
123  }
124 
125 errorout:
126 
127  return Status;
128 }
LONG NTSTATUS
Definition: precomp.h:26
#define PAGED_CODE()
Definition: video.h:57
#define FFSBreakPoint()
Definition: ffsdrv.h:43
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
NTSYSAPI NTSTATUS NTAPI RtlUnicodeStringToOemString(POEM_STRING DestinationString, PCUNICODE_STRING SourceString, BOOLEAN AllocateDestinationString)
Status
Definition: gdiplustypes.h:24

Referenced by FFSAddEntry(), FFSSetRenameInfo(), FFSSetVolumeInformation(), FFSv1AllocateFcb(), and FFSv2AllocateFcb().

Variable Documentation

◆ FFSGlobal

PFFS_GLOBAL FFSGlobal

Definition at line 22 of file init.c.