Copies the contents of a managed String into unmanaged memory.
- s (String)
- A managed string to be copied.
The address, in unmanaged memory, to where the s was copied, or 0 if null string was supplied.
StringToHGlobalUni is useful for custom marshaling or for use when mixing managed and unmanaged code.
Since this method allocates the unmanaged memory required for a string, always free the memory by calling FreeHGlobal(IntPtr).
This method provides the opposite functionality of PtrToStringUni(IntPtr).