0 needs to be an allowed value, and negative values should not halt the program but just return EINVAL. This behavior has been observed with the following python script: ```python import ctypes ucrt = ctypes.CDLL("ucrtbase.dll") buf = ctypes.create_string_buffer(26) for i in [1, 0, -1]: print(f"_ctime64_s for time {i}:") t = ctypes.c_int64(i) err = ucrt._ctime64_s(buf, ctypes.c_size_t(26), ctypes.byref(t)) if err == 0: print(buf.value.decode()) else: print(f"Error: {err}") for i in [1, 0, -1]: print(f"_ctime32_s for time {i}:") t = ctypes.c_int32(i) err = ucrt._ctime32_s(buf, ctypes.c_size_t(26), ctypes.byref(t)) if err == 0: print(buf.value.decode()) else: print(f"Error: {err}") # _ctime64_s for time 1: # Thu Jan 1 01:00:01 1970 # # _ctime64_s for time 0: # Thu Jan 1 01:00:00 1970 # # _ctime64_s for time -1: # Error: 22 # # _ctime32_s for time 1: # Thu Jan 1 01:00:01 1970 # # _ctime32_s for time 0: # Thu Jan 1 01:00:00 1970 # # _ctime32_s for time -1: # Error: 22 ``` The bug https://bugs.winehq.org/show_bug.cgi?id=57261 is solved by this, because mongodb tries to pretty-print a 0 timestamp, and sets up its own invalid_parameter_handler, which crashes due to NULL arguments. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10785