Recently I have done some work to make libntfs compile under Microsoft Visual C. I have then integrated it with a small utility that I was developing. For more information, please visit: http://code.google.com/p/fastfind/
I am attaching a patch file of the changes I did. It's not meant to be applied directly to the code since it requires some cleanup or even some discussion. Below I will summarize the changes done:
support.h and compat_msvc.c (new): Changed a macro definition not supported by MSVC to an appropriate function.
logging.h: Variadic macro parameters are not supported in MSVC, so I replaced them by __noop.
layout.h:
MSVC requires #pragma pack in order to pack the structures.
Packed enums are not supported by MSVC. My best shot was to change them into typedefs.
Zero length arrays are not supported by MSVC. I have commented them out.
Empty structs are not supported. I have added something dummy as content.
Enums of 64bit width are not supported. I have not found a solution to this (except switching to C++).
config.h: Has all the extra stuff that should be declared and defined for the project to compile under MSVC.
index.c: Changed structure initializations to a more traditional format.
win32_io.c:
Added the ability to open the special file "\\.\C:".
Removed references to st_blocks since it is not defined in MSVC.
Changed structure initializations.
utils.c:
Commented out locale stuff.
BUG: in mft_next_record there is a memory leak if an MFT record is unused (there is an inode structure allocated and never freed).
Regards,
George Prekas
|