public Nullable <ArchivePathInfo> getArchivePathsAt(UInt32 index) { RetCode ret; ArchivePathInfo pathInfo = new ArchivePathInfo(); pathInfo.pathName = new String(' ', Convert.ToInt32(maxArchivepathLen)); ret = getArchivePath(index, ref pathInfo, maxArchivepathLen); switch (ret) { case RetCode.NoError: return(pathInfo); break; case RetCode.IndexOutOfRange: return(null); break; default: Auxiliary.Logger._log.Error("Can't get archive paths :" + ret); throw new System.Exception("Error: polling archive paths"); break; } }
// deprecated public List <ArchivePathInfo> getArchivePaths() { List <ArchivePathInfo> pathInfoList = new List <ArchivePathInfo>(); UInt32 index = 0; RetCode ret; bool needPollMore = true; while (needPollMore) { ArchivePathInfo pathInfo = new ArchivePathInfo(); pathInfo.pathName = new String(' ', Convert.ToInt32(maxArchivepathLen)); ret = getArchivePath(index, ref pathInfo, maxCryptoProvderLength); switch (ret) { case RetCode.NoError: pathInfoList.Add(pathInfo); break; case RetCode.IndexOutOfRange: needPollMore = false; break; default: Auxiliary.Logger._log.Error("Can't get archive paths :" + ret); throw new System.Exception("Error: polling archive paths"); break; } index++; } return(pathInfoList); }
static extern RetCode getArchivePath(UInt32 index, ref ArchivePathInfo pathInFo, UInt64 pathnameBufferSize);