Commit Graph

1312 Commits

Author SHA1 Message Date
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
emoose
f46e3c7e39 [Kernel/VFS] Ensure vfs::Entry is up-to-date before retrieving file information
Games like Forza use NtQueryInformationFile to get the size of the file, to make sure that there's enough room inside it to write data.

Previously, updating the file size (via SetInfoFile(EndOfFile) or WriteFile) wouldn't update the vfs::Entry size field, which NtQueryInfo uses to return the size of the file.

This resulted in the game thinking that the file was smaller than it actually is, and trying to correct that by using SetInfoFile(EndOfFile), which then truncated the file and deleted important data that was written to it.
2019-08-21 02:00:57 -05:00
emoose
06cacbb9af [Kernel] Implement XeKeysObscureKey & XeKeysAesCbcUsingKey 2019-08-21 02:00:57 -05:00
emoose
b22d76f0f9 [Kernel] Add XLiveBase 0x58046 stub 2019-08-21 02:00:57 -05:00
gibbed
6ab7720951 [Kernel] Fix stray whitespace in license_mask definition. 2019-08-14 14:15:56 -05:00
illusion98
c021c7741d [Kernel] Add license mask as a config variable 2019-08-14 10:25:24 -05:00
Triang3l
2507f1a819 [Memory] TranslateVirtual in shim and strings 2019-08-14 10:31:11 +03:00
Triang3l
0067f5561d [Kernel] More TranslateVirtual/HostToGuestVirtual usage 2019-08-14 08:28:30 +03:00
Triang3l
741b5ae2ec [Memory] Add HostToGuestVirtual and use it in a couple of places 2019-08-13 23:49:49 +03:00
Jonathan Goyvaerts
c621e01dd2 Add game_language as a config variable 2019-08-10 06:51:36 -05:00
gibbed
39c3f72c41 [Kernel] Implement RtlComputeCrc32. 2019-08-07 19:50:17 -05:00
gibbed
7d6d732999 [Kernel] Of course I forget to commit another local change. 2019-08-04 11:44:18 -05:00
gibbed
1ebf7bb484 [Kernel] Implement KeTryToAcquireSpinLockAtRaisedIrql. Maybe correctly. 2019-08-04 11:36:49 -05:00
gibbed
4970fc8673 [Kernel] Make XObject type() const. 2019-08-03 23:47:16 -05:00
gibbed
b2f62b1982 Clean up cvars (rename, recategorize). 2019-08-03 23:46:03 -05:00
emoose
313e81ec38 [Kernel] Add XN_SYS_UI notifications to XamShow*UI exports 2019-08-04 03:57:06 +01:00