VirtualBox

Changeset 78321 in vbox for trunk/src


Ignore:
Timestamp:
Apr 26, 2019 12:39:27 PM (6 years ago)
Author:
vboxsync
Message:

winnt/vboxsf: Doxygen and related cleanups; eliminating the separate helper header. bugref:9172

Location:
trunk/src/VBox/Additions/WINNT/SharedFolders/driver
Files:
1 deleted
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/SharedFolders/driver/file.cpp

    r78304 r78321  
    1616 */
    1717
     18/*********************************************************************************************************************************
     19*   Header Files                                                                                                                 *
     20*********************************************************************************************************************************/
    1821#include "vbsf.h"
    1922#include <iprt/fs.h>
     
    2124
    2225
     26/*********************************************************************************************************************************
     27*   Defined Constants And Macros                                                                                                 *
     28*********************************************************************************************************************************/
    2329/* How much data to transfer in one HGCM request. */
    2430#define VBSF_MAX_READ_WRITE_PAGES 256
  • trunk/src/VBox/Additions/WINNT/SharedFolders/driver/info.cpp

    r78304 r78321  
    1616 */
    1717
     18
     19/*********************************************************************************************************************************
     20*   Header Files                                                                                                                 *
     21*********************************************************************************************************************************/
    1822#include "vbsf.h"
    1923#include <iprt/err.h>
    2024
    2125
     26/*********************************************************************************************************************************
     27*   Defined Constants And Macros                                                                                                 *
     28*********************************************************************************************************************************/
    2229/** Macro for copying a SHFLSTRING file name into a FILE_DIRECTORY_INFORMATION structure. */
    2330#define INIT_FILE_NAME(obj, str) \
     
    2734        RtlCopyMemory((obj)->FileName, &(str).String.ucs2[0], cbLength + 2); \
    2835    } while (0)
     36
    2937
    3038NTSTATUS VBoxMRxQueryDirectory(IN OUT PRX_CONTEXT RxContext)
  • trunk/src/VBox/Additions/WINNT/SharedFolders/driver/net.cpp

    r78304 r78321  
    1616 */
    1717
     18
     19/*********************************************************************************************************************************
     20*   Header Files                                                                                                                 *
     21*********************************************************************************************************************************/
    1822#include "vbsf.h"
     23
    1924
    2025NTSTATUS VBoxMRxUpdateNetRootState(IN OUT PMRX_NET_ROOT pNetRoot)
  • trunk/src/VBox/Additions/WINNT/SharedFolders/driver/path.cpp

    r78304 r78321  
    1616 */
    1717
     18/*********************************************************************************************************************************
     19*   Header Files                                                                                                                 *
     20*********************************************************************************************************************************/
    1821#include "vbsf.h"
    1922#include <iprt/err.h>
    2023
    2124
     25/*********************************************************************************************************************************
     26*   Defined Constants And Macros                                                                                                 *
     27*********************************************************************************************************************************/
    2228static UNICODE_STRING g_UnicodeBackslash = { 2, 4, L"\\" };
     29
    2330
    2431static NTSTATUS vbsfProcessCreate(PRX_CONTEXT RxContext,
  • trunk/src/VBox/Additions/WINNT/SharedFolders/driver/vbsf.cpp

    r78305 r78321  
    1616 */
    1717
     18
     19/*********************************************************************************************************************************
     20*   Header Files                                                                                                                 *
     21*********************************************************************************************************************************/
    1822#include "vbsf.h"
    1923
    2024
     25/*********************************************************************************************************************************
     26*   Structures and Typedefs                                                                                                      *
     27*********************************************************************************************************************************/
    2128/**
    2229 * The current state of the driver.
  • trunk/src/VBox/Additions/WINNT/SharedFolders/driver/vbsf.h

    r78304 r78321  
    2222#endif
    2323
     24
    2425/*
    2526 * This must be defined before including RX headers.
    2627 */
    27 #define MINIRDR__NAME VBoxMRx
    28 #define ___MINIRDR_IMPORTS_NAME (VBoxMRxDeviceObject->RdbssExports)
     28#define MINIRDR__NAME               VBoxMRx
     29#define ___MINIRDR_IMPORTS_NAME     (VBoxMRxDeviceObject->RdbssExports)
    2930
    3031/*
     
    4142 * VBox shared folders.
    4243 */
    43 #include "vbsfhlp.h"
    4444#include "vbsfshared.h"
    45 #ifdef __cplusplus /* mixes code and variables */
    46 # include <VBox/VBoxGuestLibSharedFoldersInline.h>
    47 #endif
     45#include <VBox/log.h>
     46#include <VBox/VBoxGuestLibSharedFolders.h>
     47#include <VBox/VBoxGuestLibSharedFoldersInline.h>
     48
    4849
    4950RT_C_DECLS_BEGIN
    5051
     52/*
     53 * Global data.
     54 */
    5155extern PRDBSS_DEVICE_OBJECT VBoxMRxDeviceObject;
    5256
    53 /*
     57/**
    5458 * Maximum drive letters (A - Z).
    5559 */
    5660#define _MRX_MAX_DRIVE_LETTERS 26
    5761
    58 /*
     62/**
    5963 * The shared folders device extension.
    6064 */
    6165typedef struct _MRX_VBOX_DEVICE_EXTENSION
    6266{
    63     /* The shared folders device object pointer. */
     67    /** The shared folders device object pointer. */
    6468    PRDBSS_DEVICE_OBJECT pDeviceObject;
    6569
    66     /*
     70    /**
    6771     * Keep a list of local connections used.
    6872     * The size (_MRX_MAX_DRIVE_LETTERS = 26) of the array presents the available drive letters C: - Z: of Windows.
     
    7983} MRX_VBOX_DEVICE_EXTENSION, *PMRX_VBOX_DEVICE_EXTENSION;
    8084
    81 /*
     85/**
    8286 * The shared folders NET_ROOT extension.
    8387 */
    8488typedef struct _MRX_VBOX_NETROOT_EXTENSION
    8589{
    86     /* The shared folder map handle of this netroot. */
     90    /** The shared folder map handle of this netroot. */
    8791    VBGLSFMAP map;
    8892    /** Simple initialized (mapped folder) indicator that works better with the
     
    137141#define VBOX_MJ_CREATE_SLASH_HACK   UINT16_C(0x0400)
    138142
    139 /*
    140  * Prototypes for the dispatch table routines.
     143/** @name Prototypes for the dispatch table routines.
     144 * @{
    141145 */
    142146NTSTATUS VBoxMRxStart(IN OUT struct _RX_CONTEXT * RxContext,
     
    190194                                IN PBOOLEAN ForceDisconnect);
    191195NTSTATUS VBoxMRxUpdateNetRootState(IN PMRX_NET_ROOT pNetRoot);
    192 VOID VBoxMRxExtractNetRootName(IN PUNICODE_STRING FilePathName,
    193                                IN PMRX_SRV_CALL SrvCall,
    194                                OUT PUNICODE_STRING NetRootName,
    195                                OUT PUNICODE_STRING RestOfName OPTIONAL);
     196VOID     VBoxMRxExtractNetRootName(IN PUNICODE_STRING FilePathName,
     197                                   IN PMRX_SRV_CALL SrvCall,
     198                                   OUT PUNICODE_STRING NetRootName,
     199                                   OUT PUNICODE_STRING RestOfName OPTIONAL);
    196200
    197201NTSTATUS VBoxMRxCreateSrvCall(PMRX_SRV_CALL pSrvCall,
     
    204208
    205209NTSTATUS VBoxMRxDevFcbXXXControlFile(IN OUT PRX_CONTEXT RxContext);
    206 
    207 /*
    208  * Support functions.
     210/** @} */
     211
     212/** @name Support functions and helpers
     213 * @{
    209214 */
    210215NTSTATUS vbsfDeleteConnection(IN PRX_CONTEXT RxContext,
     
    225230
    226231
     232
     233NTSTATUS vbsfHlpCreateDriveLetter(WCHAR Letter, UNICODE_STRING *pDeviceName);
     234NTSTATUS vbsfHlpDeleteDriveLetter(WCHAR Letter);
     235NTSTATUS VBoxErrorToNTStatus(int vrc);
     236
     237PVOID    vbsfAllocNonPagedMem(ULONG ulSize);
     238void     vbsfFreeNonPagedMem(PVOID lpMem);
     239
     240#if defined(DEBUG) || defined(LOG_ENABLED)
     241PCHAR MajorFunctionString(UCHAR MajorFunction, LONG MinorFunction);
     242#endif
     243
     244NTSTATUS vbsfShflStringFromUnicodeAlloc(PSHFLSTRING *ppShflString, const WCHAR *pwc, uint16_t cb);
     245
     246/**
     247 * Converts VBox (IPRT) file mode to NT file attributes.
     248 *
     249 * @returns NT file attributes
     250 * @param   fIprtMode   IPRT file mode.
     251 *
     252 */
     253DECLINLINE(uint32_t) VBoxToNTFileAttributes(uint32_t fIprtMode)
     254{
     255    AssertCompile((RTFS_DOS_READONLY               >> RTFS_DOS_SHIFT) == FILE_ATTRIBUTE_READONLY);
     256    AssertCompile((RTFS_DOS_HIDDEN                 >> RTFS_DOS_SHIFT) == FILE_ATTRIBUTE_HIDDEN);
     257    AssertCompile((RTFS_DOS_SYSTEM                 >> RTFS_DOS_SHIFT) == FILE_ATTRIBUTE_SYSTEM);
     258    AssertCompile((RTFS_DOS_DIRECTORY              >> RTFS_DOS_SHIFT) == FILE_ATTRIBUTE_DIRECTORY);
     259    AssertCompile((RTFS_DOS_ARCHIVED               >> RTFS_DOS_SHIFT) == FILE_ATTRIBUTE_ARCHIVE);
     260    AssertCompile((RTFS_DOS_NT_DEVICE              >> RTFS_DOS_SHIFT) == FILE_ATTRIBUTE_DEVICE);
     261    AssertCompile((RTFS_DOS_NT_NORMAL              >> RTFS_DOS_SHIFT) == FILE_ATTRIBUTE_NORMAL);
     262    AssertCompile((RTFS_DOS_NT_TEMPORARY           >> RTFS_DOS_SHIFT) == FILE_ATTRIBUTE_TEMPORARY);
     263    AssertCompile((RTFS_DOS_NT_SPARSE_FILE         >> RTFS_DOS_SHIFT) == FILE_ATTRIBUTE_SPARSE_FILE);
     264    AssertCompile((RTFS_DOS_NT_REPARSE_POINT       >> RTFS_DOS_SHIFT) == FILE_ATTRIBUTE_REPARSE_POINT);
     265    AssertCompile((RTFS_DOS_NT_COMPRESSED          >> RTFS_DOS_SHIFT) == FILE_ATTRIBUTE_COMPRESSED);
     266    AssertCompile((RTFS_DOS_NT_OFFLINE             >> RTFS_DOS_SHIFT) == FILE_ATTRIBUTE_OFFLINE);
     267    AssertCompile((RTFS_DOS_NT_NOT_CONTENT_INDEXED >> RTFS_DOS_SHIFT) == FILE_ATTRIBUTE_NOT_CONTENT_INDEXED);
     268    AssertCompile((RTFS_DOS_NT_ENCRYPTED           >> RTFS_DOS_SHIFT) == FILE_ATTRIBUTE_ENCRYPTED);
     269
     270    uint32_t fNtAttribs = (fIprtMode & (RTFS_DOS_MASK_NT & ~(RTFS_DOS_NT_OFFLINE | RTFS_DOS_NT_DEVICE | RTFS_DOS_NT_REPARSE_POINT)))
     271                       >> RTFS_DOS_SHIFT;
     272    return fNtAttribs ? fNtAttribs : FILE_ATTRIBUTE_NORMAL;
     273}
     274
     275/**
     276 * Converts NT file attributes to VBox (IPRT) ones.
     277 *
     278 * @returns IPRT file mode
     279 * @param   fNtAttribs      NT file attributes
     280 */
     281DECLINLINE(uint32_t) NTToVBoxFileAttributes(uint32_t fNtAttribs)
     282{
     283    uint32_t fIprtMode = (fNtAttribs << RTFS_DOS_SHIFT) & RTFS_DOS_MASK_NT;
     284    fIprtMode &= ~(RTFS_DOS_NT_OFFLINE | RTFS_DOS_NT_DEVICE | RTFS_DOS_NT_REPARSE_POINT);
     285    return fIprtMode ? fIprtMode : RTFS_DOS_NT_NORMAL;
     286}
     287
     288/** @} */
     289
    227290RT_C_DECLS_END
    228291
  • trunk/src/VBox/Additions/WINNT/SharedFolders/driver/vbsfhlp.cpp

    r78304 r78321  
    1616 */
    1717
    18 #include <iprt/nt/nt.h> /* includes ntifs.h and wdm.h */
    19 #include <iprt/win/ntdddisk.h>
    20 
    21 #include "vbsfhlp.h"
     18
     19/*********************************************************************************************************************************
     20*   Header Files                                                                                                                 *
     21*********************************************************************************************************************************/
     22#include "vbsf.h"
    2223#include <iprt/err.h>
    2324
     25
     26/*********************************************************************************************************************************
     27*   Global Variables                                                                                                             *
     28*********************************************************************************************************************************/
    2429#ifdef DEBUG
    2530static int s_iAllocRefCount = 0;
    2631#endif
    2732
    28 void vbsfHlpSleep(ULONG ulMillies)
    29 {
    30     KEVENT event;
    31     LARGE_INTEGER dueTime;
    32 
    33     KeInitializeEvent(&event, NotificationEvent, FALSE);
    34 
    35     dueTime.QuadPart = -10000 * (int)ulMillies;
    36 
    37     KeWaitForSingleObject(&event, Executive, KernelMode, FALSE, &dueTime);
    38 }
    39 
    40 /**
    41  * Converts VBox (IPRT) file mode to NT file attributes.
    42  *
    43  * @returns NT file attributes
    44  * @param   fIprtMode   IPRT file mode.
    45  *
    46  */
    47 uint32_t VBoxToNTFileAttributes(uint32_t fIprtMode)
    48 {
    49     AssertCompile((RTFS_DOS_READONLY               >> RTFS_DOS_SHIFT) == FILE_ATTRIBUTE_READONLY);
    50     AssertCompile((RTFS_DOS_HIDDEN                 >> RTFS_DOS_SHIFT) == FILE_ATTRIBUTE_HIDDEN);
    51     AssertCompile((RTFS_DOS_SYSTEM                 >> RTFS_DOS_SHIFT) == FILE_ATTRIBUTE_SYSTEM);
    52     AssertCompile((RTFS_DOS_DIRECTORY              >> RTFS_DOS_SHIFT) == FILE_ATTRIBUTE_DIRECTORY);
    53     AssertCompile((RTFS_DOS_ARCHIVED               >> RTFS_DOS_SHIFT) == FILE_ATTRIBUTE_ARCHIVE);
    54     /* skipping:   RTFS_DOS_NT_DEVICE */
    55     AssertCompile((RTFS_DOS_NT_NORMAL              >> RTFS_DOS_SHIFT) == FILE_ATTRIBUTE_NORMAL);
    56     AssertCompile((RTFS_DOS_NT_TEMPORARY           >> RTFS_DOS_SHIFT) == FILE_ATTRIBUTE_TEMPORARY);
    57     AssertCompile((RTFS_DOS_NT_SPARSE_FILE         >> RTFS_DOS_SHIFT) == FILE_ATTRIBUTE_SPARSE_FILE);
    58     AssertCompile((RTFS_DOS_NT_REPARSE_POINT       >> RTFS_DOS_SHIFT) == FILE_ATTRIBUTE_REPARSE_POINT);
    59     AssertCompile((RTFS_DOS_NT_COMPRESSED          >> RTFS_DOS_SHIFT) == FILE_ATTRIBUTE_COMPRESSED);
    60     /* skipping:   RTFS_DOS_NT_OFFLINE */
    61     AssertCompile((RTFS_DOS_NT_NOT_CONTENT_INDEXED >> RTFS_DOS_SHIFT) == FILE_ATTRIBUTE_NOT_CONTENT_INDEXED);
    62     AssertCompile((RTFS_DOS_NT_ENCRYPTED           >> RTFS_DOS_SHIFT) == FILE_ATTRIBUTE_ENCRYPTED);
    63 
    64     uint32_t fNtAttribs = (fIprtMode & (RTFS_DOS_MASK_NT & ~(RTFS_DOS_NT_OFFLINE | RTFS_DOS_NT_DEVICE | RTFS_DOS_NT_REPARSE_POINT)))
    65                        >> RTFS_DOS_SHIFT;
    66     return fNtAttribs ? fNtAttribs : FILE_ATTRIBUTE_NORMAL;
    67 }
    68 
    69 /**
    70  * Converts NT file attributes to VBox (IPRT) ones.
    71  *
    72  * @returns IPRT file mode
    73  * @param   fNtAttribs      NT file attributes
    74  */
    75 uint32_t NTToVBoxFileAttributes(uint32_t fNtAttribs)
    76 {
    77     uint32_t fIprtMode = (fNtAttribs << RTFS_DOS_SHIFT) & RTFS_DOS_MASK_NT;
    78     fIprtMode &= ~(RTFS_DOS_NT_OFFLINE | RTFS_DOS_NT_DEVICE | RTFS_DOS_NT_REPARSE_POINT);
    79     return fIprtMode ? fIprtMode : RTFS_DOS_NT_NORMAL;
    80 }
    8133
    8234NTSTATUS vbsfHlpCreateDriveLetter(WCHAR Letter, UNICODE_STRING *pDeviceName)
  • trunk/src/VBox/Additions/WINNT/SharedFolders/driver/vbsfshared.h

    r76563 r78321  
    11/* $Id$ */
    22/** @file
    3  *
    4  * VirtualBox Windows Guest Shared Folders
    5  *
    6  * File System Driver header file shared with the network provider dll
     3 * VirtualBox Windows Guest Shared Folders FSD - Definitions shared with the network provider dll.
    74 */
    85
     
    2522#endif
    2623
    27 /* The network provider name for shared folders. */
    28 #define MRX_VBOX_PROVIDER_NAME_U L"VirtualBox Shared Folders"
     24/** The network provider name for shared folders. */
     25#define MRX_VBOX_PROVIDER_NAME_U                L"VirtualBox Shared Folders"
    2926
    30 /* The filesystem name for shared folders. */
    31 #define MRX_VBOX_FILESYS_NAME_U L"VBoxSharedFolderFS"
     27/** The filesystem name for shared folders. */
     28#define MRX_VBOX_FILESYS_NAME_U                 L"VBoxSharedFolderFS"
    3229
    33 /* The redirector device name. */
    34 #define DD_MRX_VBOX_FS_DEVICE_NAME_U L"\\Device\\VBoxMiniRdr"
     30/** The redirector device name. */
     31#define DD_MRX_VBOX_FS_DEVICE_NAME_U            L"\\Device\\VBoxMiniRdr"
    3532
    36 #define VBOX_VOLNAME_PREFIX     L"VBOX_"
    37 #define VBOX_VOLNAME_PREFIX_SIZE  (sizeof(VBOX_VOLNAME_PREFIX) - sizeof(VBOX_VOLNAME_PREFIX[0]))
     33/** Volume label prefix. */
     34#define VBOX_VOLNAME_PREFIX                     L"VBOX_"
     35/** Size of volume label prefix. */
     36#define VBOX_VOLNAME_PREFIX_SIZE                (sizeof(VBOX_VOLNAME_PREFIX) - sizeof(VBOX_VOLNAME_PREFIX[0]))
    3837
    39 /* Name of symbolic link, which is used by the user mode dll to open the driver. */
    40 #define DD_MRX_VBOX_USERMODE_SHADOW_DEV_NAME_U     L"\\??\\VBoxMiniRdrDN"
    41 #define DD_MRX_VBOX_USERMODE_DEV_NAME_U            L"\\\\.\\VBoxMiniRdrDN"
     38/** NT path of the symbolic link, which is used by the user mode dll to
     39 * open the FSD. */
     40#define DD_MRX_VBOX_USERMODE_SHADOW_DEV_NAME_U  L"\\??\\VBoxMiniRdrDN"
     41/** Win32 path of the symbolic link, which is used by the user mode dll
     42 * to open the FSD. */
     43#define DD_MRX_VBOX_USERMODE_DEV_NAME_U         L"\\\\.\\VBoxMiniRdrDN"
    4244
    43 #define IOCTL_MRX_VBOX_BASE FILE_DEVICE_NETWORK_FILE_SYSTEM
    44 
    45 #define _MRX_VBOX_CONTROL_CODE(request, method, access) \
    46                 CTL_CODE(IOCTL_MRX_VBOX_BASE, request, method, access)
    47 
    48 /* VBoxSF IOCTL codes. */
    49 #define IOCTL_MRX_VBOX_ADDCONN       _MRX_VBOX_CONTROL_CODE(100, METHOD_BUFFERED, FILE_ANY_ACCESS)
    50 #define IOCTL_MRX_VBOX_GETCONN       _MRX_VBOX_CONTROL_CODE(101, METHOD_BUFFERED, FILE_ANY_ACCESS)
    51 #define IOCTL_MRX_VBOX_DELCONN       _MRX_VBOX_CONTROL_CODE(102, METHOD_BUFFERED, FILE_ANY_ACCESS)
    52 #define IOCTL_MRX_VBOX_GETLIST       _MRX_VBOX_CONTROL_CODE(103, METHOD_BUFFERED, FILE_ANY_ACCESS)
    53 #define IOCTL_MRX_VBOX_GETGLOBALLIST _MRX_VBOX_CONTROL_CODE(104, METHOD_BUFFERED, FILE_ANY_ACCESS)
    54 #define IOCTL_MRX_VBOX_GETGLOBALCONN _MRX_VBOX_CONTROL_CODE(105, METHOD_BUFFERED, FILE_ANY_ACCESS)
    55 #define IOCTL_MRX_VBOX_START         _MRX_VBOX_CONTROL_CODE(106, METHOD_BUFFERED, FILE_ANY_ACCESS)
    56 #define IOCTL_MRX_VBOX_STOP          _MRX_VBOX_CONTROL_CODE(107, METHOD_BUFFERED, FILE_ANY_ACCESS)
     45/** @name IOCTL_MRX_VBOX_XXX - VBoxSF IOCTL codes.
     46 * @{  */
     47#define IOCTL_MRX_VBOX_ADDCONN          CTL_CODE(FILE_DEVICE_NETWORK_FILE_SYSTEM, 100, METHOD_BUFFERED, FILE_ANY_ACCESS)
     48#define IOCTL_MRX_VBOX_GETCONN          CTL_CODE(FILE_DEVICE_NETWORK_FILE_SYSTEM, 101, METHOD_BUFFERED, FILE_ANY_ACCESS)
     49#define IOCTL_MRX_VBOX_DELCONN          CTL_CODE(FILE_DEVICE_NETWORK_FILE_SYSTEM, 102, METHOD_BUFFERED, FILE_ANY_ACCESS)
     50#define IOCTL_MRX_VBOX_GETLIST          CTL_CODE(FILE_DEVICE_NETWORK_FILE_SYSTEM, 103, METHOD_BUFFERED, FILE_ANY_ACCESS)
     51#define IOCTL_MRX_VBOX_GETGLOBALLIST    CTL_CODE(FILE_DEVICE_NETWORK_FILE_SYSTEM, 104, METHOD_BUFFERED, FILE_ANY_ACCESS)
     52#define IOCTL_MRX_VBOX_GETGLOBALCONN    CTL_CODE(FILE_DEVICE_NETWORK_FILE_SYSTEM, 105, METHOD_BUFFERED, FILE_ANY_ACCESS)
     53#define IOCTL_MRX_VBOX_START            CTL_CODE(FILE_DEVICE_NETWORK_FILE_SYSTEM, 106, METHOD_BUFFERED, FILE_ANY_ACCESS)
     54#define IOCTL_MRX_VBOX_STOP             CTL_CODE(FILE_DEVICE_NETWORK_FILE_SYSTEM, 107, METHOD_BUFFERED, FILE_ANY_ACCESS)
     55/** @} */
    5756
    5857#endif /* !GA_INCLUDED_SRC_WINNT_SharedFolders_driver_vbsfshared_h */
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette