76 Commits

Author SHA1 Message Date
9dd65bc70a More msvcrt (WIP quality) and various fixes 2025-09-29 20:07:19 -06:00
f09e6a3986 Reimplement GetFullPathName and GetCurrentDirectory 2025-09-29 15:22:55 -06:00
d69fc8a422 Implement kernel32 Heap* funcs using mimalloc 2025-09-29 14:54:38 -06:00
c17953b318 Refactor main module resolution & HMODULE handle behavior 2025-09-29 13:50:27 -06:00
4a2ba45620 Resolve own absolute path for subprocess spawn 2025-09-29 09:25:57 -06:00
195f6c1408 Un-stub FileTime functions; impl TerminateProcess, HeapDestroy 2025-09-29 09:25:19 -06:00
f941a1e642 Initial threading support & more impls for compilers 2025-09-28 22:44:35 -06:00
8884c9597e Merge remote-tracking branch 'origin/main' into dll 2025-09-28 20:40:26 -06:00
1c35da4801 Implement GetComputerNameW 2025-09-28 19:52:15 -06:00
bc33bae659 Formatting, fixes, deduplication 2025-09-28 17:00:38 -06:00
2732bd584a More msvcrt impls for Ubuntu mingw 2025-09-28 15:09:13 -06:00
b53ae15c82 Force builtin lmgr stub and stub missing imports 2025-09-26 19:59:58 -06:00
f23224bbcc cl.exe works! but I didn't review most of this code 2025-09-26 17:38:24 -06:00
b4ea1da959 Improve DLL loading and process launch handling 2025-09-26 15:04:55 -06:00
042a43ced1 DLL fixes; impl GetSystemInfo, __dllonexit, and more 2025-09-26 13:30:39 -06:00
b5da26aa48 msvcrt: Clean up __wgetmainargs, _wdupenv_s, _wgetenv_s; add __getmainargs 2025-09-26 11:40:36 -06:00
01ddf95d36 Add proper resource implementation 2025-09-26 01:51:25 -06:00
720e6639a9 Return ERROR_RESOURCE_DATA_NOT_FOUND if open_resource_stream fails 2025-09-26 01:16:52 -06:00
836f485d66 Initial external DLL support 2025-09-26 00:55:35 -06:00
rjkiv
6f81e707ed file ops 2025-09-01 14:59:03 -07:00
c80b7cb3d0
Integrate mimalloc (#88) 2025-08-15 10:03:13 -06:00
rjkiv
da17dd573d bug fixes 2025-08-10 10:15:14 -07:00
rjkiv
f80d7dda62 FindFirstFileW 2025-08-09 14:53:56 -07:00
rjkiv
87916afc79 oops a few wchar_t's slipped through 2025-08-09 14:07:41 -07:00
rjkiv
61fa3084fb more more more 2025-08-07 14:35:39 -07:00
rjkiv
cf346634a8 use std::string over char* 2025-08-07 12:29:23 -07:00
rjkiv
92f8944cf1 implement FindResourceW and LoadResource 2025-08-07 11:23:34 -07:00
rjkiv
9324825d04 why segfaulting lmao 2025-08-06 12:52:09 -07:00
rjkiv
3f5b1c3767 use wideStringToString 2025-08-06 11:47:04 -07:00
rjkiv
ca647d32e7 get a lil farther (segfaulting again lol) 2025-08-06 11:38:10 -07:00
rjkiv
a045fd0b9e a few more funcs 2025-08-06 11:21:33 -07:00
pixel-stuck
0320efcda2 properly implement GetModuleFileNameW 2025-08-04 17:10:52 -04:00
rjkiv
dc2ad0d678 more cl funcs 2025-08-04 10:53:35 -07:00
rjkiv
78f4d534df
Add InterlockedCompareExchange (#85) 2025-07-27 10:29:38 +02:00
rjkiv
d88a4c9530 un-atomicize 2025-07-26 21:26:14 -07:00
rjkiv
57cb392654 add interlockedcompareexchange 2025-07-26 21:15:49 -07:00
Dávid Balatoni
8bd112f0e4
Add GetTempFileNameA (#84) 2025-06-18 00:12:39 +02:00
Howard Luck
c01d9a25b9
findNextFile improvement (#82)
* move empty pattern check into while loop

* early return if pattern is empty

* comment
2025-06-01 22:22:17 +09:00
Pheenoh
93862405ed
move empty pattern check into while loop (#81) 2024-08-19 21:00:15 -06:00
Exant64
bcc6eae470
Added quotation mark check in files::pathFromWindows (#77)
* Added quotation mark check in files::pathFromWindows

* Moved quotation mark logic to createprocess argument processing code
2024-07-23 00:29:47 -06:00
Parker
701134e596
fix (#80) 2024-07-23 00:27:03 -06:00
Anghelo Carvajal
ca9364a0df
Add trailing periods support to FindFirstFileA (#75)
* idk

* meh

* Implement trailing periods on FindFirstFileA

* ah?

* Remove assert
2024-05-27 19:51:24 -06:00
Anghelo Carvajal
396008c593
Proper implementation for GetSystemTime and GetLocalTime (#73)
* Implement

* GetLocalTime
2024-03-23 10:56:34 -06:00
Anghelo Carvajal
0fbe87751f
Fix FindFirstFileA failing due to an empty parent and add locale LCType stubs (#71)
* Fix sn cpp.exe not finding the include paths

* str_for_LCType stubs for sn gcc as.exe
2024-03-22 22:44:53 -06:00
Mark Street
d71a902ace
Add GetTempPathA (#68)
* Add GetTempPathA

* Update dll/kernel32.cpp

Co-authored-by: Anghelo Carvajal <angheloalf95@gmail.com>

---------

Co-authored-by: Anghelo Carvajal <angheloalf95@gmail.com>
2024-02-10 22:09:28 +00:00
Mark Street
ae5b4fffaa
Add EnumSystemLocalesA stub (#63) 2023-11-26 20:04:27 +00:00
nocato
c6fa592a31
Handle dwCreationDisposition in CreateFileA to fix PSYLINK (#60)
Before this change, dwCreationDisposition parameter of CreateFileA was
ignored by wibo. However, it turns out that PSYLINK.EXE in PsyQ 4.4
sometimes depends on correct handling of that parameter.

When building overlays with PSYLINK.EXE, it sometimes opens the
resulting overlay file the second time, with OPEN_EXISTING creation
disposition (as opposed to TRUNCATE_EXISTING). Before the change,
wibo opened that file with fopen(..., "wb+") which truncated the file
even though OPEN_EXISTING (non-truncating) was requested. This affected
https://github.com/foxdieteam/mgs_reversing, where one of the overlays
(camera.bin) was built incorrectly when using wibo (worked correctly
on Windows or with wine).

This commit adds proper handling of dwCreationDisposition parameter.
The file now can be opened in truncating or non-truncating mode.
Additionally, the implementation now reacts correctly to file
existing/non-existing as specified by the requested creation disposition
mode. For example, if CreateFileA is called with OPEN_EXISTING and the
file does not exist it will set an error and not create a new file
(the previous behavior). If the file exists, it's opened in
non-truncating mode, as TRUNCATE_EXISTING or CREATE_ALWAYS is required
for truncation.

After the fix you can correctly build the whole mgs_reversing project
with wibo - tools running under wibo: ASMPSX, ASPSX, CC1PSX 4.0 & 4.4,
PSYLINK. I have NOT tested other executables apart from those.
2023-10-27 16:18:06 +09:00
Mark Street
0f8fb7f62d
Support ProDC NgcAs.exe (#57) 2023-10-22 09:11:00 +01:00
Mark Street
30ef434872
Add Fibre local storage (Fls*) functions for armcc (#55)
* Add Fibre local storage (Fls*) functions for armcc

* Update dll/kernel32.cpp

Co-authored-by: Simon Lindholm <simon.lindholm10@gmail.com>

* Update dll/kernel32.cpp

Co-authored-by: Simon Lindholm <simon.lindholm10@gmail.com>

* Update dll/kernel32.cpp

Co-authored-by: Simon Lindholm <simon.lindholm10@gmail.com>

* Update dll/kernel32.cpp

Co-authored-by: Simon Lindholm <simon.lindholm10@gmail.com>

* one more copypasta

---------

Co-authored-by: Simon Lindholm <simon.lindholm10@gmail.com>
2023-10-17 21:33:22 +01:00
EstexNT
a829d0d58b
Fix a use-after-free in CreateProcessA (#54)
Co-authored-by: Simon Lindholm <simon.lindholm10@gmail.com>
2023-10-17 19:39:28 +01:00