libmagic support Unicode filename with MinGW

Libmagic or a file is an awesome tools that detect the type of file by its contents not by extension.

You should read it first: Kblog: To compile libmagic with MinGW, and before: Kblog: MinGW: Porting GNU Regex to Windows.

We should make this libmagic as native as possible to windows, so we won’t use Cygwin. But, the Mingw version cannot open the file which contains unicode character. If you feed a buffer to libmagic, there will no problem. But if you tell libmagic to read from a file, the file name string cannot contain unicode character, because the default Win32 API call is the ANSI version, not WIDECHAR version. So, there should be some workaround to solve this problem. YES, it’s simply by conver all corresponding ANSI calls to WIDECHAR calls version.

Installing Windows XP without CDROM

What you Need:
1. Hiren’s BootCD, which includes: Partition Wizard, WinNTSetup
2. Windows XP Installer Disc (or ISO).

Step-by-Step:
1. Setup BIOS to boot first from USB.
2. Make bootable USB drive and fill with Hiren’s BootCD.
3. Prepare the Windows XP CD contents (may extracted from ISO) then put them at available space (on USB or on other partition on your HD).
4. Prepare free partition on HD for target OS (using Partition Wizard format NTFS and set as active)
5. Use WinNTSetup, select source from the extracted CD contents, and set target and boot to prepared NTFS partition on HD
6. After restart prompted, setup BIOS to boot first to your HD. The next stage of Windows setup should start.

This method is useful to avoid BSOD 0x0000007B if installing from USB has no clue for unknown SATA driver.