Changeset 105875 in vbox for trunk/src/VBox
- Timestamp:
- Aug 27, 2024 3:52:45 PM (3 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxService/VBoxServiceControlSession.cpp
r104565 r105875 1068 1068 { 1069 1069 pDir->pszPathAbs = RTStrDup(szPath); 1070 if (!pDir->pszPathAbs) 1070 if (pDir->pszPathAbs) 1071 { 1072 /* Save reading parameters for subsequent directory entry read calls later. */ 1073 pDir->fRead = fReadFlags; 1074 pDir->enmReadAttrAdd = enmAttrAdd; 1075 1076 pDir->cbDirEntryEx = GSTCTL_DIRENTRY_MAX_SIZE; 1077 pDir->pDirEntryEx = (PRTDIRENTRYEX)RTMemAlloc(pDir->cbDirEntryEx); 1078 if (pDir->pDirEntryEx) 1079 { 1080 rc = RTDirOpenFiltered(&pDir->hDir, pDir->pszPathAbs, (RTDIRFILTER)enmFilter, fFlags); 1081 if (RT_SUCCESS(rc)) 1082 { 1083 uHandle = VBOX_GUESTCTRL_CONTEXTID_GET_OBJECT(pHostCtx->uContextID); 1084 pDir->uHandle = uHandle; 1085 RTListAppend(&pSession->lstDirs, &pDir->Node); 1086 VGSvcVerbose(2, "[Dir %s] Opened (ID=%RU32)\n", pDir->pszPathAbs, pDir->uHandle); 1087 } 1088 } 1089 else 1090 rc = VERR_NO_MEMORY; 1091 } 1092 else 1071 1093 rc = VERR_NO_MEMORY; 1072 1073 /* Save reading parameters for subsequent directory entry read calls later. */1074 pDir->fRead = fReadFlags;1075 pDir->enmReadAttrAdd = enmAttrAdd;1076 1077 pDir->cbDirEntryEx = GSTCTL_DIRENTRY_MAX_SIZE;1078 pDir->pDirEntryEx = (PRTDIRENTRYEX)RTMemAlloc(pDir->cbDirEntryEx);1079 AssertPtrReturn(pDir->pDirEntryEx, VERR_NO_MEMORY);1080 1081 if (RT_SUCCESS(rc))1082 {1083 rc = RTDirOpenFiltered(&pDir->hDir, pDir->pszPathAbs, (RTDIRFILTER)enmFilter, fFlags);1084 if (RT_SUCCESS(rc))1085 {1086 uHandle = VBOX_GUESTCTRL_CONTEXTID_GET_OBJECT(pHostCtx->uContextID);1087 pDir->uHandle = uHandle;1088 RTListAppend(&pSession->lstDirs, &pDir->Node);1089 VGSvcVerbose(2, "[Dir %s] Opened (ID=%RU32)\n", pDir->pszPathAbs, pDir->uHandle);1090 }1091 }1092 1094 } 1093 1095 else … … 1101 1103 { 1102 1104 RTStrFree(pDir->pszPathAbs); 1105 pDir->pszPathAbs = NULL; 1103 1106 if (pDir->hDir != NIL_RTDIR) 1104 1107 RTDirClose(pDir->hDir); 1105 1108 RTMemFree(pDir); 1109 pDir = NULL; 1106 1110 } 1107 1111
Note:
See TracChangeset
for help on using the changeset viewer.