Lines Matching defs:pDir

82 int rtDirNativeOpen(PRTDIR pDir, char *pszPathBuf)
88 pDir->pNtFilterStr = NULL;
89 if ( pDir->cchFilter > 0
90 && pDir->enmFilter == RTDIRFILTER_WINNT)
93 rc = RTStrToUtf16(pDir->pszFilter, &pwszTmp);
96 pDir->NtFilterStr.Buffer = pwszTmp;
97 pDir->NtFilterStr.Length = pDir->NtFilterStr.MaximumLength = (uint16_t)(RTUtf16Len(pwszTmp) * sizeof(RTUTF16));
98 pDir->pNtFilterStr = &pDir->NtFilterStr;
112 &pDir->hDir,
124 pDir->fDataUnread = false; /* spelling it out */
127 pDir->enmInfoClass = FileMaximumInformation; /* object directory. */
134 RTDECL(int) RTDirClose(PRTDIR pDir)
139 if (!pDir)
141 if (pDir->u32Magic != RTDIR_MAGIC)
143 AssertMsgFailed(("Invalid pDir=%p\n", pDir));
150 pDir->u32Magic = ~RTDIR_MAGIC;
151 if (pDir->hDir != RTNT_INVALID_HANDLE_VALUE)
153 int rc = RTNtPathClose(pDir->hDir);
155 pDir->hDir = RTNT_INVALID_HANDLE_VALUE;
157 RTStrFree(pDir->pszName);
158 pDir->pszName = NULL;
159 RTUtf16Free(pDir->NtFilterStr.Buffer);
160 pDir->NtFilterStr.Buffer = NULL;
161 RTMemFree(pDir->pabBuffer);
162 pDir->pabBuffer = NULL;
163 RTMemFree(pDir);
426 RTDECL(int) RTDirRead(PRTDIR pDir, PRTDIRENTRY pDirEntry, size_t *pcbDirEntry)
433 AssertPtrReturn(pDir, VERR_INVALID_POINTER);
434 AssertReturn(pDir->u32Magic == RTDIR_MAGIC, VERR_INVALID_HANDLE);
448 if (!pDir->fDataUnread)
450 rc = rtDirNtFetchMore(pDir);
458 rc = rtDirNtConvertCurName(pDir);
465 const char *pszName = pDir->pszName;
466 const size_t cchName = pDir->cchName;
479 pDirEntry->INodeId = pDir->enmInfoClass == FileIdBothDirectoryInformation
480 ? pDir->uCurData.pBothId->FileId.QuadPart : 0;
483 if (pDir->enmInfoClass != FileMaximumInformation)
486 switch ( pDir->uCurData.pBoth->FileAttributes
509 if (rtNtCompWideStrAndAscii(pDir->uCurData.pObjDir->TypeName.Buffer, pDir->uCurData.pObjDir->TypeName.Length,
512 else if (rtNtCompWideStrAndAscii(pDir->uCurData.pObjDir->TypeName.Buffer, pDir->uCurData.pObjDir->TypeName.Length,
518 return rtDirNtAdvanceBuffer(pDir);
522 RTDECL(int) RTDirReadEx(PRTDIR pDir, PRTDIRENTRYEX pDirEntry, size_t *pcbDirEntry,
530 AssertPtrReturn(pDir, VERR_INVALID_POINTER);
531 AssertReturn(pDir->u32Magic == RTDIR_MAGIC, VERR_INVALID_HANDLE);
550 if (!pDir->fDataUnread)
552 rc = rtDirNtFetchMore(pDir);
560 rc = rtDirNtConvertCurName(pDir);
567 const char *pszName = pDir->pszName;
568 const size_t cchName = pDir->cchName;
578 PFILE_BOTH_DIR_INFORMATION pBoth = pDir->uCurData.pBoth;
584 if (pDir->enmInfoClass != FileMaximumInformation)
620 if (rtNtCompWideStrAndAscii(pDir->uCurData.pObjDir->TypeName.Buffer, pDir->uCurData.pObjDir->TypeName.Length,
623 else if (rtNtCompWideStrAndAscii(pDir->uCurData.pObjDir->TypeName.Buffer, pDir->uCurData.pObjDir->TypeName.Length,
626 else if (rtNtCompWideStrAndAscii(pDir->uCurData.pObjDir->TypeName.Buffer, pDir->uCurData.pObjDir->TypeName.Length,
642 if (pDir->enmInfoClass == FileMaximumInformation)
695 return rtDirNtAdvanceBuffer(pDir);