Ignore:
Timestamp:
Jul 11, 2010, 7:42:10 AM (15 years ago)
Author:
David Azarewicz
Message:

Bring branch up-to-date with trunk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • GPL/branches/uniaud32-2.1.x/drv32/init.c

    r492 r504  
    3636#include <ossidc32.h>
    3737#include <dbgos2.h>
    38 #include <printfos2.h>
    3938#include <irqos2.h>
    4039//#include <bsedos16.h>
     
    4342#endif
    4443#include "parse.h"
     44#include "malloc.h"
    4545
    4646const char ERR_ERROR[]   = "ERROR: ";
     
    6868extern "C" int sprintf (char *buffer, const char *format, ...);
    6969
    70 extern "C" int wrOffset;
    71 extern "C" char *szprintBuf;
    7270extern "C" APIRET APIENTRY DOS16OPEN(PSZ pszFileName, PHFILE phf, PULONG pulAction, ULONG cbFile, ULONG ulAttribute, ULONG fsOpenFlags, ULONG fsOpenMode, PEAOP2 peaop2 );
    7371extern "C" APIRET APIENTRY DOS16CLOSE(HFILE hFile);
    7472extern "C" APIRET APIENTRY DOS16WRITE(HFILE hFile, PVOID pBuffer, ULONG cbWrite, PULONG pcbActual);
    7573extern "C" void SaveBuffer(void);
     74
     75#define VMDHA_FIXED             0x0002
     76
     77extern "C" APIRET VMAlloc(ULONG size, ULONG flags, char NEAR* *pAddr);
    7678
    7779//Print messages with DosWrite when init is done or has failed (see startup.asm)
     
    9193}
    9294
    93 void _cdecl printfos2(char *string)
    94 {
    95    DevSaveMessage(string, strlen(string));
    96 }
    97 
    9895//SvL: Lock our 32 bits data & code segments
    99 int LockSegments(void) 
     96int LockSegments(void)
    10097{
    10198#ifdef KEE
     
    194191#endif
    195192// Initialize device driver
    196 WORD32 DiscardableInit(RPInit __far* rp) 
     193WORD32 DiscardableInit(RPInit __far* rp)
    197194{
    198195    char        debugmsg[64];
     
    209206    }
    210207
     208        DebugLevel = 1;
    211209    rp->Out.FinalCS = 0;
    212210    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        }
    213222
    214223    args = MAKE_FARPTR32(rp->In.Args);
     
    268277#if 0
    269278        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)
    271280            {
    272281                WriteString(szDeviceName, strlen(szDeviceName));
     
    281290        WriteString(szEOL, sizeof(szEOL)-1);
    282291    }
    283 #ifdef DEBUG
    284     dprintf(("DiscardableInit. cp1"));
    285 #endif
    286292    // Complete the installation
    287293    rp->Out.FinalCS = _OffsetFinalCS16;
    288294    rp->Out.FinalDS = _OffsetFinalDS16;
    289 #ifdef DEBUG
    290     dprintf(("DiscardableInit. cp2"));
    291 #endif
    292 
    293 //    SaveBuffer();
     295
     296        //SaveBuffer();
    294297
    295298    // Confirm a successful installation
Note: See TracChangeset for help on using the changeset viewer.