in first patch: - %llIu doesn't exist, I suppose you meant %llu... I'd suggest using %I64x and %I64u instead (IIRC %llu isn't supported in all versions of msvcrt on Windows)
(and yes it's a pain that mingw doesn't support __attribute__(format) for wide chars, that should have generated warnings here)