VirtualBox

Changeset 78304 in vbox for trunk


Ignore:
Timestamp:
Apr 26, 2019 1:19:49 AM (6 years ago)
Author:
vboxsync
Message:

winnt/vboxsf: Use g_SfClient everywhere to avoid having dangling pointers (MRX_VBOX_NETROOT_EXTENSION::phgcmClient) and copies (MRX_VBOX_DEVICE_EXTENSION::hgcmClient). This also reduces the stack space usage. ASSUMES that the module can only be instantiated once (already an assumption of the g_SfClient variable and related code in VBoxGuestLibSharedFoldersInline.h). Renamed all sources to .cpp (except the w2k hacks). bugref:9172

Location:
trunk/src/VBox/Additions/WINNT/SharedFolders/driver
Files:
4 edited
4 moved

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/SharedFolders/driver/Makefile.kmk

    r78302 r78304  
    3333VBoxSF_LDFLAGS.amd64 = -Entry:DriverEntry
    3434VBoxSF_SOURCES     = \
    35         file.c \
     35        vbsf.cpp \
     36        net.cpp \
     37        file.cpp \
    3638        info.cpp \
    37         vbsf.cpp \
    38         net.c \
    39         path.c \
    40         vbsfhlp.c \
     39        path.cpp \
     40        vbsfhlp.cpp \
    4141        VBoxSF.rc
    4242VBoxSF_SOURCES.x86 = \
  • trunk/src/VBox/Additions/WINNT/SharedFolders/driver/file.cpp

    r78303 r78304  
    226226    RxCaptureFobx;
    227227
    228     PMRX_VBOX_DEVICE_EXTENSION pDeviceExtension = VBoxMRxGetDeviceExtension(RxContext);
    229228    PMRX_VBOX_NETROOT_EXTENSION pNetRootExtension = VBoxMRxGetNetRootExtension(capFcb->pNetRoot);
    230229    PMRX_VBOX_FOBX pVBoxFobx = VBoxMRxGetFileObjectExtension(capFobx);
     
    282281    }
    283282
    284     ctx.pClient = &pDeviceExtension->hgcmClient;
     283    ctx.pClient = &g_SfClient;
    285284    ctx.pMap    = &pNetRootExtension->map;
    286285    ctx.hFile   = pVBoxFobx->hFile;
     
    363362    RxCaptureFobx;
    364363
    365     PMRX_VBOX_DEVICE_EXTENSION pDeviceExtension = VBoxMRxGetDeviceExtension(RxContext);
    366364    PMRX_VBOX_NETROOT_EXTENSION pNetRootExtension = VBoxMRxGetNetRootExtension(capFcb->pNetRoot);
    367365    PMRX_VBOX_FOBX pVBoxFobx = VBoxMRxGetFileObjectExtension(capFobx);
     
    399397    }
    400398
    401     ctx.pClient = &pDeviceExtension->hgcmClient;
     399    ctx.pClient = &g_SfClient;
    402400    ctx.pMap    = &pNetRootExtension->map;
    403401    ctx.hFile   = pVBoxFobx->hFile;
     
    468466    RxCaptureFobx;
    469467
    470     PMRX_VBOX_DEVICE_EXTENSION pDeviceExtension = VBoxMRxGetDeviceExtension(RxContext);
    471468    PMRX_VBOX_NETROOT_EXTENSION pNetRootExtension = VBoxMRxGetNetRootExtension(capFcb->pNetRoot);
    472469    PMRX_VBOX_FOBX pVBoxFobx = VBoxMRxGetFileObjectExtension(capFobx);
     
    510507        fu32Lock |= SHFL_LOCK_WAIT;
    511508
    512     vrc = VbglR0SfLock(&pDeviceExtension->hgcmClient, &pNetRootExtension->map, pVBoxFobx->hFile,
     509    vrc = VbglR0SfLock(&g_SfClient, &pNetRootExtension->map, pVBoxFobx->hFile,
    513510                       LowIoContext->ParamsFor.Locks.ByteOffset, LowIoContext->ParamsFor.Locks.Length, fu32Lock);
    514511
     
    534531    RxCaptureFobx;
    535532
    536     PMRX_VBOX_DEVICE_EXTENSION pDeviceExtension = VBoxMRxGetDeviceExtension(RxContext);
    537533    PMRX_VBOX_NETROOT_EXTENSION pNetRootExtension = VBoxMRxGetNetRootExtension(capFcb->pNetRoot);
    538534    PMRX_VBOX_FOBX pVBoxFobx = VBoxMRxGetFileObjectExtension(capFobx);
     
    543539
    544540    /* Do the actual flushing of file buffers */
    545     vrc = VbglR0SfFlush(&pDeviceExtension->hgcmClient, &pNetRootExtension->map, pVBoxFobx->hFile);
     541    vrc = VbglR0SfFlush(&g_SfClient, &pNetRootExtension->map, pVBoxFobx->hFile);
    546542
    547543    Status = VBoxErrorToNTStatus(vrc);
     
    560556    RxCaptureFobx;
    561557
    562     PMRX_VBOX_DEVICE_EXTENSION pDeviceExtension = VBoxMRxGetDeviceExtension(RxContext);
    563558    PMRX_VBOX_NETROOT_EXTENSION pNetRootExtension = VBoxMRxGetNetRootExtension(capFcb->pNetRoot);
    564559    PMRX_VBOX_FOBX pVBoxFobx = VBoxMRxGetFileObjectExtension(capFobx);
     
    571566         pNewFileSize->QuadPart, pNewFileSize, pNewAllocationSize));
    572567
    573     Assert(pVBoxFobx && pNetRootExtension && pDeviceExtension);
     568    Assert(pVBoxFobx && pNetRootExtension);
    574569
    575570    cbBuffer = sizeof(SHFLFSOBJINFO);
     
    584579    pObjInfo->cbObject = pNewFileSize->QuadPart;
    585580
    586     vrc = VbglR0SfFsInfo(&pDeviceExtension->hgcmClient, &pNetRootExtension->map, pVBoxFobx->hFile,
     581    vrc = VbglR0SfFsInfo(&g_SfClient, &pNetRootExtension->map, pVBoxFobx->hFile,
    587582                         SHFL_INFO_SET | SHFL_INFO_SIZE, &cbBuffer, (PSHFLDIRINFO)pObjInfo);
    588583
  • trunk/src/VBox/Additions/WINNT/SharedFolders/driver/info.cpp

    r78302 r78304  
    3535    RxCaptureFcb;
    3636
    37     PMRX_VBOX_DEVICE_EXTENSION pDeviceExtension = VBoxMRxGetDeviceExtension(RxContext);
    3837    PMRX_VBOX_NETROOT_EXTENSION pNetRootExtension = VBoxMRxGetNetRootExtension(capFcb->pNetRoot);
    3938    PMRX_VBOX_FOBX pVBoxFobx = VBoxMRxGetFileObjectExtension(capFobx);
     
    175174    Log(("VBOXSF: MrxQueryDirectory: CallDirInfo: File = 0x%08x, Flags = 0x%08x, Index = %d, u32BufSize = %d\n",
    176175         pVBoxFobx->hFile, fSFFlags, index, u32BufSize));
    177     vrc = VbglR0SfDirInfo(&pDeviceExtension->hgcmClient, &pNetRootExtension->map, pVBoxFobx->hFile,
     176    vrc = VbglR0SfDirInfo(&g_SfClient, &pNetRootExtension->map, pVBoxFobx->hFile,
    178177                          ParsedPath, fSFFlags, index, &u32BufSize, (PSHFLDIRINFO)pHGCMBuffer, &cFiles);
    179178    Log(("VBOXSF: MrxQueryDirectory: u32BufSize after CallDirInfo = %d, rc = %Rrc\n",
     
    520519    RxCaptureFobx;
    521520
    522     PMRX_VBOX_DEVICE_EXTENSION pDeviceExtension = VBoxMRxGetDeviceExtension(RxContext);
    523521    PMRX_VBOX_NETROOT_EXTENSION pNetRootExtension = VBoxMRxGetNetRootExtension(capFcb->pNetRoot);
    524522    PMRX_VBOX_FOBX pVBoxFobx = VBoxMRxGetFileObjectExtension(capFobx);
     
    597595            }
    598596
    599             vrc = VbglR0SfFsInfo(&pDeviceExtension->hgcmClient, &pNetRootExtension->map, pVBoxFobx->hFile,
     597            vrc = VbglR0SfFsInfo(&g_SfClient, &pNetRootExtension->map, pVBoxFobx->hFile,
    600598                                 SHFL_INFO_GET | SHFL_INFO_VOLUME, &cbHGCMBuffer, (PSHFLDIRINFO)pHGCMBuffer);
    601599
     
    770768            }
    771769
    772             vrc = VbglR0SfFsInfo(&pDeviceExtension->hgcmClient, &pNetRootExtension->map, pVBoxFobx->hFile,
     770            vrc = VbglR0SfFsInfo(&g_SfClient, &pNetRootExtension->map, pVBoxFobx->hFile,
    773771                                 SHFL_INFO_GET | SHFL_INFO_VOLUME, &cbHGCMBuffer, (PSHFLDIRINFO)pHGCMBuffer);
    774772
     
    961959    RxCaptureFobx;
    962960    NTSTATUS                    Status            = STATUS_SUCCESS;
    963     //PMRX_VBOX_DEVICE_EXTENSION  pDeviceExtension  = VBoxMRxGetDeviceExtension(RxContext);
    964961    PMRX_VBOX_NETROOT_EXTENSION pNetRootExtension = VBoxMRxGetNetRootExtension(capFcb->pNetRoot);
    965962    PMRX_VBOX_FOBX              pVBoxFobx         = VBoxMRxGetFileObjectExtension(capFobx);
     
    12721269    RxCaptureFobx;
    12731270
    1274     PMRX_VBOX_DEVICE_EXTENSION pDeviceExtension = VBoxMRxGetDeviceExtension(RxContext);
    12751271    PMRX_VBOX_NETROOT_EXTENSION pNetRootExtension = VBoxMRxGetNetRootExtension(capFcb->pNetRoot);
    12761272    PMRX_VBOX_FOBX pVBoxFobx = VBoxMRxGetFileObjectExtension(capFobx);
     
    14031399                pSHFLFileInfo->Attr.fMode = NTToVBoxFileAttributes(pInfo->FileAttributes);
    14041400
    1405             Assert(pVBoxFobx && pNetRootExtension && pDeviceExtension);
    1406             vrc = VbglR0SfFsInfo(&pDeviceExtension->hgcmClient, &pNetRootExtension->map, pVBoxFobx->hFile,
     1401            Assert(pVBoxFobx && pNetRootExtension);
     1402            vrc = VbglR0SfFsInfo(&g_SfClient, &pNetRootExtension->map, pVBoxFobx->hFile,
    14071403                                 SHFL_INFO_SET | SHFL_INFO_FILE, &cbBuffer, (PSHFLDIRINFO)pSHFLFileInfo);
    14081404
  • trunk/src/VBox/Additions/WINNT/SharedFolders/driver/net.cpp

    r78303 r78304  
    7979    PMRX_V_NET_ROOT pVNetRoot = (PMRX_V_NET_ROOT)pCreateNetRootContext->pVNetRoot;
    8080
    81     PMRX_VBOX_DEVICE_EXTENSION pDeviceExtension = VBoxMRxGetDeviceExtension(pCreateNetRootContext->RxContext);
    8281    PMRX_VBOX_NETROOT_EXTENSION pNetRootExtension = VBoxMRxGetNetRootExtension(pVNetRoot->pNetRoot);
    8382
     
    158157     * pNetRootExtension is actually the pNetRoot->Context and it is not NULL.
    159158     */
    160     fInitializeNetRoot = (pNetRootExtension->phgcmClient == NULL);
    161 
    162159    Status = STATUS_SUCCESS;
    163160
    164     if (fInitializeNetRoot)
     161    if (!pNetRootExtension->fInitialized)
    165162    {
    166163        PWCHAR pRootName;
     
    172169
    173170        pNetRoot->MRxNetRootState = MRX_NET_ROOT_STATE_GOOD;
     171        pNetRootExtension->map.root = SHFL_ROOT_NIL;
    174172
    175173        RootNameLength = pNetRoot->pNetRootName->Length - pSrvCall->pSrvCallName->Length;
     
    193191            RootNameLength -= sizeof(WCHAR);
    194192
    195         if (!pNetRootExtension->phgcmClient)
     193        if (!pNetRootExtension->fInitialized)
    196194        {
    197195            Log(("VBOXSF: MRxCreateVNetRoot: Initialize netroot length = %d, name = %.*ls\n",
     
    204202            }
    205203
    206             vrc = VbglR0SfMapFolder(&pDeviceExtension->hgcmClient, ParsedPath, &pNetRootExtension->map);
     204            vrc = VbglR0SfMapFolder(&g_SfClient, ParsedPath, &pNetRootExtension->map);
    207205            vbsfFreeNonPagedMem(ParsedPath);
    208             if (vrc != VINF_SUCCESS)
     206            if (RT_SUCCESS(vrc))
    209207            {
    210                 Log(("VBOXSF: MRxCreateVNetRoot: VbglR0SfMapFolder failed with %d\n", vrc));
    211                 Status = STATUS_BAD_NETWORK_NAME;
     208                pNetRootExtension->fInitialized = true;
     209                Status = STATUS_SUCCESS;
    212210            }
    213211            else
    214212            {
    215                 Status = STATUS_SUCCESS;
    216                 pNetRootExtension->phgcmClient = &pDeviceExtension->hgcmClient;
     213                Log(("VBOXSF: MRxCreateVNetRoot: VbglR0SfMapFolder failed with %d\n", vrc));
     214                pNetRootExtension->map.root = SHFL_ROOT_NIL;
     215                Status = STATUS_BAD_NETWORK_NAME;
    217216            }
    218217        }
     
    259258    Log(("VBOXSF: MRxFinalizeNetRoot: NET_ROOT %p\n", pNetRoot));
    260259
    261     if (pNetRootExtension->phgcmClient)
    262     {
    263         int vrc = VbglR0SfUnmapFolder(pNetRootExtension->phgcmClient, &pNetRootExtension->map);
     260    if (   pNetRootExtension->fInitialized
     261        && g_SfClient.handle != NULL)
     262    {
     263        int vrc = VbglR0SfUnmapFolder(&g_SfClient, &pNetRootExtension->map);
    264264        if (vrc != VINF_SUCCESS)
    265265            Log(("VBOXSF: MRxFinalizeVNetRoot: VbglR0SfUnmapFolder failed with %d\n",
    266266                 vrc));
    267         pNetRootExtension->phgcmClient = NULL;
     267        pNetRootExtension->map.root = SHFL_ROOT_NIL;
     268        pNetRootExtension->fInitialized = false;
    268269    }
    269270
  • trunk/src/VBox/Additions/WINNT/SharedFolders/driver/path.cpp

    r78303 r78304  
    3434    RxCaptureFcb;
    3535
    36     PMRX_VBOX_DEVICE_EXTENSION pDeviceExtension = VBoxMRxGetDeviceExtension(RxContext);
    3736    PMRX_VBOX_NETROOT_EXTENSION pNetRootExtension = VBoxMRxGetNetRootExtension(capFcb->pNetRoot);
    3837
     
    280279        /* Call host. */
    281280        Log(("VBOXSF: vbsfProcessCreate: VbglR0SfCreate called.\n"));
    282         vrc = VbglR0SfCreate(&pDeviceExtension->hgcmClient, &pNetRootExtension->map, ParsedPath, pCreateParms);
     281        vrc = VbglR0SfCreate(&g_SfClient, &pNetRootExtension->map, ParsedPath, pCreateParms);
    283282
    284283        vbsfFreeNonPagedMem(ParsedPath);
     
    441440    if (pCreateParms && pCreateParms->Handle != SHFL_HANDLE_NIL)
    442441    {
    443         VbglR0SfClose(&pDeviceExtension->hgcmClient, &pNetRootExtension->map, pCreateParms->Handle);
     442        VbglR0SfClose(&g_SfClient, &pNetRootExtension->map, pCreateParms->Handle);
    444443        *pHandle = SHFL_HANDLE_NIL;
    445444    }
     
    534533    RxContext->Create.ReturnedCreateInformation = CreateAction;
    535534
     535    /* Initialize the FCB if this is the first open.
     536       Note! The RxFinishFcbInitialization call expects node types as the 2nd parameter, but is for
     537             some reason given enum RX_FILE_TYPE as type. */
    536538    if (capFcb->OpenCount == 0)
    537539    {
     
    556558                         &Data.EndOfFile,
    557559                         &Data.EndOfFile);
    558         /** @todo r=bird: Use FileTypeDirectory/RDBSS_NTC_STORAGE_TYPE_DIRECTORY here
    559          *        for directories? */
    560         RxFinishFcbInitialization(capFcb, RDBSS_STORAGE_NTC(FileTypeFile), &InitPacket);
     560        if (Info.Attr.fMode & RTFS_DOS_DIRECTORY)
     561            RxFinishFcbInitialization(capFcb, (RX_FILE_TYPE)RDBSS_NTC_STORAGE_TYPE_DIRECTORY, &InitPacket);
     562        else
     563            RxFinishFcbInitialization(capFcb, (RX_FILE_TYPE)RDBSS_NTC_STORAGE_TYPE_FILE, &InitPacket);
    561564    }
    562565
     
    652655}
    653656
    654 static NTSTATUS vbsfSetFileInfoOnClose(PMRX_VBOX_DEVICE_EXTENSION pDeviceExtension,
    655                                        PMRX_VBOX_NETROOT_EXTENSION pNetRootExtension,
     657static NTSTATUS vbsfSetFileInfoOnClose(PMRX_VBOX_NETROOT_EXTENSION pNetRootExtension,
    656658                                       PMRX_VBOX_FOBX pVBoxFobx,
    657659                                       PFILE_BASIC_INFORMATION pInfo,
     
    701703        pSHFLFileInfo->Attr.fMode = NTToVBoxFileAttributes(pInfo->FileAttributes);
    702704
    703     vrc = VbglR0SfFsInfo(&pDeviceExtension->hgcmClient, &pNetRootExtension->map, pVBoxFobx->hFile,
     705    vrc = VbglR0SfFsInfo(&g_SfClient, &pNetRootExtension->map, pVBoxFobx->hFile,
    704706                         SHFL_INFO_SET | SHFL_INFO_FILE, &cbBuffer, (PSHFLDIRINFO)pSHFLFileInfo);
    705707
     
    718720 * Updates file attributes if necessary.
    719721 */
    720 NTSTATUS vbsfCloseFileHandle(PMRX_VBOX_DEVICE_EXTENSION pDeviceExtension,
    721                              PMRX_VBOX_NETROOT_EXTENSION pNetRootExtension,
    722                              PMRX_VBOX_FOBX pVBoxFobx)
     722static NTSTATUS vbsfCloseFileHandle(PMRX_VBOX_NETROOT_EXTENSION pNetRootExtension,
     723                                    PMRX_VBOX_FOBX pVBoxFobx)
    723724{
    724725    NTSTATUS Status = STATUS_SUCCESS;
     
    740741         * to cancel any effect of the file read/write operations on the host.
    741742         */
    742         Status = vbsfSetFileInfoOnClose(pDeviceExtension,
    743                                         pNetRootExtension,
     743        Status = vbsfSetFileInfoOnClose(pNetRootExtension,
    744744                                        pVBoxFobx,
    745745                                        &pVBoxFobx->FileBasicInfo,
     
    747747    }
    748748
    749     vrc = VbglR0SfClose(&pDeviceExtension->hgcmClient,
     749    vrc = VbglR0SfClose(&g_SfClient,
    750750                        &pNetRootExtension->map,
    751751                        pVBoxFobx->hFile);
     
    767767    RxCaptureFobx;
    768768
    769     PMRX_VBOX_DEVICE_EXTENSION pDeviceExtension = VBoxMRxGetDeviceExtension(RxContext);
    770769    PMRX_VBOX_NETROOT_EXTENSION pNetRootExtension = VBoxMRxGetNetRootExtension(capFcb->pNetRoot);
    771770    PMRX_VBOX_FOBX pVBoxFobx = VBoxMRxGetFileObjectExtension(capFobx);
     
    796795    /* Close file */
    797796    if (pVBoxFobx->hFile != SHFL_HANDLE_NIL)
    798         vbsfCloseFileHandle(pDeviceExtension, pNetRootExtension, pVBoxFobx);
     797        vbsfCloseFileHandle(pNetRootExtension, pVBoxFobx);
    799798
    800799    if (capFcb->FcbState & FCB_STATE_DELETE_ON_CLOSE)
     
    818817    RxCaptureFobx;
    819818
    820     PMRX_VBOX_DEVICE_EXTENSION pDeviceExtension = VBoxMRxGetDeviceExtension(RxContext);
    821819    PMRX_VBOX_NETROOT_EXTENSION pNetRootExtension = VBoxMRxGetNetRootExtension(capFcb->pNetRoot);
    822820    PMRX_VBOX_FOBX pVBoxFobx = VBoxMRxGetFileObjectExtension(capFobx);
     
    832830    /* Close file first if not already done. */
    833831    if (pVBoxFobx->hFile != SHFL_HANDLE_NIL)
    834         vbsfCloseFileHandle(pDeviceExtension, pNetRootExtension, pVBoxFobx);
     832        vbsfCloseFileHandle(pNetRootExtension, pVBoxFobx);
    835833
    836834    Log(("VBOXSF: vbsfRemove: RemainingName->Length %d\n", RemainingName->Length));
     
    840838
    841839    /* Call host. */
    842     vrc = VbglR0SfRemove(&pDeviceExtension->hgcmClient, &pNetRootExtension->map,
     840    vrc = VbglR0SfRemove(&g_SfClient, &pNetRootExtension->map,
    843841                         ParsedPath,
    844842                         pVBoxFobx->Info.Attr.fMode & RTFS_DOS_DIRECTORY ? SHFL_REMOVE_DIR : SHFL_REMOVE_FILE);
     
    868866    RxCaptureFobx;
    869867
    870     PMRX_VBOX_DEVICE_EXTENSION pDeviceExtension = VBoxMRxGetDeviceExtension(RxContext);
    871868    PMRX_VBOX_NETROOT_EXTENSION pNetRootExtension = VBoxMRxGetNetRootExtension(capFcb->pNetRoot);
    872869    PMRX_VBOX_FOBX pVBoxFobx = VBoxMRxGetFileObjectExtension(capFobx);
     
    889886    /* Must close the file before renaming it! */
    890887    if (pVBoxFobx->hFile != SHFL_HANDLE_NIL)
    891         vbsfCloseFileHandle(pDeviceExtension, pNetRootExtension, pVBoxFobx);
     888        vbsfCloseFileHandle(pNetRootExtension, pVBoxFobx);
    892889
    893890    /* Mark it as renamed, so we do nothing during close */
     
    919916
    920917    Log(("VBOXSF: vbsfRename: Calling VbglR0SfRename\n"));
    921     vrc = VbglR0SfRename(&pDeviceExtension->hgcmClient, &pNetRootExtension->map, SrcPath, DestPath, flags);
     918    vrc = VbglR0SfRename(&g_SfClient, &pNetRootExtension->map, SrcPath, DestPath, flags);
    922919
    923920    vbsfFreeNonPagedMem(SrcPath);
  • trunk/src/VBox/Additions/WINNT/SharedFolders/driver/vbsf.cpp

    r78302 r78304  
    4141PRDBSS_DEVICE_OBJECT VBoxMRxDeviceObject;
    4242
    43 uint64_t g_abPadding111[256] = {0};
    4443/** The shared folder service client structure. */
    4544VBGLSFCLIENT g_SfClient;
     
    5049/** Shared folders features (SHFL_FEATURE_XXX). */
    5150uint64_t     g_fSfFeatures = 0;
    52 uint64_t g_abPadding222[256] = {0};
    5351
    5452
     
    619617
    620618    AssertPtr(pDeviceExtension);
    621     pDeviceExtension->hgcmClient = g_SfClient;
    622619
    623620    /* The redirector driver must intercept the IOCTL to avoid VBOXSVR name resolution
     
    812809                    }
    813810
    814                     vrc = VbglR0SfQueryMappings(&pDeviceExtension->hgcmClient, mappings, &cMappings);
     811                    vrc = VbglR0SfQueryMappings(&g_SfClient, mappings, &cMappings);
    815812                    if (vrc == VINF_SUCCESS)
    816813                    {
     
    963960                             *pu8ConnectId));
    964961
    965                         vrc = VbglR0SfQueryMapName(&pDeviceExtension->hgcmClient,
     962                        vrc = VbglR0SfQueryMapName(&g_SfClient,
    966963                                                   *pu8ConnectId & ~0x80 /** @todo fix properly */,
    967964                                                   pString, ShflStringSizeOfBuffer(pString));
  • trunk/src/VBox/Additions/WINNT/SharedFolders/driver/vbsf.h

    r78302 r78304  
    7272    FAST_MUTEX mtxLocalCon;
    7373
    74     /* The HGCM client information. */
    75     VBGLSFCLIENT hgcmClient;
    76 
    7774    /** Saved pointer to the original IRP_MJ_DEVICE_CONTROL handler. */
    7875    NTSTATUS (* pfnRDBSSDeviceControl) (PDEVICE_OBJECT pDevObj, PIRP pIrp);
     
    8178
    8279} MRX_VBOX_DEVICE_EXTENSION, *PMRX_VBOX_DEVICE_EXTENSION;
    83 #ifdef RT_ARCH_AMD64
    84 AssertCompileMemberOffset(MRX_VBOX_DEVICE_EXTENSION, cLocalConnections, 8);
    85 AssertCompileMemberOffset(MRX_VBOX_DEVICE_EXTENSION, wszLocalConnectionName, 0x28);
    86 AssertCompileMemberOffset(MRX_VBOX_DEVICE_EXTENSION, mtxLocalCon, 0xF8);
    87 AssertCompileMemberSize(MRX_VBOX_DEVICE_EXTENSION, mtxLocalCon, 7 * 8);
    88 AssertCompileMemberOffset(MRX_VBOX_DEVICE_EXTENSION, hgcmClient, 0x130);
    89 AssertCompileMemberOffset(MRX_VBOX_DEVICE_EXTENSION, pfnRDBSSDeviceControl, 0x130 + 16);
    90 #endif
    9180
    9281/*
     
    9584typedef struct _MRX_VBOX_NETROOT_EXTENSION
    9685{
    97     /* The pointert to HGCM client information in device extension. */
    98     VBGLSFCLIENT *phgcmClient;
    99 
    10086    /* The shared folder map handle of this netroot. */
    10187    VBGLSFMAP map;
     88    /** Simple initialized (mapped folder) indicator that works better with the
     89     *  zero filled defaults than SHFL_ROOT_NIL.  */
     90    bool        fInitialized;
    10291} MRX_VBOX_NETROOT_EXTENSION, *PMRX_VBOX_NETROOT_EXTENSION;
    10392
     
    232221                    IN ULONG BufferLength);
    233222NTSTATUS vbsfRemove(IN PRX_CONTEXT RxContext);
    234 NTSTATUS vbsfCloseFileHandle(PMRX_VBOX_DEVICE_EXTENSION pDeviceExtension,
    235                              PMRX_VBOX_NETROOT_EXTENSION pNetRootExtension,
    236                              PMRX_VBOX_FOBX pVBoxFobx);
    237223
    238224void     vbsfNtCopyInfoToLegacy(PMRX_VBOX_FOBX pVBoxFobx, PCSHFLFSOBJINFO pInfo);
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