2013/8/26 Zenju <[email protected]>: > Hi, > > I'm currently testing x32-4.8.1-release-win32-dwarf-rev4 and am planning > to migrate away from the MinGW.org distribution. It all seems to work > fine except for one major showstopper: > > My application is supporting Windows XP upwards, but some Windows > features are not yet available on XP. Therefore I load them dynamically > via Win32 GetProcAddress (e.g. SetFileInformationByHandle). This works > fine except that the enums and structures required, are if-defed away by > mingw-32! > > For example: minwinbase.h: > > #if _WIN32_WINNT >= 0x0600 > typedef enum _FILE_INFO_BY_HANDLE_CLASS { > FileBasicInfo /* is zero? */, > FileStandardInfo, > FileNameInfo, > FileRenameInfo, > FileDispositionInfo, > FileAllocationInfo, > FileEndOfFileInfo, > FileStreamInfo, > FileCompressionInfo, > FileAttributeTagInfo, > FileIdBothDirectoryInfo, > FileIdBothDirectoryRestartInfo, > FileIoPriorityHintInfo, > FileRemoteProtocolInfo, > FileFullDirectoryInfo, > FileFullDirectoryRestartInfo, > #if _WIN32_WINNT >= 0x0602 > FileStorageInfo, > FileAlignmentInfo, > FileIdInfo, > FileIdExtdDirectoryInfo, > FileIdExtdDirectoryRestartInfo, > #endif > MaximumFileInfoByHandleClass > } FILE_INFO_BY_HANDLE_CLASS, *PFILE_INFO_BY_HANDLE_CLASS; > #endif > > I can't use this enum because _WIN32_WINNT is kept at the default value > 0x0502 (XP). Therefore I suggest to remove those #ifdefs from > structures, but only place them around the functions! > > Best, Zenju >
Hello Zenju, First, it is helpful that you subscribe to this ML before you post to it. Otherwise your post needs to be moderated and this might cause delay. Well, if you want to use more modern features (types, structures, etc), then you will need to define _WIN32_WINNT with proper value. Eg in your case you might want to use the compiler -D_WIN32_WINNT=0x600 option. By this you tell headers that you want to have all API setup for Vista. Of course it is then up to you to avoid direct use of none-XP API, so that your application will still work on XP OS. Regards, Kai ------------------------------------------------------------------------------ Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more! Discover the easy way to master current and previous Microsoft technologies and advance your career. Get an incredible 1,500+ hours of step-by-step tutorial videos with LearnDevNow. Subscribe today and save! http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk _______________________________________________ Mingw-w64-public mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
