Changeset 162 for branches


Ignore:
Timestamp:
Jan 22, 2009, 9:30:43 AM (17 years ago)
Author:
Paul Smedley
Message:

Do not use hrtimer for random data - causes login delays

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/samba-3.0/source/lib/os2ea.c

    r160 r162  
    114114 */
    115115
    116 /* The high resolution timer API provides access to the hardware timer
    117  * running at around 1.1MHz. The amount this changes in a time slice is
    118  * varies randomly due to system events, hardware interrupts etc
    119  */
    120 
    121116void os2_randget(char * buffer, int length)
    122117{
     
    128123
    129124}
    130 
    131 static UCHAR randbyte_hrtimer()
    132 {
    133     QWORD t1, t2;
    134     UCHAR byte;
    135 
    136     DosTmrQueryTime(&t1);
    137     DosSleep(5);
    138     DosTmrQueryTime(&t2);
    139 
    140     byte = (t2.ulLo - t1.ulLo) & 0xFF;
    141     byte ^= (t2.ulLo - t1.ulLo) >> 8;
    142     return byte;
    143 }
    144 
    145 
    146125
    147126/* A bunch of system information like memory & process stats.
     
    229208UCHAR randbyte()
    230209{
    231     return randbyte_hrtimer() ^ randbyte_sysinfo() ^ randbyte_perf();
     210    return randbyte_sysinfo() ^ randbyte_perf();
    232211}
    233212
Note: See TracChangeset for help on using the changeset viewer.