LocalUnlock (Kernel32)
Usage
<DllImport("kernel32.dll", EntryPoint:="LocalUnlock", SetLastError:=True)>
Public Shared Function LocalUnlock(hMem As IntPtr) As IntPtr
End Function
<DllImport("kernel32.dll", EntryPoint:="LocalAlloc", SetLastError:=True)>
Public Shared Function LocalAlloc(uFlags As UInteger, uBytes As Integer) As IntPtr
End Function
Dim pszBuf As IntPtr = Nothing
pszBuf = LocalAlloc(0, 80)
Dim retError As Integer = GetLastError
If pszBuf = Nothing Then
MsgBox("LocalAlloc failed (" + GetLastError + ")")
Exit Sub
End If
Dim ret As Integer = LocalUnlock(pszBuf)