Whats the import library for ZeroMemory?

Thw win32.hlp file does not list it under quick info


And what is the Buildinc.bat file in my include file for?


Thanx
Posted on 2003-01-18 21:48:08 by IwasTitan
It's RtlZeroMemory and it should be under kernel32.dll.

Cheers,
Jimmy

ps: Check Msdn ;)
Posted on 2003-01-18 21:56:54 by JimmyClif
Why would you want to use RtlZeroMemory, anyway?
:grin:

-Stealth
Posted on 2003-01-18 22:21:27 by Stealth

Why would you want to use RtlZeroMemory, anyway?
:grin:

-Stealth


To zero some memory.

Yes i know you could make your own algo.

RTlZeroMemory gives me an undefined symbol error and i have included the proper lib

According to the quick info button the inc file is base.h

i have no base.inc in my include file.
does anyone else?
Posted on 2003-01-18 22:35:14 by IwasTitan
It is declared in kernel32.inc and kernel32.lib
Posted on 2003-01-18 22:50:05 by roticv
I put this in the Kernel32.inc file

RTlZeroMemory PROTO :DWORD,:DWORD

I get an unresolved external error
Posted on 2003-01-18 22:59:28 by IwasTitan
lol.. it is RtlZeroMemory
Posted on 2003-01-18 23:32:43 by roticv
I found these in the kernel32.dll too:

RtlMoveMemory - seems to be memcpy
RtlFillMemory - seems to be FillMemory

IwasTitan, thiscompiled ok for me:




.386
.model flat, stdcall
option casemap:none

include \masm32\include\kernel32.inc
includelib \masm32\lib\kernel32.lib

.data?

buff1 db 256 dup (?)
buff2 db 256 dup (?)

.code

START:

invoke RtlZeroMemory, ADDR buff1, sizeof buff1

invoke RtlMoveMemory, ADDR buff2, ADDR buff1, sizeof buff2

invoke RtlFillMemory, ADDR buff1, sizeof buff1, 0FFh

invoke ExitProcess, 0

END START

Posted on 2003-01-18 23:38:03 by david

lol.. it is RtlZeroMemory

:grin: I hate when that happens!!
I forgot an 'A' in the end of some API-name once, took me several days to find out was what wrong :)
Posted on 2003-01-18 23:41:15 by david
I've always assumed the "Rtl" bit means "right to left" but aside from overlapping memory copies, I don't see the need to specify direction. /shrug
Posted on 2003-01-19 00:08:23 by iblis

lol.. it is RtlZeroMemory


Yep ..works fine if you use the proper case.

thanx
Posted on 2003-01-19 01:01:33 by IwasTitan

I've always assumed the "Rtl" bit means "right to left" but aside from overlapping memory copies, I don't see the need to specify direction. /shrug


Hmmmmm, my guess is "Run time library".
Posted on 2003-01-19 02:14:23 by ThoughtCriminal
Originally posted by IwasTitan
To zero some memory.

Yes i know you could make your own algo.

It would be far more efficient to code it yourself. Just do some rep stosb or better, rep stosd if it's dword aligned.

-Stealth
Posted on 2003-01-19 16:46:28 by Stealth
i wonder if rep stosb would be more efficient than RtlZeroMemory. too lazy to disassemble kernel32.dll right now, though. but sure, writing your own routines instead of zero+movemory is smarter.
Posted on 2003-01-20 03:40:44 by f0dder


Hmmmmm, my guess is "Run time library".


Doh! Thanks ThoughtCriminal. That never even occured to me.
Posted on 2003-01-20 06:12:35 by iblis
Its probably a right to left run time library. :alright:

Regards,

hutch@movsd.com
Posted on 2003-01-20 07:48:54 by hutch--
I just want to link this to some other discussions of memory copy/zero:
http://www.asmcommunity.net/board/index.php?topic=6465&highlight=memZero

Time left the library to run right. :tongue:
Posted on 2003-01-20 13:21:04 by bitRAKE