The compiler is right; there is no
"T" in
TStream_WriteBuffer because that function isn't generic. And you can't just change it to...
generic function TStream_WriteBuffer<T>(p: specialize TStream<T>; const Buffer; Count: Integer): Integer; stdcall; external RTLDLL;
...either, because
DLLs don't contain generic templates, they contain machine code. Generics are a compile-time feature, so to provide a generic function in a DLL you'd have to specialize it
for every type that could ever possibly be constructed in advance - which is impossible.
If you want to distribute generic functions, you
must provide source code, period.