I opened up xapilib.lib in vim and found the declaration within. This is what the parameters to the function are and what they mean:
pszDDrivePath = This is what you want your D: drive to be mapped to. (ex. "\\Device\\CdRom0")
dwLaunchDataType = The launch data type field is what you use to determine which type of LAUNCH_DATA structure to parse. (ex. LDT_TITLE)
dwTitleId = The title id of the xbe you are launching. Could this be used as an override? (ex. 0x4D530004 if you were launching Halo 2)
pLaunchData = This is a reference to a launch data structure or you can just pass it a PLAUNCH_DATA.
Alright, so lets say I want to launch Halo 2 and I know that it is in the same directory as my xbe and that I am running off of an actual DVD. I could launch Halo 2 with the following code:
// Halo 2 obviously won't parse this but my app will so lets pretend like Halo 2 will.
strcpy((char*)((PLD_DEMO)&launcData)->Reserved, "SomeCommandLineArgs"); // I can put anything I want in here. Using the PLD_DEMO structure we get 2932 bytes in the reserved field to work with which I hope would be plenty for any command-line arguments we may want to pass.
XWriteTitleInfoAndRebootA("D:\\Halo2.xbe", "\\Device\\CdRom0", LDT_TITLE, 0x4D530004, &launchData);
This code works great. I can pass anything I want to the xbe I am launching including up to a 2932 character command-line argument.
Now lets say that D:\ wasn't actually mapped to "\\Device\\CdRom0" but instead to "\\Device\\Harddrisk0\\Partition6\\Games\\MyApp" (which is equivalent to F:\Games\MyApp). Well now this code doesn't work because I am mapping D: to the wrong path. This leaves me choosing between two possible solutions:
1) Ask the user exactly where to find the XBE to be launched. This is inconvenient because you have to inform the user that they should only select it within the D: path if the actual location of the xbe is the DVD drive.
2) Query the actual mapping. This option ftw.
I'm not sure if the second option is possible but, if it is, I would love to know how to do it. Thanks to anyone that can provide any information.
As an added note, another function found within the undocumented.h header is:
The declaration is exactly the same as the other function. But, if you were to try to use this you would get a linker error due to the non-existent _XWriteTitleInfoNoReboot@20. This is because, should you look in xapilib.lib, it is actually _XwriteTitleInfoNoReboot@24. It has an extra parameter. Maybe it changed after undocumented.h was produced. Anyway, the extra parameter is after pszDDrivePath and it is DWORD fAllowDDriveMapping. It seems to specify whether or not the D drive can be mapped. I was slightly hopeful that if you sent a 0 into it the pszDDrivePath parameter would be ignored and it would use the current mapping. It seems that it does cause pszDDrivePath to be ignored but it doesn't use the current mapping. I am not absolutely sure but I believe it forces the mapping to be the DVD drive no matter what. I don't really see how that parameter is useful.
On top of that I am not sure how to make the Title launch once you are done with this function besides sending the console a warm reboot. Does anyone know anything more about this function?