[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-ntfs-cvs
Subject:    [Linux-NTFS-cvs] CVS: linux-ntfs/ntfstools ntfsinfo.c,1.2,1.3
From:       "Matthew J. Fanto" <mattjf () users ! sourceforge ! net>
Date:       2002-05-13 3:44:12
[Download RAW message or body]


Changes by: mattjf

Update of /cvsroot/linux-ntfs/linux-ntfs/ntfstools
In directory usw-pr-cvs1:/tmp/cvs-serv3519/ntfstools

Modified Files:
	ntfsinfo.c 
Log Message:
Update code


Index: ntfsinfo.c
===================================================================
RCS file: /cvsroot/linux-ntfs/linux-ntfs/ntfstools/ntfsinfo.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -U2 -r1.2 -r1.3
--- ntfsinfo.c	11 May 2002 21:43:56 -0000	1.2
+++ ntfsinfo.c	13 May 2002 03:44:10 -0000	1.3
@@ -38,6 +38,5 @@
 #include "inode.h"
 
-void get_file_attribute_value(const char *dev, int inode);
-
+void get_file_attribute_value(const char *dev, long int i);
 
 int main(int argc, char **argv)
@@ -45,5 +44,6 @@
 	const char *AUTHOR = "Matthew J. Fanto";
 	const char *EXEC_NAME = "ntfsinfo";
-       
+        int i;
+
 	if (argc < 3 || argc > 4) {
 		fprintf(stderr, "%s v%s - %s\n", EXEC_NAME, VERSION, AUTHOR);
@@ -52,6 +52,7 @@
 	}
 
-	else 		
-		get_file_attribute_value(argv[1], (int)argv[2]);
+	else	
+		i = atol(argv[2]);
+		get_file_attribute_value(argv[1], i);
 
 	return 0;
@@ -60,6 +61,7 @@
 
 
-void get_file_attribute_value(const char *dev, int i)
+void get_file_attribute_value(const char *dev, long int i)
 {
+
 	MFT_REF mref;
 	MFT_RECORD *mrec = NULL;
@@ -77,5 +79,5 @@
 	inode = ntfs_open_inode(vol,mref);
 
-	if(ntfs_read_file_record(vol,NULL,&mrec,NULL)){
+	if(ntfs_read_file_record(vol,mref,&mrec,NULL)){
 		perror("Error reading file record!\n");
 		exit(1);
@@ -93,9 +95,9 @@
 	file_name_attr = (FILE_NAME_ATTR*)((char*)attr + le16_to_cpu(attr->value_offset));
 	
-
-	file_name = malloc(sizeof(uchar_t)*file_name_attr->file_name_length);
-	file_name = &file_name_attr->file_name;
-	printf("%s\n",file_name);
-					   
+	ntfs_mbstoucs(file_name_attr->file_name,&file_name,0);
 	
+	printf("%s\n",file_name);
+
+
+
 }


_______________________________________________________________

Have big pipes? SourceForge.net is looking for download mirrors. We supply
the hardware. You get the recognition. Email Us: bandwidth@sourceforge.net
_______________________________________________
Linux-NTFS-cvs mailing list
Linux-NTFS-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-ntfs-cvs
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic