ReactOS  0.4.15-dev-1206-g731eddf
options.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _MOUNT_OPTION_BUFFER
 
struct  _CONNECTION_BUFFER
 
struct  _CONNECTION_INFO
 

Macros

#define MOUNT_OPTION_BUFFER_SECRET   ('n4')
 
#define MAX_CONNECTION_BUFFER_SIZE(EaSize)
 

Typedefs

typedef struct _MOUNT_OPTION_BUFFER MOUNT_OPTION_BUFFER
 
typedef struct _MOUNT_OPTION_BUFFERPMOUNT_OPTION_BUFFER
 
typedef struct _CONNECTION_BUFFER CONNECTION_BUFFER
 
typedef struct _CONNECTION_BUFFERPCONNECTION_BUFFER
 
typedef struct _CONNECTION_INFO CONNECTION_INFO
 
typedef struct _CONNECTION_INFOPCONNECTION_INFO
 

Functions

DWORD InitializeConnectionInfo (IN OUT PCONNECTION_INFO Connection, IN PMOUNT_OPTION_BUFFER Options, OUT LPWSTR *ConnectionName)
 
void FreeConnectionInfo (IN OUT PCONNECTION_INFO Connection)
 
void MarshalConnectionInfo (IN OUT PCONNECTION_INFO Connection)
 

Macro Definition Documentation

◆ MAX_CONNECTION_BUFFER_SIZE

#define MAX_CONNECTION_BUFFER_SIZE (   EaSize)
Value:
( \
sizeof(CONNECTION_BUFFER) + MAX_PATH + (EaSize) )
#define MAX_PATH
Definition: compat.h:34

Definition at line 61 of file options.h.

◆ MOUNT_OPTION_BUFFER_SECRET

#define MOUNT_OPTION_BUFFER_SECRET   ('n4')

Definition at line 26 of file options.h.

Typedef Documentation

◆ CONNECTION_BUFFER

◆ CONNECTION_INFO

◆ MOUNT_OPTION_BUFFER

◆ PCONNECTION_BUFFER

◆ PCONNECTION_INFO

◆ PMOUNT_OPTION_BUFFER

Function Documentation

◆ FreeConnectionInfo()

void FreeConnectionInfo ( IN OUT PCONNECTION_INFO  Connection)

◆ InitializeConnectionInfo()

DWORD InitializeConnectionInfo ( IN OUT PCONNECTION_INFO  Connection,
IN PMOUNT_OPTION_BUFFER  Options,
OUT LPWSTR ConnectionName 
)

Definition at line 26 of file options.c.

30 {
32  SIZE_T size;
33 
34  /* verify that this is a mount options buffer */
35  if (Options &&
36  Options->Zero == 0 &&
38  {
39  Connection->Options = Options;
41  }
42  else
43  {
44  Connection->Options = NULL;
46  }
47 
48  Connection->Buffer = LocalAlloc(LMEM_ZEROINIT, size);
49  if (Connection->Buffer)
50  *ConnectionName = (LPWSTR)Connection->Buffer->Buffer;
51  else
53 
54  return result;
55 }
#define WN_SUCCESS
Definition: winnetwk.h:111
enum OPTION_FLAGS Options
Definition: stats.c:44
smooth NULL
Definition: ftsmooth.c:416
#define MAX_CONNECTION_BUFFER_SIZE(EaSize)
Definition: options.h:61
GLsizeiptr size
Definition: glext.h:5919
#define LMEM_ZEROINIT
Definition: winbase.h:356
unsigned long DWORD
Definition: ntddk_ex.h:95
#define MOUNT_OPTION_BUFFER_SECRET
Definition: options.h:26
ULONG_PTR SIZE_T
Definition: typedefs.h:80
#define WN_OUT_OF_MEMORY
Definition: winnetwk.h:125
HLOCAL NTAPI LocalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:1373
WCHAR * LPWSTR
Definition: xmlstorage.h:184
GLuint64EXT * result
Definition: glext.h:11304

Referenced by NPAddConnection3().

◆ MarshalConnectionInfo()

void MarshalConnectionInfo ( IN OUT PCONNECTION_INFO  Connection)

Definition at line 68 of file options.c.

70 {
71  PCONNECTION_BUFFER Buffer = Connection->Buffer;
72  LPWSTR ConnectionName = (LPWSTR)Buffer->Buffer;
73 
74  Buffer->NameLength = (USHORT)(wcslen(ConnectionName) + 1) * sizeof(WCHAR);
75 
76  /* copy the EaBuffer after the end of ConnectionName */
77  if (Connection->Options && Connection->Options->Length)
78  {
79  PBYTE ptr = Buffer->Buffer + Buffer->NameLength;
80  /* add padding so EaBuffer starts on a ULONG boundary */
81  Buffer->EaPadding = (USHORT)
82  (sizeof(ULONG) - (SIZE_T)ptr % sizeof(ULONG)) % sizeof(ULONG);
83  Buffer->EaLength = Connection->Options->Length;
84  ptr += Buffer->EaPadding;
85 
86  RtlCopyMemory(ptr, Connection->Options->Buffer, Buffer->EaLength);
87  }
88 
89  Connection->BufferSize = (ULONG)ConnectionBufferSize(Buffer);
90 }
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
static PVOID ptr
Definition: dispmode.c:27
Definition: bufpool.h:45
static FORCEINLINE SIZE_T ConnectionBufferSize(IN PCONNECTION_BUFFER Buffer)
Definition: options.c:60
__wchar_t WCHAR
Definition: xmlstorage.h:180
ULONG_PTR SIZE_T
Definition: typedefs.h:80
unsigned short USHORT
Definition: pedump.c:61
unsigned int ULONG
Definition: retypes.h:1
WCHAR * LPWSTR
Definition: xmlstorage.h:184
BYTE * PBYTE
Definition: pedump.c:66
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)

Referenced by NPAddConnection3().