* rndw32.c (slow_gatherer_windowsNT): Use a simple array for the

disk performance structure and increase it to the size required by
W2000.
This commit is contained in:
Werner Koch 2002-07-24 07:42:16 +00:00
parent 160895b8e6
commit 6b50533fe1
2 changed files with 12 additions and 3 deletions

View File

@ -1,3 +1,9 @@
2002-07-02 Werner Koch <wk@gnupg.org>
* rndw32.c (slow_gatherer_windowsNT): Use a simple array for the
disk performance structure and increase it to the size required by
W2000.
2002-06-29 Werner Koch <wk@gnupg.org>
* rndlinux.c: Removed HAVE_LINUX_RANDOM_H conditional because it

View File

@ -318,6 +318,9 @@ gather_random_fast( void (*add)(const void*, size_t, int), int requester )
#define VER_PLATFORM_WIN32_WINDOWS 1
#endif
#define SIZEOF_DISK_PERFORMANCE_STRUCT (6*8+5*4+8*2)
typedef struct {
DWORD dwSize;
DWORD th32ProcessID;
@ -617,7 +620,7 @@ slow_gatherer_windowsNT( void (*add)(const void*, size_t, int), int requester )
/* Get disk I/O statistics for all the hard drives */
for (nDrive = 0;; nDrive++) {
DISK_PERFORMANCE diskPerformance;
char diskPerformance[SIZEOF_DISK_PERFORMANCE_STRUCT];
char szDevice[50];
/* Check whether we can access this device */
@ -630,13 +633,13 @@ slow_gatherer_windowsNT( void (*add)(const void*, size_t, int), int requester )
/* Note: This only works if you have turned on the disk performance
* counters with 'diskperf -y'. These counters are off by default */
if (DeviceIoControl (hDevice, IOCTL_DISK_PERFORMANCE, NULL, 0,
&diskPerformance, sizeof (DISK_PERFORMANCE),
diskPerformance, SIZEOF_DISK_PERFORMANCE_STRUCT,
&dwSize, NULL))
{
if ( debug_me )
log_debug ("rndw32#slow_gatherer_nt: iostats drive %d\n",
nDrive );
(*add) ( &diskPerformance, dwSize, requester );
(*add) (diskPerformance, dwSize, requester );
}
else {
log_info ("NOTE: you should run 'diskperf -y' "