}
if (mask & (GNOME_VFS_SET_FILE_INFO_PERMISSIONS | GNOME_VFS_SET_FILE_INFO_TIME)) {
-FILE_BASIC_INFORMATION FileBasicInformation_struct;
+char FileBasicInformation_buf[sizeof(FILE_BASIC_INFORMATION)+4];
+FILE_BASIC_INFORMATION *FileBasicInformationp=(FILE_BASIC_INFORMATION *)FileBasicInformation_buf;
IO_STATUS_BLOCK file_IoStatusBlock;
NTSTATUS err;
+ /* FIXME: Everywhere is is the declaration with 4xLARGE_INTEGER+1xULONG==36 bytes
+ * but the precompiled ext2fsd.sys wants 40 bytes - why?
+ */
+ g_assert(sizeof(FILE_BASIC_INFORMATION)==36);
+ g_assert(sizeof(FileBasicInformation_buf)==40);
err=NtQueryInformationFile(
captive_file_object->file_Handle, /* FileHandle */
&file_IoStatusBlock, /* IoStatusBlock */
- &FileBasicInformation_struct, /* FileInformation */
- sizeof(FileBasicInformation_struct), /* Length */
+ FileBasicInformation_buf, /* FileInformation */
+ sizeof(FileBasicInformation_buf), /* Length */
FileBasicInformation); /* FileInformationClass */
g_return_val_if_fail(NT_SUCCESS(err),GNOME_VFS_ERROR_GENERIC);
if (mask & GNOME_VFS_SET_FILE_INFO_PERMISSIONS) {
- FileBasicInformation_struct.FileAttributes&=~FILE_ATTRIBUTE_READONLY;
+ FileBasicInformationp->FileAttributes&=~FILE_ATTRIBUTE_READONLY;
g_assert(info->valid_fields & GNOME_VFS_FILE_INFO_FIELDS_PERMISSIONS);
if (!(info->permissions&0200))
- FileBasicInformation_struct.FileAttributes|=FILE_ATTRIBUTE_READONLY;
+ FileBasicInformationp->FileAttributes|=FILE_ATTRIBUTE_READONLY;
}
if (mask & GNOME_VFS_SET_FILE_INFO_TIME) {
if (info->valid_fields&GNOME_VFS_FILE_INFO_FIELDS_ATIME) {
RtlSecondsSince1970ToTime(
info->atime, /* SecondsSince1970 */
- &FileBasicInformation_struct.LastAccessTime); /* Time */
+ &FileBasicInformationp->LastAccessTime); /* Time */
}
if (info->valid_fields&GNOME_VFS_FILE_INFO_FIELDS_MTIME) {
RtlSecondsSince1970ToTime(
info->mtime, /* SecondsSince1970 */
- &FileBasicInformation_struct.LastWriteTime); /* Time */
- FileBasicInformation_struct.ChangeTime=FileBasicInformation_struct.LastWriteTime;
+ &FileBasicInformationp->LastWriteTime); /* Time */
+ FileBasicInformationp->ChangeTime=FileBasicInformationp->LastWriteTime;
}
if (info->valid_fields&GNOME_VFS_FILE_INFO_FIELDS_CTIME) {
RtlSecondsSince1970ToTime(
info->ctime, /* SecondsSince1970 */
- &FileBasicInformation_struct.CreationTime); /* Time */
+ &FileBasicInformationp->CreationTime); /* Time */
}
}
err=NtSetInformationFile(
captive_file_object->file_Handle, /* FileHandle */
&file_IoStatusBlock, /* IoStatusBlock */
- &FileBasicInformation_struct, /* FileInformation */
- sizeof(FileBasicInformation_struct), /* Length */
+ FileBasicInformation_buf, /* FileInformation */
+ sizeof(FileBasicInformation_buf), /* Length */
FileBasicInformation); /* FileInformationClass */
g_return_val_if_fail(NT_SUCCESS(err),GNOME_VFS_ERROR_GENERIC);
}