ReactOS 0.4.15-dev-8102-g108db8f
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{
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 NULL
Definition: types.h:112
#define MAX_CONNECTION_BUFFER_SIZE(EaSize)
Definition: options.h:61
#define MOUNT_OPTION_BUFFER_SECRET
Definition: options.h:26
unsigned long DWORD
Definition: ntddk_ex.h:95
GLsizeiptr size
Definition: glext.h:5919
GLuint64EXT * result
Definition: glext.h:11304
HLOCAL NTAPI LocalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:1390
ULONG_PTR SIZE_T
Definition: typedefs.h:80
_In_ PWDFDEVICE_INIT _In_ PWDF_REMOVE_LOCK_OPTIONS Options
Definition: wdfdevice.h:3534
#define LMEM_ZEROINIT
Definition: winbase.h:375
#define WN_OUT_OF_MEMORY
Definition: winnetwk.h:125
#define WN_SUCCESS
Definition: winnetwk.h:111
WCHAR * LPWSTR
Definition: xmlstorage.h:184

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}
Definition: bufpool.h:45
static FORCEINLINE SIZE_T ConnectionBufferSize(IN PCONNECTION_BUFFER Buffer)
Definition: options.c:60
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
static PVOID ptr
Definition: dispmode.c:27
BYTE * PBYTE
Definition: pedump.c:66
unsigned short USHORT
Definition: pedump.c:61
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
uint32_t ULONG
Definition: typedefs.h:59
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by NPAddConnection3().