During setup/boot two functions use wrong partition numbers when an unusual partitioning is used.
The partition number in ARC paths (like multi(0)disk(0)rdisk(0)partition(1)\ReactOS) starts with 1, but only partitions which exist are counted. When the partition used by reactos it the second partition, but the first partition slot in the mbr is unused, the second partition is still number 1. In my case this caused the error message "Opening hive file failed" during boot.
In the attached patch I did not change the indentation of a code block, to avoid cluttering the patch file. If required I'll create a new version which includes that.
The changed functions are also called from xbox related code. I don't have an xbox, so I was not able to test that. But the changes should not change the partition numbers of primary partitions if there are no gaps and an extended partition is last. These changes however do change the numbering of logical drives in the extended partition. The existing code simply assumed those start with number 5.