#include "captive/storage.h"
#include "captive/signal.h" /* for captive_signal_init() */
#include "reactos/ddk/psfuncs.h" /* for PsGetCurrentThread() */
+#include <stdio.h>
/* Are we initialized? */
gboolean errbool;
OBJECT_ATTRIBUTES root_ObjectAttributes;
IO_STATUS_BLOCK root_IoStatusBlock;
-#if 0
-FILE_ID_BOTH_DIR_INFORMATION *FileIdBothDirInformation;
-#endif
+FILE_ID_BOTH_DIR_INFORMATION *FileIdBothDirInformation,*FileIdBothDirInformation_next;
char QueryDirectory_buf[0x10000];
#ifdef MAINTAINER_MODE
g_return_val_if_fail(NT_SUCCESS(err),FALSE);
g_return_val_if_fail(NT_SUCCESS(root_IoStatusBlock.Status),FALSE);
+ for (FileIdBothDirInformation=(gpointer)QueryDirectory_buf;
+ (gpointer)FileIdBothDirInformation < (gpointer)(QueryDirectory_buf+root_IoStatusBlock.Information);
+ FileIdBothDirInformation=FileIdBothDirInformation_next) {
+gint i;
+
+ FileIdBothDirInformation_next=(gpointer)(((char *)FileIdBothDirInformation)+FileIdBothDirInformation->NextEntryOffset);
+ /* do not exceed the returned buffer by this record */
+ g_assert((gpointer)FileIdBothDirInformation_next<=(gpointer)(QueryDirectory_buf+root_IoStatusBlock.Information));
+
+ printf("@%ld: FileIndex=%lu,EndOfFile=%lld,AllocationSize=%lld,FileId=0x%llX,",
+ (long)(((char *)FileIdBothDirInformation)-((char *)QueryDirectory_buf)), /* @%ld */
+ FileIdBothDirInformation->FileIndex,
+ FileIdBothDirInformation->EndOfFile.QuadPart,
+ FileIdBothDirInformation->AllocationSize.QuadPart,
+ (unsigned long long)FileIdBothDirInformation->FileId.QuadPart);
+ printf("ShortName=\"");
+ g_assert((FileIdBothDirInformation->ShortNameLength%sizeof(*FileIdBothDirInformation->ShortName))==0);
+ for (i=0;(unsigned)i<FileIdBothDirInformation->ShortNameLength/sizeof(*FileIdBothDirInformation->ShortName);i++) {
+gunichar uc=FileIdBothDirInformation->ShortName[i];
+
+ if (g_unichar_isprint(uc) && uc<=0xFF)
+ putchar(uc);
+ else
+ printf("[0x%X]",(unsigned)uc);
+ }
+ printf("\",");
+ printf("FileName: ");
+ g_assert((FileIdBothDirInformation->FileNameLength)%sizeof(*FileIdBothDirInformation->FileName)==0);
+ for (i=0;(unsigned)i<FileIdBothDirInformation->FileNameLength/sizeof(*FileIdBothDirInformation->FileName);i++) {
+gunichar uc=FileIdBothDirInformation->FileName[i];
+
+ if (g_unichar_isprint(uc) && uc<=0xFF)
+ putchar(uc);
+ else
+ printf("[0x%X]",(unsigned)uc);
+ }
+ printf("\n");
+ /* Last entry may be also marked by: 0==FileIdBothDirInformation->NextEntryOffset */
+ if (FileIdBothDirInformation_next==FileIdBothDirInformation)
+ break;
+ }
+
active=TRUE;
return TRUE;