aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2002-07-24 07:42:16 +0000
committerWerner Koch <[email protected]>2002-07-24 07:42:16 +0000
commit6b50533fe19f747d3ce5442f5a81b5a494d9b1a6 (patch)
tree41ff3972eb1c14786d5cd3edae02bef709a25c99
parentAdd a new readon code for delet key. (diff)
downloadgnupg-6b50533fe19f747d3ce5442f5a81b5a494d9b1a6.tar.gz
gnupg-6b50533fe19f747d3ce5442f5a81b5a494d9b1a6.zip
* rndw32.c (slow_gatherer_windowsNT): Use a simple array for the
disk performance structure and increase it to the size required by W2000.
-rw-r--r--cipher/ChangeLog6
-rw-r--r--cipher/rndw32.c9
2 files changed, 12 insertions, 3 deletions
diff --git a/cipher/ChangeLog b/cipher/ChangeLog
index d62219ede..6e138f4af 100644
--- a/cipher/ChangeLog
+++ b/cipher/ChangeLog
@@ -1,3 +1,9 @@
+2002-07-02 Werner Koch <[email protected]>
+
+ * 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 <[email protected]>
* rndlinux.c: Removed HAVE_LINUX_RANDOM_H conditional because it
diff --git a/cipher/rndw32.c b/cipher/rndw32.c
index 484b11c52..f58d45866 100644
--- a/cipher/rndw32.c
+++ b/cipher/rndw32.c
@@ -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' "