Changeset 504 for GPL/branches/uniaud32-2.1.x/drv32/init.c
- Timestamp:
- Jul 11, 2010, 7:42:10 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GPL/branches/uniaud32-2.1.x/drv32/init.c
r492 r504 36 36 #include <ossidc32.h> 37 37 #include <dbgos2.h> 38 #include <printfos2.h>39 38 #include <irqos2.h> 40 39 //#include <bsedos16.h> … … 43 42 #endif 44 43 #include "parse.h" 44 #include "malloc.h" 45 45 46 46 const char ERR_ERROR[] = "ERROR: "; … … 68 68 extern "C" int sprintf (char *buffer, const char *format, ...); 69 69 70 extern "C" int wrOffset;71 extern "C" char *szprintBuf;72 70 extern "C" APIRET APIENTRY DOS16OPEN(PSZ pszFileName, PHFILE phf, PULONG pulAction, ULONG cbFile, ULONG ulAttribute, ULONG fsOpenFlags, ULONG fsOpenMode, PEAOP2 peaop2 ); 73 71 extern "C" APIRET APIENTRY DOS16CLOSE(HFILE hFile); 74 72 extern "C" APIRET APIENTRY DOS16WRITE(HFILE hFile, PVOID pBuffer, ULONG cbWrite, PULONG pcbActual); 75 73 extern "C" void SaveBuffer(void); 74 75 #define VMDHA_FIXED 0x0002 76 77 extern "C" APIRET VMAlloc(ULONG size, ULONG flags, char NEAR* *pAddr); 76 78 77 79 //Print messages with DosWrite when init is done or has failed (see startup.asm) … … 91 93 } 92 94 93 void _cdecl printfos2(char *string)94 {95 DevSaveMessage(string, strlen(string));96 }97 98 95 //SvL: Lock our 32 bits data & code segments 99 int LockSegments(void) 96 int LockSegments(void) 100 97 { 101 98 #ifdef KEE … … 194 191 #endif 195 192 // Initialize device driver 196 WORD32 DiscardableInit(RPInit __far* rp) 193 WORD32 DiscardableInit(RPInit __far* rp) 197 194 { 198 195 char debugmsg[64]; … … 209 206 } 210 207 208 DebugLevel = 1; 211 209 rp->Out.FinalCS = 0; 212 210 rp->Out.FinalDS = 0; 211 212 if ( szprintBuf == 0 ) { 213 VMAlloc( DBG_MAX_BUF_SIZE, VMDHA_FIXED, &szprintBuf ); 214 if (szprintBuf) { 215 memset( szprintBuf, 0, DBG_MAX_BUF_SIZE ); 216 wrOffset= 0; 217 } 218 } 219 if (!HeapInit(HEAP_SIZE)) { 220 dprintf(("HeapInit failed!")); 221 } 213 222 214 223 args = MAKE_FARPTR32(rp->In.Args); … … 268 277 #if 0 269 278 for(int i=1;i<OSS32_MAX_AUDIOCARDS;i++) { 270 if(OSS32_QueryNames(i, szDeviceName, sizeof(szDeviceName), szMixerName, sizeof(szMixerName)) == OSSERR_SUCCESS) 279 if(OSS32_QueryNames(i, szDeviceName, sizeof(szDeviceName), szMixerName, sizeof(szMixerName)) == OSSERR_SUCCESS) 271 280 { 272 281 WriteString(szDeviceName, strlen(szDeviceName)); … … 281 290 WriteString(szEOL, sizeof(szEOL)-1); 282 291 } 283 #ifdef DEBUG284 dprintf(("DiscardableInit. cp1"));285 #endif286 292 // Complete the installation 287 293 rp->Out.FinalCS = _OffsetFinalCS16; 288 294 rp->Out.FinalDS = _OffsetFinalDS16; 289 #ifdef DEBUG 290 dprintf(("DiscardableInit. cp2")); 291 #endif 292 293 // SaveBuffer(); 295 296 //SaveBuffer(); 294 297 295 298 // Confirm a successful installation
Note:
See TracChangeset
for help on using the changeset viewer.