- /* copy all OBJECT_DIRECTORY_INFORMATION structures to the buffer and
- just append all strings (whose pointers are stored in the buffer!)
- and replace the pointers */
- for(DirInfo = (POBJECT_DIRECTORY_INFORMATION)TemporaryBuffer;
- nDirectories > 0;
- nDirectories--, DirInfo++, DestDirInfo++)
- {
- if(DirInfo->ObjectName.Length > 0)
- {
- DestDirInfo->ObjectName.Length = DirInfo->ObjectName.Length;
- DestDirInfo->ObjectName.MaximumLength = DirInfo->ObjectName.MaximumLength;
- DestDirInfo->ObjectName.Buffer = strbuf;
- RtlCopyMemory(strbuf,
- DirInfo->ObjectName.Buffer,
- DirInfo->ObjectName.Length);
- /* NULL-terminate the string */
- strbuf[DirInfo->ObjectName.Length / sizeof(WCHAR)] = L'\0';
- strbuf += (DirInfo->ObjectName.Length / sizeof(WCHAR)) + 1;
- }
-
- DestDirInfo->ObjectTypeName.Length = DirInfo->ObjectTypeName.Length;
- DestDirInfo->ObjectTypeName.MaximumLength = DirInfo->ObjectTypeName.MaximumLength;
- DestDirInfo->ObjectTypeName.Buffer = strbuf;
- RtlCopyMemory(strbuf,
- DirInfo->ObjectTypeName.Buffer,
- DirInfo->ObjectTypeName.Length);
- /* NULL-terminate the string */
- strbuf[DirInfo->ObjectTypeName.Length / sizeof(WCHAR)] = L'\0';
- strbuf += (DirInfo->ObjectTypeName.Length / sizeof(WCHAR)) + 1;
- }