As someone always says: "Read the source, Luke" :)
Those things are arrays!!!!!!!!!!!!!!!!!
(dos.c)
static CHAR CurrentDirectories[NUM_DRIVES][DOS_DIR_LENGTH];
...
RtlZeroMemory(CurrentDirectories, sizeof(CurrentDirectories));
(vga.c)
static BYTE VgaMemory[VGA_NUM_BANKS * VGA_BANK_SIZE];
...
RtlZeroMemory(VgaMemory, sizeof(VgaMemory));
For me it seems valid C that zeroes out the full array. Otherwise you could
say that those:
http://git.reactos.org/?p=reactos.git;a=blob;f=reactos/boot/freeldr/freeldr/
arch/i386/custom.c;hb=0d14bbad2f3554f40979f97fd4d3efc46c20f03c#l87
(and more generally, grep for "ZeroMemory")
are bugs, too? :PPP
H.
-----Message d'origine-----
De : Ros-dev [mailto:ros-dev-bounces@reactos.org] De la part de Jérôme
Gardou
Envoyé : jeudi 16 octobre 2014 12:19
À : ReactOS Development List
Objet : Re: [ros-dev] [ros-diffs] [hbelusca] 64747: [NTVDM]: Zero-fill
memory with RtlZeroMemory (that exists also in NT mode), and use
sizeof(object) instead of sizeof(type_of_object).
RtlZeroMemory(ptr, sizeof(ptr)) is almost always a bug ;-)
Le 16/10/2014 12:19, Hermès BÉLUSCA - MAÏTO a écrit :
De : Ros-dev [mailto:ros-dev-bounces@reactos.org] De
la part de Timo
Kreuzer Envoyé : mercredi 15 octobre 2014 21:11 À :
ros-dev(a)reactos.org Objet : Re: [ros-dev] [ros-diffs] [hbelusca]
64747: [NTVDM]: Zero-fill memory with RtlZeroMemory (that exists also
in NT mode), and use
sizeof(object) instead of sizeof(type_of_object).
Looks like bugs
Can you develop your
point?
Am 15.10.2014 00:46, schrieb hbelusca(a)svn.reactos.org:
Author: hbelusca
Date: Tue Oct 14 22:46:40 2014
New Revision: 64747
URL:
http://svn.reactos.org/svn/reactos?rev=64747&view=rev
Log:
[NTVDM]: Zero-fill memory with RtlZeroMemory (that exists also in NT
mode), and
use sizeof(object) instead of sizeof(type_of_object).
/* Clear the current directory buffer */
- ZeroMemory(CurrentDirectories, sizeof(CurrentDirectories));
+ RtlZeroMemory(CurrentDirectories, sizeof(CurrentDirectories));
@@ -2901,7 +2901,7 @@
WCHAR Buffer[256];
/* Clear the current directory buffer */
- ZeroMemory(CurrentDirectories, sizeof(CurrentDirectories));
+ RtlZeroMemory(CurrentDirectories, sizeof(CurrentDirectories));
@@ -1901,7 +1901,7 @@
VOID VgaClearMemory(VOID)
{
- ZeroMemory(VgaMemory, sizeof(VgaMemory));
+ RtlZeroMemory(VgaMemory, sizeof(VgaMemory));
}
_______________________________________________
Ros-dev mailing list
Ros-dev(a)reactos.org
http://www.reactos.org/mailman/listinfo/ros-dev
_______________________________________________
Ros-dev mailing list
Ros-dev(a)reactos.org
http://www.reactos.org/mailman/listinfo/ros-dev
_______________________________________________
Ros-dev mailing list
Ros-dev(a)reactos.org
http://www.reactos.org/mailman/listinfo/ros-dev