[Gd-chatter] r11076 - trunk/fundev/sources/win32/win32-registry
andreas at gwydiondylan.org
andreas at gwydiondylan.org
Tue Dec 19 22:44:04 CET 2006
Author: andreas
Date: Tue Dec 19 22:43:54 2006
New Revision: 11076
Modified:
trunk/fundev/sources/win32/win32-registry/regutil.dylan
Log:
job: minor
Instead of assuming that the key is less than 1000 bytes, actually calculate size from input data.
Modified: trunk/fundev/sources/win32/win32-registry/regutil.dylan
==============================================================================
--- trunk/fundev/sources/win32/win32-registry/regutil.dylan (original)
+++ trunk/fundev/sources/win32/win32-registry/regutil.dylan Tue Dec 19 22:43:54 2006
@@ -35,7 +35,7 @@
define method register-item(subkey1 :: <byte-string>, subkey2 :: <byte-string>,
subkey3 :: <byte-string>, value :: <string>)
- let max-key-size = 1000;
+ let max-key-size = reduce1(\+, map(size, list(subkey1, subkey2, subkey3))) + 1;
with-stack-structure( key-buf :: <LPTSTR>, size: max-key-size)
let start-id = append-c-string(key-buf, subkey1 );
let end-id = append-c-string(start-id, subkey2);
@@ -60,7 +60,7 @@
subkey2 :: <byte-string>,
subkey3 :: <byte-string>)
=> (value :: false-or(<string>));
- let max-key-size = 1000;
+ let max-key-size = reduce1(\+, map(size, list(subkey1, subkey2, subkey3))) + 1;
with-stack-structure( key-buf :: <LPTSTR>, size: max-key-size)
with-stack-structure( value-buf :: <LPTSTR>, size: max-key-size)
with-stack-structure( size-ptr :: <PLONG> )
More information about the chatter
mailing list