The VS code analyzer throws this warning:
CA2101 Specify marshaling for P/Invoke string arguments To reduce security risk, marshal parameter 'buffer' as Unicode, by setting DllImport.CharSet to CharSet.Unicode, or by explicitly marshaling the parameter as UnmanagedType.LPWStr. If you need to marshal this string as ANSI or system-dependent, specify MarshalAs explicitly, and set BestFitMapping=false; for added security, also set ThrowOnUnmappableChar=true. Reg2Bat CenteredMSGBox.vb 20
Here:
<DllImport("user32.dll")> _
Shared Function GetClassName(hWnd As IntPtr, buffer As System.Text.StringBuilder, buflen As Integer) As Integer
End Function
I need to use the ANSI encoding but I don't understand what I need to do, so how I need to marshall this?