Cxbx-Reloaded / xbox_kernel_test_suite

Xbox kernel APIs tester written using nxdk
GNU General Public License v3.0
22 stars 6 forks source link

Add test for RtlUnicodeStringToAnsiString function #70

Closed RadWolfie closed 3 years ago

RadWolfie commented 3 years ago

After found out about DoA 1 Ultimate's crash for create a profile. I start making the test for any possibility success and failure outcome. In the process, I found some faults in Cxbx-Reloaded's implemention for RtlUnicodeStringToAnsiString function. Plus kernel test suite with string comparsion being checked for null termation when should had check the whole length instead. With this pull request's implemention and a fix for comparsion. It is working as intended base on hardware result (see below).

xbox hardware test: (updated)

0x0134 - RtlUnicodeStringToAnsiString: Tests Starting
  Test 'Initialize unicode string.' PASSED
  Function 'RtlUnicodeStringToAnsiString' returned 0x0 as expected
  Test 'Convert partial unicode to ansi string (alloc).' PASSED
  Function 'RtlUnicodeStringToAnsiString' returned 0x0 as expected
  Test 'Convert partial unicode to ansi string.' PASSED
  Function 'RtlUnicodeStringToAnsiString' returned 0x80000005 as expected
  Test 'Convert unicode (up by one length) to limited ansi string.' PASSED
  Function 'RtlUnicodeStringToAnsiString' returned 0x80000005 as expected
  Test 'Convert max unicode to limited ansi string.' PASSED
  Function 'RtlUnicodeStringToAnsiString' returned 0x0 as expected
  Test 'Convert full unicode to ansi string.' PASSED
  Function 'RtlUnicodeStringToAnsiString' returned 0x80000005 as expected
  Function 'RtlUnicodeStringToAnsiString' returned 0x0 as expected
  Test 'Unicode to max ansi string.' PASSED
  Function 'RtlUnicodeStringToAnsiString' returned 0x0 as expected
  Test 'Max unicode to max ansi string.' PASSED
0x0134 - RtlUnicodeStringToAnsiString: All tests PASSED

This test will produce a crash on Cxbx-Reloaded, pull request is being made to solve the issue.