HQ NETWORK:   XBOX ONE |  XBOX 360 |  AIDELUXE HQ Network: 13,793 | Guests: 8076 | Members: 1 


   Current Location: Forums New google drive   |   Which modchip is this?   |   Anyone here capable or interested in restarting XBConnect?   |   Error code 05   |   original xbox with 0 memory   |   Why cell damage is low with ratings   |   New Game - Fursan al-Aqsa - Knights of al-Aqsa Mosque   |   Xbox-Hq.Com VIP Member Testimonials   |   XBHD: A Full-Featured Original Xbox Adapter from EON Gaming,   |   Best place for XBox ROMS?   |   
  Home | Active Topics | CD/DVD Media | Downloads | Forums | Feedback | Games | HardDrives | Homebrew | My Profile | ModChips | Reviews | Search | SoftMods | Tutorials

Xbox Forums

Discuss all aspects of the original Xbox Console in our Interactive Xbox Forums..

Get Xbox Game Pass Ultimate
Xbox-Hq.Com :: View topic - runxbe();
Xbox-Hq.Com Forum Index -> Learn to code Xbox
Post new topic Reply to topic    
 runxbe(); View previous topic :: View next topic  
 
 
 
 
forahobby
Administrator
Administrator


Joined: May 22, 2003
Posts: 23942
Location: NSW, Australia

Post Posted: Sat Dec 11, 2004 7:45 pm   
Post subject: runxbe();
Reply with quote
 
Hi guys,

I have a runxbe(); class.

All the app does is boot another .xbe at the moment.. Can anyone help getting this to work..

heres the launch.cpp:
Code:
#include "launch.h"

#include <stdio.h> // sprintf(..)
/*
Description: Launch another XBE by unmounting then remounting D:

Detail:
If you want to launch another XBE (say you have a menu program) - you
have to first map the D: drive to the location of the XBE you are launching
or else it won't be able to find its media files.

You have to first unmount the D: drive, then re-mount it to the correct
device and subdirectory. Then simply call your XBE.
*/
 

#ifdef _XBOX

// Hidden Kernal Functions
#define IN
typedef struct _UNICODE_STRING {unsigned short Length; unsigned short MaximumLength; PSTR Buffer;} UNICODE_STRING,*PUNICODE_STRING;
extern "C" XBOXAPI DWORD WINAPI IoCreateSymbolicLink(IN PUNICODE_STRING SymbolicLinkName,IN PUNICODE_STRING DeviceName);
extern "C" XBOXAPI DWORD WINAPI IoDeleteSymbolicLink(IN PUNICODE_STRING SymbolicLinkName);
extern "C" XBOXAPI DWORD WINAPI XapiMapLetterToDirectory(IN LPCSTR pcDriveString,IN LPCSTR pcPathString,IN DWORD pcszTitleId,IN bool fCreateDirectory,IN LPCSTR pcszTitleName,IN bool fUpdateTimestamp);

// Unmount the old D: drive
static void UnmountD()
{
   char szDestinationDrive[16];
   strcpy(szDestinationDrive,"\\??\\D:");

   UNICODE_STRING LinkName = {
   strlen(szDestinationDrive),
   strlen(szDestinationDrive) + 1,
   szDestinationDrive};

   IoDeleteSymbolicLink(&LinkName);
}

// Mount the D: drive to a given device and directory
// szDevice = "Cdrom0" or "Harddisk0\Partition6"
// szDir = "" or "Game1"
static void MountD(char* szDevice, char* szDir)
{
   char szSourceDevice[256];
   char szDestinationDrive[16];

   strcpy(szDestinationDrive,"\\??\\D:");
   sprintf(szSourceDevice,"\\Device\\%s",szDevice);
   if (*szDir != 0x00 && *szDir != '\\')
   {
      strcat(szSourceDevice, "\\");
      strcat(szSourceDevice, szDir);
   }

   UNICODE_STRING LinkName = {
      strlen(szDestinationDrive),
      strlen(szDestinationDrive) + 1,
      szDestinationDrive
      };
   UNICODE_STRING DeviceName = {
      strlen(szSourceDevice),
      strlen(szSourceDevice) + 1,
      szSourceDevice
      };

   IoCreateSymbolicLink(&LinkName, &DeviceName);
}

// szDevice = the device where the XBE is "Cdrom0"
// szDir = the subdirectory where your xbe is "Games\Game1"
// szFile = the name of your XBE (without the path) - "Game1.xbe"
void RunXbe (char* szDevice, char* szDir, char* szFile)
{
   char szXbePath[64];
   wsprintf(szXbePath,"D:\\",szFile);

   UnmountD();
   MountD(szDevice, szDir);
   XLaunchNewImage(szXbePath, NULL );
}


#else

void RunXbe (char* szDevice, char* szDir, char* szFile)
{
   //Start a standard exe here for pc version :)
}

#endif //_XBOX


and heres the launch.h:
Code:
#pragma once



#ifdef _XBOX

#include <xtl.h>

#else

// Where using DirectX
#pragma comment(lib, "D3d8.lib") // DirectX 8
#pragma comment(lib, "D3dx8.lib")
#include <d3dx8.h>

#endif //_XBOX



// szDevice = the device where the XBE is "Cdrom0"
// szDir = the subdirectory where your xbe is "Games\Game1"
// szFile = the name of your XBE (without the path) - "Game1.xbe"
void RunXbe (char* szDevice, char* szDir, char* szFile);




Now i call the function no problems at all and can pass my variables accross but i get a error. .xbe could not be booted.. I know its something so small.. any whizzes around?? Im not that bad a coder on xbox but this ones got me stumped..

Heres how i call it:
Code:
RunXbe ("Cdrom0", "", "install.xbe"); // lets launch ourself
   
   // szDevice = "Cdrom0" or "Harddisk0\Partition6" (where xbe is)
// szDir = the subdirectory where your xbe is "Games\Game1"
// szFile = the name of your XBE (without the path) - "Game1.xbe"


Im just trying to call another xbe for a test.. Its really the same app at the moment!

anyway, thanks for any help guys,

l8r

forahobby
http://www.xbox-hq.com

_________________
HQ Network:
www.xbox-hq.com | www.xboxone-hq.com | www.360-hq.com | www.c64-hq.com


View user's profile Send private message Send e-mail Visit poster's website
 
 
 
 
forahobby
Administrator
Administrator


Joined: May 22, 2003
Posts: 23942
Location: NSW, Australia

Post Posted: Sun Dec 12, 2004 12:03 am   
Post subject:
Reply with quote
 
i got it working guys..
If anyone needs help just contact me..

Ill help no probs at all.

l8r

forahobby
http://www.xbox-hq.com

another all night mission eh?? well a couple of them.
Now we can get back onto business..

_________________
HQ Network:
www.xbox-hq.com | www.xboxone-hq.com | www.360-hq.com | www.c64-hq.com


View user's profile Send private message Send e-mail Visit poster's website
 
 
 
 
enigma516
V.I.P. Lifetime


Joined: Feb 07, 2005
Posts: 2743
Location: Florida

Post Posted: Fri Nov 18, 2005 9:46 pm   
Post subject:
Reply with quote
 
Sorry Hobbs, had to delete a realy idiotic post someone made here.
_________________


View user's profile Send private message Send e-mail Visit poster's website AIM Address
 
Display posts from previous:   
  Post new topic  
 
  Reply to topic  
|
 All times are GMT | Page 1 of 1
Jump to:  
 

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum
 


Get Xbox Game Pass Ultimate