void ShopSubmitter::BeginShopSubmission(const QString &threadId, const QString &shopData, bool bumpAfter) {
    if (threadId.isEmpty() || shopData.isEmpty()) {
        emit ShopSubmissionError(threadId, "Invalid shop submitted.");
        return;
    }

    if (submissions.contains(threadId)) {
        emit ShopSubmissionError(threadId, "This shop is already being submitted.");
        return;
    }

    // Setup Queue
    ShopSubmission* submission = new ShopSubmission;
    submission->threadId = threadId;
    submission->shopData = shopData;
    submission->bumpAfter = bumpAfter;
    submissions.insert(threadId, submission);

    submission->timerId = startTimer(GetTimeout());

    // Submit!
    QNetworkRequest request(QUrl(ShopEditUrl(threadId)));
    request.setAttribute((QNetworkRequest::Attribute) SHOP_DATA_THREAD, threadId);

    QNetworkReply *fetched = network->get(request);
    submission->state = SHOP_SUBMISSION_STARTED;
    submission->currentReply = fetched;
    connect(fetched, SIGNAL(finished()), this, SLOT(OnSubmissionPageFinished()));
}
Example #2
0
NS_IMETHODIMP
nsGeolocationRequest::Allow()
{
  nsRefPtr<nsGeolocationService> geoService = nsGeolocationService::GetInstance();

  // Kick off the geo device, if it isn't already running
  nsresult rv = geoService->StartDevice();
  
  if (NS_FAILED(rv)) {
    // Location provider error
    NotifyError(nsIDOMGeoPositionError::POSITION_UNAVAILABLE);
    return NS_OK;
  }
  
  nsCOMPtr<nsIDOMGeoPosition> lastPosition = geoService->GetCachedPosition();
  DOMTimeStamp cachedPositionTime;
  if (lastPosition)
    lastPosition->GetTimestamp(&cachedPositionTime);

  // check to see if we can use a cached value
  //
  // either:
  // a) the user has specified a maximumAge which allows us to return a cached value,
  // -or-
  // b) the cached position time is some reasonable value to return to the user (<30s)
  
  PRUint32 maximumAge = 30 * PR_MSEC_PER_SEC;
  if (mOptions) {
    PRInt32 tempAge;
    nsresult rv = mOptions->GetMaximumAge(&tempAge);
    if (NS_SUCCEEDED(rv)) {
      if (tempAge >= 0)
        maximumAge = tempAge;
    }
  }

  if (lastPosition && maximumAge > 0 && ( (PR_Now() / PR_USEC_PER_MSEC ) - maximumAge <= cachedPositionTime) ) {
    // okay, we can return a cached position
    mAllowed = PR_TRUE;
    
    // send the cached location
    SendLocation(lastPosition);
  }

  PRInt32 timeout;
  if (mOptions && NS_SUCCEEDED(mOptions->GetTimeout(&timeout)) && timeout > 0) {
    
    if (timeout < 10)
      timeout = 10;

    mTimeoutTimer = do_CreateInstance("@mozilla.org/timer;1");
    mTimeoutTimer->InitWithCallback(this, timeout, nsITimer::TYPE_ONE_SHOT);
  }

  mAllowed = PR_TRUE;
  return NS_OK;
}
UDPClient::UDPClient(string address, unsigned int port) : Client(address, port)
{
	this->serverAddressInfo = (sockaddr*)CreateAddressInfoForClient();
	_udp_socket = CreateUDPSocket();
	SetReceiveTimeout(this->_udp_socket, GetTimeout(UDP_RECV_TIMEOUT));
	for (auto i = 0; i < PACKAGE_COUNT; i++)
	{
		auto _pair = new pair<fpos_t, char*>();
		_pair->second = new char[UDP_BUFFER_SIZE];
		this->receivedBuffer.push_back(_pair);
	}
}
Example #4
0
/**
 * @function main
 * @brief entry point
 * @param none
 * @return dummy
 */
int32_t main(void) {

  timer_t tmInit;

  UcInit();       /*uc init; shall be the first one*/
  TicksInit();    /*software clock init*/
  LCD_Init();     /*start the ILI932X*/

  /* start a timer; backlight will be turned on once this timer will elapse
   * -> this avoids a white flash*/
  tmInit = GetTimeout(120);

  P2D_Init();
  GUI_Init();
  TouchScreenCalib(NULL);
  TouchScreenEnable();

  /*mount the file system*/
  disk_initialize(0);
  f_mount(0, &Fatfs);

  /* wait the 120ms timeout */
  while(IsTimerElapsed(tmInit) == false) DelayMs(1);
  BacklightInit();

  /*set the main task*/
  pCurrentTask = &SetupTask;

  /*main loop*/
  while(1) {

    /*execute the main task, if any*/
    if(pCurrentTask != NULL) pCurrentTask();

    /*GUI task*/
    GUI_DrawObjects();
    GUI_DBG_Task();

    /*software RTC task*/
    RtcTask();

    /*CPU limiter; reduces the power consumption*/
    DelayMs(1);
  }

  /*never arrive here*/
  return -1;
}
Example #5
0
HRESULT ExecCommon64(
    __in LPCWSTR wzArgumentsProperty,
    __in LPCWSTR wzTimeoutProperty,
    __in BOOL fLogCommand,
    __in BOOL fLogOutput
)
{
    HRESULT hr = S_OK;
    LPWSTR pwzCommand = NULL;
    DWORD dwTimeout = 0;
    BOOL fIsWow64Initialized = FALSE;
    BOOL fRedirected = FALSE;

    hr = WcaInitializeWow64();
    if (S_FALSE == hr)
    {
        hr = TYPE_E_DLLFUNCTIONNOTFOUND;
    }
    ExitOnFailure(hr, "Failed to intialize WOW64.");
    fIsWow64Initialized = TRUE;

    hr = WcaDisableWow64FSRedirection();
    ExitOnFailure(hr, "Failed to enable filesystem redirection.");
    fRedirected = TRUE;

    hr = BuildCommandLine(wzArgumentsProperty, &pwzCommand);
    ExitOnFailure(hr, "Failed to get Command Line");

    dwTimeout = GetTimeout(wzTimeoutProperty);

    hr = QuietExecEx(pwzCommand, dwTimeout, fLogCommand, fLogOutput);
    ExitOnFailure(hr, "QuietExec64 Failed");

LExit:
    ReleaseStr(pwzCommand);

    if (fRedirected)
    {
        WcaRevertWow64FSRedirection();
    }

    if (fIsWow64Initialized)
    {
        WcaFinalizeWow64();
    }

    return hr;
}
Example #6
0
bool
cThreadCond::TimedWait( unsigned int timeout )
{
  struct timespec t;
  GetTimeout( t, timeout );

  int rv = pthread_cond_timedwait( &m_cond, &m_lock, &t );

  if ( rv )
     {
       assert( rv == ETIMEDOUT );
       return false;
     }

  return true;
}
Example #7
0
bool
cThreadLockRw::TimedWriteLock( unsigned int timeout )
{
  struct timespec t;
  GetTimeout( t, timeout );

  int rv = pthread_rwlock_timedwrlock( &m_rwlock, &t );

  if ( rv )
     {
       assert( rv == ETIMEDOUT );
       return false;
     }

  return true;
}
Example #8
0
bool
cThreadLock::TimedLock( unsigned int timeout )
{
  struct timespec t;
  GetTimeout( t, timeout );

  int rv = pthread_mutex_timedlock( &m_lock, &t );

  if ( rv )
     {
       assert( rv == ETIMEDOUT );
       return false;
     }

  return true;
}
void ShopSubmitter::BumpShop(ShopSubmission *submission) {
    QUrlQuery query;
    query.addQueryItem("forum_post", submission->data.value("forum_post").toString());
    query.addQueryItem("content", BUMP_MESSAGE);
    query.addQueryItem("post_submit", "Submit");

    submission->timerId = startTimer(GetTimeout());

    QNetworkRequest request(QUrl(ShopBumpUrl(submission->threadId)));
    request.setAttribute((QNetworkRequest::Attribute) SHOP_DATA_THREAD, submission->threadId);
    request.setHeader(QNetworkRequest::ContentTypeHeader, "application/x-www-form-urlencoded");
    QNetworkReply *submitted = network->post(request, query.query().toUtf8());
    submission->state = SHOP_SUBMISSION_BUMPING;
    submission->currentReply = submitted;
    connect(submitted, SIGNAL(finished()), this, SLOT(OnBumpFinished()));
}
void TCPClient::Reconnect()
{
	auto reconnected = false;
	auto delay = 5;
	while (!reconnected)
	{
		Sleep(GetTimeout(TIMEOUT / delay));
		try {
			Close();
			Init();
			reconnected = true;
			cout << "Reconnected." << endl;
		}
		catch (runtime_error e) {
			if (delay != 1) delay--;
			cout << e.what() << endl;
		}
	}
}
Example #11
0
Server::Server(unsigned int port)
{
	this->port = port;
	
	_udp_socket = CreateUDPSocket();
	CreateTCPSocket();
	Bind(_udp_socket);
	Bind(this->_tcp_socket);
	SetSendTimeout(this->_tcp_socket);
	SetReceiveTimeout(_udp_socket, GetTimeout(100));
	Listen();

	FD_ZERO(&this->clientsSet);
	FD_ZERO(&this->serverSet);
	FD_SET(this->_tcp_socket, &this->serverSet);
	FD_SET(_udp_socket, &this->serverSet);

	std::cout << "Server started at port: " << this->port << std::endl;
}
Example #12
0
int CDBAPI_CacheAdmin::Run(void)
{
    try {
        const CArgs& args = GetArgs();

        int rc = Connect(args);
        if (rc) {
            return rc;
        }

        if (args["m"]) {
            NcbiCout << "Running cache maintanance..." << NcbiEndl;

            unsigned time_out = GetTimeout(args);
            m_Cache.Purge(time_out);
        }

    } catch( CDB_Exception& dbe ) {
        ERR_POST_X(3, dbe.what() << dbe.GetMsg());
                 
    }

    return 0;
}
Example #13
0
HRESULT ExecCommon(
    __in LPCWSTR wzArgumentsProperty,
    __in LPCWSTR wzTimeoutProperty,
    __in BOOL fLogCommand,
    __in BOOL fLogOutput
)
{
    HRESULT hr = S_OK;
    LPWSTR pwzCommand = NULL;
    DWORD dwTimeout = 0;

    hr = BuildCommandLine(wzArgumentsProperty, &pwzCommand);
    ExitOnFailure(hr, "Failed to get Command Line");

    dwTimeout = GetTimeout(wzTimeoutProperty);

    hr = QuietExecEx(pwzCommand, dwTimeout, fLogCommand, fLogOutput);
    ExitOnFailure(hr, "QuietExec Failed");

LExit:
    ReleaseStr(pwzCommand);

    return hr;
}
Example #14
0
TPS_PUBLIC PSHttpResponse *HttpConnection::getResponse(int index, const char *servlet, const char *body) {
    char *host_port;
    char uri[800];
    char *nickname;
    const char *httpprotocol;

    ConnectionInfo *failoverList = GetFailoverList();
    int len = failoverList->ConnectionInfo::GetHostPortListLen(); 
    if (index >= len) {
      index = len - 1; // use the last one
    }
    host_port= (failoverList->GetHostPortList())[index];

    if (IsSSL()) {
        httpprotocol = "https";
    } else {
        httpprotocol = "http";
    }

    PR_snprintf((char *)uri, 800,
      "%s://%s/%s",
      httpprotocol, host_port, servlet);

    RA::Debug("HttpConnection::getResponse", "Send request to host %s servlet %s", host_port, servlet);

    RA::Debug(LL_PER_PDU, "HttpConnection::getResponse", "uri=%s", uri);
    RA::Debug(LL_PER_PDU, "HttpConnection::getResponse", "host_port=%s", host_port);

    char *pPort = NULL;
    char *pPortActual = NULL;


    char hostName[512];

    /*
     * Isolate the host name, account for IPV6 numeric addresses.
     *
     */

    if(host_port)
        strncpy(hostName,host_port,512);

    pPort = hostName;
    while(1)  {
        pPort = strchr(pPort, ':');
        if (pPort) {
            pPortActual = pPort;
            pPort++;
        } else
            break;
    }

    if(pPortActual)
        *pPortActual = '\0';


    /*
    *  Rifle through the values for the host
    */

    PRAddrInfo *ai;
    void *iter;
    PRNetAddr addr;
    int family = PR_AF_INET;

    ai = PR_GetAddrInfoByName(hostName, PR_AF_UNSPEC, PR_AI_ADDRCONFIG);
    if (ai) {
        printf("%s\n", PR_GetCanonNameFromAddrInfo(ai));
        iter = NULL;
        while ((iter = PR_EnumerateAddrInfo(iter, ai, 0, &addr)) != NULL) {
            char buf[512];
            PR_NetAddrToString(&addr, buf, sizeof buf);
            RA::Debug( LL_PER_PDU,
                       "HttpConnection::getResponse: ",
                           "Sending addr -- Msg='%s'\n",
                           buf );
            family = PR_NetAddrFamily(&addr);
            RA::Debug( LL_PER_PDU,
                       "HttpConnection::getResponse: ",
                           "Sending family -- Msg='%d'\n",
                           family );
            break;
        }
        PR_FreeAddrInfo(ai);
        
    }

    PSHttpServer httpserver(host_port, family);
    nickname = GetClientNickname();
    if (IsSSL())
       httpserver.setSSL(PR_TRUE);
    else
       httpserver.setSSL(PR_FALSE);

    PSHttpRequest httprequest(&httpserver, uri, HTTP11, 0);
    if (IsSSL()) {
        httprequest.setSSL(PR_TRUE);
        if (nickname != NULL) {
            httprequest.setCertNickName(nickname);
        } else {
            return NULL;
        }
    } else
        httprequest.setSSL(PR_FALSE);

    httprequest.setMethod("POST");

    if (body != NULL) {
        httprequest.setBody( strlen(body), body);
    }

    httprequest.addHeader( "Content-Type", "application/x-www-form-urlencoded" );
    if (m_headers != NULL) {
        for (int i=0; i<m_headers->Size(); i++) {
            char *name = m_headers->GetNameAt(i);
            httprequest.addHeader(name, m_headers->GetValue(name));
        }
    }

    if (IsKeepAlive())
        httprequest.addHeader( "Connection", "keep-alive" );

    HttpEngine httpEngine;
    return httpEngine.makeRequest(httprequest, httpserver, (PRIntervalTime)GetTimeout(),
      PR_FALSE /*expectChunked*/);
}
Example #15
0
BOOL
ES_TimerEvent::TimeoutExpired()
{
	return GetTimeout() == 0;
}
Example #16
0
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 );
	}