Terraria
v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
SafeLocalAllocHandle.cs
Go to the documentation of this file.
1
using
System.Runtime.InteropServices
;
2
3
namespace
Microsoft.Win32.SafeHandles
;
4
5
internal
sealed
class
SafeLocalAllocHandle :
SafeBuffer
6
{
7
public
SafeLocalAllocHandle
()
8
: base(ownsHandle: true)
9
{
10
}
11
12
internal
static
SafeLocalAllocHandle
LocalAlloc
(
int
cb)
13
{
14
SafeLocalAllocHandle
safeLocalAllocHandle =
new
SafeLocalAllocHandle
();
15
safeLocalAllocHandle.SetHandle(
Marshal
.
AllocHGlobal
(cb));
16
safeLocalAllocHandle.Initialize((ulong)cb);
17
return
safeLocalAllocHandle;
18
}
19
20
protected
override
bool
ReleaseHandle
()
21
{
22
Marshal
.
FreeHGlobal
(
handle
);
23
return
true
;
24
}
25
}
Microsoft.Win32.SafeHandles.SafeLocalAllocHandle.SafeLocalAllocHandle
SafeLocalAllocHandle()
Definition
SafeLocalAllocHandle.cs:7
Microsoft.Win32.SafeHandles.SafeLocalAllocHandle.LocalAlloc
static SafeLocalAllocHandle LocalAlloc(int cb)
Definition
SafeLocalAllocHandle.cs:12
Microsoft.Win32.SafeHandles.SafeLocalAllocHandle.ReleaseHandle
override bool ReleaseHandle()
Definition
SafeLocalAllocHandle.cs:20
Microsoft.Win32.SafeHandles.SafeLocalAllocHandle
Definition
SafeLocalAllocHandle.cs:6
System.Runtime.InteropServices.Marshal.FreeHGlobal
static void FreeHGlobal(IntPtr hglobal)
Definition
Marshal.cs:1680
System.Runtime.InteropServices.Marshal.AllocHGlobal
static IntPtr AllocHGlobal(int cb)
Definition
Marshal.cs:625
System.Runtime.InteropServices.Marshal
Definition
Marshal.cs:14
System.Runtime.InteropServices.SafeBuffer
Definition
SafeBuffer.cs:8
System.Runtime.InteropServices.SafeHandle.handle
IntPtr handle
Definition
SafeHandle.cs:8
Microsoft.Win32.SafeHandles
Definition
SafeProcessHandle.cs:3
System.Runtime.InteropServices
Definition
SequenceMarshal.cs:4
source
System.Net.Ping
Microsoft.Win32.SafeHandles
SafeLocalAllocHandle.cs
Generated by
1.10.0