#include once "window9.bi"

Sub Write_StringN (ByVal H As HANDLE, ByRef String_ As USTRING) Export
	Dim iRetBytes As long
	#ifdef UNICODE
		Dim As short b,c
		b=13 : c=10
		If WriteFile(H,*string_,Len(String_)*2,@iRetBytes,0) Then
			If WriteFile(H,@b,2,@iRetBytes,0) Then
				WriteFile(H,@c,2,@iRetBytes,0)
			End If
		End If		
	#else	
		Dim As Byte b,c
		b=13 : c=10
		If WriteFile(H,StrPtr(string_),Len(String_),@iRetBytes,0) Then
			If WriteFile(H,@b,1,@iRetBytes,0) Then
				WriteFile(H,@c,1,@iRetBytes,0)
			End If
		End If		
	#EndIf
End Sub
