home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
dosapi.zip
/
STARTSES.C
< prev
Wrap
C/C++ Source or Header
|
1994-08-16
|
1KB
|
41 lines
/**********************************************************/
/* Stub program for starting OS/2 programs under DOS */
/* Only use this program as a DOS stub in LINK386 */
/* Refer to documentation regarding DEF files for CSet/2 */
/**********************************************************/
#include "dosapi.h"
#include <string.h>
char Sem_Name[32] = "\\SEM32\\STARTSES";
unsigned long Sem_Handle;
Session_Data Start_Sess;
char OS2_PGM[128] = "";
main(int argc, char *argv[])
{
int i;
Dos32CreateEventSem( Sem_Name, &Sem_Handle, 0, 0 );
strcpy(OS2_PGM,"/C");
for(i=0;i<argc;++i){
strcat(OS2_PGM," ");
strcat(OS2_PGM,argv[i]);
}
memset(&Start_Sess, 0, sizeof(Start_Sess));
Start_Sess.Sess_Struct_Len = sizeof(Start_Sess);
Start_Sess.Sess_Relation = 0;
Start_Sess.Sess_Fore_Back = 1;
Start_Sess.Sess_Trace = 0;
Start_Sess.Sess_Program_Title = 0;
Start_Sess.Sess_Program_Name = 0;
Start_Sess.Sess_Program_Args = OS2_PGM;
Start_Sess.Sess_Type = 1;
DosStartSession( &Start_Sess );
Dos32WaitEventSem( Sem_Handle, -1 );
Dos32CloseEventSem( Sem_Handle );
}