VirtualBox

Ignore:
Timestamp:
Apr 26, 2019 2:45:38 PM (6 years ago)
Author:
vboxsync
Message:

winnt/vboxsf: Cleaned up the vbsfhlp.cpp code, removing a few unused functions and such. bugref:9172

File:
1 edited

Legend:

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

    r78321 r78326  
    141141
    142142    /* Initialize create parameters. */
    143     pCreateParms = (SHFLCREATEPARMS *)vbsfAllocNonPagedMem(sizeof(SHFLCREATEPARMS));
     143    pCreateParms = (SHFLCREATEPARMS *)vbsfNtAllocNonPagedMem(sizeof(SHFLCREATEPARMS));
    144144    if (!pCreateParms)
    145145    {
     
    265265        if (!bf.SlashHack)
    266266        {
    267             Status = vbsfShflStringFromUnicodeAlloc(&ParsedPath, RemainingName->Buffer, RemainingName->Length);
     267            Status = vbsfNtShflStringFromUnicodeAlloc(&ParsedPath, RemainingName->Buffer, RemainingName->Length);
    268268            if (Status != STATUS_SUCCESS)
    269269                goto failure;
     
    272272        {
    273273            /* Add back the slash we had to hide from RDBSS. */
    274             Status = vbsfShflStringFromUnicodeAlloc(&ParsedPath, NULL, RemainingName->Length + sizeof(RTUTF16));
     274            Status = vbsfNtShflStringFromUnicodeAlloc(&ParsedPath, NULL, RemainingName->Length + sizeof(RTUTF16));
    275275            if (Status != STATUS_SUCCESS)
    276276                goto failure;
     
    288288        vrc = VbglR0SfCreate(&g_SfClient, &pNetRootExtension->map, ParsedPath, pCreateParms);
    289289
    290         vbsfFreeNonPagedMem(ParsedPath);
     290        vbsfNtFreeNonPagedMem(ParsedPath);
    291291    }
    292292
     
    321321            {
    322322                *pulCreateAction = FILE_DOES_NOT_EXIST;
    323                 Status = VBoxErrorToNTStatus(vrc);
     323                Status = vbsfNtVBoxStatusToNt(vrc);
    324324                goto failure;
    325325            }
     
    436436    *pInfo = pCreateParms->Info;
    437437
    438     vbsfFreeNonPagedMem(pCreateParms);
     438    vbsfNtFreeNonPagedMem(pCreateParms);
    439439
    440440    return Status;
     
    452452
    453453    if (pCreateParms)
    454         vbsfFreeNonPagedMem(pCreateParms);
     454        vbsfNtFreeNonPagedMem(pCreateParms);
    455455
    456456    return Status;
     
    689689
    690690    cbBuffer = sizeof(SHFLFSOBJINFO);
    691     pHGCMBuffer = (uint8_t *)vbsfAllocNonPagedMem(cbBuffer);
     691    pHGCMBuffer = (uint8_t *)vbsfNtAllocNonPagedMem(cbBuffer);
    692692    if (!pHGCMBuffer)
    693693    {
     
    714714
    715715    if (vrc != VINF_SUCCESS)
    716         Status = VBoxErrorToNTStatus(vrc);
     716        Status = vbsfNtVBoxStatusToNt(vrc);
    717717
    718718    if (pHGCMBuffer)
    719         vbsfFreeNonPagedMem(pHGCMBuffer);
     719        vbsfNtFreeNonPagedMem(pHGCMBuffer);
    720720
    721721    Log(("VBOXSF: vbsfSetFileInfo: Returned 0x%08X\n", Status));
     
    761761
    762762    if (vrc != VINF_SUCCESS)
    763         Status = VBoxErrorToNTStatus(vrc);
     763        Status = vbsfNtVBoxStatusToNt(vrc);
    764764
    765765    Log(("VBOXSF: vbsfCloseFileHandle: Returned 0x%08X\n", Status));
     
    811811        /* Remove file or directory if delete action is pending. */
    812812        if (capFcb->OpenCount == 0)
    813             Status = vbsfRemove(RxContext);
     813            Status = vbsfNtRemove(RxContext);
    814814    }
    815815
     
    817817}
    818818
    819 NTSTATUS vbsfRemove(IN PRX_CONTEXT RxContext)
     819NTSTATUS vbsfNtRemove(IN PRX_CONTEXT RxContext)
    820820{
    821821    NTSTATUS Status = STATUS_SUCCESS;
     
    832832    PSHFLSTRING ParsedPath = NULL;
    833833
    834     Log(("VBOXSF: vbsfRemove: Delete %.*ls. open count = %d\n",
     834    Log(("VBOXSF: vbsfNtRemove: Delete %.*ls. open count = %d\n",
    835835         RemainingName->Length / sizeof(WCHAR), RemainingName->Buffer, capFcb->OpenCount));
    836836
     
    839839        vbsfCloseFileHandle(pNetRootExtension, pVBoxFobx);
    840840
    841     Log(("VBOXSF: vbsfRemove: RemainingName->Length %d\n", RemainingName->Length));
    842     Status = vbsfShflStringFromUnicodeAlloc(&ParsedPath, RemainingName->Buffer, RemainingName->Length);
     841    Log(("VBOXSF: vbsfNtRemove: RemainingName->Length %d\n", RemainingName->Length));
     842    Status = vbsfNtShflStringFromUnicodeAlloc(&ParsedPath, RemainingName->Buffer, RemainingName->Length);
    843843    if (Status != STATUS_SUCCESS)
    844844        return Status;
     
    850850
    851851    if (ParsedPath)
    852         vbsfFreeNonPagedMem(ParsedPath);
     852        vbsfNtFreeNonPagedMem(ParsedPath);
    853853
    854854    if (vrc == VINF_SUCCESS)
    855855        SetFlag(capFobx->pSrvOpen->Flags, SRVOPEN_FLAG_FILE_DELETED);
    856856
    857     Status = VBoxErrorToNTStatus(vrc);
     857    Status = vbsfNtVBoxStatusToNt(vrc);
    858858    if (vrc != VINF_SUCCESS)
    859         Log(("VBOXSF: vbsfRemove: VbglR0SfRemove failed with %Rrc\n", vrc));
    860 
    861     Log(("VBOXSF: vbsfRemove: Returned 0x%08X\n", Status));
     859        Log(("VBOXSF: vbsfNtRemove: VbglR0SfRemove failed with %Rrc\n", vrc));
     860
     861    Log(("VBOXSF: vbsfNtRemove: Returned 0x%08X\n", Status));
    862862    return Status;
    863863}
    864864
    865 NTSTATUS vbsfRename(IN PRX_CONTEXT RxContext,
     865NTSTATUS vbsfNtRename(IN PRX_CONTEXT RxContext,
    866866                    IN FILE_INFORMATION_CLASS FileInformationClass,
    867867                    IN PVOID pBuffer,
     
    888888    Assert(FileInformationClass == FileRenameInformation);
    889889
    890     Log(("VBOXSF: vbsfRename: FileName = %.*ls\n",
     890    Log(("VBOXSF: vbsfNtRename: FileName = %.*ls\n",
    891891         RenameInformation->FileNameLength / sizeof(WCHAR), &RenameInformation->FileName[0]));
    892892
     
    898898    SetFlag(pSrvOpen->Flags, SRVOPEN_FLAG_FILE_RENAMED);
    899899
    900     Log(("VBOXSF: vbsfRename: RenameInformation->FileNameLength = %d\n", RenameInformation->FileNameLength));
    901     Status = vbsfShflStringFromUnicodeAlloc(&DestPath, RenameInformation->FileName, (uint16_t)RenameInformation->FileNameLength);
     900    Log(("VBOXSF: vbsfNtRename: RenameInformation->FileNameLength = %d\n", RenameInformation->FileNameLength));
     901    Status = vbsfNtShflStringFromUnicodeAlloc(&DestPath, RenameInformation->FileName, (uint16_t)RenameInformation->FileNameLength);
    902902    if (Status != STATUS_SUCCESS)
    903903        return Status;
    904904
    905     Log(("VBOXSF: vbsfRename: Destination path = %.*ls\n",
     905    Log(("VBOXSF: vbsfNtRename: Destination path = %.*ls\n",
    906906         DestPath->u16Length / sizeof(WCHAR), &DestPath->String.ucs2[0]));
    907907
    908     Log(("VBOXSF: vbsfRename: RemainingName->Length = %d\n", RemainingName->Length));
    909     Status = vbsfShflStringFromUnicodeAlloc(&SrcPath, RemainingName->Buffer, RemainingName->Length);
     908    Log(("VBOXSF: vbsfNtRename: RemainingName->Length = %d\n", RemainingName->Length));
     909    Status = vbsfNtShflStringFromUnicodeAlloc(&SrcPath, RemainingName->Buffer, RemainingName->Length);
    910910    if (Status != STATUS_SUCCESS)
    911911    {
    912         vbsfFreeNonPagedMem(DestPath);
     912        vbsfNtFreeNonPagedMem(DestPath);
    913913        return Status;
    914914    }
    915915
    916     Log(("VBOXSF: vbsfRename: Source path = %.*ls\n",
     916    Log(("VBOXSF: vbsfNtRename: Source path = %.*ls\n",
    917917         SrcPath->u16Length / sizeof(WCHAR), &SrcPath->String.ucs2[0]));
    918918
     
    922922        flags |= SHFL_RENAME_REPLACE_IF_EXISTS;
    923923
    924     Log(("VBOXSF: vbsfRename: Calling VbglR0SfRename\n"));
     924    Log(("VBOXSF: vbsfNtRename: Calling VbglR0SfRename\n"));
    925925    vrc = VbglR0SfRename(&g_SfClient, &pNetRootExtension->map, SrcPath, DestPath, flags);
    926926
    927     vbsfFreeNonPagedMem(SrcPath);
    928     vbsfFreeNonPagedMem(DestPath);
    929 
    930     Status = VBoxErrorToNTStatus(vrc);
     927    vbsfNtFreeNonPagedMem(SrcPath);
     928    vbsfNtFreeNonPagedMem(DestPath);
     929
     930    Status = vbsfNtVBoxStatusToNt(vrc);
    931931    if (vrc != VINF_SUCCESS)
    932         Log(("VBOXSF: vbsfRename: VbglR0SfRename failed with %Rrc\n", vrc));
    933 
    934     Log(("VBOXSF: vbsfRename: Returned 0x%08X\n", Status));
     932        Log(("VBOXSF: vbsfNtRename: VbglR0SfRename failed with %Rrc\n", vrc));
     933
     934    Log(("VBOXSF: vbsfNtRename: Returned 0x%08X\n", Status));
    935935    return Status;
    936936}
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