/* This program (install.c) is Public Domain */ #define INCL_OS2MM #define INCL_DOS #include #include #include #include #include #include "streamproc.h" //#include //If you don't have minstall.h, this is all that is needed typedef struct _INSTMCISENDCOMMAND { USHORT wDeviceID; USHORT wMessage; ULONG dwParam1; ULONG dwParam2; USHORT wUserParm; } INSTMCISENDCOMMAND; typedef INSTMCISENDCOMMAND *PINSTMCISENDCOMMAND; #define IM_MCI_SEND_COMMAND 0x057C #define IM_MCI_EXTENDED_SYSINFO 0x057E #define IM_LOG_ERROR 0x0573 int deleteProc(char *Fourcc) { MMINIFILEINFO mmIniFileInfo; ULONG ulFlags = 0L; ULONG rc; memset( &mmIniFileInfo, '\0', sizeof(MMINIFILEINFO) ); mmIniFileInfo.fccIOProc = mmioStringToFOURCC(Fourcc,0); ulFlags = MMIO_FINDPROC; rc = mmioIniFileHandler( &mmIniFileInfo, ulFlags); if (rc) { printf("Couldn't find IOProc %s. Code: %ld\n",Fourcc,rc); return rc; } ulFlags = MMIO_REMOVEPROC; rc = mmioIniFileHandler( &mmIniFileInfo, ulFlags); if (rc) { printf("Couldn't remove IOProc %s. Code: %ld\n",Fourcc,rc); return rc; } else { printf("Removed IOProc %s.\n",Fourcc); } /* endif */ { char dllname[DLLNAME_SIZE] = "DLL\\"; char fulldllname[DLLNAME_SIZE] = ""; strncat(dllname, mmIniFileInfo.szDLLName,sizeof(dllname)); strncat(dllname, ".DLL",sizeof(dllname)); rc = DosSearchPath(2,"MMBASE",dllname,fulldllname,sizeof(fulldllname)); if (rc) { printf("Couldn't find %s. code:%ld\n", dllname,rc); return rc; } rc = DosReplaceModule(fulldllname,NULL,NULL); if (rc) { printf("Couldn't unlock %s. code:%ld\n", fulldllname,rc); } else { printf("Unlocked %s.\n", fulldllname); } /* endif */ rc = DosDelete(fulldllname); if (rc) { printf("Couldn't delete %s. code:%ld\n", fulldllname,rc); return rc; } else { printf("Deleted %s.\n", fulldllname); } /* endif */ } return 0; } int queryNumStorageProcs(void) { MMFORMATINFO mmfinfo; LONG lNum=0; printf("In %s().\n", __FUNCTION__); memset( &mmfinfo, '\0', sizeof(MMFORMATINFO) ); // mmfinfo.ulIOProcType=MMIO_IOPROC_STORAGESYSTEM; //mmfinfo.ulMediaType=MMIO_MEDIATYPE_AUDIO; mmioQueryFormatCount(&mmfinfo, &lNum, 0, 0); return lNum; } int queryNumFormatProcs(void) { MMFORMATINFO mmfinfo; LONG lNum=0; memset( &mmfinfo, '\0', sizeof(MMFORMATINFO) ); mmfinfo.ulIOProcType=MMIO_IOPROC_STORAGESYSTEM; mmfinfo.ulMediaType=MMIO_MEDIATYPE_AUDIO; mmioQueryFormatCount(&mmfinfo, &lNum, 0, 0); return lNum; } BOOL getFormats(LONG lNum) { MMFORMATINFO mmfinfo; PMMFORMATINFO pmmfi; LONG lFormatsRead; int a; memset( &mmfinfo, '\0', sizeof(MMFORMATINFO) ); mmfinfo.ulIOProcType=MMIO_IOPROC_STORAGESYSTEM; // mmfinfo.ulMediaType=MMIO_MEDIATYPE_AUDIO; if((pmmfi=(PMMFORMATINFO)malloc(lNum*sizeof(MMFORMATINFO)))==NULL) return FALSE; printf("mmioGetFormats() returned: %d \n", mmioGetFormats(&mmfinfo, lNum, pmmfi, &lFormatsRead,0,0)); printf("Info for %d formats read.\n\n", lFormatsRead); for(a=0;a