Oct
15
2008
Code Review FUN!
Legacy code can be fun!
How many wrongs make a right? The more the merrier?
TOM ANGRY, can you guess why?
Legacy code can be fun!
How many wrongs make a right? The more the merrier?
TOM ANGRY, can you guess why?
Public Function ConvertSDToStringSD(ByVal securityDescriptor() As Byte, ByVal securityInfo As Integer) As String
Dim stringSDLen As Integer
Dim success As Boolean = ConvertSecurityDescriptorToStringSecurityDescriptor(securityDescriptor, 1, securityInfo, pStringSD, stringSDLen)
‘ The following ensures that the memory allocated to pStringSD by the unmanaged
‘ Win32 API is freed.
Try
End If
Return Marshal.PtrToStringAuto(pStringSD, stringSDLen)
Finally
End If
pStringSD = IntPtr.Zero
End Try
End Function