Update hyperlinks Use https whenever possible, and replace some outdated links.
Consistently use _WIN32 instead of __WIN32__ _WIN32 works with all compilers, while __WIN32__ is MinGW-specific. This project used __WIN32__ in files that only support MinGW, and _WIN32 in other files such as the library header and example programs. One place even used WIN32. Avoid this unnecessary complication by just always using _WIN32.
Remove support for Windows XP
win32_replacements.c: fix handle closing in win32_wglob() The handle returned by FindFirstFileW() needs to be closed by FindClose(), not by CloseHandle(). This is a very old bug, which presumably wasn't noticed before because ordinarily it just leaked the handle. However, this bug caused a SEH exception when wimlib was run under a debugger.
Improved year 2038 safety Make wimlib on 32-bit Windows year 2038 safe by doing the following: - Build both the library and program with 64-bit time_t, being careful to avoid changing the timespec struct exposed in the API. - Update wimlib's API to include an extended seconds field in wimlib_dir_entry for each timestamp, and set it when tv_sec is 32-bit. - When needing the current time, call GetSystemTimeAsFileTime() instead of MinGW's gettimeofday(). This also has the advantage that due to switching to the 64-bit time_t functions, 32-bit wimlib-imagex.exe now prints timestamps prior to year 1970 correctly. Unfortunately, despite the API improvement, we cannot at this time make wimlib fully Y2038-safe on 32-bit UNIX, due to lack of OS support.
Improve random number generation wimlib used rand() to generate random numbers, e.g. for GUIDs. This was neither cryptographically secure nor thread-safe. Use getrandom(), /dev/urandom, or RtlGenRandom() instead.
Do not use read() and write() from MSVCRT
win32_common.c: add extra error messages if pread() or pwrite() fails
Move CPU and memory information to util
Move errno translation to win32_replacements.c
win32_get_avail_memory(): Report 85% of minimum of virtual and physical memory This should be a better prediction of how much memory can actually be allocated.
Use LGPLv3+ for src/*.c
Windows replacement for fopen(path, "a")
win32_replacements.c: Remove unnecessary 'extern'
Rewrite code for capture rpfix The previous code had many potential problems on the Windows side. Targets of Windows native symbolic links (except those with SYMBOLIC_LINK_RELATIVE set) and junction points are stored in the reparse points as NT namespace paths. Therefore they can validly include prefixes like '\??\', '\DosDevices\', or '\Device\HardDiskVolume1'. They potentially do not use drive letters at all, and they may be over MAX_PATH characters. Such paths should be accessed using the native API (NtOpenFile), not Win32 (CreateFile). This commit changes the code to do so.
Remove unused win32_truncate_replacement()
win32_replacements.c: Remove unused headers
win32.h: Remove unused stuff
Adjust path matching - To get consistent behavior, always use own implementation in wildcard.c, not fnmatch() or PatchMatchSpec() - Don't store prefix in capture config - Don't allow non-rooted paths with multiple directory components (these could cause confusion) - win32_apply.c: Match [PrepopulateList] patterns recursively
win32_common.c: Remove unused writev() replacement