Does Marshal.AllocHGlobal lock the memory it allocates (e.g. GlobalLock)?
Howard Weiss
Howard,
>Does Marshal.AllocHGlobal lock the memory it allocates (e.g. GlobalLock)?
No it doesn't.
Mattias

Signature
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Mattias Sj?gren - 23 Jun 2004 10:30 GMT
I should probably add that is uses LocalAlloc(0, size) internally,
which implies LMEM_FIXED. So the memory doesn't have to be locked.
Mattias

Signature
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.