Re: Safe handles and Marshal class
Alex Ivanoff <[email protected]> Wed, 13 Feb 2008 13:54:48 -0600
| Newsgroups | gmane.comp.windows.devel.dotnet.clr |
|---|---|
| Message-ID | <[email protected]> |
Ideally SafeGlobalMemoryHandle class is introduced in the framework and Marshal class (and any other framework class working with native memory) are extended to work with SafeGlobalMemoryHandle. Until then I am going to do something similar to what you suggested. -----Original Message----- From: Discussion of development on the .NET platform using any managed language [mailto:[email protected]] On Behalf Of Peter Ritchie Sent: Wednesday, February 13, 2008 11:52 To: [email protected] Subject: Re: [DOTNET-CLR] Safe handles and Marshal class > 1. You do not need to declare handle, SafeHandle class has protected > member handle. possibly a good optimization; but SafeHandle also has a SetHandle > 2. You are exposing handle publicly which is not good. I'm curious, how do you use a global memory handle without exposing the handle publicly? I was assuming "SafeGlobalMemoryHandle" would used for things like SetClipboardData and DocumentProperties where the typical usage is to pass the handle around--but you want to ensure the handle is freed more deterministically. =================================== This list is hosted by DevelopMentorĀ® http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com