Commit Graph

1327 Commits

Author SHA1 Message Date
Silent
9205a6b062 [Kernel] Fixup GetProcAddressByOrdinal
Now properly takes a global lock when populating guest_trampoline_map_
as opposed to taking and immediately releasing it
Also removes a redundant find() from guest_trampoline_map_
so map is not searched twice if the function has already been generated.
2020-04-12 21:53:46 -05:00
gibbed
e0f3458026 [Kernel] Maybe stub DmGetXbeInfo better. 2020-04-09 17:54:40 -05:00
gibbed
fe016cc60c [Kernel] Fix vswprintf debug log. 2020-04-09 17:54:22 -05:00
gibbed
15866274a8 [Kernel] Stub a few more XBDM functions. 2020-04-09 16:59:37 -05:00
gibbed
ed04d96e67 Avoid using '#' format spec for X hex numbers.
Avoid using '#' format spec for X (uppercase) hex numbers, as it
results in output like "0XABCDEF" instead of "0xABCDEF".
2020-04-09 11:25:08 -05:00
Sandy Carter
e605eef781 filesystem: remove unused includes of header 2020-04-09 09:44:48 -05:00
Sandy Carter
df65de231f filesystem: use std for DeleteFolder
Remove custom platform implementation of `DeleteFolder` and replace two
uses with `std::filesystem::remove_all` which removes a file or
directory with all its contents.
2020-04-09 09:44:48 -05:00
Sandy Carter
69bcf59c79 filesystem: use std for CreateFolder
Remove custom platform implementation of `CreateFolder` and replace uses
with `std::filesystem::create_directories` which creates paths
recursively.
2020-04-09 09:44:48 -05:00
Sandy Carter
c8e64da4eb filesystem: use std for PathExists
Remove custom platform implementation of `PathExists` and replace uses
with `std::filesystem::exists`.
2020-04-09 09:44:48 -05:00
gibbed
c51cba080b Fix some bad string formats. 2020-04-08 13:05:37 -05:00
gibbed
a48bb71c2f Overhaul logging. 2020-04-07 16:09:41 -05:00
gibbed
5bf0b34445 C++17ification.
C++17ification!

- Filesystem interaction now uses std::filesystem::path.
- Usage of const char*, std::string have been changed to
  std::string_view where appropriate.
- Usage of printf-style functions changed to use fmt.
2020-04-07 16:09:41 -05:00
Triang3l
821a9897ef [Kernel/XAM] Even more detailed rationale for XNotifyGetNext param_ptr null check 2020-03-23 10:46:51 +03:00
Triang3l
61bcd467a6 [Kernel/XAM] Rationale for XNotifyGetNext param_ptr null check 2020-03-23 10:38:45 +03:00
Gliniak
4f8cdd9967 [Kernel/XAM] XNotifyGetNext: Check for nullptr for param_ptr 2020-03-22 15:38:31 -05:00
Gliniak
5558c8aafe [XAM/Network] Implemented NetDll___WSAFDIsSet 2020-03-03 17:07:49 -06:00
gibbed
8d5d70c77f [XAM] Don't allow an empty title.
[XAM] Don't allow an empty titles because ImGui explodes otherwise.
2020-02-29 15:47:19 -06:00
emoose
9185cdcc79 [Kernel] Fix wide-printf functions not processing %ws format correctly
This would break format strings like memory://%.*ws (that dashboard tries using), because the "ws" part would set FF_IsWide, but FF_IsWide actually seemed to be used as an "is opposite encoding" flag.
Since the format string is wide that'd make it treat the param as ASCII, but in dashboards case the param string provided is actually a wide string.
(in other words, it seems %ws is supposed to mean that the param is always a wide string, not that the param is just opposite encoding)

This changes the old FF_IsWide to FF_InvertWide, and adds a new FF_IsWide that means that the param is always wide.
2020-02-24 14:58:09 -06:00
emoose
ac5d548e90 [Kernel] *FormatData: make peek() match get() endian, fix skip() not advancing pointer 2020-02-24 14:58:09 -06:00
Triang3l
cf99696e79 [Kernel] Fix incorrect TranslatePhysical usage in XFile 2020-02-23 14:51:49 +03:00
gibbed
a6e6f0f7bf Lint cleanup. 2020-02-22 13:29:07 -06:00
Triang3l
1e9f999b37 [Kernel] Add xe:: in XFile::Read for consistency 2020-02-22 18:10:25 +03:00
Triang3l
f858631245 [Kernel] Trigger memory callbacks after file read 2020-02-22 18:06:56 +03:00
Triang3l
028c784c5c [Memory] Make heap_size actually mean size rather than high address 2020-02-22 14:55:28 +03:00
gibbed
722018d095 [Kernel] Use reserved form of sc for dynamic imports. 2020-02-20 01:01:31 -06:00
Triang3l
8ec813de82 [Memory, D3D12] Various refactoring from data provider development 2020-02-15 21:35:24 +03:00
Gliniak
d241a98189 [Kernel] Rewrote ObReferenceObjectByHandle 2020-02-10 20:52:23 -06:00
gibbed
74c95c64d2 [Kernel] Ignore page size with base addr allocs.
Changes NtAllocateVirtualMemory so that it ignores specified page size when a
base address is specified.

Fixes a crash seen in N3 demo boot.
2020-02-09 06:54:27 -06:00
Silent
38bf6c8822 [Kernel] Make XexUnloadImage fully release the image
Previously XexUnloadImage did not cleanup the image fully,
and if XexLoadImage was to be called again on the same module,
it was not initialized fully, leading to a crash when using it.
2020-01-27 06:35:10 -06:00
Silent
9d48e904da [Kernel] (Partially) fix module refcounting
.xex module handles were retained twice in several places,
possibly causing them to leak.
More placed may have to be fixed too.
2020-01-27 06:35:10 -06:00
Silent
f278e30d21 [Kernel] Fix SHA1 and SHA256 state endianness
Fixes malfunctioning SHA256 hash,
corrupting its state between Update and Finish calls.
2020-01-27 06:33:39 -06:00
Joel Linn
7e244e0488 [Base] Clock state now unaltered by threading.
- Removed tick and time values from ThreadSavedState.
- Removed affiliated get/set code from Save and Restore.
- Removed dangerous SetGuestTickCount method.
2019-12-01 17:11:58 -06:00
Silent
c5db959154 [Kernel] Retain handles and not objects in XThread
This fixes cases introduced by 52e836d0f81e752ba368717e68773b591adfa9cf
where thread handles get closed before the thread finishes.
Handle was assumed to be alive there, which was not true as
threads self-referenced only their objects, not their handles.

Affected games: Payday 2 Demo
2019-11-30 20:08:30 -06:00
Silent
728531eff7 [Kernel] Operate on handle refcounts in Ob funcs
Although this seems counter-intuitive, operating on handle
reference counters in
- ObLookupThreadByThreadId
- ObReferenceObjectByHandle
- ObDereferenceObject
allows to cleanly clean up handles for resources created elsewhere
and destructed by ObDereferenceObject (for example, threads with 0x80
creation flag). Operating on pointer reference counters alone
would leave a stray handle in the slots list.
2019-11-30 20:08:30 -06:00
Silent
05ef022fd7 [Kernel] Do not retain handle in ExCreateThread
Closing the thread handle should delete the thread object
if it's finished. When this handle was retained, closing the handle
left a lingering handle reference and thus this XThread would leak
2019-11-30 20:08:30 -06:00
Silent
5bec69e983 [Kernel] Add some useful asserts 2019-11-30 20:08:30 -06:00
aerosoul
bc8b629092 [Kernel] Enable XEX1 loading 2019-11-20 18:09:28 -06:00
Triang3l
8ba6f3fc37 [Memory] Trigger watches when making pages writable, not the other way around 2019-11-10 14:21:36 +03:00
gibbed
c19a052b96 [XAM] Don't use strncpy for XamUserGetName. 2019-09-12 03:41:02 -05:00
gibbed
b422ed750b Oops. Didn't mean to add that yet. 2019-09-04 23:16:06 -05:00
gibbed
2780e7b1a6 Add user_country cvar, rename game_language cvar.
- [Kernel] Rename game_language cvar to user_language.
- [Kernel] Recategorize user_language to XConfig.
- [Kernel] Add user_country cvar, used instead of hardcoded value in XConfig.
- [XAM] Use user_country cvar for xeXamGetLocaleEx instead of
  xeExGetXConfigSetting.
2019-09-04 23:02:55 -05:00
gibbed
4f4b83b421 [Kernel] Move ExGetXConfigSetting to its own file.
- [Kernel] Clean up xboxkrnl registration function declarations.
- [Kernel] Move ExGetXConfigSetting to its own file.
2019-09-04 23:02:55 -05:00
gibbed
d58544b406 [XAM] Fix incomplete locale tables. 2019-09-04 23:02:55 -05:00
gibbed
858923898f [XAM] Implement a number of language/locale related functions.
[XAM] Implement XamGetLocale, XamGetOnlineCountryFromLocale,
  XamGetOnlineCountryString, XamGetCountryString, XamGetLanguageString,
  XamGetLanguageLocaleString, XamGetOnlineLanguageAndCountryString,
  XamGetLocaleString, XamGetLocaleFromOnlineCountry,
  XamGetLanguageFromOnlineLanguage, XamGetOnlineLanguageString,
  XamGetCountryFromOnlineCountry, and XamGetLocaleEx.
2019-09-04 20:03:25 -05:00
Triang3l
803fa0cba9 [Kernel] Fix TranslateUnicodeString endian and size 2019-08-28 09:20:10 +03:00
Triang3l
0ad1bd9ab4 [Kernel] XMAInitializeContext physical buffer addresses 2019-08-28 08:11:43 +03:00
Triang3l
2f51949ece [Kernel] Cya l8r recently added wrong XMAInitializeContext comment 2019-08-27 23:53:06 +03:00
Triang3l
9df39e4883 [Kernel] Fix StoreXmaContextIndexedRegister, note about physical addresses in XMAInitializeContext 2019-08-27 23:50:30 +03:00
Triang3l
a422166123 [Kernel] Fix MmAllocatePhysicalMemoryEx range base 2019-08-24 19:23:31 +03:00
Triang3l
7e6bf8022f [Memory] Refactor GetPhysicalAddress and use it for XMA, resolve #1448 2019-08-24 17:42:06 +03:00