static void key_adb_exit(void) { OSErr e; short adb_command; short tmp; char adb_key_registers[8]; ADBAddress adb_address; ADBDataBlock now_data; ADBSetInfoBlock mySet; if(adb_keyboard_id!=0){ adb_address = GetIndADB(&now_data, adb_keyboard_id); e = GetADBInfo(&now_data, adb_address); if(now_data.origADBAddr == 2){ adb_key_registers[0] = 2; adb_command = (adb_address * 16) + ADB_TALKMASK + ADB_TYPEREGISTER; if (send_adb_command_sync(adb_key_registers, adb_command) == noErr){ tmp=adb_key_save.devType; if(tmp == 3 || tmp ==5) adb_key_registers[2] = tmp; else adb_key_registers[2] = 2; adb_command = (adb_address * 16) + ADB_LISTENMASK + ADB_TYPEREGISTER; send_adb_command_sync(adb_key_registers, adb_command); } } mySet.siService = adb_key_save.dbServiceRtPtr; mySet.siDataAreaAddr = adb_key_save.dbDataAreaAddr; SetADBInfo (&mySet,adb_address); adb_keyboard_id=0; } DisposeADBServiceRoutineUPP (adb_key_upp); DisposeADBCompletionUPP(adb_key_cpt_upp); }
int aedioctl(dev_t dev, u_long cmd, void *data, int flag, struct lwp *l) { switch (cmd) { case ADBIOC_DEVSINFO: { adb_devinfo_t *di; ADBDataBlock adbdata; int totaldevs; int adbaddr; int i; di = (void *)data; /* Initialize to no devices */ for (i = 0; i < 16; i++) di->dev[i].addr = -1; totaldevs = CountADBs(); for (i = 1; i <= totaldevs; i++) { adbaddr = GetIndADB(&adbdata, i); di->dev[adbaddr].addr = adbaddr; di->dev[adbaddr].default_addr = (int)(adbdata.origADBAddr); di->dev[adbaddr].handler_id = (int)(adbdata.devType); } /* Must call ADB Manager to get devices now */ break; } case ADBIOC_GETREPEAT:{ adb_rptinfo_t *ri; ri = (void *)data; ri->delay_ticks = aed_sc->sc_rptdelay; ri->interval_ticks = aed_sc->sc_rptinterval; break; } case ADBIOC_SETREPEAT:{ adb_rptinfo_t *ri; ri = (void *) data; aed_sc->sc_rptdelay = ri->delay_ticks; aed_sc->sc_rptinterval = ri->interval_ticks; break; } case ADBIOC_RESET: /* Do nothing for now */ break; case ADBIOC_LISTENCMD: /* adb_listencmd_t *lc = data; */ default: return (EINVAL); } return (0); }
static int key_adb_init(void) { OSErr e; short adb_command; short adb_devices; char adb_key_registers[8]; ADBAddress adb_address; ADBSetInfoBlock mySet; adb_key_cpt_upp = NewADBCompletionUPP(adb_command_callback); adb_key_upp = NewADBServiceRoutineUPP (key_adb_interrupt); adb_devices = CountADBs(); for(adb_keyboard_id = 1 ; adb_keyboard_id <= adb_devices ; adb_keyboard_id++){ adb_address = GetIndADB(&adb_key_save, adb_keyboard_id); e = GetADBInfo(&adb_key_save, adb_address); if(adb_key_save.origADBAddr == ADB_KEYBOARD){ switch (adb_key_save.devType){ case 2:case 3:case 5: LOCK_VARIABLE(KeyNow); LOCK_VARIABLE(KeyOld); LOCK_VARIABLE(_mouse2nd); LOCK_VARIABLE(adb_to_allegro); LOCK_VARIABLE(modifier_table); LOCK_VARIABLE(standard_key_ascii_table); LOCK_VARIABLE(standard_key_capslock_table); LOCK_VARIABLE(standard_key_shift_table); LOCK_VARIABLE(standard_key_control_table); /* LOCK_FUNCTION(key_adb_interrupt);*/ /* LOCK_FUNCTION(adb_command_callback);*/ mySet.siService = adb_key_upp; mySet.siDataAreaAddr = NULL; SetADBInfo (&mySet,adb_address); adb_key_registers[0] = 2; adb_command = (adb_address * 16) + ADB_TALKMASK + ADB_TYPEREGISTER; if (send_adb_command_sync(adb_key_registers, adb_command) == noErr){ adb_key_registers[2] = 3; adb_command = (adb_address * 16) + ADB_LISTENMASK + ADB_TYPEREGISTER; send_adb_command_sync(adb_key_registers, adb_command); } GetKeys(KeyNow); _key_shifts=0; if(BitTst(KeyNow,k_apple_shift) || BitTst(KeyNow,k_apple_rshift))_key_shifts |= KB_SHIFT_FLAG; if(BitTst(KeyNow,k_apple_alt) || BitTst(KeyNow,k_apple_altgr))_key_shifts |= KB_ALT_FLAG; if(BitTst(KeyNow,k_apple_control) || BitTst(KeyNow,k_apple_rcontrol))_key_shifts |= KB_CTRL_FLAG; _mouse2nd = BitTst(KeyNow,k_2nd); return 0; default: break; } } } adb_keyboard_id=0; return -1; }
static void mouse_adb_exit(void) { ADBAddress adb_address; ADBDataBlock now_data; ADBSetInfoBlock mySet; if(adb_mouse_id != 0){ adb_address = GetIndADB(&now_data, adb_mouse_id); mySet.siService = adb_mouse_save.dbServiceRtPtr; mySet.siDataAreaAddr = adb_mouse_save.dbDataAreaAddr; SetADBInfo (&mySet,adb_address); adb_mouse_id = 0; } DisposeADBServiceRoutineUPP (adb_mouse_upp); DisposeADBCompletionUPP(adb_mouse_cpt_upp); }
static int mouse_adb_init(void) { OSErr e; ADBAddress adb_address; ADBSetInfoBlock mySet; short adb_devices; adb_mouse_cpt_upp = NewADBCompletionUPP(adb_command_callback); adb_mouse_upp = NewADBServiceRoutineUPP (mouse_adb_interrupt); adb_devices = CountADBs(); for(adb_mouse_id = 1 ; adb_mouse_id <= adb_devices ; adb_mouse_id++){ adb_address = GetIndADB(&adb_mouse_save, adb_mouse_id); e = GetADBInfo(&adb_mouse_save, adb_address); if(adb_mouse_save.origADBAddr == ADB_MOUSE){ switch (adb_mouse_save.devType){ case 1: LOCK_VARIABLE(mouse_x_min); LOCK_VARIABLE(mouse_y_min); LOCK_VARIABLE(mouse_x_max); LOCK_VARIABLE(mouse_y_max); LOCK_VARIABLE(mickey_x); LOCK_VARIABLE(mickey_y); LOCK_VARIABLE(_mouse2nd); mickey_x=0; mickey_y=0; mySet.siService = adb_mouse_upp; mySet.siDataAreaAddr = NULL; SetADBInfo (&mySet,adb_address); _mouse_x = 0; _mouse_y = 0; _mouse_b = 0; return 2; default: break; } } } adb_mouse_id=0; return -1; }
static pascal void key_adb_interrupt(Ptr buffer, TempADBServiceRoutineUPP completionProc, Ptr refCon, long command) { extern short _mac_keyboard_installed; unsigned char origcode; unsigned char keycode; int a; if((command & 0xF) == 0xC){ for(a = 1; a < 3 ; a++ ){ origcode=buffer[a]; keycode=adb_to_allegro[origcode&0x7f]; if(keycode!=0){ if(origcode&0x80){ if(keycode >= KEY_MODIFIERS && keycode<KEY_MAX ) if(keycode != KEY_SCRLOCK && keycode != KEY_NUMLOCK) _key_shifts &= ~modifier_table[keycode - KEY_MODIFIERS]; _handle_key_release(keycode); } else{ unsigned int ascii; if(keycode >= KEY_MODIFIERS && keycode<KEY_MAX ){ if(keycode == KEY_SCRLOCK || keycode == KEY_NUMLOCK){ _key_shifts ^= modifier_table[keycode - KEY_MODIFIERS]; } else _key_shifts |= modifier_table[keycode - KEY_MODIFIERS]; ascii=0; } else if(_key_shifts & KB_CTRL_FLAG) ascii=standard_key_control_table[keycode]; else if(_key_shifts & KB_CAPSLOCK_FLAG) ascii=standard_key_capslock_table[keycode]; else if(_key_shifts & KB_SHIFT_FLAG) ascii=standard_key_shift_table[keycode]; else ascii=standard_key_ascii_table[keycode]; if(ascii == 0xFFFF) ascii = _key_shifts & KB_MODIFIERS; _handle_key_press(ascii,keycode); } } else if(origcode == kk_2nd){ _mouse2nd = TRUE; } else if(origcode == kk_2nd+0x80){ _mouse2nd = FALSE; } // Debug Hack <CTRL-SHIFT-ON> restore system driver else if(origcode == 0x7F && _key_shifts & KB_SHIFT_FLAG && _key_shifts & KB_CTRL_FLAG){ ADBAddress adb_address; ADBSetInfoBlock mySet; ADBDataBlock now_data; adb_address = GetIndADB(&now_data, adb_keyboard_id); mySet.siService = adb_key_save.dbServiceRtPtr; mySet.siDataAreaAddr = adb_key_save.dbDataAreaAddr; SetADBInfo (&mySet,adb_address); _mac_keyboard_installed=TRUE; keyboard_driver = &keyboard_macos; } } } }
/* * initialize extended mouse - probes devices as * described in _Inside Macintosh, Devices_. */ void extdms_init(int totaladbs) { ADBDataBlock adbdata; int adbindex, adbaddr, count; short cmd; u_char buffer[9]; for (adbindex = 1; adbindex <= totaladbs; adbindex++) { /* Get the ADB information */ adbaddr = GetIndADB(&adbdata, adbindex); if (adbdata.origADBAddr == ADBADDR_MS && (adbdata.devType == ADBMS_USPEED || adbdata.devType == ADBMS_UCONTOUR)) { /* Found MicroSpeed Mouse Deluxe Mac or Contour Mouse */ cmd = ADBLISTEN(adbaddr, 1); /* * To setup the MicroSpeed or the Contour, it appears * that we can send the following command to the mouse * and then expect data back in the form: * buffer[0] = 4 (bytes) * buffer[1], buffer[2] as std. mouse * buffer[3] = buffer[4] = 0xff when no buttons * are down. When button N down, bit N is clear. * buffer[4]'s locking mask enables a * click to toggle the button down state--sort of * like the "Easy Access" shift/control/etc. keys. * buffer[3]'s alternative speed mask enables using * different speed when the corr. button is down */ buffer[0] = 4; buffer[1] = 0x00; /* Alternative speed */ buffer[2] = 0x00; /* speed = maximum */ buffer[3] = 0x10; /* enable extended protocol, * lower bits = alt. speed mask * = 0000b */ buffer[4] = 0x07; /* Locking mask = 0000b, * enable buttons = 0111b */ extdms_done = 0; ADBOp((Ptr)buffer, (Ptr)extdms_complete, (Ptr)&extdms_done, cmd); while (!extdms_done) /* busy wait until done */; } if (adbdata.origADBAddr == ADBADDR_MS && (adbdata.devType == ADBMS_100DPI || adbdata.devType == ADBMS_200DPI)) { /* found a mouse */ cmd = ADBTALK(adbaddr, 3); extdms_done = 0; ADBOp((Ptr)buffer, (Ptr)extdms_complete, (Ptr)&extdms_done, cmd); /* Wait until done, but no more than 2 secs */ count = 40000; while (!extdms_done && count-- > 0) delay(50); if (!extdms_done) { #ifdef ADB_DEBUG if (adb_debug) printf("adb: extdms_init timed out\n"); #endif return; } /* Attempt to initialize Extended Mouse Protocol */ buffer[2] = '\004'; /* make handler ID 4 */ extdms_done = 0; cmd = ADBLISTEN(adbaddr, 3); ADBOp((Ptr)buffer, (Ptr)extdms_complete, (Ptr)&extdms_done, cmd); while (!extdms_done) /* busy wait until done */; /* * Check to see if successful, if not * try to initialize it as other types */ cmd = ADBTALK(adbaddr, 3); extdms_done = 0; ADBOp((Ptr)buffer, (Ptr)extdms_complete, (Ptr)&extdms_done, cmd); while (!extdms_done) /* busy wait until done */; if (buffer[2] != ADBMS_EXTENDED) { /* Attempt to initialize as an A3 mouse */ buffer[2] = 0x03; /* make handler ID 3 */ extdms_done = 0; cmd = ADBLISTEN(adbaddr, 3); ADBOp((Ptr)buffer, (Ptr)extdms_complete, (Ptr)&extdms_done, cmd); while (!extdms_done) /* busy wait until done */; /* * Check to see if successful, if not * try to initialize it as other types */ cmd = ADBTALK(adbaddr, 3); extdms_done = 0; ADBOp((Ptr)buffer, (Ptr)extdms_complete, (Ptr)&extdms_done, cmd); while (!extdms_done) /* busy wait until done */; if (buffer[2] == ADBMS_MSA3) { /* Initialize as above */ cmd = ADBLISTEN(adbaddr, 2); /* listen 2 */ buffer[0] = 3; buffer[1] = 0x00; /* Irrelevant, buffer has 0x77 */ buffer[2] = 0x07; /* * enable 3 button mode = 0111b, * speed = normal */ extdms_done = 0; ADBOp((Ptr)buffer, (Ptr)extdms_complete, (Ptr)&extdms_done, cmd); while (!extdms_done) /* busy wait until done */; } else { /* No special support for this mouse */ } } } } }
void slowPoll( void ) { RANDOM_STATE randomState; BYTE buffer[ RANDOM_BUFSIZE + 8 ]; ProcessSerialNumber psn; GDHandle deviceHandle; GrafPtr currPort; QElemPtr queuePtr; QHdrPtr queueHdr; static BOOLEAN addedFixedItems = FALSE; initRandomData( randomState, buffer, RANDOM_BUFSIZE ); /* Walk through the list of graphics devices adding information about a device (IM VI 21-21) */ deviceHandle = GetDeviceList(); while( deviceHandle != NULL ) { GDHandle currentHandle = deviceHandle; GDPtr devicePtr; HLock( ( Handle ) currentHandle ); devicePtr = *currentHandle; deviceHandle = devicePtr->gdNextGD; addRandomData( randomState, devicePtr, sizeof( GDevice ) ); HUnlock( ( Handle ) currentHandle ); } /* Walk through the list of processes adding information about each process, including the name and serial number of the process, file and resource information, memory usage information, the name of the launching process, launch time, and accumulated CPU time (IM VI 29-17) */ psn.highLongOfPSN = 0; psn.lowLongOfPSN = kNoProcess; while( !GetNextProcess( &psn ) ) { ProcessInfoRec infoRec; GetProcessInformation( &psn, &infoRec ); addRandomData( randomState, &infoRec, sizeof( ProcessInfoRec ) ); } /* Get the command type, trap address, and parameters for all commands in the file I/O queue. The parameters are quite complex and are listed on page 117 of IM IV, and include reference numbers, attributes, time stamps, length and file allocation information, finder info, and large amounts of other volume and filesystem-related data */ #if !defined CALL_NOT_IN_CARBON || CALL_NOT_IN_CARBON if( ( queueHdr = GetFSQHdr() ) != NULL ) queuePtr = queueHdr->qHead; while( queuePtr != NULL ) { /* The queue entries are variant records of variable length so we need to adjust the length parameter depending on the record type */ addRandomData( randomState, queuePtr, 32 ); /* dunno how big.. */ queuePtr = queuePtr->qLink; } #endif /* The following are fixed for the lifetime of the process so we only add them once */ if( !addedFixedItems ) { Str255 appName, volName; GDHandle deviceHandle; Handle appHandle; DrvSts driveStatus; MachineLocation machineLocation; ProcessInfoRec processInfo; QHdrPtr vblQueue; SysEnvRec sysEnvirons; SysPPtr pramPtr; DefStartRec startupInfo; DefVideoRec videoInfo; DefOSRec osInfo; XPPParamBlock appleTalkParams; unsigned char *driverNames[] = { "\p.AIn", "\p.AOut", "\p.AppleCD", "\p.ATP", "\p.BIn", "\p.BOut", "\p.MPP", "\p.Print", "\p.Sony", "\p.Sound", "\p.XPP", NULL }; SInt16 count, dummy, i, node, net, vRefNum, script; SInt32 lcount, volume; /* Get the current font family ID, node ID of the local AppleMumble router, caret blink delay, CPU speed, double-click delay, sound volume, application and system heap zone, the number of resource types in the application, the number of sounds voices available, the FRef of the current resource file, volume of the sysbeep, primary line direction, computer SCSI disk mode ID, timeout before the screen is dimmed and before the computer is put to sleep, number of available threads in the thread pool, whether hard drive spin-down is disabled, the handle to the i18n resources, timeout time for the internal HDD, */ addRandomValue( randomState, GetAppFont() ); #if !defined CALL_NOT_IN_CARBON || CALL_NOT_IN_CARBON addRandomValue( randomState, GetBridgeAddress() ); #endif addRandomValue( randomState, GetCaretTime() ); /* addRandomValue( randomState, GetCPUSpeed() ); */ addRandomValue( randomState, GetDblTime() ); GetSysBeepVolume( &volume ); addRandomValue( randomState, volume ); GetDefaultOutputVolume( &volume ); addRandomValue( randomState, volume ); #if !defined CALL_NOT_IN_CARBON || CALL_NOT_IN_CARBON addRandomValue( randomState, ApplicationZone() ); addRandomValue( randomState, SystemZone() ); #endif addRandomValue( randomState, CountTypes() ); /* CountVoices( &count ); ** seems to crash addRandomValue( randomState, count ); */ addRandomValue( randomState, CurResFile() ); GetSysBeepVolume( &lcount ); addRandomValue( randomState, lcount ); addRandomValue( randomState, GetSysDirection() ); /* addRandomValue( randomState, GetSCSIDiskModeAddress() ); addRandomValue( randomState, GetDimmingTimeout() ); addRandomValue( randomState, GetSleepTimeout() ); */ GetFreeThreadCount( kCooperativeThread, &count ); addRandomValue( randomState, count ); /* addRandomValue( randomState, IsSpindownDisabled() ); */ addRandomValue( randomState, GetIntlResource( 0 ) ); #if !defined CALL_NOT_IN_CARBON || CALL_NOT_IN_CARBON GetTimeout( &count ); addRandomValue( randomState, count ); #endif /* Get the number of documents/files which were selected when the app started and for each document get the vRefNum, name, type, and version -- OBSOLETE CountAppFiles( &dummy, &count ); addRandomValue( randomState, count ); while( count > 0 ) { AppFile theFile; GetAppFiles( count, &theFile ); addRandomData( randomState, &theFile, sizeof( AppFile ) ); count--; } */ /* Get the app's name, resource file reference number, and handle to the finder information -- OBSOLETE GetAppParams( appName, appHandle, &count ); addRandomData( randomState, appName, sizeof( Str255 ) ); addRandomValue( randomState, appHandle ); addRandomValue( randomState, count ); */ /* Get all sorts of statistics such as physical information, disk and write-protect present status, error status, and handler queue information, on floppy drives attached to the system. Also get the volume name, volume reference number and number of bytes free, for the volume in the drive */ #if !defined CALL_NOT_IN_CARBON || CALL_NOT_IN_CARBON if( !DriveStatus( 1, &driveStatus ) ) addRandomData( randomState, &driveStatus, sizeof (DrvSts) ); #endif #if !defined CALL_NOT_IN_CARBON || CALL_NOT_IN_CARBON if( !GetVInfo( 1, volName, &vRefNum, &lcount ) ) { addRandomData( randomState, volName, sizeof( Str255 ) ); addRandomValue( randomState, vRefNum ); addRandomValue( randomState, lcount ); } #endif #if !defined CALL_NOT_IN_CARBON || CALL_NOT_IN_CARBON if( !DriveStatus( 2, &driveStatus ) ) addRandomData( randomState, &driveStatus, sizeof (DrvSts) ); #endif #if !defined CALL_NOT_IN_CARBON || CALL_NOT_IN_CARBON if( !GetVInfo( 2, volName, &vRefNum, &lcount ) ) { addRandomData( randomState, volName, sizeof( Str255 ) ); addRandomValue( randomState, vRefNum ); addRandomValue( randomState, lcount ); } #endif /* Get information on the head and tail of the vertical retrace queue */ #if !defined CALL_NOT_IN_CARBON || CALL_NOT_IN_CARBON if( ( vblQueue = GetVBLQHdr() ) != NULL ) addRandomData( randomState, vblQueue, sizeof( QHdr ) ); #endif /* Get the parameter RAM settings */ pramPtr = GetSysPPtr(); addRandomData( randomState, pramPtr, sizeof( SysParmType ) ); /* Get information about the machines geographic location */ ReadLocation( &machineLocation ); addRandomData( randomState, &machineLocation, sizeof( MachineLocation ) ); /* Get information on current graphics devices including device information such as dimensions and cursor information, and a number of handles to device-related data blocks and functions, and information about the dimentions and contents of the devices pixel image as well as the images resolution, storage format, depth, and colour usage */ deviceHandle = GetDeviceList(); do { GDPtr gdPtr; addRandomValue( randomState, deviceHandle ); HLock( ( Handle ) deviceHandle ); gdPtr = ( GDPtr ) *deviceHandle; addRandomData( randomState, gdPtr, sizeof( GDevice ) ); addRandomData( randomState, gdPtr->gdPMap, sizeof( PixMap ) ); HUnlock( ( Handle ) deviceHandle ); } while( ( deviceHandle = GetNextDevice( deviceHandle ) ) != NULL ); /* Get the current system environment, including the machine and system software type, the keyboard type, where there's a colour display attached, the AppleTalk driver version, and the VRefNum of the system folder */ #if !defined CALL_NOT_IN_CARBON || CALL_NOT_IN_CARBON SysEnvirons( curSysEnvVers, &sysEnvirons ); addRandomData( randomState, &sysEnvirons, sizeof( SysEnvRec ) ); #endif /* Get the AppleTalk node ID and network number for this machine */ #if !defined CALL_NOT_IN_CARBON || CALL_NOT_IN_CARBON if( GetNodeAddress( &node, &net ) ) { addRandomValue( randomState, node ); addRandomValue( randomState, net ); } #endif /* Get information on each device connected to the ADB including the device handler ID, the devices ADB address, and the address of the devices handler and storage area */ #if !defined CALL_NOT_IN_CARBON || CALL_NOT_IN_CARBON count = CountADBs(); while( count-- > 0 ) { ADBDataBlock adbInfo; GetIndADB( &adbInfo, count ); addRandomData( randomState, &adbInfo, sizeof( ADBDataBlock ) ); } #endif /* Open the most common device types and get the general device status information and (if possible) device-specific status. The general device information contains the device handle and flags, I/O queue information, event information, and other driver-related details */ /* Try something like this again.. and ur a dead man, Peter ;-) -xmath */ /* for( count = 0; driverNames[ count ] != NULL; count++ ) { AuxDCEHandle dceHandle; short driverRefNum; ** Try and open the driver ** if( OpenDriver( driverNames[ count ], &driverRefNum ) ) continue; ** Get a handle to the driver control information (this could also be done with GetDCtlHandle()) ** Status( driverRefNum, 1, &dceHandle ); HLock( dceHandle ); addRandomData( randomState, *dceHandle, sizeof( AuxDCE ) ); HUnlock( dceHandle ); CloseDriver( driverRefNum ); } */ /* Get the name and volume reference number for the current volume */ #if !defined CALL_NOT_IN_CARBON || CALL_NOT_IN_CARBON GetVol( volName, &vRefNum ); addRandomData( randomState, volName, sizeof( Str255 ) ); addRandomValue( randomState, vRefNum ); #endif /* Get the time information, attributes, directory information and bitmap, volume allocation information, volume and drive information, pointers to various pieces of volume-related information, and details on path and directory caches, for each volume */ #if !defined CALL_NOT_IN_CARBON || CALL_NOT_IN_CARBON if( ( queueHdr = GetVCBQHdr() ) != NULL ) queuePtr = queueHdr->qHead; while ( queuePtr != NULL ) { addRandomData( randomState, queuePtr, sizeof( VCB ) ); queuePtr = queuePtr->qLink; } #endif /* Get the driver reference number, FS type, and media size for each drive */ #if !defined CALL_NOT_IN_CARBON || CALL_NOT_IN_CARBON if( ( queueHdr = GetDrvQHdr() ) != NULL ) queuePtr = queueHdr->qHead; while ( queuePtr != NULL ) { addRandomData( randomState, queuePtr, sizeof( DrvQEl ) ); queuePtr = queuePtr->qLink; } #endif /* Get global script manager variables and vectors, including the globals changed count, font, script, and i18n flags, various script types, and cache information */ for( count = 0; count < 30; count++ ) addRandomValue( randomState, GetScriptManagerVariable( count ) ); /* Get the script code for the font script the i18n script, and for each one add the changed count, font, script, i18n, and display flags, resource ID's, and script file information */ script = FontScript(); addRandomValue( randomState, script ); for( count = 0; count < 30; count++ ) addRandomValue( randomState, GetScriptVariable( script, count ) ); script = IntlScript(); addRandomValue( randomState, script ); for( count = 0; count < 30; count++ ) addRandomValue( randomState, GetScriptVariable( script, count ) ); /* Get the device ID, partition, slot number, resource ID, and driver reference number for the default startup device */ #if !defined CALL_NOT_IN_CARBON || CALL_NOT_IN_CARBON GetDefaultStartup( &startupInfo ); addRandomData( randomState, &startupInfo, sizeof( DefStartRec ) ); #endif /* Get the slot number and resource ID for the default video device */ #if !defined CALL_NOT_IN_CARBON || CALL_NOT_IN_CARBON GetVideoDefault( &videoInfo ); addRandomData( randomState, &videoInfo, sizeof( DefVideoRec ) ); #endif /* Get the default OS type */ #if !defined CALL_NOT_IN_CARBON || CALL_NOT_IN_CARBON GetOSDefault( &osInfo ); addRandomData( randomState, &osInfo, sizeof( DefOSRec ) ); #endif /* Get the AppleTalk command block and data size and number of sessions */ #if !defined CALL_NOT_IN_CARBON || CALL_NOT_IN_CARBON ASPGetParms( &appleTalkParams, FALSE ); addRandomData( randomState, &appleTalkParams, sizeof( XPPParamBlock ) ); #endif addedFixedItems = TRUE; } /* Flush any remaining data through */ endRandomData( randomState, 100 ); }